{"id":24380612,"url":"https://github.com/diodechain/icp_agent","last_synced_at":"2026-03-04T09:31:18.240Z","repository":{"id":272640753,"uuid":"917260789","full_name":"diodechain/icp_agent","owner":"diodechain","description":"Elixir ICP agent for interacting with the internet computer","archived":false,"fork":false,"pushed_at":"2025-09-05T16:25:33.000Z","size":43,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-23T13:05:26.895Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/diodechain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-15T16:52:46.000Z","updated_at":"2025-09-05T16:25:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"81f97266-11bd-4980-bd3b-798eb7a514c4","html_url":"https://github.com/diodechain/icp_agent","commit_stats":null,"previous_names":["diodechain/icp_agent"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/diodechain/icp_agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diodechain%2Ficp_agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diodechain%2Ficp_agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diodechain%2Ficp_agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diodechain%2Ficp_agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diodechain","download_url":"https://codeload.github.com/diodechain/icp_agent/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diodechain%2Ficp_agent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30077068,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T08:01:56.766Z","status":"ssl_error","status_checked_at":"2026-03-04T08:00:42.919Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-19T08:27:33.202Z","updated_at":"2026-03-04T09:31:18.224Z","avatar_url":"https://github.com/diodechain.png","language":"Elixir","funding_links":[],"categories":["Client Libraries (Agents)"],"sub_categories":["Elixir"],"readme":"# Elixir ICP Agent for the Internet Computer\n\nThe ICP Agent library supports both queries and calls to the Internet Computer. All authentication is done using Secp256k1 keys handled by the `DiodeClient.Wallet` struct.\n\n## Query example\n\nThis examples uses the `get_latest_sns_version_pretty` method from the SNS-wasm system canister. It's a publicly available method, so no authentication is needed. We're generating a new wallet ad-hoc and using it to query the \ncanister.\n\n```elixir\n\u003e [versions] = ICPAgent.query(\"qaa6y-5yaaa-aaaaa-aaafa-cai\", DiodeClient.Wallet.new(), \"get_latest_sns_version_pretty\")\n[\n  [\n    {\"Ledger Index\",\n     \"2adc74fe5667f26ea4c4006309d99b1dfa71787aa43a5c168cb08ec725677996\"},\n    {\"Governance\",\n     \"bd936ef6bb878df87856a0b0c46034a242a88b7f1eeff5439daf6278febca6b7\"},\n    {\"Ledger Archive\",\n     \"f94cf1db965b7042197e5894fef54f5f413bb2ebc607ff0fb59c9d4dfd3babea\"},\n    {\"Swap\", \"8313ac22d2ef0a0c1290a85b47f235cfa24ca2c96d095b8dbed5502483b9cd18\"},\n    {\"Root\", \"431cb333feb3f762f742b0dea58745633a2a2ca41075e9933183d850b4ddb259\"},\n    {\"Ledger\",\n     \"25071c2c55ad4571293e00d8e277f442aec7aed88109743ac52df3125209ff45\"}\n  ]\n]\n```\n\n## Call example\n\nCalls and queries both support providing arguments and types in Candid format specification. These are some examples of call structures to give a better understanding of how the types are specified.\n\n\n```elixir\n# Generating a new private key as identity\n\u003e wallet = DiodeClient.Wallet.new()\n\n# Call with passing two blobs as an argument\n\u003e [200] = ICPAgent.call(canister_id, wallet, \"test_blob_input\", [:blob, :blob], [\"blob_a\", \"blob_b\"])\n\n# Call with passing a record as an argument\n\u003e [3] = ICPAgent.call(canister_id, wallet, \"test_record_input\", [{:record, {:nat32, :nat32}}], [{1, 2}])\n\n# Call with passing a record with named fields as an argument\n\u003e [3] = ICPAgent.call(canister_id, wallet, \"test_named_record_input\", [{:record, %{a: :nat32, b: :nat32}}], [{a: 1, b: 2}])\n\n# Call with passing a vector of records as an argument\n\u003e [200] = ICPAgent.call(canister_id, wallet, \"test_vec_input\", [{:vec, {:record, {:blob, :blob}}}], [[{\"blob_a\", \"blob_b\"}]])\n```\n\n## Limits\n\n- Only secp256k1 keys are supported.\n- Did files are not supported and instead types for a call/query must be manually specified.\n\n## Installation\n\nIf [available in Hex](https://hex.pm/docs/publish), the package can be installed\nby adding `icp_agent` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:icp_agent, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\nDocumentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)\nand published on [HexDocs](https://hexdocs.pm). Once published, the docs can\nbe found at \u003chttps://hexdocs.pm/icp_agent\u003e.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiodechain%2Ficp_agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiodechain%2Ficp_agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiodechain%2Ficp_agent/lists"}