Constructor
new Output(optionsopt, nullable)
Create an output.
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
| options | Object | <optional> <nullable> | 
Properties:
| Name | Type | Description | 
|---|---|---|
| value | AmountValue | |
| address | Address | 
- Source:
Methods
(static) fromScript(address, value) → {Output}
Instantiate output from address/value pair.
Parameters:
| Name | Type | Description | 
|---|---|---|
| address | Address | |
| value | AmountValue | 
- Source:
Returns:
- Type
- Output
(static) isOutput(obj) → {Boolean}
Test an object to see if it is an Output.
Parameters:
| Name | Type | Description | 
|---|---|---|
| obj | Object | 
- Source:
Returns:
- Type
- Boolean
compare(output) → {Number}
Compare against another output (BIP69).
Parameters:
| Name | Type | Description | 
|---|---|---|
| output | Output | 
- Source:
Returns:
- Type
- Number
equals(output) → {Boolean}
Test equality against another output.
Parameters:
| Name | Type | Description | 
|---|---|---|
| output | Output | 
- Source:
Returns:
- Type
- Boolean
format() → {Object}
Convert the input to a more user-friendly object.
- Source:
Returns:
- Type
- Object
fromJSON(json)
Inject properties from a JSON object.
Parameters:
| Name | Type | Description | 
|---|---|---|
| json | OutputJSON | 
- Source:
fromOptions(options)
Inject properties from options object.
Parameters:
| Name | Type | Description | 
|---|---|---|
| options | Object | 
- Source:
fromScript(address, value) → {Output}
Inject properties from address/value pair.
Parameters:
| Name | Type | Description | 
|---|---|---|
| address | Address | |
| value | AmountValue | 
- Source:
Returns:
- Type
- Output
getAddress() → {Address}
Get the address.
- Source:
Returns:
address
- Type
- Address
getDustThreshold(rateopt, nullable) → {AmountValue}
Calculate the dust threshold for this output, based on serialize size and rate.
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
| rate | Rate | <optional> <nullable> | 
- Source:
Returns:
- Type
- AmountValue
getHash() → {Hash}
Get the address hash.
- Source:
Returns:
- Type
- Hash
getJSON(networkopt) → {OutputJSON}
Convert the output to an object suitable for JSON serialization.
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
| network | Network | <optional> | 
- Source:
Returns:
- Type
- OutputJSON
getSize() → {Number}
Calculate size of serialized output.
- Source:
Returns:
- Type
- Number
inject(output) → {this}
Clone the output.
Parameters:
| Name | Type | Description | 
|---|---|---|
| output | this | 
- Source:
Returns:
- Type
- this
isDust(rateopt, nullable) → {Boolean}
Test whether the output should be considered dust.
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
| rate | Rate | <optional> <nullable> | 
- Source:
Returns:
- Type
- Boolean
isUnspendable() → {Boolean}
Test whether the output is unspendable.
- Source:
Returns:
- Type
- Boolean
read(br) → {this}
Inject properties from buffer reader.
Parameters:
| Name | Type | Description | 
|---|---|---|
| br | bio.BufferReader | 
- Source:
Returns:
- Type
- this
write(bw) → {BufioWriter}
Write the output to a buffer writer.
Parameters:
| Name | Type | Description | 
|---|---|---|
| bw | BufioWriter | 
- Source:
Returns:
- Type
- BufioWriter