# decodeGrant

> **decodeGrant**(`bytes`): [`Grant`](/reference/filoz/keysmith/interfaces/grant/) & [`Record`](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type)\<`string`, `unknown`\>

Defined in: [wrap.ts:188](https://github.com/FilOzone/synapse-sdk/blob/68e30a2a5457180e60a5579eb5ecff90b65894b3/packages/keysmith/src/wrap.ts#L188)

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

[`Grant`](/reference/filoz/keysmith/interfaces/grant/) & [`Record`](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type)\<`string`, `unknown`\>

## Throws

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