Admin Login
HomeGuidesAPI ReferenceChangelogBlockdaemon Main Docs
Log In
Guides

Gas-Sponsored Transactions

Sponsor EVM gas and sweep deposit addresses

Gas-sponsored transactions

A sponsor account can pay the native gas for an EVM contract call. Deposit addresses can then move tokens without holding ETH, or the native gas token of that chain.

The sweep path has two operations:

  1. POST /api/cwp/operations/start/generateConsolidationData builds the call data and EIP-7702 authorizations for the deposit indexes you name.
  2. POST /api/cwp/operations/start/sponsor submits that call. The sponsor account is the fee payer.

Both operations follow transaction restrictions. Track each one with operation submission and status.

This sweep is available on networks that ship with a consolidation gateway:

NetworkChain idGateway
Ethereum mainneteip155:10xF0707d6B59AD11765016CD11477DDf94DDc2feBE
Ethereum Hoodieip155:5600480xA48c4E0158312301C89B3C1E1A7538990c29a719
Ethereum Sepoliaeip155:111551110x725DCbD76c4478618E1f57322bcE6dEdf8cE2bf9
Polygon mainneteip155:1370xF0707d6B59AD11765016CD11477DDf94DDc2feBE
Polygon Amoyeip155:800020x918C691F014B621721c6E3D24d160BBe02808b05

The sponsor ContractAddress is that gateway. Other EVM networks can still register and transfer. They do not include this gateway, so this sweep shape does not apply there.

1. Build the sweep

SubAddressData lists each deposit index and the amount to return to the main address. Amount is base units. Asset is the token symbol. One request can include several indexes and several assets.

curl -s -X POST "https://<wallet-host>/api/cwp/operations/start/generateConsolidationData" \
  -H "authorization: <api-key>" \
  -H "content-type: application/json" \
  -d '{
    "OperationID": "sweep-data-1",
    "CAIP19": "eip155:11155111/slip44:60",
    "Asset": "ETH",
    "TestNetwork": true,
    "MasterKeyName": "default",
    "Account": "deposits",
    "SubAddressData": [
      { "Asset": "ETH", "Amount": "10000000000000000", "SubAddressIndex": 1 },
      { "Asset": "USDC", "Amount": "25000000", "SubAddressIndex": 1 }
    ]
  }'

When the operation succeeds, Result.ConsolidationData contains:

  • Data, hex call data for the gateway
  • EIP7702Authorizations, authorizations for the sweep
  • EIP7702AuthorizationsForReset, authorizations that clear the temporary delegation after the sweep

2. Sponsor the sweep

Source is the sponsor account. Copy Data and EIP7702Authorizations from the result. The deposit addresses are not the fee source.

curl -s -X POST "https://<wallet-host>/api/cwp/operations/start/sponsor" \
  -H "authorization: <api-key>" \
  -H "content-type: application/json" \
  -d '{
    "OperationID": "sweep-sponsor-1",
    "CAIP19": "eip155:11155111/slip44:60",
    "Asset": "ETH",
    "TestNetwork": true,
    "Source": { "MasterKeyName": "default", "AccountName": "gas" },
    "ContractAddress": "0x725DCbD76c4478618E1f57322bcE6dEdf8cE2bf9",
    "EVM": {
      "Data": "<ConsolidationData.Data>",
      "EIP7702Authorizations": ["<ConsolidationData.EIP7702Authorizations entries>"]
    }
  }'

The sponsor account needs enough native gas for the call. The deposit address does not.

3. Clear the delegation

Submit a second sponsor operation with an empty ContractAddress, no call data, and EIP7702AuthorizationsForReset from the same consolidation result. That returns the deposit addresses to their previous code.

curl -s -X POST "https://<wallet-host>/api/cwp/operations/start/sponsor" \
  -H "authorization: <api-key>" \
  -H "content-type: application/json" \
  -d '{
    "OperationID": "sweep-reset-1",
    "CAIP19": "eip155:11155111/slip44:60",
    "Asset": "ETH",
    "TestNetwork": true,
    "Source": { "MasterKeyName": "default", "AccountName": "gas" },
    "ContractAddress": "",
    "EVM": {
      "EIP7702Authorizations": ["<ConsolidationData.EIP7702AuthorizationsForReset entries>"]
    }
  }'

A deposit address that already holds native gas can use consolidate funds instead of this sponsor path.

🗣️We Are Here to Help!

Please contact us via email or support chat if you encounter an issue, bug, or need assistance. Don't forget to include any relevant details about the problem. To request a wallet form and Institutional Vault Approver form, please click here or contact our sales team.


Did this page help you?