Etherspot
Search…
⌃K

Swaps

Introduction

The Swaps block allows a user to facilitate asset swaps as part of the BUIDLER component.
Users can use assets in their Key Wallet or Smart Wallet to swap assets.
Once a user selects their swap pair and amount, they can then choose a swap offer from the list presented.
Once the user has chosen their offer, they are ready to make the swap.

Implementation

Copy and paste the code below to get started.
import {
Etherspot,
TRANSACTION_BLOCK_TYPE,
} from "@etherspot/react-transaction-buidler";
// ...
return (
<Etherspot
defaultTransactionBlocks={[{ type: TRANSACTION_BLOCK_TYPE.ASSET_SWAP }]}
/>
);