Skip to main content
POST
/
v2
/
earn
/
deposit
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_deposit(owner="0x2e04F6705F8a855E8411e79e7668ceA6407De9ea", chain=models.Chain.ETHEREUM, vault_address="0xbEef047a543E45807105E51A8BBEFCc5950fcfBa", amount="0.1", gas_sponsorship=False)

    # Handle response
    print(res)
{
  "transaction": {
    "chainId": "<string>",
    "data": "<string>",
    "from": "<string>",
    "gas": "<string>",
    "to": "<string>",
    "value": "<string>",
    "nonce": "<string>",
    "maxFeePerGas": "<string>",
    "maxPriorityFeePerGas": "<string>"
  },
  "eip_712": {
    "domain": {
      "chainId": 123,
      "verifyingContract": "<string>"
    },
    "types": {
      "EIP712Domain": [
        {
          "name": "<string>",
          "type": "<string>"
        }
      ],
      "SafeTx": [
        {
          "name": "<string>",
          "type": "<string>"
        }
      ]
    },
    "primaryType": "<string>",
    "message": {
      "to": "<string>",
      "value": "<string>",
      "operation": 0,
      "safeTxGas": "<string>",
      "baseGas": "<string>",
      "gasPrice": "<string>",
      "gasToken": "<string>",
      "refundReceiver": "<string>",
      "nonce": "<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
vault_address
string
required

The vault address you are depositing to.

Examples:

"0xbEef047a543E45807105E51A8BBEFCc5950fcfBa"

amount
required

The amount of underlying token to deposit into the vault.

Required range: x > 0
Examples:

1.5

gas_sponsorship
boolean
default:false

Optionally request gas sponsorship. If set to true, EIP-712 signature data will be returned that must be signed by the owner and submitted to the /sponsor_gas endpoint.

Response

Successful Response

transaction
object | null
required
eip_712
object | null
required

Response containing EIP-712 typed data for Safe transaction signing.