ton
    TypeScript icon, indicating that this package has built-in type declarations

    6.12.0 • Public • Published

    TON js client

    Version npm

    Cross-platform client for TON blockchain.

    Features

    • 🚀 Create new wallets
    • 🍰 Get balance
    • ✈️ Transfers

    Install

    yarn add ton buffer

    Browser polifil

    // Add before using library
    require("buffer");

    Usage

    To use this library you need HTTP API endpoint, you can use one of the public endpoints:

    import { TonClient } from "ton";
    
    // Create Client
    const client = new TonClient({
      endpoint: 'https://toncenter.com/api/v2/jsonRPC',
    });
    
    // Open Wallet
    const wallet = await client.openWallet('<public-key>');
    console.log(wallet.address);
    console.log(await wallet.getBalance());
    
    // Transfering coins
    let seqno = await wallet.getSeqNo();
    
    // In case of failure you can safely retry calling this method
    await wallet.transfer({ to: 'some-address', amount: 10.0, seqno, secretKey: '<secret>' });

    License

    MIT

    Keywords

    none

    Install

    npm i ton

    DownloadsWeekly Downloads

    477

    Version

    6.12.0

    License

    MIT

    Unpacked Size

    292 kB

    Total Files

    194

    Last publish

    Collaborators

    • fractal
    • steve.kite
    • yocontra