@junobuild/functions 0.4.1 → 0.5.1

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 (137) hide show
  1. package/canisters/_canister.d.ts +17 -0
  2. package/canisters/_constants.d.ts +3 -0
  3. package/canisters/ckbtc/index.d.ts +1 -0
  4. package/canisters/ckbtc/index.js +2 -0
  5. package/canisters/cketh/index.d.ts +1 -0
  6. package/canisters/cketh/index.js +2 -0
  7. package/canisters/cketh/index.js.map +7 -0
  8. package/canisters/cmc/cmc.canister.d.ts +28 -0
  9. package/canisters/cmc/index.d.ts +2 -0
  10. package/canisters/cmc/index.js +2 -0
  11. package/canisters/cmc/index.js.map +7 -0
  12. package/canisters/declarations/_idl.d.ts +16 -0
  13. package/canisters/declarations/_types.d.ts +16 -0
  14. package/canisters/declarations/ckbtc/bitcoin.did.d.ts +134 -0
  15. package/canisters/declarations/ckbtc/bitcoin.did.idl.d.ts +40 -0
  16. package/canisters/declarations/ckbtc/minter.did.d.ts +831 -0
  17. package/canisters/declarations/ckbtc/minter.did.idl.d.ts +61 -0
  18. package/canisters/declarations/cketh/minter.did.d.ts +893 -0
  19. package/canisters/declarations/cketh/minter.did.idl.d.ts +58 -0
  20. package/canisters/declarations/cketh/orchestrator.did.d.ts +302 -0
  21. package/canisters/declarations/cketh/orchestrator.did.idl.d.ts +34 -0
  22. package/canisters/declarations/cmc/cmc.did.d.ts +344 -0
  23. package/canisters/declarations/cmc/cmc.did.idl.d.ts +53 -0
  24. package/canisters/declarations/ic-management/ic-management.did.d.ts +583 -0
  25. package/canisters/declarations/ic-management/ic-management.did.idl.d.ts +147 -0
  26. package/canisters/declarations/index.d.ts +2 -0
  27. package/canisters/declarations/ledger-icp/index.did.d.ts +119 -0
  28. package/canisters/declarations/ledger-icp/index.did.idl.d.ts +35 -0
  29. package/canisters/declarations/ledger-icp/ledger.did.d.ts +606 -0
  30. package/canisters/declarations/ledger-icp/ledger.did.idl.d.ts +106 -0
  31. package/canisters/declarations/ledger-icrc/icrc_index-ng.did.d.ts +148 -0
  32. package/canisters/declarations/ledger-icrc/icrc_index-ng.did.idl.d.ts +44 -0
  33. package/canisters/declarations/ledger-icrc/icrc_index.did.d.ts +102 -0
  34. package/canisters/declarations/ledger-icrc/icrc_index.did.idl.d.ts +28 -0
  35. package/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts +579 -0
  36. package/canisters/declarations/ledger-icrc/icrc_ledger.did.idl.d.ts +100 -0
  37. package/canisters/declarations/ledger-icrc/icrc_nft-ledger.did.d.ts +81 -0
  38. package/canisters/declarations/ledger-icrc/icrc_nft-ledger.did.idl.d.ts +39 -0
  39. package/canisters/declarations/nns/genesis_token.did.d.ts +49 -0
  40. package/canisters/declarations/nns/genesis_token.did.idl.d.ts +24 -0
  41. package/canisters/declarations/nns/governance.did.d.ts +1254 -0
  42. package/canisters/declarations/nns/governance.did.idl.d.ts +217 -0
  43. package/canisters/declarations/nns/governance_test.did.d.ts +1258 -0
  44. package/canisters/declarations/nns/governance_test.did.idl.d.ts +218 -0
  45. package/canisters/declarations/nns/sns_wasm.did.d.ts +286 -0
  46. package/canisters/declarations/nns/sns_wasm.did.idl.d.ts +80 -0
  47. package/canisters/declarations/sns/sns_governance.did.d.ts +834 -0
  48. package/canisters/declarations/sns/sns_governance.did.idl.d.ts +189 -0
  49. package/canisters/declarations/sns/sns_governance_test.did.d.ts +861 -0
  50. package/canisters/declarations/sns/sns_governance_test.did.idl.d.ts +199 -0
  51. package/canisters/declarations/sns/sns_root.did.d.ts +204 -0
  52. package/canisters/declarations/sns/sns_root.did.idl.d.ts +53 -0
  53. package/canisters/declarations/sns/sns_swap.did.d.ts +411 -0
  54. package/canisters/declarations/sns/sns_swap.did.idl.d.ts +108 -0
  55. package/canisters/ic-management/index.d.ts +1 -0
  56. package/canisters/ic-management/index.js +2 -0
  57. package/canisters/ic-management/index.js.map +7 -0
  58. package/canisters/index.d.ts +1 -0
  59. package/canisters/index.js +2 -0
  60. package/canisters/index.js.map +7 -0
  61. package/canisters/ledger/icp/index.d.ts +2 -0
  62. package/canisters/ledger/icp/index.js +2 -0
  63. package/canisters/ledger/icp/index.js.map +7 -0
  64. package/canisters/ledger/icp/ledger.canister.d.ts +24 -0
  65. package/canisters/ledger/icrc/index.d.ts +3 -0
  66. package/canisters/ledger/icrc/index.js +2 -0
  67. package/canisters/ledger/icrc/index.js.map +7 -0
  68. package/canisters/ledger/icrc/ledger.canister.d.ts +45 -0
  69. package/canisters/ledger/icrc/schemas.d.ts +11 -0
  70. package/canisters/nns/index.d.ts +1 -0
  71. package/canisters/nns/index.js +2 -0
  72. package/canisters/nns/index.js.map +7 -0
  73. package/canisters/schemas.d.ts +11 -0
  74. package/canisters/sns/index.d.ts +1 -0
  75. package/canisters/sns/index.js +2 -0
  76. package/canisters/sns/index.js.map +7 -0
  77. package/chunk-4C666HHU.js +2 -0
  78. package/chunk-4C666HHU.js.map +7 -0
  79. package/chunk-5NZMOUKF.js +2 -0
  80. package/chunk-5NZMOUKF.js.map +7 -0
  81. package/chunk-BXZ5PSUW.js +2 -0
  82. package/chunk-BXZ5PSUW.js.map +7 -0
  83. package/chunk-EMQQE34V.js +2 -0
  84. package/chunk-EMQQE34V.js.map +7 -0
  85. package/chunk-HANEPD6T.js +2 -0
  86. package/chunk-HANEPD6T.js.map +7 -0
  87. package/chunk-TZVF5LQY.js +2 -0
  88. package/chunk-TZVF5LQY.js.map +7 -0
  89. package/ic-cdk.js +1 -1
  90. package/ic-cdk.js.map +4 -4
  91. package/index.js +1 -1
  92. package/index.js.map +1 -1
  93. package/package.json +39 -2
  94. package/sdk.js +1 -1
  95. package/sdk.js.map +1 -1
  96. package/src/canisters/declarations/ckbtc/bitcoin.did.d.ts +134 -0
  97. package/src/canisters/declarations/ckbtc/bitcoin.did.idl.js +302 -0
  98. package/src/canisters/declarations/ckbtc/minter.did.d.ts +831 -0
  99. package/src/canisters/declarations/ckbtc/minter.did.idl.js +893 -0
  100. package/src/canisters/declarations/cketh/minter.did.d.ts +893 -0
  101. package/src/canisters/declarations/cketh/minter.did.idl.js +878 -0
  102. package/src/canisters/declarations/cketh/orchestrator.did.d.ts +302 -0
  103. package/src/canisters/declarations/cketh/orchestrator.did.idl.js +343 -0
  104. package/src/canisters/declarations/cmc/cmc.did.d.ts +344 -0
  105. package/src/canisters/declarations/cmc/cmc.did.idl.js +338 -0
  106. package/src/canisters/declarations/ic-management/ic-management.did.d.ts +583 -0
  107. package/src/canisters/declarations/ic-management/ic-management.did.idl.js +1150 -0
  108. package/src/canisters/declarations/ledger-icp/index.did.d.ts +119 -0
  109. package/src/canisters/declarations/ledger-icp/index.did.idl.js +225 -0
  110. package/src/canisters/declarations/ledger-icp/ledger.did.d.ts +606 -0
  111. package/src/canisters/declarations/ledger-icp/ledger.did.idl.js +813 -0
  112. package/src/canisters/declarations/ledger-icrc/icrc_index-ng.did.d.ts +148 -0
  113. package/src/canisters/declarations/ledger-icrc/icrc_index-ng.did.idl.js +274 -0
  114. package/src/canisters/declarations/ledger-icrc/icrc_index.did.d.ts +102 -0
  115. package/src/canisters/declarations/ledger-icrc/icrc_index.did.idl.js +171 -0
  116. package/src/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts +579 -0
  117. package/src/canisters/declarations/ledger-icrc/icrc_ledger.did.idl.js +923 -0
  118. package/src/canisters/declarations/ledger-icrc/icrc_nft-ledger.did.d.ts +81 -0
  119. package/src/canisters/declarations/ledger-icrc/icrc_nft-ledger.did.idl.js +163 -0
  120. package/src/canisters/declarations/nns/genesis_token.did.d.ts +49 -0
  121. package/src/canisters/declarations/nns/genesis_token.did.idl.js +84 -0
  122. package/src/canisters/declarations/nns/governance.did.d.ts +1254 -0
  123. package/src/canisters/declarations/nns/governance.did.idl.js +2756 -0
  124. package/src/canisters/declarations/nns/governance_test.did.d.ts +1258 -0
  125. package/src/canisters/declarations/nns/governance_test.did.idl.js +2758 -0
  126. package/src/canisters/declarations/nns/sns_wasm.did.d.ts +286 -0
  127. package/src/canisters/declarations/nns/sns_wasm.did.idl.js +589 -0
  128. package/src/canisters/declarations/sns/sns_governance.did.d.ts +834 -0
  129. package/src/canisters/declarations/sns/sns_governance.did.idl.js +2235 -0
  130. package/src/canisters/declarations/sns/sns_governance_test.did.d.ts +861 -0
  131. package/src/canisters/declarations/sns/sns_governance_test.did.idl.js +2283 -0
  132. package/src/canisters/declarations/sns/sns_root.did.d.ts +204 -0
  133. package/src/canisters/declarations/sns/sns_root.did.idl.js +433 -0
  134. package/src/canisters/declarations/sns/sns_swap.did.d.ts +411 -0
  135. package/src/canisters/declarations/sns/sns_swap.did.idl.js +858 -0
  136. package/global.d.js +0 -1
  137. /package/{global.d.js.map → canisters/ckbtc/index.js.map} +0 -0
