From a5fdebec01866979600a01cac495fbd3906766ac Mon Sep 17 00:00:00 2001 From: Roscanta Date: Mon, 11 May 2026 10:59:46 +0300 Subject: [PATCH 1/3] updated lambda docs --- components/GenericMethod/GenericMethod.tsx | 9 + .../wallet/WalletMethod_getevmportfolio.tsx | 1 + .../WalletMethod_getnonevmportfolio.tsx | 1 + .../WalletMethod_getwalletnftsmultichain.tsx | 429 ++++++++++++++++++ pages/_meta.json | 2 + pages/overview-wallet-api.mdx | 35 ++ pages/quickstart-wallet-api.mdx | 118 +++++ pages/wallet-api/nft/_meta.json | 1 + .../nft/getwalletnftsmultichain.mdx | 7 + 9 files changed, 603 insertions(+) create mode 100644 components/method-docs/wallet/WalletMethod_getwalletnftsmultichain.tsx create mode 100644 pages/overview-wallet-api.mdx create mode 100644 pages/quickstart-wallet-api.mdx create mode 100644 pages/wallet-api/nft/getwalletnftsmultichain.mdx diff --git a/components/GenericMethod/GenericMethod.tsx b/components/GenericMethod/GenericMethod.tsx index f2723c2..998fec5 100644 --- a/components/GenericMethod/GenericMethod.tsx +++ b/components/GenericMethod/GenericMethod.tsx @@ -23,6 +23,7 @@ export type GenericMethodProps = { method: string; network: string; cu: number; + culambda?: string; description: string; url?: string | string[]; useCases: string[]; @@ -64,6 +65,7 @@ export default function GenericMethod({ method, network, cu, + culambda, description, url, useCases, @@ -136,6 +138,13 @@ export default function GenericMethod({ + + + {network}{" "} + [{culambda}] + + + {description} diff --git a/components/method-docs/wallet/WalletMethod_getevmportfolio.tsx b/components/method-docs/wallet/WalletMethod_getevmportfolio.tsx index 7c09284..2d3b823 100644 --- a/components/method-docs/wallet/WalletMethod_getevmportfolio.tsx +++ b/components/method-docs/wallet/WalletMethod_getevmportfolio.tsx @@ -10,6 +10,7 @@ export function WalletMethod_getevmportfolio() { + ); +} + +const CODE_SNIPPETS: Array = [ + { + language: "shell", + code: () => `curl --request GET \\ + --url https://lb.drpc.live/{chain}/{key}/lambda/v1/wallets/{address}/nfts \\ + --header 'accept: application/json'`, + }, + { + language: "js", + code: () => `fetch("https://lb.drpc.live/{chain}/{key}/lambda/v1/wallets/{address}/nfts", { + method: "GET", + headers: { + "accept": "application/json" + } +}) + .then(res => res.json()) + .then(console.log) + .catch(console.error);`, + }, + { + language: "node", + code: () => `import fetch from "node-fetch"; + +const res = await fetch("https://lb.drpc.live/{chain}/{key}/lambda/v1/wallets/{address}/nfts", { + method: "GET", + headers: { + "accept": "application/json" + } +}); + +const data = await res.json(); +console.log(data);`, + }, + { + language: "go", + code: () => `package main + +import ( + "fmt" + "io" + "net/http" +) + +func main() { + req, _ := http.NewRequest("GET", "https://lb.drpc.live/{chain}/{key}/lambda/v1/wallets/{address}/nfts", nil) + req.Header.Set("accept", "application/json") + + client := &http.Client{} + resp, err := client.Do(req) + if err != nil { + panic(err) + } + defer resp.Body.Close() + + body, _ := io.ReadAll(resp.Body) + fmt.Println(string(body)) +}`, + }, + { + language: "rust", + code: () => `use reqwest::header::ACCEPT; + +#[tokio::main] +async fn main() -> Result<(), Box> { + let client = reqwest::Client::new(); + + let res = client + .get("https://lb.drpc.live/{chain}/{key}/lambda/v1/wallets/{address}/nfts") + .header(ACCEPT, "application/json") + .send() + .await?; + + let body = res.text().await?; + println!("{}", body); + + Ok(()) +}`, + }, + { + language: "python", + code: () => `import requests + +url = "https://lb.drpc.live/{chain}/{key}/lambda/v1/wallets/{address}/nfts" +headers = { + "accept": "application/json" +} + +response = requests.get(url, headers=headers) +print(response.json())`, + }, +]; + +const RESPONSE_JSON = `{ + "data": [ + { + "type": "nft", + "id": "0xe7b9d5a2b01b23985356f521e0f5016eec201234:ethereum:0x9690b63eb85467be5267a3603f770589ab12dc95:15060", + "chain_id": "ethereum", + "chain_id_numeric": 1, + "chain_name": "Ethereum", + "amount": 1, + "price": 79.667354, + "value_usd": 79.667354, + "attributes": { + "token_id": "15060", + "contract_address": "0x9690b63eb85467be5267a3603f770589ab12dc95", + "name": "Leila Lacerator of the Rune Raiders", + "interface": "ERC721", + "image_url": "https://lh3.googleusercontent.com/1YGMrTrpMkI9Ch7ZvDxkGzCyuUznBESmWwmSuHxSZx3iqczOEi1MZE9lXrC-xYVrq5mFnu8y9WB5MZSbacKvcms-tXOtfg_-ow=s250", + "collection": { + "id": "2695", + "name": "Forgotten Runes Warriors Guild", + "description": "Forgotten Runes Warriors Guild\\r\\n\\r\\n[Sister Collections](https://opensea.io/collection/forgottenrunes)", + "icon_url": "https://lh3.googleusercontent.com/8uCBJ-m9No4zAPWuuvRz-2uxZ3uBt9HfYO0wUj_v-zLHvTAr9W2rpNGRRkTPyNfn8Q1HMvSvQEtlD22RVoWkn20E1_O-Mj9BBw", + "banner_url": "https://lh3.googleusercontent.com/kjbHmiQhpsYIPy5RFdST8XNYIwg-5WTtWUGavhfaF_lXEzrMKtC_-nrdUrUt9cuejuOMv-CW5klEzqDPivHD5o6L6hSKEhUn_k8=w2500" + } + } + }, + { + "type": "nft", + "id": "0xe7b9d5a2b01b23985356f521e0f5016eec201234:polygon:0x98e62fe371519d1d07e6f5bfce04737d4dacabfd:1", + "chain_id": "polygon", + "chain_id_numeric": 137, + "chain_name": "Polygon", + "amount": 5, + "price": 6.660082750547, + "value_usd": 33.300413752735, + "attributes": { + "token_id": "1", + "contract_address": "0x98e62fe371519d1d07e6f5bfce04737d4dacabfd", + "name": "Holiday Lootbox (1st Edition)", + "interface": "ERC1155", + "image_url": "https://lh3.googleusercontent.com/1YGMrTrpMkI9Ch7ZvDxkGzCyuUznBESmWwmSuHxSZx3iqczOEi1MZE9lXrC-xYVrq5mFnu8y9WB5MZSbacKvcms-tXOtfg_-ow=s250", + "collection": { + "id": "308732", + "name": "NFT Worlds Items", + "description": "The official items collection for NFT Worlds. \\r\\n\\r\\nItems and lootboxes within this collection are exclusively created by the NFT Worlds team.", + "icon_url": "https://lh3.googleusercontent.com/cdYxiSmSB7iLLl8zMAX7PaTtq5NsAkJz2TFkn9aJATR8rjuCczf2JucdEyXmlLLDJxMxbSkLAAkfLSxR25mXaDoAF3QW3MORuOAN", + "banner_url": "https://lh3.googleusercontent.com/hUFM5Je9hUAuLHOuEJ6ake5sVoVe0mX8HyGA1uaSBQIza2l7Tc9DgqMm4nK6JfR47FV6RSZvN0QzMTZFt4TTzL2qH21F0hSrWA=w2500" + } + } + } + ], + "next_page_token": "IjIi" +}`; + +const PATH_PARAMS: ReqResParam[] = [ + { + paramName: "chain", + type: "string", + paramDescription: "[Required] Chain name (e.g. ethereum, polygon)", + }, + { + paramName: "key", + type: "string", + paramDescription: "[Required] Your dRPC API key", + }, + { + paramName: "address", + type: "string", + paramDescription: "[Required] Wallet address", + }, +]; + +const QUERY_PARAMS: RequestParamProp = [ + { + paramName: "chain_ids", + type: "array", + paramDescription: "IDs of chains (using Lambda API names) that support NFTs. Default: all supported chains. Max length: 19.", + childrenParamsType: "string" + }, + { + paramName: "collection_ids", + type: "array", + paramDescription: "IDs of collections. Default: all collections.", + childrenParamsType: "integer" + }, + { + paramName: "with_meta_data", + type: "boolean", + paramDescription: "Whether to include metadata enrichment. Default: false." + }, + { + paramName: "refresh_cache", + type: "boolean", + paramDescription: "Force-refresh metadata cache. Default: false." + }, + { + paramName: "page_token", + type: "string", + paramDescription: "Token to retrieve the next page." + }, + { + paramName: "limit", + type: "integer", + paramDescription: "[Required] ≤ 100. Number of NFTs to retrieve." + } +]; + +const REQUEST_PARAMS: RequestParamProp = []; + +const RESPONSE_PARAMS: ReqResParam[] = [ + { + paramName: "data", + type: "array", + paramDescription: "[Required] NFT data", + childrenParamsType: "object", + childrenParams: [ + { + paramName: "type", + type: "string", + paramDescription: "[Required] Type of the entity" + }, + { + paramName: "id", + type: "string", + paramDescription: "[Required] ID of the entity" + }, + { + paramName: "chain_id", + type: "string", + paramDescription: "[Required] ID of the chain" + }, + { + paramName: "chain_id_numeric", + type: "integer", + paramDescription: "Numeric ID of the chain" + }, + { + paramName: "chain_name", + type: "string", + paramDescription: "[Required] Name of the chain" + }, + { + paramName: "amount", + type: "number", + paramDescription: "[Required] Amount of tokens" + }, + { + paramName: "price", + type: "number", + paramDescription: "Price of the token" + }, + { + paramName: "value_usd", + type: "number", + paramDescription: "Value of the token in USD" + }, + { + paramName: "attributes", + type: "object", + paramDescription: "[Required] NFT details", + childrenParamsType: "object", + childrenParams: [ + { + paramName: "token_id", + type: "string", + paramDescription: "[Required] ID of the token" + }, + { + paramName: "contract_address", + type: "string", + paramDescription: "[Required] NFT address" + }, + { + paramName: "name", + type: "string", + paramDescription: "[Required] NFT name" + }, + { + paramName: "interface", + type: "string", + paramDescription: "[Required] NFT interface" + }, + { + paramName: "image_url", + type: "string", + paramDescription: "[Required] URL of image content, if any" + }, + { + paramName: "preview_url", + type: "string", + paramDescription: "[Required] URL of preview image content, if any" + }, + { + paramName: "video_url", + type: "string", + paramDescription: "[Required] URL of video content, if any" + }, + { + paramName: "audio_url", + type: "string", + paramDescription: "[Required] URL of audio content, if any" + }, + { + paramName: "last_update_time", + type: "string", + paramDescription: "Time of the last NFT update" + }, + { + paramName: "collection", + type: "object", + paramDescription: "[Required] NFT collection info", + childrenParamsType: "object", + childrenParams: [ + { + paramName: "id", + type: "string", + paramDescription: "[Required] NFT collection ID" + }, + { + paramName: "name", + type: "string", + paramDescription: "[Required] NFT collection name" + }, + { + paramName: "description", + type: "string", + paramDescription: "[Required] NFT collection description" + }, + { + paramName: "icon_url", + type: "string", + paramDescription: "NFT collection icon URL, if any" + }, + { + paramName: "banner_url", + type: "string", + paramDescription: "NFT collection banner URL, if any" + }, + { + paramName: "number_of_assets", + type: "integer", + paramDescription: "Total number of NFTs in the collection, if known" + }, + { + paramName: "number_of_owners", + type: "integer", + paramDescription: "Number of unique owners in the collection, if known" + }, + { + paramName: "marketplace_urls", + type: "array", + paramDescription: "Marketplace URLs for the collection, if any" + } + ] +}, + { + paramName: "marketplace_urls", + type: "array", + paramDescription: "Marketplace URLs for the NFT" + } + + ] +}, + { + paramName: "traits", + type: "object", + paramDescription: "NFT traits dictionary" + }, + { + paramName: "owner_address", + type: "string", + paramDescription: "Address of the NFT owner" + }, + { + paramName: "creator_address", + type: "string", + paramDescription: "Address of the NFT creator" + }, + { + paramName: "spam", + type: "object", + paramDescription: "Spam classification result" + }, + { + paramName: "raw_metadata", + type: "object", + paramDescription: "Raw metadata as returned by the NFT's tokenURI" + }, + + ] + +}, +{ + paramName: "next_page_token", + type: "string", + paramDescription: "Token to retrieve next page" +} + +]; + +const USE_CASES = [ + "Display NFTs owned by a wallet in EVM chain", + "Build NFT portfolio dashboards", +]; + +const CONSTRAINTS = [ + "Requires valid wallet address", + "Only NFTs on supported chains are returned", +]; \ No newline at end of file diff --git a/pages/_meta.json b/pages/_meta.json index cdea04b..588d264 100644 --- a/pages/_meta.json +++ b/pages/_meta.json @@ -31,6 +31,8 @@ "type": "separator", "title": "Data & Wallet API" }, + "overview-wallet-api": "Overview", + "quickstart-wallet-api": "Quickstart", "wallet-api": "Wallet API", "-- Core RPC API": { diff --git a/pages/overview-wallet-api.mdx b/pages/overview-wallet-api.mdx new file mode 100644 index 0000000..18dbcaf --- /dev/null +++ b/pages/overview-wallet-api.mdx @@ -0,0 +1,35 @@ +# Overview + +The **dRPC Data & Wallet API** is a comprehensive REST API designed for developers building wallets, portfolio trackers, dApps, and analytic dashboards. It provides instant access to aggregated, human-readable on-chain data across multiple networks without the need to maintain complex indexing infrastructure. + +### Raw RPC vs. Indexed Data + +Standard RPC nodes are the backbone of Web3, providing the ultimate flexibility and raw access needed for deep blockchain interactions. However, when building user-facing apps that require aggregated data — like calculating historical DeFi PnL, fetching cross-chain balances, or filtering spam tokens—developers typically have to build and maintain custom indexing infrastructure on top of their RPCs. + +**The Solution:** The dRPC Data & Wallet API acts as a powerful complement to your standard nodes. It handles the complex indexing layer for you, delivering instant, ready-to-use JSON responses for high-level portfolio queries so you can ship faster. + +### At a Glance + +- **Ready-to-use wallet & portfolio data** via REST API +- **Balances, transactions, DeFi positions & Wallet PnL** +- **20k+ tokens, 8k+ DeFi protocols** across all supported networks +- **35+ EVM chains and Solana** +- **DeFi & Staking historical rewards and Missed Yield data** + +### Core Use Cases + +### 1. Token Balances to build dApps + +Build apps and wallets using Balances and Transactions data across 35+ EVM chains and Solana. Basic Web3 data can still be challenging—spam tokens, deep history, accurate pricing—but the Data API handles it all for high-load apps. + +### 2. Retain DeFi users with a unified DeFi portfolio + +Showing DeFi positions alongside standard token balances helps users track their entire portfolio in one wallet without needing to interact with dozens of different dApps. + +### 3. Activation mechanics for Earn products + +Use Missed Yield data to power smart CTAs like: *"You could earn $3k more using Protocol X pools instead of Protocol Y (by holding assets)."* This drives your revenue, especially if you have revenue-share contracts with specific protocols. + +### Ready to build? + +Head over to the [Quickstart](http://drpc.org/docs/quickstart-wallet-api) to make your first API call in under a minute. \ No newline at end of file diff --git a/pages/quickstart-wallet-api.mdx b/pages/quickstart-wallet-api.mdx new file mode 100644 index 0000000..0fcd52b --- /dev/null +++ b/pages/quickstart-wallet-api.mdx @@ -0,0 +1,118 @@ +# Quickstart + +Get up and running with the Data & Wallet API in less than a minute. In this guide, we will fetch the complete token balances for a specific wallet address on Ethereum. + +### Step 1: Get Your API Endpoint + +The Data & Wallet API is enabled by default for all dRPC paid users. No extra activation is required. + +1. Log in to your [dRPC Dashboard](https://drpc.org/). +2. Navigate to **API Keys** and select your active key (or create a new one). +3. On the key's page, locate the **Data & Wallet API** card. Copy the base URL provided there. + +Your base URL will look like: + +``` +https://lb.drpc.live/lambda/ +``` + +For per-chain requests, the base URL includes the network: + +``` +https://lb.drpc.live///lambda +``` + +### Step 2: Make Your First Request + +Let's fetch token balances for vitalik.eth on Ethereum. We'll use the per-chain endpoint `GET /lambda/v1/wallets/{address}/balances`: + +**cURL:** + +```bash +curl --request GET \ + --url 'https://lb.drpc.live/ethereum//lambda/v1/wallets/0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045/balances' \ + --header 'Accept: application/json' +``` + +**JavaScript (Fetch):** + +```jsx +const chain = 'ethereum'; +const apiToken = ''; +const address = '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'; + +fetch(`https://lb.drpc.live/${chain}/${apiToken}/lambda/v1/wallets/${address}/balances`, { + method: 'GET', + headers: { 'Accept': 'application/json' } +}) + .then(response => response.json()) + .then(data => console.log(data)) + .catch(err => console.error(err)); +``` + +### Step 3: Understand the Response + +You will receive a structured JSON response containing the wallet's token holdings with current USD values, amounts, and contract metadata: + +```json +{ + "balances": [ + { + "chain_id": 1, + "address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", + "symbol": "ETH", + "name": "Ethereum", + "decimals": 18, + "amount": "4.502841", + "price_usd": 2295.40, + "value_usd": 10335.42, + "logo_url": "https://assets.coingecko.com/coins/images/279/small/ethereum.png" + }, + { + "chain_id": 1, + "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", + "symbol": "USDC", + "name": "USD Coin", + "decimals": 6, + "amount": "1930.504200", + "price_usd": 1.00, + "value_usd": 1930.50, + "logo_url": "https://assets.coingecko.com/coins/images/6319/small/usdc.png" + }, + { + "chain_id": 1, + "address": "0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9", + "symbol": "AAVE", + "name": "Aave", + "decimals": 18, + "amount": "52.180000", + "price_usd": 178.25, + "value_usd": 9300.09, + "logo_url": "https://assets.coingecko.com/coins/images/12645/small/aave.png" + } + ], + "total_value_usd": 21565.01 +} +``` + +### Step 3.5: Try the Global Endpoint + +The per-chain endpoint above returns balances for one network. To get **cross-chain balances in a single call**, use the global endpoint `GET /v2/wallets/{address}/balances`: + +```bash +curl --request GET \ + --url 'https://lb.drpc.live/lambda//v2/wallets/0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045/balances' \ + --header 'Accept: application/json' +``` + +This returns balances across all supported chains at once — no need to query each network separately. + +### Next Steps + +Now that you have successfully connected, explore other core endpoints to power your application's DeFi features: + +- [Get Portfolio](https://drpc.org/docs/wallet-api/wallet/getevmportfolio) — Full DeFi portfolio with positions across 8k+ protocols, including supply, borrow, LP, staking and rewards. +- [Get Wallet PnL History](https://drpc.org/docs/wallet-api/wallet/getpnlhistory) — Historical profit and loss data per token and DeFi position. +- [Get Transaction History](https://drpc.org/docs/wallet-api/wallet/gettransactionshistory) — Decoded, human-readable transfer and interaction logs. +- [Get Tokens Net Worth](https://drpc.org/docs/wallet-api/wallet/getpnlformultiplewallets) — Total wallet value aggregated across all holdings. +- [Get Recommendations](https://drpc.org/docs/wallet-api/wallet/getyieldrecommendations) — Missed Yield opportunities to power Earn product CTAs. \ No newline at end of file diff --git a/pages/wallet-api/nft/_meta.json b/pages/wallet-api/nft/_meta.json index 8f2121e..b81bca9 100644 --- a/pages/wallet-api/nft/_meta.json +++ b/pages/wallet-api/nft/_meta.json @@ -1,5 +1,6 @@ { "getwalletnfts": "Get Wallet NFTs (Non-EVM)", + "getwalletnftsmultichain": "Get Wallet NFTs (Multichain / EVM)", "getnftcollections": "Get NFT Collections", "getnftmetadatabyid": "Get NFT Metadata by ID", "refreshnftmetadata": "Refresh NFT Metadata" diff --git a/pages/wallet-api/nft/getwalletnftsmultichain.mdx b/pages/wallet-api/nft/getwalletnftsmultichain.mdx new file mode 100644 index 0000000..5191642 --- /dev/null +++ b/pages/wallet-api/nft/getwalletnftsmultichain.mdx @@ -0,0 +1,7 @@ +# Get Wallet NFTs - Wallet & Data API + +## Get Wallet NFTs - Returns list of wallet NFTS + +import { WalletMethod_getwalletnftsmultichain } from "components/method-docs/wallet/WalletMethod_getwalletnftsmultichain"; + + From f01d47444f8defcf73fe1321cc6f7d6a8ef43d13 Mon Sep 17 00:00:00 2001 From: Roscanta Date: Mon, 18 May 2026 12:15:07 +0300 Subject: [PATCH 2/3] edited culambda param --- components/GenericMethod/GenericMethod.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/components/GenericMethod/GenericMethod.tsx b/components/GenericMethod/GenericMethod.tsx index 998fec5..0e79284 100644 --- a/components/GenericMethod/GenericMethod.tsx +++ b/components/GenericMethod/GenericMethod.tsx @@ -139,9 +139,11 @@ export default function GenericMethod({ - - {network}{" "} - [{culambda}] + + {network}{" "} + {culambda && ( + [{culambda}] + )} From 4ca2de22de69212c0cbec2719812e9178f57a659 Mon Sep 17 00:00:00 2001 From: Roscanta Date: Mon, 18 May 2026 16:06:42 +0300 Subject: [PATCH 3/3] edited culambda param again --- components/GenericMethod/GenericMethod.tsx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/components/GenericMethod/GenericMethod.tsx b/components/GenericMethod/GenericMethod.tsx index 0e79284..a04d298 100644 --- a/components/GenericMethod/GenericMethod.tsx +++ b/components/GenericMethod/GenericMethod.tsx @@ -136,16 +136,14 @@ export default function GenericMethod({ {method} - {network}{" "} [Value: {cu}CU] - - - - {network}{" "} - {culambda && ( - [{culambda}] - )} - + {culambda && + + {network}{" "} + [{culambda}] + + }