Skip to main content
POST
/
v2
/
gasless_transfer
/
prepare_permit
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_transfer.gasless_transfer_prepare_permit(token="<value>", owner="<value>", spender="<value>", value="<value>", deadline=447096, chain=models.Chain.BASE)

    # Handle response
    print(res)
{
  "typed_data": {
    "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>"
    }
  },
  "nonce": 123
}

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Body

application/json

Request model for preparing an ERC-20 Permit (EIP-2612) signature.

token
string
required

The token symbol or address of the ERC-20 token that supports EIP-2612 permit

Examples:

"USDC"

"WETH"

"0xA0b86a33E6441ccF30EE5DdEF1E9b652C91ac1c8"

owner
string
required

Token owner address

spender
string
required

Address to be authorized to spend tokens

value
required

Amount of tokens to approve in decimal format (e.g., 100.5 for 100.5 tokens). The value will be automatically converted to the token's smallest unit using its decimals.

Required range: x > 0
deadline
integer
required

Unix timestamp after which the permit is no longer valid

chain
enum<string>
required

Blockchain network

Available options:
base,
ethereum,
arbitrum

Response

Successful Response

Response containing EIP-712 typed data for permit signing and current nonce.

typed_data
object
required

EIP-712 typed data ready for signing

nonce
integer
required

Current permit nonce for the owner