Aller directement au contenu principal

Get wallet approvals – Earn API

Mis à jour le
Jul 31, 2026

Présentation générale

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.

Paramètres

ParamètreLocationTypeObligatoireDescription
addrcheminchaîne de caractèresOuiWallet address (`0x` + 40 hex).
chaînesrequêtechaîne de caractèresNonCSV of supported chain ids. Defaults to all.
requiredUsdcrequêtechaîne de caractèresNonUSDC the pending deposit needs, in 6-decimal base units, evaluated against each requested chain's USDC allowance. Default 0 (report-only).
vaultsrequêtechaîne de caractèresNonCSV 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>'

Réponse

ChampTypeObligatoireDescription
adressechaîne de caractèresOuiLowercased wallet address.
chaînesarray<object>OuiApproval information grouped by chain.
chains[].chainIdentierOuiEVM chain ID for this approval group.
chains[].spenderstring | nullOuiEarn proxy address authorized to spend the tokens, or `null` when the chain lookup fails.
chains[].usdcobject | nullOuiUSDC allowance state for the chain, or `null` when it is unavailable.
chains[].usdc.tokenchaîne de caractèresOuiUSDC contract address on the chain.
chains[].usdc.currentAllowancechaîne de caractèresOuiCurrent USDC allowance in base units.
chains[].usdc.requiredAllowancechaîne de caractèresOuiUSDC allowance required by the request, in base units.
chains[].usdc.approvedbooléenOuiWhether the current USDC allowance meets the required allowance.
chains[].usdc.txobjetNonReady-to-sign approval transaction when additional USDC allowance is required.
chains[].usdc.tx.tochaîne de caractèresOuiUSDC token contract that receives the approval transaction.
chains[].usdc.tx.datachaîne de caractèresOuiABI-encoded `approve(spender, amount)` calldata.
chains[].usdc.tx.valuechaîne de caractèresOuiNative-token value to send with the transaction, in wei.
chains[].vaultsarray<object>OuiAllowance states for the requested or approved vault share tokens on the chain.
chains[].vaults[].tokenchaîne de caractèresOuiVault share-token contract address.
chains[].vaults[].vaultAddresschaîne de caractèresNonAddress of the vault represented by the share token.
chains[].vaults[].currentAllowancechaîne de caractèresOuiCurrent vault share-token allowance in base units.
chains[].vaults[].requiredAllowancechaîne de caractèresOuiRequired vault share-token allowance in base units.
chains[].vaults[].approvedbooléenOuiWhether the vault share token has a non-zero allowance.
chains[].vaults[].txobjetNonReady-to-sign approval transaction when the vault share token is not approved.
chains[].vaults[].tx.tochaîne de caractèresOuiToken contract that receives the approval transaction.
chains[].vaults[].tx.datachaîne de caractèresOuiABI-encoded `approve(spender, amount)` calldata.
chains[].vaults[].tx.valuechaîne de caractèresOuiNative-token value to send with the transaction, in wei.
chains[].errorstring | nullOui`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

StatutDescription
200Approval state and templates, grouped per chain.
400Invalid wallet address, chain ID, required allowance, or vault key.
429Rate 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.
500Internal server error.
OpenAPI source

This page is based on operation getWalletApprovals in the Earn OpenAPI 3.1 specification.