# OneSource - Pay-per-call Ethereum RPC for Agents

> Pay-per-call Ethereum mainnet RPC for AI agents. Live block, balance, contract, NFT, transaction, and event data served directly from mainnet nodes. No API keys, no accounts; pay per request in USDC on Base via x402.

## Discovery

- [OpenAPI 3.1 spec](https://skills.onesource.io/openapi.json)
- [x402 well-known](https://skills.onesource.io/.well-known/x402)
- [Pricing](https://skills.onesource.io/api/pricing)
- [Networks](https://skills.onesource.io/api/networks)

## Paid endpoints

- `GET /api/chain/allowance` ($0.003 USDC) - ERC20 allowance via allowance (eth_call) - how much a spender is approved to move from an owner's wallet
- `GET /api/chain/block-number` ($0.001 USDC) - Latest Ethereum block height - current chain tip via eth_blockNumber
- `GET /api/chain/block/{number}` ($0.003 USDC) - Fetch an Ethereum block header and transaction hashes by number, tag, or hex via eth_getBlockByNumber
- `POST /api/chain/call` ($0.005 USDC) - Simulate a read-only Ethereum contract call via eth_call - no transaction sent
- `GET /api/chain/chain-id` ($0.001 USDC) - Ethereum chain ID (EIP-155) via eth_chainId - confirm which chain a network is on
- `GET /api/chain/code/{address}` ($0.003 USDC) - Check if an Ethereum address is a contract via eth_getCode - returns deployed bytecode
- `GET /api/chain/contract/{address}` ($0.005 USDC) - Contract introspection via eth_call - name, symbol, decimals, and ERC20/721/1155 interface support
- `GET /api/chain/ens/{input}` ($0.005 USDC) - ENS resolve - turn a .eth name into an address, or an address into its primary .eth name, via eth_call on OneSource live Ethereum RPC
- `GET /api/chain/erc1155-balance` ($0.003 USDC) - ERC1155 token balance via balanceOf (eth_call) - how many copies of a token_id a wallet holds
- `GET /api/chain/erc20-balance` ($0.003 USDC) - ERC20 token balance for any Ethereum wallet - USDC, USDT, DAI, or any token - via balanceOf (eth_call) on OneSource live Ethereum RPC
- `GET /api/chain/erc20-transfers` ($0.005 USDC) - ERC20 Transfer logs via eth_getLogs - decoded sender, recipient, and amount for a token or wallet
- `GET /api/chain/erc721-tokens` ($0.008 USDC) - List every ERC721 NFT token_id a wallet owns in a collection via tokenOfOwnerByIndex (eth_call)
- `POST /api/chain/estimate-gas` ($0.004 USDC) - Estimate the gas a transaction will consume via eth_estimateGas before signing it
- `GET /api/chain/events` ($0.005 USDC) - Query Ethereum contract event logs via eth_getLogs - filter by contract, topic, and block range
- `GET /api/chain/live-balance` ($0.003 USDC) - Live wallet balance - native ETH plus any ERC20 tokens in one call via eth_getBalance and balanceOf on OneSource Ethereum RPC
- `GET /api/chain/network-info` ($0.001 USDC) - Ethereum network info - chain ID, block height, and gas price in one batched RPC call (eth_chainId + eth_blockNumber + eth_gasPrice)
- `GET /api/chain/nft-metadata` ($0.008 USDC) - NFT metadata, traits, and image URI for any ERC721 or ERC1155 token - fetched via eth_call with IPFS resolution (OneSource live Ethereum RPC)
- `GET /api/chain/nft-owner` ($0.003 USDC) - Look up the current owner of an ERC721 NFT by token_id via ownerOf (eth_call)
- `GET /api/chain/nonce/{address}` ($0.003 USDC) - Next transaction nonce for any Ethereum wallet via eth_getTransactionCount - how many txs it has sent
- `GET /api/chain/pending` ($0.010 USDC) - Pending Ethereum block - mempool transactions not yet mined, via eth_getBlockByNumber("pending")
- `GET /api/chain/proxy/{address}` ($0.005 USDC) - Detect upgradeable proxy patterns (EIP-1967, UUPS, Transparent) via eth_getStorageAt - returns the implementation address behind a proxy
- `GET /api/chain/receipt/{hash}` ($0.005 USDC) - Transaction receipt via eth_getTransactionReceipt - status, gas, and event logs for a mined Ethereum transaction
- `GET /api/chain/storage` ($0.005 USDC) - Read a raw storage slot from any Ethereum contract via eth_getStorageAt
- `GET /api/chain/total-supply` ($0.003 USDC) - Total supply of an ERC20 or ERC721 token contract via totalSupply (eth_call)
- `GET /api/chain/tx/{hash}` ($0.008 USDC) - Full Ethereum transaction details by hash via eth_getTransactionByHash - from, to, value, calldata, block

## Calling

Each request without payment returns HTTP 402 with a `Payment-Required` header carrying x402 v2 challenge metadata. Use [@x402/fetch](https://www.npmjs.com/package/@x402/fetch) or AgentCash (`npx agentcash try https://skills.onesource.io`) to handle the payment flow automatically.
