How to Use
Installation
yarn add @xchainjs/xchain-thorchainPeer Dependencies
Testing
yarn install
yarn testExamples
Connect wallet to new Thor Client
// Imports
import { Client, getChainIds, getDefaultClientUrl} from '@xchainjs/xchain-thorchain'
import { assetToBase, baseToAsset, assetAmount } from "@xchainjs/xchain-util"
// Create new instance of the client and query chain for balances.
const connectWallet = async () => {
let phrase = "phrase"
const thorClient = new Client({phrase})
let address = thorClient.getAddress()
console.log(`Address: ${address}`)
try {
const balance = await thorClient.getBalance(address)
let assetAmount = (baseToAsset(balance[0].amount)).amount()
console.log(`With balance: ${assetAmount}`)
} catch (error) {
console.log(`Caught ${error}`)
}
}
Transfer Rune using Thor Client
Get Transaction Data & Transaction History
Get Transfer Fees
Get Network and Explorer Data
Last updated