@ohos-ports/azle 0.33.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (629) hide show
  1. package/.scripts/add_metadata_to_dfx_json.js +54 -0
  2. package/.scripts/cargo_expand.sh +17 -0
  3. package/.scripts/class_migration/add_example_dependency.js +54 -0
  4. package/.scripts/class_migration/change_to_custom_candid_gen.js +76 -0
  5. package/.scripts/class_migration/clean_package.js +27 -0
  6. package/.scripts/class_migration/copy_generated_candid_from_example.js +90 -0
  7. package/.scripts/class_migration/delete_tests_file.js +22 -0
  8. package/.scripts/class_migration/do_all_packages.js +61 -0
  9. package/.scripts/class_migration/modify_pretest.js +57 -0
  10. package/.scripts/class_migration/name_package.js +62 -0
  11. package/.scripts/class_migration/update_test.js +38 -0
  12. package/.scripts/class_migration/update_ts_config.js +48 -0
  13. package/.scripts/class_migration/update_typescript.js +99 -0
  14. package/.scripts/clean_all_projects.ts +91 -0
  15. package/.scripts/delete_git_branches.sh +20 -0
  16. package/.scripts/dev_dependencies/add_dev_dependencies.js +53 -0
  17. package/.scripts/dev_dependencies/remove_dev_dependencies.js +44 -0
  18. package/.scripts/examples-survey.json +5651 -0
  19. package/.scripts/file_generator/bin.js +4 -0
  20. package/.scripts/file_generator/index.ts +59 -0
  21. package/.scripts/file_generator/main.ts +55 -0
  22. package/.scripts/find_multiline_files.ts +101 -0
  23. package/.scripts/hash_file.ts +9 -0
  24. package/.scripts/hash_file_by_parts/bin.js +4 -0
  25. package/.scripts/hash_file_by_parts/index.ts +48 -0
  26. package/.scripts/hash_file_by_parts/main.ts +10 -0
  27. package/.scripts/jest_isolate_modules.js +29 -0
  28. package/.scripts/jest_migration.sh +31 -0
  29. package/.scripts/reorder_dfx_json.js +72 -0
  30. package/.scripts/setup_release_branch.sh +34 -0
  31. package/.scripts/simplify_tsconfig.js +37 -0
  32. package/.scripts/survey_examples.ts +396 -0
  33. package/.scripts/tsx_migration/ts_node_to_tsx.js +76 -0
  34. package/.scripts/update_candid.sh +40 -0
  35. package/.scripts/update_dfx_json_main.js +66 -0
  36. package/.scripts/update_dfx_json_with_optimize.py +22 -0
  37. package/.scripts/update_jest_configs.ts +248 -0
  38. package/LICENSE +21 -0
  39. package/LICENSE_EXTENSION.md +42 -0
  40. package/NOTICE +222 -0
  41. package/README.md +78 -0
  42. package/dist/canister_templates/experimental.wasm +0 -0
  43. package/dist/canister_templates/licenses.yml +29186 -0
  44. package/dist/canister_templates/stable.wasm +0 -0
  45. package/examples/README.md +22 -0
  46. package/examples/experimental/demo/hello_world_http_server/README.md +120 -0
  47. package/examples/experimental/demo/hello_world_http_server/benchmarks.json +42 -0
  48. package/examples/experimental/demo/hello_world_http_server/benchmarks.md +28 -0
  49. package/examples/experimental/demo/hello_world_http_server/dfx.json +13 -0
  50. package/examples/experimental/demo/hello_world_http_server/env.d.ts +9 -0
  51. package/examples/experimental/demo/hello_world_http_server/jest.config.js +10 -0
  52. package/examples/experimental/demo/hello_world_http_server/package-lock.json +8409 -0
  53. package/examples/experimental/demo/hello_world_http_server/package.json +20 -0
  54. package/examples/experimental/demo/hello_world_http_server/src/backend/index.ts +23 -0
  55. package/examples/experimental/demo/hello_world_http_server/src/frontend/index.html +16 -0
  56. package/examples/experimental/demo/hello_world_http_server/src/frontend/index.ts +62 -0
  57. package/examples/experimental/demo/hello_world_http_server/test/pretest.ts +13 -0
  58. package/examples/experimental/demo/hello_world_http_server/test/test.ts +9 -0
  59. package/examples/experimental/demo/hello_world_http_server/test/tests.ts +27 -0
  60. package/examples/experimental/demo/hello_world_http_server/tsconfig.json +13 -0
  61. package/examples/package-lock.json +8746 -0
  62. package/examples/package.json +17 -0
  63. package/examples/stable/demo/hello_world/README.md +97 -0
  64. package/examples/stable/demo/hello_world/benchmarks.json +28 -0
  65. package/examples/stable/demo/hello_world/benchmarks.md +26 -0
  66. package/examples/stable/demo/hello_world/dfx.json +12 -0
  67. package/examples/stable/demo/hello_world/jest.config.js +10 -0
  68. package/examples/stable/demo/hello_world/package-lock.json +5524 -0
  69. package/examples/stable/demo/hello_world/package.json +14 -0
  70. package/examples/stable/demo/hello_world/src/index.ts +15 -0
  71. package/examples/stable/demo/hello_world/test/pretest.ts +17 -0
  72. package/examples/stable/demo/hello_world/test/test.ts +15 -0
  73. package/examples/stable/demo/hello_world/test/tests.ts +27 -0
  74. package/examples/stable/demo/hello_world/tsconfig.json +10 -0
  75. package/jest.config.dev.js +10 -0
  76. package/package.json +102 -0
  77. package/src/build.ts +98 -0
  78. package/src/experimental/build/assert_experimental.ts +5 -0
  79. package/src/experimental/build/commands/build/candid_and_method_meta.ts +30 -0
  80. package/src/experimental/build/commands/build/custom_js_modules/acorn/acorn.ts +6 -0
  81. package/src/experimental/build/commands/build/custom_js_modules/acorn/walk.ts +6 -0
  82. package/src/experimental/build/commands/build/custom_js_modules/async_hooks.ts +11 -0
  83. package/src/experimental/build/commands/build/custom_js_modules/https.ts +6 -0
  84. package/src/experimental/build/commands/build/custom_js_modules/perf_hooks.ts +12 -0
  85. package/src/experimental/build/commands/build/file_watcher/file_watcher.ts +152 -0
  86. package/src/experimental/build/commands/build/file_watcher/file_watcher_loader.js +9 -0
  87. package/src/experimental/build/commands/build/file_watcher/setup_file_watcher.ts +61 -0
  88. package/src/experimental/build/commands/build/get_context.ts +61 -0
  89. package/src/experimental/build/commands/build/index.ts +87 -0
  90. package/src/experimental/build/commands/build/javascript.ts +194 -0
  91. package/src/experimental/build/commands/build/wasm_binary/index.ts +32 -0
  92. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/Cargo.toml +26 -0
  93. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/autoreload.rs +46 -0
  94. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/benchmarking.rs +35 -0
  95. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/candid.rs +106 -0
  96. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/chunk.rs +11 -0
  97. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/execute_method_js.rs +46 -0
  98. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/guards.rs +9 -0
  99. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/accept_message.rs +10 -0
  100. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/call_raw.rs +265 -0
  101. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/candid_compiler.rs +19 -0
  102. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/candid_decode.rs +17 -0
  103. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/candid_encode.rs +17 -0
  104. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/canister_cycle_balance.rs +12 -0
  105. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/canister_self.rs +10 -0
  106. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/canister_version.rs +10 -0
  107. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/certified_data_set.rs +17 -0
  108. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/clear_timer.rs +18 -0
  109. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/cycles_burn.rs +17 -0
  110. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/data_certificate.rs +13 -0
  111. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/debug_print.rs +17 -0
  112. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/drain_microtasks.rs +23 -0
  113. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/in_replicated_execution.rs +8 -0
  114. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/is_controller.rs +16 -0
  115. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/mod.rs +351 -0
  116. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/msg_arg_data.rs +10 -0
  117. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/msg_caller.rs +10 -0
  118. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/msg_cycles_accept.rs +17 -0
  119. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/msg_cycles_available.rs +10 -0
  120. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/msg_cycles_refunded.rs +10 -0
  121. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/msg_method_name.rs +8 -0
  122. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/msg_reject.rs +16 -0
  123. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/msg_reject_code.rs +8 -0
  124. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/msg_reject_msg.rs +8 -0
  125. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/msg_reply.rs +19 -0
  126. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/notify_raw.rs +65 -0
  127. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/performance_counter.rs +19 -0
  128. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/rand_bytes.rs +25 -0
  129. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/rand_seed.rs +30 -0
  130. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/set_timer.rs +83 -0
  131. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/set_timer_interval.rs +66 -0
  132. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/stable_b_tree_map_contains_key.rs +32 -0
  133. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/stable_b_tree_map_get.rs +36 -0
  134. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/stable_b_tree_map_init.rs +29 -0
  135. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/stable_b_tree_map_insert.rs +46 -0
  136. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/stable_b_tree_map_is_empty.rs +23 -0
  137. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/stable_b_tree_map_items.rs +59 -0
  138. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/stable_b_tree_map_keys.rs +54 -0
  139. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/stable_b_tree_map_len.rs +23 -0
  140. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/stable_b_tree_map_remove.rs +36 -0
  141. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/stable_b_tree_map_values.rs +54 -0
  142. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/time.rs +8 -0
  143. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/ic/trap.rs +14 -0
  144. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/init_and_post_upgrade.rs +212 -0
  145. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/internal_canister_methods.rs +142 -0
  146. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/lib.rs +35 -0
  147. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/stable_b_tree_map.rs +50 -0
  148. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/upload_file/bytes_to_human_readable.rs +20 -0
  149. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/upload_file/file_info.rs +60 -0
  150. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/upload_file/hash.rs +111 -0
  151. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/upload_file/mod.rs +20 -0
  152. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/upload_file/reset.rs +15 -0
  153. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/upload_file/upload_file_chunk.rs +88 -0
  154. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/wasm_binary_manipulation.rs +276 -0
  155. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/web_assembly/instantiate.rs +195 -0
  156. package/src/experimental/build/commands/build/wasm_binary/rust/experimental_canister_template/src/web_assembly/mod.rs +24 -0
  157. package/src/experimental/build/commands/upload_assets/file_uploader/bytes_to_human_readable.ts +27 -0
  158. package/src/experimental/build/commands/upload_assets/file_uploader/expand_paths.ts +50 -0
  159. package/src/experimental/build/commands/upload_assets/file_uploader/get_files_to_upload.ts +21 -0
  160. package/src/experimental/build/commands/upload_assets/file_uploader/incomplete_files.ts +28 -0
  161. package/src/experimental/build/commands/upload_assets/file_uploader/index.ts +43 -0
  162. package/src/experimental/build/commands/upload_assets/file_uploader/on_before_exit.ts +34 -0
  163. package/src/experimental/build/commands/upload_assets/file_uploader/upload_file.ts +91 -0
  164. package/src/experimental/build/commands/upload_assets/file_uploader/uploader_actor.ts +51 -0
  165. package/src/experimental/build/commands/upload_assets/index.ts +16 -0
  166. package/src/experimental/build/commands/upload_assets/uploader_identity.ts +23 -0
  167. package/src/experimental/build/index.ts +61 -0
  168. package/src/experimental/build/utils/dfx.ts +212 -0
  169. package/src/experimental/build/utils/filter_async.ts +14 -0
  170. package/src/experimental/build/utils/find_project_root.ts +67 -0
  171. package/src/experimental/build/utils/global_paths.ts +8 -0
  172. package/src/experimental/build/utils/log_success.ts +18 -0
  173. package/src/experimental/build/utils/types.ts +34 -0
  174. package/src/experimental/lib/assert_experimental.ts +19 -0
  175. package/src/experimental/lib/fetch/file.ts +15 -0
  176. package/src/experimental/lib/fetch/headers.ts +85 -0
  177. package/src/experimental/lib/fetch/http.ts +293 -0
  178. package/src/experimental/lib/fetch/icp.ts +98 -0
  179. package/src/experimental/lib/fetch/index.ts +97 -0
  180. package/src/experimental/lib/fetch/response.ts +171 -0
  181. package/src/experimental/lib/fetch/url.ts +15 -0
  182. package/src/experimental/lib/globals.ts +146 -0
  183. package/src/experimental/lib/http_client/fetch_ic/actor.ts +131 -0
  184. package/src/experimental/lib/http_client/fetch_ic/agent.ts +20 -0
  185. package/src/experimental/lib/http_client/fetch_ic/call.ts +257 -0
  186. package/src/experimental/lib/http_client/fetch_ic/get_canister_id.ts +25 -0
  187. package/src/experimental/lib/http_client/fetch_ic/host.ts +30 -0
  188. package/src/experimental/lib/http_client/fetch_ic/identity.ts +52 -0
  189. package/src/experimental/lib/http_client/fetch_ic/index.ts +95 -0
  190. package/src/experimental/lib/http_client/fetch_ic/response.ts +8 -0
  191. package/src/experimental/lib/http_client/index.ts +6 -0
  192. package/src/experimental/lib/http_client/to_jwt.ts +6 -0
  193. package/src/experimental/lib/ic/azle_ic_experimental.ts +92 -0
  194. package/src/experimental/lib/ic/candid_compiler.ts +14 -0
  195. package/src/experimental/lib/ic/index.ts +10 -0
  196. package/src/experimental/lib/ic/set_outgoing_http_options.ts +18 -0
  197. package/src/experimental/lib/index.ts +7 -0
  198. package/src/experimental/lib/server.ts +279 -0
  199. package/src/experimental/lib/threshold_wallet/calculate_rsv_for_tecdsa.ts +45 -0
  200. package/src/experimental/lib/threshold_wallet/ecdsa_public_key.ts +33 -0
  201. package/src/experimental/lib/threshold_wallet/index.ts +7 -0
  202. package/src/experimental/lib/threshold_wallet/register_get_url.ts +36 -0
  203. package/src/experimental/lib/threshold_wallet/sign_with_ecdsa.ts +28 -0
  204. package/src/experimental/lib/threshold_wallet/wallet.ts +99 -0
  205. package/src/experimental/test/property/arbitraries/candid/candid_definition_arb/complex_candid_definition_memo.ts +113 -0
  206. package/src/experimental/test/property/arbitraries/candid/candid_definition_arb/index.ts +73 -0
  207. package/src/experimental/test/property/arbitraries/candid/candid_definition_arb/recursive_candid_definition_memo.ts +28 -0
  208. package/src/experimental/test/property/arbitraries/candid/candid_definition_arb/simple_candid_definition_arb.ts +116 -0
  209. package/src/experimental/test/property/arbitraries/candid/candid_definition_arb/types.ts +117 -0
  210. package/src/experimental/test/property/arbitraries/candid/candid_return_type_arb.ts +22 -0
  211. package/src/experimental/test/property/arbitraries/candid/candid_type.ts +83 -0
  212. package/src/experimental/test/property/arbitraries/candid/candid_value_and_meta_arb.ts +84 -0
  213. package/src/experimental/test/property/arbitraries/candid/candid_value_and_meta_arb_generator.ts +63 -0
  214. package/src/experimental/test/property/arbitraries/candid/candid_values_arb.ts +173 -0
  215. package/src/experimental/test/property/arbitraries/candid/constructed/blob_arb/definition_arb.ts +11 -0
  216. package/src/experimental/test/property/arbitraries/candid/constructed/blob_arb/index.ts +19 -0
  217. package/src/experimental/test/property/arbitraries/candid/constructed/blob_arb/values_arb.ts +11 -0
  218. package/src/experimental/test/property/arbitraries/candid/constructed/opt_arb/definition_arb.ts +172 -0
  219. package/src/experimental/test/property/arbitraries/candid/constructed/opt_arb/index.ts +29 -0
  220. package/src/experimental/test/property/arbitraries/candid/constructed/opt_arb/values_arb.ts +88 -0
  221. package/src/experimental/test/property/arbitraries/candid/constructed/record_arb/definition_arb.ts +184 -0
  222. package/src/experimental/test/property/arbitraries/candid/constructed/record_arb/index.ts +34 -0
  223. package/src/experimental/test/property/arbitraries/candid/constructed/record_arb/values_arb.ts +95 -0
  224. package/src/experimental/test/property/arbitraries/candid/constructed/tuple_arb/definition_arb.ts +159 -0
  225. package/src/experimental/test/property/arbitraries/candid/constructed/tuple_arb/index.ts +31 -0
  226. package/src/experimental/test/property/arbitraries/candid/constructed/tuple_arb/values_arbs.ts +76 -0
  227. package/src/experimental/test/property/arbitraries/candid/constructed/variant_arb/definition_arbs.ts +257 -0
  228. package/src/experimental/test/property/arbitraries/candid/constructed/variant_arb/index.ts +37 -0
  229. package/src/experimental/test/property/arbitraries/candid/constructed/variant_arb/values_arb.ts +92 -0
  230. package/src/experimental/test/property/arbitraries/candid/constructed/vec_arb/definition_arb.ts +203 -0
  231. package/src/experimental/test/property/arbitraries/candid/constructed/vec_arb/index.ts +39 -0
  232. package/src/experimental/test/property/arbitraries/candid/constructed/vec_arb/values_arb.ts +257 -0
  233. package/src/experimental/test/property/arbitraries/candid/corresponding_js_type.ts +34 -0
  234. package/src/experimental/test/property/arbitraries/candid/primitive/bool_arb.ts +28 -0
  235. package/src/experimental/test/property/arbitraries/candid/primitive/floats/float32_arb.ts +56 -0
  236. package/src/experimental/test/property/arbitraries/candid/primitive/floats/float64_arb.ts +56 -0
  237. package/src/experimental/test/property/arbitraries/candid/primitive/ints/index.ts +11 -0
  238. package/src/experimental/test/property/arbitraries/candid/primitive/ints/int16_arb.ts +34 -0
  239. package/src/experimental/test/property/arbitraries/candid/primitive/ints/int32_arb.ts +34 -0
  240. package/src/experimental/test/property/arbitraries/candid/primitive/ints/int64_arb.ts +41 -0
  241. package/src/experimental/test/property/arbitraries/candid/primitive/ints/int8_arb.ts +34 -0
  242. package/src/experimental/test/property/arbitraries/candid/primitive/ints/int_arb.ts +39 -0
  243. package/src/experimental/test/property/arbitraries/candid/primitive/nats/index.ts +11 -0
  244. package/src/experimental/test/property/arbitraries/candid/primitive/nats/nat16_arb.ts +34 -0
  245. package/src/experimental/test/property/arbitraries/candid/primitive/nats/nat32_arb.ts +34 -0
  246. package/src/experimental/test/property/arbitraries/candid/primitive/nats/nat64_arb.ts +41 -0
  247. package/src/experimental/test/property/arbitraries/candid/primitive/nats/nat8_arb.ts +34 -0
  248. package/src/experimental/test/property/arbitraries/candid/primitive/nats/nat_arb.ts +39 -0
  249. package/src/experimental/test/property/arbitraries/candid/primitive/null_arb.ts +33 -0
  250. package/src/experimental/test/property/arbitraries/candid/primitive/text_arb.ts +47 -0
  251. package/src/experimental/test/property/arbitraries/candid/primitive/void_arb.ts +33 -0
  252. package/src/experimental/test/property/arbitraries/candid/recursive/definition_arb.ts +125 -0
  253. package/src/experimental/test/property/arbitraries/candid/recursive/index.ts +35 -0
  254. package/src/experimental/test/property/arbitraries/candid/recursive/values_arb.ts +43 -0
  255. package/src/experimental/test/property/arbitraries/candid/reference/func_arb/definition_arb.ts +198 -0
  256. package/src/experimental/test/property/arbitraries/candid/reference/func_arb/index.ts +23 -0
  257. package/src/experimental/test/property/arbitraries/candid/reference/func_arb/values_arb.ts +70 -0
  258. package/src/experimental/test/property/arbitraries/candid/reference/principal_arb.ts +43 -0
  259. package/src/experimental/test/property/arbitraries/candid/reference/service_arb/definition_arb.ts +163 -0
  260. package/src/experimental/test/property/arbitraries/candid/reference/service_arb/index.ts +41 -0
  261. package/src/experimental/test/property/arbitraries/candid/reference/service_arb/service_method_arb.ts +110 -0
  262. package/src/experimental/test/property/arbitraries/candid/reference/service_arb/values_arb.ts +20 -0
  263. package/src/experimental/test/property/arbitraries/candid/simple_type_arbs/candid_type_to_azle_candid_type.ts +66 -0
  264. package/src/experimental/test/property/arbitraries/candid/simple_type_arbs/definition_arb.ts +95 -0
  265. package/src/experimental/test/property/arbitraries/candid/simple_type_arbs/values_arb.ts +19 -0
  266. package/src/experimental/test/property/arbitraries/candid/to_src_literal/bigint.ts +5 -0
  267. package/src/experimental/test/property/arbitraries/candid/to_src_literal/blob.ts +5 -0
  268. package/src/experimental/test/property/arbitraries/candid/to_src_literal/boolean.ts +5 -0
  269. package/src/experimental/test/property/arbitraries/candid/to_src_literal/float.ts +18 -0
  270. package/src/experimental/test/property/arbitraries/candid/to_src_literal/null.ts +5 -0
  271. package/src/experimental/test/property/arbitraries/candid/to_src_literal/number.ts +5 -0
  272. package/src/experimental/test/property/arbitraries/candid/to_src_literal/principal.ts +7 -0
  273. package/src/experimental/test/property/arbitraries/candid/to_src_literal/string.ts +12 -0
  274. package/src/experimental/test/property/arbitraries/candid/to_src_literal/void.ts +5 -0
  275. package/src/experimental/test/property/arbitraries/canister_arb.ts +195 -0
  276. package/src/experimental/test/property/arbitraries/canister_methods/index.ts +79 -0
  277. package/src/experimental/test/property/arbitraries/canister_methods/init_method_arb.ts +127 -0
  278. package/src/experimental/test/property/arbitraries/canister_methods/inspect_message_method_arb.ts +55 -0
  279. package/src/experimental/test/property/arbitraries/canister_methods/post_upgrade_method_arb.ts +133 -0
  280. package/src/experimental/test/property/arbitraries/canister_methods/pre_upgrade_method_arb.ts +57 -0
  281. package/src/experimental/test/property/arbitraries/canister_methods/query_method_arb.ts +141 -0
  282. package/src/experimental/test/property/arbitraries/canister_methods/update_method_arb.ts +158 -0
  283. package/src/experimental/test/property/arbitraries/config.ts +4 -0
  284. package/src/experimental/test/property/arbitraries/http/body_arb.ts +7 -0
  285. package/src/experimental/test/property/arbitraries/http/headers_arb.ts +22 -0
  286. package/src/experimental/test/property/arbitraries/http/request_arb.ts +158 -0
  287. package/src/experimental/test/property/arbitraries/http/response_arb.ts +192 -0
  288. package/src/experimental/test/property/arbitraries/js_name_arb.ts +144 -0
  289. package/src/experimental/test/property/arbitraries/stable_b_tree_map_arb.ts +55 -0
  290. package/src/experimental/test/property/arbitraries/types.ts +24 -0
  291. package/src/experimental/test/property/arbitraries/unique_identifier_arb.ts +38 -0
  292. package/src/experimental/test/property/arbitraries/unique_primitive_arb.ts +22 -0
  293. package/src/experimental/test/property/are_params_correctly_ordered.ts +19 -0
  294. package/src/experimental/test/property/get_actor.ts +39 -0
  295. package/src/experimental/test/property/index.ts +141 -0
  296. package/src/experimental/test/property/test/index.ts +226 -0
  297. package/src/experimental/test/property/visitors/LICENCE +201 -0
  298. package/src/experimental/test/property/visitors/cli-string-visitor.ts +138 -0
  299. package/src/experimental/test/set_experimental.ts +1 -0
  300. package/src/exports/_internal/dfx.ts +1 -0
  301. package/src/exports/_internal/globals.ts +1 -0
  302. package/src/exports/_internal/test/candid_deep_equal.ts +1 -0
  303. package/src/exports/_internal/test.ts +1 -0
  304. package/src/exports/_internal/type_tests/assert_type.ts +1 -0
  305. package/src/exports/_internal.ts +1 -0
  306. package/src/exports/canisters/ck_btc_ledger/idl.ts +1 -0
  307. package/src/exports/canisters/ck_eth_ledger/idl.ts +1 -0
  308. package/src/exports/canisters/cycles_ledger/idl.ts +1 -0
  309. package/src/exports/canisters/evm_rpc/idl.ts +1 -0
  310. package/src/exports/canisters/exchange_rate/idl.ts +1 -0
  311. package/src/exports/canisters/http_gateway/idl.ts +1 -0
  312. package/src/exports/canisters/icrc_1/idl.ts +1 -0
  313. package/src/exports/canisters/icrc_10/idl.ts +1 -0
  314. package/src/exports/canisters/icrc_2/idl.ts +1 -0
  315. package/src/exports/canisters/icrc_3/idl.ts +1 -0
  316. package/src/exports/canisters/icrc_37/idl.ts +1 -0
  317. package/src/exports/canisters/icrc_7/idl.ts +1 -0
  318. package/src/exports/canisters/llm/idl.ts +1 -0
  319. package/src/exports/canisters/management/idl.ts +1 -0
  320. package/src/exports/canisters/nns_cycles_minting/idl.ts +1 -0
  321. package/src/exports/canisters/nns_governance/idl.ts +1 -0
  322. package/src/exports/canisters/nns_icp_ledger/idl.ts +1 -0
  323. package/src/exports/canisters/nns_internet_identity/idl.ts +1 -0
  324. package/src/exports/canisters/nns_registry/idl.ts +1 -0
  325. package/src/exports/canisters/nns_sns_w/idl.ts +1 -0
  326. package/src/exports/experimental/_internal/dfx.ts +1 -0
  327. package/src/exports/experimental/_internal/globals.ts +1 -0
  328. package/src/exports/experimental/_internal/test/property/arbitraries/candid/candid_definition_arb/types.ts +1 -0
  329. package/src/exports/experimental/_internal/test/property/arbitraries/candid/candid_definition_arb.ts +1 -0
  330. package/src/exports/experimental/_internal/test/property/arbitraries/candid/candid_return_type_arb.ts +1 -0
  331. package/src/exports/experimental/_internal/test/property/arbitraries/candid/candid_value_and_meta_arb.ts +1 -0
  332. package/src/exports/experimental/_internal/test/property/arbitraries/candid/candid_value_and_meta_arb_generator.ts +1 -0
  333. package/src/exports/experimental/_internal/test/property/arbitraries/candid/candid_values_arb.ts +1 -0
  334. package/src/exports/experimental/_internal/test/property/arbitraries/candid/constructed/blob_arb.ts +1 -0
  335. package/src/exports/experimental/_internal/test/property/arbitraries/candid/constructed/opt_arb.ts +1 -0
  336. package/src/exports/experimental/_internal/test/property/arbitraries/candid/constructed/record_arb.ts +1 -0
  337. package/src/exports/experimental/_internal/test/property/arbitraries/candid/constructed/tuple_arb.ts +1 -0
  338. package/src/exports/experimental/_internal/test/property/arbitraries/candid/constructed/variant_arb.ts +1 -0
  339. package/src/exports/experimental/_internal/test/property/arbitraries/candid/constructed/vec_arb.ts +1 -0
  340. package/src/exports/experimental/_internal/test/property/arbitraries/candid/corresponding_js_type.ts +1 -0
  341. package/src/exports/experimental/_internal/test/property/arbitraries/candid/primitive/bool_arb.ts +1 -0
  342. package/src/exports/experimental/_internal/test/property/arbitraries/candid/primitive/floats/float32_arb.ts +1 -0
  343. package/src/exports/experimental/_internal/test/property/arbitraries/candid/primitive/floats/float64_arb.ts +1 -0
  344. package/src/exports/experimental/_internal/test/property/arbitraries/candid/primitive/ints/int16_arb.ts +1 -0
  345. package/src/exports/experimental/_internal/test/property/arbitraries/candid/primitive/ints/int32_arb.ts +1 -0
  346. package/src/exports/experimental/_internal/test/property/arbitraries/candid/primitive/ints/int64_arb.ts +1 -0
  347. package/src/exports/experimental/_internal/test/property/arbitraries/candid/primitive/ints/int8_arb.ts +1 -0
  348. package/src/exports/experimental/_internal/test/property/arbitraries/candid/primitive/ints/int_arb.ts +1 -0
  349. package/src/exports/experimental/_internal/test/property/arbitraries/candid/primitive/nats/nat16_arb.ts +1 -0
  350. package/src/exports/experimental/_internal/test/property/arbitraries/candid/primitive/nats/nat32_arb.ts +1 -0
  351. package/src/exports/experimental/_internal/test/property/arbitraries/candid/primitive/nats/nat64_arb.ts +1 -0
  352. package/src/exports/experimental/_internal/test/property/arbitraries/candid/primitive/nats/nat8_arb.ts +1 -0
  353. package/src/exports/experimental/_internal/test/property/arbitraries/candid/primitive/nats/nat_arb.ts +1 -0
  354. package/src/exports/experimental/_internal/test/property/arbitraries/candid/primitive/null_arb.ts +1 -0
  355. package/src/exports/experimental/_internal/test/property/arbitraries/candid/primitive/text_arb.ts +1 -0
  356. package/src/exports/experimental/_internal/test/property/arbitraries/candid/primitive/void_arb.ts +1 -0
  357. package/src/exports/experimental/_internal/test/property/arbitraries/candid/recursive.ts +1 -0
  358. package/src/exports/experimental/_internal/test/property/arbitraries/candid/reference/func_arb.ts +1 -0
  359. package/src/exports/experimental/_internal/test/property/arbitraries/candid/reference/principal_arb.ts +1 -0
  360. package/src/exports/experimental/_internal/test/property/arbitraries/candid/reference/service_arb.ts +1 -0
  361. package/src/exports/experimental/_internal/test/property/arbitraries/canister_arb.ts +1 -0
  362. package/src/exports/experimental/_internal/test/property/arbitraries/canister_methods/init_method_arb.ts +1 -0
  363. package/src/exports/experimental/_internal/test/property/arbitraries/canister_methods/inspect_message_method_arb.ts +1 -0
  364. package/src/exports/experimental/_internal/test/property/arbitraries/canister_methods/post_upgrade_method_arb.ts +1 -0
  365. package/src/exports/experimental/_internal/test/property/arbitraries/canister_methods/pre_upgrade_method_arb.ts +1 -0
  366. package/src/exports/experimental/_internal/test/property/arbitraries/canister_methods/query_method_arb.ts +1 -0
  367. package/src/exports/experimental/_internal/test/property/arbitraries/canister_methods/update_method_arb.ts +1 -0
  368. package/src/exports/experimental/_internal/test/property/arbitraries/canister_methods.ts +1 -0
  369. package/src/exports/experimental/_internal/test/property/arbitraries/config.ts +1 -0
  370. package/src/exports/experimental/_internal/test/property/arbitraries/http/body_arb.ts +1 -0
  371. package/src/exports/experimental/_internal/test/property/arbitraries/http/headers_arb.ts +1 -0
  372. package/src/exports/experimental/_internal/test/property/arbitraries/http/request_arb.ts +1 -0
  373. package/src/exports/experimental/_internal/test/property/arbitraries/http/response_arb.ts +1 -0
  374. package/src/exports/experimental/_internal/test/property/arbitraries/stable_b_tree_map_arb.ts +1 -0
  375. package/src/exports/experimental/_internal/test/property/arbitraries/types.ts +1 -0
  376. package/src/exports/experimental/_internal/test/property/arbitraries/unique_identifier_arb.ts +1 -0
  377. package/src/exports/experimental/_internal/test/property/are_params_correctly_ordered.ts +1 -0
  378. package/src/exports/experimental/_internal/test/property/test.ts +1 -0
  379. package/src/exports/experimental/_internal/test/property.ts +1 -0
  380. package/src/exports/experimental/_internal/test/set_experimental.ts +1 -0
  381. package/src/exports/experimental/_internal.ts +8 -0
  382. package/src/exports/experimental/http_client.ts +1 -0
  383. package/src/exports/experimental.ts +3 -0
  384. package/src/stable/build/commands/build/candid_and_method_meta/execute.ts +134 -0
  385. package/src/stable/build/commands/build/candid_and_method_meta/index.ts +27 -0
  386. package/src/stable/build/commands/build/get_context.ts +79 -0
  387. package/src/stable/build/commands/build/index.ts +48 -0
  388. package/src/stable/build/commands/build/javascript.ts +259 -0
  389. package/src/stable/build/commands/build/wasm_binary/compile.ts +27 -0
  390. package/src/stable/build/commands/build/wasm_binary/index.ts +30 -0
  391. package/src/stable/build/commands/build/wasm_binary/manipulate.ts +268 -0
  392. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/Cargo.toml +23 -0
  393. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/benchmarking.rs +45 -0
  394. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/candid_and_method_meta.rs +49 -0
  395. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/execute_method_js.rs +65 -0
  396. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/guards.rs +11 -0
  397. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/accept_message.rs +6 -0
  398. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/call_raw.rs +362 -0
  399. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/candid_decode.rs +18 -0
  400. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/candid_encode.rs +19 -0
  401. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/canister_cycle_balance.rs +8 -0
  402. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/canister_self.rs +8 -0
  403. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/canister_version.rs +8 -0
  404. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/certified_data_set.rs +8 -0
  405. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/clear_timer.rs +15 -0
  406. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/cycles_burn.rs +17 -0
  407. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/data_certificate.rs +13 -0
  408. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/debug_print.rs +8 -0
  409. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/drain_microtasks.rs +22 -0
  410. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/in_replicated_execution.rs +6 -0
  411. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/is_controller.rs +11 -0
  412. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/mod.rs +219 -0
  413. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/msg_arg_data.rs +8 -0
  414. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/msg_caller.rs +8 -0
  415. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/msg_cycles_accept.rs +17 -0
  416. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/msg_cycles_available.rs +8 -0
  417. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/msg_cycles_refunded.rs +8 -0
  418. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/msg_method_name.rs +6 -0
  419. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/msg_reject.rs +6 -0
  420. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/msg_reject_code.rs +6 -0
  421. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/msg_reject_msg.rs +6 -0
  422. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/msg_reply.rs +8 -0
  423. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/notify_raw.rs +62 -0
  424. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/performance_counter.rs +17 -0
  425. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/rand_bytes.rs +21 -0
  426. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/rand_seed.rs +26 -0
  427. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/set_timer.rs +92 -0
  428. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/set_timer_interval.rs +62 -0
  429. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/stable_b_tree_map_contains_key.rs +18 -0
  430. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/stable_b_tree_map_get.rs +21 -0
  431. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/stable_b_tree_map_init.rs +19 -0
  432. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/stable_b_tree_map_insert.rs +44 -0
  433. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/stable_b_tree_map_is_empty.rs +11 -0
  434. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/stable_b_tree_map_items.rs +48 -0
  435. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/stable_b_tree_map_keys.rs +43 -0
  436. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/stable_b_tree_map_len.rs +16 -0
  437. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/stable_b_tree_map_remove.rs +21 -0
  438. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/stable_b_tree_map_values.rs +43 -0
  439. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/time.rs +8 -0
  440. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/ic/trap.rs +22 -0
  441. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/init_and_post_upgrade.rs +98 -0
  442. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/initialize_context.rs +102 -0
  443. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/internal_canister_methods.rs +122 -0
  444. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/lib.rs +39 -0
  445. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/rquickjs_utils/call_with_error_handling.rs +26 -0
  446. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/rquickjs_utils/error.rs +27 -0
  447. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/rquickjs_utils/mod.rs +7 -0
  448. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/rquickjs_utils/with_ctx.rs +24 -0
  449. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/stable_b_tree_map.rs +84 -0
  450. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/state.rs +55 -0
  451. package/src/stable/build/commands/build/wasm_binary/rust/stable_canister_template/src/wasm_binary_manipulation.rs +296 -0
  452. package/src/stable/build/commands/clean.ts +15 -0
  453. package/src/stable/build/commands/dev/audit.ts +39 -0
  454. package/src/stable/build/commands/dev/setup/index.ts +41 -0
  455. package/src/stable/build/commands/dev/setup/install_cargo-audit.sh +11 -0
  456. package/src/stable/build/commands/dev/setup/install_cargo-auditable.sh +16 -0
  457. package/src/stable/build/commands/dev/setup/install_cargo-bundle-licenses.sh +11 -0
  458. package/src/stable/build/commands/dev/setup/install_cargo-deny.sh +11 -0
  459. package/src/stable/build/commands/dev/setup/install_dfx.sh +36 -0
  460. package/src/stable/build/commands/dev/setup/install_node.sh +25 -0
  461. package/src/stable/build/commands/dev/setup/install_rust.sh +24 -0
  462. package/src/stable/build/commands/dev/setup/install_wasi2ic.sh +11 -0
  463. package/src/stable/build/commands/dev/template/experimental.ts +28 -0
  464. package/src/stable/build/commands/dev/template/generate_licenses.ts +28 -0
  465. package/src/stable/build/commands/dev/template/stable.ts +27 -0
  466. package/src/stable/build/commands/extension/install.ts +25 -0
  467. package/src/stable/build/commands/generate/index.ts +21 -0
  468. package/src/stable/build/commands/generate/rust/candid_to_ts_js/Cargo.toml +12 -0
  469. package/src/stable/build/commands/generate/rust/candid_to_ts_js/build.sh +9 -0
  470. package/src/stable/build/commands/generate/rust/candid_to_ts_js/licenses.md +1 -0
  471. package/src/stable/build/commands/generate/rust/candid_to_ts_js/pkg/candid_to_ts_js.d.ts +18 -0
  472. package/src/stable/build/commands/generate/rust/candid_to_ts_js/pkg/candid_to_ts_js.js +144 -0
  473. package/src/stable/build/commands/generate/rust/candid_to_ts_js/pkg/candid_to_ts_js_bg.wasm +0 -0
  474. package/src/stable/build/commands/generate/rust/candid_to_ts_js/pkg/candid_to_ts_js_bg.wasm.d.ts +9 -0
  475. package/src/stable/build/commands/generate/rust/candid_to_ts_js/pkg/package.json +11 -0
  476. package/src/stable/build/commands/generate/rust/candid_to_ts_js/src/lib.rs +31 -0
  477. package/src/stable/build/commands/new.ts +165 -0
  478. package/src/stable/build/commands/version.ts +5 -0
  479. package/src/stable/build/dfx_extension/extension.json +36 -0
  480. package/src/stable/build/dfx_extension/install.sh +10 -0
  481. package/src/stable/build/index.ts +282 -0
  482. package/src/stable/build/utils/dfx.ts +10 -0
  483. package/src/stable/build/utils/dfx_root.ts +34 -0
  484. package/src/stable/build/utils/exec_sync_pretty.ts +17 -0
  485. package/src/stable/build/utils/experimental_message.ts +19 -0
  486. package/src/stable/build/utils/get_canister_config.ts +52 -0
  487. package/src/stable/build/utils/global_paths.ts +26 -0
  488. package/src/stable/build/utils/types.ts +87 -0
  489. package/src/stable/lib/canister_methods/heartbeat.ts +29 -0
  490. package/src/stable/lib/canister_methods/index.ts +405 -0
  491. package/src/stable/lib/canister_methods/init.ts +71 -0
  492. package/src/stable/lib/canister_methods/inspect_message.ts +79 -0
  493. package/src/stable/lib/canister_methods/on_low_wasm_memory.ts +27 -0
  494. package/src/stable/lib/canister_methods/post_upgrade.ts +73 -0
  495. package/src/stable/lib/canister_methods/pre_upgrade.ts +27 -0
  496. package/src/stable/lib/canister_methods/query.ts +69 -0
  497. package/src/stable/lib/canister_methods/update.ts +66 -0
  498. package/src/stable/lib/canisters/NOTICE +15 -0
  499. package/src/stable/lib/canisters/ck_btc_ledger/idl/README.md +9 -0
  500. package/src/stable/lib/canisters/ck_btc_ledger/idl/index.did +289 -0
  501. package/src/stable/lib/canisters/ck_btc_ledger/idl/index.ts +1143 -0
  502. package/src/stable/lib/canisters/ck_eth_ledger/idl/README.md +9 -0
  503. package/src/stable/lib/canisters/ck_eth_ledger/idl/index.did +289 -0
  504. package/src/stable/lib/canisters/ck_eth_ledger/idl/index.ts +1143 -0
  505. package/src/stable/lib/canisters/cycles_ledger/idl/README.md +9 -0
  506. package/src/stable/lib/canisters/cycles_ledger/idl/index.did +272 -0
  507. package/src/stable/lib/canisters/cycles_ledger/idl/index.ts +978 -0
  508. package/src/stable/lib/canisters/evm_rpc/idl/README.md +9 -0
  509. package/src/stable/lib/canisters/evm_rpc/idl/index.did +311 -0
  510. package/src/stable/lib/canisters/evm_rpc/idl/index.ts +1028 -0
  511. package/src/stable/lib/canisters/exchange_rate/idl/README.md +9 -0
  512. package/src/stable/lib/canisters/exchange_rate/idl/index.did +83 -0
  513. package/src/stable/lib/canisters/exchange_rate/idl/index.ts +165 -0
  514. package/src/stable/lib/canisters/http_gateway/idl/README.md +9 -0
  515. package/src/stable/lib/canisters/http_gateway/idl/http-gateway.did +49 -0
  516. package/src/stable/lib/canisters/http_gateway/idl/index.ts +120 -0
  517. package/src/stable/lib/canisters/icrc_1/idl/ICRC-1.did +63 -0
  518. package/src/stable/lib/canisters/icrc_1/idl/LICENSE +202 -0
  519. package/src/stable/lib/canisters/icrc_1/idl/index.ts +151 -0
  520. package/src/stable/lib/canisters/icrc_10/idl/ICRC-10.did +8 -0
  521. package/src/stable/lib/canisters/icrc_10/idl/LICENSE +202 -0
  522. package/src/stable/lib/canisters/icrc_10/idl/index.ts +32 -0
  523. package/src/stable/lib/canisters/icrc_2/idl/ICRC-2.did +76 -0
  524. package/src/stable/lib/canisters/icrc_2/idl/LICENSE +202 -0
  525. package/src/stable/lib/canisters/icrc_2/idl/index.ts +226 -0
  526. package/src/stable/lib/canisters/icrc_3/idl/ICRC-3.did +59 -0
  527. package/src/stable/lib/canisters/icrc_3/idl/LICENSE +202 -0
  528. package/src/stable/lib/canisters/icrc_3/idl/index.ts +156 -0
  529. package/src/stable/lib/canisters/icrc_37/idl/ICRC-37.did +152 -0
  530. package/src/stable/lib/canisters/icrc_37/idl/LICENSE +202 -0
  531. package/src/stable/lib/canisters/icrc_37/idl/index.ts +466 -0
  532. package/src/stable/lib/canisters/icrc_7/idl/ICRC-7.did +67 -0
  533. package/src/stable/lib/canisters/icrc_7/idl/LICENSE +202 -0
  534. package/src/stable/lib/canisters/icrc_7/idl/index.ts +213 -0
  535. package/src/stable/lib/canisters/llm/idl/README.md +9 -0
  536. package/src/stable/lib/canisters/llm/idl/index.did +21 -0
  537. package/src/stable/lib/canisters/llm/idl/index.ts +43 -0
  538. package/src/stable/lib/canisters/management/idl/README.md +10 -0
  539. package/src/stable/lib/canisters/management/idl/ic.did +502 -0
  540. package/src/stable/lib/canisters/management/idl/index.ts +1257 -0
  541. package/src/stable/lib/canisters/nns_cycles_minting/idl/README.md +9 -0
  542. package/src/stable/lib/canisters/nns_cycles_minting/idl/index.did +241 -0
  543. package/src/stable/lib/canisters/nns_cycles_minting/idl/index.ts +394 -0
  544. package/src/stable/lib/canisters/nns_governance/idl/README.md +9 -0
  545. package/src/stable/lib/canisters/nns_governance/idl/index.did +1316 -0
  546. package/src/stable/lib/canisters/nns_governance/idl/index.ts +3599 -0
  547. package/src/stable/lib/canisters/nns_icp_ledger/idl/LICENSE +202 -0
  548. package/src/stable/lib/canisters/nns_icp_ledger/idl/NOTICE +14 -0
  549. package/src/stable/lib/canisters/nns_icp_ledger/idl/README.md +18 -0
  550. package/src/stable/lib/canisters/nns_icp_ledger/idl/address/index.ts +82 -0
  551. package/src/stable/lib/canisters/nns_icp_ledger/idl/index.did +264 -0
  552. package/src/stable/lib/canisters/nns_icp_ledger/idl/index.ts +1020 -0
  553. package/src/stable/lib/canisters/nns_internet_identity/idl/README.md +9 -0
  554. package/src/stable/lib/canisters/nns_internet_identity/idl/index.did +779 -0
  555. package/src/stable/lib/canisters/nns_internet_identity/idl/index.ts +1509 -0
  556. package/src/stable/lib/canisters/nns_registry/idl/README.md +9 -0
  557. package/src/stable/lib/canisters/nns_registry/idl/index.did +493 -0
  558. package/src/stable/lib/canisters/nns_registry/idl/index.ts +1421 -0
  559. package/src/stable/lib/canisters/nns_sns_w/idl/README.md +9 -0
  560. package/src/stable/lib/canisters/nns_sns_w/idl/index.did +352 -0
  561. package/src/stable/lib/canisters/nns_sns_w/idl/index.ts +887 -0
  562. package/src/stable/lib/did_file/idl_to_string.ts +79 -0
  563. package/src/stable/lib/did_file/index.ts +2 -0
  564. package/src/stable/lib/did_file/visitor/did_visitor.ts +135 -0
  565. package/src/stable/lib/did_file/visitor/escape_candid_name.ts +100 -0
  566. package/src/stable/lib/did_file/visitor/extract_candid.ts +31 -0
  567. package/src/stable/lib/did_file/visitor/index.ts +1 -0
  568. package/src/stable/lib/did_file/visitor/visit/func.ts +31 -0
  569. package/src/stable/lib/did_file/visitor/visit/opt.ts +16 -0
  570. package/src/stable/lib/did_file/visitor/visit/primitive.ts +11 -0
  571. package/src/stable/lib/did_file/visitor/visit/record.ts +24 -0
  572. package/src/stable/lib/did_file/visitor/visit/recursive.ts +32 -0
  573. package/src/stable/lib/did_file/visitor/visit/service.ts +107 -0
  574. package/src/stable/lib/did_file/visitor/visit/tuple.ts +20 -0
  575. package/src/stable/lib/did_file/visitor/visit/variant.ts +26 -0
  576. package/src/stable/lib/did_file/visitor/visit/vec.ts +16 -0
  577. package/src/stable/lib/error.ts +55 -0
  578. package/src/stable/lib/execute_and_reply_with_candid_serde.ts +245 -0
  579. package/src/stable/lib/func.ts +7 -0
  580. package/src/stable/lib/globals.ts +250 -0
  581. package/src/stable/lib/ic_apis/NOTICE +203 -0
  582. package/src/stable/lib/ic_apis/azle_ic_stable.ts +86 -0
  583. package/src/stable/lib/ic_apis/call.ts +397 -0
  584. package/src/stable/lib/ic_apis/candid_decode.ts +26 -0
  585. package/src/stable/lib/ic_apis/candid_encode.ts +27 -0
  586. package/src/stable/lib/ic_apis/canister_cycle_balance.ts +28 -0
  587. package/src/stable/lib/ic_apis/canister_self.ts +25 -0
  588. package/src/stable/lib/ic_apis/canister_version.ts +33 -0
  589. package/src/stable/lib/ic_apis/certified_data_set.ts +35 -0
  590. package/src/stable/lib/ic_apis/chunk.ts +42 -0
  591. package/src/stable/lib/ic_apis/clear_timer.ts +53 -0
  592. package/src/stable/lib/ic_apis/cycles_burn.ts +32 -0
  593. package/src/stable/lib/ic_apis/data_certificate.ts +30 -0
  594. package/src/stable/lib/ic_apis/in_replicated_execution.ts +20 -0
  595. package/src/stable/lib/ic_apis/index.ts +37 -0
  596. package/src/stable/lib/ic_apis/is_controller.ts +31 -0
  597. package/src/stable/lib/ic_apis/msg_arg_data.ts +28 -0
  598. package/src/stable/lib/ic_apis/msg_caller.ts +32 -0
  599. package/src/stable/lib/ic_apis/msg_cycles_accept.ts +27 -0
  600. package/src/stable/lib/ic_apis/msg_cycles_available.ts +25 -0
  601. package/src/stable/lib/ic_apis/msg_cycles_refunded.ts +25 -0
  602. package/src/stable/lib/ic_apis/msg_method_name.ts +21 -0
  603. package/src/stable/lib/ic_apis/msg_reject.ts +28 -0
  604. package/src/stable/lib/ic_apis/msg_reject_code.ts +40 -0
  605. package/src/stable/lib/ic_apis/msg_reject_msg.ts +24 -0
  606. package/src/stable/lib/ic_apis/msg_reply.ts +34 -0
  607. package/src/stable/lib/ic_apis/performance_counter.ts +31 -0
  608. package/src/stable/lib/ic_apis/rand_seed.ts +40 -0
  609. package/src/stable/lib/ic_apis/set_timer.ts +80 -0
  610. package/src/stable/lib/ic_apis/set_timer_interval.ts +87 -0
  611. package/src/stable/lib/ic_apis/time.ts +26 -0
  612. package/src/stable/lib/ic_apis/trap.ts +29 -0
  613. package/src/stable/lib/index.ts +16 -0
  614. package/src/stable/lib/json.ts +39 -0
  615. package/src/stable/lib/stable_structures/stable_b_tree_map.ts +488 -0
  616. package/src/stable/lib/stable_structures/stable_json.ts +254 -0
  617. package/src/stable/lib/state.ts +322 -0
  618. package/src/stable/test/benchmarks/_azle_get_benchmarks.did +9 -0
  619. package/src/stable/test/benchmarks/index.ts +273 -0
  620. package/src/stable/test/candid_deep_equal.ts +99 -0
  621. package/src/stable/test/canister_names.ts +36 -0
  622. package/src/stable/test/fuzz.ts +102 -0
  623. package/src/stable/test/get_canister_actor.ts +45 -0
  624. package/src/stable/test/global_state.ts +202 -0
  625. package/src/stable/test/index.ts +274 -0
  626. package/src/stable/test/memory_state.ts +187 -0
  627. package/src/stable/test/property/default_prop_test_params.ts +36 -0
  628. package/src/stable/test/type/assert_type.ts +9 -0
  629. package/tsconfig.dev.json +10 -0
