@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

    Constructors

    Methods

    • 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.

    • 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>)[],
            >[];
            payer: Address;
        }

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

      Transaction message for the given instructions, with a freshly-fetched blockhash lifetime. Caller must sign before broadcast.

    • 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.