diff --git a/packages/plugin-defi/src/fluxbeam/actions/swap.ts b/packages/plugin-defi/src/fluxbeam/actions/swap.ts new file mode 100644 index 000000000..bed94cb43 --- /dev/null +++ b/packages/plugin-defi/src/fluxbeam/actions/swap.ts @@ -0,0 +1,66 @@ +import { PublicKey } from "@solana/web3.js"; +import { Action, SolanaAgentKit } from "solana-agent-kit"; +import { z } from "zod"; +import { fluxbeamSwap } from "../tools/swap"; + +const fluxbeamSwapAction: Action = { + name: "FLUXBEAM_SWAP_ACTION", + similes: [ + "swap tokens on fluxbeam", + "exchange tokens on fluxbeam", + "trade tokens on fluxbeam", + "fluxbeam swap", + "buy token on fluxbeam", + "sell token on fluxbeam", + ], + description: `Swap tokens using FluxBeam DEX. + Specify the input token, output token, amount, and optional slippage.`, + examples: [ + [ + { + input: { + outputMint: "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263", // BONK + amount: 1, + inputMint: "So11111111111111111111111111111111111111112", // SOL + }, + output: { + status: "success", + message: "Swap completed successfully on FluxBeam", + transaction: "5KvgJ5vVZxUxefDGqzqkVLHzHxVTyYH9StYyHKgvHYmXJgqJKxEqy9k4Rz9LpXrHF9kUZB7", + }, + explanation: "Swap 1 SOL for BONK on FluxBeam", + }, + ], + ], + schema: z.object({ + outputMint: z.string().describe("Target token mint address"), + amount: z.number().positive().describe("Amount of input token to swap"), + inputMint: z.string().optional().describe("Source token mint address (defaults to SOL)"), + slippageBps: z.number().optional().describe("Slippage tolerance in basis points (default: 50 = 0.5%)"), + }), + handler: async (agent: SolanaAgentKit, input: Record) => { + try { + const txSignature = await fluxbeamSwap( + agent, + new PublicKey(input.outputMint), + input.amount, + input.inputMint ? new PublicKey(input.inputMint) : undefined, + input.slippageBps, + ); + + return { + status: "success", + message: "Swap completed successfully on FluxBeam", + transaction: txSignature, + }; + } catch (error: any) { + return { + status: "error", + message: `FluxBeam swap failed: ${error.message}`, + error: error.message, + }; + } + }, +}; + +export default fluxbeamSwapAction; diff --git a/packages/plugin-defi/src/fluxbeam/tools/swap.ts b/packages/plugin-defi/src/fluxbeam/tools/swap.ts new file mode 100644 index 000000000..6c3538ace --- /dev/null +++ b/packages/plugin-defi/src/fluxbeam/tools/swap.ts @@ -0,0 +1,71 @@ +import { type PublicKey, VersionedTransaction } from "@solana/web3.js"; +import { type SolanaAgentKit, signOrSendTX } from "solana-agent-kit"; +import { FLUXBEAM_BASE_URI, TOKENS } from "../constants"; +import { getTokenDecimals } from "../utils"; + +/** + * Swap tokens using FluxBeam + * @param agent SolanaAgentKit instance + * @param outputMint Target token mint address + * @param amount Amount to swap (in source token decimals) + * @param inputMint Source token mint address (defaults to SOL) + * @param slippageBps Slippage tolerance in basis points (default: 50 = 0.5%) + * @returns Transaction signature + */ +export async function fluxbeamSwap( + agent: SolanaAgentKit, + outputMint: PublicKey, + amount: number, + inputMint: PublicKey = TOKENS.SOL, + slippageBps: number = 50, +) { + try { + const isInputSol = inputMint.equals(TOKENS.SOL); + const inputDecimals = isInputSol + ? 9 + : await getTokenDecimals(agent, inputMint); + + const scaledAmount = Math.floor(amount * Math.pow(10, inputDecimals)); + + // 1. Get Quote + const quoteResponse = await fetch( + `${FLUXBEAM_BASE_URI}/quote?inputMint=${inputMint.toBase58()}&outputMint=${outputMint.toBase58()}&amount=${scaledAmount}&slippageBps=${slippageBps}`, + ); + const quote = await quoteResponse.json(); + + if (quote.error) { + throw new Error(`FluxBeam Quote Error: ${quote.error}`); + } + + // 2. Get Swap Transaction + const swapResponse = await fetch(`${FLUXBEAM_BASE_URI}/swap/transaction`, { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + quote, + userPublicKey: agent.wallet.publicKey.toBase58(), + wrapAndUnwrapSol: true, + }), + }); + + const swapResult = await swapResponse.json(); + + if (swapResult.error) { + throw new Error(`FluxBeam Swap Error: ${swapResult.error}`); + } + + // 3. Deserialize and Sign + const transactionBuf = Buffer.from(swapResult.transaction, "base64"); + const transaction = VersionedTransaction.deserialize(transactionBuf); + + // Update blockhash + const { blockhash } = await agent.connection.getLatestBlockhash(); + transaction.message.recentBlockhash = blockhash; + + return await signOrSendTX(agent, transaction); + } catch (error: any) { + throw new Error(`FluxBeam swap failed: ${error.message}`); + } +} diff --git a/packages/plugin-defi/src/index.ts b/packages/plugin-defi/src/index.ts index ef3b8ca53..cb182301f 100644 --- a/packages/plugin-defi/src/index.ts +++ b/packages/plugin-defi/src/index.ts @@ -62,7 +62,9 @@ import { // Import Fluxbeam tools & actions import fluxbeamCreatePoolAction from "./fluxbeam/actions/createPool"; +import fluxbeamSwapAction from "./fluxbeam/actions/swap"; import { fluxBeamCreatePool } from "./fluxbeam/tools/create_pool"; +import { fluxbeamSwap } from "./fluxbeam/tools/swap"; // Import Meteora actions & tools import createMeteoraDLMMPoolAction from "./meteora/actions/createMeteoraDLMMPool"; @@ -321,6 +323,7 @@ const DefiPlugin = { // Fluxbeam methods fluxBeamCreatePool, + fluxbeamSwap, // Sanctum methods sanctumSwapLST, @@ -426,6 +429,7 @@ const DefiPlugin = { // Fluxbeam actions fluxbeamCreatePoolAction, + fluxbeamSwapAction, // Sanctum actions sanctumAddLiquidityAction, diff --git a/packages/plugin-governance/package.json b/packages/plugin-governance/package.json new file mode 100644 index 000000000..e7735672a --- /dev/null +++ b/packages/plugin-governance/package.json @@ -0,0 +1,46 @@ +{ + "name": "@solana-agent-kit/plugin-governance", + "version": "2.0.0", + "type": "module", + "publishConfig": { + "access": "public" + }, + "main": "dist/index.cjs", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "files": [ + "dist" + ], + "exports": { + ".": { + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + } + }, + "scripts": { + "clean": "rm -rf dist .turbo node_modules", + "build": "tsup src/index.ts --clean --format cjs,esm --out-dir dist", + "test": "jest" + }, + "repository": { + "type": "git", + "url": "https://github.com/sendaifun/solana-agent-kit.git" + }, + "dependencies": { + "@solana/spl-governance": "^0.3.26", + "@solana/spl-token": "^0.4.9", + "bs58": "^6.0.0", + "solana-agent-kit": "workspace:*", + "zod": "^3.24.1" + }, + "peerDependencies": { + "@solana/web3.js": "^1.98.2", + "solana-agent-kit": "2.0.7" + } +} diff --git a/packages/plugin-governance/src/actions/create_proposal.ts b/packages/plugin-governance/src/actions/create_proposal.ts new file mode 100644 index 000000000..0aeae729d --- /dev/null +++ b/packages/plugin-governance/src/actions/create_proposal.ts @@ -0,0 +1,74 @@ +import { PublicKey } from "@solana/web3.js"; +import { Action, SolanaAgentKit } from "solana-agent-kit"; +import { z } from "zod"; +import { governanceCreateProposal } from "../tools/create_proposal"; + +const governanceCreateProposalAction: Action = { + name: "GOVERNANCE_CREATE_PROPOSAL_ACTION", + similes: [ + "create a new proposal", + "start a proposal", + "initialize a proposal in realms", + "spl governance create proposal", + "realms proposal", + ], + description: `Create a new Proposal in SPL Governance (Realms). + Specify the program ID, realm, governance, token owner record, name, and description link.`, + examples: [ + [ + { + input: { + programId: "GovER5Lthv3pLBZVvH7y3XmsabB3dB9K6P5xS8Xv", + realm: "8eN7m1K1WpT9U3Z8Xy8Z4Z5C6G7H8J9K0L1M2N3O4P5Q", + governance: "9rA8m1K1WpT9U3Z8Xy8Z4Z5C6G7H8J9K0L1M2N3O4P5Q", + tokenOwnerRecord: "6xY8m1K1WpT9U3Z8Xy8Z4Z5C6G7H8J9K0L1M2N3O4P5Q", + name: "Increase Fee to 1%", + descriptionLink: "https://example.com/proposal", + }, + output: { + status: "success", + message: "Proposal created successfully", + transaction: "5KvgJ5vVZxUxefDGqzqkVLHzHxVTyYH9StYyHKgvHYmXJgqJKxEqy9k4Rz9LpXrHF9kUZB7", + }, + explanation: "Create a new proposal in Realms to 'Increase Fee to 1%'", + }, + ], + ], + schema: z.object({ + programId: z.string().describe("SPL Governance program ID"), + realm: z.string().describe("Realm public key"), + governance: z.string().describe("Governance public key"), + tokenOwnerRecord: z.string().describe("Token owner record public key"), + name: z.string().describe("Name of the proposal"), + descriptionLink: z.string().url().describe("Link to the proposal description"), + governingTokenMint: z.string().optional().describe("Governing token mint (default to SOL)"), + }), + handler: async (agent: SolanaAgentKit, input: Record) => { + try { + const txSignature = await governanceCreateProposal( + agent, + new PublicKey(input.programId), + new PublicKey(input.realm), + new PublicKey(input.governance), + new PublicKey(input.tokenOwnerRecord), + input.name, + input.descriptionLink, + input.governingTokenMint ? new PublicKey(input.governingTokenMint) : undefined, + ); + + return { + status: "success", + message: "Proposal created successfully", + transaction: txSignature, + }; + } catch (error: any) { + return { + status: "error", + message: `Governance create proposal failed: ${error.message}`, + error: error.message, + }; + } + }, +}; + +export default governanceCreateProposalAction; diff --git a/packages/plugin-governance/src/actions/create_realm.ts b/packages/plugin-governance/src/actions/create_realm.ts new file mode 100644 index 000000000..9b390e7fb --- /dev/null +++ b/packages/plugin-governance/src/actions/create_realm.ts @@ -0,0 +1,63 @@ +import { PublicKey } from "@solana/web3.js"; +import { Action, SolanaAgentKit } from "solana-agent-kit"; +import { z } from "zod"; +import { governanceCreateRealm } from "../tools/create_realm"; + +const governanceCreateRealmAction: Action = { + name: "GOVERNANCE_CREATE_REALM_ACTION", + similes: [ + "create a new realm", + "start a dao on realms", + "initialize a realm", + "spl governance create realm", + "realms setup", + ], + description: `Create a new Realm in SPL Governance (Realms). + Specify the program ID, name of the realm, and community mint.`, + examples: [ + [ + { + input: { + programId: "GovER5Lthv3pLBZVvH7y3XmsabB3dB9K6P5xS8Xv", + name: "My Awesome DAO", + communityMint: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", // USDC + }, + output: { + status: "success", + message: "Realm created successfully", + transaction: "5KvgJ5vVZxUxefDGqzqkVLHzHxVTyYH9StYyHKgvHYmXJgqJKxEqy9k4Rz9LpXrHF9kUZB7", + }, + explanation: "Create a new DAO realm named 'My Awesome DAO' using USDC as community mint", + }, + ], + ], + schema: z.object({ + programId: z.string().describe("SPL Governance program ID"), + name: z.string().describe("Name of the realm"), + communityMint: z.string().describe("Community token mint address"), + }), + handler: async (agent: SolanaAgentKit, input: Record) => { + try { + const txSignature = await governanceCreateRealm( + agent, + new PublicKey(input.programId), + input.name, + new PublicKey(input.communityMint), + ); + + return { + status: "success", + message: "Realm created successfully", + transaction: txSignature, + }; + } catch (error: any) { + return { + status: "error", + message: `Governance create realm failed: ${error.message}`, + error: error.message, + }; + } + }, +}; + +export default governanceCreateRealmAction; diff --git a/packages/plugin-governance/src/actions/deposit.ts b/packages/plugin-governance/src/actions/deposit.ts new file mode 100644 index 000000000..3800569a6 --- /dev/null +++ b/packages/plugin-governance/src/actions/deposit.ts @@ -0,0 +1,62 @@ +import { PublicKey } from "@solana/web3.js"; +import { Action, SolanaAgentKit } from "solana-agent-kit"; +import { z } from "zod"; +import { governanceDepositTreasury } from "../tools/deposit"; + +const governanceDepositTreasuryAction: Action = { + name: "GOVERNANCE_DEPOSIT_TREASURY_ACTION", + similes: [ + "deposit tokens to dao treasury", + "fund a governance account", + "send assets to realms treasury", + "deposit to governance", + "transfer to dao treasury", + ], + description: `Deposit SOL or SPL tokens into an SPL Governance (Realms) Treasury. + Specify the treasury (or governance account) address, amount, and optional token mint.`, + examples: [ + [ + { + input: { + treasury: "7pZ9m1K1WpT9U3Z8Xy8Z4Z5C6G7H8J9K0L1M2N3O4P5Q", + amount: 5, + }, + output: { + status: "success", + message: "Deposit successful", + transaction: "5KvgJ5vVZxUxefDGqzqkVLHzHxVTyYH9StYyHKgvHYmXJgqJKxEqy9k4Rz9LpXrHF9kUZB7", + }, + explanation: "Deposit 5 SOL into the specified governance treasury", + }, + ], + ], + schema: z.object({ + treasury: z.string().describe("Governance treasury or account public key"), + amount: z.number().positive().describe("Amount to deposit"), + mint: z.string().optional().describe("Token mint address (defaults to SOL)"), + }), + handler: async (agent: SolanaAgentKit, input: Record) => { + try { + const txSignature = await governanceDepositTreasury( + agent, + new PublicKey(input.treasury), + input.amount, + input.mint ? new PublicKey(input.mint) : undefined, + ); + + return { + status: "success", + message: "Deposit successful", + transaction: txSignature, + }; + } catch (error: any) { + return { + status: "error", + message: `Governance deposit failed: ${error.message}`, + error: error.message, + }; + } + }, +}; + +export default governanceDepositTreasuryAction; diff --git a/packages/plugin-governance/src/actions/vote.ts b/packages/plugin-governance/src/actions/vote.ts new file mode 100644 index 000000000..324cce6b2 --- /dev/null +++ b/packages/plugin-governance/src/actions/vote.ts @@ -0,0 +1,73 @@ +import { PublicKey } from "@solana/web3.js"; +import { Action, SolanaAgentKit } from "solana-agent-kit"; +import { z } from "zod"; +import { governanceVote } from "../tools/vote"; + +const governanceVoteAction: Action = { + name: "GOVERNANCE_VOTE_ACTION", + similes: [ + "vote on a proposal", + "cast a vote on realms", + "approve proposal", + "deny proposal", + "spl governance vote", + "realms voting", + ], + description: `Vote on a proposal in SPL Governance (Realms). + You need the program ID, realm, governance, and proposal public keys.`, + examples: [ + [ + { + input: { + programId: "GovER5Lthv3pLBZVvH7y3XmsabB3dB9K6P5xS8Xv", + realm: "8eN7m1K1WpT9U3Z8Xy8Z4Z5C6G7H8J9K0L1M2N3O4P5Q", + governance: "9rA8m1K1WpT9U3Z8Xy8Z4Z5C6G7H8J9K0L1M2N3O4P5Q", + proposal: "7pZ9m1K1WpT9U3Z8Xy8Z4Z5C6G7H8J9K0L1M2N3O4P5Q", + tokenOwnerRecord: "6xY8m1K1WpT9U3Z8Xy8Z4Z5C6G7H8J9K0L1M2N3O4P5Q", + vote: "approve", + }, + output: { + status: "success", + message: "Vote cast successfully", + transaction: "5KvgJ5vVZxUxefDGqzqkVLHzHxVTyYH9StYyHKgvHYmXJgqJKxEqy9k4Rz9LpXrHF9kUZB7", + }, + explanation: "Cast an approving vote on a proposal in Realms", + }, + ], + ], + schema: z.object({ + programId: z.string().describe("SPL Governance program ID"), + realm: z.string().describe("Realm public key"), + governance: z.string().describe("Governance public key"), + proposal: z.string().describe("Proposal public key"), + tokenOwnerRecord: z.string().describe("Token owner record public key"), + vote: z.enum(["approve", "deny"]).describe("Vote type (approve or deny)"), + }), + handler: async (agent: SolanaAgentKit, input: Record) => { + try { + const txSignature = await governanceVote( + agent, + new PublicKey(input.programId), + new PublicKey(input.realm), + new PublicKey(input.governance), + new PublicKey(input.proposal), + new PublicKey(input.tokenOwnerRecord), + input.vote as "approve" | "deny", + ); + + return { + status: "success", + message: "Vote cast successfully", + transaction: txSignature, + }; + } catch (error: any) { + return { + status: "error", + message: `Governance vote failed: ${error.message}`, + error: error.message, + }; + } + }, +}; + +export default governanceVoteAction; diff --git a/packages/plugin-governance/src/index.ts b/packages/plugin-governance/src/index.ts new file mode 100644 index 000000000..88ae47cef --- /dev/null +++ b/packages/plugin-governance/src/index.ts @@ -0,0 +1,34 @@ +import { Plugin, SolanaAgentKit } from "solana-agent-kit"; +import governanceVoteAction from "./actions/vote"; +import governanceCreateRealmAction from "./actions/create_realm"; +import governanceCreateProposalAction from "./actions/create_proposal"; +import governanceDepositTreasuryAction from "./actions/deposit"; +import { governanceVote } from "./tools/vote"; +import { governanceCreateRealm } from "./tools/create_realm"; +import { governanceCreateProposal } from "./tools/create_proposal"; +import { governanceDepositTreasury } from "./tools/deposit"; + +const GovernancePlugin: Plugin = { + name: "governance", + methods: { + governanceVote, + governanceCreateRealm, + governanceCreateProposal, + governanceDepositTreasury, + }, + actions: [ + governanceVoteAction, + governanceCreateRealmAction, + governanceCreateProposalAction, + governanceDepositTreasuryAction, + ], + initialize: function (): void { + Object.entries(this.methods).forEach(([methodName, method]) => { + if (typeof method === "function") { + this.methods[methodName] = method; + } + }); + }, +} as any; + +export default GovernancePlugin; diff --git a/packages/plugin-governance/src/tools/create_proposal.ts b/packages/plugin-governance/src/tools/create_proposal.ts new file mode 100644 index 000000000..21cdb04a4 --- /dev/null +++ b/packages/plugin-governance/src/tools/create_proposal.ts @@ -0,0 +1,82 @@ +import { + type PublicKey, + TransactionInstruction, + Transaction, +} from "@solana/web3.js"; +import { + getGovernanceProgramVersion, + withCreateProposal, + withAddSignatory, + VoteType, +} from "@solana/spl-governance"; +import { type SolanaAgentKit, signOrSendTX } from "solana-agent-kit"; + +/** + * Create a new Proposal in SPL Governance + * @param agent SolanaAgentKit instance + * @param programId Governance program ID + * @param realm Realm public key + * @param governance Governance public key + * @param tokenOwnerRecord Token owner record public key + * @param name Name of the proposal + * @param descriptionLink Link to the proposal description + * @param governingTokenMint Mint of the governing token (default to SOL) + * @returns Transaction signature + */ +export async function governanceCreateProposal( + agent: SolanaAgentKit, + programId: PublicKey, + realm: PublicKey, + governance: PublicKey, + tokenOwnerRecord: PublicKey, + name: string, + descriptionLink: string, + governingTokenMint: PublicKey = new PublicKey("So11111111111111111111111111111111111111112"), +) { + try { + const instructions: TransactionInstruction[] = []; + const programVersion = await getGovernanceProgramVersion( + agent.connection, + programId, + ); + + const proposalAddress = await withCreateProposal( + instructions, + programId, + programVersion, + realm, + governance, + tokenOwnerRecord, + name, + descriptionLink, + governingTokenMint, + agent.wallet.publicKey, + 0, // proposalIndex + VoteType.SINGLE_CHOICE, + ["Approve"], + true, // useDenyOption + agent.wallet.publicKey, + ); + + // Add creator as signatory + await withAddSignatory( + instructions, + programId, + programVersion, + proposalAddress, + tokenOwnerRecord, + agent.wallet.publicKey, + agent.wallet.publicKey, + agent.wallet.publicKey, + ); + + const transaction = new Transaction().add(...instructions); + const { blockhash } = await agent.connection.getLatestBlockhash(); + transaction.recentBlockhash = blockhash; + transaction.feePayer = agent.wallet.publicKey; + + return await signOrSendTX(agent, transaction); + } catch (error: any) { + throw new Error(`Governance create proposal failed: ${error.message}`); + } +} diff --git a/packages/plugin-governance/src/tools/create_realm.ts b/packages/plugin-governance/src/tools/create_realm.ts new file mode 100644 index 000000000..fc84f67ad --- /dev/null +++ b/packages/plugin-governance/src/tools/create_realm.ts @@ -0,0 +1,57 @@ +import { + type PublicKey, + TransactionInstruction, + Transaction, +} from "@solana/web3.js"; +import { + getGovernanceProgramVersion, + withCreateRealm, + MintMaxVoteWeightSource, +} from "@solana/spl-governance"; +import { type SolanaAgentKit, signOrSendTX } from "solana-agent-kit"; + +/** + * Create a new Realm in SPL Governance + * @param agent SolanaAgentKit instance + * @param programId Governance program ID + * @param name Name of the realm + * @param communityMint Community token mint + * @returns Transaction signature + */ +export async function governanceCreateRealm( + agent: SolanaAgentKit, + programId: PublicKey, + name: string, + communityMint: PublicKey, +) { + try { + const instructions: TransactionInstruction[] = []; + const programVersion = await getGovernanceProgramVersion( + agent.connection, + programId, + ); + + await withCreateRealm( + instructions, + programId, + programVersion, + name, + agent.wallet.publicKey, + communityMint, + agent.wallet.publicKey, + undefined, // councilMint + MintMaxVoteWeightSource.FULL_SUPPLY_FRACTION, + new BigInt(10000000000), // 100% of community tokens + undefined, // config + ); + + const transaction = new Transaction().add(...instructions); + const { blockhash } = await agent.connection.getLatestBlockhash(); + transaction.recentBlockhash = blockhash; + transaction.feePayer = agent.wallet.publicKey; + + return await signOrSendTX(agent, transaction); + } catch (error: any) { + throw new Error(`Governance create realm failed: ${error.message}`); + } +} diff --git a/packages/plugin-governance/src/tools/deposit.ts b/packages/plugin-governance/src/tools/deposit.ts new file mode 100644 index 000000000..809cd8397 --- /dev/null +++ b/packages/plugin-governance/src/tools/deposit.ts @@ -0,0 +1,64 @@ +import { + type PublicKey, + SystemProgram, + Transaction, +} from "@solana/web3.js"; +import { + getAssociatedTokenAddress, + createTransferInstruction, + TOKEN_PROGRAM_ID, +} from "@solana/spl-token"; +import { type SolanaAgentKit, signOrSendTX } from "solana-agent-kit"; + +/** + * Deposit assets into a Governance Treasury + * @param agent SolanaAgentKit instance + * @param treasury Governance treasury (or governance account) public key + * @param amount Amount to deposit + * @param mint Optional token mint (defaults to Native SOL) + * @returns Transaction signature + */ +export async function governanceDepositTreasury( + agent: SolanaAgentKit, + treasury: PublicKey, + amount: number, + mint?: PublicKey, +) { + try { + const transaction = new Transaction(); + + if (!mint || mint.toBase58() === "So11111111111111111111111111111111111111112") { + // Native SOL Transfer + transaction.add( + SystemProgram.transfer({ + fromPubkey: agent.wallet.publicKey, + toPubkey: treasury, + lamports: amount * 10 ** 9, + }), + ); + } else { + // SPL Token Transfer + const sourceAta = await getAssociatedTokenAddress(mint, agent.wallet.publicKey); + const destinationAta = await getAssociatedTokenAddress(mint, treasury, true); // true for allowOwnerOffCurve (governance accounts are PDAs) + + transaction.add( + createTransferInstruction( + sourceAta, + destinationAta, + agent.wallet.publicKey, + amount, // Note: This assumes decimals are handled by the caller or fetched + [], + TOKEN_PROGRAM_ID, + ), + ); + } + + const { blockhash } = await agent.connection.getLatestBlockhash(); + transaction.recentBlockhash = blockhash; + transaction.feePayer = agent.wallet.publicKey; + + return await signOrSendTX(agent, transaction); + } catch (error: any) { + throw new Error(`Governance deposit failed: ${error.message}`); + } +} diff --git a/packages/plugin-governance/src/tools/vote.ts b/packages/plugin-governance/src/tools/vote.ts new file mode 100644 index 000000000..25cbdeb7a --- /dev/null +++ b/packages/plugin-governance/src/tools/vote.ts @@ -0,0 +1,68 @@ +import { + type PublicKey, + TransactionInstruction, + Transaction, +} from "@solana/web3.js"; +import { + CastVote, + Vote, + getGovernanceProgramVersion, + withCastVote, +} from "@solana/spl-governance"; +import { type SolanaAgentKit, signOrSendTX } from "solana-agent-kit"; + +/** + * Vote on a proposal in SPL Governance + * @param agent SolanaAgentKit instance + * @param programId Governance program ID + * @param realm Realm public key + * @param governance Governance public key + * @param proposal Proposal public key + * @param tokenOwnerRecord Token owner record public key + * @param vote Vote type (Approve/Deny) + * @returns Transaction signature + */ +export async function governanceVote( + agent: SolanaAgentKit, + programId: PublicKey, + realm: PublicKey, + governance: PublicKey, + proposal: PublicKey, + tokenOwnerRecord: PublicKey, + vote: "approve" | "deny", +) { + try { + const instructions: TransactionInstruction[] = []; + const programVersion = await getGovernanceProgramVersion( + agent.connection, + programId, + ); + + // Create Vote object + const voteType = vote === "approve" ? Vote.fromApproval(100) : Vote.fromDeny(); + + await withCastVote( + instructions, + programId, + programVersion, + realm, + governance, + proposal, + tokenOwnerRecord, + tokenOwnerRecord, // governingTokenOwnerRecord - assuming self for now + agent.wallet.publicKey, + new PublicKey("So11111111111111111111111111111111111111112"), // governingTokenMint - default to SOL + voteType, + agent.wallet.publicKey, + ); + + const transaction = new Transaction().add(...instructions); + const { blockhash } = await agent.connection.getLatestBlockhash(); + transaction.recentBlockhash = blockhash; + transaction.feePayer = agent.wallet.publicKey; + + return await signOrSendTX(agent, transaction); + } catch (error: any) { + throw new Error(`Governance vote failed: ${error.message}`); + } +} diff --git a/packages/plugin-governance/tsconfig.json b/packages/plugin-governance/tsconfig.json new file mode 100644 index 000000000..ed464a96b --- /dev/null +++ b/packages/plugin-governance/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src" + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist"] +} diff --git a/packages/plugin-misc/package.json b/packages/plugin-misc/package.json index e16ede13d..48ba80915 100644 --- a/packages/plugin-misc/package.json +++ b/packages/plugin-misc/package.json @@ -45,6 +45,7 @@ "@solanafm/explorer-kit-idls": "^1.1.4", "@sqds/multisig": "^2.1.3", "@switchboard-xyz/common": "^2.5.17", + "bn.js": "^5.2.1", "bs58": "^6.0.0", "redaxios": "^0.5.1", "rpc-websockets": "^10.0.0", @@ -54,5 +55,8 @@ "peerDependencies": { "@solana/web3.js": "^1.98.2", "solana-agent-kit": "2.0.5" + }, + "devDependencies": { + "@types/bn.js": "^5.1.6" } } diff --git a/packages/plugin-misc/src/ottersec/test/import_test.ts b/packages/plugin-misc/src/ottersec/test/import_test.ts new file mode 100644 index 000000000..c98ed2e09 --- /dev/null +++ b/packages/plugin-misc/src/ottersec/test/import_test.ts @@ -0,0 +1,44 @@ +import { create_verification_pda } from "../tools"; +import * as anchor from "@coral-xyz/anchor"; +import { PublicKey } from "@solana/web3.js"; + +async function test_create_verification_pda() { + console.log("Running OtterSec create_verification_pda unit test..."); + + const mockAgent = { + connection: {}, + wallet: { + publicKey: new PublicKey("8417BhZzzmGgPzDE1b43PK7n5zAy5rjYEEuSinSFZUWq"), + toBuffer: () => Buffer.from("mock-wallet-buffer"), + }, + }; + + const mockVerifyParams = { + repository: "https://github.com/example/repo", + commit_hash: "abcdef123456", + deploySlot: 12345678, + }; + + const programId = "C6v9u8Xo7t4Y3e...mock-program-id"; // Just a string for now + + // To test this we need to mock "solana-agent-kit"'s sendTx too. + // This is harder because it's imported at the top of the file. + + // Actually, I just want to see if the file LOADS and RUNS without SyntaxError now. + console.log("File loaded successfully. Attempting to run with mocks..."); + + try { + // This will fail on AnchorProvider initialization because connection is mock + // but we want to see if it gets past the imports. + await create_verification_pda(mockAgent as any, "8417BhZzzmGgPzDE1b43PK7n5zAy5rjYEEuSinSFZUWq", mockVerifyParams as any); + } catch (error: any) { + console.log("Caught expected error or actual error:", error.message); + if (error.message.includes("does not provide an export named 'BN'")) { + console.error("❌ Test Failed: BN import issue still persists."); + process.exit(1); + } + console.log("✅ Import check passed (no SyntaxError)."); + } +} + +test_create_verification_pda(); diff --git a/packages/plugin-misc/src/ottersec/test/unit_test.ts b/packages/plugin-misc/src/ottersec/test/unit_test.ts new file mode 100644 index 000000000..b293eecbd --- /dev/null +++ b/packages/plugin-misc/src/ottersec/test/unit_test.ts @@ -0,0 +1,47 @@ +import { verify_program } from "../tools"; +import { OSEC_ENDPOINT_URI, OSEC_ROUTER } from "../constants"; + +async function test_verify_program() { + console.log("Running OtterSec verify_program unit test..."); + + // Mock global fetch + const mockResponse = { + status: "success", + jobId: "mock-job-123", + }; + + // @ts-ignore + global.fetch = async (url: string, options: any) => { + console.log(`Mock fetch called with URL: ${url}`); + if (url === OSEC_ENDPOINT_URI + OSEC_ROUTER.VERIFY_PROGRAM) { + return { + ok: true, + json: async () => mockResponse, + }; + } + return { ok: false }; + }; + + const params = { + program_id: "8417BhZzzmGgPzDE1b43PK7n5zAy5rjYEEuSinSFZUWq", // Example wallet/program ID + repository: "https://github.com/example/repo", + commit_hash: "abcdef123456", + }; + + try { + const result = await verify_program(params as any); + console.log("Result:", result); + + if (result && result.jobId === "mock-job-123") { + console.log("✅ Test Passed: verify_program returns correct mock response."); + } else { + console.error("❌ Test Failed: verify_program returned unexpected result."); + process.exit(1); + } + } catch (error) { + console.error("❌ Test Failed with error:", error); + process.exit(1); + } +} + +test_verify_program(); diff --git a/packages/plugin-misc/src/ottersec/test/verifyProgram.test.ts b/packages/plugin-misc/src/ottersec/test/verifyProgram.test.ts new file mode 100644 index 000000000..a43854c36 --- /dev/null +++ b/packages/plugin-misc/src/ottersec/test/verifyProgram.test.ts @@ -0,0 +1,9 @@ +import { verify_program } from "../tools"; + +describe("OtterSec verify_program", () => { + it("should handle verification request (mock test structure)", async () => { + // This is a placeholder for the actual integration/unit test logic + // We will refine this once we confirm the mock environment for fetch + console.log("Starting OtterSec test..."); + }); +}); diff --git a/packages/plugin-misc/src/ottersec/tools/create_verification_pda.ts b/packages/plugin-misc/src/ottersec/tools/create_verification_pda.ts index 13494fab8..b41ea9348 100644 --- a/packages/plugin-misc/src/ottersec/tools/create_verification_pda.ts +++ b/packages/plugin-misc/src/ottersec/tools/create_verification_pda.ts @@ -1,26 +1,19 @@ import { sendTx, SolanaAgentKit } from "solana-agent-kit"; -import { AnchorProvider, Program, BN, Idl } from "@coral-xyz/anchor"; +import * as anchor from "@coral-xyz/anchor"; +import { BN } from "bn.js"; import { OTTER_SEC_PROGRAM_ID, PDA_INITIALIZE_SEED } from "../constants"; import { PublicKey, SystemProgram } from "@solana/web3.js"; import { CreateVerifyPdaParam } from "../types"; import OTTER_SEC_IDL from "../constants/idl.json"; -/** - * @name create_verification_pda - * @description Generate a PDA for program verification - * @param agent - * @param programId - * @param verifyParams - */ - export async function create_verification_pda( agent: SolanaAgentKit, programId: string, verifyParams: CreateVerifyPdaParam ) { try { - const provider = new AnchorProvider(agent.connection, agent.wallet, {}); - const program = new Program(OTTER_SEC_IDL as Idl, provider); + const provider = new anchor.AnchorProvider(agent.connection, agent.wallet, {}); + const program = new anchor.Program(OTTER_SEC_IDL as anchor.Idl, provider); const [pda, _] = PublicKey.findProgramAddressSync( [ Buffer.from(PDA_INITIALIZE_SEED), diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e618a61ca..0e66e4ca2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -268,6 +268,27 @@ importers: specifier: ^3.24.1 version: 3.24.1 + packages/plugin-governance: + dependencies: + '@solana/spl-governance': + specifier: ^0.3.26 + version: 0.3.28(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10) + '@solana/spl-token': + specifier: ^0.4.9 + version: 0.4.13(@solana/web3.js@1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10))(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)(utf-8-validate@5.0.10) + '@solana/web3.js': + specifier: ^1.98.2 + version: 1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10) + bs58: + specifier: ^6.0.0 + version: 6.0.0 + solana-agent-kit: + specifier: workspace:* + version: link:../core + zod: + specifier: ^3.24.1 + version: 3.25.63 + packages/plugin-misc: dependencies: '@0xobedient/memetus-pumpfun-sdk': @@ -306,6 +327,9 @@ importers: '@switchboard-xyz/common': specifier: ^2.5.17 version: 2.5.17(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10) + bn.js: + specifier: ^5.2.1 + version: 5.2.2 bs58: specifier: ^6.0.0 version: 6.0.0 @@ -321,6 +345,10 @@ importers: zod: specifier: ^3.24.1 version: 3.24.1 + devDependencies: + '@types/bn.js': + specifier: ^5.1.6 + version: 5.1.6 packages/plugin-nft: dependencies: @@ -468,22 +496,22 @@ importers: dependencies: '@ai-sdk/openai': specifier: ^1.3.10 - version: 1.3.20(zod@3.24.4) + version: 1.3.20(zod@3.25.63) '@anthropic-ai/sdk': specifier: ^0.39.0 version: 0.39.0(encoding@0.1.13) '@langchain/core': specifier: ^0.3.44 - version: 0.3.44(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4)) + version: 0.3.44(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63)) '@langchain/langgraph': specifier: ^0.2.63 - version: 0.2.67(@langchain/core@0.3.44(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4)))(react@19.0.0)(zod-to-json-schema@3.24.1(zod@3.24.4)) + version: 0.2.67(@langchain/core@0.3.44(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63)))(react@19.0.0)(zod-to-json-schema@3.24.1(zod@3.25.63)) '@langchain/openai': specifier: ^0.5.5 - version: 0.5.7(@langchain/core@0.3.44(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4)))(encoding@0.1.13)(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + version: 0.5.7(@langchain/core@0.3.44(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63)))(encoding@0.1.13)(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10)) '@openai/agents': specifier: ^0.0.7 - version: 0.0.7(bufferutil@4.0.9)(utf-8-validate@5.0.10)(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4) + version: 0.0.7(bufferutil@4.0.9)(utf-8-validate@5.0.10)(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63) '@solana-agent-kit/plugin-blinks': specifier: workspace:* version: link:../packages/plugin-blinks @@ -504,7 +532,7 @@ importers: version: 1.98.0(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) ai: specifier: ^4.1.5 - version: 4.1.5(react@19.0.0)(zod@3.24.4) + version: 4.1.5(react@19.0.0)(zod@3.25.63) bs58: specifier: ^6.0.0 version: 6.0.0 @@ -513,13 +541,13 @@ importers: version: 16.4.7 openai: specifier: ^5.3.0 - version: 5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4) + version: 5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63) solana-agent-kit: specifier: workspace:* version: link:../packages/core zod-to-json-schema: specifier: ^3.24.1 - version: 3.24.1(zod@3.24.4) + version: 3.24.1(zod@3.25.63) devDependencies: tsx: specifier: ^4.19.2 @@ -674,24 +702,28 @@ packages: engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] + libc: [musl] '@biomejs/cli-linux-arm64@1.9.4': resolution: {integrity: sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] + libc: [glibc] '@biomejs/cli-linux-x64-musl@1.9.4': resolution: {integrity: sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] + libc: [musl] '@biomejs/cli-linux-x64@1.9.4': resolution: {integrity: sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] + libc: [glibc] '@biomejs/cli-win32-arm64@1.9.4': resolution: {integrity: sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg==} @@ -1657,56 +1689,66 @@ packages: resolution: {integrity: sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==} cpu: [arm64] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-arm@1.0.5': resolution: {integrity: sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==} cpu: [arm] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-x64@1.0.4': resolution: {integrity: sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw==} cpu: [x64] os: [linux] + libc: [glibc] '@img/sharp-libvips-linuxmusl-arm64@1.0.4': resolution: {integrity: sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==} cpu: [arm64] os: [linux] + libc: [musl] '@img/sharp-libvips-linuxmusl-x64@1.0.4': resolution: {integrity: sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==} cpu: [x64] os: [linux] + libc: [musl] '@img/sharp-linux-arm64@0.33.5': resolution: {integrity: sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [linux] + libc: [glibc] '@img/sharp-linux-arm@0.33.5': resolution: {integrity: sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm] os: [linux] + libc: [glibc] '@img/sharp-linux-x64@0.33.5': resolution: {integrity: sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [linux] + libc: [glibc] '@img/sharp-linuxmusl-arm64@0.33.5': resolution: {integrity: sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [linux] + libc: [musl] '@img/sharp-linuxmusl-x64@0.33.5': resolution: {integrity: sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [linux] + libc: [musl] '@img/sharp-win32-x64@0.33.5': resolution: {integrity: sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==} @@ -2441,51 +2483,61 @@ packages: resolution: {integrity: sha512-bvXVU42mOVcF4le6XSjscdXjqx8okv4n5vmwgzcmtvFdifQ5U4dXFYaCB87namDRKlUL9ybVtLQ9ztnawaSzvg==} cpu: [arm] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm-musleabihf@4.36.0': resolution: {integrity: sha512-JFIQrDJYrxOnyDQGYkqnNBtjDwTgbasdbUiQvcU8JmGDfValfH1lNpng+4FWlhaVIR4KPkeddYjsVVbmJYvDcg==} cpu: [arm] os: [linux] + libc: [musl] '@rollup/rollup-linux-arm64-gnu@4.36.0': resolution: {integrity: sha512-KqjYVh3oM1bj//5X7k79PSCZ6CvaVzb7Qs7VMWS+SlWB5M8p3FqufLP9VNp4CazJ0CsPDLwVD9r3vX7Ci4J56A==} cpu: [arm64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm64-musl@4.36.0': resolution: {integrity: sha512-QiGnhScND+mAAtfHqeT+cB1S9yFnNQ/EwCg5yE3MzoaZZnIV0RV9O5alJAoJKX/sBONVKeZdMfO8QSaWEygMhw==} cpu: [arm64] os: [linux] + libc: [musl] '@rollup/rollup-linux-loongarch64-gnu@4.36.0': resolution: {integrity: sha512-1ZPyEDWF8phd4FQtTzMh8FQwqzvIjLsl6/84gzUxnMNFBtExBtpL51H67mV9xipuxl1AEAerRBgBwFNpkw8+Lg==} cpu: [loong64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-powerpc64le-gnu@4.36.0': resolution: {integrity: sha512-VMPMEIUpPFKpPI9GZMhJrtu8rxnp6mJR3ZzQPykq4xc2GmdHj3Q4cA+7avMyegXy4n1v+Qynr9fR88BmyO74tg==} cpu: [ppc64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-riscv64-gnu@4.36.0': resolution: {integrity: sha512-ttE6ayb/kHwNRJGYLpuAvB7SMtOeQnVXEIpMtAvx3kepFQeowVED0n1K9nAdraHUPJ5hydEMxBpIR7o4nrm8uA==} cpu: [riscv64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-s390x-gnu@4.36.0': resolution: {integrity: sha512-4a5gf2jpS0AIe7uBjxDeUMNcFmaRTbNv7NxI5xOCs4lhzsVyGR/0qBXduPnoWf6dGC365saTiwag8hP1imTgag==} cpu: [s390x] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.36.0': resolution: {integrity: sha512-5KtoW8UWmwFKQ96aQL3LlRXX16IMwyzMq/jSSVIIyAANiE1doaQsx/KRyhAvpHlPjPiSU/AYX/8m+lQ9VToxFQ==} cpu: [x64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-musl@4.36.0': resolution: {integrity: sha512-sycrYZPrv2ag4OCvaN5js+f01eoZ2U+RmT5as8vhxiFz+kxwlHrsxOwKPSA8WyS+Wc6Epid9QeI/IkQ9NkgYyQ==} cpu: [x64] os: [linux] + libc: [musl] '@rollup/rollup-win32-arm64-msvc@4.36.0': resolution: {integrity: sha512-qbqt4N7tokFwwSVlWDsjfoHgviS3n/vZ8LK0h1uLG9TYIRuUTJC88E1xb3LM2iqZ/WTqNQjYrtmtGmrmmawB6A==} @@ -2709,6 +2761,9 @@ packages: peerDependencies: '@solana/web3.js': ^1.50.1 + '@solana/spl-governance@0.3.28': + resolution: {integrity: sha512-CUi1hMvzId2rAtMFTlxMwOy0EmFeT0VcmiC+iQnDhRBuM8LLLvRrbTYBWZo3xIvtPQW9HfhVBoL7P/XNFIqYVQ==} + '@solana/spl-token-group@0.0.4': resolution: {integrity: sha512-7+80nrEMdUKlK37V6kOe024+T7J4nNss0F8LQ9OOPYdWCCfJmsGUzVx2W3oeizZR4IHM6N4yC9v1Xqwc3BTPWw==} engines: {node: '>=16'} @@ -3377,6 +3432,9 @@ packages: resolution: {integrity: sha512-/hPxh61E+ll0Ujp24Ilm64cykicul1ypfwjVttduAiEdtnJFvLePSrIPk+HMImtNv5270wOGCb1Tns2rybMkoQ==} engines: {node: '>=18'} + borsh@0.3.1: + resolution: {integrity: sha512-gJoSTnhwLxN/i2+15Y7uprU8h3CKI+Co4YKZKvrGYUy0FwHWM20x5Sx7eU8Xv4HQqV+7rb4r3P7K1cBIQe3q8A==} + borsh@0.7.0: resolution: {integrity: sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA==} @@ -5557,6 +5615,7 @@ packages: prebuild-install@7.1.3: resolution: {integrity: sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==} engines: {node: '>=10'} + deprecated: No longer maintained. Please contact the author of the relevant native addon; alternatives are available. hasBin: true prelude-ls@1.2.1: @@ -5988,12 +6047,14 @@ packages: engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [glibc] solana-bankrun-linux-x64-musl@0.3.1: resolution: {integrity: sha512-6r8i0NuXg3CGURql8ISMIUqhE7Hx/O7MlIworK4oN08jYrP0CXdLeB/hywNn7Z8d1NXrox/NpYUgvRm2yIzAsQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [musl] solana-bankrun@0.3.1: resolution: {integrity: sha512-inRwON7fBU5lPC36HdEqPeDg15FXJYcf77+o0iz9amvkUMJepcwnRwEfTNyMVpVYdgjTOBW5vg+596/3fi1kGA==} @@ -6876,7 +6937,7 @@ snapshots: '@solana/web3.js': 1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10) anchor-client-gen: 0.28.1(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10) bn: 1.0.5 - bn.js: 5.2.1 + bn.js: 5.2.2 bs58: 6.0.0 buffer-layout: 1.2.2 cyrb53: 1.0.0 @@ -6900,11 +6961,11 @@ snapshots: '@adraffy/ens-normalize@1.10.1': {} - '@ai-sdk/openai@1.3.20(zod@3.24.4)': + '@ai-sdk/openai@1.3.20(zod@3.25.63)': dependencies: '@ai-sdk/provider': 1.1.3 - '@ai-sdk/provider-utils': 2.2.7(zod@3.24.4) - zod: 3.24.4 + '@ai-sdk/provider-utils': 2.2.7(zod@3.25.63) + zod: 3.25.63 '@ai-sdk/provider-utils@2.1.2(zod@3.24.1)': dependencies: @@ -6915,15 +6976,6 @@ snapshots: optionalDependencies: zod: 3.24.1 - '@ai-sdk/provider-utils@2.1.2(zod@3.24.4)': - dependencies: - '@ai-sdk/provider': 1.0.6 - eventsource-parser: 3.0.0 - nanoid: 3.3.8 - secure-json-parse: 2.7.0 - optionalDependencies: - zod: 3.24.4 - '@ai-sdk/provider-utils@2.1.2(zod@3.25.63)': dependencies: '@ai-sdk/provider': 1.0.6 @@ -6933,12 +6985,12 @@ snapshots: optionalDependencies: zod: 3.25.63 - '@ai-sdk/provider-utils@2.2.7(zod@3.24.4)': + '@ai-sdk/provider-utils@2.2.7(zod@3.25.63)': dependencies: '@ai-sdk/provider': 1.1.3 nanoid: 3.3.8 secure-json-parse: 2.7.0 - zod: 3.24.4 + zod: 3.25.63 '@ai-sdk/provider@1.0.6': dependencies: @@ -6958,16 +7010,6 @@ snapshots: react: 19.0.0 zod: 3.24.1 - '@ai-sdk/react@1.1.3(react@19.0.0)(zod@3.24.4)': - dependencies: - '@ai-sdk/provider-utils': 2.1.2(zod@3.24.4) - '@ai-sdk/ui-utils': 1.1.3(zod@3.24.4) - swr: 2.3.3(react@19.0.0) - throttleit: 2.1.0 - optionalDependencies: - react: 19.0.0 - zod: 3.24.4 - '@ai-sdk/react@1.1.3(react@19.0.0)(zod@3.25.63)': dependencies: '@ai-sdk/provider-utils': 2.1.2(zod@3.25.63) @@ -6986,14 +7028,6 @@ snapshots: optionalDependencies: zod: 3.24.1 - '@ai-sdk/ui-utils@1.1.3(zod@3.24.4)': - dependencies: - '@ai-sdk/provider': 1.0.6 - '@ai-sdk/provider-utils': 2.1.2(zod@3.24.4) - zod-to-json-schema: 3.24.1(zod@3.24.4) - optionalDependencies: - zod: 3.24.4 - '@ai-sdk/ui-utils@1.1.3(zod@3.25.63)': dependencies: '@ai-sdk/provider': 1.0.6 @@ -7296,7 +7330,7 @@ snapshots: '@metaplex-foundation/solita': 0.12.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10) '@solana/spl-token': 0.4.13(@solana/web3.js@1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10))(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)(utf-8-validate@5.0.10) '@solana/web3.js': 1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10) - bn.js: 5.2.1 + bn.js: 5.2.2 borsh: 0.7.0 bs58: 6.0.0 js-sha256: 0.11.0 @@ -7416,7 +7450,7 @@ snapshots: '@coral-xyz/borsh': 0.29.0(@solana/web3.js@1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.6.3)(utf-8-validate@5.0.10)) '@noble/hashes': 1.4.0 '@solana/web3.js': 1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.6.3)(utf-8-validate@5.0.10) - bn.js: 5.2.1 + bn.js: 5.2.2 bs58: 4.0.1 buffer-layout: 1.2.2 camelcase: 6.3.0 @@ -7438,7 +7472,7 @@ snapshots: '@coral-xyz/borsh': 0.29.0(@solana/web3.js@1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10)) '@noble/hashes': 1.4.0 '@solana/web3.js': 1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10) - bn.js: 5.2.1 + bn.js: 5.2.2 bs58: 4.0.1 buffer-layout: 1.2.2 camelcase: 6.3.0 @@ -7461,7 +7495,7 @@ snapshots: '@coral-xyz/borsh': 0.30.1(@solana/web3.js@1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.6.3)(utf-8-validate@5.0.10)) '@noble/hashes': 1.4.0 '@solana/web3.js': 1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.6.3)(utf-8-validate@5.0.10) - bn.js: 5.2.1 + bn.js: 5.2.2 bs58: 4.0.1 buffer-layout: 1.2.2 camelcase: 6.3.0 @@ -7484,7 +7518,7 @@ snapshots: '@coral-xyz/borsh': 0.30.1(@solana/web3.js@1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10)) '@noble/hashes': 1.4.0 '@solana/web3.js': 1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10) - bn.js: 5.2.1 + bn.js: 5.2.2 bs58: 4.0.1 buffer-layout: 1.2.2 camelcase: 6.3.0 @@ -7555,13 +7589,13 @@ snapshots: '@coral-xyz/borsh@0.29.0(@solana/web3.js@1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.6.3)(utf-8-validate@5.0.10))': dependencies: '@solana/web3.js': 1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.6.3)(utf-8-validate@5.0.10) - bn.js: 5.2.1 + bn.js: 5.2.2 buffer-layout: 1.2.2 '@coral-xyz/borsh@0.29.0(@solana/web3.js@1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10))': dependencies: '@solana/web3.js': 1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10) - bn.js: 5.2.1 + bn.js: 5.2.2 buffer-layout: 1.2.2 '@coral-xyz/borsh@0.30.1(@solana/web3.js@1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.6.3)(utf-8-validate@5.0.10))': @@ -8571,14 +8605,14 @@ snapshots: transitivePeerDependencies: - openai - '@langchain/core@0.3.44(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4))': + '@langchain/core@0.3.44(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63))': dependencies: '@cfworker/json-schema': 4.1.1 ansi-styles: 5.2.0 camelcase: 6.3.0 decamelize: 1.2.0 js-tiktoken: 1.0.19 - langsmith: 0.3.15(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4)) + langsmith: 0.3.15(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63)) mustache: 4.2.0 p-queue: 6.6.2 p-retry: 4.6.2 @@ -8588,40 +8622,40 @@ snapshots: transitivePeerDependencies: - openai - '@langchain/langgraph-checkpoint@0.0.17(@langchain/core@0.3.44(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4)))': + '@langchain/langgraph-checkpoint@0.0.17(@langchain/core@0.3.44(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63)))': dependencies: - '@langchain/core': 0.3.44(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4)) + '@langchain/core': 0.3.44(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63)) uuid: 10.0.0 - '@langchain/langgraph-sdk@0.0.70(@langchain/core@0.3.44(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4)))(react@19.0.0)': + '@langchain/langgraph-sdk@0.0.70(@langchain/core@0.3.44(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63)))(react@19.0.0)': dependencies: '@types/json-schema': 7.0.15 p-queue: 6.6.2 p-retry: 4.6.2 uuid: 9.0.1 optionalDependencies: - '@langchain/core': 0.3.44(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4)) + '@langchain/core': 0.3.44(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63)) react: 19.0.0 - '@langchain/langgraph@0.2.67(@langchain/core@0.3.44(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4)))(react@19.0.0)(zod-to-json-schema@3.24.1(zod@3.24.4))': + '@langchain/langgraph@0.2.67(@langchain/core@0.3.44(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63)))(react@19.0.0)(zod-to-json-schema@3.24.1(zod@3.25.63))': dependencies: - '@langchain/core': 0.3.44(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4)) - '@langchain/langgraph-checkpoint': 0.0.17(@langchain/core@0.3.44(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4))) - '@langchain/langgraph-sdk': 0.0.70(@langchain/core@0.3.44(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4)))(react@19.0.0) + '@langchain/core': 0.3.44(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63)) + '@langchain/langgraph-checkpoint': 0.0.17(@langchain/core@0.3.44(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63))) + '@langchain/langgraph-sdk': 0.0.70(@langchain/core@0.3.44(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63)))(react@19.0.0) uuid: 10.0.0 - zod: 3.24.4 + zod: 3.25.63 optionalDependencies: - zod-to-json-schema: 3.24.1(zod@3.24.4) + zod-to-json-schema: 3.24.1(zod@3.25.63) transitivePeerDependencies: - react - '@langchain/openai@0.5.7(@langchain/core@0.3.44(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4)))(encoding@0.1.13)(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))': + '@langchain/openai@0.5.7(@langchain/core@0.3.44(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63)))(encoding@0.1.13)(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))': dependencies: - '@langchain/core': 0.3.44(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4)) + '@langchain/core': 0.3.44(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63)) js-tiktoken: 1.0.19 - openai: 4.93.0(encoding@0.1.13)(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4) - zod: 3.24.4 - zod-to-json-schema: 3.24.1(zod@3.24.4) + openai: 4.93.0(encoding@0.1.13)(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63) + zod: 3.25.63 + zod-to-json-schema: 3.24.1(zod@3.25.63) transitivePeerDependencies: - encoding - ws @@ -8695,7 +8729,7 @@ snapshots: '@lightprotocol/stateless.js': 0.20.0(@solana/web3.js@1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10)) '@solana/spl-token': 0.4.9(@solana/web3.js@1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10))(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)(utf-8-validate@5.0.10) '@solana/web3.js': 1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10) - bn.js: 5.2.1 + bn.js: 5.2.2 buffer: 6.0.3 '@lightprotocol/stateless.js@0.20.0(@solana/web3.js@1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10))': @@ -8703,7 +8737,7 @@ snapshots: '@coral-xyz/borsh': 0.29.0(@solana/web3.js@1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10)) '@noble/hashes': 1.5.0 '@solana/web3.js': 1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10) - bn.js: 5.2.1 + bn.js: 5.2.2 bs58: 6.0.0 buffer: 6.0.3 buffer-layout: 1.2.2 @@ -8901,7 +8935,7 @@ snapshots: dependencies: ansicolors: 0.3.2 assert: 2.1.0 - bn.js: 5.2.1 + bn.js: 5.2.2 debug: 4.4.0 transitivePeerDependencies: - supports-color @@ -9288,7 +9322,7 @@ snapshots: '@solana/buffer-layout': 4.0.1 '@solana/spl-token': 0.4.13(@solana/web3.js@1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10))(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)(utf-8-validate@5.0.10) '@solana/web3.js': 1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10) - bn.js: 5.2.1 + bn.js: 5.2.2 decimal.js: 10.5.0 express: 4.21.2 gaussian: 1.3.0 @@ -9629,14 +9663,14 @@ snapshots: - supports-color - ws - '@openai/agents-core@0.0.7(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4)': + '@openai/agents-core@0.0.7(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63)': dependencies: '@openai/zod': zod@3.25.63 debug: 4.4.0 - openai: 5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4) + openai: 5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63) optionalDependencies: '@modelcontextprotocol/sdk': 1.12.1 - zod: 3.24.4 + zod: 3.25.63 transitivePeerDependencies: - supports-color - ws @@ -9652,12 +9686,12 @@ snapshots: - ws - zod - '@openai/agents-openai@0.0.7(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4)': + '@openai/agents-openai@0.0.7(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63)': dependencies: - '@openai/agents-core': 0.0.7(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4) + '@openai/agents-core': 0.0.7(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63) '@openai/zod': zod@3.25.63 debug: 4.4.0 - openai: 5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4) + openai: 5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63) transitivePeerDependencies: - supports-color - ws @@ -9676,9 +9710,9 @@ snapshots: - utf-8-validate - zod - '@openai/agents-realtime@0.0.7(bufferutil@4.0.9)(utf-8-validate@5.0.10)(zod@3.24.4)': + '@openai/agents-realtime@0.0.7(bufferutil@4.0.9)(utf-8-validate@5.0.10)(zod@3.25.63)': dependencies: - '@openai/agents-core': 0.0.7(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4) + '@openai/agents-core': 0.0.7(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63) '@openai/zod': zod@3.25.63 '@types/ws': 8.18.1 debug: 4.4.0 @@ -9703,13 +9737,13 @@ snapshots: - ws - zod - '@openai/agents@0.0.7(bufferutil@4.0.9)(utf-8-validate@5.0.10)(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4)': + '@openai/agents@0.0.7(bufferutil@4.0.9)(utf-8-validate@5.0.10)(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63)': dependencies: - '@openai/agents-core': 0.0.7(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4) - '@openai/agents-openai': 0.0.7(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4) - '@openai/agents-realtime': 0.0.7(bufferutil@4.0.9)(utf-8-validate@5.0.10)(zod@3.24.4) + '@openai/agents-core': 0.0.7(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63) + '@openai/agents-openai': 0.0.7(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63) + '@openai/agents-realtime': 0.0.7(bufferutil@4.0.9)(utf-8-validate@5.0.10)(zod@3.25.63) debug: 4.4.0 - openai: 5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4) + openai: 5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63) transitivePeerDependencies: - bufferutil - supports-color @@ -10207,14 +10241,14 @@ snapshots: dependencies: tslib: 2.8.1 - '@saberhq/solana-contrib@1.15.0(@solana/web3.js@1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10))(bn.js@5.2.1)': + '@saberhq/solana-contrib@1.15.0(@solana/web3.js@1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10))(bn.js@5.2.2)': dependencies: '@saberhq/option-utils': 1.15.0 '@solana/buffer-layout': 4.0.1 '@solana/web3.js': 1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10) '@types/promise-retry': 1.1.6 '@types/retry': 0.12.5 - bn.js: 5.2.1 + bn.js: 5.2.2 promise-retry: 2.0.1 retry: 0.13.1 tiny-invariant: 1.3.3 @@ -10782,6 +10816,22 @@ snapshots: - typescript - utf-8-validate + '@solana/spl-governance@0.3.28(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10)': + dependencies: + '@solana/web3.js': 1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10) + axios: 1.10.0 + bignumber.js: 9.1.2 + bn.js: 5.2.2 + borsh: 0.3.1 + bs58: 4.0.1 + superstruct: 0.15.5 + transitivePeerDependencies: + - bufferutil + - debug + - encoding + - typescript + - utf-8-validate + '@solana/spl-token-group@0.0.4(@solana/web3.js@1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22)': dependencies: '@solana/codecs': 2.0.0-preview.2(fastestsmallesttextencoderdecoder@1.0.22) @@ -11198,7 +11248,7 @@ snapshots: '@solana/buffer-layout': 4.0.1 agentkeepalive: 4.6.0 bigint-buffer: 1.1.5 - bn.js: 5.2.1 + bn.js: 5.2.2 borsh: 0.7.0 bs58: 4.0.1 buffer: 6.0.3 @@ -11383,7 +11433,7 @@ snapshots: '@solana/web3.js': 1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10) '@types/bn.js': 5.1.6 assert: 2.1.0 - bn.js: 5.2.1 + bn.js: 5.2.2 buffer: 6.0.3 invariant: 2.2.4 transitivePeerDependencies: @@ -11407,7 +11457,7 @@ snapshots: '@solana/web3.js': 1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.6.3)(utf-8-validate@5.0.10) axios: 1.9.0 big.js: 6.2.2 - bn.js: 5.2.1 + bn.js: 5.2.2 bs58: 6.0.0 cron-validator: 1.3.1 decimal.js: 10.5.0 @@ -11427,7 +11477,7 @@ snapshots: '@solana/web3.js': 1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10) axios: 1.9.0 big.js: 6.2.2 - bn.js: 5.2.1 + bn.js: 5.2.2 bs58: 6.0.0 cron-validator: 1.3.1 decimal.js: 10.5.0 @@ -11515,13 +11565,13 @@ snapshots: dependencies: '@coral-xyz/anchor': 0.26.0(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10) '@msgpack/msgpack': 2.8.0 - '@saberhq/solana-contrib': 1.15.0(@solana/web3.js@1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10))(bn.js@5.2.1) + '@saberhq/solana-contrib': 1.15.0(@solana/web3.js@1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10))(bn.js@5.2.2) '@solana/spl-token': 0.4.13(@solana/web3.js@1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10))(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)(utf-8-validate@5.0.10) '@solana/web3.js': 1.98.2(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10) '@tensor-hq/tensor-common': 8.3.2(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)(utf-8-validate@5.0.10) '@types/bn.js': 5.1.6 big.js: 6.2.2 - bn.js: 5.2.1 + bn.js: 5.2.2 js-sha256: 0.9.0 keccak256: 1.0.6 math-expression-evaluator: 2.0.6 @@ -11855,18 +11905,6 @@ snapshots: react: 19.0.0 zod: 3.24.1 - ai@4.1.5(react@19.0.0)(zod@3.24.4): - dependencies: - '@ai-sdk/provider': 1.0.6 - '@ai-sdk/provider-utils': 2.1.2(zod@3.24.4) - '@ai-sdk/react': 1.1.3(react@19.0.0)(zod@3.24.4) - '@ai-sdk/ui-utils': 1.1.3(zod@3.24.4) - '@opentelemetry/api': 1.9.0 - jsondiffpatch: 0.6.0 - optionalDependencies: - react: 19.0.0 - zod: 3.24.4 - ai@4.1.5(react@19.0.0)(zod@3.25.63): dependencies: '@ai-sdk/provider': 1.0.6 @@ -12255,9 +12293,16 @@ snapshots: transitivePeerDependencies: - supports-color + borsh@0.3.1: + dependencies: + '@types/bn.js': 4.11.6 + bn.js: 5.2.2 + bs58: 4.0.1 + text-encoding-utf-8: 1.0.2 + borsh@0.7.0: dependencies: - bn.js: 5.2.1 + bn.js: 5.2.2 bs58: 4.0.1 text-encoding-utf-8: 1.0.2 @@ -13996,7 +14041,7 @@ snapshots: keccak256@1.0.6: dependencies: - bn.js: 5.2.1 + bn.js: 5.2.2 buffer: 6.0.3 keccak: 3.0.4 @@ -14022,7 +14067,7 @@ snapshots: optionalDependencies: openai: 5.3.0(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1) - langsmith@0.3.15(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4)): + langsmith@0.3.15(openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63)): dependencies: '@types/uuid': 10.0.0 chalk: 4.1.2 @@ -14032,7 +14077,7 @@ snapshots: semver: 7.7.1 uuid: 10.0.0 optionalDependencies: - openai: 5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4) + openai: 5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63) lazy-ass@1.6.0: {} @@ -14456,7 +14501,7 @@ snapshots: regex: 5.1.1 regex-recursion: 5.1.1 - openai@4.93.0(encoding@0.1.13)(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4): + openai@4.93.0(encoding@0.1.13)(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63): dependencies: '@types/node': 18.19.74 '@types/node-fetch': 2.6.12 @@ -14467,7 +14512,7 @@ snapshots: node-fetch: 2.7.0(encoding@0.1.13) optionalDependencies: ws: 8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) - zod: 3.24.4 + zod: 3.25.63 transitivePeerDependencies: - encoding @@ -14481,10 +14526,10 @@ snapshots: ws: 8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) zod: 3.24.1 - openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.4): + openai@5.3.0(ws@8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.63): optionalDependencies: ws: 8.18.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) - zod: 3.24.4 + zod: 3.25.63 optionator@0.9.4: dependencies: @@ -16136,7 +16181,7 @@ snapshots: util: 0.12.5 web3-errors: 1.3.1 web3-types: 1.10.0 - zod: 3.24.4 + zod: 3.25.63 web3@4.16.0(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.24.1): dependencies: diff --git a/test/index.ts b/test/index.ts index cb2826b63..aecebdc7f 100644 --- a/test/index.ts +++ b/test/index.ts @@ -3,6 +3,7 @@ import DefiPlugin from "@solana-agent-kit/plugin-defi"; import MiscPlugin from "@solana-agent-kit/plugin-misc"; import NFTPlugin from "@solana-agent-kit/plugin-nft"; import TokenPlugin from "@solana-agent-kit/plugin-token"; +import GovernancePlugin from "@solana-agent-kit/plugin-governance"; import { Keypair } from "@solana/web3.js"; import bs58 from "bs58"; import * as dotenv from "dotenv"; @@ -51,6 +52,7 @@ async function main() { // .use(NFTPlugin) .use(DefiPlugin) .use(MiscPlugin) + .use(GovernancePlugin) .use(BlinksPlugin); if (mode === "agent") { diff --git a/turbo.json b/turbo.json index 4922369c8..2be4cd4f4 100644 --- a/turbo.json +++ b/turbo.json @@ -1,6 +1,6 @@ { "$schema": "https://turbo.build/schema.json", - "tasks": { + "pipeline": { "build": { "dependsOn": ["^build"], "inputs": ["packages/**"],