Documentation
    Preparing search index...

    Transaction builder for composing, building and sending transactions.

    Index

    Constructors

    Properties

    connection: Connection
    wallet: Wallet

    Methods

    • Constructs a transaction payload with the gathered instructions, sign it with the provider and send it out

      Parameters

      • Optionaloptions: Partial<BuildOptions>

        Options to build the transaction. . Overrides the default options provided in the constructor.

      • OptionalsendOptions: Partial<SendOptions>

        Options to send the transaction. Overrides the default options provided in the constructor.

      • OptionalconfirmCommitment: Commitment

        Commitment level to wait for transaction confirmation. Overrides the default options provided in the constructor.

      Returns Promise<string>

      the txId of the transaction

    • Estimates the fee for this transaction

      Parameters

      • OptionalgetPriorityFeePerUnit: (lockedWritableAccounts: PublicKey[]) => Promise<RecentPrioritizationFees[]>

        A function to get the priority fee per unit

      • OptionalcomputeLimitMargin: number

        The margin for the compute budget limit

      • OptionalselectionPercentile: number

        The percentile to use when calculating the priority fee

      • OptionallookupTableAccounts: AddressLookupTableAccount[]

        The lookup table accounts that will be used in the transaction

      Returns Promise<
          {
              estConsumedComputeUnits: number;
              estPriorityFeeInLamports: number;
              estPriorityFeePerUnitInLamports: RecentPrioritizationFees[];
          },
      >

      An object containing the estimated values for consumed compute units, priority fee per unit in lamports, and the total priority fee in lamports

    • Returns the size of the current transaction in bytes. Measurement method can differ based on the maxSupportedTransactionVersion.

      Parameters

      • OptionaluserOptions: Partial<BuildOptions>

        Options to override the default build options

      Returns number

      the size of the current transaction in bytes.

      error if there is an error measuring the transaction size. This can happen if the transaction is too large, or if the transaction contains too many keys to be serialized.