quicknode
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseQuicknode: Blockchain Data Access for Agents
Quicknode: 面向Agent的区块链数据访问
Quicknode provides high-performance RPC endpoints across 77+ blockchain networks including all chains Bankr supports: Base, Ethereum, Polygon, Solana, and Unichain.
Two ways to access:
- API key: Create a Quicknode account, get an endpoint URL with auth baked in. Full access to all products and settings.
- x402 (no account needed): Any wallet with USDC can authenticate and pay per request. Install and start querying immediately.
@quicknode/x402
Quicknode为77+区块链网络提供高性能RPC端点,覆盖Bankr支持的所有链:Base、Ethereum、Polygon、Solana和Unichain。
两种访问方式:
- API密钥:创建Quicknode账户,获取内置身份验证的端点URL,可完全访问所有产品和设置。
- x402(无需账户):任何持有USDC的钱包都可以进行身份验证并按请求付费。安装即可立即开始查询。
@quicknode/x402
x402 Access (Recommended for Agents)
x402访问(推荐Agent使用)
x402 is ideal for autonomous agents. No signup, no API keys. Pay with USDC on Base, Polygon, or Solana.
typescript
import { createQuicknodeX402Client } from "@quicknode/x402";
const client = await createQuicknodeX402Client({
baseUrl: 'https://x402.quicknode.com',
network: "eip155:84532", // pay on Base Sepolia (testnet)
evmPrivateKey: process.env.PRIVATE_KEY,
preAuth: true, // pre-authenticates via SIWX for faster payment flow
});
// Pay on Base, query any chain
const res = await client.fetch("https://x402.quicknode.com/ethereum-mainnet", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ jsonrpc: "2.0", method: "eth_blockNumber", params: [], id: 1 }),
});Install:
npm install @quicknode/x402Credit pricing:
- Testnet: 100 credits for $0.01 USDC
- Mainnet: 1,000,000 credits for $10 USDC
- 1 credit per successful JSON-RPC response
Full x402 docs: https://x402.quicknode.com/llms.txt
x402非常适合自主Agent,无需注册,无需API密钥,可在Base、Polygon或Solana上使用USDC支付。
typescript
import { createQuicknodeX402Client } from "@quicknode/x402";
const client = await createQuicknodeX402Client({
baseUrl: 'https://x402.quicknode.com',
network: "eip155:84532", // pay on Base Sepolia (testnet)
evmPrivateKey: process.env.PRIVATE_KEY,
preAuth: true, // pre-authenticates via SIWX for faster payment flow
});
// Pay on Base, query any chain
const res = await client.fetch("https://x402.quicknode.com/ethereum-mainnet", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ jsonrpc: "2.0", method: "eth_blockNumber", params: [], id: 1 }),
});安装:
npm install @quicknode/x402信用定价:
- 测试网:0.01 USDC兑换100积分
- 主网:10 USDC兑换1,000,000积分
- 每次成功的JSON-RPC响应消耗1积分
x402完整文档:https://x402.quicknode.com/llms.txt
API Key Access
API密钥访问
Quicknode endpoints include authentication in the URL:
https://{ENDPOINT_NAME}.{NETWORK}.quiknode.pro/{API_KEY}/typescript
import { createPublicClient, http } from "viem";
import { base } from "viem/chains";
const client = createPublicClient({
chain: base,
transport: http(process.env.QUICKNODE_RPC_URL),
});
const block = await client.getBlockNumber();Quicknode端点在URL中包含身份验证信息:
https://{ENDPOINT_NAME}.{NETWORK}.quiknode.pro/{API_KEY}/typescript
import { createPublicClient, http } from "viem";
import { base } from "viem/chains";
const client = createPublicClient({
chain: base,
transport: http(process.env.QUICKNODE_RPC_URL),
});
const block = await client.getBlockNumber();Common Agent Operations
常见Agent操作
Check Native Balance (EVM)
查询原生余额(EVM)
typescript
const balance = await client.getBalance({ address: "0x..." });Or raw RPC:
json
{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x...", "latest"], "id": 1 }typescript
const balance = await client.getBalance({ address: "0x..." });或原始RPC:
json
{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x...", "latest"], "id": 1 }Check ERC-20 Token Balance (EVM)
查询ERC-20代币余额(EVM)
Use with the ERC-20 selector ():
eth_callbalanceOf(address)0x70a08231json
{
"jsonrpc": "2.0",
"method": "eth_call",
"params": [{
"to": "0xTOKEN_CONTRACT",
"data": "0x70a08231000000000000000000000000WALLET_ADDRESS_NO_0x"
}, "latest"],
"id": 1
}使用带有ERC-20 选择器()的:
balanceOf(address)0x70a08231eth_calljson
{
"jsonrpc": "2.0",
"method": "eth_call",
"params": [{
"to": "0xTOKEN_CONTRACT",
"data": "0x70a08231000000000000000000000000WALLET_ADDRESS_NO_0x"
}, "latest"],
"id": 1
}Get Gas Estimate (EVM)
获取Gas估算(EVM)
json
{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }json
{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }Check Transaction Status (EVM)
查询交易状态(EVM)
json
{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0xTX_HASH"], "id": 1 }json
{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0xTX_HASH"], "id": 1 }Solana Balance
Solana余额
json
{ "jsonrpc": "2.0", "method": "getBalance", "params": ["WALLET_PUBKEY"], "id": 1 }json
{ "jsonrpc": "2.0", "method": "getBalance", "params": ["WALLET_PUBKEY"], "id": 1 }Solana Token Accounts
Solana代币账户
json
{
"jsonrpc": "2.0",
"method": "getTokenAccountsByOwner",
"params": [
"WALLET_PUBKEY",
{ "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" },
{ "encoding": "jsonParsed" }
],
"id": 1
}json
{
"jsonrpc": "2.0",
"method": "getTokenAccountsByOwner",
"params": [
"WALLET_PUBKEY",
{ "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" },
{ "encoding": "jsonParsed" }
],
"id": 1
}Quicknode Marketplace Add-ons
Quicknode市场插件
Quicknode endpoints can be enhanced with Marketplace add-ons. Relevant ones for trading agents:
- Token API: returns all ERC-20 balances for a wallet in one call. No need to query each token contract individually.
qn_getWalletTokenBalance - NFT API: returns NFTs owned by an address with metadata.
qn_fetchNFTs - Solana Priority Fee API: returns recommended priority fees based on recent network activity. Useful for ensuring transactions land quickly.
qn_estimatePriorityFees - Solana DAS API: Query compressed NFTs, fungible tokens, and digital assets via methods like and
getAssetsByOwner.searchAssets - Metis - Solana Trading API: Jupiter-powered token swaps on Solana. Get quotes and execute swaps via and
quoteGetendpoints. Docs: https://www.quicknode.com/docs/solana/metis-overviewswapPost
See all add-ons: https://marketplace.quicknode.com/
These add-ons are available on API key endpoints. Enable them in the Quicknode dashboard.
Quicknode端点可以通过市场插件扩展功能,适合交易Agent的相关插件包括:
- Token API:可一次调用返回钱包的所有ERC-20余额,无需单独查询每个代币合约。
qn_getWalletTokenBalance - NFT API:返回地址持有的NFT及元数据。
qn_fetchNFTs - Solana优先级费用API:基于近期网络活动返回推荐的优先级费用,有助于确保交易快速上链。
qn_estimatePriorityFees - Solana DAS API:通过和
getAssetsByOwner等方法查询压缩NFT、同质化代币和数字资产。searchAssets - Metis - Solana交易API:Jupiter驱动的Solana代币兑换功能,可通过和
quoteGet端点获取报价和执行兑换。文档:https://www.quicknode.com/docs/solana/metis-overviewswapPost
这些插件可在API密钥端点上使用,在Quicknode控制台中启用即可。
Supported Networks
支持的网络
All Bankr-supported chains are available on Quicknode:
| Chain | x402 Network Slug | API Key Docs |
|---|---|---|
| Base | | https://www.quicknode.com/docs/base |
| Ethereum | | https://www.quicknode.com/docs/ethereum |
| Polygon | | https://www.quicknode.com/docs/polygon |
| Solana | | https://www.quicknode.com/docs/solana |
| Unichain | | https://www.quicknode.com/docs/unichain |
x402 base URL:
https://x402.quicknode.com/{network-slug}See full list of supported chains: https://www.quicknode.com/chains
所有Bankr支持的链都可在Quicknode上使用:
| Chain | x402 Network Slug | API Key Docs |
|---|---|---|
| Base | | https://www.quicknode.com/docs/base |
| Ethereum | | https://www.quicknode.com/docs/ethereum |
| Polygon | | https://www.quicknode.com/docs/polygon |
| Solana | | https://www.quicknode.com/docs/solana |
| Unichain | | https://www.quicknode.com/docs/unichain |
x402基础URL:
https://x402.quicknode.com/{network-slug}查看所有支持的链:https://www.quicknode.com/chains
Error Handling
错误处理
- 429 Too Many Requests: Back off and retry. Use exponential backoff.
- 402 Payment Required (x402): Credits depleted. handles this automatically by triggering a new USDC payment.
@quicknode/x402 - JSON-RPC errors (e.g., ): Method-specific errors. Check params and retry.
-32000
- 429 请求过多:退避重试,建议使用指数退避策略。
- 402 需要付费(x402):积分不足,会自动触发新的USDC支付来处理该问题。
@quicknode/x402 - JSON-RPC错误(例如):方法特定错误,检查参数后重试。
-32000
Resources
资源
- AI & Agents docs: https://www.quicknode.com/docs/build-with-ai
- Full RPC documentation (all chains): https://www.quicknode.com/docs/llms.txt
- x402 technical details: https://x402.quicknode.com/llms.txt
- Code examples (x402): https://github.com/quiknode-labs/qn-x402-examples
- Marketplace add-ons: https://marketplace.quicknode.com
- Full Quicknode skill with extended references: https://github.com/quiknode-labs/blockchain-skills/tree/main/skills/quicknode-skill
- AI & Agent文档:https://www.quicknode.com/docs/build-with-ai
- 完整RPC文档(所有链):https://www.quicknode.com/docs/llms.txt
- x402技术细节:https://x402.quicknode.com/llms.txt
- 代码示例(x402):https://github.com/quiknode-labs/qn-x402-examples
- 市场插件:https://marketplace.quicknode.com
- 包含扩展参考的完整Quicknode skill:https://github.com/quiknode-labs/blockchain-skills/tree/main/skills/quicknode-skill