Typescript SDK
Sell.prepare
Prepares a finalized Bridge quote for the provided sell request with transaction data. This function will return everything quote does, with the addition of a series of prepared transactions and the associated expiration timestamp.
This will return a quote that might look like:
The transactions array is a series of transactions ready to be executed (with sendTransaction) must be executed one after the other in order to fulfill the complete route. There are a few things to keep in mind when executing these transactions:
Approvals will have the
approvalaction specified. You can perform approvals withsendAndConfirmTransaction, then proceed to the next transaction.All transactions are assumed to be executed by the
senderaddress, regardless of which chain they are on. The final transaction will use thereceiveras the recipient address.If an
expirationtimestamp is provided, all transactions must be executed before that time to guarantee successful execution at the specified price.
NOTE: To get the status of each non-approval transaction, use Bridge.status rather than checking for transaction inclusion. This function will ensure full bridge completion on the destination chain.
You can access this functions input and output types with Sell.prepare.Options and Sell.prepare.Result, respectively.
You can include arbitrary data to be included on any webhooks and status responses with the purchaseData option.
To limit quotes to routes that have a certain number of steps involved, use the maxSteps option.