Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

IRouter

Git Source

Author: Async Labs

This interface defines the functions for the Router contract, which allows users to swap tokens and fill orders using async orders.

Functions

swap

Swaps tokens using an async order.

function swap(AsyncOrder calldata order, bytes calldata userData) external;

Parameters

NameTypeDescription
orderAsyncOrderThe async order to be placed.
userDatabytesAdditional data for the user, allowing user to specify an executor.

fillOrder

Fills an async order.

function fillOrder(AsyncOrder calldata order, bytes calldata userData) external;

Parameters

NameTypeDescription
orderAsyncOrderThe async order to be filled.
userDatabytesAdditional data for the user, allowing user to specify an executor.

Structs

SwapCallback

Callback structure for the swap function.

struct SwapCallback {
  ActionType action;
  AsyncOrder order;
}

Properties

NameTypeDescription
actionActionTypeThe action type, either Swap or FillOrder.
orderAsyncOrderThe async order that is in context for the swap or fill operation.

Enums

ActionType

Enum representing the action type for the swap callback.

  1. Swap - If the action is a swap, this will specify the async swap order intent.
  2. FillOrder - If the action is a fill order, this will specify fill order intent.
enum ActionType {
  Swap,
  FillOrder
}