-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Bump * Refactor pyth client * Bump. refactor client
- Loading branch information
Showing
3 changed files
with
14 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,3 @@ | ||
import { AnchorProvider, Wallet } from "@project-serum/anchor"; | ||
import { PublicKey } from "@solana/web3.js"; | ||
import { STAKING_ADDRESS } from "./constants"; | ||
import { StakeConnection } from "./StakeConnection"; | ||
|
||
export class PythClient { | ||
program: { programId: PublicKey }; | ||
cluster: string; | ||
constructor(public stakeConnection: StakeConnection, cluster: string) { | ||
this.cluster = cluster; | ||
this.program = { | ||
programId: STAKING_ADDRESS, | ||
}; | ||
} | ||
static async connect( | ||
provider: AnchorProvider, | ||
cluster: string | ||
): Promise<PythClient> { | ||
// only supports localnet and devnet for now | ||
// TODO: update this to support mainnet when program is deployed | ||
return new PythClient( | ||
await StakeConnection.createStakeConnection( | ||
provider.connection, | ||
provider.wallet as unknown as Wallet, | ||
STAKING_ADDRESS | ||
), | ||
cluster | ||
); | ||
} | ||
} | ||
export const PythClient = StakeConnection; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
afcd195
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
staking-devnet – ./
staking-devnet-git-main-pyth-web.vercel.app
governance-nu.vercel.app
staking-devnet-pyth-web.vercel.app
afcd195
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
staking – ./
staking-git-main-pyth-web.vercel.app
staking.pyth.network
staking-pyth-web.vercel.app
staking-rho-nine.vercel.app