Skip to main content
POST
/
v2
/
credit
/
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.credit.credit_transfer(owner="0x4A83fec8c6A9A25Be28f3242a16dBaD0ab00f3a6", chain=models.Chain.BASE, token="USDC", amount=100)

    # Handle response
    print(res)
{
  "eip_712": {
    "types": {
      "EIP712Domain": [
        {
          "name": "name",
          "type": "string"
        },
        {
          "name": "chainId",
          "type": "uint256"
        },
        {
          "name": "verifyingContract",
          "type": "address"
        }
      ],
      "TokenPermissions": [
        {
          "name": "token",
          "type": "address"
        },
        {
          "name": "amount",
          "type": "uint256"
        }
      ],
      "PermitTransferFrom": [
        {
          "name": "permitted",
          "type": "TokenPermissions"
        },
        {
          "name": "spender",
          "type": "address"
        },
        {
          "name": "nonce",
          "type": "uint256"
        },
        {
          "name": "deadline",
          "type": "uint256"
        }
      ]
    },
    "domain": {
      "chainId": 123,
      "verifyingContract": "<string>",
      "name": "Permit2"
    },
    "message": {
      "permitted": {
        "token": "<string>",
        "amount": 1
      },
      "spender": "<string>",
      "nonce": 1,
      "deadline": 1
    },
    "primaryType": "PermitTransferFrom"
  }
}

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Body

application/json
owner
string
default:0x4A83fec8c6A9A25Be28f3242a16dBaD0ab00f3a6
required

The owner's wallet address (EOA).

chain
enum<string>
default:base
required

Blockchain network.

Available options:
base,
ethereum,
arbitrum
token
string
default:USDC
required

The token to transfer from the EOA to the Credit Account.

Examples:

"USDC"

"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"

amount
default:100
required

The amount of tokens to transfer (in token units, not wei).

Required range: x > 0
Example:

100

Response

Successful Response

eip_712
Permit2TypedData · object
required

EIP-712 Permit2 typed data to be signed by the owner's wallet.