POST
/
v0
/
generic
/
allowance
/
get
curl --request POST \
  --url https://api.compasslabs.ai/v0/generic/allowance/get \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "chain": "arbitrum:mainnet",
  "user": "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
  "token": "USDC",
  "contract_name": "AaveV3Pool"
}'
{
  "amount": 1.5,
  "decimals": 18,
  "token_symbol": "WETH",
  "token_address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
  "contract_address": "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B"
}

Authorizations

x-api-key
string
header
required

Your Compass API key. Get your key here.

Body

application/json

Request model for getting an ERC20 token allowance.

chain
enum<string>
required

The chain to use.

Available options:
base:mainnet,
ethereum:mainnet,
arbitrum:mainnet
user
string
required

The user to get the ERC20 allowance of.

Example:

"0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45"

token
enum<string>
required

The symbol of the token for which the allowance is checked. Note the supported tokens per chain.

Available options:
1INCH,
AAVE,
BAL,
cbBTC,
cbETH,
CRV,
crvUSD,
DAI,
ENS,
ETHx,
FRAX,
FXS,
GHO,
KNC,
LDO,
LINK,
LUSD,
MKR,
osETH,
PYUSD,
rETH,
RPL,
rsETH,
sDAI,
SNX,
STG,
sUSDe,
tBTC,
UNI,
USDC,
USDe,
USDS,
USDT,
WBTC,
weETH,
WETH,
wstETH,
ARB,
EURS,
MAI,
USDCe,
AERO,
EUR,
VIRTUAL
contract_name
enum<string>
required

The name of the contract to check allowance for.

Available options:
AaveV3Pool,
AaveV3Oracle,
AaveV3ProtocolDataProvider,
AerodromeBasicFactory,
AerodromeSlipstreamFactory,
AerodromeBasicRouter,
AerodromeSlipstreamRouter,
AerodromeBasicPool,
AerodromeSlipstreamPool,
AerodromeSlipstreamNonfungiblePositionManager,
UniswapV3Pool,
UniswapV3Router,
UniswapV3Factory,
UniswapV3NFTPositionManager,
UniswapV3Quoter,
ChainlinkEACAggregatorProxy,
Multicall

Response

200
application/json
Successful Response

Response model for token allowance information.

amount
string
required

Amount of tokens allowed to be spent by spender

Example:

1.5

decimals
integer
required

Number of decimals of the token

Example:

18

token_symbol
enum<string>
required

Symbol of the token Note the supported tokens per chain.

Available options:
1INCH,
AAVE,
BAL,
cbBTC,
cbETH,
CRV,
crvUSD,
DAI,
ENS,
ETHx,
FRAX,
FXS,
GHO,
KNC,
LDO,
LINK,
LUSD,
MKR,
osETH,
PYUSD,
rETH,
RPL,
rsETH,
sDAI,
SNX,
STG,
sUSDe,
tBTC,
UNI,
USDC,
USDe,
USDS,
USDT,
WBTC,
weETH,
WETH,
wstETH,
ARB,
EURS,
MAI,
USDCe,
AERO,
EUR,
VIRTUAL
token_address
string
required

Address of the token

Example:

"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"

contract_address
string
required

Address of the contract

Example:

"0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B"

Was this page helpful?