UNPKG

@abstraxn/paymaster

Version:

Abstraxn Paymaster to interact with Paymaster Services that interacts with ( veriying and token ) paymasters

97 lines (96 loc) 2.33 kB
import { BigNumberish } from "ethers"; export type PaymasterServiceErrorResponse = { jsonrpc: string; id: number; error: JsonRpcError; }; export type JsonRpcResponse = { jsonrpc: string; id: number; result?: any; error?: JsonRpcError; }; export type JsonRpcError = { code: string; message: string; data: any; }; export type PaymasterConfig = { paymasterUrl: string; strictMode?: boolean; }; export type SponsorUserOperationDto = { mode: PaymasterMode; calculateGasLimits?: boolean; expiryDuration?: number; webhookData?: { [key: string]: any; }; feeTokenAddress?: string; }; export type FeeQuotesOrDataDto = { mode?: PaymasterMode; expiryDuration?: number; calculateGasLimits?: boolean; tokenList?: string[]; preferredToken?: string; webhookData?: { [key: string]: any; }; }; export type FeeQuoteParams = { tokenList?: string[]; preferredToken?: string; }; export type FeeTokenInfo = { feeTokenAddress: string; }; export type SponsorpshipInfo = { webhookData?: { [key: string]: any; }; }; export type PaymasterFeeQuote = { tokenAddress: string; decimal: number; maxGasFee: number; }; export type TokenPaymasterRequest = { feeQuote: PaymasterFeeQuote; spender: string; maxApproval?: boolean; }; export type FeeQuotesOrDataResponse = { feeQuotes?: PaymasterFeeQuote[]; tokenPaymasterAddress?: string; paymasterAndData?: string; preVerificationGas?: BigNumberish; verificationGasLimit?: BigNumberish; callGasLimit?: BigNumberish; }; export type PaymasterAndDataResponse = { paymasterAndData: string; preVerificationGas?: BigNumberish; verificationGasLimit?: BigNumberish; callGasLimit?: BigNumberish; maxPriorityFeePerGas?: BigNumberish; maxFeePerGas?: BigNumberish; }; export declare enum PaymasterMode { ERC20 = "ERC20", SPONSORED = "SPONSORED" } export type EstimateUserOpGasResponse = { jsonrpc: string; id: number; result: UserOpGasResponse; error?: JsonRpcError; }; export type UserOpGasResponse = { paymasterAndData: string; preVerificationGas: string; maxPriorityFeePerGas: string; maxFeePerGas: string; verificationGasLimit: string; callGasLimit: string; };