Skip to main content
POST
/
v2
/
credit
/
bundle
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_bundle(owner="<value>", chain=models.Chain.ARBITRUM, actions=[
        models.CreditUserOperation(
            body=models.EarnTransferFromEOAParams(
                token="<value>",
                amount="709.93",
                permit2_signature="<value>",
                permit2_nonce=210517,
                permit2_deadline=120606,
            ),
        ),
    ], gas_sponsorship=False)

    # Handle response
    print(res)
{
  "actions_count": 3,
  "transaction": {
    "chainId": "0x2105",
    "data": "0x6a761202000000000000000000000000...",
    "from": "0xc98949522db2eE403d6c75E91DDEe875a824bB10",
    "gas": "0xdbba0",
    "maxFeePerGas": "0x3b9aca00",
    "maxPriorityFeePerGas": "0x5f5e100",
    "nonce": "0x2e",
    "to": "0xaB5801a7D398351b8bE11C439e05C5B3259aeC9B",
    "value": "0x0"
  },
  "eip_712": {
    "domain": {
      "chainId": 8453,
      "verifyingContract": "0x6B90E8B4E3E971E74C1A47a3a20976377E2dB4b1"
    },
    "message": {
      "baseGas": "0",
      "data": "0x8d80ff0a0000000000000000000000000000000000000000000000000000000000000020",
      "gasPrice": "0",
      "gasToken": "0x0000000000000000000000000000000000000000",
      "nonce": "7",
      "operation": 1,
      "refundReceiver": "0x0000000000000000000000000000000000000000",
      "safeTxGas": "0",
      "to": "0x93C23AAE4793C14D6DF35D2A2A2234204e1559dA",
      "value": "0"
    },
    "primaryType": "SafeTx",
    "types": {
      "EIP712Domain": [
        {
          "name": "chainId",
          "type": "uint256"
        },
        {
          "name": "verifyingContract",
          "type": "address"
        }
      ],
      "SafeTx": [
        {
          "name": "to",
          "type": "address"
        },
        {
          "name": "value",
          "type": "uint256"
        },
        {
          "name": "data",
          "type": "bytes"
        },
        {
          "name": "operation",
          "type": "uint8"
        },
        {
          "name": "safeTxGas",
          "type": "uint256"
        },
        {
          "name": "baseGas",
          "type": "uint256"
        },
        {
          "name": "gasPrice",
          "type": "uint256"
        },
        {
          "name": "gasToken",
          "type": "address"
        },
        {
          "name": "refundReceiver",
          "type": "address"
        },
        {
          "name": "nonce",
          "type": "uint256"
        }
      ]
    }
  }
}

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Body

application/json

Request to execute multiple credit actions in a single atomic transaction.

owner
string
required

The owner's wallet address that controls the Credit Account.

chain
enum<string>
required

Target blockchain network where the bundled actions will execute.

Available options:
base,
ethereum,
arbitrum
actions
CreditUserOperation · object[]
required

List of actions to bundle. Actions are executed in order.

Required array length: 1 - 20 elements
gas_sponsorship
boolean
default:false

If true, returns EIP-712 typed data for gas-sponsored execution.

Response

Successful Response

actions_count
integer
required

Number of individual transactions bundled in this execution.

Example:

3

transaction
UnsignedTransaction · object

Unsigned transaction for direct execution by the owner. Present when gas_sponsorship=false.

Example:
{
"chainId": "0x2105",
"data": "0x6a761202000000000000000000000000...",
"from": "0xc98949522db2eE403d6c75E91DDEe875a824bB10",
"gas": "0xdbba0",
"maxFeePerGas": "0x3b9aca00",
"maxPriorityFeePerGas": "0x5f5e100",
"nonce": "0x2e",
"to": "0xaB5801a7D398351b8bE11C439e05C5B3259aeC9B",
"value": "0x0"
}
eip_712
BatchedSafeOperationsResponse · object

EIP-712 typed data for gas-sponsored execution. Present when gas_sponsorship=true. Owner must sign and submit to /gas_sponsorship/prepare.

Example:
{
"domain": {
"chainId": 8453,
"verifyingContract": "0x6B90E8B4E3E971E74C1A47a3a20976377E2dB4b1"
},
"message": {
"baseGas": "0",
"data": "0x8d80ff0a0000000000000000000000000000000000000000000000000000000000000020",
"gasPrice": "0",
"gasToken": "0x0000000000000000000000000000000000000000",
"nonce": "7",
"operation": 1,
"refundReceiver": "0x0000000000000000000000000000000000000000",
"safeTxGas": "0",
"to": "0x93C23AAE4793C14D6DF35D2A2A2234204e1559dA",
"value": "0"
},
"primaryType": "SafeTx",
"types": {
"EIP712Domain": [
{ "name": "chainId", "type": "uint256" },
{
"name": "verifyingContract",
"type": "address"
}
],
"SafeTx": [
{ "name": "to", "type": "address" },
{ "name": "value", "type": "uint256" },
{ "name": "data", "type": "bytes" },
{ "name": "operation", "type": "uint8" },
{ "name": "safeTxGas", "type": "uint256" },
{ "name": "baseGas", "type": "uint256" },
{ "name": "gasPrice", "type": "uint256" },
{ "name": "gasToken", "type": "address" },
{
"name": "refundReceiver",
"type": "address"
},
{ "name": "nonce", "type": "uint256" }
]
}
}