JavaScript library for the Metaverse Blockchain Websocket and JSON-RPC services
Metaverse Websocket and JSONRPC
Setup
npm i mvsd
JSON-RPC
Initialize the connection settings
const MvsdJSONRPC =const mvsd = 'http://127.0.0.1:8820/rpc/v3'
Get the current height of the blockchain
mvsd
Get a block by its number or txid
mvsd// or by txidmvsd
Send new encoded raw transaction
mvsd
other functions
tx-decode validate-tx getnewaccount getaccount deleteaccount importaccount changepasswd getnewaddress validateaddress listaddresses dumpkeyfile importkeyfile importaddress shutdown getinfo addnode getpeerinfo getrandom verifyrandom startmining stopmining getmininginfo getstakeinfo setminingaccount getwork submitwork getmemorypool registerwitness getblockheader fetchheaderext gettx listtxs popblock createrawtx decoderawtx signrawtx getpublickey createmultisigtx getnewmultisig listmultisig deletemultisig signmultisigtx send sendmore sendfrom lock listbalances getbalance getaddressetp getlocked validatesymbol createasset deletelocalasset issue secondaryissue sendasset sendmoreasset sendassetfrom listassets getasset getaccountasset getaddressasset burn swaptoken issuecert transfercert registermit transfermit listmits getmit registerdid didchangeaddress listdids getdid
Websocket
Initialize the connection (NodeJS)
const MvsdWebsocket =const websocket = 'ws://127.0.0.1:8821/ws'
Initialize the connection (Browser)
Connect to server
websocket
Check for status
mvsdready
Subscribe to transactions
mvsd// ormvsd
Subscribe to blocks
mvsd
Process incomming transactions
mvsdtransactions
Process incomming blocks
mvsdblocks