Skip to main content
GET
/
v1
/
generic
/
allowance
Python (SDK)
from compass_api_sdk import CompassAPI, models


with CompassAPI(
    api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:

    res = compass_api.universal.generic_allowance(chain=models.V1GenericAllowanceChain.ARBITRUM, token="USDC", contract="<value>", user="0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B")

    # Handle response
    print(res)
{
  "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.

Query Parameters

chain
enum<string>
default:arbitrum
required
Available options:
arbitrum,
base,
ethereum
user
string
default:0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B

The user to get the ERC20 allowance of.

token
string
default:USDC
required

The symbol or address of the token for which the allowance is checked.

Examples:

"USDC"

"WETH"

"0xA0b86a33E6441ccF30EE5DdEF1E9b652C91ac1c8"

contract
default:AaveV3Pool
required

The name or address of the contract to check allowance for.

Available options:
AaveV3Pool,
AerodromeBasicRouter,
AerodromeSlipstreamRouter,
AerodromeSlipstreamNonfungiblePositionManager,
UniswapV3Router,
UniswapV3NFTPositionManager,
Morpho,
SkyDaiUsdsConverter,
SkyUsdcUsdsConverter,
SkyUsdsVault,
PendleRouter,
OdosRouter,
EthenaVault

Response

Successful Response

Response model for token allowance information.

amount
string
required

Amount of tokens allowed to be spent by spender

Examples:

1.5

decimals
integer
required

Number of decimals of the token

Examples:

18

token_symbol
string
required

Symbol of the token.

Examples:

"WETH"

token_address
string
required

Address of the token

Examples:

"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"

contract_address
string
required

Address of the contract

Examples:

"0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B"