Get Started
Install the package, create VeloraProtocolEvm, and learn supported networks.
This guide covers installation, create the swap protocol, and supported networks. You need Node.js and npm to follow along.
Installation
Run the following to install @tetherto/wdk-protocol-swap-velora-evm:
npm install @tetherto/wdk-protocol-swap-velora-evmYou also need an EVM wallet account from @tetherto/wdk-wallet-evm (or an ERC-4337 account from @tetherto/wdk-wallet-evm-erc-4337) on the same chain as your RPC provider.
Create the swap protocol
You can construct a swap client with new VeloraProtocolEvm(account, config?) on top of VeloraProtocolEvm:
import VeloraProtocolEvm from '@tetherto/wdk-protocol-swap-velora-evm'
import { WalletAccountEvm } from '@tetherto/wdk-wallet-evm'
const account = new WalletAccountEvm(seedPhrase, "0'/0/0", {
provider: 'https://ethereum-rpc.publicnode.com'
})
const swapProtocol = new VeloraProtocolEvm(account, {
swapMaxFee: 200000000000000n
})Optional swapMaxFee caps the total gas fee in wei for swaps. See configuration for environment-specific settings.
Supported networks
Velora routing works on EVM networks the aggregator supports, including Ethereum, Polygon, Arbitrum, and other chains where Velora exposes liquidity. Use an RPC endpoint for the network your WalletAccountEvm is configured for so swap() and quoteSwap() target the correct chain.