@solana/spl-governance
Advanced tools
Comparing version 0.0.13 to 0.0.14
@@ -21,3 +21,2 @@ "use strict"; | ||
const constants_1 = require("../registry/constants"); | ||
const moment_1 = __importDefault(require("moment")); | ||
/// Seed prefix for Governance Program PDAs | ||
@@ -196,3 +195,3 @@ exports.GOVERNANCE_PROGRAM_SEED = 'governance'; | ||
args.minCommunityTokensToCreateGovernance; | ||
this.useCommunityVoterWeightAddin = args.useCommunityVoterWeightAddin; | ||
this.useCommunityVoterWeightAddin = !!args.useCommunityVoterWeightAddin; | ||
this.reserved = args.reserved; | ||
@@ -460,3 +459,3 @@ } | ||
var _a, _b; | ||
const now = (0, moment_1.default)().unix(); | ||
const unixTimestampInSeconds = Date.now() / 1000; | ||
return this.isPreVotingState() | ||
@@ -466,3 +465,3 @@ ? governance.config.maxVotingTime | ||
governance.config.maxVotingTime - | ||
now; | ||
unixTimestampInSeconds; | ||
} | ||
@@ -469,0 +468,0 @@ hasVoteTimeEnded(governance) { |
import { PublicKey, TransactionInstruction } from '@solana/web3.js'; | ||
import { Vote } from './instructions'; | ||
export declare const withCastVote: (instructions: TransactionInstruction[], programId: PublicKey, programVersion: number, realm: PublicKey, governance: PublicKey, proposal: PublicKey, proposalOwnerRecord: PublicKey, tokenOwnerRecord: PublicKey, governanceAuthority: PublicKey, governingTokenMint: PublicKey, vote: Vote, payer: PublicKey) => Promise<PublicKey>; | ||
export declare const withCastVote: (instructions: TransactionInstruction[], programId: PublicKey, programVersion: number, realm: PublicKey, governance: PublicKey, proposal: PublicKey, proposalOwnerRecord: PublicKey, tokenOwnerRecord: PublicKey, governanceAuthority: PublicKey, governingTokenMint: PublicKey, vote: Vote, payer: PublicKey, voterWeightRecord?: PublicKey | undefined) => Promise<PublicKey>; | ||
//# sourceMappingURL=withCastVote.d.ts.map |
@@ -20,3 +20,4 @@ "use strict"; | ||
const runtime_1 = require("../tools/sdk/runtime"); | ||
const withCastVote = (instructions, programId, programVersion, realm, governance, proposal, proposalOwnerRecord, tokenOwnerRecord, governanceAuthority, governingTokenMint, vote, payer) => __awaiter(void 0, void 0, void 0, function* () { | ||
const withVoterWeightAccounts_1 = require("./withVoterWeightAccounts"); | ||
const withCastVote = (instructions, programId, programVersion, realm, governance, proposal, proposalOwnerRecord, tokenOwnerRecord, governanceAuthority, governingTokenMint, vote, payer, voterWeightRecord) => __awaiter(void 0, void 0, void 0, function* () { | ||
const args = new instructions_1.CastVoteArgs(programVersion === constants_1.PROGRAM_VERSION_V1 | ||
@@ -89,2 +90,3 @@ ? { yesNoVote: vote.toYesNoVote(), vote: undefined } | ||
]; | ||
(0, withVoterWeightAccounts_1.withVoterWeightAccounts)(keys, programId, realm, voterWeightRecord); | ||
instructions.push(new web3_js_1.TransactionInstruction({ | ||
@@ -91,0 +93,0 @@ keys, |
import { PublicKey, TransactionInstruction } from '@solana/web3.js'; | ||
import { GovernanceConfig } from './accounts'; | ||
export declare const withCreateAccountGovernance: (instructions: TransactionInstruction[], programId: PublicKey, realm: PublicKey, governedAccount: PublicKey, config: GovernanceConfig, tokenOwnerRecord: PublicKey, payer: PublicKey, governanceAuthority: PublicKey) => Promise<{ | ||
export declare const withCreateAccountGovernance: (instructions: TransactionInstruction[], programId: PublicKey, realm: PublicKey, governedAccount: PublicKey, config: GovernanceConfig, tokenOwnerRecord: PublicKey, payer: PublicKey, governanceAuthority: PublicKey, voterWeightRecord?: PublicKey | undefined) => Promise<{ | ||
governanceAddress: PublicKey; | ||
}>; | ||
//# sourceMappingURL=withCreateAccountGovernance.d.ts.map |
@@ -18,3 +18,4 @@ "use strict"; | ||
const runtime_1 = require("../tools/sdk/runtime"); | ||
const withCreateAccountGovernance = (instructions, programId, realm, governedAccount, config, tokenOwnerRecord, payer, governanceAuthority) => __awaiter(void 0, void 0, void 0, function* () { | ||
const withVoterWeightAccounts_1 = require("./withVoterWeightAccounts"); | ||
const withCreateAccountGovernance = (instructions, programId, realm, governedAccount, config, tokenOwnerRecord, payer, governanceAuthority, voterWeightRecord) => __awaiter(void 0, void 0, void 0, function* () { | ||
const args = new instructions_1.CreateAccountGovernanceArgs({ config }); | ||
@@ -69,2 +70,3 @@ const data = Buffer.from((0, borsh_1.serialize)(serialisation_1.GOVERNANCE_SCHEMA, args)); | ||
]; | ||
(0, withVoterWeightAccounts_1.withVoterWeightAccounts)(keys, programId, realm, voterWeightRecord); | ||
instructions.push(new web3_js_1.TransactionInstruction({ | ||
@@ -71,0 +73,0 @@ keys, |
import { PublicKey, TransactionInstruction } from '@solana/web3.js'; | ||
import { GovernanceConfig } from './accounts'; | ||
export declare const withCreateMintGovernance: (instructions: TransactionInstruction[], programId: PublicKey, realm: PublicKey, governedMint: PublicKey, config: GovernanceConfig, transferMintAuthority: boolean, mintAuthority: PublicKey, tokenOwnerRecord: PublicKey, payer: PublicKey, governanceAuthority: PublicKey) => Promise<{ | ||
export declare const withCreateMintGovernance: (instructions: TransactionInstruction[], programId: PublicKey, realm: PublicKey, governedMint: PublicKey, config: GovernanceConfig, transferMintAuthority: boolean, mintAuthority: PublicKey, tokenOwnerRecord: PublicKey, payer: PublicKey, governanceAuthority: PublicKey, voterWeightRecord?: PublicKey | undefined) => Promise<{ | ||
governanceAddress: PublicKey; | ||
}>; | ||
//# sourceMappingURL=withCreateMintGovernance.d.ts.map |
@@ -19,3 +19,4 @@ "use strict"; | ||
const runtime_1 = require("../tools/sdk/runtime"); | ||
const withCreateMintGovernance = (instructions, programId, realm, governedMint, config, transferMintAuthority, mintAuthority, tokenOwnerRecord, payer, governanceAuthority) => __awaiter(void 0, void 0, void 0, function* () { | ||
const withVoterWeightAccounts_1 = require("./withVoterWeightAccounts"); | ||
const withCreateMintGovernance = (instructions, programId, realm, governedMint, config, transferMintAuthority, mintAuthority, tokenOwnerRecord, payer, governanceAuthority, voterWeightRecord) => __awaiter(void 0, void 0, void 0, function* () { | ||
const args = new instructions_1.CreateMintGovernanceArgs({ | ||
@@ -79,2 +80,3 @@ config, | ||
]; | ||
(0, withVoterWeightAccounts_1.withVoterWeightAccounts)(keys, programId, realm, voterWeightRecord); | ||
instructions.push(new web3_js_1.TransactionInstruction({ | ||
@@ -81,0 +83,0 @@ keys, |
import { PublicKey, TransactionInstruction } from '@solana/web3.js'; | ||
import { GovernanceConfig } from './accounts'; | ||
export declare const withCreateProgramGovernance: (instructions: TransactionInstruction[], programId: PublicKey, realm: PublicKey, governedProgram: PublicKey, config: GovernanceConfig, transferUpgradeAuthority: boolean, programUpgradeAuthority: PublicKey, tokenOwnerRecord: PublicKey, payer: PublicKey, governanceAuthority: PublicKey) => Promise<{ | ||
export declare const withCreateProgramGovernance: (instructions: TransactionInstruction[], programId: PublicKey, realm: PublicKey, governedProgram: PublicKey, config: GovernanceConfig, transferUpgradeAuthority: boolean, programUpgradeAuthority: PublicKey, tokenOwnerRecord: PublicKey, payer: PublicKey, governanceAuthority: PublicKey, voterWeightRecord?: PublicKey | undefined) => Promise<{ | ||
governanceAddress: PublicKey; | ||
}>; | ||
//# sourceMappingURL=withCreateProgramGovernance.d.ts.map |
@@ -19,3 +19,4 @@ "use strict"; | ||
const bpfUpgradeableLoader_1 = require("../tools/sdk/bpfUpgradeableLoader"); | ||
const withCreateProgramGovernance = (instructions, programId, realm, governedProgram, config, transferUpgradeAuthority, programUpgradeAuthority, tokenOwnerRecord, payer, governanceAuthority) => __awaiter(void 0, void 0, void 0, function* () { | ||
const withVoterWeightAccounts_1 = require("./withVoterWeightAccounts"); | ||
const withCreateProgramGovernance = (instructions, programId, realm, governedProgram, config, transferUpgradeAuthority, programUpgradeAuthority, tokenOwnerRecord, payer, governanceAuthority, voterWeightRecord) => __awaiter(void 0, void 0, void 0, function* () { | ||
const args = new instructions_1.CreateProgramGovernanceArgs({ | ||
@@ -89,2 +90,3 @@ config, | ||
]; | ||
(0, withVoterWeightAccounts_1.withVoterWeightAccounts)(keys, programId, realm, voterWeightRecord); | ||
instructions.push(new web3_js_1.TransactionInstruction({ | ||
@@ -91,0 +93,0 @@ keys, |
import { PublicKey, TransactionInstruction } from '@solana/web3.js'; | ||
import { VoteType } from './accounts'; | ||
export declare const withCreateProposal: (instructions: TransactionInstruction[], programId: PublicKey, programVersion: number, realm: PublicKey, governance: PublicKey, tokenOwnerRecord: PublicKey, name: string, descriptionLink: string, governingTokenMint: PublicKey, governanceAuthority: PublicKey, proposalIndex: number, voteType: VoteType, options: string[], useDenyOption: boolean, payer: PublicKey) => Promise<PublicKey>; | ||
export declare const withCreateProposal: (instructions: TransactionInstruction[], programId: PublicKey, programVersion: number, realm: PublicKey, governance: PublicKey, tokenOwnerRecord: PublicKey, name: string, descriptionLink: string, governingTokenMint: PublicKey, governanceAuthority: PublicKey, proposalIndex: number, voteType: VoteType, options: string[], useDenyOption: boolean, payer: PublicKey, voterWeightRecord?: PublicKey | undefined) => Promise<PublicKey>; | ||
//# sourceMappingURL=withCreateProposal.d.ts.map |
@@ -20,3 +20,4 @@ "use strict"; | ||
const runtime_1 = require("../tools/sdk/runtime"); | ||
const withCreateProposal = (instructions, programId, programVersion, realm, governance, tokenOwnerRecord, name, descriptionLink, governingTokenMint, governanceAuthority, proposalIndex, voteType, options, useDenyOption, payer) => __awaiter(void 0, void 0, void 0, function* () { | ||
const withVoterWeightAccounts_1 = require("./withVoterWeightAccounts"); | ||
const withCreateProposal = (instructions, programId, programVersion, realm, governance, tokenOwnerRecord, name, descriptionLink, governingTokenMint, governanceAuthority, proposalIndex, voteType, options, useDenyOption, payer, voterWeightRecord) => __awaiter(void 0, void 0, void 0, function* () { | ||
const args = new instructions_1.CreateProposalArgs({ | ||
@@ -95,2 +96,3 @@ name, | ||
]; | ||
(0, withVoterWeightAccounts_1.withVoterWeightAccounts)(keys, programId, realm, voterWeightRecord); | ||
instructions.push(new web3_js_1.TransactionInstruction({ | ||
@@ -97,0 +99,0 @@ keys, |
import { PublicKey, TransactionInstruction } from '@solana/web3.js'; | ||
import { GovernanceConfig } from './accounts'; | ||
export declare const withCreateTokenGovernance: (instructions: TransactionInstruction[], programId: PublicKey, realm: PublicKey, governedToken: PublicKey, config: GovernanceConfig, transferTokenOwner: boolean, tokenOwner: PublicKey, tokenOwnerRecord: PublicKey, payer: PublicKey, governanceAuthority: PublicKey) => Promise<{ | ||
export declare const withCreateTokenGovernance: (instructions: TransactionInstruction[], programId: PublicKey, realm: PublicKey, governedToken: PublicKey, config: GovernanceConfig, transferTokenOwner: boolean, tokenOwner: PublicKey, tokenOwnerRecord: PublicKey, payer: PublicKey, governanceAuthority: PublicKey, voterWeightRecord?: PublicKey | undefined) => Promise<{ | ||
governanceAddress: PublicKey; | ||
}>; | ||
//# sourceMappingURL=withCreateTokenGovernance.d.ts.map |
@@ -19,3 +19,4 @@ "use strict"; | ||
const splToken_1 = require("../tools/sdk/splToken"); | ||
const withCreateTokenGovernance = (instructions, programId, realm, governedToken, config, transferTokenOwner, tokenOwner, tokenOwnerRecord, payer, governanceAuthority) => __awaiter(void 0, void 0, void 0, function* () { | ||
const withVoterWeightAccounts_1 = require("./withVoterWeightAccounts"); | ||
const withCreateTokenGovernance = (instructions, programId, realm, governedToken, config, transferTokenOwner, tokenOwner, tokenOwnerRecord, payer, governanceAuthority, voterWeightRecord) => __awaiter(void 0, void 0, void 0, function* () { | ||
const args = new instructions_1.CreateTokenGovernanceArgs({ | ||
@@ -83,2 +84,3 @@ config, | ||
]; | ||
(0, withVoterWeightAccounts_1.withVoterWeightAccounts)(keys, programId, realm, voterWeightRecord); | ||
instructions.push(new web3_js_1.TransactionInstruction({ | ||
@@ -85,0 +87,0 @@ keys, |
{ | ||
"name": "@solana/spl-governance", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"description": "SPL Governance Client API", | ||
@@ -36,3 +36,2 @@ "author": "Solana Maintainers <maintainers@solana.foundation>", | ||
"bs58": "^4.0.1", | ||
"moment": "^2.29.1", | ||
"superstruct": "^0.15.2" | ||
@@ -51,2 +50,2 @@ }, | ||
} | ||
} | ||
} |
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
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
811115
6
426
11891
- Removedmoment@^2.29.1
- Removedmoment@2.30.1(transitive)