UNPKG

@orca-so/tx-sender

Version:

Send transactions to the Solana blockchain with auto priority fees.

54 lines (48 loc) 2.94 kB
import { Rpc, SolanaRpcApi, IInstruction, TransactionSigner, Address, FullySignedTransaction, TransactionWithLifetime, KeyPairSigner, Commitment, Signature } from '@solana/kit'; declare const DEFAULT_COMPUTE_UNIT_MARGIN_MULTIPLIER = 1.1; declare const DEFAULT_PRIORITIZATION: TransactionConfig; declare const getRpcConfig: () => RpcConfig; declare const getJitoConfig: () => JitoFeeSetting; declare const getPriorityFeeConfig: () => PriorityFeeSetting; declare const getComputeUnitMarginMultiplier: () => number; declare const getJitoBlockEngineUrl: () => string; declare function setRpc(url: string, supportsPriorityFeePercentile?: boolean): Promise<Rpc<SolanaRpcApi>>; declare function setJitoBlockEngineUrl(url: string): Promise<void>; declare function setPriorityFeeSetting(priorityFee: FeeSetting): void; declare function setJitoTipSetting(jito: FeeSetting): void; declare function setComputeUnitMarginMultiplier(multiplier: number): void; declare function setJitoFeePercentile(percentile: Percentile | "50ema"): void; declare function setPriorityFeePercentile(percentile: Percentile): void; type FeeSetting = { type: "dynamic"; maxCapLamports?: bigint; } | { type: "exact"; amountLamports: bigint; } | { type: "none"; }; type JitoFeeSetting = FeeSetting & { priorityFeePercentile?: Percentile | "50ema"; }; type PriorityFeeSetting = FeeSetting & { priorityFeePercentile?: Percentile; }; type TransactionConfig = { jito: JitoFeeSetting; priorityFee: PriorityFeeSetting; computeUnitMarginMultiplier: number; jitoBlockEngineUrl: string; }; type Percentile = "25" | "50" | "75" | "95" | "99"; type ChainId = "solana" | "eclipse" | "solana-devnet" | "eclipse-testnet" | "unknown"; type RpcConfig = { rpcUrl: string; supportsPriorityFeePercentile: boolean; chainId: ChainId; }; declare function buildTransaction(instructions: IInstruction[], feePayer: TransactionSigner | Address, lookupTableAddresses?: (Address | string)[]): Promise<Readonly<FullySignedTransaction & TransactionWithLifetime>>; declare function buildAndSendTransaction(instructions: IInstruction[], payer: KeyPairSigner, lookupTableAddresses?: (Address | string)[], commitment?: Commitment): Promise<Signature>; declare function sendTransaction(transaction: FullySignedTransaction, commitment?: Commitment): Promise<Signature>; declare function rpcFromUrl(url: string): Rpc<SolanaRpcApi>; export { type ChainId, DEFAULT_COMPUTE_UNIT_MARGIN_MULTIPLIER, DEFAULT_PRIORITIZATION, type JitoFeeSetting, type Percentile, type PriorityFeeSetting, type RpcConfig, type TransactionConfig, buildAndSendTransaction, buildTransaction, getComputeUnitMarginMultiplier, getJitoBlockEngineUrl, getJitoConfig, getPriorityFeeConfig, getRpcConfig, rpcFromUrl, sendTransaction, setComputeUnitMarginMultiplier, setJitoBlockEngineUrl, setJitoFeePercentile, setJitoTipSetting, setPriorityFeePercentile, setPriorityFeeSetting, setRpc };