Skip to main content
constructFullSDK returns the same namespaced API as the Simple SDK (sdk.swap.*, sdk.delta.*, sdk.quote), but you construct the fetcher and contract caller yourself. That extra wiring buys you a typed <TxResponse> generic and the freedom to share one caller across multiple SDK instances or chains.

When to use this

  • You want write methods to return your wallet library’s native response type (e.g., viem Hex or ethers.ContractTransaction) instead of a bare transaction hash.
  • You need one contractCaller to back several SDKs — for example, the same signer used on mainnet (chainId: 1) and Optimism (chainId: 10).
  • You’re building infrastructure that abstracts the fetcher (custom retry, caching, logging) and don’t want the Simple SDK to wrap it.
If none of those apply, prefer the Simple SDK; it has fewer moving parts.

Construct it

import axios from "axios";
import { createWalletClient, custom } from "viem";
import { mainnet } from "viem/chains";
import {
  constructFullSDK,
  constructAxiosFetcher,
  constructViemContractCaller,
} from "@velora-dex/sdk";

const walletClient = createWalletClient({
  chain: mainnet,
  transport: custom(window.ethereum!),
});
const [account] = await walletClient.getAddresses();

const contractCaller = constructViemContractCaller(walletClient, account);
const fetcher = constructAxiosFetcher(axios);

const sdk = constructFullSDK({
  chainId: 1,
  fetcher,
  contractCaller,
});
Swap the contract-caller line for constructEthersContractCaller, constructEthersV6ContractCaller, or constructWeb3ContractCaller to use a different wallet library. See Configure providers for each variant.

Typed transaction responses

The <TxResponse> generic is the type that every write method returns. It’s inferred from the contract caller you pass.
Contract caller<TxResponse>
constructViemContractCallerviem Hex (the transaction hash)
constructEthersContractCaller (v5)ethers.ContractTransaction
constructEthersV6ContractCallerethers v6 ContractTransactionResponse
constructWeb3ContractCallerweb3.js PromiEvent<TransactionReceipt>
So with the viem caller above:
// type Promise<Hex>
const hash = await sdk.swap.approveToken("10000000000", USDC);
console.log("approval submitted:", hash);

What’s available

The namespaces are identical to Simple SDK:
  • sdk.delta: full Delta lifecycle — getDeltaPrice, submitDeltaOrder, build/sign/post split, getDeltaOrders (paginated), cancelDeltaOrders, plus approve/preSign.
  • sdk.quote exposes getQuote.
  • sdk.swap: rate, build, approve, balances, spender, tokens, adapters, swapTx (Market execution path for swaps).
  • sdk.otcOrders exposes the AugustusRFQ maker/taker orders used for OTC; see OTC.
See Swaps → Delta and Swaps → Market for end-to-end flows.

Sharing one caller across chains

Because you own the caller, you can reuse it:
const baseConfig = { fetcher, contractCaller };

const mainnet = constructFullSDK({ ...baseConfig, chainId: 1 });
const optimism = constructFullSDK({ ...baseConfig, chainId: 10 });

Partial SDK

Drop unused modules entirely with constructPartialSDK.

Configure providers

All four contract callers and both fetchers, with examples.

Swaps → Delta

The full Delta order lifecycle, including the split build/sign/post flow.

Swaps → Market

Market-Swap walkthrough using the namespaced SDK.
Last modified on June 10, 2026