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.14 to 0.0.15

2

lib/governance/serialisation.d.ts

@@ -1,5 +0,5 @@

/// <reference types="node" />
import { TransactionInstruction } from '@solana/web3.js';
import { InstructionData, GovernanceAccountClass, GovernanceAccountType } from './accounts';
export declare const serializeInstructionToBase64: (instruction: TransactionInstruction) => string;
export declare const createInstructionData: (instruction: TransactionInstruction) => InstructionData;
export declare const GOVERNANCE_SCHEMA_V1: Map<Function, any>;

@@ -6,0 +6,0 @@ export declare const GOVERNANCE_SCHEMA: Map<Function, any>;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getInstructionDataFromBase64 = exports.GovernanceAccountParser = exports.getGovernanceSchemaForAccount = exports.getGovernanceSchema = exports.GOVERNANCE_SCHEMA = exports.GOVERNANCE_SCHEMA_V1 = exports.serializeInstructionToBase64 = void 0;
exports.getInstructionDataFromBase64 = exports.GovernanceAccountParser = exports.getGovernanceSchemaForAccount = exports.getGovernanceSchema = exports.GOVERNANCE_SCHEMA = exports.GOVERNANCE_SCHEMA_V1 = exports.createInstructionData = exports.serializeInstructionToBase64 = void 0;
const borsh_1 = require("borsh");

@@ -85,3 +85,9 @@ const instructions_1 = require("./instructions");

const serializeInstructionToBase64 = (instruction) => {
let data = new accounts_1.InstructionData({
let data = (0, exports.createInstructionData)(instruction);
return Buffer.from((0, borsh_2.serialize)(exports.GOVERNANCE_SCHEMA, data)).toString('base64');
};
exports.serializeInstructionToBase64 = serializeInstructionToBase64;
// Converts TransactionInstruction to InstructionData format
const createInstructionData = (instruction) => {
return new accounts_1.InstructionData({
programId: instruction.programId,

@@ -95,5 +101,4 @@ data: instruction.data,

});
return Buffer.from((0, borsh_2.serialize)(exports.GOVERNANCE_SCHEMA, data)).toString('base64');
};
exports.serializeInstructionToBase64 = serializeInstructionToBase64;
exports.createInstructionData = createInstructionData;
exports.GOVERNANCE_SCHEMA_V1 = createGovernanceSchema(1);

@@ -100,0 +105,0 @@ exports.GOVERNANCE_SCHEMA = createGovernanceSchema(2);

import { Connection, PublicKey } from '@solana/web3.js';
export declare function getGovernanceProgramVersion(connection: Connection, programId: PublicKey, env: string): Promise<number>;
export declare function getGovernanceProgramVersion(connection: Connection, programId: PublicKey, env?: string): Promise<number>;
//# sourceMappingURL=version.d.ts.map
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, voterWeightRecord?: PublicKey | undefined) => Promise<{
governanceAddress: PublicKey;
}>;
export declare const withCreateAccountGovernance: (instructions: TransactionInstruction[], programId: PublicKey, realm: PublicKey, governedAccount: PublicKey, config: GovernanceConfig, tokenOwnerRecord: PublicKey, payer: PublicKey, governanceAuthority: PublicKey, voterWeightRecord?: PublicKey | undefined) => Promise<PublicKey>;
//# sourceMappingURL=withCreateAccountGovernance.d.ts.map

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

}));
return { governanceAddress };
return governanceAddress;
});
exports.withCreateAccountGovernance = withCreateAccountGovernance;
//# sourceMappingURL=withCreateAccountGovernance.js.map
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, voterWeightRecord?: PublicKey | undefined) => Promise<{
governanceAddress: PublicKey;
}>;
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<PublicKey>;
//# sourceMappingURL=withCreateMintGovernance.d.ts.map

@@ -26,3 +26,3 @@ "use strict";

const data = Buffer.from((0, borsh_1.serialize)(serialisation_1.GOVERNANCE_SCHEMA, args));
const [mintGovernanceAddress] = yield web3_js_1.PublicKey.findProgramAddress([Buffer.from('mint-governance'), realm.toBuffer(), governedMint.toBuffer()], programId);
const [governanceAddress] = yield web3_js_1.PublicKey.findProgramAddress([Buffer.from('mint-governance'), realm.toBuffer(), governedMint.toBuffer()], programId);
const keys = [

@@ -35,3 +35,3 @@ {

{
pubkey: mintGovernanceAddress,
pubkey: governanceAddress,
isWritable: true,

@@ -87,5 +87,5 @@ isSigner: false,

}));
return { governanceAddress: mintGovernanceAddress };
return governanceAddress;
});
exports.withCreateMintGovernance = withCreateMintGovernance;
//# sourceMappingURL=withCreateMintGovernance.js.map
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, voterWeightRecord?: PublicKey | undefined) => Promise<{
governanceAddress: PublicKey;
}>;
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<PublicKey>;
//# sourceMappingURL=withCreateProgramGovernance.d.ts.map

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

}));
return { governanceAddress };
return governanceAddress;
});
exports.withCreateProgramGovernance = withCreateProgramGovernance;
//# sourceMappingURL=withCreateProgramGovernance.js.map
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, voterWeightRecord?: PublicKey | undefined) => Promise<{
governanceAddress: PublicKey;
}>;
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<PublicKey>;
//# sourceMappingURL=withCreateTokenGovernance.d.ts.map

@@ -26,3 +26,3 @@ "use strict";

const data = Buffer.from((0, borsh_1.serialize)(serialisation_1.GOVERNANCE_SCHEMA, args));
const [tokenGovernanceAddress] = yield web3_js_1.PublicKey.findProgramAddress([
const [governanceAddress] = yield web3_js_1.PublicKey.findProgramAddress([
Buffer.from('token-governance'),

@@ -39,3 +39,3 @@ realm.toBuffer(),

{
pubkey: tokenGovernanceAddress,
pubkey: governanceAddress,
isWritable: true,

@@ -91,5 +91,5 @@ isSigner: false,

}));
return { governanceAddress: tokenGovernanceAddress };
return governanceAddress;
});
exports.withCreateTokenGovernance = withCreateTokenGovernance;
//# sourceMappingURL=withCreateTokenGovernance.js.map
{
"name": "@solana/spl-governance",
"version": "0.0.14",
"version": "0.0.15",
"description": "SPL Governance Client API",

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

"jest": "^27.4.7",
"typescript": "^4.5.4"
"typescript": "^4.5.4",
"@solana/spl-token": "0.1.3"
},

@@ -50,2 +51,2 @@ "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

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