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.EarnTransferToEOAParams(
                token="<value>",
                amount="709.93",
            ),
        ),
    ], gas_sponsorship=False)

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

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.

transaction
UnsignedTransaction · object

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

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.