@jadepool/lib-qlink
v0.1.2
Published
NodeJS lib for QLink
Downloads
4
Readme
QLink NodeJS lib
How to use
const libqlink = require('@jadepool/lib-qlink')
// genAddress
const addr = libqlink.genAddressByPriKey(privKey)
// fillBlock, require the block json from QLink's jsonrpc
const stateBlock = `{
"type": "state",
"token":"991cf190094c00f0b68e2e5f75f6bee95a2e0bd93ceaa4a6734db9f19b728949",
"address":"qlc_3pjn4swtnsr8ujkyyorci5bjyhuegdkisx9te7tr7yztf4mtr1xqzz8fofih",
"balance": "1456778",
"previous": "247230c7377a661e57d51b17b527198ed52392fb8b99367a234d28ccc378eb05",
"link": "7d35650e78d8d7037c90390357f8a59bf17eff82cbc03c94f0b6267335a8dcb3",
"sender": "IjE1ODExMTEwMDAwMCI=",
"receiver": "IjE1ODExMTEwMDAwMCI=",
"message": "1235650e78d8d7037c90390357f8a59bf17eff82cbc03c94f0b6267335a8dcb3",
"data": "DCI4Tg==",
"quota": 12345612,
"timestamp": 783474523,
"extra": "1235650e78d297037c90390357f8a59bf17eff82cbc03c94f0b6267335a8dcb3",
"representative": "qlc_1c47tsj9cipsda74no7iugu44zjrae4doc8yu3m6qwkrtywnf9z1qa3badby"
}
`
const blockWithWorkAndSig = lib.fillBlock(testBlk, privKey)
// blockWithWorkAndSig is the json with 'work' and 'signature'