Skip to main content
POST
/
v2
/
earn
/
transfer
Python (SDK)
from compass_api_sdk import CompassAPI, models


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

    res = compass_api.earn.earn_transfer(owner="<value>", chain=models.Chain.ETHEREUM, token="USDC", amount="0.1", action=models.EarnTransferRequestAction.FUND)

    # Handle response
    print(res)
{
  "transaction": {
    "chainId": "<string>",
    "data": "<string>",
    "from": "<string>",
    "gas": "<string>",
    "to": "<string>",
    "value": "<string>",
    "nonce": "<string>",
    "maxFeePerGas": "<string>",
    "maxPriorityFeePerGas": "<string>"
  }
}

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Body

application/json
owner
string
required

The owner's wallet address.

chain
enum<string>
required

Blockchain network

Available options:
base,
ethereum,
arbitrum
token
string
required

The token you would like to transfer.

Examples:

"USDC"

"WETH"

"0xA0b86a33E6441ccF30EE5DdEF1E9b652C91ac1c8"

amount
required

The amount of 'token' to transfer.

Required range: x > 0
Examples:

1.5

action
enum<string>
required

Whether you are funding or withdrawing from your earn account.

Available options:
FUND,
WITHDRAW

Response

Successful Response

transaction
object
required