Configuration options and settings for @tetherto/wdk-protocol-swap-velora-evm
Swap Service Configuration
The VeloraProtocolEvm accepts a configuration object that defines fee controls and behavior:
importVeloraProtocolEvmfrom'@tetherto/wdk-protocol-swap-velora-evm'import{WalletAccountEvm}from'@tetherto/wdk-wallet-evm'// Create wallet account firstconstaccount=newWalletAccountEvm(seedPhrase,"0'/0/0",{provider:'https://ethereum-rpc.publicnode.com'})// Create swap service with configurationconstswapProtocol=newVeloraProtocolEvm(account,{swapMaxFee:200000000000000n// Optional: Max swap fee in wei})
Account Configuration
The swap service uses the wallet account configuration for network access and signing:
The swapMaxFee option sets an upper bound for total gas costs to prevent excessive fees.
Type:bigint (optional)
Unit: Wei
Examples:
ERC‑4337 (Account Abstraction) Configuration
When using ERC‑4337 smart accounts (@tetherto/wdk-wallet-evm-erc-4337), you can override fee behavior per swap and specify a paymaster token:
Paymaster Token (ERC‑4337)
The paymasterToken option indicates which token the paymaster should use to sponsor gas.
Type:string (optional)
Format: Token symbol or address
Example:
Network Support
velora supports multiple EVM networks (e.g., Ethereum, Polygon, Arbitrum). Ensure your account is configured with a valid provider for the target network.
Swap Options
When calling swap, provide the swap parameters:
Parameters
tokenIn (string): ERC‑20 address to sell
tokenOut (string): ERC‑20 address to buy
tokenInAmount (bigint, optional): exact input amount in token base units
tokenOutAmount (bigint, optional): exact output amount in token base units
to (string, optional): recipient address (defaults to account address)
Note: Use either tokenInAmount OR tokenOutAmount, not both.
Node.js Quickstart
Get started with WDK in a Node.js environment
WDK velora Swap Protocol API
Get started with WDK's velora Swap Protocol API
WDK velora Swap Protocol Usage
Get started with WDK's velora Swap Protocol usage
Need Help?
Discord Community
Connect with developers, ask questions, share your projects