@solana/spl-governance
Advanced tools
Comparing version 0.0.31 to 0.0.32
@@ -214,2 +214,3 @@ import { PublicKey } from '@solana/web3.js'; | ||
reserved: Uint8Array; | ||
governanceDelegate: PublicKey | undefined; | ||
}); | ||
@@ -216,0 +217,0 @@ } |
@@ -312,2 +312,3 @@ "use strict"; | ||
this.reserved = args.reserved; | ||
this.governanceDelegate = args.governanceDelegate; | ||
} | ||
@@ -314,0 +315,0 @@ } |
import { Connection, PublicKey } from '@solana/web3.js'; | ||
import { Governance, GovernanceAccount, Proposal, Realm, TokenOwnerRecord, VoteRecord } from './accounts'; | ||
import { Governance, GovernanceAccount, Proposal, Realm, TokenOwnerRecord, VoteRecord, RealmConfigAccount } from './accounts'; | ||
import { MemcmpFilter } from '../core/api'; | ||
import { ProgramAccount } from '../tools/sdk/runtime'; | ||
import { RealmConfigAccount } from '.'; | ||
export declare function getRealm(connection: Connection, realm: PublicKey): Promise<ProgramAccount<Realm>>; | ||
export declare function getRealms(connection: Connection, programId: PublicKey): Promise<ProgramAccount<Realm>[]>; | ||
export declare function getRealmConfig(connection: Connection, realmConfigPk: PublicKey): Promise<ProgramAccount<RealmConfigAccount>>; | ||
export declare function tryGetRealmConfig(connection: Connection, realmConfigPk: PublicKey): Promise<ProgramAccount<RealmConfigAccount> | undefined>; | ||
export declare function tryGetRealmConfig(connection: Connection, programId: PublicKey, realmPk: PublicKey): Promise<ProgramAccount<RealmConfigAccount>>; | ||
export declare function getVoteRecordsByVoter(connection: Connection, programId: PublicKey, voter: PublicKey): Promise<ProgramAccount<VoteRecord>[]>; | ||
export declare function getTokenOwnerRecordForRealm(connection: Connection, programId: PublicKey, realm: PublicKey, governingTokenMint: PublicKey, governingTokenOwner: PublicKey): Promise<ProgramAccount<TokenOwnerRecord>>; | ||
export declare function getTokenOwnerRecord(connection: Connection, tokenOwnerRecordPk: PublicKey): Promise<ProgramAccount<TokenOwnerRecord>>; | ||
/** | ||
@@ -13,0 +12,0 @@ * Returns TokenOwnerRecords for the given token owner (voter) |
@@ -12,7 +12,6 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.tryGetGovernanceAccount = exports.getGovernanceAccount = exports.getGovernanceAccounts = exports.getAllProposals = exports.getProposalsByGovernance = exports.getProposal = exports.getAllGovernances = exports.getGovernance = exports.getAllTokenOwnerRecords = exports.getTokenOwnerRecordsByOwner = exports.getTokenOwnerRecordForRealm = exports.getVoteRecordsByVoter = exports.tryGetRealmConfig = exports.getRealmConfig = exports.getRealms = exports.getRealm = void 0; | ||
exports.tryGetGovernanceAccount = exports.getGovernanceAccount = exports.getGovernanceAccounts = exports.getAllProposals = exports.getProposalsByGovernance = exports.getProposal = exports.getAllGovernances = exports.getGovernance = exports.getAllTokenOwnerRecords = exports.getTokenOwnerRecordsByOwner = exports.getTokenOwnerRecord = exports.getTokenOwnerRecordForRealm = exports.getVoteRecordsByVoter = exports.tryGetRealmConfig = exports.getRealms = exports.getRealm = void 0; | ||
const serialisation_1 = require("./serialisation"); | ||
const accounts_1 = require("./accounts"); | ||
const api_1 = require("../core/api"); | ||
const _1 = require("."); | ||
// Realms | ||
@@ -31,20 +30,11 @@ function getRealm(connection, realm) { | ||
exports.getRealms = getRealms; | ||
function getRealmConfig(connection, realmConfigPk) { | ||
// Realm config | ||
function tryGetRealmConfig(connection, programId, realmPk) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return getGovernanceAccount(connection, realmConfigPk, _1.RealmConfigAccount); | ||
const realmConfigPk = yield (0, accounts_1.getRealmConfigAddress)(programId, realmPk); | ||
return getGovernanceAccount(connection, realmConfigPk, accounts_1.RealmConfigAccount); | ||
}); | ||
} | ||
exports.getRealmConfig = getRealmConfig; | ||
// Realm config | ||
// export async function tryGetRealmConfig(connection: Connection, programId: PublicKey, realm: PublicKey) { | ||
// const realmConfigPk = await getRealmConfigAddress(programId,realm); | ||
// return tryGetGovernanceAccount(connection, realmConfigPk, RealmConfigAccount); | ||
// } | ||
exports.tryGetRealmConfig = tryGetRealmConfig; | ||
// VoteRecords | ||
function tryGetRealmConfig(connection, realmConfigPk) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return tryGetGovernanceAccount(connection, realmConfigPk, _1.RealmConfigAccount); | ||
}); | ||
} | ||
exports.tryGetRealmConfig = tryGetRealmConfig; | ||
function getVoteRecordsByVoter(connection, programId, voter) { | ||
@@ -66,2 +56,8 @@ return __awaiter(this, void 0, void 0, function* () { | ||
exports.getTokenOwnerRecordForRealm = getTokenOwnerRecordForRealm; | ||
function getTokenOwnerRecord(connection, tokenOwnerRecordPk) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return getGovernanceAccount(connection, tokenOwnerRecordPk, accounts_1.TokenOwnerRecord); | ||
}); | ||
} | ||
exports.getTokenOwnerRecord = getTokenOwnerRecord; | ||
/** | ||
@@ -68,0 +64,0 @@ * Returns TokenOwnerRecords for the given token owner (voter) |
@@ -30,2 +30,3 @@ export * from './accounts'; | ||
export * from './withSetRealmAuthority'; | ||
export * from './withSetGovernanceDelegate'; | ||
export * from './withSignOffProposal'; | ||
@@ -32,0 +33,0 @@ export * from './withUpdateProgramMetadata'; |
@@ -42,2 +42,3 @@ "use strict"; | ||
__exportStar(require("./withSetRealmAuthority"), exports); | ||
__exportStar(require("./withSetGovernanceDelegate"), exports); | ||
__exportStar(require("./withSignOffProposal"), exports); | ||
@@ -44,0 +45,0 @@ __exportStar(require("./withUpdateProgramMetadata"), exports); |
@@ -219,2 +219,9 @@ import { PublicKey } from '@solana/web3.js'; | ||
} | ||
export declare class SetGovernanceDelegateArgs { | ||
instruction: GovernanceInstruction; | ||
newGovernanceDelegate: PublicKey | undefined; | ||
constructor(args: { | ||
newGovernanceDelegate: PublicKey | undefined; | ||
}); | ||
} | ||
//# sourceMappingURL=instructions.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CreateNativeTreasuryArgs = exports.UpdateProgramMetadataArgs = exports.CreateTokenOwnerRecordArgs = exports.SetRealmConfigArgs = exports.SetRealmAuthorityArgs = exports.SetRealmAuthorityAction = exports.FlagTransactionErrorArgs = exports.ExecuteTransactionArgs = exports.RemoveTransactionArgs = exports.InsertTransactionArgs = exports.FinalizeVoteArgs = exports.RelinquishVoteArgs = exports.CastVoteArgs = exports.Vote = exports.VoteKind = exports.VoteChoice = exports.YesNoVote = exports.CancelProposalArgs = exports.SignOffProposalArgs = exports.AddSignatoryArgs = exports.CreateProposalArgs = exports.SetGovernanceConfigArgs = exports.CreateTokenGovernanceArgs = exports.CreateMintGovernanceArgs = exports.CreateProgramGovernanceArgs = exports.CreateGovernanceArgs = exports.WithdrawGoverningTokensArgs = exports.DepositGoverningTokensArgs = exports.CreateRealmArgs = exports.GovernanceInstruction = void 0; | ||
exports.SetGovernanceDelegateArgs = exports.CreateNativeTreasuryArgs = exports.UpdateProgramMetadataArgs = exports.CreateTokenOwnerRecordArgs = exports.SetRealmConfigArgs = exports.SetRealmAuthorityArgs = exports.SetRealmAuthorityAction = exports.FlagTransactionErrorArgs = exports.ExecuteTransactionArgs = exports.RemoveTransactionArgs = exports.InsertTransactionArgs = exports.FinalizeVoteArgs = exports.RelinquishVoteArgs = exports.CastVoteArgs = exports.Vote = exports.VoteKind = exports.VoteChoice = exports.YesNoVote = exports.CancelProposalArgs = exports.SignOffProposalArgs = exports.AddSignatoryArgs = exports.CreateProposalArgs = exports.SetGovernanceConfigArgs = exports.CreateTokenGovernanceArgs = exports.CreateMintGovernanceArgs = exports.CreateProgramGovernanceArgs = exports.CreateGovernanceArgs = exports.WithdrawGoverningTokensArgs = exports.DepositGoverningTokensArgs = exports.CreateRealmArgs = exports.GovernanceInstruction = void 0; | ||
var GovernanceInstruction; | ||
@@ -269,2 +269,9 @@ (function (GovernanceInstruction) { | ||
exports.CreateNativeTreasuryArgs = CreateNativeTreasuryArgs; | ||
class SetGovernanceDelegateArgs { | ||
constructor(args) { | ||
this.instruction = GovernanceInstruction.SetGovernanceDelegate; | ||
this.newGovernanceDelegate = args.newGovernanceDelegate; | ||
} | ||
} | ||
exports.SetGovernanceDelegateArgs = SetGovernanceDelegateArgs; | ||
//# sourceMappingURL=instructions.js.map |
@@ -163,2 +163,12 @@ "use strict"; | ||
[ | ||
instructions_1.SetGovernanceDelegateArgs, | ||
{ | ||
kind: 'struct', | ||
fields: [ | ||
['instruction', 'u8'], | ||
['newGovernanceDelegate', { kind: 'option', type: 'pubkey' }], | ||
], | ||
}, | ||
], | ||
[ | ||
instructions_1.CreateGovernanceArgs, | ||
@@ -165,0 +175,0 @@ { |
{ | ||
"name": "@solana/spl-governance", | ||
"version": "0.0.31", | ||
"version": "0.0.32", | ||
"description": "SPL Governance Client API", | ||
@@ -5,0 +5,0 @@ "author": "Solana Maintainers <maintainers@solana.foundation>", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
395770
238
5704