fz-blockchain-sdk
v3.3.4-rc.1
Published
The SDK for interact with blockchain fanzeal version v3.2.1
Downloads
6
Readme
Blockchain Fanzeal SDK Library
The SDK for interact with blockchain fanzeal version v3.2.1
Repository https://bitbucket.org/chromawallet/fanzeal-blockchain/src/v3.2.1
Requirements
- Node 16 or higher
Installation
npm install [email protected] fanzeal-blockchain-sdk
# or
pnpm install [email protected] fanzeal-blockchain-sdk
Usage
- create SDK instance
import { BlockchainSDK } from 'fanzeal-blockchain-sdk'
const sdk = await BlockchainSDK.init({
nodeURLPool: '<NODE_URL>',
blockchainRID: '<BLOCKCHAIN_RID>'
})
- Make query
// from module
const collections = await sdk.collection.getAllCollectionsQueryObject()
// from query object
const collections = await sdk.query({ name: "collection.get_all_collections" })
- Login account
const signer = new ethers.Wallet('<PRIVATE_KEY>')
await sdk.login(signer)
- Check authenticated
const isAuthenticated = await sdk.isAuthenticated()
- Send transaction
// from module
const transactionReceipt = await sdk.collection.addCollectionOperation('Pack', 'Pack size 1', 100)
// from operation
const transactionReceipt = await sdk.call({ name: "collection.add_collection", args: [name, description, maxCount] })