# pickGrant

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

Defined in: [claims.ts:361](https://github.com/FilOzone/synapse-sdk/blob/5989c4b03ed2fe4cf8b1ef29efe1d4ff1ad4c7bc/packages/keysmith/src/claims.ts#L361)

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 Parameters

| Type Parameter |
| ------ |
| <a id="type-parameter-t"></a> `T` *extends* `object` |

## Parameters

| Parameter | Type |
| ------ | ------ |
| `grants` | readonly `T`[] |
| `target` | [`GrantTarget`](/reference/filoz/keysmith/type-aliases/granttarget/) |
| `options` | \{ `chainId`: `bigint`; `now?`: `number`; \} |
| `options.chainId` | `bigint` |
| `options.now?` | `number` |

## Returns

`T` \| `undefined`