# swap-velora-evm

A lightweight package that lets EVM wallet accounts swap tokens using the velora aggregator. It provides a clean SDK for token swaps on EVM chains and works with both standard wallets and ERC‑4337 smart accounts.

## Features

* **Token Swapping**: Execute token swaps through velora on supported EVM networks
* **Account Abstraction**: Compatible with standard EVM accounts and ERC‑4337 smart accounts
* **Fee Controls**: Optional `swapMaxFee` to cap gas costs
* **Allowance Safety**: Handles USD₮ mainnet pattern (reset allowance to 0 before approve)
* **Provider Flexibility**: Works with JSON‑RPC URLs and EIP‑1193 providers
* **TypeScript Support**: Full TypeScript definitions included

## Supported Networks

Works with EVM networks supported by velora (e.g., Ethereum, Polygon, Arbitrum, etc.). A working RPC provider is required.

## Wallet Compatibility

The swap service supports multiple EVM wallet types:

* **Standard EVM Wallets**: `@tetherto/wdk-wallet-evm` accounts
* **ERC‑4337 Smart Accounts**: `@tetherto/wdk-wallet-evm-erc-4337` accounts with bundler/paymaster
* **Read‑Only Accounts**: For quoting swaps without sending transactions

## Key Components

* **velora Integration**: Uses velora aggregator for routing and quotes
* **Quote System**: Pre‑transaction fee and amount estimation via `quoteSwap`
* **AA Integration**: Optional paymaster token and fee cap overrides when using ERC‑4337
* **Allowance Management**: Approve flow handled automatically when required

## Next Steps

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><i class="fa-code">:code:</i></td><td><strong>Node.js Quickstart</strong></td><td>Get started with WDK in a Node.js environment</td><td><a href="../../start-building/nodejs-bare-quickstart">nodejs-bare-quickstart</a></td></tr><tr><td><i class="fa-code">:code:</i></td><td><strong>WDK velora Swap Protocol Configuration</strong></td><td>Get started with WDK's velora Swap Protocol configuration</td><td><a href="swap-velora-evm/configuration">configuration</a></td></tr><tr><td><i class="fa-code">:code:</i></td><td><strong>WDK velora Swap Protocol API</strong></td><td>Get started with WDK's velora Swap Protocol API</td><td><a href="swap-velora-evm/api-reference">api-reference</a></td></tr><tr><td><i class="fa-code">:code:</i></td><td><strong>WDK velora Swap Protocol Usage</strong></td><td>Get started with WDK's velora Swap Protocol usage</td><td><a href="swap-velora-evm/usage">usage</a></td></tr></tbody></table>

***

### Need Help?

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><i class="fa-discord">:discord:</i></td><td><strong>Discord Community</strong></td><td>Connect with developers, ask questions, share your projects</td><td><a href="https://discord.gg/arYXDhHB2w" class="button primary">Join Community</a></td><td><a href="https://discord.gg/arYXDhHB2w">https://discord.gg/arYXDhHB2w</a></td></tr><tr><td><i class="fa-github">:github:</i></td><td><strong>GitHub Issues</strong></td><td>Report bugs, request features, and get technical help</td><td><a href="https://github.com/tetherto/wdk-core" class="button secondary">Open an Issue</a></td><td><a href="https://github.com/tetherto/wdk-core">https://github.com/tetherto/wdk-core</a></td></tr><tr><td><i class="fa-envelope">:envelope:</i></td><td><strong>Email Contact</strong></td><td>For sensitive or private matters, contact our team directly</td><td><a href="mailto:wallet-info.tether.io" class="button secondary">Send an email</a></td><td><a href="mailto:wallet-info.tether.io">mailto:wallet-info.tether.io</a></td></tr></tbody></table>
