Constructor
new TXRecord(mtime, txopt, blockopt)
Create tx record.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
mtime |
Number | ||
tx |
TX |
<optional> |
|
block |
BlockMeta |
<optional> |
- Source:
Methods
(static) fromTX(txopt, blockopt, mtimeopt) → {TXRecord}
Instantiate tx record from tx and block.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
tx |
TX |
<optional> |
|
block |
Block |
<optional> |
|
mtime |
Number |
<optional> |
- Source:
Returns:
- Type
- TXRecord
(private) fromTX(tx, blockopt) → {TXRecord}
Inject properties from tx and block.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
tx |
TX | ||
block |
Block |
<optional> |
- Source:
Returns:
- Type
- TXRecord
getBlock() → {BlockMeta}
Convert tx record to a block meta.
- Source:
Returns:
- Type
- BlockMeta
getDepth(height) → {Number}
Calculate current number of transaction confirmations.
Parameters:
Name | Type | Description |
---|---|---|
height |
Number | Current chain height. |
- Source:
Returns:
confirmations
- Type
- Number
getSize() → {Number}
Get serialization size.
- Source:
Returns:
- Type
- Number
(private) read(data)
Inject properties from "extended" format.
Parameters:
Name | Type | Description |
---|---|---|
data |
Buffer |
- Source:
setBlock(block)
Set block data (confirm).
Parameters:
Name | Type | Description |
---|---|---|
block |
BlockMeta |
- Source:
unsetBlock()
Unset block (unconfirm).
- Source:
write() → {Buffer}
Serialize a transaction to "extended format".
- Source:
Returns:
- Type
- Buffer