@ton-defi.org/ton-connection
TypeScript icon, indicating that this package has built-in type declarations

0.8.1 • Public • Published

Ton Connection

A library for connecting to ton

Description

=> Note: This library is in alpha. Use at your own risk.

The library currently the following operations:

  1. Retrieving a wallet details
  2. Sending a transaction

Current supported wallet providers are:

  • Tonhub (via ton-x connector)
  • Ton wallet chrome extension
  • Mnemonic-based provider

Usage

const tonHubCon = new TonConnection(
  new TonhubProvider({
    isSandbox: true,
    onSessionLinkReady: (session) => {
      // For example, display `session.link` as a QR code for the mobile tonhub wallet to scan
    },
    persistenceProvider: localStorage, // If you want the persist the session
  }),
  EnvProfiles[Environments.SANDBOX].rpcApi
);
const wallet = await tonHubCon.connect(); // Get wallet details

// Send a transaction
await tonHubCon.requestTransaction(...)

Future

  • Support disconnection
  • Support transaction details (exit code)
  • Support get methods

Readme

Keywords

none

Package Sidebar

Install

npm i @ton-defi.org/ton-connection

Weekly Downloads

22

Version

0.8.1

License

MIT

Unpacked Size

37 kB

Total Files

21

Last publish

Collaborators

  • doronaviguy
  • shahary
  • zlotindaniel