# 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/d80afb89df823a5628b86ab0edae21dc95850f82/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.