@cfxlabsinc/b2b-services
    Preparing search index...

    Solana transaction builder and related helpers.

    Returns kit TransactionMessage values. Callers sign via SolanaKeypairService.sign and broadcast via SolanaTransactionSenderService.sendAndConfirmTransaction. No CFX signature is baked into a message — signing happens once, immediately before broadcast.

    Index
    • Parameters

      • __namedParameters: { nonceAccount: Address }

      Returns Promise<{ instruction: Instruction; nonce: Nonce }>

      Durable nonce paired with an advance-nonce instruction. Most callers should prefer transactionWithNonce, which embeds the lifetime + advance-nonce instruction in one step.

    • Fetch a blockhash without building anything with it.

      For a caller that builds many messages against one lifetime — a bulk writer sending hundreds of independent transactions — and needs the lifetime as a value so did this generation land stays a single question with a single answer. Pass the result back in as lifetime below.

      Returns Promise<{ blockhash: string; lastValidBlockHeight: number }>

    • Simulate a Solana transaction by sending it to the RPC.

      Parameters

      • transaction: Transaction
      • opts: { sigVerify?: boolean } = {}

      Returns Promise<
          {
              response: {
                  accounts: object[]
                  | null;
                  err: string | object | null;
                  logs: string[] | null;
                  unitsConsumed: number | undefined;
              };
              success: boolean;
          },
      >

    • Parameters

      • __namedParameters: {
            cuLimit?: number | "UNSET";
            cuPrice?: number | bigint | "UNSET";
            instructions: Instruction<
                string,
                readonly (AccountLookupMeta<string, string> | AccountMeta<string>)[],
            >[];
            lifetime?: { blockhash: string; lastValidBlockHeight: number };
            payer: Address;
        }
        • OptionalcuLimit?: number | "UNSET"
        • OptionalcuPrice?: number | bigint | "UNSET"
        • instructions: Instruction<
              string,
              readonly (AccountLookupMeta<string, string> | AccountMeta<string>)[],
          >[]
        • Optionallifetime?: { blockhash: string; lastValidBlockHeight: number }

          Reuse a blockhash from latestBlockhash instead of fetching one. Without it every message costs its own getLatestBlockhash round trip and lands on its own lifetime, so a batch has no shared expiry to reason about.

        • payer: Address

      Returns Promise<
          {
              lastValidBlockHeight: number;
              message: SolanaBlockhashTransactionMessage;
          },
      >

    • Parameters

      • __namedParameters: {
            cuLimit?: number | "UNSET";
            cuPrice?: number | bigint | "UNSET";
            instructions: Instruction<
                string,
                readonly (AccountLookupMeta<string, string> | AccountMeta<string>)[],
            >[];
            nonceAccount: Address;
            payer: Address;
        }

      Returns Promise<SolanaNonceTransactionMessage>

      Transaction message for the given instructions, using a durable nonce for the lifetime. Kit prepends the advance-nonce instruction automatically. Caller must sign (PAYER + NONCE_AUTHORITY + any others) before broadcast.