Skip to content

Commit

Permalink
Merge pull request #182 from openbook-dex/default-program-id
Browse files Browse the repository at this point in the history
Add a default `programId` to ts client
  • Loading branch information
binyebarwe authored Oct 24, 2023
2 parents 2a5d4fe + 396b103 commit af8aadf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ts/client/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ export function nameToString(name: number[]): string {
const BooksideSpace = 90944 + 8;
const EventHeapSpace = 91280 + 8;

const OPENBOOK_PROGRAM_ID = new PublicKey(
"opnbkNkqux64GppQhwbyEVc3axhssFhVYuwar8rDHCu"
);

export class OpenBookV2Client {
public program: Program<OpenbookV2>;

Expand All @@ -71,8 +75,8 @@ export class OpenBookV2Client {
private readonly txConfirmationCommitment: Commitment;

constructor(
public programId: PublicKey,
public provider: AnchorProvider,
public programId: PublicKey = OPENBOOK_PROGRAM_ID,
public opts: OpenBookClientOptions = {},
) {
this.program = new Program<OpenbookV2>(IDL, programId, provider);
Expand Down

0 comments on commit af8aadf

Please sign in to comment.