View Source Candid (Candid v1.0.1)
Candid is a binary encoding format for the Internet Computer (ICP). https://github.com/dfinity/candid/blob/master/spec/Candid.md
This module encodes and decodes the format allowing to encode requests to the ICP network and decode responses.
type_spec = [{:vec, {:record, [{0, :blob}, {1, :blob}]}}]
messages = [
{"key1", "hello world"},
{"key2," "hello candid"}
]
^messages = Candid.encode_parameters(type_spec, messages)
|> Candid.decode_parameters()
Summary
Functions
Encodes a list of types and values into a Candid binary parameter string.
Functions
Encodes a list of types and values into a Candid binary parameter string.
Example:
Candid.encode_parameters([:int, :blob], [15, "hello world"])