Skip to content
docs

nextSealedIndex

nextSealedIndex(options): Promise<{ address: string; index: number; }>

Defined in: scan.ts:177

The first index, from from, whose address is sealed: unused on the chain (isUsed) and absent from the ledger. The place a protected account sweeps to.

isUsed answers true, false, or undefined when it could not tell (the RPC is down). An address is taken only on a plain false: on undefined the search stops with SealedIndexError cannot-tell, because skipping the index would leave a gap and taking it could sweep to an address the chain already knows. An error isUsed throws is passed on as it is.

(index) => string | Promise<string>

string

number

(address) => boolean | Promise<boolean | undefined> | undefined

Has the chain ever seen this address (a nonce, a spent or unspent output, any history)? undefined: could not tell.

ExposureLedger

number

How many indexes to try before giving up. Default 100.

Promise<{ address: string; index: number; }>

SealedIndexError cannot-tell, none-found or unsealable.