View Source Candid (Candid v1.0.5)

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

Link to this function

decode_parameters(arg, passed_argument_types \\ nil)

View Source
Link to this function

encode_parameters(types, values)

View Source

Encodes a list of types and values into a Candid binary parameter string.

Example:

Candid.encode_parameters([:int, :blob], [15, "hello world"])