UNPKG

@reflex-mev/sdk

Version:

TypeScript SDK for Reflex Router - Execute MEV backruns with ease

74 lines 3.01 kB
import { Provider, Signer } from "ethers"; import { ExecuteParams, BackrunParams, BackrunedExecuteResult, ReflexConfig, TransactionOptions, BackrunExecutedEvent } from "./types"; /** * Reflex SDK - TypeScript SDK for interacting with Reflex Router * * This SDK provides a simple interface for executing MEV backruns using the Reflex Router contract. * It supports both standalone backruns and combined execute + backrun operations. */ export declare class ReflexSDK { private provider; private signer; private config; private contract; /** * Creates a new instance of the Reflex SDK * * @param provider - Ethers provider for reading blockchain data * @param signer - Ethers signer for sending transactions * @param config - Configuration for the Reflex Router */ constructor(provider: Provider, signer: Signer, config: ReflexConfig); /** * Executes arbitrary calldata on a target contract and then triggers multiple backruns * * @param executeParams - Parameters for the execute call (target, value, callData) * @param backrunParams - Array of parameters for each backrun trigger * @param options - Transaction options (gas, etc.) * @returns Promise with execution results including profit information for each backrun */ backrunedExecute(executeParams: ExecuteParams, backrunParams: BackrunParams[], options?: TransactionOptions): Promise<BackrunedExecuteResult>; /** * Estimates gas for a backruned execute operation * * @param executeParams - Parameters for the execute call * @param backrunParams - Array of parameters for each backrun trigger * @returns Estimated gas limit */ estimateBackrunedExecuteGas(executeParams: ExecuteParams, backrunParams: BackrunParams[]): Promise<bigint>; /** * Gets the current owner/admin of the Reflex Router * * @returns The address of the current admin */ getAdmin(): Promise<string>; /** * Gets the current ReflexQuoter address * * @returns The address of the ReflexQuoter contract */ getQuoter(): Promise<string>; /** * Listens for BackrunExecuted events * * @param callback - Function to call when an event is received * @param options - Event filter options */ watchBackrunExecuted(callback: (event: BackrunExecutedEvent) => void, options?: { triggerPoolId?: string; profitToken?: string; recipient?: string; }): () => void; /** * Encodes function data for backruned execute (useful for batch transactions) * * @param executeParams - Execute parameters * @param backrunParams - Array of backrun parameters * @returns Encoded function data */ encodeBackrunedExecute(executeParams: ExecuteParams, backrunParams: BackrunParams[]): string; private prepareTxOptions; private parseBackrunedExecuteResult; private formatError; } //# sourceMappingURL=ReflexSDK.d.ts.map