Class: MoneroWalletLocal

MoneroWalletLocal(config)

Implements a Monero wallet using client-side crypto and a given daemon. TODO: optimize block requests TODO: ability to incorporate new blocks into current sync TODO: concurrent processing with X threads and await after network requests TODO: support creation from seed TODO: toJson() instead of getStore()? TODO: progress based on transaction count if starting from 0

Constructor

new MoneroWalletLocal(config)

Constructs client-side Monero wallet.
Parameters:
Name Type Description
config is a daemon instance or a config object as follows:
Properties
Name Type Description
daemon is the daemon to support the wallet (required unless procol, host, port, etc provided) // TODO: test with rpc config instead of daemon
mnemonic is a mnemonic phrase to import or generates new one if not given (optional)
mnemonicLanguage specifies the mnemonic phrase language (defaults to "en" for english)
store is an existing wallet store to import (optional)
startHeight is the start height to scan the wallet from (requires existing keys, defaults to 0)
numHeadersPerRequest specifies the number of headers to fetch when populating the header cache (defaults to 750)
maxReqSize specifies maximum total block size per blocks request (defaults to 4000000)
maxConcurrency specifies maximum concurrency for block requests; maximum memory = this * maxReqSize (defaults to 5)
skipMinerTxs skips processing miner txs to speed up scan time (defaults to false)
Source:

Members

(static) DEFAULT_CONFIG

Local wallet default config.
Source:

Methods

(async) _getCachedHeader(height)

Retrieves a header from the cache or fetches and caches a header range if not in the cache.
Parameters:
Name Type Description
height is the height of the header to retrieve from the cache
Source:

_hasUnprocessedBlocks(startHeight, endHeight)

Indicates if blocks are unprocessed within the given range.
Parameters:
Name Type Description
startHeight specifies the start height to check for unprocessed blocks
endHeight specifies the end height to check for unprocessed blocks
Source:

(async) _initOneTime()

Performs one time initialization prior to executing wallet methods.
Source:
Returns:
Promise is a singleton promise that resolves after initializing

_processBlock()

Processes a single block.
Source:

(async) _processBlocksChunk(daemon, startHeight, endHeight, onProgress())

Processes a chunk of unprocessed blocks.
Parameters:
Name Type Description
daemon is the daemon to query blocks as binary requests
startHeight specifies the start height to process unprocessed blocks within
endHeight specifies the end height to process unprocessed blocks within
onProgress() is called as progress is made
Source: