Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ton

Package Overview
Dependencies
Maintainers
3
Versions
179
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ton

[![Version npm](https://img.shields.io/npm/v/ton.svg?logo=npm)](https://www.npmjs.com/package/ton)

  • 2.2.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

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

FAQs

Package last updated on 10 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc