@tunghm/relay-kit
Version:
SDK for Safe Smart Accounts with support for ERC-4337 and Relay
54 lines • 2.38 kB
TypeScript
import { EstimateGasData } from '@safe-global/types-kit';
import { EstimateFeeFunctionProps, IFeeEstimator } from '../../../../packs/safe-4337/types';
/**
* BiconomyFeeEstimator implements the IFeeEstimator interface for Biconomy bundler.
*
* This estimator is simpler than PimlicoFeeEstimator because:
* - Uses standard pm_getPaymasterData for all paymaster modes
* (Pimlico uses custom pm_sponsorUserOperation for sponsored)
* - Gas price response structure is identical to Pimlico (3 tiers: slow/standard/fast)
* - Uses 'fast' tier by default for optimal transaction speed
*
* @example
* ```typescript
* const estimator = new BiconomyFeeEstimator()
* const feeData = await estimator.preEstimateUserOperationGas({
* bundlerUrl: 'https://bundler.biconomy.io/api/v3/...',
* userOperation,
* entryPoint,
* paymasterOptions,
* protocolKit
* })
* ```
*/
export declare class BiconomyFeeEstimator implements IFeeEstimator {
#private;
/**
* Setup the userOperation before calling eth_estimateUserOperationGas
*
* This method:
* 1. Fetches gas prices from biconomy_getGasFeeValues
* 2. If paymaster enabled, fetches stub data from pm_getPaymasterStubData
* 3. Returns combined estimation data
*
* @param props - Estimation parameters
* @returns Gas estimation data including fees and paymaster stub data
*/
preEstimateUserOperationGas({ bundlerUrl, userOperation, entryPoint, paymasterOptions, protocolKit }: EstimateFeeFunctionProps): Promise<EstimateGasData>;
/**
* Adjust the userOperation values after calling eth_estimateUserOperationGas
*
* This method:
* 1. If sponsored mode: calls pm_getPaymasterData with sponsorship context
* 2. If ERC-20 mode: calls pm_getPaymasterData with token context
* 3. Returns paymaster data to be merged into userOperation
*
* Note: Unlike Pimlico which uses custom pm_sponsorUserOperation for sponsored mode,
* Biconomy uses the standard pm_getPaymasterData for both modes.
*
* @param props - Estimation parameters
* @returns Paymaster data including paymasterAndData/paymaster fields
*/
postEstimateUserOperationGas({ userOperation, entryPoint, paymasterOptions, protocolKit }: EstimateFeeFunctionProps): Promise<EstimateGasData>;
}
//# sourceMappingURL=BiconomyFeeEstimator.d.ts.map