@bolt-liquidity-hq/solana-client
v0.1.0-beta.39
Published
Typescript SDK to interact with Bolt Liquidity on Solana.
Downloads
358
Maintainers
Readme
Solana Client for Bolt Liquidity
TypeScript SDK to interact with Bolt Liquidity on Solana.
Installation
# Using npm
npm install @bolt-liquidity-hq/solana-client
# Using yarn
yarn add @bolt-liquidity-hq/solana-client
# Using pnpm
pnpm add @bolt-liquidity-hq/solana-clientUsage
import { BoltSolanaClient } from '@bolt-liquidity-hq/solana-client';
// Initialize client
const client = new BoltSolanaClient();
// Get current price
const price = await client.getPrice(
'So11111111111111111111111111111111111111112', // SOL mint address
'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' // USDC mint address
);
console.log(`SOL/USDC: ${price.price}`);
// Execute a swap with signer
const result = await client.swap(
{
assetIn: 'So11111111111111111111111111111111111111112', // SOL
amountIn: '1000000000', // 1 SOL (9 decimals)
assetOut: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', // USDC
slippagePercent: 1, // 1% slippage tolerance
},
signer
);📖 API Reference
Full API documentation is available in our docs.
Development
See the CONTRIBUTING.md file.
📄 License
Apache 2.0 - see LICENSE for details.
