Request Network Docs
WebsiteGithubStatusDiscord
  • Request Network Docs
  • Request Network API
    • Create and Pay Requests
    • Crosschain Payments
    • EasyInvoice: API Demo App
    • API Portal: Manage API Keys and Webhooks
      • Manage API Keys and Webhooks programmatically
    • Full API Reference
  • General
    • Lifecycle of a Request
    • Request Scan
    • Supported Chains
      • Smart Contract Addresses
    • Request Network Token List
  • Advanced
    • Request Network SDK
      • Get Started
        • Quickstart - Browser
        • Quickstart - Node.js
        • Installation
        • SDK Injector
        • Request Node Gateways
      • SDK Demo Apps
        • Request Invoicing
          • Pay from Safe Multisig
        • Request Checkout
        • Components
          • Create Invoice Form
          • Invoice Dashboard
          • Payment Widget
          • Add Stakeholder
      • SDK Guides
        • Request Client
          • Configure the Request Client
          • Updating a Request
          • Payment Reference
          • Compute a Request ID without creating the request
          • Use your own signature mechanism
          • Support a new currency
          • In-Memory Requests
        • Encryption and Decryption
          • Encrypt with a wallet signature using Lit Protocol
          • Encrypt with an Ethereum private key
          • Share an encrypted request
        • Payment
          • Detect a payment
          • Native Payment
          • Conversion Payment
          • Declarative Payment
          • Configuring Payment Fees
          • Single Request Forwarder
          • Batch Payment
          • Swap-to-Pay Payment
          • Swap-to-Conversion Payment
          • Transferable Receivable Payment
          • Meta Payments
          • Escrow Payment
          • Streaming Payment
          • Pay through a proxy-contract with a multisig
          • Hinkal Private Payments
        • Mobile using Expo
      • SDK Reference
        • request-client.js
          • RequestNetwork
            • createRequest()
            • computeRequestId()
            • fromRequestId()
            • fromIdentity()
            • fromTopic()
          • Request
            • waitForConfirmation()
            • getData()
            • refresh()
            • cancel()
            • accept()
            • increaseExpectedAmountRequest()
            • reduceExpectedAmountRequest()
          • IIdentity
          • IRequestDataWithEvents
          • PaymentReferenceCalculator
        • payment-processor
          • payRequest()
        • web3-signature
          • Web3SignatureProvider
        • epk-signature
          • EthereumPrivateKeySignatureProvider
        • epk-decryption
          • EthereumPrivateKeyDecryptionProvider
    • Protocol Overview
      • SDK and Request Node Overview
      • Payment Networks
      • Private Requests using Encryption
      • Smart Contracts Overview
    • Internal SDK Architecture
      • Request Logic
      • Advanced Logic
      • Transaction
      • Data-access
      • Storage
      • Data flow
      • Request IPFS network
  • FAQ
  • Glossary
  • Contributing
Powered by GitBook
On this page
  • Description
  • Usage
  • Constructor Paramters
  • Types and Interfaces
  • AxiosRequestConfig Properties
  • ISignatureProvider Implementations
  • IDecryptionProvider Implementations
  • IHttpDataAccessConfig Properties
  • PaymentNetworkOptions Properties
  • Instance Methods

Was this helpful?

Edit on GitHub
Export as PDF
  1. Advanced
  2. Request Network SDK
  3. SDK Reference
  4. request-client.js

RequestNetwork

Description

The Request Network client.

Usage

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

Constructor Paramters

Name
Type
Required?
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

Name
Type
Required?
Description

baseUrl

string

recommended

Request Node URL

Many other properties...

optional

ISignatureProvider Implementations

Type
Description

Sign using a private key inside of a wallet

Sign using a private key outside of a wallet

IDecryptionProvider Implementations

Type
Description

Decrypt using a private key outside of a wallet

IHttpDataAccessConfig Properties

Name
Type
Required?
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

Name
Type
Required?
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

Name
Description

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

Previousrequest-client.jsNextcreateRequest()

Last updated 1 year ago

Was this helpful?

Web3SignatureProvider
EthereumPrivateKeySignatureProvider
EthereumPrivateKeyDecryptionProvider
createRequest()
computeRequestId()
fromRequestId()
fromIdentity()
fromTopic()
AxiosRequestConfig
ISignatureProvider
IDecryptionProvider
IHttpDataAccessConfig
PaymentNetworkOptions