Module BSV::Wallet::Wire::Serializer ¶
Serialises and deserialises all 28 BRC-100 wire protocol method calls.
Frame layout: Request: [UInt8 call_code] [UInt8 originator_length] [UTF-8 originator] [params…] Response: [UInt8 error_code] [result…] Error: [UInt8 error_code ≠ 0] [VarInt msg_len] [UTF-8 message] [VarInt stack_len] [UTF-8 stack]
For every method: serialize_request(method_name, args, originator:) → binary String deserialize_request(data) → [method_name, args, originator] serialize_response(method_name, result) → binary String (error_code=0 prefix) deserialize_response(method_name, data) → result Hash (raises on error_code≠0) serialize_error(code, message, stack_trace:) → binary String
Constants¶
CALL_CODES ¶
Maps method name symbols to their wire call codes (1-28).
LIST_ACTIONS_INCLUDE_FLAGS ¶
1. listActions¶
METHODS_BY_CODE ¶
Inverse mapping: call code Integer → method name Symbol.
Public Class Methods¶
decode_base64_32(b64_str) ¶
- @raise [ArgumentError]
decode_base64_32_safe(str) ¶
Not documented.
deserialize_request(data) ¶
Deserialises a binary request frame. - @param data [String] binary frame - @return [Array(Symbol, Hash, String)] [method_name, args, originator]
deserialize_response(method_name, data) ¶
Deserialises a response frame, raising a WalletError on non-zero error code. - @param method_name [Symbol] - @param data [String] binary frame - @return [Hash] result
encode_base64(raw_bytes) ¶
Not documented.
read_abort_action_params(r) ¶
Not documented.
read_abort_action_result(_r) ¶
Not documented.
read_acquire_certificate_params(r) ¶
Not documented.
read_acquire_certificate_result(r) ¶
Not documented.
read_cert_from_reader(r) ¶
Reads a certificate struct from the reader (without length prefix).
read_create_action_params(r) ¶
Not documented.
read_create_action_result(r) ¶
Not documented.
read_create_hmac_params(r) ¶
Not documented.
read_create_hmac_result(r) ¶
Not documented.
read_create_signature_params(r) ¶
Not documented.
read_create_signature_result(r) ¶
Not documented.
read_decrypt_params(r) ¶
Not documented.
read_decrypt_result(r) ¶
Not documented.
read_discover_by_attributes_params(r) ¶
Not documented.
read_discover_by_attributes_result(r) ¶
Not documented.
read_discover_by_identity_key_params(r) ¶
Not documented.
read_discover_by_identity_key_result(r) ¶
Not documented.
read_discovery_result(r) ¶
Not documented.
read_encrypt_params(r) ¶
Not documented.
read_encrypt_result(r) ¶
Not documented.
read_get_header_for_height_params(r) ¶
Not documented.
read_get_header_for_height_result(r) ¶
Not documented.
read_get_height_params(_r) ¶
Not documented.
read_get_height_result(r) ¶
Not documented.
read_get_network_params(_r) ¶
Not documented.
read_get_network_result(r) ¶
Not documented.
read_get_public_key_params(r) ¶
Not documented.
read_get_public_key_result(r) ¶
Not documented.
read_get_version_params(_r) ¶
Not documented.
read_get_version_result(r) ¶
Not documented.
read_internalize_action_params(r) ¶
Not documented.
read_internalize_action_result(_r) ¶
Not documented.
read_is_authenticated_params(_r) ¶
Not documented.
read_is_authenticated_result(r) ¶
Not documented.
read_key_related_from_reader(r) ¶
Reads key-related params: protocolID, keyID, counterparty, privileged, privilegedReason.
read_list_actions_params(r) ¶
Not documented.
read_list_actions_result(r) ¶
Not documented.
read_list_certificates_params(r) ¶
Not documented.
read_list_certificates_result(r) ¶
Not documented.
read_list_outputs_params(r) ¶
Not documented.
read_list_outputs_result(r) ¶
Not documented.
read_outpoint_str(r) ¶
Not documented.
read_prove_certificate_params(r) ¶
Not documented.
read_prove_certificate_result(r) ¶
Not documented.
read_relinquish_certificate_params(r) ¶
Not documented.
read_relinquish_certificate_result(_r) ¶
Not documented.
read_relinquish_output_params(r) ¶
Not documented.
read_relinquish_output_result(_r) ¶
Not documented.
read_reveal_counterparty_key_linkage_params(r) ¶
Not documented.
read_reveal_counterparty_key_linkage_result(r) ¶
Not documented.
read_reveal_specific_key_linkage_params(r) ¶
Not documented.
read_reveal_specific_key_linkage_result(r) ¶
Not documented.
read_sign_action_params(r) ¶
Not documented.
read_sign_action_result(r) ¶
Not documented.
read_verify_hmac_params(r) ¶
Not documented.
read_verify_hmac_result(_r) ¶
Not documented.
read_verify_signature_params(r) ¶
Not documented.
read_verify_signature_result(_r) ¶
Not documented.
read_wait_for_authentication_params(_r) ¶
Not documented.
read_wait_for_authentication_result(_r) ¶
Not documented.
serialize_error(code, message, stack_trace: = nil) ¶
Serialises an error response. - @param code [Integer] non-zero error code - @param message [String] - @param stack_trace [String, nil] - @return [String] binary frame
serialize_request(method_name, args, originator: = nil) ¶
Serialises a method call request into a binary frame. - @param method_name [Symbol] - @param args [Hash] - @param originator [String, nil] FQDN of the calling application - @return [String] binary frame (ASCII-8BIT)
serialize_response(method_name, result) ¶
Serialises a successful response. - @param method_name [Symbol] - @param result [Hash] - @return [String] binary frame
write_abort_action_params(w, args) ¶
1. abortAction — reference is the entire params payload (no length prefix)¶
write_abort_action_result(w, _result) ¶
Not documented.
write_acquire_certificate_params(w, args) ¶
1. acquireCertificate¶
write_acquire_certificate_result(w, result) ¶
Not documented.
write_certificate_fields(w, cert) ¶
Writes a certificate struct to the writer (without length prefix).
write_create_action_params(w, args) ¶
1. createAction¶
write_create_action_result(w, result) ¶
Not documented.
write_create_hmac_params(w, args) ¶
1. createHmac¶
write_create_hmac_result(w, result) ¶
Not documented.
write_create_signature_params(w, args) ¶
1. createSignature¶
write_create_signature_result(w, result) ¶
Not documented.
write_decrypt_params(w, args) ¶
1. decrypt¶
write_decrypt_result(w, result) ¶
Not documented.
write_discover_by_attributes_params(w, args) ¶
1. discoverByAttributes¶
write_discover_by_attributes_result(w, result) ¶
Not documented.
write_discover_by_identity_key_params(w, args) ¶
1. discoverByIdentityKey¶
write_discover_by_identity_key_result(w, result) ¶
Not documented.
write_discovery_result(w, result) ¶
Serialises a discovery certificate result (shared by discoverByIdentityKey/Attributes).
write_encrypt_params(w, args) ¶
1. encrypt¶
write_encrypt_result(w, result) ¶
Not documented.
write_get_header_for_height_params(w, args) ¶
1. getHeaderForHeight¶
write_get_header_for_height_result(w, result) ¶
Not documented.
write_get_height_params(w, _args) ¶
1. getHeight (no params)¶
write_get_height_result(w, result) ¶
Not documented.
write_get_network_params(w, _args) ¶
1. getNetwork (no params)¶
write_get_network_result(w, result) ¶
Not documented.
write_get_public_key_params(w, args) ¶
1. getPublicKey¶
write_get_public_key_result(w, result) ¶
Not documented.
write_get_version_params(w, _args) ¶
1. getVersion (no params)¶
write_get_version_result(w, result) ¶
Not documented.
write_internalize_action_params(w, args) ¶
1. internalizeAction¶
write_internalize_action_result(w, _result) ¶
Not documented.
write_is_authenticated_params(w, _args) ¶
1. isAuthenticated (no params)¶
write_is_authenticated_result(w, result) ¶
Not documented.
write_key_related_params(w, args) ¶
--- key-related params (shared by encrypt/decrypt/hmac/signature/revealSpecific) ---
write_list_actions_params(w, args) ¶
Not documented.
write_list_actions_result(w, result) ¶
Not documented.
write_list_certificates_params(w, args) ¶
1. listCertificates¶
write_list_certificates_result(w, result) ¶
Not documented.
write_list_outputs_params(w, args) ¶
1. listOutputs¶
write_list_outputs_result(w, result) ¶
Not documented.
write_outpoint_str(w, outpoint_str) ¶
--- write_outpoint / read_outpoint helpers ---
write_prove_certificate_params(w, args) ¶
1. proveCertificate¶
write_prove_certificate_result(w, result) ¶
Not documented.
write_relinquish_certificate_params(w, args) ¶
1. relinquishCertificate¶
write_relinquish_certificate_result(w, _result) ¶
Not documented.
write_relinquish_output_params(w, args) ¶
1. relinquishOutput¶
write_relinquish_output_result(w, _result) ¶
Not documented.
write_reveal_counterparty_key_linkage_params(w, args) ¶
1. revealCounterpartyKeyLinkage¶
write_reveal_counterparty_key_linkage_result(w, result) ¶
Not documented.
write_reveal_specific_key_linkage_params(w, args) ¶
1. revealSpecificKeyLinkage¶
write_reveal_specific_key_linkage_result(w, result) ¶
Not documented.
write_sign_action_params(w, args) ¶
1. signAction¶
write_sign_action_result(w, result) ¶
Not documented.
write_verify_hmac_params(w, args) ¶
1. verifyHmac¶
write_verify_hmac_result(w, _result) ¶
Not documented.
write_verify_signature_params(w, args) ¶
1. verifySignature¶
write_verify_signature_result(w, _result) ¶
Not documented.
write_wait_for_authentication_params(w, _args) ¶
1. waitForAuthentication (no params)¶
write_wait_for_authentication_result(w, _result) ¶
Not documented.