All Skills

Embedded Crosschain Actions

Execute contract calls on the destination chain immediately after a bridge or swap. Bridge + mint, stake, or deposit in a single transaction.

Edit

Embedded Crosschain Actions

Embedded actions let you execute contract calls on the destination chain immediately after a bridge/swap using POST /swap/approval. This is useful for minting, staking, or depositing into a protocol as part of the same user flow.

How it works

  1. Submit POST /swap/approval with an actions array in the JSON body. All the same query parameters as GET /swap/approval apply (tradeType, amount, inputToken, outputToken, originChainId, destinationChainId, depositor, etc.).
  2. The swap and bridge execute.
  3. Actions execute on the destination chain in the order provided.

Action Object Structure

{
  "actions": [
    {
      "target": "0x...",
      "functionSignature": "function transfer(address,uint256)",
      "args": [
        {
          "value": "0xRecipientAddress",
          "populateDynamically": false
        },
        {
          "value": "0",
          "populateDynamically": true,
          "balanceSourceToken": "0xTokenAddress"
        }
      ],
      "value": "0",
      "isNativeTransfer": false
    }
  ]
}

Field Reference

FieldDescription
targetTarget contract address for the action
functionSignatureFunction signature to call (for example, function transfer(address,uint256))
args[]Array of function arguments
args[].valueStatic value for the argument
args[].populateDynamicallyIf true, populate the argument at execution time
args[].balanceSourceTokenToken address to source the balance from (required when populateDynamically is true)
valueNative token value (wei) to send with the call
isNativeTransferIf true, execute a native token transfer instead of a contract call

Dynamic Argument Population

When populateDynamically is true, the argument value is populated using the balance of balanceSourceToken at execution time. Use this when you want the action to consume the full swapped balance of a token.

Common Patterns

Transfer ERC-20 after swap

{
  "target": "0xTokenAddress",
  "functionSignature": "function transfer(address to, uint256 value)",
  "args": [
    { "value": "0xRecipient", "populateDynamically": false },
    { "value": "0", "populateDynamically": true, "balanceSourceToken": "0xTokenAddress" }
  ],
  "value": "0",
  "isNativeTransfer": false
}

Simple native transfer

{
  "target": "0xRecipient",
  "functionSignature": "",
  "args": [],
  "value": "10000000000000000",
  "isNativeTransfer": true
}

Failure Behavior

Important Notes