Resumen
Current USDC and per-vault share-token allowances toward the Earn
contract (the spender), grouped per chain. Each entry carries an
approved flag and, when not approved, a ready-to-sign
approve(spender, amount) template. A share token is approved when
allowance > 0; USDC is approved when allowance >= requiredUsdc.
Allowances and amounts are base-unit strings. Per-chain error
isolation: a failed RPC marks that chain error: "rpc_error" and
never fails the whole response.
Endpoint
GET https://earn-api.quicknode.dev/functions/v1/api/v1/wallets/{addr}/approvals
Authorization
Include the published apikey header. This read request is public and does not require a SIWE signature.
Parámetros
| Parameter | Location | Tipo | Obligatorio | Descripción |
|---|---|---|---|---|
| addr | path | cadena | Sí | Wallet address (`0x` + 40 hex). |
| cadenas | query | cadena | No | CSV of supported chain ids. Defaults to all. |
| requiredUsdc | query | cadena | No | USDC the pending deposit needs, in 6-decimal base units, evaluated against each requested chain's USDC allowance. Default 0 (report-only). |
| vaults | query | cadena | No | CSV of `chainId:0xaddress` vault keys to report. Each key applies only to its own chain; a requested chain with no listed vaults still returns its USDC entry. A key targeting a chain outside the requested set is a 400. Defaults to every approved vault per chain. |
Example request
curl --location 'https://earn-api.quicknode.dev/functions/v1/api/v1/wallets/0x1234567890abcdef1234567890abcdef12345678/approvals' \
--header 'Accept: application/json' \
--header 'apikey: <EARN_PUBLIC_API_KEY>'
Respuesta
| Campo | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| dirección | cadena | Sí | Lowercased wallet address. |
| cadenas | array<object> | Sí | Approval information grouped by chain. |
| chains[].chainId | entero | Sí | EVM chain ID for this approval group. |
| chains[].spender | string | null | Sí | Earn proxy address authorized to spend the tokens, or `null` when the chain lookup fails. |
| chains[].usdc | object | null | Sí | USDC allowance state for the chain, or `null` when it is unavailable. |
| chains[].usdc.token | cadena | Sí | USDC contract address on the chain. |
| chains[].usdc.currentAllowance | cadena | Sí | Current USDC allowance in base units. |
| chains[].usdc.requiredAllowance | cadena | Sí | USDC allowance required by the request, in base units. |
| chains[].usdc.approved | booleano | Sí | Whether the current USDC allowance meets the required allowance. |
| chains[].usdc.tx | objeto | No | Ready-to-sign approval transaction when additional USDC allowance is required. |
| chains[].usdc.tx.to | cadena | Sí | USDC token contract that receives the approval transaction. |
| chains[].usdc.tx.data | cadena | Sí | ABI-encoded `approve(spender, amount)` calldata. |
| chains[].usdc.tx.value | cadena | Sí | Native-token value to send with the transaction, in wei. |
| chains[].vaults | array<object> | Sí | Allowance states for the requested or approved vault share tokens on the chain. |
| chains[].vaults[].token | cadena | Sí | Vault share-token contract address. |
| chains[].vaults[].vaultAddress | cadena | No | Address of the vault represented by the share token. |
| chains[].vaults[].currentAllowance | cadena | Sí | Current vault share-token allowance in base units. |
| chains[].vaults[].requiredAllowance | cadena | Sí | Required vault share-token allowance in base units. |
| chains[].vaults[].approved | booleano | Sí | Whether the vault share token has a non-zero allowance. |
| chains[].vaults[].tx | objeto | No | Ready-to-sign approval transaction when the vault share token is not approved. |
| chains[].vaults[].tx.to | cadena | Sí | Token contract that receives the approval transaction. |
| chains[].vaults[].tx.data | cadena | Sí | ABI-encoded `approve(spender, amount)` calldata. |
| chains[].vaults[].tx.value | cadena | Sí | Native-token value to send with the transaction, in wei. |
| chains[].error | string | null | Sí | `rpc_error` when the chain lookup fails; otherwise `null`. |
Example response
The complete response includes every requested chain and its vault entries. This excerpt shows the Base USDC approval state and one vault approval returned by the API.
{
"address": "0x1234567890abcdef1234567890abcdef12345678",
"chains": [
{
"chainId": 8453,
"spender": "0x48b415841165304f7EfaA7D5dD5FC65cc7B4bd8e",
"usdc": {
"token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"currentAllowance": "0",
"requiredAllowance": "0",
"approved": true
},
"vaults": [
{
"token": "0xc0c5689e6f4D256E861F65465b691aeEcC0dEb12",
"vaultAddress": "0xc0c5689e6f4D256E861F65465b691aeEcC0dEb12",
"currentAllowance": "0",
"requiredAllowance": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
"approved": false,
"tx": {
"to": "0xc0c5689e6f4D256E861F65465b691aeEcC0dEb12",
"data": "0x095ea7b300000000000000000000000048b415841165304f7efaa7d5dd5fc65cc7b4bd8effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"value": "0"
}
}
],
"error": null
}
]
}
HTTP responses
| Estado | Descripción |
|---|---|
| 200 | Approval state and templates, grouped per chain. |
| 400 | Invalid wallet address, chain ID, required allowance, or vault key. |
| 429 | Rate limit exceeded. `Retry-After` (seconds) tells you when to retry. Reads, feedback, and push writes are keyed per IP; create/update/delete are keyed per wallet+IP; deposit/withdraw/claim calldata is keyed per strategy+IP. |
| 500 | Internal server error. |
This page is based on operation getWalletApprovals in the Earn OpenAPI 3.1 specification.