Skip to content

openDelivery

openDelivery(privateKey, bytes, options?): Promise<{ chain: ClaimChain; claim: VerifiedClaim; expired: boolean; grant: Grant; key: Uint8Array; }>

Defined in: claims.ts:649

Open a delivery as its final bearer: verify the chain, unwrap the key, and check it against the commitment in its claim, which the owner (or the delegate above) signed. The group key commitment comes back too, for a bearer that writes the group key’s first datasets.

An expired delivery still opens: a key cannot expire, so decrypting with it keeps working. expired says the claim is spent, and signRequest and delegateClaim refuse it; get a new grant before fetching from a gating provider or sharing onward.

Parameter Type
privateKey `0x${string}`
bytes Uint8Array
options? { now?: number; piece?: PieceLabels; }
options.now? number
options.piece? PieceLabels

Promise<{ chain: ClaimChain; claim: VerifiedClaim; expired: boolean; grant: Grant; key: Uint8Array; }>

With the reason the delivery is refused.