Description
An intent defines one or more actions that a solver needs to complete, and the conditions that allow the solver to run those actions.
Schema
Property | Required | Description |
---|---|---|
| Yes | The ID of the network where this intent will be executed |
| No | Replay rules for the intent. Expects an object with
Excluding the |
| No | The block when the intent will expire. Expects an integer value greater than 0. The intent cannot be run in or after the expiry block. |
| No | Array of conditions that must be run by a solver when executing a transaction for the intent |
| Yes | Array of actions that must be completed by a solver when executing a transaction for the intent |
Example
{
chainId: 1,
replay: {
nonce: 555,
runs: 'ONCE'
},
expiryBlock: 21_000_000,
conditions: [{
type: 'price',
operator: 'lt',
tokenA: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', // WETH
tokenB: '0x6B175474E89094C44Da98b954EedeAC495271d0F', // DAI
price: 1400.00
}],
actions: [{
type: 'marketSwap',
tokenIn: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', // WETH
tokenOut: '0x6B175474E89094C44Da98b954EedeAC495271d0F', // DAI
tokenInAmount: 1_500000000000000000
}]
}