waitForSwap
Wait until a swap transaction is mined and decode its outcome from the router's Swapped (and, when present, FrontendFeeCharged) events.
ts
waitForSwap(hash: Hash): Promise<SwapResult>Usage
ts
const hash = await router.swap(params);
await router.waitForSwap(hash);Returns
The decoded swap outcome.
Throws if the transaction reverted or emitted no Swapped event.
Parameters
hash
- Type:
Hash
Hash returned by any swap method.