-
Notifications
You must be signed in to change notification settings - Fork 1
3.1 tx_in
gettocat edited this page Aug 25, 2017
·
6 revisions
tx_in is Transaction input type. This type contain next fields:
{
hash: 'char32',
index: 'uint32',
scriptSig: 'string',
sequence: 'uint32'
}
read from Buffer (or hex string) into object with fields above.
write into Buffer object. Throw error if:
- scriptSig, index or hash is empty
- hash is not 32 byte char str
- index is not numeric
read from stack tx_in value
var script = {
'keyname': ['tx_in']
}
var stack = new bitPony.stackReader(buffer, script)write into stack tx_in value
var script = [
['tx_in', hash, index, scriptSig, sequence],
];
var stack = new bitPony.stackWriter(buffer, script);read from stream tx_in
var stream = new bitPony.reader(b);
var res = stream.tx_in(offset);
//res.resultwrite to stream tx_in value
var stream = new bitPony.writer(b);
stream.tx_in (hash, index, scriptSig, sequence, true);
//or
var res = stream.tx_in(hash, index, scriptSig, sequence);
//res.resultcan be vector as vector.tx_in