Create an unencrypted request
Promise<Request >
Name Type Required? Description requestInfo IRequestInfo true Core request contents signer IIdentity true Identity of the creator and signer of the request. Must be either the payee or payer. paymentNetwork PaymentNetworkCreateParameters false Payment method topics string[] false List of hashes, usually one for each of the request stakeholders contentData Object false Additional arbitrary request contents disablePaymentDetection boolean false Disable payment detection disableEvents boolean false Diable event callbacks
Name Type Requried Description skipRefresh boolean false Disable the request refresh after creation. Warning: the balance will be null.
Name Type Required? Description currency string | ICurrency true The currency in which the request is denominated. Not necessarily the currency in which the payment will occur. expectedAmount number | string true The requested amount in machine-readable integer units. payee IIdentity false Identity of the payee. Required if payer not set payer IIdentity false Identity of the payer. Required if payee not set extensionsData any[] false Raw extensionsData. Not recommended. Prefer contentData and paymentNetwork instead. timestamp number (Unix timestamp) false Timestamp when request is created. User provided, so this is an agreement between payee and payer. nonce number false Optional nonce to differentiate identical requests created at the same timestamp.
PaymentNetworkCreateParameters
Name Type Required? Description type Types.RequestLogic.CURRENCY true Currency type value string true Depends on type.
ERC20 contract address '0x123' Fiat symbol 'USD' Native symbol 'ETH' network ChainName false The chain on which the currency exists
Types.RequestLogic.CURRENCY
Name Value ETH 'ETH' Native (ETH, XDAI, etc.) BTC 'BTC' Bitcoin ISO4217 'ISO4217' Fiat (USD, EUR, etc.) ERC20 'ERC20' Non-native fungible currency (USDC, REQ, etc.) ERC777 'ERC777' Streamable fungible currency (USDCx, REQx, etc.)
Types.Extension.PAYMENT_NETWORK_ID
Name Value Description ANY_DECLARATIVE 'pn-any-declarative' Payer declares payment sent. Payee declares payment received. ANY_TO_ERC20_PROXY 'pn-any-to-erc20-proxy' Swap to ERC20 before sending to payee ANY_TO_ETH_PROXY 'pn-any-to-eth-proxy' Swap to native token before sending to payee. Only works on EVM-compatible chains. ANY_TO_NATIVE_TOKEN 'pn-any-to-native-token' Swap to native token before sending to payee. Only works on NEAR. BITCOIN_ADDRESS_BASED 'pn-bitcoin-address-based' Payee generates a new Bitcoin address. Use block explorer to detect all payments to that address. ERC20_ADDRESS_BASED 'pn-erc20-address-based' Payee generates a new Ethereum address. Use block explorer to detect all payments to that address. ERC20_FEE_PROXY_CONTRACT 'pn-erc20-fee-proxy-contract' Send ERC20 via smart contract with an optional fee. ERC20_PROXY_CONTRACT 'pn-erc20-proxy-contract' Send ERC20 via smart contract ERC20_TRANSFERABLE_RECEIVABLE 'pn-erc20-transferable-receivable' Mint a Request as an NFT. The holder receives the payment. ERC777_STREAM 'pn-erc777-stream' Superfluid stream ETH_FEE_PROXY_CONTRACT 'pn-eth-fee-proxy-contract' Send native token via smart contract with an optional fee. ETH_INPUT_DATA 'pn-eth-input-data' Send native token with paymentReference in the call data. NATIVE_TOKEN 'pn-native-token' Send native token via smart contract with an optional fee on NEAR. TESTNET_BITCOIN_ADDRESS_BASED 'pn-testnet-bitcoin-address-based' Payee generates a new Bitcoin testnet address. Use block explorer to detect all payments to that address.
{% hint style="info" %}
Escrow payments use the ERC20_FEE_PROXY_CONTRACT payment network.
{% endhint %}
graph TD
PnAnyDeclarative.ICreationParameters --> PnAddressBased.ICreationParameters
PnAddressBased.ICreationParameters --> PnReferenceBased.ICreationParameters
PnReferenceBased.ICreationParameters --> PnFeeReferenceBased.ICreationParameters
PnReferenceBased.ICreationParameters --> PnStreamReferenceBased.ICreationParameters
PnFeeReferenceBased.ICreationParameters --> PnAnyToAnyConversion.ICreationParameters
PnAnyToAnyConversion.ICreationParameters --> PnAnyToErc20.ICreationParameters
PnAnyToAnyConversion.ICreationParameters --> PnAnyToEth.ICreationParameters
Loading
PnAnyDeclarative.ICreationParameters
Name Type Required Description paymentInfo any false refundInfo any false payeeDelegate IIdentity false Identity that can update the request on behalf of the payee payerDelegate IIdentity false Identity that can update the request on behalf of the payer salt string false A random number with at least 8 bytes of randomness. It must be unique to each request
PnAddressBased.ICreationParameters
Name Type Required Description paymentAddress string false The payment recipient address refundAddress string false The refund recipient address
PnReferenceBased.ICreationParameters
Name Type Required Description salt string false paymentNetworkName ChainName false The chain name on which the payment will occur
PnFeeReferenceBased.ICreationParameters
Name Type Required Description feeAddress string false The address to which fees will be sent feeAmount string false The fee amount in machine-readable integer units
PnAnyToAnyConversion.ICreationParameters
Name Type Required Description maxRateTimespan number false The maximum acceptable time span between the payment and the conversion rate timestamp network ChainName false The network of the tokens accepted for payments
PnAnyToErc20.ICreationParameters
Name Type Required Description acceptedTokens string[] false A list of token addresses accepted for payments and refunds network EvmChainName false the network of the tokens accepted for payments
PnAnyToEth.ICreationParameters
Identical to PnAnyToAnyConversion.ICreationParameters
PnStreamReferenceBased.ICreationParameters
Equal to IOriginalRequestCreationParameters OR ISubsequentRequestCreationParameters
IOriginalRequestCreationParameters
Name Type Required Description expectedFlowRate string true expectedStartDate string true
ISubsequentRequestCreationParameters
Name Type Required Description previousRequestId string true originalRequestId string true recurrenceNumber string true