Networks and Endpoints
The Morpher DataFeed is available on both Radix Mainnet and Stokenet (testnet). This page provides the network configurations, API endpoints, and component addresses for both networks.
DataFeed Request Flow
The following diagram illustrates the complete flow of a signed price request in the Morpher DataFeed system:
Detailed Flow Explanation
-
User Request: The user interacts with the frontend application and initiates a transaction that requires price data.
-
DApp Backend Signing: The DApp backend creates a signed request that includes:
- Market ID (e.g., “GATEIO:XRD_USDT”)
- NFT ID (subscription identifier)
- Public key (stored in the NFT)
- Signature (signed with the DApp’s private key)
-
DataFeed Request: The signed request is sent to the DataFeed backend.
-
DataFeed Verification: The DataFeed backend verifies:
- The signature is valid (signed by the DApp)
- The NFT exists and is valid
- The public key in the request matches the one stored in the NFT
-
DataFeed Response: If verification passes, the DataFeed:
- Gets the latest price data
- Signs it with the DataFeed’s private key
- Returns the signed price data
-
Transaction Creation: The frontend creates a transaction manifest that includes the signed price data.
-
Smart Contract Verification: The process works as follows:
- The smart contract calls the DataFeed component with the signed price data
- The DataFeed component verifies the signature and returns a PriceMessage
- The smart contract checks that the price data is fresh (not too old)
- The smart contract executes its business logic (e.g., minting a Gumball token)
For more details on how the DataFeed handles timestamp validation, especially for markets with limited trading hours, see our Timestamp Validation guide.
This secure flow ensures that only authorized DApps can access DataFeed data and that the data used in transactions is authentic and up-to-date.
Network Configurations
Mainnet Configuration
| Component | Address/URL |
|---|---|
| Network ID | 1 (RadixNetwork.Mainnet) |
| API Endpoint | https://radix-datafeed-api.morpher.com |
| Sample API Endpoint | https://radix-sample-dapp-api.morpher.com |
| Dapp Definition Address | account_rdx1298rzsrujtaqsd2nv4skp8p7er5s6egeyhwtkrxx0lnksgyd270dex |
| DataFeed Component Address | component_rdx1cp07hrz378zfugcf6h8f9usct4zqx7rdgjhxjwphkzxyv9h7l2q04s |
| DataFeed Subscription Component Address | component_rdx1cqeam5fe0jmy2x0hfanzcherd8tvfg5pqwfa8sjzw7azuk0d3vwygl |
| DataFeed Subscription Resource Address | resource_rdx1nfeeyrpqdkrcjmng09tdrtr6cpknlz0qadra0p3wc3ffg7p6w848gd |
| Gumball Resource Address | resource_rdx1t4kd5f5rxkyjayr5a5tsvm0cmujyg76lq8vgdyrsrynrq8zqxez23h |
| Gumball Component Address | component_rdx1cpn0l0tdjmxuaqktrgtxfdepnra27g5xhxv6feyrj3yjhg3wjsur8e |
| XRD Address | resource_rdx1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxradxrd |
Stokenet Configuration
| Component | Address/URL |
|---|---|
| Network ID | 2 (RadixNetwork.Stokenet) |
| API Endpoint | https://dev-test-radix-datafeed-api.morpher.com |
| Sample API Endpoint | https://dev-test-radix-sample-dapp-api.morpher.com |
| Dapp Definition Address | account_tdx_2_12xmevme9ujzqe3yuyq37ampaa2dw633luw8446gumfycltqe5qty66 |
| DataFeed Component Address | component_tdx_2_1cqv8gntu3avns3e8ft3v9ju7wk2n7yhlzrkygc64hpvjkcnjpyglr8 |
| DataFeed Subscription Component Address | component_tdx_2_1cqd5w7as9mq5rzrjtavnaauhtwh7kgu9lxumdtdpqkv3erj0u9dy2n |
| DataFeed Subscription Resource Address | resource_tdx_2_1nt8kpf7m6g9l0p6w6yu4jd0pc4vac564s8f20qmzf782r90fmrgrpt |
| Gumball Resource Address | resource_tdx_2_1t4tf97xvmkkjsdwejp40h942wgftaefa07jl7m4m0akwwqdq7s9nsn |
| Gumball Component Address | component_tdx_2_1cz7h4d9vvq76w9mwly2g2nma7h3h4rfu2gf6cc02w56fs3xsw5cueh |
| XRD Address | resource_tdx_2_1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxtfd2jc |
Environment Variables
When integrating the Morpher DataFeed into your application, you should use environment variables to configure the network settings. The tables above show the current values for reference, but you should always use the environment variables in your code to ensure you’re using the correct values for your environment.
For a complete implementation example of how to use these environment variables, see the Integration Guide.
API Endpoints
DataFeed API
The DataFeed API provides endpoints for requesting signed price data:
- Price Endpoint (v2):
{API_ENDPOINT}/v2/price/{marketId}/{publicKey}/{nftId}/{signature}marketId: The ID of the market (e.g., “GATEIO:XRD_USDT”)publicKey: Your BLS public keynftId: Your subscription NFT IDsignature: Signature of the request
Sample API
The Sample API provides simplified endpoints for demonstration purposes:
- Get Price:
{SAMPLE_API_ENDPOINT}/example/getPrice- Returns signed price data for a predefined market
Using the Network Configuration
In your application, you can use the network configuration as follows:
import { RadixNetwork } from '@radixdlt/radix-dapp-toolkit';
// Network configuration based on selected network
const getNetworkConfig = (network: 'mainnet' | 'stokenet') => {
return {
networkId: network === 'mainnet' ? RadixNetwork.Mainnet : RadixNetwork.Stokenet,
apiEndpoint: network === 'mainnet'
? process.env.NEXT_PUBLIC_RADIX_MAINNET_API_ENDPOINT
: process.env.NEXT_PUBLIC_RADIX_STOKENET_API_ENDPOINT,
sampleApiEndpoint: network === 'mainnet'
? process.env.NEXT_PUBLIC_RADIX_MAINNET_SAMPLE_API_ENDPOINT
: process.env.NEXT_PUBLIC_RADIX_STOKENET_SAMPLE_API_ENDPOINT,
dappDefinitionAddress: network === 'mainnet'
? process.env.NEXT_PUBLIC_RADIX_MAINNET_DAPP_DEFINITION_ADDRESS
: process.env.NEXT_PUBLIC_RADIX_STOKENET_DAPP_DEFINITION_ADDRESS,
oracleComponentAddress: network === 'mainnet'
? process.env.NEXT_PUBLIC_RADIX_MAINNET_ORACLE_COMPONENT_ADDRESS
: process.env.NEXT_PUBLIC_RADIX_STOKENET_ORACLE_COMPONENT_ADDRESS,
// ... other configuration properties
};
};
// Get the configuration for the current network
const networkConfig = getNetworkConfig(currentNetwork);For a complete implementation example, see the Integration Guide.