Installation

Using the SDK

The SDK is included in the VinuSwap repository and can be imported directly.

Direct Import

// Import from local SDK
import { VinuSwap } from './sdk/core';
import { encodePrice, decodePrice } from './sdk/utils';

As a Package (Future)

When published as an npm package:

npm install @vinuswap/sdk
import { VinuSwap } from '@vinuswap/sdk';

Dependencies

Ensure these dependencies are installed:

npm install ethers@^5.7.0
npm install @uniswap/v3-sdk @uniswap/sdk-core

TypeScript Configuration

The SDK requires TypeScript with ES2020 target:

Contract ABIs

The SDK needs contract ABIs. These are generated during compilation:

ABIs are located in:

  • artifacts/contracts/core/VinuSwapPool.sol/VinuSwapPool.json

  • artifacts/contracts/periphery/SwapRouter.sol/SwapRouter.json

  • artifacts/contracts/periphery/NonfungiblePositionManager.sol/NonfungiblePositionManager.json

  • artifacts/contracts/periphery/VinuSwapQuoter.sol/VinuSwapQuoter.json

Provider Setup

Local Development

VinuChain Mainnet

With Signer

Initialization Example

Verification

Test your setup:

Next Steps

Last updated