Skip to main content
POST
/
v2
/
gasless
/
approve_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.gasless.gasless_approve_transfer(owner="<value>", chain=models.Chain.ARBITRUM, token="<value>", 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": {
      "name": "<string>",
      "version": "<string>",
      "chainId": 123,
      "verifyingContract": "<string>"
    },
    "types": {
      "EIP712Domain": [
        {
          "name": "<string>",
          "type": "<string>"
        }
      ],
      "Permit": [
        {
          "name": "<string>",
          "type": "<string>"
        }
      ]
    },
    "primaryType": "<string>",
    "message": {
      "owner": "<string>",
      "spender": "<string>",
      "value": "<string>",
      "nonce": "<string>",
      "deadline": "<string>"
    }
  }
}

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Body

application/json
owner
string
required

The owner of the smart account's address.

chain
enum<string>
required

Blockchain network

Available options:
base,
ethereum,
arbitrum
token
string
required

The token you would like to transfer with gas sponsorship.

Examples:

"USDC"

"WETH"

"0xA0b86a33E6441ccF30EE5DdEF1E9b652C91ac1c8"

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 ERC-20 Permit signing.