@orca-so/tx-sender
Version:
Send transactions to the Solana blockchain with auto priority fees.
60 lines (54 loc) • 3.08 kB
text/typescript
import { Rpc, SolanaRpcApi, Instruction, KeyPairSigner, NoopSigner, Address, Transaction, TransactionWithLifetime, 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, options?: {
supportsPriorityFeePercentile?: boolean;
pollIntervalMs?: number;
resendOnPoll?: 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;
pollIntervalMs: number;
resendOnPoll: boolean;
};
declare function buildTransaction(instructions: Instruction[], feePayer: KeyPairSigner | NoopSigner, lookupTableAddresses?: (Address | string)[]): Promise<Readonly<Transaction & TransactionWithLifetime>>;
declare function buildAndSendTransaction(instructions: Instruction[], payer: KeyPairSigner | NoopSigner, lookupTableAddresses?: (Address | string)[], commitment?: Commitment): Promise<Signature>;
declare function sendTransaction(transaction: Readonly<Transaction & TransactionWithLifetime>, 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 };