@drift-labs/sdk-browser
Version:
SDK for Drift Protocol
27 lines (26 loc) • 1.27 kB
TypeScript
import { Connection, SimulatedTransactionResponse, VersionedTransaction } from '@solana/web3.js';
import { BaseTxParams, ProcessingTxParams } from '../types';
type TransactionBuildingProps = {
txParams: BaseTxParams;
};
/**
* This class is responsible for running through a "processing" pipeline for a base transaction, to adjust the standard transaction parameters based on a given configuration.
*/
export declare class TransactionParamProcessor {
private static getComputeUnitsFromSim;
static getTxSimComputeUnits(tx: VersionedTransaction, connection: Connection, bufferMultiplier: number, // Making this a mandatory param to force the user to remember that simulated CU's can be inaccurate and a buffer should be applied
lowerBoundCu?: number, simulatedTx?: SimulatedTransactionResponse): Promise<{
success: boolean;
computeUnits: number;
}>;
static process(props: {
baseTxParams: BaseTxParams;
processConfig: ProcessingTxParams;
processParams: {
connection: Connection;
simulatedTx?: SimulatedTransactionResponse;
};
txBuilder: (baseTransactionProps: TransactionBuildingProps) => Promise<VersionedTransaction>;
}): Promise<BaseTxParams>;
}
export {};