UNPKG

gill

Version:

a modern javascript/typescript client library for interacting with the Solana blockchain

42 lines 2.11 kB
import type { CompilableTransactionMessage, GetLatestBlockhashApi, ITransactionMessageWithFeePayer, Rpc, SimulateTransactionApi, TransactionMessage, TransactionMessageWithBlockhashLifetime } from "@solana/kit"; type PrepareCompilableTransactionMessage = CompilableTransactionMessage | (ITransactionMessageWithFeePayer & TransactionMessage); export type PrepareTransactionConfig<TMessage extends PrepareCompilableTransactionMessage> = { /** * Transaction to prepare for sending to the blockchain */ transaction: TMessage; /** * RPC client capable of simulating transactions and getting the latest blockhash **/ rpc: Rpc<SimulateTransactionApi & GetLatestBlockhashApi>; /** * Multiplier applied to the simulated compute unit value obtained from simulation * * Default: `1.1` **/ computeUnitLimitMultiplier?: number; /** * Whether or not you wish to force reset the compute unit limit value (if one is already set) * using the simulation response and `computeUnitLimitMultiplier` **/ computeUnitLimitReset?: boolean; /** * Whether or not you wish to force reset the latest blockhash (if one is already set) * * Default: `true` **/ blockhashReset?: boolean; }; /** * Prepare a Transaction to be signed and sent to the network. Including: * - setting a compute unit limit (if not already set) * - fetching the latest blockhash (if not already set) * - (optional) simulating and resetting the compute unit limit * - (optional) resetting latest blockhash to the most recent */ export declare function prepareTransaction<TMessage extends PrepareCompilableTransactionMessage>(config: PrepareTransactionConfig<TMessage>): Promise<TMessage & Readonly<{ instructions: readonly import("@solana/kit").IInstruction<string, readonly (import("@solana/kit").IAccountLookupMeta<string, string> | import("@solana/kit").IAccountMeta<string>)[]>[]; version: import("@solana/kit").TransactionVersion; }> & TransactionMessageWithBlockhashLifetime>; export {}; //# sourceMappingURL=prepare-transaction.d.ts.map