@@ -0,0 +1,204 @@
1
+ /* eslint-disable */
2
+
3
+ // @ts-nocheck
4
+
5
+ // This file was automatically generated by @icp-sdk/bindgen@0.2.0.
6
+ // You should NOT make any changes in this file as it will be overwritten.
7
+ // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
8
+
9
+ import type { ActorMethod } from '@icp-sdk/core/agent';
10
+ import type { IDL } from '@icp-sdk/core/candid';
11
+ import type { Principal } from '@icp-sdk/core/principal';
12
+
13
+ export interface CanisterCallError {
14
+ 'code' : [] | [number],
15
+ 'description' : string,
16
+ }
17
+ export interface CanisterIdRecord { 'canister_id' : Principal }
18
+ export type CanisterInstallMode = { 'reinstall' : null } |
19
+ { 'upgrade' : null } |
20
+ { 'install' : null };
21
+ export interface CanisterStatusResult {
22
+ 'memory_metrics' : [] | [MemoryMetrics],
23
+ 'status' : CanisterStatusType,
24
+ 'memory_size' : bigint,
25
+ 'cycles' : bigint,
26
+ 'settings' : DefiniteCanisterSettings,
27
+ 'query_stats' : [] | [QueryStats],
28
+ 'idle_cycles_burned_per_day' : [] | [bigint],
29
+ 'module_hash' : [] | [Uint8Array],
30
+ 'reserved_cycles' : [] | [bigint],
31
+ }
32
+ export interface CanisterStatusResultV2 {
33
+ 'memory_metrics' : [] | [MemoryMetrics],
34
+ 'status' : CanisterStatusType,
35
+ 'memory_size' : bigint,
36
+ 'cycles' : bigint,
37
+ 'settings' : DefiniteCanisterSettingsArgs,
38
+ 'query_stats' : [] | [QueryStats],
39
+ 'idle_cycles_burned_per_day' : bigint,
40
+ 'module_hash' : [] | [Uint8Array],
41
+ }
42
+ export type CanisterStatusType = { 'stopped' : null } |
43
+ { 'stopping' : null } |
44
+ { 'running' : null };
45
+ export interface CanisterSummary {
46
+ 'status' : [] | [CanisterStatusResultV2],
47
+ 'canister_id' : [] | [Principal],
48
+ }
49
+ export interface ChangeCanisterRequest {
50
+ 'arg' : Uint8Array,
51
+ 'wasm_module' : Uint8Array,
52
+ 'stop_before_installing' : boolean,
53
+ 'mode' : CanisterInstallMode,
54
+ 'canister_id' : Principal,
55
+ 'chunked_canister_wasm' : [] | [ChunkedCanisterWasm],
56
+ }
57
+ export interface ChunkedCanisterWasm {
58
+ 'wasm_module_hash' : Uint8Array,
59
+ 'chunk_hashes_list' : Array<Uint8Array>,
60
+ 'store_canister_id' : Principal,
61
+ }
62
+ export interface DefiniteCanisterSettings {
63
+ 'freezing_threshold' : [] | [bigint],
64
+ 'wasm_memory_threshold' : [] | [bigint],
65
+ 'controllers' : Array<Principal>,
66
+ 'reserved_cycles_limit' : [] | [bigint],
67
+ 'log_visibility' : [] | [LogVisibility],
68
+ 'wasm_memory_limit' : [] | [bigint],
69
+ 'memory_allocation' : [] | [bigint],
70
+ 'compute_allocation' : [] | [bigint],
71
+ }
72
+ export interface DefiniteCanisterSettingsArgs {
73
+ 'freezing_threshold' : bigint,
74
+ 'wasm_memory_threshold' : [] | [bigint],
75
+ 'controllers' : Array<Principal>,
76
+ 'wasm_memory_limit' : [] | [bigint],
77
+ 'memory_allocation' : bigint,
78
+ 'compute_allocation' : bigint,
79
+ }
80
+ export interface Extensions { 'extension_canister_ids' : Array<Principal> }
81
+ export interface FailedUpdate {
82
+ 'err' : [] | [CanisterCallError],
83
+ 'dapp_canister_id' : [] | [Principal],
84
+ }
85
+ export interface GetSnsCanistersSummaryRequest {
86
+ 'update_canister_list' : [] | [boolean],
87
+ }
88
+ export interface GetSnsCanistersSummaryResponse {
89
+ 'root' : [] | [CanisterSummary],
90
+ 'swap' : [] | [CanisterSummary],
91
+ 'ledger' : [] | [CanisterSummary],
92
+ 'index' : [] | [CanisterSummary],
93
+ 'governance' : [] | [CanisterSummary],
94
+ 'dapps' : Array<CanisterSummary>,
95
+ 'archives' : Array<CanisterSummary>,
96
+ }
97
+ export interface GetTimersResponse { 'timers' : [] | [Timers] }
98
+ export interface ListSnsCanistersResponse {
99
+ 'root' : [] | [Principal],
100
+ 'swap' : [] | [Principal],
101
+ 'extensions' : [] | [Extensions],
102
+ 'ledger' : [] | [Principal],
103
+ 'index' : [] | [Principal],
104
+ 'governance' : [] | [Principal],
105
+ 'dapps' : Array<Principal>,
106
+ 'archives' : Array<Principal>,
107
+ }
108
+ export type LogVisibility = { 'controllers' : null } |
109
+ { 'public' : null } |
110
+ { 'allowed_viewers' : Array<Principal> };
111
+ export interface ManageDappCanisterSettingsRequest {
112
+ 'freezing_threshold' : [] | [bigint],
113
+ 'wasm_memory_threshold' : [] | [bigint],
114
+ 'canister_ids' : Array<Principal>,
115
+ 'reserved_cycles_limit' : [] | [bigint],
116
+ 'log_visibility' : [] | [number],
117
+ 'wasm_memory_limit' : [] | [bigint],
118
+ 'memory_allocation' : [] | [bigint],
119
+ 'compute_allocation' : [] | [bigint],
120
+ }
121
+ export interface ManageDappCanisterSettingsResponse {
122
+ 'failure_reason' : [] | [string],
123
+ }
124
+ export interface MemoryMetrics {
125
+ 'wasm_binary_size' : [] | [bigint],
126
+ 'wasm_chunk_store_size' : [] | [bigint],
127
+ 'canister_history_size' : [] | [bigint],
128
+ 'stable_memory_size' : [] | [bigint],
129
+ 'snapshots_size' : [] | [bigint],
130
+ 'wasm_memory_size' : [] | [bigint],
131
+ 'global_memory_size' : [] | [bigint],
132
+ 'custom_sections_size' : [] | [bigint],
133
+ }
134
+ export interface QueryStats {
135
+ 'response_payload_bytes_total' : [] | [bigint],
136
+ 'num_instructions_total' : [] | [bigint],
137
+ 'num_calls_total' : [] | [bigint],
138
+ 'request_payload_bytes_total' : [] | [bigint],
139
+ }
140
+ export interface RegisterDappCanisterRequest {
141
+ 'canister_id' : [] | [Principal],
142
+ }
143
+ export interface RegisterDappCanistersRequest {
144
+ 'canister_ids' : Array<Principal>,
145
+ }
146
+ export interface RegisterExtensionRequest { 'canister_id' : [] | [Principal] }
147
+ export interface RegisterExtensionResponse {
148
+ 'result' : [] | [RegisterExtensionResult],
149
+ }
150
+ export type RegisterExtensionResult = { 'Ok' : {} } |
151
+ { 'Err' : CanisterCallError };
152
+ export interface SetDappControllersRequest {
153
+ 'canister_ids' : [] | [RegisterDappCanistersRequest],
154
+ 'controller_principal_ids' : Array<Principal>,
155
+ }
156
+ export interface SetDappControllersResponse {
157
+ 'failed_updates' : Array<FailedUpdate>,
158
+ }
159
+ export interface SnsRootCanister {
160
+ 'dapp_canister_ids' : Array<Principal>,
161
+ 'timers' : [] | [Timers],
162
+ 'testflight' : boolean,
163
+ 'extensions' : [] | [Extensions],
164
+ 'archive_canister_ids' : Array<Principal>,
165
+ 'governance_canister_id' : [] | [Principal],
166
+ 'index_canister_id' : [] | [Principal],
167
+ 'swap_canister_id' : [] | [Principal],
168
+ 'ledger_canister_id' : [] | [Principal],
169
+ }
170
+ export interface Timers {
171
+ 'last_spawned_timestamp_seconds' : [] | [bigint],
172
+ 'last_reset_timestamp_seconds' : [] | [bigint],
173
+ 'requires_periodic_tasks' : [] | [boolean],
174
+ }
175
+ export interface _SERVICE {
176
+ 'canister_status' : ActorMethod<[CanisterIdRecord], CanisterStatusResult>,
177
+ 'change_canister' : ActorMethod<[ChangeCanisterRequest], undefined>,
178
+ 'get_build_metadata' : ActorMethod<[], string>,
179
+ 'get_sns_canisters_summary' : ActorMethod<
180
+ [GetSnsCanistersSummaryRequest],
181
+ GetSnsCanistersSummaryResponse
182
+ >,
183
+ 'get_timers' : ActorMethod<[{}], GetTimersResponse>,
184
+ 'list_sns_canisters' : ActorMethod<[{}], ListSnsCanistersResponse>,
185
+ 'manage_dapp_canister_settings' : ActorMethod<
186
+ [ManageDappCanisterSettingsRequest],
187
+ ManageDappCanisterSettingsResponse
188
+ >,
189
+ 'register_dapp_canister' : ActorMethod<[RegisterDappCanisterRequest], {}>,
190
+ 'register_dapp_canisters' : ActorMethod<[RegisterDappCanistersRequest], {}>,
191
+ 'register_extension' : ActorMethod<
192
+ [RegisterExtensionRequest],
193
+ RegisterExtensionResponse
194
+ >,
195
+ 'reset_timers' : ActorMethod<[{}], {}>,
196
+ 'set_dapp_controllers' : ActorMethod<
197
+ [SetDappControllersRequest],
198
+ SetDappControllersResponse
199
+ >,
200
+ }
201
+ export declare const idlService: IDL.ServiceClass;
202
+ export declare const idlInitArgs: IDL.Type[];
203
+ export declare const idlFactory: IDL.InterfaceFactory;
204
+ export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
@@ -0,0 +1,433 @@
1
+ /* eslint-disable */
2
+
3
+ // @ts-nocheck
4
+
5
+ // This file was automatically generated by @icp-sdk/bindgen@0.2.0.
6
+ // You should NOT make any changes in this file as it will be overwritten.
7
+ // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
8
+
9
+ import {IDL} from '@icp-sdk/core/candid';
10
+
11
+ export const Timers = IDL.Record({
12
+ last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),
13
+ last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),
14
+ requires_periodic_tasks: IDL.Opt(IDL.Bool)
15
+ });
16
+ export const Extensions = IDL.Record({
17
+ extension_canister_ids: IDL.Vec(IDL.Principal)
18
+ });
19
+ export const SnsRootCanister = IDL.Record({
20
+ dapp_canister_ids: IDL.Vec(IDL.Principal),
21
+ timers: IDL.Opt(Timers),
22
+ testflight: IDL.Bool,
23
+ extensions: IDL.Opt(Extensions),
24
+ archive_canister_ids: IDL.Vec(IDL.Principal),
25
+ governance_canister_id: IDL.Opt(IDL.Principal),
26
+ index_canister_id: IDL.Opt(IDL.Principal),
27
+ swap_canister_id: IDL.Opt(IDL.Principal),
28
+ ledger_canister_id: IDL.Opt(IDL.Principal)
29
+ });
30
+ export const CanisterIdRecord = IDL.Record({canister_id: IDL.Principal});
31
+ export const MemoryMetrics = IDL.Record({
32
+ wasm_binary_size: IDL.Opt(IDL.Nat),
33
+ wasm_chunk_store_size: IDL.Opt(IDL.Nat),
34
+ canister_history_size: IDL.Opt(IDL.Nat),
35
+ stable_memory_size: IDL.Opt(IDL.Nat),
36
+ snapshots_size: IDL.Opt(IDL.Nat),
37
+ wasm_memory_size: IDL.Opt(IDL.Nat),
38
+ global_memory_size: IDL.Opt(IDL.Nat),
39
+ custom_sections_size: IDL.Opt(IDL.Nat)
40
+ });
41
+ export const CanisterStatusType = IDL.Variant({
42
+ stopped: IDL.Null,
43
+ stopping: IDL.Null,
44
+ running: IDL.Null
45
+ });
46
+ export const LogVisibility = IDL.Variant({
47
+ controllers: IDL.Null,
48
+ public: IDL.Null,
49
+ allowed_viewers: IDL.Vec(IDL.Principal)
50
+ });
51
+ export const DefiniteCanisterSettings = IDL.Record({
52
+ freezing_threshold: IDL.Opt(IDL.Nat),
53
+ wasm_memory_threshold: IDL.Opt(IDL.Nat),
54
+ controllers: IDL.Vec(IDL.Principal),
55
+ reserved_cycles_limit: IDL.Opt(IDL.Nat),
56
+ log_visibility: IDL.Opt(LogVisibility),
57
+ wasm_memory_limit: IDL.Opt(IDL.Nat),
58
+ memory_allocation: IDL.Opt(IDL.Nat),
59
+ compute_allocation: IDL.Opt(IDL.Nat)
60
+ });
61
+ export const QueryStats = IDL.Record({
62
+ response_payload_bytes_total: IDL.Opt(IDL.Nat),
63
+ num_instructions_total: IDL.Opt(IDL.Nat),
64
+ num_calls_total: IDL.Opt(IDL.Nat),
65
+ request_payload_bytes_total: IDL.Opt(IDL.Nat)
66
+ });
67
+ export const CanisterStatusResult = IDL.Record({
68
+ memory_metrics: IDL.Opt(MemoryMetrics),
69
+ status: CanisterStatusType,
70
+ memory_size: IDL.Nat,
71
+ cycles: IDL.Nat,
72
+ settings: DefiniteCanisterSettings,
73
+ query_stats: IDL.Opt(QueryStats),
74
+ idle_cycles_burned_per_day: IDL.Opt(IDL.Nat),
75
+ module_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),
76
+ reserved_cycles: IDL.Opt(IDL.Nat)
77
+ });
78
+ export const CanisterInstallMode = IDL.Variant({
79
+ reinstall: IDL.Null,
80
+ upgrade: IDL.Null,
81
+ install: IDL.Null
82
+ });
83
+ export const ChunkedCanisterWasm = IDL.Record({
84
+ wasm_module_hash: IDL.Vec(IDL.Nat8),
85
+ chunk_hashes_list: IDL.Vec(IDL.Vec(IDL.Nat8)),
86
+ store_canister_id: IDL.Principal
87
+ });
88
+ export const ChangeCanisterRequest = IDL.Record({
89
+ arg: IDL.Vec(IDL.Nat8),
90
+ wasm_module: IDL.Vec(IDL.Nat8),
91
+ stop_before_installing: IDL.Bool,
92
+ mode: CanisterInstallMode,
93
+ canister_id: IDL.Principal,
94
+ chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm)
95
+ });
96
+ export const GetSnsCanistersSummaryRequest = IDL.Record({
97
+ update_canister_list: IDL.Opt(IDL.Bool)
98
+ });
99
+ export const DefiniteCanisterSettingsArgs = IDL.Record({
100
+ freezing_threshold: IDL.Nat,
101
+ wasm_memory_threshold: IDL.Opt(IDL.Nat),
102
+ controllers: IDL.Vec(IDL.Principal),
103
+ wasm_memory_limit: IDL.Opt(IDL.Nat),
104
+ memory_allocation: IDL.Nat,
105
+ compute_allocation: IDL.Nat
106
+ });
107
+ export const CanisterStatusResultV2 = IDL.Record({
108
+ memory_metrics: IDL.Opt(MemoryMetrics),
109
+ status: CanisterStatusType,
110
+ memory_size: IDL.Nat,
111
+ cycles: IDL.Nat,
112
+ settings: DefiniteCanisterSettingsArgs,
113
+ query_stats: IDL.Opt(QueryStats),
114
+ idle_cycles_burned_per_day: IDL.Nat,
115
+ module_hash: IDL.Opt(IDL.Vec(IDL.Nat8))
116
+ });
117
+ export const CanisterSummary = IDL.Record({
118
+ status: IDL.Opt(CanisterStatusResultV2),
119
+ canister_id: IDL.Opt(IDL.Principal)
120
+ });
121
+ export const GetSnsCanistersSummaryResponse = IDL.Record({
122
+ root: IDL.Opt(CanisterSummary),
123
+ swap: IDL.Opt(CanisterSummary),
124
+ ledger: IDL.Opt(CanisterSummary),
125
+ index: IDL.Opt(CanisterSummary),
126
+ governance: IDL.Opt(CanisterSummary),
127
+ dapps: IDL.Vec(CanisterSummary),
128
+ archives: IDL.Vec(CanisterSummary)
129
+ });
130
+ export const GetTimersResponse = IDL.Record({timers: IDL.Opt(Timers)});
131
+ export const ListSnsCanistersResponse = IDL.Record({
132
+ root: IDL.Opt(IDL.Principal),
133
+ swap: IDL.Opt(IDL.Principal),
134
+ extensions: IDL.Opt(Extensions),
135
+ ledger: IDL.Opt(IDL.Principal),
136
+ index: IDL.Opt(IDL.Principal),
137
+ governance: IDL.Opt(IDL.Principal),
138
+ dapps: IDL.Vec(IDL.Principal),
139
+ archives: IDL.Vec(IDL.Principal)
140
+ });
141
+ export const ManageDappCanisterSettingsRequest = IDL.Record({
142
+ freezing_threshold: IDL.Opt(IDL.Nat64),
143
+ wasm_memory_threshold: IDL.Opt(IDL.Nat64),
144
+ canister_ids: IDL.Vec(IDL.Principal),
145
+ reserved_cycles_limit: IDL.Opt(IDL.Nat64),
146
+ log_visibility: IDL.Opt(IDL.Int32),
147
+ wasm_memory_limit: IDL.Opt(IDL.Nat64),
148
+ memory_allocation: IDL.Opt(IDL.Nat64),
149
+ compute_allocation: IDL.Opt(IDL.Nat64)
150
+ });
151
+ export const ManageDappCanisterSettingsResponse = IDL.Record({
152
+ failure_reason: IDL.Opt(IDL.Text)
153
+ });
154
+ export const RegisterDappCanisterRequest = IDL.Record({
155
+ canister_id: IDL.Opt(IDL.Principal)
156
+ });
157
+ export const RegisterDappCanistersRequest = IDL.Record({
158
+ canister_ids: IDL.Vec(IDL.Principal)
159
+ });
160
+ export const RegisterExtensionRequest = IDL.Record({
161
+ canister_id: IDL.Opt(IDL.Principal)
162
+ });
163
+ export const CanisterCallError = IDL.Record({
164
+ code: IDL.Opt(IDL.Int32),
165
+ description: IDL.Text
166
+ });
167
+ export const RegisterExtensionResult = IDL.Variant({
168
+ Ok: IDL.Record({}),
169
+ Err: CanisterCallError
170
+ });
171
+ export const RegisterExtensionResponse = IDL.Record({
172
+ result: IDL.Opt(RegisterExtensionResult)
173
+ });
174
+ export const SetDappControllersRequest = IDL.Record({
175
+ canister_ids: IDL.Opt(RegisterDappCanistersRequest),
176
+ controller_principal_ids: IDL.Vec(IDL.Principal)
177
+ });
178
+ export const FailedUpdate = IDL.Record({
179
+ err: IDL.Opt(CanisterCallError),
180
+ dapp_canister_id: IDL.Opt(IDL.Principal)
181
+ });
182
+ export const SetDappControllersResponse = IDL.Record({
183
+ failed_updates: IDL.Vec(FailedUpdate)
184
+ });
185
+
186
+ export const idlService = IDL.Service({
187
+ canister_status: IDL.Func([CanisterIdRecord], [CanisterStatusResult], []),
188
+ change_canister: IDL.Func([ChangeCanisterRequest], [], []),
189
+ get_build_metadata: IDL.Func([], [IDL.Text], ['query']),
190
+ get_sns_canisters_summary: IDL.Func(
191
+ [GetSnsCanistersSummaryRequest],
192
+ [GetSnsCanistersSummaryResponse],
193
+ []
194
+ ),
195
+ get_timers: IDL.Func([IDL.Record({})], [GetTimersResponse], ['query']),
196
+ list_sns_canisters: IDL.Func([IDL.Record({})], [ListSnsCanistersResponse], ['query']),
197
+ manage_dapp_canister_settings: IDL.Func(
198
+ [ManageDappCanisterSettingsRequest],
199
+ [ManageDappCanisterSettingsResponse],
200
+ []
201
+ ),
202
+ register_dapp_canister: IDL.Func([RegisterDappCanisterRequest], [IDL.Record({})], []),
203
+ register_dapp_canisters: IDL.Func([RegisterDappCanistersRequest], [IDL.Record({})], []),
204
+ register_extension: IDL.Func([RegisterExtensionRequest], [RegisterExtensionResponse], []),
205
+ reset_timers: IDL.Func([IDL.Record({})], [IDL.Record({})], []),
206
+ set_dapp_controllers: IDL.Func([SetDappControllersRequest], [SetDappControllersResponse], [])
207
+ });
208
+
209
+ export const idlInitArgs = [SnsRootCanister];
210
+
211
+ export const idlFactory = ({IDL}) => {
212
+ const Timers = IDL.Record({
213
+ last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),
214
+ last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),
215
+ requires_periodic_tasks: IDL.Opt(IDL.Bool)
216
+ });
217
+ const Extensions = IDL.Record({
218
+ extension_canister_ids: IDL.Vec(IDL.Principal)
219
+ });
220
+ const SnsRootCanister = IDL.Record({
221
+ dapp_canister_ids: IDL.Vec(IDL.Principal),
222
+ timers: IDL.Opt(Timers),
223
+ testflight: IDL.Bool,
224
+ extensions: IDL.Opt(Extensions),
225
+ archive_canister_ids: IDL.Vec(IDL.Principal),
226
+ governance_canister_id: IDL.Opt(IDL.Principal),
227
+ index_canister_id: IDL.Opt(IDL.Principal),
228
+ swap_canister_id: IDL.Opt(IDL.Principal),
229
+ ledger_canister_id: IDL.Opt(IDL.Principal)
230
+ });
231
+ const CanisterIdRecord = IDL.Record({canister_id: IDL.Principal});
232
+ const MemoryMetrics = IDL.Record({
233
+ wasm_binary_size: IDL.Opt(IDL.Nat),
234
+ wasm_chunk_store_size: IDL.Opt(IDL.Nat),
235
+ canister_history_size: IDL.Opt(IDL.Nat),
236
+ stable_memory_size: IDL.Opt(IDL.Nat),
237
+ snapshots_size: IDL.Opt(IDL.Nat),
238
+ wasm_memory_size: IDL.Opt(IDL.Nat),
239
+ global_memory_size: IDL.Opt(IDL.Nat),
240
+ custom_sections_size: IDL.Opt(IDL.Nat)
241
+ });
242
+ const CanisterStatusType = IDL.Variant({
243
+ stopped: IDL.Null,
244
+ stopping: IDL.Null,
245
+ running: IDL.Null
246
+ });
247
+ const LogVisibility = IDL.Variant({
248
+ controllers: IDL.Null,
249
+ public: IDL.Null,
250
+ allowed_viewers: IDL.Vec(IDL.Principal)
251
+ });
252
+ const DefiniteCanisterSettings = IDL.Record({
253
+ freezing_threshold: IDL.Opt(IDL.Nat),
254
+ wasm_memory_threshold: IDL.Opt(IDL.Nat),
255
+ controllers: IDL.Vec(IDL.Principal),
256
+ reserved_cycles_limit: IDL.Opt(IDL.Nat),
257
+ log_visibility: IDL.Opt(LogVisibility),
258
+ wasm_memory_limit: IDL.Opt(IDL.Nat),
259
+ memory_allocation: IDL.Opt(IDL.Nat),
260
+ compute_allocation: IDL.Opt(IDL.Nat)
261
+ });
262
+ const QueryStats = IDL.Record({
263
+ response_payload_bytes_total: IDL.Opt(IDL.Nat),
264
+ num_instructions_total: IDL.Opt(IDL.Nat),
265
+ num_calls_total: IDL.Opt(IDL.Nat),
266
+ request_payload_bytes_total: IDL.Opt(IDL.Nat)
267
+ });
268
+ const CanisterStatusResult = IDL.Record({
269
+ memory_metrics: IDL.Opt(MemoryMetrics),
270
+ status: CanisterStatusType,
271
+ memory_size: IDL.Nat,
272
+ cycles: IDL.Nat,
273
+ settings: DefiniteCanisterSettings,
274
+ query_stats: IDL.Opt(QueryStats),
275
+ idle_cycles_burned_per_day: IDL.Opt(IDL.Nat),
276
+ module_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),
277
+ reserved_cycles: IDL.Opt(IDL.Nat)
278
+ });
279
+ const CanisterInstallMode = IDL.Variant({
280
+ reinstall: IDL.Null,
281
+ upgrade: IDL.Null,
282
+ install: IDL.Null
283
+ });
284
+ const ChunkedCanisterWasm = IDL.Record({
285
+ wasm_module_hash: IDL.Vec(IDL.Nat8),
286
+ chunk_hashes_list: IDL.Vec(IDL.Vec(IDL.Nat8)),
287
+ store_canister_id: IDL.Principal
288
+ });
289
+ const ChangeCanisterRequest = IDL.Record({
290
+ arg: IDL.Vec(IDL.Nat8),
291
+ wasm_module: IDL.Vec(IDL.Nat8),
292
+ stop_before_installing: IDL.Bool,
293
+ mode: CanisterInstallMode,
294
+ canister_id: IDL.Principal,
295
+ chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm)
296
+ });
297
+ const GetSnsCanistersSummaryRequest = IDL.Record({
298
+ update_canister_list: IDL.Opt(IDL.Bool)
299
+ });
300
+ const DefiniteCanisterSettingsArgs = IDL.Record({
301
+ freezing_threshold: IDL.Nat,
302
+ wasm_memory_threshold: IDL.Opt(IDL.Nat),
303
+ controllers: IDL.Vec(IDL.Principal),
304
+ wasm_memory_limit: IDL.Opt(IDL.Nat),
305
+ memory_allocation: IDL.Nat,
306
+ compute_allocation: IDL.Nat
307
+ });
308
+ const CanisterStatusResultV2 = IDL.Record({
309
+ memory_metrics: IDL.Opt(MemoryMetrics),
310
+ status: CanisterStatusType,
311
+ memory_size: IDL.Nat,
312
+ cycles: IDL.Nat,
313
+ settings: DefiniteCanisterSettingsArgs,
314
+ query_stats: IDL.Opt(QueryStats),
315
+ idle_cycles_burned_per_day: IDL.Nat,
316
+ module_hash: IDL.Opt(IDL.Vec(IDL.Nat8))
317
+ });
318
+ const CanisterSummary = IDL.Record({
319
+ status: IDL.Opt(CanisterStatusResultV2),
320
+ canister_id: IDL.Opt(IDL.Principal)
321
+ });
322
+ const GetSnsCanistersSummaryResponse = IDL.Record({
323
+ root: IDL.Opt(CanisterSummary),
324
+ swap: IDL.Opt(CanisterSummary),
325
+ ledger: IDL.Opt(CanisterSummary),
326
+ index: IDL.Opt(CanisterSummary),
327
+ governance: IDL.Opt(CanisterSummary),
328
+ dapps: IDL.Vec(CanisterSummary),
329
+ archives: IDL.Vec(CanisterSummary)
330
+ });
331
+ const GetTimersResponse = IDL.Record({timers: IDL.Opt(Timers)});
332
+ const ListSnsCanistersResponse = IDL.Record({
333
+ root: IDL.Opt(IDL.Principal),
334
+ swap: IDL.Opt(IDL.Principal),
335
+ extensions: IDL.Opt(Extensions),
336
+ ledger: IDL.Opt(IDL.Principal),
337
+ index: IDL.Opt(IDL.Principal),
338
+ governance: IDL.Opt(IDL.Principal),
339
+ dapps: IDL.Vec(IDL.Principal),
340
+ archives: IDL.Vec(IDL.Principal)
341
+ });
342
+ const ManageDappCanisterSettingsRequest = IDL.Record({
343
+ freezing_threshold: IDL.Opt(IDL.Nat64),
344
+ wasm_memory_threshold: IDL.Opt(IDL.Nat64),
345
+ canister_ids: IDL.Vec(IDL.Principal),
346
+ reserved_cycles_limit: IDL.Opt(IDL.Nat64),
347
+ log_visibility: IDL.Opt(IDL.Int32),
348
+ wasm_memory_limit: IDL.Opt(IDL.Nat64),
349
+ memory_allocation: IDL.Opt(IDL.Nat64),
350
+ compute_allocation: IDL.Opt(IDL.Nat64)
351
+ });
352
+ const ManageDappCanisterSettingsResponse = IDL.Record({
353
+ failure_reason: IDL.Opt(IDL.Text)
354
+ });
355
+ const RegisterDappCanisterRequest = IDL.Record({
356
+ canister_id: IDL.Opt(IDL.Principal)
357
+ });
358
+ const RegisterDappCanistersRequest = IDL.Record({
359
+ canister_ids: IDL.Vec(IDL.Principal)
360
+ });
361
+ const RegisterExtensionRequest = IDL.Record({
362
+ canister_id: IDL.Opt(IDL.Principal)
363
+ });
364
+ const CanisterCallError = IDL.Record({
365
+ code: IDL.Opt(IDL.Int32),
366
+ description: IDL.Text
367
+ });
368
+ const RegisterExtensionResult = IDL.Variant({
369
+ Ok: IDL.Record({}),
370
+ Err: CanisterCallError
371
+ });
372
+ const RegisterExtensionResponse = IDL.Record({
373
+ result: IDL.Opt(RegisterExtensionResult)
374
+ });
375
+ const SetDappControllersRequest = IDL.Record({
376
+ canister_ids: IDL.Opt(RegisterDappCanistersRequest),
377
+ controller_principal_ids: IDL.Vec(IDL.Principal)
378
+ });
379
+ const FailedUpdate = IDL.Record({
380
+ err: IDL.Opt(CanisterCallError),
381
+ dapp_canister_id: IDL.Opt(IDL.Principal)
382
+ });
383
+ const SetDappControllersResponse = IDL.Record({
384
+ failed_updates: IDL.Vec(FailedUpdate)
385
+ });
386
+
387
+ return IDL.Service({
388
+ canister_status: IDL.Func([CanisterIdRecord], [CanisterStatusResult], []),
389
+ change_canister: IDL.Func([ChangeCanisterRequest], [], []),
390
+ get_build_metadata: IDL.Func([], [IDL.Text], ['query']),
391
+ get_sns_canisters_summary: IDL.Func(
392
+ [GetSnsCanistersSummaryRequest],
393
+ [GetSnsCanistersSummaryResponse],
394
+ []
395
+ ),
396
+ get_timers: IDL.Func([IDL.Record({})], [GetTimersResponse], ['query']),
397
+ list_sns_canisters: IDL.Func([IDL.Record({})], [ListSnsCanistersResponse], ['query']),
398
+ manage_dapp_canister_settings: IDL.Func(
399
+ [ManageDappCanisterSettingsRequest],
400
+ [ManageDappCanisterSettingsResponse],
401
+ []
402
+ ),
403
+ register_dapp_canister: IDL.Func([RegisterDappCanisterRequest], [IDL.Record({})], []),
404
+ register_dapp_canisters: IDL.Func([RegisterDappCanistersRequest], [IDL.Record({})], []),
405
+ register_extension: IDL.Func([RegisterExtensionRequest], [RegisterExtensionResponse], []),
406
+ reset_timers: IDL.Func([IDL.Record({})], [IDL.Record({})], []),
407
+ set_dapp_controllers: IDL.Func([SetDappControllersRequest], [SetDappControllersResponse], [])
408
+ });
409
+ };
410
+
411
+ export const init = ({IDL}) => {
412
+ const Timers = IDL.Record({
413
+ last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),
414
+ last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),
415
+ requires_periodic_tasks: IDL.Opt(IDL.Bool)
416
+ });
417
+ const Extensions = IDL.Record({
418
+ extension_canister_ids: IDL.Vec(IDL.Principal)
419
+ });
420
+ const SnsRootCanister = IDL.Record({
421
+ dapp_canister_ids: IDL.Vec(IDL.Principal),
422
+ timers: IDL.Opt(Timers),
423
+ testflight: IDL.Bool,
424
+ extensions: IDL.Opt(Extensions),
425
+ archive_canister_ids: IDL.Vec(IDL.Principal),
426
+ governance_canister_id: IDL.Opt(IDL.Principal),
427
+ index_canister_id: IDL.Opt(IDL.Principal),
428
+ swap_canister_id: IDL.Opt(IDL.Principal),
429
+ ledger_canister_id: IDL.Opt(IDL.Principal)
430
+ });
431
+
432
+ return [SnsRootCanister];
433
+ };