1.0.9 • Published 11 months ago

@lessenter/tonpay v1.0.9

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

This is a ton payment public component encapsulated based on @tonconnect/ui and @ton/ton.

The main methods are:

  1. connect
  2. disconnect
  3. pay
  4. isConnecting
  5. getbalance
  6. decodeBoc
  7. getWalletInfo
  8. decodeAddress

How to use:

npm install @lessenter/tonpay

import $ton from '@lessenter/tonpay';

# Must first init and manifestUrl is required
$ton.init("your manifestUrl");

# Return wallet information
const walletInfo = await $ton.connect();

# Disconnect Wallet
$ton.disconnect();

# Transfer, the parameters are the target address, transfer amount, and remarks. If the wallet is not connected, the connection will be called first and then the transfer will be called
# back boc,hash,walletInfo
const { boc, hash, walletInfo } = await $ton.pay(address, amount, remark); 

#is Connecting, back true/false
$ton.isConnecting();

#back wallet balance (address is required)
const balance = await $ton.getbalance(address);

# back transfer hash (boc is required)
const hash = $ton.decodeBoc(boc);

# back current wallet info
cont walletInfo = $ton.getWalletInfo();

# decode address (address is required)
cont address = $ton.decodeAddress(address);
1.0.9

11 months ago

1.0.8

11 months ago

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago