Extract the two Ethereum USDC payment rows from a recorded transaction that also contains an ETH payment.
Prerequisites
- An API key with the Data API scope, exported as
RANGE_API_KEY. Use the shared quickstart for key setup and Bearer authentication.
- Python 3.10 or later and
httpx for the complete script: python -m pip install httpx.
- Ethereum network identifier
eth and transaction hash 0xe22fefdfb13dc89c83473480881a8f4f16e9b8e3c9ed60aa5727afdc4baaf1e2, recorded from a live response. This is a transaction hash, not a transfer ID.
- USDC contract
0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 on Ethereum, listed in Circle’s contract addresses. The example uses its six decimal places.
- GET /v1/network/payments, which accepts
network, hash, limit, and offset. This example verifies Ethereum (eth); see the reference’s network support for a verified Cosmos Hub input. These recorded lookups do not establish availability on every network.
The network payment operation reads payments for a known transaction. It has no contract-address filter, so select matching base_denom values from its returned rows. The address payment operation projects symbol fields without a token contract; this recipe uses the network operation to retain the contract identity. A USDC symbol by itself does not establish that identity.
1. Read the first payment row
Call GET /v1/network/payments with offset=0 and limit=1.
Recorded HTTP 200 on October 21, 2026, abbreviated:
The first row has base_denom: "eth", so it does not match the USDC contract. The response reports total: 3 payment rows for this hash, not three transactions or three USDC payments.
2. Read the next row and match the contract
Call GET /v1/network/payments with the same network, hash, and limit, and offset=1.
Recorded HTTP 200 on October 21, 2026, abbreviated:
Here, base_denom matches the Ethereum USDC contract. Keep base_amount: "45370" as an integer string; with six decimal places it is 0.045370 USDC. The script compares the Ethereum contract in lowercase and retains the sender, receiver, and transaction hash.
3. Read the remaining payment row
Call GET /v1/network/payments with offset=2.
Recorded HTTP 200 on October 21, 2026, abbreviated:
This row matches the same contract. Its base_amount: "21000000" is 21.000000 USDC. Keep it as a separate payment row with its own receiver.
4. Confirm the end of the result set
Call GET /v1/network/payments with offset=3.
Recorded HTTP 200 on October 21, 2026:
The empty payment array ends this sample. Use Working with responses for the offset convention.
Complete script
Save this as stablecoin_flows.py, then run python stablecoin_flows.py with RANGE_API_KEY set. It fetches every payment page for this transaction and retains only the approved Ethereum contract. Amount arithmetic uses the exact base-unit strings.
The recorded run prints payment_rows: 3, stablecoin_payment_rows: 2, other_payment_rows: 1, and distinct_transactions: 1, with USDC quantities 0.045370 and 21.000000. These are payment-row and transaction counts for this one query. The script does not query or count transfer records, and the result does not represent all payments on the network.
See Working with responses for response conventions, network support for this operation, and Errors and rate limits for failures and retry guidance. Last modified on November 9, 2026