Skip to content

Installation

Install the SDK and viem together:

npm install @silentswap/sdk viem

The public package graph is @silentswap/sdk → @silentswap/assets → @silentswap/chains. All three packages ship at version 2.0.0. They share viem ^2.21.55 as a peer to preserve one Chain type identity.

Runtime support

The package is ESM and exports JavaScript, declarations, source maps, and TypeScript source. Use a modern browser or current Node.js runtime with fetch. Browser tracking uses EventSource; Node.js automatically falls back to polling.

Verify the install

import {
  createSilentSwapClient,
  type SilentSwapClient,
} from '@silentswap/sdk';
import { bsc } from 'viem/chains';
 
const client: SilentSwapClient = createSilentSwapClient({
  baseUrl: 'http://localhost:3001',
  chain: bsc,
});
 
client.getOrder;