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