TON js client
Cross-platform client for TON blockchain.
Features
- 🚀 Create new wallets
- 🍰 Get balance
- ✈️ Transfers
Install
yarn add ton buffer
Browser polifil
require("buffer");
Usage
To use this library you need HTTP API endpoint, you can use one of the public endpoints:
import { TonClient } from "ton";
const client = new TonClient({
endpoint: 'https://toncenter.com/api/v2/jsonRPC',
});
const wallet = await client.openWallet('<public-key>');
console.log(wallet.address);
console.log(await wallet.getBalance());
let seqno = await wallet.getSeqNo();
await wallet.transfer({ to: 'some-address', amount: 10.0, seqno, secretKey: '<secret>' });
License
MIT