Docs/SDK
For bidders
Seal, reveal and claim from code.
#Place a sealed bid
ts
const { secret } = await proven.bid(auction, {
maxPrice: 5n * 10n ** 12n,
quantity: 50_000n * 10n ** 18n,
});The call hashes the bid, timelock-encrypts it and submits it with a bucketed deposit. Store the returned secret. It proves the bid is yours.
#Reveal and claim
After the round:
ts
await proven.revealAll(auction);
await proven.claimAll(auction);revealAll decrypts every bid whose drand round has passed and reveals them in batches. claimAll pushes tokens and refunds to bidders.
#Bid privately
ts
await priv.bidPrivately(auction, { maxPrice, quantity });
await priv.finishPrivateBids(auction);A bid paid from the private balance, with the tokens and refund returning to it after settlement.
#Claim privately
ts
await priv.claimPrivately(wallet, auction, bidId);Claims a won bid to the wallet and shields it, so what you do with the tokens cannot be linked to the bid.
#Timelock primitives
Lower-level helpers are exported: sealBid, unsealBid and drandRoundAt.