# decodeGrant

> **decodeGrant**(`bytes`): [`DecodedGrant`](/reference/filoz/keysmith/type-aliases/decodedgrant/)

Defined in: [wrap.ts:196](https://github.com/FilOzone/synapse-sdk/blob/840d7b2c6263846ac51b7558000e62dd68d33a44/packages/keysmith/src/wrap.ts#L196)

Read a grant delivered as bytes, without opening it: to see what it names
before unwrapping, or to pass to [holdingOf](/reference/filoz/keysmith/functions/holdingof/).

## Parameters

| Parameter | Type |
| ------ | ------ |
| `bytes` | [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) |

## Returns

[`DecodedGrant`](/reference/filoz/keysmith/type-aliases/decodedgrant/)

## Throws

If the bytes are not one canonical CBOR map holding a version 2
grant, with every field the right type and size and no unknown numbered field.