create-tx
API, the response includes a tx
field. To create an order, it is sufficient to sign the
transaction and submit it to the network. The data
field within tx
contains all necessary instructions for creating an order
on the source chain.
The simplest scenario occurs when bridging reserve assets from the source chain to the destination chain.
In this case, the order creation process on the initiator’s side consists of three distinct steps:
- Step 1: Call
create-tx
API with the required parameters. - Step 2: After receiving the response, call
approve
on the ERC-20 contract of the reserve assets. The spender should be set toresponse.tx.to
value, and the approved amount should match the value specified in the transaction, with caveats.- Note: This step is required only for ERC-20 assets.
- Step 3: Sign response.tx and submit the transaction. This action locks the specified amount of reserve assets on the source chain until the order is either claimed by a solver or cancelled by an authorized entity.