BunkerOptions
Defined in: policies.ts:6
Options for bunkerPolicies.
Properties
Section titled “Properties”inner?
Section titled “inner?”
optionalinner?:Policies
Defined in: policies.ts:38
The app’s own policies. Their lists and fee caps apply unchanged; their confirm runs after the bunker rules.
isFullSweep?
Section titled “isFullSweep?”
optionalisFullSweep?: (intent) =>boolean|Promise<boolean>
Defined in: policies.ts:22
Does this send move the whole balance of its asset? A partial send exposes the key and leaves
the rest behind it. Without this check, enforce mode refuses every send of a protected account.
Parameters
Section titled “Parameters”intent
Section titled “intent”WriteIntent
Returns
Section titled “Returns”boolean | Promise<boolean>
isSealedDestination?
Section titled “isSealedDestination?”
optionalisSealedDestination?: (chain,address) =>boolean|Promise<boolean>
Defined in: policies.ts:17
Is address a sealed address of this wallet: derived from the same seed, never used on-chain
and absent from the ledger? Use nextSealedIndex to pick one, or a vault address.
Without it no address counts as sealed: every send of a protected account is an
unsealed-destination, refused in enforce mode and reported in warn mode. An app that runs
warn only can leave it out.
Parameters
Section titled “Parameters”string
address
Section titled “address”string
Returns
Section titled “Returns”boolean | Promise<boolean>
ledgerFailure?
Section titled “ledgerFailure?”
optionalledgerFailure?:"refuse"|"continue"
Defined in: policies.ts:34
When the ledger cannot be saved for a write this package does not guard (an account that is not protected, or
warn mode): refuse (default) signs nothing; continue tells BunkerOptions.onLedgerError and lets the
write go on. The exposure then stays known in memory until the app restarts, and the chain scan finds a
transaction later; an off-chain signature is lost to the ledger. A protected account in enforce mode is always
refused.
optionalmode?:"enforce"|"warn"
Defined in: policies.ts:24
enforce (default) refuses. warn calls BunkerOptions.onWarning and lets inner.confirm decide.
optionalnow?: () =>number
Defined in: policies.ts:40
Clock, for tests.
Returns
Section titled “Returns”number
onLedgerError?
Section titled “onLedgerError?”
optionalonLedgerError?: (error,intent) =>void|Promise<void>
Defined in: policies.ts:36
ledgerFailure: 'continue': told what the storage threw, before the write goes on.
Parameters
Section titled “Parameters”unknown
intent
Section titled “intent”WriteIntent
Returns
Section titled “Returns”void | Promise<void>
onWarning?
Section titled “onWarning?”
optionalonWarning?: (rule,message,intent) =>void|Promise<void>
Defined in: policies.ts:26
warn mode: told what enforce would have refused, before inner.confirm runs.
Parameters
Section titled “Parameters”message
Section titled “message”string
intent
Section titled “intent”WriteIntent
Returns
Section titled “Returns”void | Promise<void>
protect
Section titled “protect”protect: (
intent) =>boolean|Promise<boolean>
Defined in: policies.ts:8
Is the writing account in the bunker? The app decides who is (by balance, by user choice).
Parameters
Section titled “Parameters”intent
Section titled “intent”WriteIntent
Returns
Section titled “Returns”boolean | Promise<boolean>