Skip to content

pickGrant

pickGrant<T>(grants, target, options): T | undefined

Defined in: claims.ts:361

The narrowest held grant that reaches target: a piece grant before a scope grant, a deeper scope before a shallower one, the keyspace last; on a tie, the one that expires last. Grants for another network or keyspace, or expired ones, are skipped. Undefined when none reaches it: ask for a grant to that scope or piece.

Takes anything carrying a verified claim, such as what openDelivery returns.

Type Parameter
T extends object
Parameter Type
grants readonly T[]
target GrantTarget
options { chainId: bigint; now?: number; }
options.chainId bigint
options.now? number

T | undefined