Skip to main content
POST
/
v2
/
safe
/
sponsor_gas
Python (SDK)
from compass_api_sdk import CompassAPI, models


with CompassAPI(
    api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:

    res = compass_api.safe.safe_sponsor_gas(owner="<value>", chain=models.Chain.ETHEREUM, message={
        "to": "<value>",
        "value": "<value>",
        "data": "0xac5F96FeDb".encode(),
        "operation": models.OperationType.ONE,
        "safe_tx_gas": "<value>",
        "base_gas": "<value>",
        "gas_price": "<value>",
        "gas_token": "<value>",
        "refund_receiver": "<value>",
        "nonce": "<value>",
    }, signature="<value>", gas_sponsor_address="<value>")

    # Handle response
    print(res)
{
  "transaction": {
    "chainId": "<string>",
    "data": "<string>",
    "from": "<string>",
    "gas": "<string>",
    "to": "<string>",
    "value": "<string>",
    "nonce": "<string>",
    "maxFeePerGas": "<string>",
    "maxPriorityFeePerGas": "<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
message
object
required

The message that was returned as part of the EIP-712 signature.

signature
string
required

The EIP-712 signed typed data signature.

gas_sponsor_address
string
required

The address of the wallet which will send the transaction.

Response

Successful Response

transaction
object
required

Transaction to deploy Safe