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
  • Overview
  • Key Benefits:
  • How it works:
  • Integration Guide
  • Create a request
  • Deploy Single Request Forwarder
  • Pay through a Single Request Forwarder
  • Design Features:

Was this helpful?

Edit on GitHub
Export as PDF
  1. Advanced
  2. Request Network SDK
  3. SDK Guides
  4. Payment

Single Request Forwarder

PreviousConfiguring Payment FeesNextBatch Payment

Last updated 2 months ago

Was this helpful?

Overview

The Single Request Forwarder is a smart contract solution that enables integration with Request Network's payment system without modifying existing smart contracts.

The Single Request Forwarder Factory contact addresses can be found : Smart Contract Addresses

The contract name is SingleRequestProxyFactory

Key Benefits:

  • Universal Compatibility: Works with any system that can make standard crypto transfers.

  • No Code Changes: Integrate with Request Network without modifying existing smart contracts.

  • Exchange Friendly: Enable payments from centralized exchanges.

How it works:

  1. Request: Create a request in the Request Network protocol

  2. Deploy: Deploy a unique Single Request Forwarder for your request

  3. Pay: The Payer sends funds to the Single Request Forwarder

  4. Complete: The Single Request Forwarder forwards the payment to the Payee and emits an event to enable payment detection.

Integration Guide

Create a request

const request = await requestClient.createRequest(requestCreateParameters);

const requestData = request.getData() 

// In case of in-memory request
 const requestData = request.inMemoryInfo.requestData

Deploy Single Request Forwarder

To deploy a Single Request Forwarder, call deploySingleRequestForwarder() which takes in the following arguments:

  • requestData: the data of the created request

  • signer: An Ethers v5 Signer to sign the deployment transaction

The deploySingleRequestForwarder() function automatically deploys the correct type of Single Request Forwarder based on the Request data passed into the function; either an Ethereum Single Request Forwarder or ERC20 Single Request Forwarder

It returns

  • Single Request Forwarder Address

import { deploySingleRequestForwarder } from "@requestnetwork/payment-processor"

 const forwarderAddress = await deploySingleRequestForwarder(
      requestData,
      signer
    );

console.log(`Single Request Forwarder Deployed At: ${forwarderAddress}`)
// Single Request Forwarder Deployed At : 0x1234567890123456789012345678901234567890

Pay through a Single Request Forwarder

Pay through a Single Request Forwarder using the RN SDK

To pay a request through a Single Request Forwarder using the Request Network SDK, call payRequestWithSingleRequestForwarder() which takes in the following arguments:

  • singleRequestForwarderAddress: the address of the SRP deployed in the previous step.

  • signer: A wallet signer who is making the transfer of funds.

  • amount: Amount of funds that need to be transferred.

import { payRequestWithSingleRequestForwarder } from "@requestnetwork/payment-processor"
import { utils } from "ethers"
const paymentAmount = utils.parseUnits("1" , 18)
await payRequestWithSingleRequestForwarder(forwarderAddress , signer, paymentAmount)

Pay through a Single Request Forwarder using a Direct Transfer

Once we have the Single Request Forwarder address, we can pay by directly transferring the money to the address itself. The Single Request Forwarder will automatically process the payment. For ERC20 payments, the process of paying with a Single Request Forwarder happens in two steps:

  • Transferring the tokens to the Single Request Forwarder

  • Make a zero-value transaction to the Single Request Forwarder (i.e. Send 0 ETH to the contract)

Design Features:

  • Single Use: Each Single Request Forwarder deployment processes payments for a specific request.

  • Immutable Parameters: Payment details cannot be modified after deployment.

  • Fund Recovery: Built-in mechanisms to send stuck funds to the payment receiver.

For a complete guide on request creation, see

Single Request Forwarder Payment Flow
Create a request