1.0.9 • Published 2 years ago

@lessenter/tonpay v1.0.9

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years 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

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago