0.19.21 • Published 3 years ago
@test-xchain/xchain-mayachain v0.19.21
@test-xchain/xchain-mayachain
Mayachain Module for XChainJS Clients
Installation
yarn add @test-xchain/xchain-mayachain
Following peer dependencies have to be installed into your project. These are not included in @test-xchain/xchain-mayachain
.
yarn add @test-xchain/xchain-client @test-xchain/xchain-crypto @test-xchain/xchain-util @test-xchain/xchain-cosmos axios cosmos-client
Important note: Make sure to install same version of cosmos-client
as xchain-mayachain
is using (currently cosmos-client@0.39.2
). In other case things might break.
Mayachain Client Testing
yarn install
yarn test
Service Providers
This package uses the following service providers:
Function | Service | Notes |
---|---|---|
Balances | Cosmos RPC | https://cosmos.network/rpc/v0.37.9 (GET /bank/balances/{address} ) |
Transaction history | Tendermint RPC | https://docs.tendermint.com/master/rpc/#/Info/tx_search |
Transaction details by hash | Cosmos RPC | https://cosmos.network/rpc/v0.37.9 (GET /txs/{hash} ) |
Transaction broadcast | Cosmos RPC | https://cosmos.network/rpc/v0.37.9 (POST /txs ) |
Explorer | Mayachain.net | https://mayachain.net |
Rate limits: No
Examples
// import `xchain-mayachain`
import { Client } from '@test-xchain/xchain-mayachain'
// Create a `Client`
const client = new Client({ network: Network.Testnet, phrase: 'my secret phrase' })
// get address
const address = client.getAddress()
console.log('address:', client.getAddress()) // address: tthor13gym97tmw3axj3hpewdggy2cr288d3qffr8skg
// get balances
const balances = await client.getBalance(address)
console.log('balances:', balances[0].amount.amount().toString()) // balance: 6968080395099
// get transactions
const txs = await client.getTransactions({ address })
console.log('txs total:', txs.total) // txs total: 100
// get transaction details
const tx = await client.getTransactionData('any-tx-hash', address)
console.log('tx asset:', tx.asset) // tx asset: { chain: 'MAYA', symbol: 'RUNE', ticker: 'RUNE' }
For more examples check out tests in ./__tests__/client.test.ts
0.20.4-alpha
3 years ago
0.19.20
3 years ago
0.19.21
3 years ago
0.20.3-alpha
3 years ago
0.19.19
3 years ago
0.20.1-alpha
4 years ago
0.20.0-alpha
4 years ago
0.20.2-alpha
3 years ago
0.19.11
4 years ago
0.19.12
4 years ago
0.19.13
4 years ago
0.19.15
4 years ago
0.19.16
4 years ago
0.19.17
4 years ago
0.19.18
4 years ago
0.19.8
4 years ago
0.19.9
4 years ago
0.19.10
4 years ago
0.19.6
4 years ago
0.19.7
4 years ago
0.19.5
4 years ago