Coda by Ian Macalinao
    Preparing search index...

    Module @solana-programs/goki

    @solana-programs/goki

    npm version

    TypeScript client for the Goki programs (Smart Wallet and Token Signer), generated using Coda CLI with full ESM support.

    bun add @solana-programs/goki
    

    Goki is a multisig and smart wallet protocol on Solana, made up of two programs:

    • Smart Wallet: An owner-threshold multisig that proposes, approves, and executes arbitrary instructions, optionally behind a timelock
    • Token Signer: Lets the holder of an NFT sign instructions on behalf of a PDA derived from that NFT's mint

    This client pairs with @solana-programs/tribeca: Tribeca governance executes passed proposals through a Goki smart wallet, so the two are almost always used together.

    • SmartWallet: Owner set, threshold, and timelock configuration for a multisig
    • Transaction: A proposed instruction bundle, its approvals, and its execution status
    • SubaccountInfo: Metadata describing a derived or owner-invoker subaccount
    • InvokeSignedInstruction: Invokes an instruction signed by the PDA of an NFT mint, authorized by the NFT's holder

    This client is generated from the Goki IDLs using Coda CLI:

    # Generate the client from idls/
    bun run codegen

    # Build the TypeScript
    bun run build

    The IDLs are legacy Anchor 0.x IDLs that declare their PDA seeds inline on instruction accounts, which the Anchor-to-Codama parser does not carry over. coda.config.ts redeclares those seeds so the client ships PDA helpers, and links each account to its PDA.

    The full set of PDA helpers:

    Helper Seeds
    findSmartWalletPda({ base }) "GokiSmartWallet", base
    findTransactionPda({ smartWallet, index }) "GokiTransaction", smart wallet, index
    findSubaccountInfoPda({ subaccount }) "GokiSubaccountInfo", subaccount
    findWalletDerivedPda({ smartWallet, index }) "GokiSmartWalletDerived", smart wallet, index
    findOwnerInvokerPda({ smartWallet, index }) "GokiSmartWalletOwnerInvoker", smart wallet, index
    findNftSignerPda({ mint }) "GokiTokenSigner", mint

    walletDerived and ownerInvoker are subaccount addresses rather than stored accounts — they back executeTransactionDerived and ownerInvokeInstruction respectively, and have no on-chain struct to decode.

    import {
    fetchSmartWallet,
    fetchTransaction,
    findSmartWalletPda,
    findTransactionPda,
    getApproveInstruction,
    getCreateTransactionInstruction,
    } from "@solana-programs/goki";

    const [smartWallet] = await findSmartWalletPda({ base: baseAddress });
    const wallet = await fetchSmartWallet(rpc, smartWallet);

    const [transaction] = await findTransactionPda({
    smartWallet,
    index: wallet.data.numTransactions,
    });

    const createIx = getCreateTransactionInstruction({
    smartWallet,
    transaction,
    proposer: proposerSigner,
    payer: payerSigner,
    bump: 0,
    instructions: [
    /* TXInstruction[] */
    ],
    });

    const approveIx = getApproveInstruction({
    smartWallet,
    transaction,
    owner: ownerSigner,
    });

    Copyright © 2025 Ian Macalinao

    Licensed under the Apache License, Version 2.0

    ApproveInput
    ApproveInstruction
    ApproveInstructionData
    ApproveInstructionDataArgs
    ChangeThresholdInput
    ChangeThresholdInstruction
    ChangeThresholdInstructionData
    ChangeThresholdInstructionDataArgs
    CreateSmartWalletInput
    CreateSmartWalletInstruction
    CreateSmartWalletInstructionData
    CreateSmartWalletInstructionDataArgs
    CreateSubaccountInfoInput
    CreateSubaccountInfoInstruction
    CreateSubaccountInfoInstructionData
    CreateSubaccountInfoInstructionDataArgs
    CreateTransactionInput
    CreateTransactionInstruction
    CreateTransactionInstructionData
    CreateTransactionInstructionDataArgs
    CreateTransactionWithTimelockInput
    CreateTransactionWithTimelockInstruction
    CreateTransactionWithTimelockInstructionData
    CreateTransactionWithTimelockInstructionDataArgs
    ExecuteTransactionDerivedInput
    ExecuteTransactionDerivedInstruction
    ExecuteTransactionDerivedInstructionData
    ExecuteTransactionDerivedInstructionDataArgs
    ExecuteTransactionInput
    ExecuteTransactionInstruction
    ExecuteTransactionInstructionData
    ExecuteTransactionInstructionDataArgs
    InvokeSignedInstructionInput
    InvokeSignedInstructionInstruction
    InvokeSignedInstructionInstructionData
    InvokeSignedInstructionInstructionDataArgs
    NftSignerSeeds
    OwnerInvokeInstructionInput
    OwnerInvokeInstructionInstruction
    OwnerInvokeInstructionInstructionData
    OwnerInvokeInstructionInstructionDataArgs
    OwnerInvokeInstructionV2Input
    OwnerInvokeInstructionV2Instruction
    OwnerInvokeInstructionV2InstructionData
    OwnerInvokeInstructionV2InstructionDataArgs
    OwnerInvokerSeeds
    ParsedApproveInstruction
    ParsedChangeThresholdInstruction
    ParsedCreateSmartWalletInstruction
    ParsedCreateSubaccountInfoInstruction
    ParsedCreateTransactionInstruction
    ParsedCreateTransactionWithTimelockInstruction
    ParsedExecuteTransactionDerivedInstruction
    ParsedExecuteTransactionInstruction
    ParsedInvokeSignedInstructionInstruction
    ParsedOwnerInvokeInstructionInstruction
    ParsedOwnerInvokeInstructionV2Instruction
    ParsedSetOwnersInstruction
    ParsedSmartWalletInstruction
    ParsedTokenSignerInstruction
    ParsedUnapproveInstruction
    SetOwnersInput
    SetOwnersInstruction
    SetOwnersInstructionData
    SetOwnersInstructionDataArgs
    SmartWallet
    SmartWalletAccount
    SmartWalletArgs
    SmartWalletError
    SmartWalletInstruction
    SmartWalletPlugin
    SmartWalletPluginAccounts
    SmartWalletPluginInstructions
    SmartWalletPluginPdas
    SmartWalletPluginRequirements
    SmartWalletSeeds
    SubaccountInfo
    SubaccountInfoArgs
    SubaccountInfoSeeds
    SubaccountType
    SubaccountTypeArgs
    TokenSignerError
    TokenSignerInstruction
    TokenSignerPlugin
    TokenSignerPluginInstructions
    TokenSignerPluginPdas
    TokenSignerPluginRequirements
    Transaction
    TransactionApproveEvent
    TransactionApproveEventArgs
    TransactionArgs
    TransactionCreateEvent
    TransactionCreateEventArgs
    TransactionExecuteEvent
    TransactionExecuteEventArgs
    TransactionSeeds
    TransactionUnapproveEvent
    TransactionUnapproveEventArgs
    TXAccountMeta
    TXAccountMetaArgs
    TXInstruction
    TXInstructionArgs
    UnapproveInput
    UnapproveInstruction
    UnapproveInstructionData
    UnapproveInstructionDataArgs
    WalletChangeThresholdEvent
    WalletChangeThresholdEventArgs
    WalletCreateEvent
    WalletCreateEventArgs
    WalletDerivedSeeds
    WalletSetOwnersEvent
    WalletSetOwnersEventArgs
    APPROVE_DISCRIMINATOR
    CHANGE_THRESHOLD_DISCRIMINATOR
    CREATE_SMART_WALLET_DISCRIMINATOR
    CREATE_SUBACCOUNT_INFO_DISCRIMINATOR
    CREATE_TRANSACTION_DISCRIMINATOR
    CREATE_TRANSACTION_WITH_TIMELOCK_DISCRIMINATOR
    EXECUTE_TRANSACTION_DERIVED_DISCRIMINATOR
    EXECUTE_TRANSACTION_DISCRIMINATOR
    INVOKE_SIGNED_INSTRUCTION_DISCRIMINATOR
    OWNER_INVOKE_INSTRUCTION_DISCRIMINATOR
    OWNER_INVOKE_INSTRUCTION_V2_DISCRIMINATOR
    SET_OWNERS_DISCRIMINATOR
    SMART_WALLET_DISCRIMINATOR
    SMART_WALLET_ERROR__ALREADY_EXECUTED
    SMART_WALLET_ERROR__BUFFER_BUNDLE_EXECUTED
    SMART_WALLET_ERROR__BUFFER_BUNDLE_NOT_FINALIZED
    SMART_WALLET_ERROR__BUFFER_BUNDLE_NOT_FOUND
    SMART_WALLET_ERROR__BUFFER_BUNDLE_OUT_OF_RANGE
    SMART_WALLET_ERROR__BUFFER_FINALIZED
    SMART_WALLET_ERROR__DELAY_TOO_HIGH
    SMART_WALLET_ERROR__INVALID_E_T_A
    SMART_WALLET_ERROR__INVALID_OWNER
    SMART_WALLET_ERROR__INVALID_THRESHOLD
    SMART_WALLET_ERROR__NOT_ENOUGH_SIGNERS
    SMART_WALLET_ERROR__OWNER_SET_CHANGED
    SMART_WALLET_ERROR__SUBACCOUNT_OWNER_MISMATCH
    SMART_WALLET_ERROR__TRANSACTION_IS_STALE
    SMART_WALLET_ERROR__TRANSACTION_NOT_READY
    SMART_WALLET_PROGRAM_ADDRESS
    SmartWalletAccount
    SmartWalletInstruction
    SUBACCOUNT_INFO_DISCRIMINATOR
    SubaccountType
    TOKEN_SIGNER_ERROR__UNAUTHORIZED
    TOKEN_SIGNER_PROGRAM_ADDRESS
    TokenSignerInstruction
    TRANSACTION_DISCRIMINATOR
    UNAPPROVE_DISCRIMINATOR
    decodeSmartWallet
    decodeSubaccountInfo
    decodeTransaction
    fetchAllMaybeSmartWallet
    fetchAllMaybeSubaccountInfo
    fetchAllMaybeTransaction
    fetchAllSmartWallet
    fetchAllSubaccountInfo
    fetchAllTransaction
    fetchMaybeSmartWallet
    fetchMaybeSmartWalletFromSeeds
    fetchMaybeSubaccountInfo
    fetchMaybeSubaccountInfoFromSeeds
    fetchMaybeTransaction
    fetchMaybeTransactionFromSeeds
    fetchSmartWallet
    fetchSmartWalletFromSeeds
    fetchSubaccountInfo
    fetchSubaccountInfoFromSeeds
    fetchTransaction
    fetchTransactionFromSeeds
    findNftSignerPda
    findOwnerInvokerPda
    findSmartWalletPda
    findSubaccountInfoPda
    findTransactionPda
    findWalletDerivedPda
    getApproveDiscriminatorBytes
    getApproveInstruction
    getApproveInstructionDataCodec
    getApproveInstructionDataDecoder
    getApproveInstructionDataEncoder
    getChangeThresholdDiscriminatorBytes
    getChangeThresholdInstruction
    getChangeThresholdInstructionDataCodec
    getChangeThresholdInstructionDataDecoder
    getChangeThresholdInstructionDataEncoder
    getCreateSmartWalletDiscriminatorBytes
    getCreateSmartWalletInstruction
    getCreateSmartWalletInstructionDataCodec
    getCreateSmartWalletInstructionDataDecoder
    getCreateSmartWalletInstructionDataEncoder
    getCreateSubaccountInfoDiscriminatorBytes
    getCreateSubaccountInfoInstruction
    getCreateSubaccountInfoInstructionDataCodec
    getCreateSubaccountInfoInstructionDataDecoder
    getCreateSubaccountInfoInstructionDataEncoder
    getCreateTransactionDiscriminatorBytes
    getCreateTransactionInstruction
    getCreateTransactionInstructionDataCodec
    getCreateTransactionInstructionDataDecoder
    getCreateTransactionInstructionDataEncoder
    getCreateTransactionWithTimelockDiscriminatorBytes
    getCreateTransactionWithTimelockInstruction
    getCreateTransactionWithTimelockInstructionDataCodec
    getCreateTransactionWithTimelockInstructionDataDecoder
    getCreateTransactionWithTimelockInstructionDataEncoder
    getExecuteTransactionDerivedDiscriminatorBytes
    getExecuteTransactionDerivedInstruction
    getExecuteTransactionDerivedInstructionDataCodec
    getExecuteTransactionDerivedInstructionDataDecoder
    getExecuteTransactionDerivedInstructionDataEncoder
    getExecuteTransactionDiscriminatorBytes
    getExecuteTransactionInstruction
    getExecuteTransactionInstructionDataCodec
    getExecuteTransactionInstructionDataDecoder
    getExecuteTransactionInstructionDataEncoder
    getInvokeSignedInstructionDiscriminatorBytes
    getInvokeSignedInstructionInstruction
    getInvokeSignedInstructionInstructionDataCodec
    getInvokeSignedInstructionInstructionDataDecoder
    getInvokeSignedInstructionInstructionDataEncoder
    getOwnerInvokeInstructionDiscriminatorBytes
    getOwnerInvokeInstructionInstruction
    getOwnerInvokeInstructionInstructionDataCodec
    getOwnerInvokeInstructionInstructionDataDecoder
    getOwnerInvokeInstructionInstructionDataEncoder
    getOwnerInvokeInstructionV2DiscriminatorBytes
    getOwnerInvokeInstructionV2Instruction
    getOwnerInvokeInstructionV2InstructionDataCodec
    getOwnerInvokeInstructionV2InstructionDataDecoder
    getOwnerInvokeInstructionV2InstructionDataEncoder
    getSetOwnersDiscriminatorBytes
    getSetOwnersInstruction
    getSetOwnersInstructionDataCodec
    getSetOwnersInstructionDataDecoder
    getSetOwnersInstructionDataEncoder
    getSmartWalletCodec
    getSmartWalletDecoder
    getSmartWalletDiscriminatorBytes
    getSmartWalletEncoder
    getSmartWalletErrorMessage
    getSubaccountInfoCodec
    getSubaccountInfoDecoder
    getSubaccountInfoDiscriminatorBytes
    getSubaccountInfoEncoder
    getSubaccountTypeCodec
    getSubaccountTypeDecoder
    getSubaccountTypeEncoder
    getTokenSignerErrorMessage
    getTransactionApproveEventCodec
    getTransactionApproveEventDecoder
    getTransactionApproveEventEncoder
    getTransactionCodec
    getTransactionCreateEventCodec
    getTransactionCreateEventDecoder
    getTransactionCreateEventEncoder
    getTransactionDecoder
    getTransactionDiscriminatorBytes
    getTransactionEncoder
    getTransactionExecuteEventCodec
    getTransactionExecuteEventDecoder
    getTransactionExecuteEventEncoder
    getTransactionUnapproveEventCodec
    getTransactionUnapproveEventDecoder
    getTransactionUnapproveEventEncoder
    getTXAccountMetaCodec
    getTXAccountMetaDecoder
    getTXAccountMetaEncoder
    getTXInstructionCodec
    getTXInstructionDecoder
    getTXInstructionEncoder
    getUnapproveDiscriminatorBytes
    getUnapproveInstruction
    getUnapproveInstructionDataCodec
    getUnapproveInstructionDataDecoder
    getUnapproveInstructionDataEncoder
    getWalletChangeThresholdEventCodec
    getWalletChangeThresholdEventDecoder
    getWalletChangeThresholdEventEncoder
    getWalletCreateEventCodec
    getWalletCreateEventDecoder
    getWalletCreateEventEncoder
    getWalletSetOwnersEventCodec
    getWalletSetOwnersEventDecoder
    getWalletSetOwnersEventEncoder
    identifySmartWalletAccount
    identifySmartWalletInstruction
    identifyTokenSignerInstruction
    isSmartWalletError
    isTokenSignerError
    parseApproveInstruction
    parseChangeThresholdInstruction
    parseCreateSmartWalletInstruction
    parseCreateSubaccountInfoInstruction
    parseCreateTransactionInstruction
    parseCreateTransactionWithTimelockInstruction
    parseExecuteTransactionDerivedInstruction
    parseExecuteTransactionInstruction
    parseInvokeSignedInstructionInstruction
    parseOwnerInvokeInstructionInstruction
    parseOwnerInvokeInstructionV2Instruction
    parseSetOwnersInstruction
    parseSmartWalletInstruction
    parseTokenSignerInstruction
    parseUnapproveInstruction
    smartWalletProgram
    tokenSignerProgram