Skip to content

Latest commit

 

History

History
23 lines (13 loc) · 2.11 KB

File metadata and controls

23 lines (13 loc) · 2.11 KB

payRequest()

Usage

import { payRequest } from "@requestnetwork/payment-processor";

Parameters

NameTypeRequired?Description
requestIRequestDatatrueThe request object
signerOrProviderethers.providers.Web3Provider | ethers.Signer = getProvider()trueAn ethers v5 Provider. See #pay-a-request for explanation how to wrap a viem WalletClient to look like an ethers v5 Provider.
amountethers.BigNumberishfalseThe amount to pay. Defaults to the expected amount of the request.
overridesOmit<ethers.providers.TransactionRequest, 'to' | 'data' | 'value'>falseOverride transaction settings like baseFee and maxPriorityFee
paymentSettingsConversionPaymentSettingsfalseSettings for conversion payments

Returns

Promise<ethers.ContractTransaction>

This is what ethers returns after submitting a transaction.

Types and Interfaces

IConversionPaymentSettings

NameTypeRequired?Description
currencyICurrencytrueThe currency in which the payment is made, not the currency in which the request is denominated.
maxToSpendethers.BigNumberishtrueThe maximum input currency to spend on conversion payments. Protects the user from rapidly changing exchange rates.
currencyManagerICurrencyManagertrueA Currency manager handles a list of currencies and provides utility to retrieve and change format