@mytonswap/sdk
v1.0.10
Published
MyTonSwap Dex Aggregator SDK
Downloads
1,671
Maintainers
Readme
Installation:
npm install @mytonswap/sdk
Usage
Here's a basic example of how to use the MyTonSwap SDK:
import { MyTonSwapClient } from '@mytonswap/sdk';
const client = new MyTonSwapClient();
async function performSwap() {
const userWallet = 'your-wallet-address';
const TON = await client.assets.getExactAsset('TON');
const NOT = await client.assets.getExactAsset('NOT');
const bestRoute = await client.router.findBestRoute(
TON!.address,
NOT!.address,
toNano(1),
1,
);
const swap = await client.swap.createSwap(userWallet, bestRoute);
console.log(swap);
}
performSwap();
Contributing
We welcome contributions! Please read our contributing guidelines before submitting a pull request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
If you have any questions or need help, feel free to open an issue on our GitHub repository.