Skip to main content
The SDK separates what (the Velora methods) from how it talks to the chain and the API. You wire two things:
  • A contract caller bridges between the SDK’s transactCall / signTypedDataCall / staticCall interface and your wallet library.
  • A fetcher bridges between the SDK’s FetcherFunction and your HTTP client.
Simple SDK builds both for you from a single options object. Full SDK and Partial SDKs take them as constructor arguments.

Contract callers

viem

Write methods resolve to a viem Hex (the transaction hash).
For sending the result of sdk.swap.buildTx via viem, the SDK exports txParamsToViemTxParams to cast all string-numbers to BigInt:

ethers v5

Write methods resolve to ethers.ContractTransaction. You can call .wait() directly on the result.

ethers v6

Write methods resolve to ethers v6’s ContractTransactionResponse.

web3.js

Write methods resolve to web3’s PromiEvent<TransactionReceipt>. Listen on transactionHash for early notification:

Fetchers

axios

fetch (Node 18+ and the browser)

Custom fetcher

Any HTTP client works: implement FetcherFunction and pass it through. Useful for adding retries, logging, header injection, or wrapping an unusual transport.
For richer error semantics, throw a FetcherError and the SDK will re-throw it untouched so calling code can isFetcherError(err) and inspect the response.

wagmi recipe

If your app already uses wagmi, reuse the viem wallet client it manages:
Memoize the result (with useMemo on the wallet client and address) to avoid rebuilding the SDK on every render.
  • Install covers peer dependencies for each wallet library.
  • Simple SDK: uses these callers and fetchers via a single options object.
  • Full SDK — takes the caller and fetcher you construct here.
  • Partial SDK, same wiring, smallest bundle.
Last modified on June 14, 2026