Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@solana/spl-governance

Package Overview
Dependencies
Maintainers
12
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solana/spl-governance - npm Package Compare versions

Comparing version 0.0.15 to 0.0.16

2

lib/chat/accounts.d.ts

@@ -19,5 +19,7 @@ import { PublicKey } from '@solana/web3.js';

value: string;
isReply: boolean;
constructor(args: {
type: ChatMessageBodyType;
value: string;
isReply?: boolean;
});

@@ -24,0 +26,0 @@ }

@@ -18,4 +18,6 @@ "use strict";

constructor(args) {
var _a;
this.type = args.type;
this.value = args.value;
this.isReply = (_a = args.isReply) !== null && _a !== void 0 ? _a : false;
}

@@ -22,0 +24,0 @@ }

4

lib/chat/api.d.ts
import { Connection, PublicKey } from '@solana/web3.js';
import { ChatMessage } from './accounts';
export declare function getGovernanceChatMessages(connection: Connection, proposal: PublicKey): Promise<import("..").ProgramAccount<ChatMessage>[]>;
export declare function getGovernanceChatMessagesByVoter(connection: Connection, voter: PublicKey): Promise<import("..").ProgramAccount<ChatMessage>[]>;
export declare function getGovernanceChatMessages(connection: Connection, chatProgramId: PublicKey, proposal: PublicKey): Promise<import("..").ProgramAccount<ChatMessage>[]>;
export declare function getGovernanceChatMessagesByVoter(connection: Connection, chatProgramId: PublicKey, voter: PublicKey): Promise<import("..").ProgramAccount<ChatMessage>[]>;
//# sourceMappingURL=api.d.ts.map

@@ -7,10 +7,10 @@ "use strict";

const serialisation_1 = require("./serialisation");
function getGovernanceChatMessages(connection, proposal) {
return (0, api_1.getBorshProgramAccounts)(connection, accounts_1.GOVERNANCE_CHAT_PROGRAM_ID, _ => serialisation_1.GOVERNANCE_CHAT_SCHEMA, accounts_1.ChatMessage, [(0, api_1.pubkeyFilter)(1, proposal)]);
function getGovernanceChatMessages(connection, chatProgramId, proposal) {
return (0, api_1.getBorshProgramAccounts)(connection, chatProgramId, _ => serialisation_1.GOVERNANCE_CHAT_SCHEMA, accounts_1.ChatMessage, [(0, api_1.pubkeyFilter)(1, proposal)]);
}
exports.getGovernanceChatMessages = getGovernanceChatMessages;
function getGovernanceChatMessagesByVoter(connection, voter) {
return (0, api_1.getBorshProgramAccounts)(connection, accounts_1.GOVERNANCE_CHAT_PROGRAM_ID, _ => serialisation_1.GOVERNANCE_CHAT_SCHEMA, accounts_1.ChatMessage, [(0, api_1.pubkeyFilter)(33, voter)]);
function getGovernanceChatMessagesByVoter(connection, chatProgramId, voter) {
return (0, api_1.getBorshProgramAccounts)(connection, chatProgramId, _ => serialisation_1.GOVERNANCE_CHAT_SCHEMA, accounts_1.ChatMessage, [(0, api_1.pubkeyFilter)(33, voter)]);
}
exports.getGovernanceChatMessagesByVoter = getGovernanceChatMessagesByVoter;
//# sourceMappingURL=api.js.map

@@ -15,2 +15,3 @@ "use strict";

['value', 'string'],
['isReply', 'u8'],
],

@@ -17,0 +18,0 @@ },

import { Keypair, PublicKey, TransactionInstruction } from '@solana/web3.js';
import { ChatMessageBody } from './accounts';
export declare function withPostChatMessage(instructions: TransactionInstruction[], signers: Keypair[], governanceProgramId: PublicKey, governance: PublicKey, proposal: PublicKey, tokenOwnerRecord: PublicKey, governanceAuthority: PublicKey, payer: PublicKey, replyTo: PublicKey | undefined, body: ChatMessageBody): Promise<PublicKey>;
export declare function withPostChatMessage(instructions: TransactionInstruction[], signers: Keypair[], chatProgramId: PublicKey, governanceProgramId: PublicKey, realm: PublicKey, governance: PublicKey, proposal: PublicKey, tokenOwnerRecord: PublicKey, governanceAuthority: PublicKey, payer: PublicKey, replyTo: PublicKey | undefined, body: ChatMessageBody, voterWeightRecord?: PublicKey): Promise<PublicKey>;
//# sourceMappingURL=withPostChatMessage.d.ts.map

@@ -17,5 +17,5 @@ "use strict";

