# encodeGrant

> **encodeGrant**\<`G`\>(`grant`): [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)

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

Pack the grant to deliver or store it

```text
{ 0: v, 1: node, 2: owner (20 bytes), 3: keyspace (16 bytes),
  4: epk (65 bytes), 5: iv (12 bytes), 6: ct (48 bytes), * text: informational }
```

Fields with text keys carry anything informational added to the grant, such as
a piece's CID. These informational keys are not authenticated.

## Type Parameters

| Type Parameter |
| ------ |
| `G` *extends* [`Grant`](/reference/filoz/keysmith/interfaces/grant/) |

## Parameters

| Parameter | Type |
| ------ | ------ |
| `grant` | `G` |

## Returns

[`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)