@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,1020 @@
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 AccountBalanceArgs {
10
+ account: string;
11
+ }
12
+ export interface AccountIdentifierByteBuf {
13
+ account: Uint8Array | number[];
14
+ }
15
+ export interface Allowance {
16
+ allowance: bigint;
17
+ expires_at: [] | [bigint];
18
+ }
19
+ export interface AllowanceArgs {
20
+ account: Account;
21
+ spender: Account;
22
+ }
23
+ export interface ApproveArgs {
24
+ fee: [] | [bigint];
25
+ memo: [] | [Uint8Array | number[]];
26
+ from_subaccount: [] | [Uint8Array | number[]];
27
+ created_at_time: [] | [bigint];
28
+ amount: bigint;
29
+ expected_allowance: [] | [bigint];
30
+ expires_at: [] | [bigint];
31
+ spender: Account;
32
+ }
33
+ export type ApproveError =
34
+ | {
35
+ GenericError: { message: string; error_code: bigint };
36
+ }
37
+ | { TemporarilyUnavailable: null }
38
+ | { Duplicate: { duplicate_of: bigint } }
39
+ | { BadFee: { expected_fee: bigint } }
40
+ | { AllowanceChanged: { current_allowance: bigint } }
41
+ | { CreatedInFuture: { ledger_time: bigint } }
42
+ | { TooOld: null }
43
+ | { Expired: { ledger_time: bigint } }
44
+ | { InsufficientFunds: { balance: bigint } };
45
+ export interface ArchiveInfo {
46
+ canister_id: Principal;
47
+ }
48
+ export interface ArchiveOptions {
49
+ num_blocks_to_archive: bigint;
50
+ max_transactions_per_response: [] | [bigint];
51
+ trigger_threshold: bigint;
52
+ more_controller_ids: [] | [Array<Principal>];
53
+ max_message_size_bytes: [] | [bigint];
54
+ cycles_for_archive_creation: [] | [bigint];
55
+ node_max_memory_size_bytes: [] | [bigint];
56
+ controller_id: Principal;
57
+ }
58
+ export interface ArchivedBlocksRange {
59
+ callback: [Principal, string];
60
+ start: bigint;
61
+ length: bigint;
62
+ }
63
+ export interface ArchivedEncodedBlocksRange {
64
+ callback: [Principal, string];
65
+ start: bigint;
66
+ length: bigint;
67
+ }
68
+ export interface Archives {
69
+ archives: Array<ArchiveInfo>;
70
+ }
71
+ export interface BlockRange {
72
+ blocks: Array<CandidBlock>;
73
+ }
74
+ export interface CandidBlock {
75
+ transaction: CandidTransaction;
76
+ timestamp: TimeStamp;
77
+ parent_hash: [] | [Uint8Array | number[]];
78
+ }
79
+ export type CandidOperation =
80
+ | {
81
+ Approve: {
82
+ fee: Tokens;
83
+ from: Uint8Array | number[];
84
+ allowance_e8s: bigint;
85
+ allowance: Tokens;
86
+ expected_allowance: [] | [Tokens];
87
+ expires_at: [] | [TimeStamp];
88
+ spender: Uint8Array | number[];
89
+ };
90
+ }
91
+ | {
92
+ Burn: {
93
+ from: Uint8Array | number[];
94
+ amount: Tokens;
95
+ spender: [] | [Uint8Array | number[]];
96
+ };
97
+ }
98
+ | { Mint: { to: Uint8Array | number[]; amount: Tokens } }
99
+ | {
100
+ Transfer: {
101
+ to: Uint8Array | number[];
102
+ fee: Tokens;
103
+ from: Uint8Array | number[];
104
+ amount: Tokens;
105
+ spender: [] | [Uint8Array | number[]];
106
+ };
107
+ };
108
+ export interface CandidTransaction {
109
+ memo: bigint;
110
+ icrc1_memo: [] | [Uint8Array | number[]];
111
+ operation: [] | [CandidOperation];
112
+ created_at_time: TimeStamp;
113
+ }
114
+ export interface ConsentInfo {
115
+ metadata: ConsentMessageMetadata;
116
+ consent_message: ConsentMessage;
117
+ }
118
+ export type ConsentMessage =
119
+ | {
120
+ LineDisplayMessage: { pages: Array<LineDisplayPage> };
121
+ }
122
+ | { GenericDisplayMessage: string };
123
+ export interface ConsentMessageMetadata {
124
+ utc_offset_minutes: [] | [number];
125
+ language: string;
126
+ }
127
+ export interface ConsentMessageRequest {
128
+ arg: Uint8Array | number[];
129
+ method: string;
130
+ user_preferences: ConsentMessageSpec;
131
+ }
132
+ export interface ConsentMessageSpec {
133
+ metadata: ConsentMessageMetadata;
134
+ device_spec: [] | [DisplayMessageType];
135
+ }
136
+ export interface Decimals {
137
+ decimals: number;
138
+ }
139
+ export type DisplayMessageType =
140
+ | { GenericDisplay: null }
141
+ | {
142
+ LineDisplay: {
143
+ characters_per_line: number;
144
+ lines_per_page: number;
145
+ };
146
+ };
147
+ export interface Duration {
148
+ secs: bigint;
149
+ nanos: number;
150
+ }
151
+ export interface ErrorInfo {
152
+ description: string;
153
+ }
154
+ export interface FeatureFlags {
155
+ icrc2: boolean;
156
+ }
157
+ export interface GetBlocksArgs {
158
+ start: bigint;
159
+ length: bigint;
160
+ }
161
+ export type GetBlocksError =
162
+ | {
163
+ BadFirstBlockIndex: {
164
+ requested_index: bigint;
165
+ first_valid_index: bigint;
166
+ };
167
+ }
168
+ | { Other: { error_message: string; error_code: bigint } };
169
+ export type Icrc21Error =
170
+ | {
171
+ GenericError: { description: string; error_code: bigint };
172
+ }
173
+ | { InsufficientPayment: ErrorInfo }
174
+ | { UnsupportedCanisterCall: ErrorInfo }
175
+ | { ConsentMessageUnavailable: ErrorInfo };
176
+ export interface InitArgs {
177
+ send_whitelist: Array<Principal>;
178
+ token_symbol: [] | [string];
179
+ transfer_fee: [] | [Tokens];
180
+ minting_account: string;
181
+ transaction_window: [] | [Duration];
182
+ max_message_size_bytes: [] | [bigint];
183
+ icrc1_minting_account: [] | [Account];
184
+ archive_options: [] | [ArchiveOptions];
185
+ initial_values: Array<[string, Tokens]>;
186
+ token_name: [] | [string];
187
+ feature_flags: [] | [FeatureFlags];
188
+ }
189
+ export type LedgerCanisterPayload =
190
+ | { Upgrade: [] | [UpgradeArgs] }
191
+ | { Init: InitArgs };
192
+ export interface LineDisplayPage {
193
+ lines: Array<string>;
194
+ }
195
+ export type MetadataValue =
196
+ | { Int: bigint }
197
+ | { Nat: bigint }
198
+ | { Blob: Uint8Array | number[] }
199
+ | { Text: string };
200
+ export interface Name {
201
+ name: string;
202
+ }
203
+ export interface QueryBlocksResponse {
204
+ certificate: [] | [Uint8Array | number[]];
205
+ blocks: Array<CandidBlock>;
206
+ chain_length: bigint;
207
+ first_block_index: bigint;
208
+ archived_blocks: Array<ArchivedBlocksRange>;
209
+ }
210
+ export interface QueryEncodedBlocksResponse {
211
+ certificate: [] | [Uint8Array | number[]];
212
+ blocks: Array<Uint8Array | number[]>;
213
+ chain_length: bigint;
214
+ first_block_index: bigint;
215
+ archived_blocks: Array<ArchivedEncodedBlocksRange>;
216
+ }
217
+ export type Result = { Ok: bigint } | { Err: TransferError };
218
+ export type Result_1 = { Ok: ConsentInfo } | { Err: Icrc21Error };
219
+ export type Result_2 = { Ok: bigint } | { Err: ApproveError };
220
+ export type Result_3 = { Ok: bigint } | { Err: TransferFromError };
221
+ export type Result_4 = { Ok: BlockRange } | { Err: GetBlocksError };
222
+ export type Result_5 =
223
+ | { Ok: Array<Uint8Array | number[]> }
224
+ | { Err: GetBlocksError };
225
+ export type Result_6 = { Ok: bigint } | { Err: TransferError_1 };
226
+ export interface SendArgs {
227
+ to: string;
228
+ fee: Tokens;
229
+ memo: bigint;
230
+ from_subaccount: [] | [Uint8Array | number[]];
231
+ created_at_time: [] | [TimeStamp];
232
+ amount: Tokens;
233
+ }
234
+ export interface StandardRecord {
235
+ url: string;
236
+ name: string;
237
+ }
238
+ export interface Symbol {
239
+ symbol: string;
240
+ }
241
+ export interface TimeStamp {
242
+ timestamp_nanos: bigint;
243
+ }
244
+ export interface Tokens {
245
+ e8s: bigint;
246
+ }
247
+ export interface TransferArg {
248
+ to: Account;
249
+ fee: [] | [bigint];
250
+ memo: [] | [Uint8Array | number[]];
251
+ from_subaccount: [] | [Uint8Array | number[]];
252
+ created_at_time: [] | [bigint];
253
+ amount: bigint;
254
+ }
255
+ export interface TransferArgs {
256
+ to: Uint8Array | number[];
257
+ fee: Tokens;
258
+ memo: bigint;
259
+ from_subaccount: [] | [Uint8Array | number[]];
260
+ created_at_time: [] | [TimeStamp];
261
+ amount: Tokens;
262
+ }
263
+ export type TransferError =
264
+ | {
265
+ GenericError: { message: string; error_code: bigint };
266
+ }
267
+ | { TemporarilyUnavailable: null }
268
+ | { BadBurn: { min_burn_amount: bigint } }
269
+ | { Duplicate: { duplicate_of: bigint } }
270
+ | { BadFee: { expected_fee: bigint } }
271
+ | { CreatedInFuture: { ledger_time: bigint } }
272
+ | { TooOld: null }
273
+ | { InsufficientFunds: { balance: bigint } };
274
+ export type TransferError_1 =
275
+ | {
276
+ TxTooOld: { allowed_window_nanos: bigint };
277
+ }
278
+ | { BadFee: { expected_fee: Tokens } }
279
+ | { TxDuplicate: { duplicate_of: bigint } }
280
+ | { TxCreatedInFuture: null }
281
+ | { InsufficientFunds: { balance: Tokens } };
282
+ export interface TransferFee {
283
+ transfer_fee: Tokens;
284
+ }
285
+ export interface TransferFromArgs {
286
+ to: Account;
287
+ fee: [] | [bigint];
288
+ spender_subaccount: [] | [Uint8Array | number[]];
289
+ from: Account;
290
+ memo: [] | [Uint8Array | number[]];
291
+ created_at_time: [] | [bigint];
292
+ amount: bigint;
293
+ }
294
+ export type TransferFromError =
295
+ | {
296
+ GenericError: { message: string; error_code: bigint };
297
+ }
298
+ | { TemporarilyUnavailable: null }
299
+ | { InsufficientAllowance: { allowance: bigint } }
300
+ | { BadBurn: { min_burn_amount: bigint } }
301
+ | { Duplicate: { duplicate_of: bigint } }
302
+ | { BadFee: { expected_fee: bigint } }
303
+ | { CreatedInFuture: { ledger_time: bigint } }
304
+ | { TooOld: null }
305
+ | { InsufficientFunds: { balance: bigint } };
306
+ export interface UpgradeArgs {
307
+ icrc1_minting_account: [] | [Account];
308
+ feature_flags: [] | [FeatureFlags];
309
+ }
310
+ export interface _SERVICE {
311
+ account_balance: ActorMethod<[AccountIdentifierByteBuf], Tokens>;
312
+ account_balance_dfx: ActorMethod<[AccountBalanceArgs], Tokens>;
313
+ account_identifier: ActorMethod<[Account], Uint8Array | number[]>;
314
+ archives: ActorMethod<[], Archives>;
315
+ decimals: ActorMethod<[], Decimals>;
316
+ icrc10_supported_standards: ActorMethod<[], Array<StandardRecord>>;
317
+ icrc1_balance_of: ActorMethod<[Account], bigint>;
318
+ icrc1_decimals: ActorMethod<[], number>;
319
+ icrc1_fee: ActorMethod<[], bigint>;
320
+ icrc1_metadata: ActorMethod<[], Array<[string, MetadataValue]>>;
321
+ icrc1_minting_account: ActorMethod<[], [] | [Account]>;
322
+ icrc1_name: ActorMethod<[], string>;
323
+ icrc1_supported_standards: ActorMethod<[], Array<StandardRecord>>;
324
+ icrc1_symbol: ActorMethod<[], string>;
325
+ icrc1_total_supply: ActorMethod<[], bigint>;
326
+ icrc1_transfer: ActorMethod<[TransferArg], Result>;
327
+ icrc21_canister_call_consent_message: ActorMethod<
328
+ [ConsentMessageRequest],
329
+ Result_1
330
+ >;
331
+ icrc2_allowance: ActorMethod<[AllowanceArgs], Allowance>;
332
+ icrc2_approve: ActorMethod<[ApproveArgs], Result_2>;
333
+ icrc2_transfer_from: ActorMethod<[TransferFromArgs], Result_3>;
334
+ is_ledger_ready: ActorMethod<[], boolean>;
335
+ name: ActorMethod<[], Name>;
336
+ query_blocks: ActorMethod<[GetBlocksArgs], QueryBlocksResponse>;
337
+ query_encoded_blocks: ActorMethod<
338
+ [GetBlocksArgs],
339
+ QueryEncodedBlocksResponse
340
+ >;
341
+ send_dfx: ActorMethod<[SendArgs], bigint>;
342
+ symbol: ActorMethod<[], Symbol>;
343
+ transfer: ActorMethod<[TransferArgs], Result_6>;
344
+ transfer_fee: ActorMethod<[{}], TransferFee>;
345
+ }
346
+ export type idlFactory = IDL.InterfaceFactory;
347
+ export type init = (args: { IDL: typeof IDL }) => IDL.Type[];
348
+ export const Account = IDL.Record({
349
+ owner: IDL.Principal,
350
+ subaccount: IDL.Opt(IDL.Vec(IDL.Nat8))
351
+ });
352
+ export const FeatureFlags = IDL.Record({ icrc2: IDL.Bool });
353
+ export const UpgradeArgs = IDL.Record({
354
+ icrc1_minting_account: IDL.Opt(Account),
355
+ feature_flags: IDL.Opt(FeatureFlags)
356
+ });
357
+ export const Tokens = IDL.Record({ e8s: IDL.Nat64 });
358
+ export const Duration = IDL.Record({ secs: IDL.Nat64, nanos: IDL.Nat32 });
359
+ export const ArchiveOptions = IDL.Record({
360
+ num_blocks_to_archive: IDL.Nat64,
361
+ max_transactions_per_response: IDL.Opt(IDL.Nat64),
362
+ trigger_threshold: IDL.Nat64,
363
+ more_controller_ids: IDL.Opt(IDL.Vec(IDL.Principal)),
364
+ max_message_size_bytes: IDL.Opt(IDL.Nat64),
365
+ cycles_for_archive_creation: IDL.Opt(IDL.Nat64),
366
+ node_max_memory_size_bytes: IDL.Opt(IDL.Nat64),
367
+ controller_id: IDL.Principal
368
+ });
369
+ export const InitArgs = IDL.Record({
370
+ send_whitelist: IDL.Vec(IDL.Principal),
371
+ token_symbol: IDL.Opt(IDL.Text),
372
+ transfer_fee: IDL.Opt(Tokens),
373
+ minting_account: IDL.Text,
374
+ transaction_window: IDL.Opt(Duration),
375
+ max_message_size_bytes: IDL.Opt(IDL.Nat64),
376
+ icrc1_minting_account: IDL.Opt(Account),
377
+ archive_options: IDL.Opt(ArchiveOptions),
378
+ initial_values: IDL.Vec(IDL.Tuple(IDL.Text, Tokens)),
379
+ token_name: IDL.Opt(IDL.Text),
380
+ feature_flags: IDL.Opt(FeatureFlags)
381
+ });
382
+ export const LedgerCanisterPayload = IDL.Variant({
383
+ Upgrade: IDL.Opt(UpgradeArgs),
384
+ Init: InitArgs
385
+ });
386
+ export const AccountIdentifierByteBuf = IDL.Record({
387
+ account: IDL.Vec(IDL.Nat8)
388
+ });
389
+ export const AccountBalanceArgs = IDL.Record({ account: IDL.Text });
390
+ export const ArchiveInfo = IDL.Record({ canister_id: IDL.Principal });
391
+ export const Archives = IDL.Record({ archives: IDL.Vec(ArchiveInfo) });
392
+ export const Decimals = IDL.Record({ decimals: IDL.Nat32 });
393
+ export const StandardRecord = IDL.Record({
394
+ url: IDL.Text,
395
+ name: IDL.Text
396
+ });
397
+ export const MetadataValue = IDL.Variant({
398
+ Int: IDL.Int,
399
+ Nat: IDL.Nat,
400
+ Blob: IDL.Vec(IDL.Nat8),
401
+ Text: IDL.Text
402
+ });
403
+ export const TransferArg = IDL.Record({
404
+ to: Account,
405
+ fee: IDL.Opt(IDL.Nat),
406
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
407
+ from_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
408
+ created_at_time: IDL.Opt(IDL.Nat64),
409
+ amount: IDL.Nat
410
+ });
411
+ export const TransferError = IDL.Variant({
412
+ GenericError: IDL.Record({ message: IDL.Text, error_code: IDL.Nat }),
413
+ TemporarilyUnavailable: IDL.Null,
414
+ BadBurn: IDL.Record({ min_burn_amount: IDL.Nat }),
415
+ Duplicate: IDL.Record({ duplicate_of: IDL.Nat }),
416
+ BadFee: IDL.Record({ expected_fee: IDL.Nat }),
417
+ CreatedInFuture: IDL.Record({ ledger_time: IDL.Nat64 }),
418
+ TooOld: IDL.Null,
419
+ InsufficientFunds: IDL.Record({ balance: IDL.Nat })
420
+ });
421
+ export const Result = IDL.Variant({ Ok: IDL.Nat, Err: TransferError });
422
+ export const ConsentMessageMetadata = IDL.Record({
423
+ utc_offset_minutes: IDL.Opt(IDL.Int16),
424
+ language: IDL.Text
425
+ });
426
+ export const DisplayMessageType = IDL.Variant({
427
+ GenericDisplay: IDL.Null,
428
+ LineDisplay: IDL.Record({
429
+ characters_per_line: IDL.Nat16,
430
+ lines_per_page: IDL.Nat16
431
+ })
432
+ });
433
+ export const ConsentMessageSpec = IDL.Record({
434
+ metadata: ConsentMessageMetadata,
435
+ device_spec: IDL.Opt(DisplayMessageType)
436
+ });
437
+ export const ConsentMessageRequest = IDL.Record({
438
+ arg: IDL.Vec(IDL.Nat8),
439
+ method: IDL.Text,
440
+ user_preferences: ConsentMessageSpec
441
+ });
442
+ export const LineDisplayPage = IDL.Record({ lines: IDL.Vec(IDL.Text) });
443
+ export const ConsentMessage = IDL.Variant({
444
+ LineDisplayMessage: IDL.Record({ pages: IDL.Vec(LineDisplayPage) }),
445
+ GenericDisplayMessage: IDL.Text
446
+ });
447
+ export const ConsentInfo = IDL.Record({
448
+ metadata: ConsentMessageMetadata,
449
+ consent_message: ConsentMessage
450
+ });
451
+ export const ErrorInfo = IDL.Record({ description: IDL.Text });
452
+ export const Icrc21Error = IDL.Variant({
453
+ GenericError: IDL.Record({
454
+ description: IDL.Text,
455
+ error_code: IDL.Nat
456
+ }),
457
+ InsufficientPayment: ErrorInfo,
458
+ UnsupportedCanisterCall: ErrorInfo,
459
+ ConsentMessageUnavailable: ErrorInfo
460
+ });
461
+ export const Result_1 = IDL.Variant({
462
+ Ok: ConsentInfo,
463
+ Err: Icrc21Error
464
+ });
465
+ export const AllowanceArgs = IDL.Record({
466
+ account: Account,
467
+ spender: Account
468
+ });
469
+ export const Allowance = IDL.Record({
470
+ allowance: IDL.Nat,
471
+ expires_at: IDL.Opt(IDL.Nat64)
472
+ });
473
+ export const ApproveArgs = IDL.Record({
474
+ fee: IDL.Opt(IDL.Nat),
475
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
476
+ from_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
477
+ created_at_time: IDL.Opt(IDL.Nat64),
478
+ amount: IDL.Nat,
479
+ expected_allowance: IDL.Opt(IDL.Nat),
480
+ expires_at: IDL.Opt(IDL.Nat64),
481
+ spender: Account
482
+ });
483
+ export const ApproveError = IDL.Variant({
484
+ GenericError: IDL.Record({ message: IDL.Text, error_code: IDL.Nat }),
485
+ TemporarilyUnavailable: IDL.Null,
486
+ Duplicate: IDL.Record({ duplicate_of: IDL.Nat }),
487
+ BadFee: IDL.Record({ expected_fee: IDL.Nat }),
488
+ AllowanceChanged: IDL.Record({ current_allowance: IDL.Nat }),
489
+ CreatedInFuture: IDL.Record({ ledger_time: IDL.Nat64 }),
490
+ TooOld: IDL.Null,
491
+ Expired: IDL.Record({ ledger_time: IDL.Nat64 }),
492
+ InsufficientFunds: IDL.Record({ balance: IDL.Nat })
493
+ });
494
+ export const Result_2 = IDL.Variant({ Ok: IDL.Nat, Err: ApproveError });
495
+ export const TransferFromArgs = IDL.Record({
496
+ to: Account,
497
+ fee: IDL.Opt(IDL.Nat),
498
+ spender_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
499
+ from: Account,
500
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
501
+ created_at_time: IDL.Opt(IDL.Nat64),
502
+ amount: IDL.Nat
503
+ });
504
+ export const TransferFromError = IDL.Variant({
505
+ GenericError: IDL.Record({ message: IDL.Text, error_code: IDL.Nat }),
506
+ TemporarilyUnavailable: IDL.Null,
507
+ InsufficientAllowance: IDL.Record({ allowance: IDL.Nat }),
508
+ BadBurn: IDL.Record({ min_burn_amount: IDL.Nat }),
509
+ Duplicate: IDL.Record({ duplicate_of: IDL.Nat }),
510
+ BadFee: IDL.Record({ expected_fee: IDL.Nat }),
511
+ CreatedInFuture: IDL.Record({ ledger_time: IDL.Nat64 }),
512
+ TooOld: IDL.Null,
513
+ InsufficientFunds: IDL.Record({ balance: IDL.Nat })
514
+ });
515
+ export const Result_3 = IDL.Variant({
516
+ Ok: IDL.Nat,
517
+ Err: TransferFromError
518
+ });
519
+ export const Name = IDL.Record({ name: IDL.Text });
520
+ export const GetBlocksArgs = IDL.Record({
521
+ start: IDL.Nat64,
522
+ length: IDL.Nat64
523
+ });
524
+ export const TimeStamp = IDL.Record({ timestamp_nanos: IDL.Nat64 });
525
+ export const CandidOperation = IDL.Variant({
526
+ Approve: IDL.Record({
527
+ fee: Tokens,
528
+ from: IDL.Vec(IDL.Nat8),
529
+ allowance_e8s: IDL.Int,
530
+ allowance: Tokens,
531
+ expected_allowance: IDL.Opt(Tokens),
532
+ expires_at: IDL.Opt(TimeStamp),
533
+ spender: IDL.Vec(IDL.Nat8)
534
+ }),
535
+ Burn: IDL.Record({
536
+ from: IDL.Vec(IDL.Nat8),
537
+ amount: Tokens,
538
+ spender: IDL.Opt(IDL.Vec(IDL.Nat8))
539
+ }),
540
+ Mint: IDL.Record({ to: IDL.Vec(IDL.Nat8), amount: Tokens }),
541
+ Transfer: IDL.Record({
542
+ to: IDL.Vec(IDL.Nat8),
543
+ fee: Tokens,
544
+ from: IDL.Vec(IDL.Nat8),
545
+ amount: Tokens,
546
+ spender: IDL.Opt(IDL.Vec(IDL.Nat8))
547
+ })
548
+ });
549
+ export const CandidTransaction = IDL.Record({
550
+ memo: IDL.Nat64,
551
+ icrc1_memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
552
+ operation: IDL.Opt(CandidOperation),
553
+ created_at_time: TimeStamp
554
+ });
555
+ export const CandidBlock = IDL.Record({
556
+ transaction: CandidTransaction,
557
+ timestamp: TimeStamp,
558
+ parent_hash: IDL.Opt(IDL.Vec(IDL.Nat8))
559
+ });
560
+ export const BlockRange = IDL.Record({ blocks: IDL.Vec(CandidBlock) });
561
+ export const GetBlocksError = IDL.Variant({
562
+ BadFirstBlockIndex: IDL.Record({
563
+ requested_index: IDL.Nat64,
564
+ first_valid_index: IDL.Nat64
565
+ }),
566
+ Other: IDL.Record({
567
+ error_message: IDL.Text,
568
+ error_code: IDL.Nat64
569
+ })
570
+ });
571
+ export const Result_4 = IDL.Variant({
572
+ Ok: BlockRange,
573
+ Err: GetBlocksError
574
+ });
575
+ export const ArchivedBlocksRange = IDL.Record({
576
+ callback: IDL.Func([GetBlocksArgs], [Result_4], ['query']),
577
+ start: IDL.Nat64,
578
+ length: IDL.Nat64
579
+ });
580
+ export const QueryBlocksResponse = IDL.Record({
581
+ certificate: IDL.Opt(IDL.Vec(IDL.Nat8)),
582
+ blocks: IDL.Vec(CandidBlock),
583
+ chain_length: IDL.Nat64,
584
+ first_block_index: IDL.Nat64,
585
+ archived_blocks: IDL.Vec(ArchivedBlocksRange)
586
+ });
587
+ export const Result_5 = IDL.Variant({
588
+ Ok: IDL.Vec(IDL.Vec(IDL.Nat8)),
589
+ Err: GetBlocksError
590
+ });
591
+ export const ArchivedEncodedBlocksRange = IDL.Record({
592
+ callback: IDL.Func([GetBlocksArgs], [Result_5], ['query']),
593
+ start: IDL.Nat64,
594
+ length: IDL.Nat64
595
+ });
596
+ export const QueryEncodedBlocksResponse = IDL.Record({
597
+ certificate: IDL.Opt(IDL.Vec(IDL.Nat8)),
598
+ blocks: IDL.Vec(IDL.Vec(IDL.Nat8)),
599
+ chain_length: IDL.Nat64,
600
+ first_block_index: IDL.Nat64,
601
+ archived_blocks: IDL.Vec(ArchivedEncodedBlocksRange)
602
+ });
603
+ export const SendArgs = IDL.Record({
604
+ to: IDL.Text,
605
+ fee: Tokens,
606
+ memo: IDL.Nat64,
607
+ from_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
608
+ created_at_time: IDL.Opt(TimeStamp),
609
+ amount: Tokens
610
+ });
611
+ export const Symbol = IDL.Record({ symbol: IDL.Text });
612
+ export const TransferArgs = IDL.Record({
613
+ to: IDL.Vec(IDL.Nat8),
614
+ fee: Tokens,
615
+ memo: IDL.Nat64,
616
+ from_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
617
+ created_at_time: IDL.Opt(TimeStamp),
618
+ amount: Tokens
619
+ });
620
+ export const TransferError_1 = IDL.Variant({
621
+ TxTooOld: IDL.Record({ allowed_window_nanos: IDL.Nat64 }),
622
+ BadFee: IDL.Record({ expected_fee: Tokens }),
623
+ TxDuplicate: IDL.Record({ duplicate_of: IDL.Nat64 }),
624
+ TxCreatedInFuture: IDL.Null,
625
+ InsufficientFunds: IDL.Record({ balance: Tokens })
626
+ });
627
+ export const Result_6 = IDL.Variant({
628
+ Ok: IDL.Nat64,
629
+ Err: TransferError_1
630
+ });
631
+ export const TransferFee = IDL.Record({ transfer_fee: Tokens });
632
+ export const idlFactory: idlFactory = ({ IDL }) => {
633
+ const Account = IDL.Record({
634
+ owner: IDL.Principal,
635
+ subaccount: IDL.Opt(IDL.Vec(IDL.Nat8))
636
+ });
637
+ const FeatureFlags = IDL.Record({ icrc2: IDL.Bool });
638
+ const UpgradeArgs = IDL.Record({
639
+ icrc1_minting_account: IDL.Opt(Account),
640
+ feature_flags: IDL.Opt(FeatureFlags)
641
+ });
642
+ const Tokens = IDL.Record({ e8s: IDL.Nat64 });
643
+ const Duration = IDL.Record({ secs: IDL.Nat64, nanos: IDL.Nat32 });
644
+ const ArchiveOptions = IDL.Record({
645
+ num_blocks_to_archive: IDL.Nat64,
646
+ max_transactions_per_response: IDL.Opt(IDL.Nat64),
647
+ trigger_threshold: IDL.Nat64,
648
+ more_controller_ids: IDL.Opt(IDL.Vec(IDL.Principal)),
649
+ max_message_size_bytes: IDL.Opt(IDL.Nat64),
650
+ cycles_for_archive_creation: IDL.Opt(IDL.Nat64),
651
+ node_max_memory_size_bytes: IDL.Opt(IDL.Nat64),
652
+ controller_id: IDL.Principal
653
+ });
654
+ const InitArgs = IDL.Record({
655
+ send_whitelist: IDL.Vec(IDL.Principal),
656
+ token_symbol: IDL.Opt(IDL.Text),
657
+ transfer_fee: IDL.Opt(Tokens),
658
+ minting_account: IDL.Text,
659
+ transaction_window: IDL.Opt(Duration),
660
+ max_message_size_bytes: IDL.Opt(IDL.Nat64),
661
+ icrc1_minting_account: IDL.Opt(Account),
662
+ archive_options: IDL.Opt(ArchiveOptions),
663
+ initial_values: IDL.Vec(IDL.Tuple(IDL.Text, Tokens)),
664
+ token_name: IDL.Opt(IDL.Text),
665
+ feature_flags: IDL.Opt(FeatureFlags)
666
+ });
667
+ const LedgerCanisterPayload = IDL.Variant({
668
+ Upgrade: IDL.Opt(UpgradeArgs),
669
+ Init: InitArgs
670
+ });
671
+ const AccountIdentifierByteBuf = IDL.Record({
672
+ account: IDL.Vec(IDL.Nat8)
673
+ });
674
+ const AccountBalanceArgs = IDL.Record({ account: IDL.Text });
675
+ const ArchiveInfo = IDL.Record({ canister_id: IDL.Principal });
676
+ const Archives = IDL.Record({ archives: IDL.Vec(ArchiveInfo) });
677
+ const Decimals = IDL.Record({ decimals: IDL.Nat32 });
678
+ const StandardRecord = IDL.Record({ url: IDL.Text, name: IDL.Text });
679
+ const MetadataValue = IDL.Variant({
680
+ Int: IDL.Int,
681
+ Nat: IDL.Nat,
682
+ Blob: IDL.Vec(IDL.Nat8),
683
+ Text: IDL.Text
684
+ });
685
+ const TransferArg = IDL.Record({
686
+ to: Account,
687
+ fee: IDL.Opt(IDL.Nat),
688
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
689
+ from_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
690
+ created_at_time: IDL.Opt(IDL.Nat64),
691
+ amount: IDL.Nat
692
+ });
693
+ const TransferError = IDL.Variant({
694
+ GenericError: IDL.Record({
695
+ message: IDL.Text,
696
+ error_code: IDL.Nat
697
+ }),
698
+ TemporarilyUnavailable: IDL.Null,
699
+ BadBurn: IDL.Record({ min_burn_amount: IDL.Nat }),
700
+ Duplicate: IDL.Record({ duplicate_of: IDL.Nat }),
701
+ BadFee: IDL.Record({ expected_fee: IDL.Nat }),
702
+ CreatedInFuture: IDL.Record({ ledger_time: IDL.Nat64 }),
703
+ TooOld: IDL.Null,
704
+ InsufficientFunds: IDL.Record({ balance: IDL.Nat })
705
+ });
706
+ const Result = IDL.Variant({ Ok: IDL.Nat, Err: TransferError });
707
+ const ConsentMessageMetadata = IDL.Record({
708
+ utc_offset_minutes: IDL.Opt(IDL.Int16),
709
+ language: IDL.Text
710
+ });
711
+ const DisplayMessageType = IDL.Variant({
712
+ GenericDisplay: IDL.Null,
713
+ LineDisplay: IDL.Record({
714
+ characters_per_line: IDL.Nat16,
715
+ lines_per_page: IDL.Nat16
716
+ })
717
+ });
718
+ const ConsentMessageSpec = IDL.Record({
719
+ metadata: ConsentMessageMetadata,
720
+ device_spec: IDL.Opt(DisplayMessageType)
721
+ });
722
+ const ConsentMessageRequest = IDL.Record({
723
+ arg: IDL.Vec(IDL.Nat8),
724
+ method: IDL.Text,
725
+ user_preferences: ConsentMessageSpec
726
+ });
727
+ const LineDisplayPage = IDL.Record({ lines: IDL.Vec(IDL.Text) });
728
+ const ConsentMessage = IDL.Variant({
729
+ LineDisplayMessage: IDL.Record({ pages: IDL.Vec(LineDisplayPage) }),
730
+ GenericDisplayMessage: IDL.Text
731
+ });
732
+ const ConsentInfo = IDL.Record({
733
+ metadata: ConsentMessageMetadata,
734
+ consent_message: ConsentMessage
735
+ });
736
+ const ErrorInfo = IDL.Record({ description: IDL.Text });
737
+ const Icrc21Error = IDL.Variant({
738
+ GenericError: IDL.Record({
739
+ description: IDL.Text,
740
+ error_code: IDL.Nat
741
+ }),
742
+ InsufficientPayment: ErrorInfo,
743
+ UnsupportedCanisterCall: ErrorInfo,
744
+ ConsentMessageUnavailable: ErrorInfo
745
+ });
746
+ const Result_1 = IDL.Variant({ Ok: ConsentInfo, Err: Icrc21Error });
747
+ const AllowanceArgs = IDL.Record({
748
+ account: Account,
749
+ spender: Account
750
+ });
751
+ const Allowance = IDL.Record({
752
+ allowance: IDL.Nat,
753
+ expires_at: IDL.Opt(IDL.Nat64)
754
+ });
755
+ const ApproveArgs = IDL.Record({
756
+ fee: IDL.Opt(IDL.Nat),
757
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
758
+ from_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
759
+ created_at_time: IDL.Opt(IDL.Nat64),
760
+ amount: IDL.Nat,
761
+ expected_allowance: IDL.Opt(IDL.Nat),
762
+ expires_at: IDL.Opt(IDL.Nat64),
763
+ spender: Account
764
+ });
765
+ const ApproveError = IDL.Variant({
766
+ GenericError: IDL.Record({
767
+ message: IDL.Text,
768
+ error_code: IDL.Nat
769
+ }),
770
+ TemporarilyUnavailable: IDL.Null,
771
+ Duplicate: IDL.Record({ duplicate_of: IDL.Nat }),
772
+ BadFee: IDL.Record({ expected_fee: IDL.Nat }),
773
+ AllowanceChanged: IDL.Record({ current_allowance: IDL.Nat }),
774
+ CreatedInFuture: IDL.Record({ ledger_time: IDL.Nat64 }),
775
+ TooOld: IDL.Null,
776
+ Expired: IDL.Record({ ledger_time: IDL.Nat64 }),
777
+ InsufficientFunds: IDL.Record({ balance: IDL.Nat })
778
+ });
779
+ const Result_2 = IDL.Variant({ Ok: IDL.Nat, Err: ApproveError });
780
+ const TransferFromArgs = IDL.Record({
781
+ to: Account,
782
+ fee: IDL.Opt(IDL.Nat),
783
+ spender_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
784
+ from: Account,
785
+ memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
786
+ created_at_time: IDL.Opt(IDL.Nat64),
787
+ amount: IDL.Nat
788
+ });
789
+ const TransferFromError = IDL.Variant({
790
+ GenericError: IDL.Record({
791
+ message: IDL.Text,
792
+ error_code: IDL.Nat
793
+ }),
794
+ TemporarilyUnavailable: IDL.Null,
795
+ InsufficientAllowance: IDL.Record({ allowance: IDL.Nat }),
796
+ BadBurn: IDL.Record({ min_burn_amount: IDL.Nat }),
797
+ Duplicate: IDL.Record({ duplicate_of: IDL.Nat }),
798
+ BadFee: IDL.Record({ expected_fee: IDL.Nat }),
799
+ CreatedInFuture: IDL.Record({ ledger_time: IDL.Nat64 }),
800
+ TooOld: IDL.Null,
801
+ InsufficientFunds: IDL.Record({ balance: IDL.Nat })
802
+ });
803
+ const Result_3 = IDL.Variant({ Ok: IDL.Nat, Err: TransferFromError });
804
+ const Name = IDL.Record({ name: IDL.Text });
805
+ const GetBlocksArgs = IDL.Record({
806
+ start: IDL.Nat64,
807
+ length: IDL.Nat64
808
+ });
809
+ const TimeStamp = IDL.Record({ timestamp_nanos: IDL.Nat64 });
810
+ const CandidOperation = IDL.Variant({
811
+ Approve: IDL.Record({
812
+ fee: Tokens,
813
+ from: IDL.Vec(IDL.Nat8),
814
+ allowance_e8s: IDL.Int,
815
+ allowance: Tokens,
816
+ expected_allowance: IDL.Opt(Tokens),
817
+ expires_at: IDL.Opt(TimeStamp),
818
+ spender: IDL.Vec(IDL.Nat8)
819
+ }),
820
+ Burn: IDL.Record({
821
+ from: IDL.Vec(IDL.Nat8),
822
+ amount: Tokens,
823
+ spender: IDL.Opt(IDL.Vec(IDL.Nat8))
824
+ }),
825
+ Mint: IDL.Record({ to: IDL.Vec(IDL.Nat8), amount: Tokens }),
826
+ Transfer: IDL.Record({
827
+ to: IDL.Vec(IDL.Nat8),
828
+ fee: Tokens,
829
+ from: IDL.Vec(IDL.Nat8),
830
+ amount: Tokens,
831
+ spender: IDL.Opt(IDL.Vec(IDL.Nat8))
832
+ })
833
+ });
834
+ const CandidTransaction = IDL.Record({
835
+ memo: IDL.Nat64,
836
+ icrc1_memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
837
+ operation: IDL.Opt(CandidOperation),
838
+ created_at_time: TimeStamp
839
+ });
840
+ const CandidBlock = IDL.Record({
841
+ transaction: CandidTransaction,
842
+ timestamp: TimeStamp,
843
+ parent_hash: IDL.Opt(IDL.Vec(IDL.Nat8))
844
+ });
845
+ const BlockRange = IDL.Record({ blocks: IDL.Vec(CandidBlock) });
846
+ const GetBlocksError = IDL.Variant({
847
+ BadFirstBlockIndex: IDL.Record({
848
+ requested_index: IDL.Nat64,
849
+ first_valid_index: IDL.Nat64
850
+ }),
851
+ Other: IDL.Record({
852
+ error_message: IDL.Text,
853
+ error_code: IDL.Nat64
854
+ })
855
+ });
856
+ const Result_4 = IDL.Variant({ Ok: BlockRange, Err: GetBlocksError });
857
+ const ArchivedBlocksRange = IDL.Record({
858
+ callback: IDL.Func([GetBlocksArgs], [Result_4], ['query']),
859
+ start: IDL.Nat64,
860
+ length: IDL.Nat64
861
+ });
862
+ const QueryBlocksResponse = IDL.Record({
863
+ certificate: IDL.Opt(IDL.Vec(IDL.Nat8)),
864
+ blocks: IDL.Vec(CandidBlock),
865
+ chain_length: IDL.Nat64,
866
+ first_block_index: IDL.Nat64,
867
+ archived_blocks: IDL.Vec(ArchivedBlocksRange)
868
+ });
869
+ const Result_5 = IDL.Variant({
870
+ Ok: IDL.Vec(IDL.Vec(IDL.Nat8)),
871
+ Err: GetBlocksError
872
+ });
873
+ const ArchivedEncodedBlocksRange = IDL.Record({
874
+ callback: IDL.Func([GetBlocksArgs], [Result_5], ['query']),
875
+ start: IDL.Nat64,
876
+ length: IDL.Nat64
877
+ });
878
+ const QueryEncodedBlocksResponse = IDL.Record({
879
+ certificate: IDL.Opt(IDL.Vec(IDL.Nat8)),
880
+ blocks: IDL.Vec(IDL.Vec(IDL.Nat8)),
881
+ chain_length: IDL.Nat64,
882
+ first_block_index: IDL.Nat64,
883
+ archived_blocks: IDL.Vec(ArchivedEncodedBlocksRange)
884
+ });
885
+ const SendArgs = IDL.Record({
886
+ to: IDL.Text,
887
+ fee: Tokens,
888
+ memo: IDL.Nat64,
889
+ from_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
890
+ created_at_time: IDL.Opt(TimeStamp),
891
+ amount: Tokens
892
+ });
893
+ const Symbol = IDL.Record({ symbol: IDL.Text });
894
+ const TransferArgs = IDL.Record({
895
+ to: IDL.Vec(IDL.Nat8),
896
+ fee: Tokens,
897
+ memo: IDL.Nat64,
898
+ from_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
899
+ created_at_time: IDL.Opt(TimeStamp),
900
+ amount: Tokens
901
+ });
902
+ const TransferError_1 = IDL.Variant({
903
+ TxTooOld: IDL.Record({ allowed_window_nanos: IDL.Nat64 }),
904
+ BadFee: IDL.Record({ expected_fee: Tokens }),
905
+ TxDuplicate: IDL.Record({ duplicate_of: IDL.Nat64 }),
906
+ TxCreatedInFuture: IDL.Null,
907
+ InsufficientFunds: IDL.Record({ balance: Tokens })
908
+ });
909
+ const Result_6 = IDL.Variant({ Ok: IDL.Nat64, Err: TransferError_1 });
910
+ const TransferFee = IDL.Record({ transfer_fee: Tokens });
911
+ return IDL.Service({
912
+ account_balance: IDL.Func(
913
+ [AccountIdentifierByteBuf],
914
+ [Tokens],
915
+ ['query']
916
+ ),
917
+ account_balance_dfx: IDL.Func(
918
+ [AccountBalanceArgs],
919
+ [Tokens],
920
+ ['query']
921
+ ),
922
+ account_identifier: IDL.Func([Account], [IDL.Vec(IDL.Nat8)], ['query']),
923
+ archives: IDL.Func([], [Archives], ['query']),
924
+ decimals: IDL.Func([], [Decimals], ['query']),
925
+ icrc10_supported_standards: IDL.Func(
926
+ [],
927
+ [IDL.Vec(StandardRecord)],
928
+ ['query']
929
+ ),
930
+ icrc1_balance_of: IDL.Func([Account], [IDL.Nat], ['query']),
931
+ icrc1_decimals: IDL.Func([], [IDL.Nat8], ['query']),
932
+ icrc1_fee: IDL.Func([], [IDL.Nat], ['query']),
933
+ icrc1_metadata: IDL.Func(
934
+ [],
935
+ [IDL.Vec(IDL.Tuple(IDL.Text, MetadataValue))],
936
+ ['query']
937
+ ),
938
+ icrc1_minting_account: IDL.Func([], [IDL.Opt(Account)], ['query']),
939
+ icrc1_name: IDL.Func([], [IDL.Text], ['query']),
940
+ icrc1_supported_standards: IDL.Func(
941
+ [],
942
+ [IDL.Vec(StandardRecord)],
943
+ ['query']
944
+ ),
945
+ icrc1_symbol: IDL.Func([], [IDL.Text], ['query']),
946
+ icrc1_total_supply: IDL.Func([], [IDL.Nat], ['query']),
947
+ icrc1_transfer: IDL.Func([TransferArg], [Result], []),
948
+ icrc21_canister_call_consent_message: IDL.Func(
949
+ [ConsentMessageRequest],
950
+ [Result_1],
951
+ []
952
+ ),
953
+ icrc2_allowance: IDL.Func([AllowanceArgs], [Allowance], ['query']),
954
+ icrc2_approve: IDL.Func([ApproveArgs], [Result_2], []),
955
+ icrc2_transfer_from: IDL.Func([TransferFromArgs], [Result_3], []),
956
+ is_ledger_ready: IDL.Func([], [IDL.Bool], ['query']),
957
+ name: IDL.Func([], [Name], ['query']),
958
+ query_blocks: IDL.Func(
959
+ [GetBlocksArgs],
960
+ [QueryBlocksResponse],
961
+ ['query']
962
+ ),
963
+ query_encoded_blocks: IDL.Func(
964
+ [GetBlocksArgs],
965
+ [QueryEncodedBlocksResponse],
966
+ ['query']
967
+ ),
968
+ send_dfx: IDL.Func([SendArgs], [IDL.Nat64], []),
969
+ symbol: IDL.Func([], [Symbol], ['query']),
970
+ transfer: IDL.Func([TransferArgs], [Result_6], []),
971
+ transfer_fee: IDL.Func([IDL.Record({})], [TransferFee], ['query'])
972
+ });
973
+ };
974
+ export const init: init = ({ IDL }) => {
975
+ const Account = IDL.Record({
976
+ owner: IDL.Principal,
977
+ subaccount: IDL.Opt(IDL.Vec(IDL.Nat8))
978
+ });
979
+ const FeatureFlags = IDL.Record({ icrc2: IDL.Bool });
980
+ const UpgradeArgs = IDL.Record({
981
+ icrc1_minting_account: IDL.Opt(Account),
982
+ feature_flags: IDL.Opt(FeatureFlags)
983
+ });
984
+ const Tokens = IDL.Record({ e8s: IDL.Nat64 });
985
+ const Duration = IDL.Record({ secs: IDL.Nat64, nanos: IDL.Nat32 });
986
+ const ArchiveOptions = IDL.Record({
987
+ num_blocks_to_archive: IDL.Nat64,
988
+ max_transactions_per_response: IDL.Opt(IDL.Nat64),
989
+ trigger_threshold: IDL.Nat64,
990
+ more_controller_ids: IDL.Opt(IDL.Vec(IDL.Principal)),
991
+ max_message_size_bytes: IDL.Opt(IDL.Nat64),
992
+ cycles_for_archive_creation: IDL.Opt(IDL.Nat64),
993
+ node_max_memory_size_bytes: IDL.Opt(IDL.Nat64),
994
+ controller_id: IDL.Principal
995
+ });
996
+ const InitArgs = IDL.Record({
997
+ send_whitelist: IDL.Vec(IDL.Principal),
998
+ token_symbol: IDL.Opt(IDL.Text),
999
+ transfer_fee: IDL.Opt(Tokens),
1000
+ minting_account: IDL.Text,
1001
+ transaction_window: IDL.Opt(Duration),
1002
+ max_message_size_bytes: IDL.Opt(IDL.Nat64),
1003
+ icrc1_minting_account: IDL.Opt(Account),
1004
+ archive_options: IDL.Opt(ArchiveOptions),
1005
+ initial_values: IDL.Vec(IDL.Tuple(IDL.Text, Tokens)),
1006
+ token_name: IDL.Opt(IDL.Text),
1007
+ feature_flags: IDL.Opt(FeatureFlags)
1008
+ });
1009
+ const LedgerCanisterPayload = IDL.Variant({
1010
+ Upgrade: IDL.Opt(UpgradeArgs),
1011
+ Init: InitArgs
1012
+ });
1013
+ return [LedgerCanisterPayload];
1014
+ };
1015
+
1016
+ export {
1017
+ binaryAddressFromAddress,
1018
+ binaryAddressFromPrincipal,
1019
+ hexAddressFromPrincipal
1020
+ } from './address';