yamaswap-sdk
v0.2.16
Published
ETF SDK for Solana and Evm
Readme
Yamaswap SDK
A Solana SDK for creating and managing ETF tokens ( from Yamaswap ).
Prerequisites
- Node.js 23+
- Solana wallet
- Solana RPC endpoint (localnet | devnet | mainnet)
- "@solana/web3.js": "^1.95.0" (recommended)
Installation
npm install yamaswap-sdkUsage
import { DexClient } from 'yamaswap-sdk';
const client = new DexClient(connection, wallet);Create ETF
const createETFParams = {
name: 'Test ETF',
symbol: 'TEST5',
description: 'Test Description',
url: 'https://test.com',
constitunent: [{
tokenAddress: ,
weight:
},...]
}
const createETFresult = await client.createETF(createETFParams, wallet);
console.log('Create ETF result:', createETFresult);Buy and Mint ETF Token
const buyMintETFTokenresult = await client.purchaseETF(wallet, {
etfAddress: new PublicKey('7NhFX8qPxqHarmHrGbk3LP8G8tgGoo8f4ErFc8RBSRHa'),
lamports: 100000000000
});
console.log('Buy Mint ETF Token result:', buyMintETFTokenresult);Burn ETF
const burnETFresult = await client.burnETF(wallet, {
etfAddress: new PublicKey('7NhFX8qPxqHarmHrGbk3LP8G8tgGoo8f4ErFc8RBSRHa'),
lamports: 90000000000
});
console.log('Burn ETF result:', burnETFresult);See the examples folder for detailed use cases
