Skip to content
docs

BunkerGate

Defined in: judge.ts:152

The two steps every signature takes past Bunker mode: the rules, then the ledger.

R extends BunkerRequest = BunkerRequest

admit(request): Promise<void>

Defined in: judge.ts:163

BunkerGate.check, then BunkerGate.record: everything to do right before a key signs.

R

Promise<void>


check(request): Promise<boolean>

Defined in: judge.ts:156

The rules: throws BunkerViolationError (enforce) or tells onWarning (warn). Resolves to whether the account is protected.

R

Promise<boolean>


judge(request): Promise<{ guarded: boolean; refusal: BunkerRefusal | undefined; }>

Defined in: judge.ts:154

Is the account protected, and which rule would enforce refuse the request with? Decides only: nothing is thrown for a rule, nothing recorded.

R

Promise<{ guarded: boolean; refusal: BunkerRefusal | undefined; }>


record(request, guarded, reason?): Promise<void>

Defined in: judge.ts:161

Write-ahead: record the exposure, with the ledgerFailure rules. Call it after BunkerGate.check and right before the key signs. reason defaults to exposureReasonOf of the request’s kind.

R

boolean

ExposureReason

Promise<void>