Skip to main content

What it does

This helper encodes an encrypted sensitive field and the 32-byte user authorization hash into a Solana registry instruction.

How the flow works

1

Caller invokes the function

The caller supplies the owner, registry, field type, encrypted bytes, and authorization hash.
2

Validation

The SDK rejects userAuthorizationHash unless it is exactly 32 bytes.
3

Main work

It serializes the field with instruction tag 10 and binds the hash to the instruction payload.
4

Result

The caller receives one owner-signed TransactionInstruction.

Signature

Uint8Array
required
Exactly 32 bytes identifying the user authorization.
string
required
Sensitive field type.
Uint8Array
required
Encryption nonce.
Uint8Array
required
Encrypted field value.
string
Metadata JSON; defaults to {}.

Result and errors

Throws userAuthorizationHash must be 32 bytes for an invalid hash length. Returns one Solana instruction otherwise.
Source: tins.ts:934-960