Estimate payment amount
Estimate the amount that should be paid for a transaction without creating a session. Since this is only an estimate, the actual amount may vary when a session is created. If you need a firm quote, you should create a session.
Import
import { estimatePaymentAmount } from "@paywithglide/glide-js";
Usage
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 amount the user wants to pay, denominated in the paymentCurrency, can be set for transactions that support variable payment amounts (ex. p2p transfers).
The currency in which the user pays in CAIP-19 format.
The contract's address, or the recipient's address if the transaction is not a contract call.
The contract's ABI.
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.
The approval object, required if the transaction requires spending of an ERC-20 token.
The token's contract address that needs to be approved for spending.
The amount to approve, in the token's smallest unit.
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 EIP-155 chain ID of the chain where the transaction will be executed.
The name of the chain where the transaction will be executed.
The URL of the chain's logo.
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.
The estimated amount required to complete the transaction in the transaction currency.
The currency required by the transaction to be executed, in CAIP-19 format.
The name of the transaction currency. Ex. "Ethereum".
The symbol of the transaction currency. Ex. "ETH".
The URL of the transaction currency's logo.