Skip to content

Module dev_codec_ans104.erl

Codec for managing transformations from ar_bundles-style Arweave TX records to and from TABMs.

Function Index

commit/3Sign a message using the priv_wallet key in the options.
content_type/1Return the content type for the codec.
deduplicating_from_list/2*Deduplicate a list of key-value pairs by key, generating a list of values for each normalized key if there are duplicates.
deserialize/3Deserialize a binary ans104 message to a TABM.
do_from/3*
encoded_tags_to_map/1*Convert an ANS-104 encoded tag list into a HyperBEAM-compatible map.
from/3Convert a #tx record into a message map recursively.
from_maintains_tag_name_case_test/0*
normal_tags/1*Check whether a list of key-value pairs contains only normalized keys.
normal_tags_test/0*
only_committed_maintains_target_test/0*
restore_tag_name_case_from_cache_test/0*
serialize/3Serialize a message or TX to a binary.
signed_duplicated_tag_name_test/0*
simple_signed_to_httpsig_test_disabled/0*
simple_to_conversion_test/0*
tag_map_to_encoded_tags/1*Convert a HyperBEAM-compatible map into an ANS-104 encoded tag list, recreating the original order of the tags.
to/3Internal helper to translate a message to its #tx record representation, which can then be used by ar_bundles to serialize the message.
type_tag_test/0*
unsigned_duplicated_tag_name_test/0*
verify/3Verify an ANS-104 commitment.

Function Details

commit/3

commit(Msg, Req, Opts) -> any()

Sign a message using the priv_wallet key in the options. Supports both the hmac-sha256 and rsa-pss-sha256 algorithms, offering unsigned and signed commitments.

content_type/1

content_type(X1) -> any()

Return the content type for the codec.

deduplicating_from_list/2 *

deduplicating_from_list(Tags, Opts) -> any()

Deduplicate a list of key-value pairs by key, generating a list of values for each normalized key if there are duplicates.

deserialize/3

deserialize(Binary, Req, Opts) -> any()

Deserialize a binary ans104 message to a TABM.

do_from/3 *

do_from(RawTX, Req, Opts) -> any()

encoded_tags_to_map/1 *

encoded_tags_to_map(Tags) -> any()

Convert an ANS-104 encoded tag list into a HyperBEAM-compatible map.

from/3

from(Binary, Req, Opts) -> any()

Convert a #tx record into a message map recursively.

from_maintains_tag_name_case_test/0 *

from_maintains_tag_name_case_test() -> any()

normal_tags/1 *

normal_tags(Tags) -> any()

Check whether a list of key-value pairs contains only normalized keys.

normal_tags_test/0 *

normal_tags_test() -> any()

only_committed_maintains_target_test/0 *

only_committed_maintains_target_test() -> any()

restore_tag_name_case_from_cache_test/0 *

restore_tag_name_case_from_cache_test() -> any()

serialize/3

serialize(Msg, Req, Opts) -> any()

Serialize a message or TX to a binary.

signed_duplicated_tag_name_test/0 *

signed_duplicated_tag_name_test() -> any()

simple_signed_to_httpsig_test_disabled/0 *

simple_signed_to_httpsig_test_disabled() -> any()

simple_to_conversion_test/0 *

simple_to_conversion_test() -> any()

tag_map_to_encoded_tags/1 *

tag_map_to_encoded_tags(TagMap) -> any()

Convert a HyperBEAM-compatible map into an ANS-104 encoded tag list, recreating the original order of the tags.

to/3

to(Binary, Req, Opts) -> any()

Internal helper to translate a message to its #tx record representation, which can then be used by ar_bundles to serialize the message. We call the message's device in order to get the keys that we will be checkpointing. We do this recursively to handle nested messages. The base case is that we hit a binary, which we return as is.

type_tag_test/0 *

type_tag_test() -> any()

unsigned_duplicated_tag_name_test/0 *

unsigned_duplicated_tag_name_test() -> any()

verify/3

verify(Msg, Req, Opts) -> any()

Verify an ANS-104 commitment.