Skip to content
This repository has been archived by the owner on Feb 9, 2025. It is now read-only.

Commit

Permalink
Quadratic Voting: Client support
Browse files Browse the repository at this point in the history
  • Loading branch information
dankelleher committed Dec 23, 2023
1 parent e59572a commit 6805a03
Show file tree
Hide file tree
Showing 5 changed files with 583 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"trailingComma": "all"
},
"dependencies": {
"@project-serum/anchor": "^0.24.2",
"@project-serum/anchor": "^0.25.0",
"@project-serum/serum": "^0.13.61"
}
}
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './nftVoter/client';
export * from './gateway/client';
export * from './realmVoter/client';
export * from './quadraticVoter/client';
23 changes: 23 additions & 0 deletions src/quadraticVoter/client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Program, Provider } from '@project-serum/anchor';
import { PublicKey } from '@solana/web3.js';
import { Quadratic, IDL } from './quadratic';

export const QUADRATIC_PLUGIN_ID = new PublicKey(
'quadCSapU8nTdLg73KHDnmdxKnJQsh7GUbu5tZfnRRr'
);

export class QuadraticClient {
constructor(public program: Program<Quadratic>, public devnet?: boolean) {}

static async connect(
provider: Provider,
devnet?: boolean,
): Promise<QuadraticClient> {
const idl = IDL;

return new QuadraticClient(
new Program<Quadratic>(idl, QUADRATIC_PLUGIN_ID, provider),
devnet,
);
}
}
Loading

0 comments on commit 6805a03

Please sign in to comment.