Type Alias TokenPaymasterActions

TokenPaymasterActions: {
    getSupportedTokens: (client: NexusClient) => Promise<FeeQuote[]>;
    getTokenPaymasterQuotes: (
        parameters: GetTokenPaymasterQuotesParameters,
    ) => Promise<TokenPaymasterQuotesResponse>;
}

Type declaration

  • getSupportedTokens: (client: NexusClient) => Promise<FeeQuote[]>

    Retrieves the supported tokens for the Biconomy Token Paymaster..

    const supportedTokens = await paymaster.getSupportedTokens(nexusClient);
    console.log(supportedTokens);
  • getTokenPaymasterQuotes: (
        parameters: GetTokenPaymasterQuotesParameters,
    ) => Promise<TokenPaymasterQuotesResponse>

    Fetches paymaster quotes for ERC20 token payment options for a given UserOperation.

    // Configure client with paymaster RPC
    const paymasterClient = createBicoPaymasterClient({
    paymasterUrl
    })

    // Token addresses to get quotes for
    const tokenList = [
    "0x...", // USDT
    "0x..." // USDC
    ];

    // Get paymaster quotes
    const quotes = await paymasterClient.getTokenPaymasterQuotes(userOp, tokenList);

    // Example response:
    // {
    // mode: "ERC20",
    // paymasterAddress: "0x...",
    // feeQuotes: [{
    // symbol: "USDT",
    // decimal: 6,
    // tokenAddress: "0x...",
    // maxGasFee: 5000000,
    // maxGasFeeUSD: 5,
    // exchangeRate: 1,
    // logoUrl: "https://...",
    // premiumPercentage: "0.1",
    // validUntil: 1234567890
    // }],
    // unsupportedTokens: []
    // }