feat: Add support for SPL Governance Voting Operations #188
+454
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces support for SPL Governance program voting operations in the Solana Agent Kit, enabling programmatic management of DAO governance activities.
Features Added:
1. Cast Votes on Active Proposals:
castProposalVote
function for submitting votes on governance proposals.2. Track Voting Power:
trackVotingPower
function to fetch the voting power of a specific token owner in a realm.3. Manage Vote Delegation:
manageVoteDelegation
function to assign or update governance delegates for token owners in a realm.4. Monitor Voting Outcomes:
monitorVotingOutcomes
function to track the current state of a governance proposal.How It Works:
1. Cast Votes:
withCastVote
helper.sendAndConfirmTransaction
.2. Track Voting Power:
TokenOwnerRecord
.3. Manage Vote Delegation:
withSetGovernanceDelegate
helper.sendAndConfirmTransaction
.4. Monitor Voting Outcomes:
getProposal
helper.Voting
,Succeeded
,Defeated
).Linked Issues:
Closes #165
This pull request was created for https://app.gib.work/bounties/5acb3e1e-b316-4c14-a9d5-c6d6a87496fa in an attempt to solve a bounty #165 . Payment for the bounty is immediately sent to the contributor after merge.