What it does
decodeTinAccount is a pure SDK decoder for the serialized TIN account layout.
It reads the numeric TIN, display name, owner commitment, encrypted seed,
metadata, route envelope, and optional TCap relationship commitments from the
provided account bytes. It does not call Solana or change state.
How the flow works
1
Caller invokes the function
The caller passes the raw account data returned by a Solana RPC request as
a
Uint8Array.2
Validation
The decoder reads each length-prefixed field in the account layout. Invalid
or truncated bytes can cause a buffer read error.
3
Main work
It decodes the TIN and display name, copies encrypted byte fields, reads
the route version and nonce, and reads TCap fields when those bytes exist.
4
Result
It returns a plain object containing decoded values as
bigint, strings,
buffers, nullable fields, and route commitments. No RPC call is made.