Skip to main content

1. Initialize a new project

Create a new project directory:
Initialize a new Node.js project:

2. Installation

The legacy Whirlpools Typescript SDK (@orca-so/whirlpools-sdk) allows for easy interaction with a deployed Whirlpools program and is a solid choice if you are working with Solana Web3.js. In your project, run:

3. Setup Whirlpool Context

The WhirlpoolContext object provides the necessary environment information to build and send transactions and is core to running many functions in the SDK.

Setup your context object for a Node-side wallet:

Setup for browser applications

The context relies on Anchor’s Wallet interface. Implement your own wallet interface or find one of the sample implementations in the community and feed it into the context object.
TypeScript

Setup with Whirlpool Anchor test environment

Provided you have set up the anchor environment, you can reference the program directly and build from there.
Note: When configuring the network, you’ll need to specify the Whirlpools Config address for the network you’re using: