1.0.9 • Published 1 year ago

@lessenter/tonpay v1.0.9

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year 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

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago