A typescript wrapper for multichain
rpc.
npm i ts-multichain-rpc
import { Client } from 'ts-multichain-rpc'
const client = new Client({
host: '127.0.0.1',
port: 8384,
user: 'multichainrpc',
pass: 'my_rpc_password'
})
async function getinfo() {
return await client.call('getinfo')
}
async function getblock(hashOrHeight: string | number) {
return new Promise((resolve, reject) => {
client.call('getblock', [hashOrHeight])
.then((result) => resolve(result))
.catch((error) => reject(error))
})
}
MultiChain JSON-RPC API commands
List of the methods/commands that have been implemented into the Client class.
If methods is not yet implemented it can still be called using client.call()
.
- getblockchainparams
- gethealthcheck
- getruntimeparams
- setruntimeparam
- getinfo
- getinitstatus
- help
- stop
- addmultisigaddress
- getaddresses
- getnewaddress
- importaddress
- listaddresses
- createkeypairs
- createmultisig
- validateaddress
- grant
- grantfrom
- grantwithdata
- grantwithdatafrom
- listpermissions
- revoke
- revokefrom
- verifypermission
- getassetinfo
- gettokeninfo
- issue
- issuefrom
- issuemore
- issuemorefrom
- issuetoken
- issuetokenfrom
- listassetissues
- listassets
- update
- updatefrom
- getaddressbalances
- getaddresstransaction
- getmultibalances
- gettokenbalances
- gettotalbalances
- getwallettransaction
- listaddresstransactions
- listwallettransactions
- send
- sendasset
- sendassetfrom
- sendfrom
- sendwithdata
- sendwithdatafrom
- appendrawexchange
- completerawexchange
- createrawexchange
- decoderawexchange
- disablerawtransaction
- preparelockunspent
- preparelockunspentfrom
- create
- createfrom
- getstreaminfo
- liststreams
- publish
- publishfrom
- publishmulti
- publishmultifrom
- subscribe
- trimsubscribe
- unsubscribe
- getassettransaction
- listassettransactions
- getstreamitem
- getstreamkeysummary
- getstreampublishersummary
- gettxoutdata
- liststreamblockitems
- liststreamkeyitems
- liststreamkeys
- liststreamitems
- liststreampublisheritems
- liststreampublishers
- liststreamqueryitems
- liststreamtxitems
- purgepublisheditems
- purgestreamitems
- retrievestreamitems
- combineunspent
- listlockunspent
- listunspent
- lockunspent
- appendrawchange
- appendrawdata
- appendrawtransaction
- createrawtransaction
- createrawsendfrom
- decoderawtransaction
- sendrawtransaction
- signrawtransaction
- addnode
- getaddednodeinfo
- getnetworkinfo
- getpeerinfo
- liststorednodes
- ping
- storenode
- signmessage
- verifymessage
- getblock
- getblockchaininfo
- getblockhash
- getchaintotals
- getlastblockinfo
- getmempoolinfo
- getrawmempool
- getrawtransaction
- gettxout
- listblocks
- listminers
- createbinarycache
- appendbinarycache
- deletebinarycache
- txouttobinarycache
- backupwallet
- dumpprivkey
- dumpwallet
- encryptwallet
- getwalletinfo
- importprivkey
- importwallet
- walletlock
- walletpassphrase
- walletpassphrasechange
- addtofeed
- createfeed
- datareftobinarycache
- deletefeed
- getdatarefdata
- listfeeds
- pausefeed
- purgefeed
- resumefeed
- updatefeed
- approvefrom
- create
- createfrom
- getfiltercode
- liststreamfilters
- listtxfilters
- listupgrades
- runstreamfilter
- runtxfilter
- teststreamfilter
- testtxfilter
- addlibraryupdate
- addlibraryupdatefrom
- getlibrarycode
- getvariablehistory
- getvariableinfo
- getvariablevalue
- listlibraries
- setvariablevalue
- setvariablevaluefrom
- testlibrary
- clearmempool
- getchunkqueueinfo
- getchunkqueuetotals
- pause
- resume
- setlastblock
- getlicenserequest
- activatelicense
- listlicenses
- transferlicense