List payment options
Lists the payment options available for a transaction for the user's wallet based on their balance across chains and tokens and the required transaction amount.
Import
import { listPaymentOptions } from "@paywithglide/glide-js";
Usage
import { listPaymentOptions, currencies, chains } from "@paywithglide/glide-js";
import { config } from "./config";
const paymentOptions = await listPaymentOptions(config, {
chainId: chains.base.id,
account: "0xc6FfEB1298Eb33Da430d14e5Eb789256ec344625",
abi: fabricAbi,
address: "0x1169c6769c4F4B3cA1944AF0F26B36582fd5279d",
functionName: "mintFor",
args: ["0xc6FfEB1298Eb33Da430d14e5Eb789256ec344625", 999999907200n],
value: 999999907200n,
});
Parameters
The EIP-155 chain ID of the chain where the transaction will be executed.
The wallet address that will be used to pay for the transaction.
The contract's ABI.
The contract's address.
The name of the function to be called on the contract.
Arguments to be passed when calling the function.
Value in the smallest unit (ex. wei) to be sent with the transaction.
List of payment currencies in the CAIP-19 format that should be considered for the transaction.
The commission amount in USD that will be added on top of the transaction cost and will be paid out to the developer.
Return Type
The estimated payment amount required for the transaction in the payment currency.
The currency in which the user pays in CAIP-19 format.
The name of the payment currency.
The symbol of the payment currency.
The URL of the payment currency's logo.
The user's current balance of the payment currency.
The user's current balance of the payment currency in USD.