@xchainjs/xchain-tron
v3.0.4
Published
Custom Tron client and utilities used by XChainJS clients
Readme
@xchainjs/xchain-tron
Modules
client- Custom client for TronclientKeystore- Keystore client for Tron
Installation
yarn add @xchainjs/xchain-tronFollowing peer dependencies have to be installed into your project. These are not included in @xchainjs/xchain-tron.
yarn add @xchainjs/xchain-client @xchainjs/xchain-crypto @xchainjs/xchain-utilUsage
Basic Transfer
import { ClientKeystore as Client, AssetTRX } from '@xchainjs/xchain-tron'
import { assetToBase, assetAmount } from '@xchainjs/xchain-util'
const client = new Client({ phrase: 'your mnemonic phrase' })
// Simple transfer
const txHash = await client.transfer({
asset: AssetTRX,
amount: assetToBase(assetAmount('1', 6)), // 1 TRX
})