@@ -0,0 +1,1143 @@
1
+ import { ActorMethod } from '@dfinity/agent';
2
+ import { IDL } from '@dfinity/candid';
3
+ import { Principal } from '@dfinity/principal';
4
+
5
+ export interface Account {
6
+ owner: Principal;
7
+ subaccount: [] | [Uint8Array | number[]];
8
+ }
9
+ export interface Allowance {
10
+ allowance: bigint;
11
+ expires_at: [] | [bigint];
12
+ }
13
+ export interface AllowanceArgs {
14
+ account: Account;
15
+ spender: Account;
16
+ }
17
+ export interface Approve {
18
+ fee: [] | [bigint];
19
+ from: Account;
20
+ memo: [] | [Uint8Array | number[]];
21
+ created_at_time: [] | [bigint];
22
+ amount: bigint;
23
+ expected_allowance: [] | [bigint];
24
+ expires_at: [] | [bigint];
25
+ spender: Account;
26
+ }
27
+ export interface ApproveArgs {
28
+ fee: [] | [bigint];
29
+ memo: [] | [Uint8Array | number[]];
30
+ from_subaccount: [] | [Uint8Array | number[]];
31
+ created_at_time: [] | [bigint];
32
+ amount: bigint;
33
+ expected_allowance: [] | [bigint];
34
+ expires_at: [] | [bigint];
35
+ spender: Account;
36
+ }
37
+ export type ApproveError =
38
+ | {
39
+ GenericError: { message: string; error_code: bigint };
40
+ }
41
+ | { TemporarilyUnavailable: null }
42
+ | { Duplicate: { duplicate_of: bigint } }
43
+ | { BadFee: { expected_fee: bigint } }
44
+ | { AllowanceChanged: { current_allowance: bigint } }
45
+ | { CreatedInFuture: { ledger_time: bigint } }
46
+ | { TooOld: null }
47
+ | { Expired: { ledger_time: bigint } }
48
+ | { InsufficientFunds: { balance: bigint } };
49
+ export interface ArchiveInfo {
50
+ block_range_end: bigint;
51
+ canister_id: Principal;
52
+ block_range_start: bigint;
53
+ }
54
+ export interface ArchiveOptions {
55
+ num_blocks_to_archive: bigint;
56
+ max_transactions_per_response: [] | [bigint];
57
+ trigger_threshold: bigint;
58
+ more_controller_ids: [] | [Array<Principal>];
59
+ max_message_size_bytes: [] | [bigint];
60
+ cycles_for_archive_creation: [] | [bigint];
61
+ node_max_memory_size_bytes: [] | [bigint];
62
+ controller_id: Principal;
63
+ }
64
+ export interface ArchivedBlocks {
65
+ args: Array<GetBlocksRequest>;
66
+ callback: [Principal, string];
67
+ }
68
+ export interface ArchivedRange {
69
+ callback: [Principal, string];
70
+ start: bigint;
71
+ length: bigint;
72
+ }
73
+ export interface ArchivedRange_1 {
74
+ callback: [Principal, string];
75
+ start: bigint;
76
+ length: bigint;
77
+ }
78
+ export interface BlockRange {
79
+ blocks: Array<Value>;
80
+ }
81
+ export interface BlockWithId {
82
+ id: bigint;
83
+ block: ICRC3Value;
84
+ }
85
+ export interface Burn {
86
+ from: Account;
87
+ memo: [] | [Uint8Array | number[]];
88
+ created_at_time: [] | [bigint];
89
+ amount: bigint;
90
+ spender: [] | [Account];
91
+ }
92
+ export interface ChangeArchiveOptions {
93
+ num_blocks_to_archive: [] | [bigint];
94
+ max_transactions_per_response: [] | [bigint];
95
+ trigger_threshold: [] | [bigint];
96
+ more_controller_ids: [] | [Array<Principal>];
97
+ max_message_size_bytes: [] | [bigint];
98
+ cycles_for_archive_creation: [] | [bigint];
99
+ node_max_memory_size_bytes: [] | [bigint];
100
+ controller_id: [] | [Principal];
101
+ }
102
+ export type ChangeFeeCollector = { SetTo: Account } | { Unset: null };
103
+ export interface ConsentInfo {
104
+ metadata: ConsentMessageMetadata;
105
+ consent_message: ConsentMessage;
106
+ }
107
+ export type ConsentMessage =
108
+ | {
109
+ LineDisplayMessage: { pages: Array<LineDisplayPage> };
110
+ }
111
+ | { GenericDisplayMessage: string };
112
+ export interface ConsentMessageMetadata {
113
+ utc_offset_minutes: [] | [number];
114
+ language: string;
115
+ }
116
+ export interface ConsentMessageRequest {
117
+ arg: Uint8Array | number[];
118
+ method: string;
119
+ user_preferences: ConsentMessageSpec;
120
+ }
121
+ export interface ConsentMessageSpec {
122
+ metadata: ConsentMessageMetadata;
123
+ device_spec: [] | [DisplayMessageType];
124
+ }
125
+ export interface DataCertificate {
126
+ certificate: [] | [Uint8Array | number[]];
127
+ hash_tree: Uint8Array | number[];
128
+ }
129
+ export type DisplayMessageType =
130
+ | { GenericDisplay: null }
131
+ | {
132
+ LineDisplay: {
133
+ characters_per_line: number;
134
+ lines_per_page: number;
135
+ };
136
+ };
137
+ export interface ErrorInfo {
138
+ description: string;
139
+ }
140
+ export interface FeatureFlags {
141
+ icrc2: boolean;
142
+ }
143
+ export interface GetArchivesArgs {
144
+ from: [] | [Principal];
145
+ }
146
+ export interface GetBlocksRequest {
147
+ start: bigint;
148
+ length: bigint;
149
+ }
150
+ export interface GetBlocksResponse {
151
+ certificate: [] | [Uint8Array | number[]];
152
+ first_index: bigint;
153
+ blocks: Array<Value>;
154
+ chain_length: bigint;
155
+ archived_blocks: Array<ArchivedRange>;
156
+ }
157
+ export interface GetBlocksResult {
158
+ log_length: bigint;
159
+ blocks: Array<BlockWithId>;
160
+ archived_blocks: Array<ArchivedBlocks>;
161
+ }
162
+ export interface GetTransactionsResponse {
163
+ first_index: bigint;
164
+ log_length: bigint;
165
+ transactions: Array<Transaction>;
166
+ archived_transactions: Array<ArchivedRange_1>;
167
+ }
168
+ export interface ICRC3ArchiveInfo {
169
+ end: bigint;
170
+ canister_id: Principal;
171
+ start: bigint;
172
+ }
173
+ export interface ICRC3DataCertificate {
174
+ certificate: Uint8Array | number[];
175
+ hash_tree: Uint8Array | number[];
176
+ }
177
+ export type ICRC3Value =
178
+ | { Int: bigint }
179
+ | { Map: Array<[string, ICRC3Value]> }
180
+ | { Nat: bigint }
181
+ | { Blob: Uint8Array | number[] }
182
+ | { Text: string }
183
+ | { Array: Array<ICRC3Value> };
184
+ export type Icrc21Error =
185
+ | {
186
+ GenericError: { description: string; error_code: bigint };
187
+ }
188
+ | { InsufficientPayment: ErrorInfo }
189
+ | { UnsupportedCanisterCall: ErrorInfo }
190
+ | { ConsentMessageUnavailable: ErrorInfo };
191
+ export interface InitArgs {
192
+ decimals: [] | [number];
193
+ token_symbol: string;
194
+ transfer_fee: bigint;
195
+ metadata: Array<[string, MetadataValue]>;
196
+ minting_account: Account;
197
+ initial_balances: Array<[Account, bigint]>;
198
+ fee_collector_account: [] | [Account];
199
+ archive_options: ArchiveOptions;
200
+ max_memo_length: [] | [number];
201
+ token_name: string;
202
+ feature_flags: [] | [FeatureFlags];
203
+ }
204
+ export type LedgerArgument =
205
+ | { Upgrade: [] | [UpgradeArgs] }
206
+ | { Init: InitArgs };
207
+ export interface LineDisplayPage {
208
+ lines: Array<string>;
209
+ }
210
+ export type MetadataValue =
211
+ | { Int: bigint }
212
+ | { Nat: bigint }
213
+ | { Blob: Uint8Array | number[] }
214
+ | { Text: string };
215
+ export interface Mint {
216
+ to: Account;
217
+ memo: [] | [Uint8Array | number[]];
218
+ created_at_time: [] | [bigint];
219
+ amount: bigint;
220
+ }
221
+ export type Result = { Ok: bigint } | { Err: TransferError };
222
+ export type Result_1 = { Ok: ConsentInfo } | { Err: Icrc21Error };
223
+ export type Result_2 = { Ok: bigint } | { Err: ApproveError };
224
+ export type Result_3 = { Ok: bigint } | { Err: TransferFromError };
225
+ export interface StandardRecord {
226
+ url: string;
227
+ name: string;
228
+ }
229
+ export interface SupportedBlockType {
230
+ url: string;
231
+ block_type: string;
232
+ }
233
+ export interface Transaction {
234
+ burn: [] | [Burn];
235
+ kind: string;
236
+ mint: [] | [Mint];
237
+ approve: [] | [Approve];
238
+ timestamp: bigint;
239
+ transfer: [] | [Transfer];
240
+ }
241
+ export interface TransactionRange {
242
+ transactions: Array<Transaction>;
243
+ }
244
+ export interface Transfer {
245
+ to: Account;
246
+ fee: [] | [bigint];
247
+ from: Account;
248
+ memo: [] | [Uint8Array | number[]];
249
+ created_at_time: [] | [bigint];
250
+ amount: bigint;
251
+ spender: [] | [Account];
252
+ }
253
+ export interface TransferArg {
254
+ to: Account;
255
+ fee: [] | [bigint];
256
+ memo: [] | [Uint8Array | number[]];
257
+ from_subaccount: [] | [Uint8Array | number[]];
258
+ created_at_time: [] | [bigint];
259
+ amount: bigint;
260
+ }
261
+ export type TransferError =
262
+ | {
263
+ GenericError: { message: string; error_code: bigint };
264
+ }
265
+ | { TemporarilyUnavailable: null }
266
+ | { BadBurn: { min_burn_amount: bigint } }
267
+ | { Duplicate: { duplicate_of: bigint } }
268
+ | { BadFee: { expected_fee: bigint } }
269
+ | { CreatedInFuture: { ledger_time: bigint } }
270
+ | { TooOld: null }
271
+ | { InsufficientFunds: { balance: bigint } };
272
+ export interface TransferFromArgs {
273
+ to: Account;
274
+ fee: [] | [bigint];
275
+ spender_subaccount: [] | [Uint8Array | number[]];
276
+ from: Account;
277
+ memo: [] | [Uint8Array | number[]];
278
+ created_at_time: [] | [bigint];
279
+ amount: bigint;
280
+ }
281
+ export type TransferFromError =
282
+ | {
283
+ GenericError: { message: string; error_code: bigint };
284
+ }
285
+ | { TemporarilyUnavailable: null }
286
+ | { InsufficientAllowance: { allowance: bigint } }
287
+ | { BadBurn: { min_burn_amount: bigint } }
288
+ | { Duplicate: { duplicate_of: bigint } }
289
+ | { BadFee: { expected_fee: bigint } }
290
+ | { CreatedInFuture: { ledger_time: bigint } }
291
+ | { TooOld: null }
292
+ | { InsufficientFunds: { balance: bigint } };
293
+ export interface UpgradeArgs {
294
+ change_archive_options: [] | [ChangeArchiveOptions];
295
+ token_symbol: [] | [string];
296
+ transfer_fee: [] | [bigint];
297
+ metadata: [] | [Array<[string, MetadataValue]>];
298
+ change_fee_collector: [] | [ChangeFeeCollector];
299
+ max_memo_length: [] | [number];
300
+ token_name: [] | [string];
301
+ feature_flags: [] | [FeatureFlags];
302
+ }
303
+ export type Value =
304
+ | { Int: bigint }
305
+ | { Map: Array<[string, Value]> }
306
+ | { Nat: bigint }
307
+ | { Nat64: bigint }
308
+ | { Blob: Uint8Array | number[] }
309
+ | { Text: string }
310
+ | { Array: Vec };
311
+ export type Vec = Array<
312
+ | { Int: bigint }
313
+ | { Map: Array<[string, Value]> }
314
+ | { Nat: bigint }
315
+ | { Nat64: bigint }
316
+ | { Blob: Uint8Array | number[] }
317
+ | { Text: string }
318
+ | { Array: Vec }
319
+ >;
320
+ export interface _SERVICE {
321
+ archives: ActorMethod<[], Array<ArchiveInfo>>;
322
+ get_blocks: ActorMethod<[GetBlocksRequest], GetBlocksResponse>;
323
+ get_data_certificate: ActorMethod<[], DataCertificate>;
324
+ get_transactions: ActorMethod<[GetBlocksRequest], GetTransactionsResponse>;
325
+ icrc10_supported_standards: ActorMethod<[], Array<StandardRecord>>;
326
+ icrc1_balance_of: ActorMethod<[Account], bigint>;
327
+ icrc1_decimals: ActorMethod<[], number>;
328
+ icrc1_fee: ActorMethod<[], bigint>;
329
+ icrc1_metadata: ActorMethod<[], Array<[string, MetadataValue]>>;
330
+ icrc1_minting_account: ActorMethod<[], [] | [Account]>;
331
+ icrc1_name: ActorMethod<[], string>;
332
+ icrc1_supported_standards: ActorMethod<[], Array<StandardRecord>>;
333
+ icrc1_symbol: ActorMethod<[], string>;
334
+ icrc1_total_supply: ActorMethod<[], bigint>;
335
+ icrc1_transfer: ActorMethod<[TransferArg], Result>;
336
+ icrc21_canister_call_consent_message: ActorMethod<
337
+ [ConsentMessageRequest],
338
+ Result_1
339
+ >;
340
+ icrc2_allowance: ActorMethod<[AllowanceArgs], Allowance>;
341
+ icrc2_approve: ActorMethod<[ApproveArgs], Result_2>;
342
+ icrc2_transfer_from: ActorMethod<[TransferFromArgs], Result_3>;
343
+ icrc3_get_archives: ActorMethod<[GetArchivesArgs], Array<ICRC3ArchiveInfo>>;
344
+ icrc3_get_blocks: ActorMethod<[Array<GetBlocksRequest>], GetBlocksResult>;
345
+ icrc3_get_tip_certificate: ActorMethod<[], [] | [ICRC3DataCertificate]>;
346
+ icrc3_supported_block_types: ActorMethod<[], Array<SupportedBlockType>>;
347
+ is_ledger_ready: ActorMethod<[], boolean>;
348
+ }
349
+ export type idlFactory = IDL.InterfaceFactory;
350
+ export type init = (args: { IDL: typeof IDL }) => IDL.Type[];
351
+ export const GetBlocksResult = IDL.Rec();
352
+ export const ICRC3Value = IDL.Rec();
353
+ export const Value = IDL.Rec();
354
+ export const Vec = IDL.Rec();
355
+ export const ChangeArchiveOptions = IDL.Record({
356
+ num_blocks_to_archive: IDL.Opt(IDL.Nat64),
357
+ max_transactions_per_response: IDL.Opt(IDL.Nat64),
358
+ trigger_threshold: IDL.Opt(IDL.Nat64),
359
+ more_controller_ids: IDL.Opt(IDL.Vec(IDL.Principal)),
360
+ max_message_size_bytes: IDL.Opt(IDL.Nat64),
361
+ cycles_for_archive_creation: IDL.Opt(IDL.Nat64),
362
+ node_max_memory_size_bytes: IDL.Opt(IDL.Nat64),
363
+ controller_id: IDL.Opt(IDL.Principal)
364
+ });
365
+ export const MetadataValue = IDL.Variant({
366
+ Int: IDL.Int,
367
+ Nat: IDL.Nat,
368
+ Blob: IDL.Vec(IDL.Nat8),
369
+ Text: IDL.Text
370
+ });
371
+ export const Account = IDL.Record({
372
+ owner: IDL.Principal,
373
+ subaccount: IDL.Opt(IDL.Vec(IDL.Nat8))
374
+ });
375
+ export const ChangeFeeCollector = IDL.Variant({
376
+ SetTo: Account,
377
+ Unset: IDL.Null
378
+ });
379
+ export const FeatureFlags = IDL.Record({ icrc2: IDL.Bool });
380
+ export const UpgradeArgs = IDL.Record({
381
+ change_archive_options: IDL.Opt(ChangeArchiveOptions),
382
+ token_symbol: IDL.Opt(IDL.Text),
383
+ transfer_fee: IDL.Opt(IDL.Nat),
384
+ metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue))),
385
+ change_fee_collector: IDL.Opt(ChangeFeeCollector),
386
+ max_memo_length: IDL.Opt(IDL.Nat16),
387
+ token_name: IDL.Opt(IDL.Text),
388
+ feature_flags: IDL.Opt(FeatureFlags)
389
+ });
390
+ export const ArchiveOptions = IDL.Record({
391
+ num_blocks_to_archive: IDL.Nat64,
392
+ max_transactions_per_response: IDL.Opt(IDL.Nat64),
393
+ trigger_threshold: IDL.Nat64,
394
+ more_controller_ids: IDL.Opt(IDL.Vec(IDL.Principal)),
395
+ max_message_size_bytes: IDL.Opt(IDL.Nat64),
396
+ cycles_for_archive_creation: IDL.Opt(IDL.Nat64),
397
+ node_max_memory_size_bytes: IDL.Opt(IDL.Nat64),
398
+ controller_id: IDL.Principal
399
+ });
400
+ export const InitArgs = IDL.Record({
401
+ decimals: IDL.Opt(IDL.Nat8),
402
+ token_symbol: IDL.Text,
403
+ transfer_fee: IDL.Nat,
404
+ metadata: IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue)),
405
+ minting_account: Account,
406
+ initial_balances: IDL.Vec(IDL.Tuple(Account, IDL.Nat)),
407
+ fee_collector_account: IDL.Opt(Account),
408
+ archive_options: ArchiveOptions,
409
+ max_memo_length: IDL.Opt(IDL.Nat16),
410
+ token_name: IDL.Text,
411
+ feature_flags: IDL.Opt(FeatureFlags)
412
+ });
413
+ export const LedgerArgument = IDL.Variant({
414
+ Upgrade: IDL.Opt(UpgradeArgs),
415
+ Init: InitArgs
416
+ });
417
+ export const ArchiveInfo = IDL.Record({
418
+ block_range_end: IDL.Nat,
419
+ canister_id: IDL.Principal,
420
+ block_range_start: IDL.Nat
421
+ });
422
+ export const GetBlocksRequest = IDL.Record({
423
+ start: IDL.Nat,
424
+ length: IDL.Nat
425
+ });
426
+ Vec.fill(
427
+ IDL.Vec(
428
+ IDL.Variant({
429
+ Int: IDL.Int,
430
+ Map: IDL.Vec(IDL.Tuple(IDL.Text, Value)),
431
+ Nat: IDL.Nat,
432
+ Nat64: IDL.Nat64,
433
+ Blob: IDL.Vec(IDL.Nat8),
434
+ Text: IDL.Text,
435
+ Array: Vec
436
+ })
437
+ )
438
+ );
439
+ Value.fill(
440
+ IDL.Variant({
441
+ Int: IDL.Int,
442
+ Map: IDL.Vec(IDL.Tuple(IDL.Text, Value)),
443
+ Nat: IDL.Nat,
444
+ Nat64: IDL.Nat64,
445
+ Blob: IDL.Vec(IDL.Nat8),
446
+ Text: IDL.Text,
447
+ Array: Vec
448
+ })
449
+ );
450
+ export const BlockRange = IDL.Record({ blocks: IDL.Vec(Value) });
451
+ export const ArchivedRange = IDL.Record({
452
+ callback: IDL.Func([GetBlocksRequest], [BlockRange], ['query']),
453
+ start: IDL.Nat,
454
+ length: IDL.Nat
455
+ });
456
+ export const GetBlocksResponse = IDL.Record({
457
+ certificate: IDL.Opt(IDL.Vec(IDL.Nat8)),
458
+ first_index: IDL.Nat,
459
+ blocks: IDL.Vec(Value),
460
+ chain_length: IDL.Nat64,
461
+ archived_blocks: IDL.Vec(ArchivedRange)
462
+ });
463
+ export const DataCertificate = IDL.Record({
464
+ certificate: IDL.Opt(IDL.Vec(IDL.Nat8)),
465
+ hash_tree: IDL.Vec(IDL.Nat8)
466
+ });
467
+ export const Burn = IDL.Record({
468
+ from: Account,
469
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
470
+ created_at_time: IDL.Opt(IDL.Nat64),
471
+ amount: IDL.Nat,
472
+ spender: IDL.Opt(Account)
473
+ });
474
+ export const Mint = IDL.Record({
475
+ to: Account,
476
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
477
+ created_at_time: IDL.Opt(IDL.Nat64),
478
+ amount: IDL.Nat
479
+ });
480
+ export const Approve = IDL.Record({
481
+ fee: IDL.Opt(IDL.Nat),
482
+ from: Account,
483
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
484
+ created_at_time: IDL.Opt(IDL.Nat64),
485
+ amount: IDL.Nat,
486
+ expected_allowance: IDL.Opt(IDL.Nat),
487
+ expires_at: IDL.Opt(IDL.Nat64),
488
+ spender: Account
489
+ });
490
+ export const Transfer = IDL.Record({
491
+ to: Account,
492
+ fee: IDL.Opt(IDL.Nat),
493
+ from: Account,
494
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
495
+ created_at_time: IDL.Opt(IDL.Nat64),
496
+ amount: IDL.Nat,
497
+ spender: IDL.Opt(Account)
498
+ });
499
+ export const Transaction = IDL.Record({
500
+ burn: IDL.Opt(Burn),
501
+ kind: IDL.Text,
502
+ mint: IDL.Opt(Mint),
503
+ approve: IDL.Opt(Approve),
504
+ timestamp: IDL.Nat64,
505
+ transfer: IDL.Opt(Transfer)
506
+ });
507
+ export const TransactionRange = IDL.Record({
508
+ transactions: IDL.Vec(Transaction)
509
+ });
510
+ export const ArchivedRange_1 = IDL.Record({
511
+ callback: IDL.Func([GetBlocksRequest], [TransactionRange], ['query']),
512
+ start: IDL.Nat,
513
+ length: IDL.Nat
514
+ });
515
+ export const GetTransactionsResponse = IDL.Record({
516
+ first_index: IDL.Nat,
517
+ log_length: IDL.Nat,
518
+ transactions: IDL.Vec(Transaction),
519
+ archived_transactions: IDL.Vec(ArchivedRange_1)
520
+ });
521
+ export const StandardRecord = IDL.Record({
522
+ url: IDL.Text,
523
+ name: IDL.Text
524
+ });
525
+ export const TransferArg = IDL.Record({
526
+ to: Account,
527
+ fee: IDL.Opt(IDL.Nat),
528
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
529
+ from_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
530
+ created_at_time: IDL.Opt(IDL.Nat64),
531
+ amount: IDL.Nat
532
+ });
533
+ export const TransferError = IDL.Variant({
534
+ GenericError: IDL.Record({ message: IDL.Text, error_code: IDL.Nat }),
535
+ TemporarilyUnavailable: IDL.Null,
536
+ BadBurn: IDL.Record({ min_burn_amount: IDL.Nat }),
537
+ Duplicate: IDL.Record({ duplicate_of: IDL.Nat }),
538
+ BadFee: IDL.Record({ expected_fee: IDL.Nat }),
539
+ CreatedInFuture: IDL.Record({ ledger_time: IDL.Nat64 }),
540
+ TooOld: IDL.Null,
541
+ InsufficientFunds: IDL.Record({ balance: IDL.Nat })
542
+ });
543
+ export const Result = IDL.Variant({ Ok: IDL.Nat, Err: TransferError });
544
+ export const ConsentMessageMetadata = IDL.Record({
545
+ utc_offset_minutes: IDL.Opt(IDL.Int16),
546
+ language: IDL.Text
547
+ });
548
+ export const DisplayMessageType = IDL.Variant({
549
+ GenericDisplay: IDL.Null,
550
+ LineDisplay: IDL.Record({
551
+ characters_per_line: IDL.Nat16,
552
+ lines_per_page: IDL.Nat16
553
+ })
554
+ });
555
+ export const ConsentMessageSpec = IDL.Record({
556
+ metadata: ConsentMessageMetadata,
557
+ device_spec: IDL.Opt(DisplayMessageType)
558
+ });
559
+ export const ConsentMessageRequest = IDL.Record({
560
+ arg: IDL.Vec(IDL.Nat8),
561
+ method: IDL.Text,
562
+ user_preferences: ConsentMessageSpec
563
+ });
564
+ export const LineDisplayPage = IDL.Record({ lines: IDL.Vec(IDL.Text) });
565
+ export const ConsentMessage = IDL.Variant({
566
+ LineDisplayMessage: IDL.Record({ pages: IDL.Vec(LineDisplayPage) }),
567
+ GenericDisplayMessage: IDL.Text
568
+ });
569
+ export const ConsentInfo = IDL.Record({
570
+ metadata: ConsentMessageMetadata,
571
+ consent_message: ConsentMessage
572
+ });
573
+ export const ErrorInfo = IDL.Record({ description: IDL.Text });
574
+ export const Icrc21Error = IDL.Variant({
575
+ GenericError: IDL.Record({
576
+ description: IDL.Text,
577
+ error_code: IDL.Nat
578
+ }),
579
+ InsufficientPayment: ErrorInfo,
580
+ UnsupportedCanisterCall: ErrorInfo,
581
+ ConsentMessageUnavailable: ErrorInfo
582
+ });
583
+ export const Result_1 = IDL.Variant({
584
+ Ok: ConsentInfo,
585
+ Err: Icrc21Error
586
+ });
587
+ export const AllowanceArgs = IDL.Record({
588
+ account: Account,
589
+ spender: Account
590
+ });
591
+ export const Allowance = IDL.Record({
592
+ allowance: IDL.Nat,
593
+ expires_at: IDL.Opt(IDL.Nat64)
594
+ });
595
+ export const ApproveArgs = IDL.Record({
596
+ fee: IDL.Opt(IDL.Nat),
597
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
598
+ from_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
599
+ created_at_time: IDL.Opt(IDL.Nat64),
600
+ amount: IDL.Nat,
601
+ expected_allowance: IDL.Opt(IDL.Nat),
602
+ expires_at: IDL.Opt(IDL.Nat64),
603
+ spender: Account
604
+ });
605
+ export const ApproveError = IDL.Variant({
606
+ GenericError: IDL.Record({ message: IDL.Text, error_code: IDL.Nat }),
607
+ TemporarilyUnavailable: IDL.Null,
608
+ Duplicate: IDL.Record({ duplicate_of: IDL.Nat }),
609
+ BadFee: IDL.Record({ expected_fee: IDL.Nat }),
610
+ AllowanceChanged: IDL.Record({ current_allowance: IDL.Nat }),
611
+ CreatedInFuture: IDL.Record({ ledger_time: IDL.Nat64 }),
612
+ TooOld: IDL.Null,
613
+ Expired: IDL.Record({ ledger_time: IDL.Nat64 }),
614
+ InsufficientFunds: IDL.Record({ balance: IDL.Nat })
615
+ });
616
+ export const Result_2 = IDL.Variant({ Ok: IDL.Nat, Err: ApproveError });
617
+ export const TransferFromArgs = IDL.Record({
618
+ to: Account,
619
+ fee: IDL.Opt(IDL.Nat),
620
+ spender_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
621
+ from: Account,
622
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
623
+ created_at_time: IDL.Opt(IDL.Nat64),
624
+ amount: IDL.Nat
625
+ });
626
+ export const TransferFromError = IDL.Variant({
627
+ GenericError: IDL.Record({ message: IDL.Text, error_code: IDL.Nat }),
628
+ TemporarilyUnavailable: IDL.Null,
629
+ InsufficientAllowance: IDL.Record({ allowance: IDL.Nat }),
630
+ BadBurn: IDL.Record({ min_burn_amount: IDL.Nat }),
631
+ Duplicate: IDL.Record({ duplicate_of: IDL.Nat }),
632
+ BadFee: IDL.Record({ expected_fee: IDL.Nat }),
633
+ CreatedInFuture: IDL.Record({ ledger_time: IDL.Nat64 }),
634
+ TooOld: IDL.Null,
635
+ InsufficientFunds: IDL.Record({ balance: IDL.Nat })
636
+ });
637
+ export const Result_3 = IDL.Variant({
638
+ Ok: IDL.Nat,
639
+ Err: TransferFromError
640
+ });
641
+ export const GetArchivesArgs = IDL.Record({ from: IDL.Opt(IDL.Principal) });
642
+ export const ICRC3ArchiveInfo = IDL.Record({
643
+ end: IDL.Nat,
644
+ canister_id: IDL.Principal,
645
+ start: IDL.Nat
646
+ });
647
+ ICRC3Value.fill(
648
+ IDL.Variant({
649
+ Int: IDL.Int,
650
+ Map: IDL.Vec(IDL.Tuple(IDL.Text, ICRC3Value)),
651
+ Nat: IDL.Nat,
652
+ Blob: IDL.Vec(IDL.Nat8),
653
+ Text: IDL.Text,
654
+ Array: IDL.Vec(ICRC3Value)
655
+ })
656
+ );
657
+ export const BlockWithId = IDL.Record({ id: IDL.Nat, block: ICRC3Value });
658
+ export const ArchivedBlocks = IDL.Record({
659
+ args: IDL.Vec(GetBlocksRequest),
660
+ callback: IDL.Func(
661
+ [IDL.Vec(GetBlocksRequest)],
662
+ [GetBlocksResult],
663
+ ['query']
664
+ )
665
+ });
666
+ GetBlocksResult.fill(
667
+ IDL.Record({
668
+ log_length: IDL.Nat,
669
+ blocks: IDL.Vec(BlockWithId),
670
+ archived_blocks: IDL.Vec(ArchivedBlocks)
671
+ })
672
+ );
673
+ export const ICRC3DataCertificate = IDL.Record({
674
+ certificate: IDL.Vec(IDL.Nat8),
675
+ hash_tree: IDL.Vec(IDL.Nat8)
676
+ });
677
+ export const SupportedBlockType = IDL.Record({
678
+ url: IDL.Text,
679
+ block_type: IDL.Text
680
+ });
681
+ export const idlFactory: idlFactory = ({ IDL }) => {
682
+ const GetBlocksResult = IDL.Rec();
683
+ const ICRC3Value = IDL.Rec();
684
+ const Value = IDL.Rec();
685
+ const Vec = IDL.Rec();
686
+ const ChangeArchiveOptions = IDL.Record({
687
+ num_blocks_to_archive: IDL.Opt(IDL.Nat64),
688
+ max_transactions_per_response: IDL.Opt(IDL.Nat64),
689
+ trigger_threshold: IDL.Opt(IDL.Nat64),
690
+ more_controller_ids: IDL.Opt(IDL.Vec(IDL.Principal)),
691
+ max_message_size_bytes: IDL.Opt(IDL.Nat64),
692
+ cycles_for_archive_creation: IDL.Opt(IDL.Nat64),
693
+ node_max_memory_size_bytes: IDL.Opt(IDL.Nat64),
694
+ controller_id: IDL.Opt(IDL.Principal)
695
+ });
696
+ const MetadataValue = IDL.Variant({
697
+ Int: IDL.Int,
698
+ Nat: IDL.Nat,
699
+ Blob: IDL.Vec(IDL.Nat8),
700
+ Text: IDL.Text
701
+ });
702
+ const Account = IDL.Record({
703
+ owner: IDL.Principal,
704
+ subaccount: IDL.Opt(IDL.Vec(IDL.Nat8))
705
+ });
706
+ const ChangeFeeCollector = IDL.Variant({
707
+ SetTo: Account,
708
+ Unset: IDL.Null
709
+ });
710
+ const FeatureFlags = IDL.Record({ icrc2: IDL.Bool });
711
+ const UpgradeArgs = IDL.Record({
712
+ change_archive_options: IDL.Opt(ChangeArchiveOptions),
713
+ token_symbol: IDL.Opt(IDL.Text),
714
+ transfer_fee: IDL.Opt(IDL.Nat),
715
+ metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue))),
716
+ change_fee_collector: IDL.Opt(ChangeFeeCollector),
717
+ max_memo_length: IDL.Opt(IDL.Nat16),
718
+ token_name: IDL.Opt(IDL.Text),
719
+ feature_flags: IDL.Opt(FeatureFlags)
720
+ });
721
+ const ArchiveOptions = IDL.Record({
722
+ num_blocks_to_archive: IDL.Nat64,
723
+ max_transactions_per_response: IDL.Opt(IDL.Nat64),
724
+ trigger_threshold: IDL.Nat64,
725
+ more_controller_ids: IDL.Opt(IDL.Vec(IDL.Principal)),
726
+ max_message_size_bytes: IDL.Opt(IDL.Nat64),
727
+ cycles_for_archive_creation: IDL.Opt(IDL.Nat64),
728
+ node_max_memory_size_bytes: IDL.Opt(IDL.Nat64),
729
+ controller_id: IDL.Principal
730
+ });
731
+ const InitArgs = IDL.Record({
732
+ decimals: IDL.Opt(IDL.Nat8),
733
+ token_symbol: IDL.Text,
734
+ transfer_fee: IDL.Nat,
735
+ metadata: IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue)),
736
+ minting_account: Account,
737
+ initial_balances: IDL.Vec(IDL.Tuple(Account, IDL.Nat)),
738
+ fee_collector_account: IDL.Opt(Account),
739
+ archive_options: ArchiveOptions,
740
+ max_memo_length: IDL.Opt(IDL.Nat16),
741
+ token_name: IDL.Text,
742
+ feature_flags: IDL.Opt(FeatureFlags)
743
+ });
744
+ const LedgerArgument = IDL.Variant({
745
+ Upgrade: IDL.Opt(UpgradeArgs),
746
+ Init: InitArgs
747
+ });
748
+ const ArchiveInfo = IDL.Record({
749
+ block_range_end: IDL.Nat,
750
+ canister_id: IDL.Principal,
751
+ block_range_start: IDL.Nat
752
+ });
753
+ const GetBlocksRequest = IDL.Record({
754
+ start: IDL.Nat,
755
+ length: IDL.Nat
756
+ });
757
+ Vec.fill(
758
+ IDL.Vec(
759
+ IDL.Variant({
760
+ Int: IDL.Int,
761
+ Map: IDL.Vec(IDL.Tuple(IDL.Text, Value)),
762
+ Nat: IDL.Nat,
763
+ Nat64: IDL.Nat64,
764
+ Blob: IDL.Vec(IDL.Nat8),
765
+ Text: IDL.Text,
766
+ Array: Vec
767
+ })
768
+ )
769
+ );
770
+ Value.fill(
771
+ IDL.Variant({
772
+ Int: IDL.Int,
773
+ Map: IDL.Vec(IDL.Tuple(IDL.Text, Value)),
774
+ Nat: IDL.Nat,
775
+ Nat64: IDL.Nat64,
776
+ Blob: IDL.Vec(IDL.Nat8),
777
+ Text: IDL.Text,
778
+ Array: Vec
779
+ })
780
+ );
781
+ const BlockRange = IDL.Record({ blocks: IDL.Vec(Value) });
782
+ const ArchivedRange = IDL.Record({
783
+ callback: IDL.Func([GetBlocksRequest], [BlockRange], ['query']),
784
+ start: IDL.Nat,
785
+ length: IDL.Nat
786
+ });
787
+ const GetBlocksResponse = IDL.Record({
788
+ certificate: IDL.Opt(IDL.Vec(IDL.Nat8)),
789
+ first_index: IDL.Nat,
790
+ blocks: IDL.Vec(Value),
791
+ chain_length: IDL.Nat64,
792
+ archived_blocks: IDL.Vec(ArchivedRange)
793
+ });
794
+ const DataCertificate = IDL.Record({
795
+ certificate: IDL.Opt(IDL.Vec(IDL.Nat8)),
796
+ hash_tree: IDL.Vec(IDL.Nat8)
797
+ });
798
+ const Burn = IDL.Record({
799
+ from: Account,
800
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
801
+ created_at_time: IDL.Opt(IDL.Nat64),
802
+ amount: IDL.Nat,
803
+ spender: IDL.Opt(Account)
804
+ });
805
+ const Mint = IDL.Record({
806
+ to: Account,
807
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
808
+ created_at_time: IDL.Opt(IDL.Nat64),
809
+ amount: IDL.Nat
810
+ });
811
+ const Approve = IDL.Record({
812
+ fee: IDL.Opt(IDL.Nat),
813
+ from: Account,
814
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
815
+ created_at_time: IDL.Opt(IDL.Nat64),
816
+ amount: IDL.Nat,
817
+ expected_allowance: IDL.Opt(IDL.Nat),
818
+ expires_at: IDL.Opt(IDL.Nat64),
819
+ spender: Account
820
+ });
821
+ const Transfer = IDL.Record({
822
+ to: Account,
823
+ fee: IDL.Opt(IDL.Nat),
824
+ from: Account,
825
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
826
+ created_at_time: IDL.Opt(IDL.Nat64),
827
+ amount: IDL.Nat,
828
+ spender: IDL.Opt(Account)
829
+ });
830
+ const Transaction = IDL.Record({
831
+ burn: IDL.Opt(Burn),
832
+ kind: IDL.Text,
833
+ mint: IDL.Opt(Mint),
834
+ approve: IDL.Opt(Approve),
835
+ timestamp: IDL.Nat64,
836
+ transfer: IDL.Opt(Transfer)
837
+ });
838
+ const TransactionRange = IDL.Record({
839
+ transactions: IDL.Vec(Transaction)
840
+ });
841
+ const ArchivedRange_1 = IDL.Record({
842
+ callback: IDL.Func([GetBlocksRequest], [TransactionRange], ['query']),
843
+ start: IDL.Nat,
844
+ length: IDL.Nat
845
+ });
846
+ const GetTransactionsResponse = IDL.Record({
847
+ first_index: IDL.Nat,
848
+ log_length: IDL.Nat,
849
+ transactions: IDL.Vec(Transaction),
850
+ archived_transactions: IDL.Vec(ArchivedRange_1)
851
+ });
852
+ const StandardRecord = IDL.Record({ url: IDL.Text, name: IDL.Text });
853
+ const TransferArg = IDL.Record({
854
+ to: Account,
855
+ fee: IDL.Opt(IDL.Nat),
856
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
857
+ from_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
858
+ created_at_time: IDL.Opt(IDL.Nat64),
859
+ amount: IDL.Nat
860
+ });
861
+ const TransferError = IDL.Variant({
862
+ GenericError: IDL.Record({
863
+ message: IDL.Text,
864
+ error_code: IDL.Nat
865
+ }),
866
+ TemporarilyUnavailable: IDL.Null,
867
+ BadBurn: IDL.Record({ min_burn_amount: IDL.Nat }),
868
+ Duplicate: IDL.Record({ duplicate_of: IDL.Nat }),
869
+ BadFee: IDL.Record({ expected_fee: IDL.Nat }),
870
+ CreatedInFuture: IDL.Record({ ledger_time: IDL.Nat64 }),
871
+ TooOld: IDL.Null,
872
+ InsufficientFunds: IDL.Record({ balance: IDL.Nat })
873
+ });
874
+ const Result = IDL.Variant({ Ok: IDL.Nat, Err: TransferError });
875
+ const ConsentMessageMetadata = IDL.Record({
876
+ utc_offset_minutes: IDL.Opt(IDL.Int16),
877
+ language: IDL.Text
878
+ });
879
+ const DisplayMessageType = IDL.Variant({
880
+ GenericDisplay: IDL.Null,
881
+ LineDisplay: IDL.Record({
882
+ characters_per_line: IDL.Nat16,
883
+ lines_per_page: IDL.Nat16
884
+ })
885
+ });
886
+ const ConsentMessageSpec = IDL.Record({
887
+ metadata: ConsentMessageMetadata,
888
+ device_spec: IDL.Opt(DisplayMessageType)
889
+ });
890
+ const ConsentMessageRequest = IDL.Record({
891
+ arg: IDL.Vec(IDL.Nat8),
892
+ method: IDL.Text,
893
+ user_preferences: ConsentMessageSpec
894
+ });
895
+ const LineDisplayPage = IDL.Record({ lines: IDL.Vec(IDL.Text) });
896
+ const ConsentMessage = IDL.Variant({
897
+ LineDisplayMessage: IDL.Record({ pages: IDL.Vec(LineDisplayPage) }),
898
+ GenericDisplayMessage: IDL.Text
899
+ });
900
+ const ConsentInfo = IDL.Record({
901
+ metadata: ConsentMessageMetadata,
902
+ consent_message: ConsentMessage
903
+ });
904
+ const ErrorInfo = IDL.Record({ description: IDL.Text });
905
+ const Icrc21Error = IDL.Variant({
906
+ GenericError: IDL.Record({
907
+ description: IDL.Text,
908
+ error_code: IDL.Nat
909
+ }),
910
+ InsufficientPayment: ErrorInfo,
911
+ UnsupportedCanisterCall: ErrorInfo,
912
+ ConsentMessageUnavailable: ErrorInfo
913
+ });
914
+ const Result_1 = IDL.Variant({ Ok: ConsentInfo, Err: Icrc21Error });
915
+ const AllowanceArgs = IDL.Record({
916
+ account: Account,
917
+ spender: Account
918
+ });
919
+ const Allowance = IDL.Record({
920
+ allowance: IDL.Nat,
921
+ expires_at: IDL.Opt(IDL.Nat64)
922
+ });
923
+ const ApproveArgs = IDL.Record({
924
+ fee: IDL.Opt(IDL.Nat),
925
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
926
+ from_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
927
+ created_at_time: IDL.Opt(IDL.Nat64),
928
+ amount: IDL.Nat,
929
+ expected_allowance: IDL.Opt(IDL.Nat),
930
+ expires_at: IDL.Opt(IDL.Nat64),
931
+ spender: Account
932
+ });
933
+ const ApproveError = IDL.Variant({
934
+ GenericError: IDL.Record({
935
+ message: IDL.Text,
936
+ error_code: IDL.Nat
937
+ }),
938
+ TemporarilyUnavailable: IDL.Null,
939
+ Duplicate: IDL.Record({ duplicate_of: IDL.Nat }),
940
+ BadFee: IDL.Record({ expected_fee: IDL.Nat }),
941
+ AllowanceChanged: IDL.Record({ current_allowance: IDL.Nat }),
942
+ CreatedInFuture: IDL.Record({ ledger_time: IDL.Nat64 }),
943
+ TooOld: IDL.Null,
944
+ Expired: IDL.Record({ ledger_time: IDL.Nat64 }),
945
+ InsufficientFunds: IDL.Record({ balance: IDL.Nat })
946
+ });
947
+ const Result_2 = IDL.Variant({ Ok: IDL.Nat, Err: ApproveError });
948
+ const TransferFromArgs = IDL.Record({
949
+ to: Account,
950
+ fee: IDL.Opt(IDL.Nat),
951
+ spender_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
952
+ from: Account,
953
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
954
+ created_at_time: IDL.Opt(IDL.Nat64),
955
+ amount: IDL.Nat
956
+ });
957
+ const TransferFromError = IDL.Variant({
958
+ GenericError: IDL.Record({
959
+ message: IDL.Text,
960
+ error_code: IDL.Nat
961
+ }),
962
+ TemporarilyUnavailable: IDL.Null,
963
+ InsufficientAllowance: IDL.Record({ allowance: IDL.Nat }),
964
+ BadBurn: IDL.Record({ min_burn_amount: IDL.Nat }),
965
+ Duplicate: IDL.Record({ duplicate_of: IDL.Nat }),
966
+ BadFee: IDL.Record({ expected_fee: IDL.Nat }),
967
+ CreatedInFuture: IDL.Record({ ledger_time: IDL.Nat64 }),
968
+ TooOld: IDL.Null,
969
+ InsufficientFunds: IDL.Record({ balance: IDL.Nat })
970
+ });
971
+ const Result_3 = IDL.Variant({ Ok: IDL.Nat, Err: TransferFromError });
972
+ const GetArchivesArgs = IDL.Record({ from: IDL.Opt(IDL.Principal) });
973
+ const ICRC3ArchiveInfo = IDL.Record({
974
+ end: IDL.Nat,
975
+ canister_id: IDL.Principal,
976
+ start: IDL.Nat
977
+ });
978
+ ICRC3Value.fill(
979
+ IDL.Variant({
980
+ Int: IDL.Int,
981
+ Map: IDL.Vec(IDL.Tuple(IDL.Text, ICRC3Value)),
982
+ Nat: IDL.Nat,
983
+ Blob: IDL.Vec(IDL.Nat8),
984
+ Text: IDL.Text,
985
+ Array: IDL.Vec(ICRC3Value)
986
+ })
987
+ );
988
+ const BlockWithId = IDL.Record({ id: IDL.Nat, block: ICRC3Value });
989
+ const ArchivedBlocks = IDL.Record({
990
+ args: IDL.Vec(GetBlocksRequest),
991
+ callback: IDL.Func(
992
+ [IDL.Vec(GetBlocksRequest)],
993
+ [GetBlocksResult],
994
+ ['query']
995
+ )
996
+ });
997
+ GetBlocksResult.fill(
998
+ IDL.Record({
999
+ log_length: IDL.Nat,
1000
+ blocks: IDL.Vec(BlockWithId),
1001
+ archived_blocks: IDL.Vec(ArchivedBlocks)
1002
+ })
1003
+ );
1004
+ const ICRC3DataCertificate = IDL.Record({
1005
+ certificate: IDL.Vec(IDL.Nat8),
1006
+ hash_tree: IDL.Vec(IDL.Nat8)
1007
+ });
1008
+ const SupportedBlockType = IDL.Record({
1009
+ url: IDL.Text,
1010
+ block_type: IDL.Text
1011
+ });
1012
+ return IDL.Service({
1013
+ archives: IDL.Func([], [IDL.Vec(ArchiveInfo)], ['query']),
1014
+ get_blocks: IDL.Func(
1015
+ [GetBlocksRequest],
1016
+ [GetBlocksResponse],
1017
+ ['query']
1018
+ ),
1019
+ get_data_certificate: IDL.Func([], [DataCertificate], ['query']),
1020
+ get_transactions: IDL.Func(
1021
+ [GetBlocksRequest],
1022
+ [GetTransactionsResponse],
1023
+ ['query']
1024
+ ),
1025
+ icrc10_supported_standards: IDL.Func(
1026
+ [],
1027
+ [IDL.Vec(StandardRecord)],
1028
+ ['query']
1029
+ ),
1030
+ icrc1_balance_of: IDL.Func([Account], [IDL.Nat], ['query']),
1031
+ icrc1_decimals: IDL.Func([], [IDL.Nat8], ['query']),
1032
+ icrc1_fee: IDL.Func([], [IDL.Nat], ['query']),
1033
+ icrc1_metadata: IDL.Func(
1034
+ [],
1035
+ [IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue))],
1036
+ ['query']
1037
+ ),
1038
+ icrc1_minting_account: IDL.Func([], [IDL.Opt(Account)], ['query']),
1039
+ icrc1_name: IDL.Func([], [IDL.Text], ['query']),
1040
+ icrc1_supported_standards: IDL.Func(
1041
+ [],
1042
+ [IDL.Vec(StandardRecord)],
1043
+ ['query']
1044
+ ),
1045
+ icrc1_symbol: IDL.Func([], [IDL.Text], ['query']),
1046
+ icrc1_total_supply: IDL.Func([], [IDL.Nat], ['query']),
1047
+ icrc1_transfer: IDL.Func([TransferArg], [Result], []),
1048
+ icrc21_canister_call_consent_message: IDL.Func(
1049
+ [ConsentMessageRequest],
1050
+ [Result_1],
1051
+ []
1052
+ ),
1053
+ icrc2_allowance: IDL.Func([AllowanceArgs], [Allowance], ['query']),
1054
+ icrc2_approve: IDL.Func([ApproveArgs], [Result_2], []),
1055
+ icrc2_transfer_from: IDL.Func([TransferFromArgs], [Result_3], []),
1056
+ icrc3_get_archives: IDL.Func(
1057
+ [GetArchivesArgs],
1058
+ [IDL.Vec(ICRC3ArchiveInfo)],
1059
+ ['query']
1060
+ ),
1061
+ icrc3_get_blocks: IDL.Func(
1062
+ [IDL.Vec(GetBlocksRequest)],
1063
+ [GetBlocksResult],
1064
+ ['query']
1065
+ ),
1066
+ icrc3_get_tip_certificate: IDL.Func(
1067
+ [],
1068
+ [IDL.Opt(ICRC3DataCertificate)],
1069
+ ['query']
1070
+ ),
1071
+ icrc3_supported_block_types: IDL.Func(
1072
+ [],
1073
+ [IDL.Vec(SupportedBlockType)],
1074
+ ['query']
1075
+ ),
1076
+ is_ledger_ready: IDL.Func([], [IDL.Bool], ['query'])
1077
+ });
1078
+ };
1079
+ export const init: init = ({ IDL }) => {
1080
+ const ChangeArchiveOptions = IDL.Record({
1081
+ num_blocks_to_archive: IDL.Opt(IDL.Nat64),
1082
+ max_transactions_per_response: IDL.Opt(IDL.Nat64),
1083
+ trigger_threshold: IDL.Opt(IDL.Nat64),
1084
+ more_controller_ids: IDL.Opt(IDL.Vec(IDL.Principal)),
1085
+ max_message_size_bytes: IDL.Opt(IDL.Nat64),
1086
+ cycles_for_archive_creation: IDL.Opt(IDL.Nat64),
1087
+ node_max_memory_size_bytes: IDL.Opt(IDL.Nat64),
1088
+ controller_id: IDL.Opt(IDL.Principal)
1089
+ });
1090
+ const MetadataValue = IDL.Variant({
1091
+ Int: IDL.Int,
1092
+ Nat: IDL.Nat,
1093
+ Blob: IDL.Vec(IDL.Nat8),
1094
+ Text: IDL.Text
1095
+ });
1096
+ const Account = IDL.Record({
1097
+ owner: IDL.Principal,
1098
+ subaccount: IDL.Opt(IDL.Vec(IDL.Nat8))
1099
+ });
1100
+ const ChangeFeeCollector = IDL.Variant({
1101
+ SetTo: Account,
1102
+ Unset: IDL.Null
1103
+ });
1104
+ const FeatureFlags = IDL.Record({ icrc2: IDL.Bool });
1105
+ const UpgradeArgs = IDL.Record({
1106
+ change_archive_options: IDL.Opt(ChangeArchiveOptions),
1107
+ token_symbol: IDL.Opt(IDL.Text),
1108
+ transfer_fee: IDL.Opt(IDL.Nat),
1109
+ metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue))),
1110
+ change_fee_collector: IDL.Opt(ChangeFeeCollector),
1111
+ max_memo_length: IDL.Opt(IDL.Nat16),
1112
+ token_name: IDL.Opt(IDL.Text),
1113
+ feature_flags: IDL.Opt(FeatureFlags)
1114
+ });
1115
+ const ArchiveOptions = IDL.Record({
1116
+ num_blocks_to_archive: IDL.Nat64,
1117
+ max_transactions_per_response: IDL.Opt(IDL.Nat64),
1118
+ trigger_threshold: IDL.Nat64,
1119
+ more_controller_ids: IDL.Opt(IDL.Vec(IDL.Principal)),
1120
+ max_message_size_bytes: IDL.Opt(IDL.Nat64),
1121
+ cycles_for_archive_creation: IDL.Opt(IDL.Nat64),
1122
+ node_max_memory_size_bytes: IDL.Opt(IDL.Nat64),
1123
+ controller_id: IDL.Principal
1124
+ });
1125
+ const InitArgs = IDL.Record({
1126
+ decimals: IDL.Opt(IDL.Nat8),
1127
+ token_symbol: IDL.Text,
1128
+ transfer_fee: IDL.Nat,
1129
+ metadata: IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue)),
1130
+ minting_account: Account,
1131
+ initial_balances: IDL.Vec(IDL.Tuple(Account, IDL.Nat)),
1132
+ fee_collector_account: IDL.Opt(Account),
1133
+ archive_options: ArchiveOptions,
1134
+ max_memo_length: IDL.Opt(IDL.Nat16),
1135
+ token_name: IDL.Text,
1136
+ feature_flags: IDL.Opt(FeatureFlags)
1137
+ });
1138
+ const LedgerArgument = IDL.Variant({
1139
+ Upgrade: IDL.Opt(UpgradeArgs),
1140
+ Init: InitArgs
1141
+ });
1142
+ return [LedgerArgument];
1143
+ };