-
Notifications
You must be signed in to change notification settings - Fork 1
3.3 tx
gettocat edited this page Aug 25, 2017
·
2 revisions
tx is Transaction type object. This type contain next fields:
{
version: 'uint32',
in_count: 176,//only for read
in: [txin,txin,...]
out_count: 74,//only for read
out: [txout, txout,...],
lock_time: 'uint32',
hash: 'b0dfddb20b270e7a5355e1035124bae6d6667e11702f54fad56b164df98e16e0', //only for read
length: 28513 //only for read
}
read from Buffer (or hex string) into object with fields above.
write into Buffer object. Throw error if:
- version, in or out is empty (1 in and 1 out is required)
- lock_time is not numeric
- tx_in errors
- tx_out errors
read from stack tx value
var script = {
'keyname': ['tx']
}
var stack = new bitPony.stackReader(buffer, script)write into stack tx value
var script = [
['tx', version, inlist, outlist, locktime],
];
var stack = new bitPony.stackWriter(buffer, script);read from stream tx
var stream = new bitPony.reader(b);
var res = stream.tx(offset);
//res.resultwrite to stream tx value
var stream = new bitPony.writer(b);
stream.tx_in (version, inlist, outlist, locktime, true);
//or
var res = stream.tx_in(version, inlist, outlist, locktime);
//res.resultcan be vector as vector.tx