live · mainnetoc · docs
specs · api · guides
docs / documentation

@orangecheck/pledge-core


@orangecheck/pledge-core / verifyBond

Function: verifyBond()

function verifyBond(input: VerifyBondInput): Promise<VerifyBondResult>;

Defined in: pledge-core/src/bond.ts:31

Run §8 verifyBond against a caller-supplied attestation lookup.

Returns: { ok: true, sats_bonded, days_unspent } when the bond clears all gates.

{ ok: false, code, message } with one of:

  • E_BOND_NOT_FOUND attestation lookup returned null
  • E_BOND_ADDRESS_MISMATCH attestation.address != pledge.swearer
  • E_BOND_SPENT utxo spent at or before now
  • E_BOND_INSUFFICIENT_SATS sats_bonded < pledge.bond.min_sats
  • E_BOND_INSUFFICIENT_DAYS days_unspent < pledge.bond.min_days

Note that bond verification is a live check — the result depends on chain state at now, not at the moment the pledge was sworn. SPEC §8 mandates this for any consequential decision.

Parameters

ParameterType
inputVerifyBondInput

Returns

Promise&lt;VerifyBondResult>