Skip to content

wrapTo

wrapTo(recipientPublicKey, key, input): Promise<Grant>

Defined in: wrap.ts:90

Wrap a node key — a group key, a group’s key, or one piece’s key — to a recipient.

The descriptor is authenticated, so a grant cannot be relabelled as one naming a different group key, group or piece. The result is inert without the recipient’s private key, so it can be delivered or stored anywhere.

The grant carries the descriptor in canonical form, whoever built it, and nothing else: add informational fields to the returned grant if needed.

Parameter Type
recipientPublicKey `0x${string}`
key Uint8Array
input GrantDescriptor

Promise<Grant>