This repository has been archived by the owner on Jan 13, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* voter weight addin * vote weight plugin yarn * playaround wip * fixes * fix version * configuremint * chore: setup DEFAULT_GOVERNANCE_PROGRAM_ID in .env files * chore: rename useVoteRegistry to useVoterStakeRegistryClient * chore: * feat: Configure voter stake registry with default values * feat: crate mint config form * fix: hide V2 options from V1 program UI * feat: add voterWeightAddin to realm config proposal * fix: add voterWeightRecord to sdk api * feat: setup voter stake configure mint instruction Co-authored-by: Sebastian.Bor <[email protected]>
- Loading branch information
1 parent
dd8044b
commit 281aeb3
Showing
39 changed files
with
888 additions
and
84 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
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 |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
"cSpell.words": [ | ||
"Addin", | ||
"Blockhash", | ||
"blockworks", | ||
"Lamport", | ||
"lamports", | ||
"localnet", | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@solana/spl-governance", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"description": "SPL Governance Client API", | ||
"author": "Solana Maintainers <[email protected]>", | ||
"homepage": "https://github.com/solana-labs/oyster/blob/main/packages/governance-sdk/README.md", | ||
|
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
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
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
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
25 changes: 25 additions & 0 deletions
25
packages/governance-sdk/src/governance/withVoterWeightAccounts.ts
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { AccountMeta, PublicKey } from '@solana/web3.js'; | ||
import { getRealmConfigAddress } from './accounts'; | ||
|
||
export async function withVoterWeightAccounts( | ||
keys: AccountMeta[], | ||
programId: PublicKey, | ||
realm: PublicKey, | ||
voterWeightRecord: PublicKey | undefined, | ||
) { | ||
if (!voterWeightRecord) { | ||
return; | ||
} | ||
|
||
const realmConfigAddress = await getRealmConfigAddress(programId, realm); | ||
keys.push({ | ||
pubkey: realmConfigAddress, | ||
isWritable: false, | ||
isSigner: false, | ||
}); | ||
keys.push({ | ||
pubkey: voterWeightRecord, | ||
isWritable: false, | ||
isSigner: false, | ||
}); | ||
} |
Oops, something went wrong.
281aeb3
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: