RequestNetwork

Description

The Request Network client.

Usage

import { RequestNetwork } from "@requestnetwork/request-client.js";

Constructor Paramters

NameTypeRequired?Description

nodeConnectionConfig

recommended

Axios configurations

signatureProvider

recommended

Required to sign and create requests

decryptionProvider

optional

Required to retrieve encrypted requests

httpConfig

optional

Options for HTTP transport (timeout, delay, retry, etc.)

paymentOptions

optional

Payment detection options

useMockStorage

boolean

optional

Store ephemeral requests in local memory

currencies

CurrencyInput[]

optional

Custom currency list

currencyManager

ICurrencyManager

optional

Custom currency manager (will override currencies). A Currency manager handles a list of currencies and provides utility to retrieve and change format

Types and Interfaces

AxiosRequestConfig Properties

NameTypeRequired?Description

baseUrl

string

recommended

Request Node URL

Many other properties...

optional

ISignatureProvider Implementations

TypeDescription

Sign using a private key inside of a wallet

Sign using a private key outside of a wallet

IDecryptionProvider Implementations

TypeDescription

Decrypt using a private key outside of a wallet

IHttpDataAccessConfig Properties

NameTypeRequired?Description

requestClientVersionHeader

string

Name of the header containing the client version

httpRequestMaxRetry

number

Maximum number of retries to attempt when http requests to the Node fail

httpRequestRetryDelay

number

Delay between retry in ms

httpRequestExponentialBackoffDelay

number

Exponential backoff delay in ms when requests to the Node fail

httpRequestMaxExponentialBackoffDelay

number

Maximum exponential backoff delay in ms when requests to the Node fail

getConfirmationMaxRetry

number

Maximum number of retries to get the confirmation of a persistTransaction

getConfirmationRetryDelay

number

Delay between retry in ms to get the confirmation of a persistTransaction

getConfirmationExponentialBackoffDelay

number

Exponential backoff delay in ms to get the confirmation of a persistTransaction

getConfirmationMaxExponentialBackoffDelay

number

Maximum exponential backoff delay in ms to get the confirmation of a persistTransaction

getConfirmationDeferDelay

number

Delay to wait in ms before trying for the first time to get the confirmation of a persistTransaction

PaymentNetworkOptions Properties

NameTypeRequired?Description

bitcoinDetectionProvider

IBitcoinDetectionProvider

Override default bitcoin payment detection

explorerApiKeys

Map<ChainName, string>

Override explorer API keys

getSubgraphClient

function(ChainName)

Override subgraph payment detection

getRpcProvider

function(ChainName)

Override RPC node provider

Instance Methods

NameDescription

Create an unencrypted request

_createEncryptedRequest()

Create an encrypted request. Docs coming soon...

Compute a request ID without actually creating a request

Retrieve a request from a requestId

Retrieve an array of requests from an Identity

Retrieve an array of requests from a topic

Last updated