const instructions_1 = require("./instructions");
const accounts_1 = require("./accounts");
const runtime_1 = require("../tools/sdk/runtime");
function withPostChatMessage(instructions, signers, governanceProgramId, governance, proposal, tokenOwnerRecord, governanceAuthority, payer, replyTo, body) {
const withVoterWeightAccounts_1 = require("../governance/withVoterWeightAccounts");
function withPostChatMessage(instructions, signers, chatProgramId, governanceProgramId, realm, governance, proposal, tokenOwnerRecord, governanceAuthority, payer, replyTo, body, voterWeightRecord) {
return __awaiter(this, void 0, void 0, function* () {

@@ -35,2 +35,7 @@ const args = new instructions_1.PostChatMessageArgs({

{
pubkey: realm,
isWritable: false,
isSigner: false,
},
{
pubkey: governance,

@@ -78,5 +83,6 @@ isWritable: false,

}
(0, withVoterWeightAccounts_1.withVoterWeightAccounts)(keys, governanceProgramId, realm, voterWeightRecord);
instructions.push(new web3_js_1.TransactionInstruction({
keys,
programId: accounts_1.GOVERNANCE_CHAT_PROGRAM_ID,
programId: chatProgramId,
data,

@@ -83,0 +89,0 @@ }));

import { SendTransactionError } from '../tools/sdk/runtime';
export declare const GovernanceError: Record<number, string>;
export declare const TokenError: Record<number, string>;
export declare const GovernanceToolsError: Record<number, string>;
export declare const GovernanceError: readonly ["Invalid instruction passed to program", "Realm with the given name and governing mints already exists", "Invalid realm", "Invalid Governing Token Mint", "Governing Token Owner must sign transaction", "Governing Token Owner or Delegate must sign transaction", "All votes must be relinquished to withdraw governing tokens", "Invalid Token Owner Record account address", "Invalid GoverningMint for TokenOwnerRecord", "Invalid Realm for TokenOwnerRecord", "Invalid Proposal for ProposalInstruction", "Invalid Signatory account address", "Signatory already signed off", "Signatory must sign", "Invalid Proposal Owner", "Invalid Proposal for VoterRecord", "Invalid GoverningTokenOwner for VoteRecord", "Invalid Governance config: Vote threshold percentage out of range", "Proposal for the given Governance, Governing Token Mint and index already exists", "Token Owner already voted on the Proposal", "Owner doesn't have enough governing tokens to create Proposal", "Invalid State: Can't edit Signatories", "Invalid Proposal state", "Invalid State: Can't edit instructions", "Invalid State: Can't execute instruction", "Can't execute instruction within its hold up time", "Instruction already executed", "Invalid Instruction index", "Instruction hold up time is below the min specified by Governance", "Instruction at the given index for the Proposal already exists", "Invalid State: Can't sign off", "Invalid State: Can't vote", "Invalid State: Can't finalize vote", "Invalid State: Can't cancel Proposal", "Vote already relinquished", "Can't finalize vote. Voting still in progress", "Proposal voting time expired", "Invalid Signatory Mint", "Proposal does not belong to the given Governance", "Proposal does not belong to given Governing Mint", "Current mint authority must sign transaction", "Invalid mint authority", "Mint has no authority", "Invalid Token account owner", "Invalid Mint account owner", "Token Account is not initialized", "Token Account doesn't exist", "Token account data is invalid", "Token mint account data is invalid", "Token Mint account is not initialized", "Token Mint account doesn't exist", "Invalid ProgramData account address", "Invalid ProgramData account Data", "Provided upgrade authority doesn't match current program upgrade authority", "Current program upgrade authority must sign transaction", "Given program is not upgradable", "Invalid token owner", "Current token owner must sign transaction", "Given VoteThresholdPercentageType is not supported", "Given VoteWeightSource is not supported", "Proposal cool off time is not supported", "Governance PDA must sign", "Instruction already flagged with error", "Invalid Realm for Governance", "Invalid Authority for Realm", "Realm has no authority", "Realm authority must sign", "Invalid governing token holding account", "Realm council mint change is not supported", "Not supported mint max vote weight source", "Invalid max vote weight supply fraction", "Owner doesn't have enough governing tokens to create Governance", "Too many outstanding proposals", "All proposals must be finalized to withdraw governing tokens", "Invalid VoterWeightRecord for Realm", "Invalid VoterWeightRecord for GoverningTokenMint", "Invalid VoterWeightRecord for TokenOwner", "VoterWeightRecord expired", "Invalid RealmConfig for Realm", "TokenOwnerRecord already exists", "Governing token deposits not allowed", "Invalid vote choice weight percentage", "Vote type not supported", "Invalid proposal options", "Proposal is not not executable", "Invalid vote", "Cannot execute defeated option"];
export declare const TokenError: readonly ["Lamport balance below rent-exempt threshold", "Insufficient funds", "Invalid Mint", "Account not associated with this Mint", "Owner does not match", "Fixed supply", "Already in use", "Invalid number of provided signers", "Invalid number of required signers", "State is uninitialized", "Instruction does not support native tokens", "Non-native account can only be closed if its balance is zero", "Invalid instruction", "State is invalid for requested operation", "Operation overflowed", "Account does not support specified authority type", "This token mint cannot freeze accounts", "Account is frozen", "The provided decimals value different from the Mint decimals"];
export declare const GovernanceToolsError: readonly ["Account already initialized", "Account doesn't exist", "Invalid account owner", "Invalid Account type"];
export declare function getTransactionErrorMsg(error: SendTransactionError): any;
//# sourceMappingURL=errors.d.ts.map

@@ -0,1 +1,2 @@

/// <reference types="node" />
import { TransactionInstruction } from '@solana/web3.js';

@@ -2,0 +3,0 @@ import { InstructionData, GovernanceAccountClass, GovernanceAccountType } from './accounts';

{
"name": "@solana/spl-governance",
"version": "0.0.15",
"version": "0.0.16",
"description": "SPL Governance Client API",

@@ -46,2 +46,3 @@ "author": "Solana Maintainers <maintainers@solana.foundation>",

"jest": {
"testTimeout": 20000,
"transform": {

@@ -48,0 +49,0 @@ "^.+\\.tsx?$": "esbuild-jest"

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc