1.0.14 • Published 5 years ago
signtransactionjs v1.0.14
signtransactionjs - Blockchain Transaction Signer
Signed the transaction with your private key before sending
Installation
Node
npm install signtransactionjs
Usage
const TxSigner = require('signtransactionjs');
const getSignTx = function (privateKey, serializeTx, type) {
switch (Number(type)) {
case config.NEO:
return blockchain.neo.signTxNeo(privateKey, serializeTx)
case config.ETH:
return blockchain.eth.signTxETH(privateKey, serializeTx)
case config.BTC:
return blockchain.btc.signTxBTC(privateKey, serializeTx)
default:
return new Promise((resolve, reject) => {
resolve("Invalid Wallet Type")
})
}
}
let signedTx = getSignTx('0x2E53AEB00D562F59A5622113DA7FECE46519BF4813DCD0DEFFEC9B631220471E', 'f889808609184e72a00082271094000000000000000000000000000000000000000080a47f74657374320000000000000000000000000000000000000000000000000000006000571ca08a8bbf888cfa37bbf0bb965423625641fc956967b81d12e23709cead01446075a01ce999b56a8a88504be365442ea61239198e23d1fce7d00fcfc5cd3b44b7215f', '1');