https://github.com/diodechain/candid
Elixir library for encoding and decoding candid. The binary encoding format for the Internet Computer (ICP).
https://github.com/diodechain/candid
Last synced: 2 months ago
JSON representation
Elixir library for encoding and decoding candid. The binary encoding format for the Internet Computer (ICP).
- Host: GitHub
- URL: https://github.com/diodechain/candid
- Owner: diodechain
- License: apache-2.0
- Created: 2024-10-16T18:08:23.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2025-01-22T13:37:45.000Z (5 months ago)
- Last Synced: 2025-04-10T23:04:56.495Z (2 months ago)
- Language: Elixir
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-internet-computer - candid - Elixir library for encoding/decoding Candid. (Candid / Candid implementations)
README
# Candid
Candid is a binary encoding format for the Internet Computer (ICP).
This library allows to encode and decode Candid messages.
## Installation
This package can be installed
by adding `candid` to your list of dependencies in `mix.exs`:```elixir
def deps do
[
{:candid, "~> 1.0.0"}
]
end
```## Usage
```elixir
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()
```## Completion
This library is currently in the early stages of development and does not yet support all Candid formats (only those we need for our use cases at the moment). PRs and contributions to extend this library are welcome though!
## Documentation
The documentation for this library can be found at [https://hexdocs.pm/candid](https://hexdocs.pm/candid).