# openDelivery

> **openDelivery**(`privateKey`, `bytes`, `options?`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<\{ `chain`: [`ClaimChain`](/reference/filoz/keysmith/interfaces/claimchain/); `claim`: [`VerifiedClaim`](/reference/filoz/keysmith/interfaces/verifiedclaim/); `grant`: [`Grant`](/reference/filoz/keysmith/interfaces/grant/); `key`: [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array); \}\>

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

Open a delivery as its final bearer: verify the chain, unwrap the key, and
check it against the commitment in its claim, which the owner (or the
delegate above) signed. The keyspace commitment comes back too, for a bearer
that writes the keyspace's first datasets.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `privateKey` | `` `0x${string}` `` |
| `bytes` | [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) |
| `options` | \{ `now?`: `number`; `piece?`: [`PieceLabels`](/reference/filoz/keysmith/interfaces/piecelabels/); \} |
| `options.now?` | `number` |
| `options.piece?` | [`PieceLabels`](/reference/filoz/keysmith/interfaces/piecelabels/) |

## Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<\{ `chain`: [`ClaimChain`](/reference/filoz/keysmith/interfaces/claimchain/); `claim`: [`VerifiedClaim`](/reference/filoz/keysmith/interfaces/verifiedclaim/); `grant`: [`Grant`](/reference/filoz/keysmith/interfaces/grant/); `key`: [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array); \}\>

## Throws

With the reason the delivery is refused.