For the complete documentation index, see llms.txt. This page is also available as Markdown.

Installation

Install the GammaSwap V2 TypeScript SDK from npm.

npm install @gammaswap/v2-exchange-sdk

Requirements

  • Node.js 20 or later

  • An EVM-compatible wallet for signed exchange actions

  • An RPC provider for deposits and other on-chain operations

  • A WebSocket implementation when the runtime does not provide one

The SDK uses the global fetch and WebSocket implementations when they are available. Custom implementations can be supplied through the client constructors.

Ethers

Signed exchange actions and on-chain deposits use an ethers wallet.

If ethers is not already installed in your application, install it alongside the SDK:

npm install ethers

Node WebSocket support

The WebSocket clients use globalThis.WebSocket when the runtime provides it. In Node.js environments without a global WebSocket implementation, the SDK can use the ws package.

npm install ws

You can also provide a custom WebSocket constructor through WebSocketCtor.

Environment variables

A typical server-side integration may use the following environment variables:

Never expose a private key in client-side code, committed source files, logs, or public environment configuration.

Verify the installation

Create a read-only client and request asset metadata:

InfoClient does not require a wallet because its methods only read public exchange data.

Local SDK development

The SDK repository uses:

  • Node.js 20 or later

  • pnpm 10 or later

These requirements apply when developing the SDK itself. Applications consuming the published npm package do not need to use pnpm.

Last updated