A comprehensive library for interacting Bitgesell API on Web, Nodejs and other JavaScript runtimes through the Bitgesell API
Install via yarn/npm:
yarn add bgl-blockchain-sdk # npm i
To initialize the sdk library
import {BitgesellBlockchainSDK} from 'bitgesell-blockchain-sdk'
const sdkConfig = {
baseAPIURL: 'https://api.bitaps.com/bgl/v1/blockchain',
logger: console.log // optional
}
const bitgesellBlockchainSDK = new BitgesellBlockchainSDK(sdkConfig)
To initialize the sdk library in Commonjs pattern:
const {BitgesellBlockchainSDK} = require('bitgesell-blockchain-sdk')
const sdkConfig = {
baseAPIURL: 'https://api.bitaps.com/bgl/v1/blockchain',
logger: console.log // optional
}
const bitgesellBlockchainSDK = new BitgesellBlockchainSDK(sdkConfig)
To query transacton by the transaction hash
:
(async() => {
const txHash = 'a transaction hash'
const transaction = await bitgesellBlockchainSDK.tx.getTransactionByHash(txHash)
console.log(txHash)
})()
To query mempool state:
(async() => {
const mempoolState = await bitgesellBlockchainSDK.mempool.getMempoolState()
console.log(mempoolState)
})()
To query block by the blockHeight:
(async() => {
const block = await bitgesellBlockchainSDK.blockchain.getBlockByHeight(206)
console.log(block)
})()
For complete documenation on how to use this library see the complete docs:
Any form of support is highly welcome through contributions, pull requests and feature requests.
License
: MIT
Generated using TypeDoc