UNPKG

hamilton

Version:

Tools and utilities for interacting with Project Hamilton OpenCBDC atomizer and 2pc environments

14 lines (10 loc) 751 B
const Input = require('./transaction/input'); const Output = require('./transaction/output'); const Transaction = require('./transaction/transaction'); const Networking = require('./networking/broadcast'); const secretKey = 'e00b5c3d80899217a22fea87e7337907203df8a1efebd4d2a8773c8f629fff36'; const input = new Input('9f981e64afc0fc56a0d7b355cd9eba36f3d19507088713b1f73afc5bf301a44e', 0, '70cd87ebaaa0d2d059dccaceeb7f9f823a5791d60b00aef9d9573f1fbf91ca29', 200) const output = new Output('81b095a242974d9f4e98ca18b468b8e644e4168380a035b3d66bc279b36c6510', 200) const tx = new Transaction([input], [output], []); tx.sign(secretKey); Networking.broadcastTx(5555, '127.0.0.1', Buffer.from(tx.toHex(), 'hex'))