End-to-end Transaction Example
Step by step
Requesting a quote or routes
Choose the desired route if `/routes` was used and retrieve transaction data from `/advanced/stepTransaction`
This step is only needed if /routes
endpoint was used. /quote
already returns the transaction data within the response. Difference between /quote
and /routes
is desribed here
Setting the allowance
Before any transaction can be sent, it must be made sure that the user is allowed to send the requested amount from the wallet.
Sending the transaction
After receiving a quote, the transaction has to be sent to trigger the transfer.
Firstly, the wallet has to be configured. The following example connects your wallet to the Gnosis Chain.
Afterward, the transaction can be sent using the transactionRequest
inside the previously retrieved quote:
Executing second step if applicable
If two-step route was used, the second step has to be executed after the first step is complete. Fetch the status of the first step like described in next step and then request transactionData from /advanced/stepTransaction
endpoint.
Fetching the transfer status
To check if the token was successfully sent to the receiving chain, the /status endpoint can be called: