@orangecheck/pledge-core / verifyBond
Function: verifyBond()
function verifyBond(input: VerifyBondInput): Promise<VerifyBondResult>;
Defined in: pledge-core/src/bond.ts:34
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
The lookup receives pledge.bond.min_sats and must return the age of the
coins that cover it (SPEC §8), not the age of the oldest coin.
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
| Parameter | Type |
|---|---|
input | VerifyBondInput |
Returns
Promise<VerifyBondResult>