Private
constructorPrivate
_contentPrivate
_signaturePrivate
_signerThis POD's data as a PODContent object.
The content ID (root hash) of this POD. PODs containing the same data (names and values, regardless of type) will have the same content ID.
The signature of this POD, in a packed string form. This is an EdDSA-Poseidon signature, with the POD's content ID as the signed message. The signature is made up of 64 bytes, represented in URL-safe Base64.
The public key of the signer, in a packed string form. This is an EdDSA-Poseidon public key made up of 32 bytes, represnted in URL-safe Base64.
Static
deserializeStatic
fromJSONRebuilds a POD object from the JSON-compatible format produced by
toJSON. The input can be taken directly from JSON.parse
and
will be fully validated by this function.
the JSON-encoded POD.
a new POD object
TypeError if the input is malformed
RangeError if a value is outside of the bounds
Static
loadFactory to create a new POD using saved data signed previously. Derived values such as Merkle tree hashes will be calculated lazily as-needed.
Note that this method does not verify the signature. To check the
validity of your POD, call verifySignature()
separately.
saved entries
saved signature
saved public key of signer
a new POD
if any arguments are malformed, or any of the entries aren't legal for inclusion in a POD
Static
signFactory to create a new POD by signing with the given private key. Since signing requires the content ID, this method of creation will immediately calculate the Merkle tree.
the contents of the new POD. These will be Merklized in order by name, regardless of the order of the input.
the EdDSA private key of the signer, required to be 32 bytes, encoded as per decodePrivateKey.
if any of the entries aren't legal for inclusion in a POD
Generated using TypeDoc
Class encapsulating a signed POD with functions for common use cases. POD instances are immutable (within the limits of TypeScript), but derived data (such as the Merkle tree of entries) is calculated lazily as it is needed.
A POD is made up of
PODEntries
, built into a Merkle tree (in sorted order) to produce a root hash called the Content ID, which is then signed. To create a POD, use one of the static factory methods of this class.Most features depending on the POD entries but not the signature are provided by a PODContent instance available via
pod.content
.