Members
(constant) DEFAULT_OPTS
These are the default arguments for a Psbt instance.
- Source:
Methods
transactionFromBuffer()
This function is needed to pass to the bip174 base class's fromBuffer. It takes the "transaction buffer" portion of the psbt buffer and returns a Transaction (From the bip174 library) interface.
- Source:
Type Definitions
AddressState :Object
Contains information about an Unspent Transaction Output
Properties:
Name | Type | Description |
---|---|---|
addrStr |
string |
Base58 Public Address |
balanceSat |
number |
Balance of the Address in Satoshis |
totalReceivedSat |
number |
Total Received to the Address in Satoshis |
unconfirmedBalanceSat |
number |
Unconfirmed Balance of the Address in Satoshis |
transactions |
Array.<string> |
Array of |
spentTransactions |
Array.<string> |
Array of |
lastUpdated |
number |
Timestamp of when the Address was last updated/synced with the Explorer |
- Source:
Example
{
addrStr: 'F8P6nUvDfcHikqdUnoQaGPBVxoMcUSpGDp',
balanceSat: 0,
totalReceivedSat: 0,
unconfirmedBalanceSat: 0,
transactions: [],
spentTransactions: [],
lastUpdated: 0
}
bip32 :Object
A BIP32 Node that manages Derivation of Chains and Addresses. This is created from the bip32
npm package managed by bitcoinjs
.
- Source:
Examples
import * as bip32 from 'bip32';
let bip32Node = bip32.fromBase58("xprv9xpXFhFpqdQK3TmytPBqXtGSwS3DLjojFhTGht8gwAAii8py5X6pxeBnQ6ehJiyJ6nDjWGJfZ95WxByFXVkDxHXrqu53WCRGypk2ttuqncb")
import * as bip32 from 'bip32';
import { Networks } from '@oipwg/hdmw';
let bip32Node = bip32.fromBase58("Fprv4xQSjQhWzrCVzvgkjam897LUV1AfxMuG8FBz5ouGAcbyiVcDYmqh7R2Fi22wjA56GQdmoU1AzfxsEmVnc5RfjGrWmAiqvfzmj4cCL3fJiiC", Networks.flo.network)
bip32utilschain :Object
A BIP32 Chain manager. This is created from the @oipwg/bip32-utils
npm package managed by oipwg
.
- Source:
Example
import * as bip32 from 'bip32';
import bip32utils from '@oipwg/bip32-utils';
let bip32Node = bip32.fromBase58("xprv9xpXFhFpqdQK3TmytPBqXtGSwS3DLjojFhTGht8gwAAii8py5X6pxeBnQ6ehJiyJ6nDjWGJfZ95WxByFXVkDxHXrqu53WCRGypk2ttuqncb")
let chain = new bip32utils.Chain(bip32Node)
CoinInfo :Object
An object that contains information about a coins Name, Network, and access to an explorer
Properties:
Name | Type | Description |
---|---|---|
name |
string |
All lowercase "name" of the CoinInfo, this is what is passed in to the |
displayName |
string |
The Display Name for the Coin, this would be the full official name and can include spaces. |
ticker |
string |
The "Ticker" that is used to track the Coin on Exchanges |
satPerCoin |
number |
The number of satoshis per single coin |
feePerKb |
number |
The amount of fee in satoshis to pay per kilobyte of data being put into the blockchain |
feePerByte |
number |
The amount of fee in satoshis to pay per byte of data being put into the blockchain |
maxFeePerByte |
number |
The maximum fee to pay per byte of data being put into the blockchain |
minFee |
number |
The minimum fee that should ever be paid |
dust |
number |
Amount in Satoshis of the minimum value allowed to be sent around the network |
txVersion |
number |
The current TX version number for the coin |
explorer |
Insight |
An Insight explorer for the current coin so that data can be retrieved from the network |
network |
CoinNetwork |
The specific coin network variables, same as used in @oipwg/bitcoinjs-lib |
- Source:
Example
{
name: 'flo',
displayName: 'Flo',
ticker: 'FLO',
satPerCoin: 1e8,
feePerKb: floFeePerKb,
feePerByte: floFeePerKb / 1000,
maxFeePerByte: 100,
minFee: floFeePerKb,
dust: 100000,
txVersion: 2,
explorer: new Insight('https://livenet.flocha.in/api'),
network: CoinNetwork
}
CoinNetwork :Object
An object that contains version variables specific to the Coin
Properties:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
bip32 |
Object |
BIP32 Variables Properties
|
|||||||||
slip44 |
number |
The |
|||||||||
messagePrefix |
string |
The Prefix to add on when checking/signing a message |
|||||||||
pubKeyHash |
number |
The coin specific "version" used when creating a Public Key Hash (Public Address) |
|||||||||
scriptHash |
number |
The coin specific "version" used when creating a Script Hash |
|||||||||
wif |
number |
Wallet Import Format "version" for this specific coin |
- Source:
Example
{
bip32: {
public: 0x0134406b,
private: 0x01343c31
},
slip44: 216,
messagePrefix: '\x1bFlorincoin Signed Message:\n',
pubKeyHash: 35,
scriptHash: 94,
wif: 163
}
ECPair :Object
- Source:
OutputAddress :Object
An Output for a Transaction
- Source:
Examples
{ "FHQvhgDut1rn1nvQRZ3z9QgMEVMavRo2Tu": 0.00001 }
{ "base58-public-address": valueInWholeCoin }
SelectedInputOutput :Object
An object returned from coinselect
that contains information about selected inputs, outputs, and the fee.
Properties:
Name | Type | Description |
---|---|---|
inputs |
Array.<TXInput> |
An Array of Transaction Inputs |
outputs |
Array.<TXOutput> |
An Array of Transaction Outputs |
fee |
number |
The Calculated Fee to pay |
- Source:
TXInput :Object
A Transaction Input
Properties:
Name | Type | Description |
---|---|---|
address |
string |
Base58 Public Address |
txId |
string |
Parent Transaction ID |
vout |
number |
Index of output in Parent Transaction |
scriptPubKey |
string |
Script Public Key Hash |
value |
number |
Balance of the input in Satoshis |
- Source:
Example
{
address: 'F8P6nUvDfcHikqdUnoQaGPBVxoMcUSpGDp',
txId: '7687e361f00998f96b29938bf5b7d9003a15ec182c13b6ddbd5adc0f993cbf9c',
vout: 1,
scriptPubKey: '76a9141bfcff1731caf3a16225d3e78735ddc229e4fc6c88ac',
value: 100000
}
TXOutput :Object
A Transaction Output
Properties:
Name | Type | Description |
---|---|---|
address |
string |
Base58 Public Address |
value |
number |
Amount to send Satoshis |
- Source:
utxo :Object
Contains information about an Unspent Transaction Output
Properties:
Name | Type | Description |
---|---|---|
address |
string |
Base58 Public Address |
txid |
string |
The Transaction ID |
vout |
number |
The Index of this specific Output in its parent Transaction |
scriptPubKey |
string |
The Script Public Key Hash |
amount |
number |
Amount (in whole Coin) of this Output |
satoshis |
number |
Amount in Satoshis of this Output |
height |
number |
The Blockheight the Parent Transaction was confirmed in |
confirmations |
number |
The total number of Confirmations the Parent Transaction has received |
- Source: