Overview
Request Network supports payments on NEAR, a sharded, proof-of-stake blockchain that offers unique capabilities compared to EVM-compatible chains. NEARβs architecture enables more complex smart contract interactions through asynchronous callbacks and cross-contract calls.NEAR support is currently available through the Request Network SDK only. The Request Network API does not support NEAR blockchain interactions.
Key Differences from EVM Chains
NEAR has several important architectural differences that affect how payments work:Asynchronous Callbacks
Unlike EVM chains where transactions are atomic, NEAR supports asynchronous callbacks that can span multiple transactions or blocks. This enables more complex payment flows but requires different handling.
Account-Based System
NEAR uses human-readable account names (like
alice.near
) instead of hex addresses. Smart contracts are deployed to named accounts and can be upgraded by their owners.Storage Deposits
To receive NEP-141 fungible tokens, accounts must first register with the token contract and pay a small storage deposit (~0.00125 NEAR) to cover storage costs.
Gas Model
NEAR uses a different gas model with TGas (TeraGas) units. Gas costs are predictable and much lower than Ethereum mainnet.
Supported Payment Types
Native NEAR Payments
Direct payments using NEARβs native token through the payment proxy smart contract. Features:- β Direct NEAR token transfers with payment references
- β Fee collection support
- β Payment detection and indexing
Fungible Token Payments (NEP-141)
Payments using NEARβs fungible token standard (NEP-141) equivalent to ERC-20 on Ethereum. Features:- β Support for all NEP-141 compliant tokens
- β Fee collection in the same token
- β Payment detection and indexing
- β οΈ Requires storage deposit registration
Native Token Conversion Payments
Payments for requests denominated in one currency (typically fiat like USD) but paid in NEAR native tokens. On-chain oracles provide real-time price feeds to calculate the correct NEAR amount. Features:- β Conversion payments denominated in USD, settled in NEAR
- β Price conversion at the moment of payment, using onchain price feeds
- β Payment detection and indexing
Smart Contract Addresses
Mainnet (near)
Payment Type | Contract Address | Actions | Description |
---|---|---|---|
Native NEAR Payments | requestnetwork.near | Direct NEAR token payments with references | |
Fungible Token Payments | pay.reqnetwork.near | NEP-141 token payments with fees | |
Native Conversion Payments | native.conversion.reqnetwork.near | Fiat/token to NEAR conversions |
Testnet (near-testnet)
Payment Type | Contract Address | Actions | Description |
---|---|---|---|
Native NEAR Payments | dev-1631521265288-35171138540673 | Direct NEAR token payments with references | |
Fungible Token Payments | pay.reqnetwork.testnet | NEP-141 token payments with fees | |
Native Conversion Payments | native.conversion.reqnetwork.testnet | Fiat/token to NEAR conversions |
Payment Detection
Payment detection for NEAR transactions is handled through dedicated subgraphs:- NEAR Mainnet: Request Payments Near Subgraph
- NEAR Testnet: Request Payments Near Testnet Subgraph
Technical Considerations
Asynchronous Callbacks
NEARβs asynchronous architecture means payment transactions may require multiple blockchain interactions:Storage Deposits
Before receiving NEP-141 tokens, accounts must register with the token contract:Important: Payment addresses must have sufficient storage deposit registered with the token contract. The SDK automatically checks for this requirement and will throw an error if the recipient is not properly registered.
Gas Considerations
NEAR uses a TGas (TeraGas) unit system and gas costs are predictable and much lower than Ethereum mainnet, typically costing fractions of a cent in USD terms.
Integration Guide
Prerequisites
- NEAR Wallet Connection: Applications need to integrate with NEAR wallet providers
- SDK Installation: Use
@requestnetwork/request-client.js
with NEAR support - Account Registration: Ensure payment recipients are registered for token contracts
Basic Payment Flow
Limitations
Current Limitations:
- NEAR support is SDK-only (not available in Request Network API)
- Crosschain payments to/from NEAR are not supported
- Advanced payment types like batch payments are not implemented