Skip to content
docs

BunkerGateOptions

Defined in: judge.ts:132

Options for bunkerGate.

R extends BunkerRequest = BunkerRequest

optional isFullSweep?: (request) => boolean | Promise<boolean>

Defined in: judge.ts:71

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 every send is a partial-spend.

R

boolean | Promise<boolean>

BunkerJudgeOptions.isFullSweep


optional isSealedDestination?: (chain, address) => boolean | Promise<boolean>

Defined in: judge.ts:66

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 breaks unsealed-destination (refused in enforce, reported in warn). An app that only warns can leave it out.

string

string

boolean | Promise<boolean>

BunkerJudgeOptions.isSealedDestination


optional ledgerFailure?: "refuse" | "continue"

Defined in: judge.ts:144

When the ledger cannot be saved for a request the rules do not guard (an account that is not protected, or warn mode): refuse (default) signs nothing; continue tells BunkerGateOptions.onLedgerError and lets it go on. A protected account in enforce mode is always refused.


optional mode?: "enforce" | "warn"

Defined in: judge.ts:136

enforce (default) refuses. warn calls BunkerGateOptions.onWarning and lets the request go on.


optional now?: () => number

Defined in: judge.ts:148

Clock, for tests.

number


optional onLedgerError?: (error, request) => void | Promise<void>

Defined in: judge.ts:146

ledgerFailure: 'continue': told what the storage threw, before the request goes on.

unknown

R

void | Promise<void>


optional onWarning?: (rule, message, request) => void | Promise<void>

Defined in: judge.ts:138

warn mode: told what enforce would have refused.

BunkerRule

string

R

void | Promise<void>


protect: (request) => boolean | Promise<boolean>

Defined in: judge.ts:134

Is the account behind this request in the bunker? The app decides who is (by balance, by user choice).

R

boolean | Promise<boolean>