Imports
All public clients can be imported from the main SDK package.
import {
createInfoClient,
createExchangeClient,
createDepositClient,
createExchangeWebSocketClient,
createOracleWebSocketClient,
} from "@gammaswap/v2-exchange-sdk";Client imports
InfoClient
import { createInfoClient } from "@gammaswap/v2-exchange-sdk";Use InfoClient for unsigned, read-only HTTP requests.
const info = createInfoClient({
apiUrl: "https://exchange-api.gammaswap.com/api",
});ExchangeClient
import { createExchangeClient } from "@gammaswap/v2-exchange-sdk";
import { Wallet } from "ethers";Use ExchangeClient for wallet-signed exchange actions.
DepositClient
Use DepositClient for on-chain deposit reads and transactions.
ExchangeWebSocketClient
Use ExchangeWebSocketClient for live market updates.
OracleWebSocketClient
Use OracleWebSocketClient for live oracle prices.
Submodule imports
WebSocket clients can also be imported from their dedicated submodules.
Input utilities
Integer-input helpers are exported from:
These helpers validate canonical unsigned decimal strings and bigint values.
They reject JavaScript numbers unless a helper explicitly supports safe JSON or runtime integers.
String utilities
Address and hexadecimal-string helpers are exported from:
The string utility module includes validation for:
EVM addresses
Non-zero addresses
Hexadecimal data
bytes32valuesCase-insensitive address comparison
Constants
Protocol constants such as time-in-force values can be imported from:
Example:
Last updated