Constructor
new TXRecord(tx, blocknullable)
Create tx record.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
tx |
TX | ||
block |
BlockMeta |
<nullable> |
- Source:
Methods
(static) fromRaw(data) → {TX}
Instantiate a transaction from a buffer in "extended" serialization format.
Parameters:
Name | Type | Description |
---|---|---|
data |
Buffer |
- Source:
Returns:
- Type
- TX
(static) fromTX(tx, blocknullable) → {TXRecord}
Instantiate tx record from tx and block.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
tx |
TX | ||
block |
Block |
<nullable> |
- Source:
Returns:
- Type
- TXRecord
(private) fromRaw(data)
Inject properties from "extended" format.
Parameters:
Name | Type | Description |
---|---|---|
data |
Buffer |
- Source:
(private) fromTX(tx, blocknullable) → {TXRecord}
Inject properties from tx and block.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
tx |
TX | ||
block |
Block |
<nullable> |
- 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
setBlock(block)
Set block data (confirm).
Parameters:
Name | Type | Description |
---|---|---|
block |
BlockMeta |
- Source:
toRaw() → {Buffer}
Serialize a transaction to "extended format".
- Source:
Returns:
- Type
- Buffer
unsetBlock()
Unset block (unconfirm).
- Source: