Members
wdb :WalletDB
Type:
- Source:
Methods
(async, private) _listHistory(acct, options) → {Promise.<Array.<TXRecord>>}
Get all transactions in ascending or decending order after or from a txid/hash, inclusive or exclusive and limited at a configurable max of transactions.
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
acct |
Number | ||||||||||||||||
options |
Number |
Properties
|
- Source:
Returns:
- Type
- Promise.<Array.<TXRecord>>
(async, private) _listUnconfirmed(acct, options) → {Promise.<Array.<TXRecord>>}
Get all unconfirmed transactions in ascending or decending order after or from a txid/hash, inclusive or exclusive and limited at a configurable max of transactions
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
acct |
Number | ||||||||||||||||
options |
Number |
Properties
|
- Source:
Returns:
- Type
- Promise.<Array.<TXRecord>>
(async, private) _toDetails(wtx) → {Promise.<Details>}
Convert transaction to transaction details.
Parameters:
Name | Type | Description |
---|---|---|
wtx |
TXRecord |
- Source:
Returns:
- Type
- Promise.<Details>
(async) abandon(hash) → {Promise.<Details>}
Abandon transaction.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash |
- Source:
Returns:
- removed tx details.
- Type
- Promise.<Details>
(async) add(tx, blockopt, extraopt) → {Promise.<?Details>}
Add transaction without a batch.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
tx |
TX | ||
block |
BlockMeta |
<optional> |
|
extra |
BlockExtraInfo |
<optional> |
- Source:
Returns:
- Type
- Promise.<?Details>
(async) addBlock(b, hash, block) → {Promise}
Append to the global block record.
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
hash |
Hash | transaction hash. |
block |
BlockMeta |
- Source:
Returns:
- Type
- Promise
addBlockMap(height) → {Promise}
Append to global map.
Parameters:
Name | Type | Description |
---|---|---|
height |
Number |
- Source:
Returns:
- Type
- Promise
(async, private) addCountAndTimeIndex(b, options) → {Promise}
Add monotonic time and count based indexing to support querying transaction history in subsets and by time.
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b |
Batch | ||||||||||||||||
options |
Object |
Properties
|
- Source:
Returns:
- Type
- Promise
(async, private) addCountAndTimeIndexUnconfirmed(b, accounts, hash, time) → {Promise}
Add count and time based indexing to support querying unconfirmed transaction history in subsets by time and by count. This is called when we see a new transaction that is unconfirmed. insert() w/o block.
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
accounts |
Map.<Number, Balance> | |
hash |
Hash | Transaction hash. |
time |
Number | Transaction time. |
- Source:
Returns:
- Type
- Promise
(async, private) addCountAndTimeIndexUnconfirmedUndo(b, hash, time) → {Promise}
Add undo unconfirmed time and unconfirmed index to restore unconfirmed time during reorganizations.
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
hash |
Hash | Transaction hash. |
time |
Number | Transaction time. |
- Source:
Returns:
- Type
- Promise
addNameMap(hash, index) → {Promise}
Append to global map.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash | |
index |
Number |
- Source:
Returns:
- Type
- Promise
addOutpointMap(hash, index) → {Promise}
Append to global map.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash | |
index |
Number |
- Source:
Returns:
- Type
- Promise
addTXMap(hash) → {Promise}
Append to global map.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash |
- Source:
Returns:
- Type
- Promise
addUndoToInput(credit, spender)
Spend credit by spender/input record. Add undo coin to the input record.
Parameters:
Name | Type | Description |
---|---|---|
credit |
Credit | |
spender |
Outpoint |
- Source:
(async) applyNameUndo(b, hash) → {Promise.<Boolean>}
Apply namestate undo data by hash without transaction. Should only be called directly to undo namestate transitions that do not affect wallet balance like a TRANSFER for a name that is in the nameMap but does not involve wallet addresses.
Parameters:
Name | Type | Description |
---|---|---|
b |
Object | |
hash |
Hash |
- Source:
Returns:
- applied undo.
- Type
- Promise.<Boolean>
(async, private) confirm(wtx, block, extra) → {Promise.<Details>}
Attempt to confirm a transaction.
Parameters:
Name | Type | Description |
---|---|---|
wtx |
TXRecord | |
block |
BlockMeta | |
extra |
BlockExtraInfo |
- Source:
Returns:
- Type
- Promise.<Details>
(async) connectNames(b, tx, view, height) → {Promise.<Boolean>}
Handle incoming covenant.
Parameters:
Name | Type | Description |
---|---|---|
b |
Object | |
tx |
TX | |
view |
CoinView | |
height |
Number |
- Source:
Returns:
updated
- Type
- Promise.<Boolean>
(async) disconnect(wtx, block, extra) → {Promise.<Details>}
Unconfirm a transaction. Necessary after a reorg.
Parameters:
Name | Type | Description |
---|---|---|
wtx |
TXRecord | |
block |
BlockMeta | |
extra |
BlockExtraInfo |
- Source:
Returns:
- Type
- Promise.<Details>
(async, private) disconnectCountAndTimeIndexUnconfirmed(b, accounts, hash)
Remove unconfirmed count and time based indexing. This will however leave some of the information around so that it's possible to restore the index should it be necessary during a reorg. This will remove indexing into the subsets of confirmed results, it will keep the count in the database that can be queried by hash, should there be a reorg and the transaction becomes pending again.
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
accounts |
Map.<Number, Balance> | |
hash |
Hash | Transaction hash. |
- Source:
(async) dump() → {bdb.Iterator}
Dump database (for debugging).
- Source:
Returns:
- Type
- bdb.Iterator
(private) emit(event, data, details)
Emit transaction event.
Parameters:
Name | Type | Description |
---|---|---|
event |
String | |
data |
Object | |
details |
Details |
- Source:
(async, private) erase(wtx, blockopt, medianTimeopt) → {Promise.<Details>}
Remove a transaction from the database. Disconnect inputs.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
wtx |
TXRecord | ||
block |
BlockMeta |
<optional> |
|
medianTime |
Number |
<optional> |
- Source:
Returns:
- Type
- Promise.<Details>
filterLocked(coins) → {Array.<Coin>|Array.<Outpoint>}
Filter array of coins or outpoints for only unlocked ones.
Parameters:
Name | Type | Description |
---|---|---|
coins |
Array.<Coin> | Array.<Outpoint> |
- Source:
Returns:
- Type
- Array.<Coin> | Array.<Outpoint>
(async) getAccountBalance(acct) → {Promise.<Balance>}
Calculate balance by account.
Parameters:
Name | Type | Description |
---|---|---|
acct |
Number |
- Source:
Returns:
- Type
- Promise.<Balance>
(async) getAccountCoins(acct) → {Promise.<Array.<Coin>>}
Get coins by account.
Parameters:
Name | Type | Description |
---|---|---|
acct |
Number |
- Source:
Returns:
- Type
- Promise.<Array.<Coin>>
(async) getAccountCredits(acct) → {Promise.<Array.<Credit>>}
Get coins by account.
Parameters:
Name | Type | Description |
---|---|---|
acct |
Number |
- Source:
Returns:
- Type
- Promise.<Array.<Credit>>
getAccountHeightRangeHashes(acct, options) → {Promise.<Array.<Hash>>}
Get TX hashes by height range.
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
acct |
Number | |||||||||||||||||||||
options |
Object |
Properties
|
- Source:
Returns:
- Type
- Promise.<Array.<Hash>>
getAccountOutpoints(acct) → {Promise.<Array.<Outpoint>>}
Get all coin hashes in the database.
Parameters:
Name | Type | Description |
---|---|---|
acct |
Number |
- Source:
Returns:
- Type
- Promise.<Array.<Outpoint>>
getAccountPendingHashes(acct) → {Promise.<Array.<Hash>>}
Get hashes of all unconfirmed transactions in the database.
Parameters:
Name | Type | Description |
---|---|---|
acct |
Number |
- Source:
Returns:
- Type
- Promise.<Array.<Hash>>
(async) getBalance(accountnullable) → {Promise.<Balance>}
Calculate balance.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
account |
Number |
<nullable> |
- Source:
Returns:
- Type
- Promise.<Balance>
(async) getBid(nameHash, outpoint) → {Promise.<?BlindBid>}
Get a bid if present.
Parameters:
Name | Type | Description |
---|---|---|
nameHash |
Buffer | |
outpoint |
Outpoint |
- Source:
Returns:
- Type
- Promise.<?BlindBid>
(async) getBidByReveal(nameHash, revealOut) → {Promise.<?BlindBid>}
Get bid by reveal outpoint.
Parameters:
Name | Type | Description |
---|---|---|
nameHash |
Buffer | |
revealOut |
Outpoint |
- Source:
Returns:
- Type
- Promise.<?BlindBid>
(async) getBids(nameHash) → {Promise.<Array.<BlindBid>>}
Get all bids for name.
Parameters:
Name | Type | Description |
---|---|---|
nameHash |
Buffer |
- Source:
Returns:
- Type
- Promise.<Array.<BlindBid>>
(async) getBlind(blind) → {Promise.<?BlindValue>}
Get a blind value if present.
Parameters:
Name | Type | Description |
---|---|---|
blind |
Buffer | Blind hash. |
- Source:
Returns:
- Type
- Promise.<?BlindValue>
(async) getBlock(height) → {Promise.<?BlockRecord>}
Get block record.
Parameters:
Name | Type | Description |
---|---|---|
height |
Number |
- Source:
Returns:
- Type
- Promise.<?BlockRecord>
getBlocks() → {Promise.<Array.<BlockRecord>>}
List block records.
- Source:
Returns:
- Type
- Promise.<Array.<BlockRecord>>
(async) getBlockTXsSize(height) → {Promise.<Number>}
Get block hashes size.
Parameters:
Name | Type | Description |
---|---|---|
height |
Number |
- Source:
Returns:
- Type
- Promise.<Number>
(async) getCoin(hash, index) → {Promise.<?Coin>}
Get coin.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash | |
index |
Number |
- Source:
Returns:
- Type
- Promise.<?Coin>
(async) getCoins(acct) → {Promise.<Array.<Credit>>}
Get coins.
Parameters:
Name | Type | Description |
---|---|---|
acct |
Number |
- Source:
Returns:
- Type
- Promise.<Array.<Credit>>
(async) getCoinView(tx) → {Promise.<CoinView>}
Get a coin viewpoint.
Parameters:
Name | Type | Description |
---|---|---|
tx |
TX |
- Source:
Returns:
- Type
- Promise.<CoinView>
(async) getCountForTX(hash) → {Promise.<?TXCount>}
Get the count of a transaction.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash | Transaction hash. |
- Source:
Returns:
- Type
- Promise.<?TXCount>
(async) getCredit(hash, index) → {Promise.<?Credit>}
Get credit.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash | |
index |
Number |
- Source:
Returns:
- Type
- Promise.<?Credit>
getCredits(acct) → {Promise.<Array.<Credit>>}
Get coins.
Parameters:
Name | Type | Description |
---|---|---|
acct |
Number |
- Source:
Returns:
- Type
- Promise.<Array.<Credit>>
(async) getDetails(hash) → {Promise.<?Details>}
Get transaction details.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash |
- Source:
Returns:
- Type
- Promise.<?Details>
getHeightHashes(height) → {Promise.<Array.<Hash>>}
Get TX hashes by height.
Parameters:
Name | Type | Description |
---|---|---|
height |
Number |
- Source:
Returns:
- Type
- Promise.<Array.<Hash>>
getHeightRangeHashes(acct, options) → {Promise.<Array.<Hash>>}
Get TX hashes by height range.
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
acct |
Number | |||||||||||||||||||||
options |
Object |
Properties
|
- Source:
Returns:
- Type
- Promise.<Array.<Hash>>
(async) getLatestUnconfirmedTXCount() → {Promise.<TXCount>}
Get the latest unconfirmed TX count from the database. This number does not represent the count of current unconfirmed transactions, but the count of all unconfirmed transactions. As transactions are confirmed the value is deleted, however proceeding values are not decremented as to not have a large number of database updates at once.
- Source:
Returns:
- Type
- Promise.<TXCount>
getLocked() → {Array.<Outpoint>}
Return an array of all locked outpoints.
- Source:
Returns:
- Type
- Array.<Outpoint>
(async) getNames() → {Promise.<Array.<NameState>>}
Get all names.
- Source:
Returns:
- Type
- Promise.<Array.<NameState>>
(async) getNameState(nameHash) → {Promise.<?NameState>}
Get a name state if present.
Parameters:
Name | Type | Description |
---|---|---|
nameHash |
Buffer |
- Source:
Returns:
- Type
- Promise.<?NameState>
getOutpoints(acct) → {Promise.<Array.<Outpoint>>}
Get all coin hashes in the database.
Parameters:
Name | Type | Description |
---|---|---|
acct |
Number |
- Source:
Returns:
- Type
- Promise.<Array.<Outpoint>>
getPath(output) → {Promise.<?Path>}
Get wallet path for output.
Parameters:
Name | Type | Description |
---|---|---|
output |
Output |
- Source:
Returns:
- Type
- Promise.<?Path>
(async) getPending(acct) → {Promise.<Array.<TX>>}
Get unconfirmed transactions.
Parameters:
Name | Type | Description |
---|---|---|
acct |
Number |
- Source:
Returns:
- Type
- Promise.<Array.<TX>>
getPendingHashes(acct) → {Promise.<Array.<Hash>>}
Get hashes of all unconfirmed transactions in the database.
Parameters:
Name | Type | Description |
---|---|---|
acct |
Number |
- Source:
Returns:
- Type
- Promise.<Array.<Hash>>
(async) getReveal(nameHash, outpoint) → {Promise.<?BidReveal>}
Get a reveal if present.
Parameters:
Name | Type | Description |
---|---|---|
nameHash |
Buffer | |
outpoint |
Outpoint |
- Source:
Returns:
- Type
- Promise.<?BidReveal>
(async) getRevealByBid(nameHash, bidOut) → {Promise.<?BidReveal>}
Get reveal by bid outpoint.
Parameters:
Name | Type | Description |
---|---|---|
nameHash |
Buffer | |
bidOut |
Outpoint |
- Source:
Returns:
- Type
- Promise.<?BidReveal>
(async) getReveals(nameHash) → {Promise.<Array.<BidReveal>>}
Get all reveals by name.
Parameters:
Name | Type | Description |
---|---|---|
nameHash |
Buffer |
- Source:
Returns:
- Type
- Promise.<Array.<BidReveal>>
(async) getSpent(hash, index) → {Promise.<?Outpoint>}
Test a whether a coin has been spent.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash | |
index |
Number |
- Source:
Returns:
- Type
- Promise.<?Outpoint>
(async) getSpentCoin(spent, prevout) → {Promise.<?Coin>}
Get spender coin.
Parameters:
Name | Type | Description |
---|---|---|
spent |
Outpoint | |
prevout |
Outpoint |
- Source:
Returns:
- Type
- Promise.<?Coin>
(async) getSpentCoins(tx) → {Promise.<Array.<Coin>>}
Get historical coins for a transaction.
Parameters:
Name | Type | Description |
---|---|---|
tx |
TX |
- Source:
Returns:
- Type
- Promise.<Array.<Coin>>
(async) getSpentCredits(tx) → {Promise.<Array.<(Credit|null)>>}
Fill a transaction with coins (all historical coins).
Parameters:
Name | Type | Description |
---|---|---|
tx |
TX |
- Source:
Returns:
- Type
- Promise.<Array.<(Credit|null)>>
(async) getSpentView(tx) → {Promise.<CoinView>}
Get historical coin viewpoint.
Parameters:
Name | Type | Description |
---|---|---|
tx |
TX |
- Source:
Returns:
- Type
- Promise.<CoinView>
(async) getTX(hash) → {Promise.<?TXRecord>}
Get transaction.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash |
- Source:
Returns:
- Type
- Promise.<?TXRecord>
(async, private) getUnconfirmedTimeForTX(hash) → {Promise.<Number>}
Add unconfirmed time indexing to support querying unconfirmed transaction history in subsets by time.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash | Transaction hash. |
- Source:
Returns:
- Type
- Promise.<Number>
(async) getUndoCountForTX(hash) → {Promise.<?TXCount>}
Get the undo count of a transaction.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash | Transaction hash. |
- Source:
Returns:
- Type
- Promise.<?TXCount>
(async) getWalletBalance() → {Promise.<Balance>}
Calculate balance.
- Source:
Returns:
- Type
- Promise.<Balance>
(async) hasBid(nameHash, outpoint) → {Promise.<Boolean>}
Test whether we have a bid.
Parameters:
Name | Type | Description |
---|---|---|
nameHash |
Buffer | |
outpoint |
Outpoint |
- Source:
Returns:
- Type
- Promise.<Boolean>
(async) hasBlind(blind) → {Promise.<Boolean>}
Test whether a blind value is present.
Parameters:
Name | Type | Description |
---|---|---|
blind |
Buffer | Blind hash. |
- Source:
Returns:
- Type
- Promise.<Boolean>
(async) hasCoin(hash) → {Promise.<Boolean>}
Test whether the database has a transaction.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash |
- Source:
Returns:
- Type
- Promise.<Boolean>
hasCoinByAccount(acct, hash, number) → {Promise.<Boolean>}
Test whether an account owns a coin.
Parameters:
Name | Type | Description |
---|---|---|
acct |
Number | |
hash |
Hash | |
number |
Index |
- Source:
Returns:
- Type
- Promise.<Boolean>
(async) hasNameState(nameHash) → {Promise.<Boolean>}
Test whether we have a name.
Parameters:
Name | Type | Description |
---|---|---|
nameHash |
Buffer |
- Source:
Returns:
- Type
- Promise.<Boolean>
hasPath(output) → {Promise.<Boolean>}
Test whether path exists for output.
Parameters:
Name | Type | Description |
---|---|---|
output |
Output |
- Source:
Returns:
- Type
- Promise.<Boolean>
(async) hasPending(hash) → {Promise.<Boolean>}
Test whether the database has a pending transaction.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash |
- Source:
Returns:
- Type
- Promise.<Boolean>
(async) hasReveal(nameHash, outpoint) → {Promise.<Boolean>}
Test whether we have a reveal.
Parameters:
Name | Type | Description |
---|---|---|
nameHash |
Buffer | |
outpoint |
Outpoint |
- Source:
Returns:
- Type
- Promise.<Boolean>
hasSpentCoin(spent) → {Promise.<Boolean>}
Test whether the database has a spent coin.
Parameters:
Name | Type | Description |
---|---|---|
spent |
Outpoint |
- Source:
Returns:
- Type
- Promise.<Boolean>
hasTX(hash) → {Promise.<Boolean>}
Test whether the database has a transaction.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash |
- Source:
Returns:
- Type
- Promise.<Boolean>
(private) incrementLatestUnconfirmedTXCount(b, count)
Increment latest unconfirmed index.
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
count |
Number |
- Source:
(private) indexOpens(b, tx)
Index open covenants.
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
tx |
TX |
- Source:
(async, private) insert(wtx, blockopt, extraopt) → {Promise.<Details>}
Insert transaction.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
wtx |
TXRecord | ||
block |
BlockMeta |
<optional> |
|
extra |
BlockExtraInfo |
<optional> |
- Source:
Returns:
- Type
- Promise.<Details>
(async) isDoubleOpen(tx) → {Promise.<Boolean>}
Test whether the transaction has a duplicate open.
Parameters:
Name | Type | Description |
---|---|---|
tx |
TX |
- Source:
Returns:
- Type
- Promise.<Boolean>
isLocked(coin) → {Boolean}
Test locked status of a single coin.
Parameters:
Name | Type | Description |
---|---|---|
coin |
Coin | Outpoint |
- Source:
Returns:
- Type
- Boolean
isSpent(hash, index) → {Promise.<Boolean>}
Test a whether a coin has been spent.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash | |
index |
Number |
- Source:
Returns:
- Type
- Promise.<Boolean>
(async) listHistory(acct, options) → {Promise.<Array.<TXRecord>>}
Get all transactions in ascending or decending order limited at a configurable max transactions.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
acct |
Number | ||||||||||
options |
Object |
Properties
|
- Source:
Returns:
- Type
- Promise.<Array.<TXRecord>>
(async) listHistoryAfter(acct, options) → {Promise.<Array.<TXRecord>>}
Get all transactions in ascending or decending order after a txid/hash (exclusive) and limited at a configurable max of transactions.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
acct |
Number | |||||||||||||
options |
Object |
Properties
|
- Source:
Returns:
- Type
- Promise.<Array.<TXRecord>>
(async) listHistoryByTime(acct, options) → {Promise.<Array.<TXRecord>>}
Get all transactions in ascending or decending order from a time (inclusive) and limited at a configurable max of transactions.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
acct |
Number | |||||||||||||
options |
Object |
Properties
|
- Source:
Returns:
- Type
- Promise.<Array.<TXRecord>>
(async) listHistoryFrom(acct, options) → {Promise.<Array.<TXRecord>>}
Get all transactions in ascending or decending order after a txid/hash (inclusive) and limited at a configurable max of transactions.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
acct |
Number | |||||||||||||
options |
Object |
Properties
|
- Source:
Returns:
- Type
- Promise.<Array.<TXRecord>>
(async) listUnconfirmed(acct, options) → {Promise.<Array.<TXRecord>>}
Get all unconfirmed transactions in ascending or decending order limited at a configurable max transactions.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
acct |
Number | ||||||||||
options |
Object |
Properties
|
- Source:
Returns:
- Type
- Promise.<Array.<TXRecord>>
(async) listUnconfirmedAfter(acct, options) → {Promise.<Array.<TXRecord>>}
Get all unconfirmed transactions in ascending or decending order after a txid/hash (exclusive) and limited at a max of 100 transactions.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
acct |
Number | |||||||||||||
options |
Object |
Properties
|
- Source:
Returns:
- Type
- Promise.<Array.<TXRecord>>
(async) listUnconfirmedByTime(acct, options) → {Promise.<Array.<TXRecord>>}
Get all unconfirmed transactions in ascending or decending order limited at a configurable max transactions.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
acct |
Number | ||||||||||
options |
Object |
Properties
|
- Source:
Returns:
- Type
- Promise.<Array.<TXRecord>>
(async) listUnconfirmedFrom(acct, options) → {Promise.<Array.<TXRecord>>}
Get all unconfirmed transactions in ascending or decending order after a txid/hash (inclusive) and limited at a max of 100 transactions.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
acct |
Number | |||||||||||||
options |
Object |
Properties
|
- Source:
Returns:
- Type
- Promise.<Array.<TXRecord>>
lockBalances(state, credit, path, height)
Lock balances according to covenant. Inserting or confirming: TX outputs. Removing or undoing: Coins spent by the wallet in tx inputs.
Parameters:
Name | Type | Description |
---|---|---|
state |
State | |
credit |
Credit | |
path |
Path | |
height |
Number |
- Source:
lockCoin(coin)
Lock a single coin.
Parameters:
Name | Type | Description |
---|---|---|
coin |
Coin | Outpoint |
- Source:
lockTX(tx)
Lock all coins in a transaction.
Parameters:
Name | Type | Description |
---|---|---|
tx |
TX |
- Source:
(async) open() → {Promise}
Open TXDB.
- Source:
Returns:
- Type
- Promise
putBid(b, nameHash, outpoint, options)
Write a bid.
Parameters:
Name | Type | Description |
---|---|---|
b |
Object | |
nameHash |
Buffer | |
outpoint |
Outpoint | |
options |
Object |
- Source:
putBlind(b, blind, options)
Write a blind value.
Parameters:
Name | Type | Description |
---|---|---|
b |
Object | |
blind |
Buffer | |
options |
Object |
- Source:
putReveal(b, nameHash, outpoint, options) → {void}
Write a reveal.
Parameters:
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b |
Object | |||||||||||||||||||
nameHash |
Buffer | |||||||||||||||||||
outpoint |
Outpoint | |||||||||||||||||||
options |
Object |
Properties
|
- Source:
Returns:
- Type
- void
(async) recalculateBalances() → {Promise}
Recalculate wallet balances.
- Source:
Returns:
- Type
- Promise
(async) remove(hash) → {Promise.<?Details>}
Recursively remove a transaction from the database.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash |
- Source:
Returns:
- Type
- Promise.<?Details>
removeBid(b, nameHash, outpoint)
Delete a bid.
Parameters:
Name | Type | Description |
---|---|---|
b |
Object | |
nameHash |
Buffer | |
outpoint |
Outpoint |
- Source:
(async) removeBids(nameHash) → {Promise}
Remove all bids for name.
Parameters:
Name | Type | Description |
---|---|---|
nameHash |
Buffer |
- Source:
Returns:
- Type
- Promise
removeBlind(b, blind)
Delete a blind value.
Parameters:
Name | Type | Description |
---|---|---|
b |
Object | |
blind |
Buffer |
- Source:
(async) removeBlock(hash, height) → {Promise}
Remove from the global block record.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash | |
height |
Number |
- Source:
Returns:
- Type
- Promise
removeBlockMap(height) → {Promise}
Remove from global map.
Parameters:
Name | Type | Description |
---|---|---|
height |
Number |
- Source:
Returns:
- Type
- Promise
(async, private) removeConflict(hash, ref) → {Promise.<?Details>}
Remove spenders that have not been confirmed. We do this in the odd case of stuck transactions or when a coin is double-spent by a newer transaction. All previously-spending transactions of that coin that are not confirmed will be removed from the database.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash | |
ref |
TX | Reference tx, the tx that double-spent. |
- Source:
Returns:
- Returns Boolean.
- Type
- Promise.<?Details>
(async, private) removeConflicts(tx, conf) → {Promise.<Boolean>}
Retrieve coins for own inputs, remove double spenders, and verify inputs.
Parameters:
Name | Type | Description |
---|---|---|
tx |
TX | |
conf |
Boolean |
- Source:
Returns:
- Type
- Promise.<Boolean>
(async, private) removeCountAndTimeIndex(b, options) → {Promise}
Remove monotonic time and count based indexing.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b |
Batch | |||||||||||||
options |
Object |
Properties
|
- Source:
Returns:
- Type
- Promise
(async, private) removeCountAndTimeIndexUnconfirmed(b, accounts, hash) → {Promise}
Remove all unconfirmed count and time based indexing.
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
accounts |
Map.<Number, Balance> | |
hash |
Hash | Transaction hash. |
- Source:
Returns:
- Type
- Promise
(async) removeCredit(credit, path)
Remove credit.
Parameters:
Name | Type | Description |
---|---|---|
credit |
Credit | |
path |
Path |
- Source:
(async, private) removeDoubleOpen(tx) → {Promise}
Remove duplicate opens.
Parameters:
Name | Type | Description |
---|---|---|
tx |
TX |
- Source:
Returns:
- Type
- Promise
(async) removeInput(tx, index)
Remove input record.
Parameters:
Name | Type | Description |
---|---|---|
tx |
TX | |
index |
Number |
- Source:
removeNameMap(hash, index) → {Promise}
Remove from global map.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash | |
index |
Number |
- Source:
Returns:
- Type
- Promise
removeOutpointMap(hash, index) → {Promise}
Remove from global map.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash | |
index |
Number |
- Source:
Returns:
- Type
- Promise
(async, private) removeRecursive(wtx, medianTime) → {Promise.<?Details>}
Remove a transaction and recursively remove all of its spenders.
Parameters:
Name | Type | Description |
---|---|---|
wtx |
TXRecord | |
medianTime |
Number |
- Source:
Returns:
- Type
- Promise.<?Details>
removeReveal(b, nameHash, outpoint, bidPrevout)
Delete a reveal.
Parameters:
Name | Type | Description |
---|---|---|
b |
Object | |
nameHash |
Buffer | |
outpoint |
Outpoint | |
bidPrevout |
Outpoint |
- Source:
(async) removeReveals(b, nameHash) → {Promise}
Remove all reveals by name.
Parameters:
Name | Type | Description |
---|---|---|
b |
Object | |
nameHash |
Buffer |
- Source:
Returns:
- Type
- Promise
removeTXMap(hash) → {Promise}
Remove from global map.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash |
- Source:
Returns:
- Type
- Promise
(async, private) restoreCountAndTimeIndexUnconfirmed(b, accounts, hash)
This will restore the count and time indexing for unconfirmed transactions during reorganizations. This is possible because we leave the pre-existing count in the database.
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
accounts |
Map.<Number, Balance> | |
hash |
Hash | Transaction hash. |
- Source:
(async) revert(height) → {Promise.<Number>}
Revert a block.
Parameters:
Name | Type | Description |
---|---|---|
height |
Number |
- Source:
Returns:
- number of txs removed.
- Type
- Promise.<Number>
(async) saveBlind(blind, options) → {Promise}
Save blind value.
Parameters:
Name | Type | Description |
---|---|---|
blind |
Buffer | |
options |
Object |
- Source:
Returns:
- Type
- Promise
(async) saveCredit(credit, path)
Save credit.
Parameters:
Name | Type | Description |
---|---|---|
credit |
Credit | |
path |
Path |
- Source:
spendCredit(credit, tx, index)
Spend credit.
Parameters:
Name | Type | Description |
---|---|---|
credit |
Credit | |
tx |
TX | |
index |
Number |
- Source:
(async) spliceBlock(hash, height) → {Promise}
Remove from the global block record.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash | |
height |
Number |
- Source:
Returns:
- Type
- Promise
(async) toDetails(wtxs) → {Promise.<(Array.<Details>|Details)>}
Convert transaction to transaction details.
Parameters:
Name | Type | Description |
---|---|---|
wtxs |
Array.<TXRecord> | TXRecord |
- Source:
Returns:
- Type
- Promise.<(Array.<Details>|Details)>
(async, private) unconfirm(hash, height, extra) → {Promise.<?Details>}
Unconfirm a transaction without a batch.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash | |
height |
Number | |
extra |
BlockExtraInfo |
- Source:
Returns:
- Type
- Promise.<?Details>
(async) undoNameState(b, tx, i, path, height) → {Promise.<Boolean>}
Handle reorg'd covenant.
Parameters:
Name | Type | Description |
---|---|---|
b |
Object | |
tx |
TX | |
i |
Number | |
path |
Path | |
height |
Number |
- Source:
Returns:
applied undo.
- Type
- Promise.<Boolean>
(private) unindexOpens(b, tx)
Unindex open covenants.
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
tx |
TX |
- Source:
unlockBalances(state, credit, path, height)
Unlock balances according to covenants. Inserting or confirming: Coins spent by the wallet in TX inputs. Removing or undoing: TX outputs.
Parameters:
Name | Type | Description |
---|---|---|
state |
State | |
credit |
Credit | |
path |
Path | |
height |
Number |
- Source:
unlockCoin(coin) → {Boolean}
Unlock a single coin.
Parameters:
Name | Type | Description |
---|---|---|
coin |
Coin | Outpoint |
- Source:
Returns:
- whether the coin was locked.
- Type
- Boolean
unlockCoins()
Unlock all locked coins.
- Source:
unlockTX(tx)
Unlock all coins in a transaction.
Parameters:
Name | Type | Description |
---|---|---|
tx |
TX |
- Source:
unspendCredit(tx, index)
Unspend credit.
Parameters:
Name | Type | Description |
---|---|---|
tx |
TX | |
index |
Number |
- Source:
(async) updateAccountBalance(b, acct, delta)
Update account balance.
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
acct |
Number | |
delta |
BalanceDelta |
- Source:
(async) updateBalance(state)
Update wallet balance.
Parameters:
Name | Type | Description |
---|---|---|
state |
BalanceDelta |
- Source:
(async) updateSpentCoin(tx, index, height) → {Promise}
Update spent coin height in storage.
Parameters:
Name | Type | Description |
---|---|---|
tx |
TX | Sending transaction. |
index |
Number | |
height |
Number |
- Source:
Returns:
- Type
- Promise
(async, private) watchOpensEarly(b, tx, path) → {Promise}
Start tracking OPENs right away. This does not check if the name is owned by the wallet.
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
tx |
Output | |
path |
Path |
- Source:
Returns:
- Type
- Promise
(async) writeInput(tx, index)
Write input record.
Parameters:
Name | Type | Description |
---|---|---|
tx |
TX | |
index |
Number |
- Source:
(async) zap(acct, age) → {Promise.<Array.<Hash>>}
Zap pending transactions older than age
.
Parameters:
Name | Type | Description |
---|---|---|
acct |
Number | |
age |
Number | Age delta. |
- Source:
Returns:
- zapped tx hashes.
- Type
- Promise.<Array.<Hash>>