@ic-reactor/candid 3.0.1-beta.0 → 3.0.2-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.
@@ -0,0 +1,188 @@
1
+ import type { BaseActor, DisplayReactorParameters } from "@ic-reactor/core";
2
+ import type { DynamicMethodOptions } from "./types";
3
+ import { DisplayReactor } from "@ic-reactor/core";
4
+ import { CandidAdapter } from "./adapter";
5
+ import { IDL } from "@icp-sdk/core/candid";
6
+ export interface CandidDisplayReactorParameters<A = BaseActor> extends Omit<DisplayReactorParameters<A>, "idlFactory" | "actor"> {
7
+ /** The Candid source code. If not provided, the canister's Candid will be fetched. */
8
+ candid?: string;
9
+ /** The IDL interface factory. */
10
+ idlFactory?: IDL.InterfaceFactory;
11
+ /** The actor instance. */
12
+ actor?: A;
13
+ }
14
+ /**
15
+ * CandidDisplayReactor combines the display transformation capabilities of
16
+ * DisplayReactor with dynamic Candid parsing from CandidReactor.
17
+ *
18
+ * This class provides:
19
+ * - **Display transformations**: Automatic type conversion between Candid and
20
+ * display-friendly types (bigint ↔ string, Principal ↔ string, etc.)
21
+ * - **Validation**: Optional argument validation with display types
22
+ * - **Dynamic Candid parsing**: Initialize from Candid source or fetch from network
23
+ * - **Dynamic method registration**: Register methods at runtime with Candid signatures
24
+ *
25
+ * @typeParam A - The actor service type
26
+ *
27
+ * @example
28
+ * ```typescript
29
+ * import { CandidDisplayReactor } from "@ic-reactor/candid"
30
+ *
31
+ * const reactor = new CandidDisplayReactor({
32
+ * clientManager,
33
+ * canisterId: "ryjl3-tyaaa-aaaaa-aaaba-cai",
34
+ * })
35
+ *
36
+ * // Initialize from network (fetches Candid from canister)
37
+ * await reactor.initialize()
38
+ *
39
+ * // Or provide Candid source directly
40
+ * const reactor2 = new CandidDisplayReactor({
41
+ * clientManager,
42
+ * canisterId: "...",
43
+ * candid: `service : { greet : (text) -> (text) query }`
44
+ * })
45
+ * await reactor2.initialize()
46
+ *
47
+ * // Call methods with display types (strings instead of bigint/Principal)
48
+ * const result = await reactor.callMethod({
49
+ * functionName: "transfer",
50
+ * args: [{ to: "aaaaa-aa", amount: "1000000" }] // strings!
51
+ * })
52
+ *
53
+ * // Add validation
54
+ * reactor.registerValidator("transfer", ([input]) => {
55
+ * if (!input.to) {
56
+ * return { success: false, issues: [{ path: ["to"], message: "Required" }] }
57
+ * }
58
+ * return { success: true }
59
+ * })
60
+ * ```
61
+ */
62
+ export declare class CandidDisplayReactor<A = BaseActor> extends DisplayReactor<A> {
63
+ adapter: CandidAdapter;
64
+ private candidSource?;
65
+ constructor(config: CandidDisplayReactorParameters<A>);
66
+ /**
67
+ * Initializes the reactor by parsing the provided Candid string or fetching it from the network.
68
+ * This updates the internal service definition with the actual canister interface.
69
+ *
70
+ * After initialization, all DisplayReactor methods work with display type transformations.
71
+ *
72
+ * @example
73
+ * ```typescript
74
+ * const reactor = new CandidDisplayReactor({
75
+ * clientManager,
76
+ * canisterId: "ryjl3-tyaaa-aaaaa-aaaba-cai",
77
+ * })
78
+ *
79
+ * // Fetches Candid from the canister and initializes
80
+ * await reactor.initialize()
81
+ *
82
+ * // Now you can call methods with display types
83
+ * const balance = await reactor.callMethod({
84
+ * functionName: "icrc1_balance_of",
85
+ * args: [{ owner: "aaaaa-aa" }] // Principal as string!
86
+ * })
87
+ * ```
88
+ */
89
+ initialize(): Promise<void>;
90
+ /**
91
+ * Re-initialize the display codecs after the service has been updated.
92
+ * This is called automatically after initialize() or registerMethod().
93
+ */
94
+ private reinitializeCodecs;
95
+ /**
96
+ * Register a dynamic method by its Candid signature.
97
+ * After registration, all DisplayReactor methods work with display type transformations.
98
+ *
99
+ * @example
100
+ * ```typescript
101
+ * // Register a method
102
+ * await reactor.registerMethod({
103
+ * functionName: "icrc1_balance_of",
104
+ * candid: "(record { owner : principal }) -> (nat) query"
105
+ * })
106
+ *
107
+ * // Now use with display types!
108
+ * const balance = await reactor.callMethod({
109
+ * functionName: "icrc1_balance_of",
110
+ * args: [{ owner: "aaaaa-aa" }] // Principal as string
111
+ * })
112
+ * // balance is string (not bigint) due to display transformation
113
+ * ```
114
+ */
115
+ registerMethod(options: DynamicMethodOptions): Promise<void>;
116
+ /**
117
+ * Register multiple methods at once.
118
+ *
119
+ * @example
120
+ * ```typescript
121
+ * await reactor.registerMethods([
122
+ * { functionName: "icrc1_balance_of", candid: "(record { owner : principal }) -> (nat) query" },
123
+ * { functionName: "icrc1_transfer", candid: "(record { to : principal; amount : nat }) -> (variant { Ok : nat; Err : text })" }
124
+ * ])
125
+ * ```
126
+ */
127
+ registerMethods(methods: DynamicMethodOptions[]): Promise<void>;
128
+ /**
129
+ * Check if a method is registered (either from initialize or registerMethod).
130
+ */
131
+ hasMethod(functionName: string): boolean;
132
+ /**
133
+ * Get all registered method names.
134
+ */
135
+ getMethodNames(): string[];
136
+ /**
137
+ * Perform a dynamic update call in one step with display type transformations.
138
+ * Registers the method if not already registered, then calls it.
139
+ *
140
+ * @example
141
+ * ```typescript
142
+ * const result = await reactor.callDynamic({
143
+ * functionName: "transfer",
144
+ * candid: "(record { to : principal; amount : nat }) -> (variant { Ok : nat; Err : text })",
145
+ * args: [{ to: "aaaaa-aa", amount: "100" }] // Display types!
146
+ * })
147
+ * ```
148
+ */
149
+ callDynamic<T = unknown>(options: DynamicMethodOptions & {
150
+ args?: unknown[];
151
+ }): Promise<T>;
152
+ /**
153
+ * Perform a dynamic query call in one step with display type transformations.
154
+ * Registers the method if not already registered, then calls it.
155
+ *
156
+ * @example
157
+ * ```typescript
158
+ * const balance = await reactor.queryDynamic({
159
+ * functionName: "icrc1_balance_of",
160
+ * candid: "(record { owner : principal }) -> (nat) query",
161
+ * args: [{ owner: "aaaaa-aa" }] // Display types!
162
+ * })
163
+ * // balance is string (not BigInt)
164
+ * ```
165
+ */
166
+ queryDynamic<T = unknown>(options: DynamicMethodOptions & {
167
+ args?: unknown[];
168
+ }): Promise<T>;
169
+ /**
170
+ * Fetch with dynamic Candid and TanStack Query caching.
171
+ * Registers the method if not already registered, then fetches with caching.
172
+ * Results are transformed to display types.
173
+ *
174
+ * @example
175
+ * ```typescript
176
+ * const balance = await reactor.fetchQueryDynamic({
177
+ * functionName: "icrc1_balance_of",
178
+ * candid: "(record { owner : principal }) -> (nat) query",
179
+ * args: [{ owner: "aaaaa-aa" }]
180
+ * })
181
+ * // Subsequent calls with same args return cached result
182
+ * ```
183
+ */
184
+ fetchQueryDynamic<T = unknown>(options: DynamicMethodOptions & {
185
+ args?: unknown[];
186
+ }): Promise<T>;
187
+ }
188
+ //# sourceMappingURL=display-reactor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"display-reactor.d.ts","sourceRoot":"","sources":["../src/display-reactor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AAC3E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAEnD,OAAO,EACL,cAAc,EAGf,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAM1C,MAAM,WAAW,8BAA8B,CAAC,CAAC,GAAG,SAAS,CAAE,SAAQ,IAAI,CACzE,wBAAwB,CAAC,CAAC,CAAC,EAC3B,YAAY,GAAG,OAAO,CACvB;IACC,sFAAsF;IACtF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,iCAAiC;IACjC,UAAU,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAA;IACjC,0BAA0B;IAC1B,KAAK,CAAC,EAAE,CAAC,CAAA;CACV;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,qBAAa,oBAAoB,CAAC,CAAC,GAAG,SAAS,CAAE,SAAQ,cAAc,CAAC,CAAC,CAAC;IACjE,OAAO,EAAE,aAAa,CAAA;IAC7B,OAAO,CAAC,YAAY,CAAC,CAAQ;gBAEjB,MAAM,EAAE,8BAA8B,CAAC,CAAC,CAAC;IAqBrD;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACU,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAiBxC;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IA4B1B;;;;;;;;;;;;;;;;;;;OAmBG;IACU,cAAc,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IAiCzE;;;;;;;;;;OAUG;IACU,eAAe,CAAC,OAAO,EAAE,oBAAoB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAI5E;;OAEG;IACI,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO;IAI/C;;OAEG;IACI,cAAc,IAAI,MAAM,EAAE;IAQjC;;;;;;;;;;;;OAYG;IACU,WAAW,CAAC,CAAC,GAAG,OAAO,EAClC,OAAO,EAAE,oBAAoB,GAAG;QAAE,IAAI,CAAC,EAAE,OAAO,EAAE,CAAA;KAAE,GACnD,OAAO,CAAC,CAAC,CAAC;IAQb;;;;;;;;;;;;;OAaG;IACU,YAAY,CAAC,CAAC,GAAG,OAAO,EACnC,OAAO,EAAE,oBAAoB,GAAG;QAAE,IAAI,CAAC,EAAE,OAAO,EAAE,CAAA;KAAE,GACnD,OAAO,CAAC,CAAC,CAAC;IAQb;;;;;;;;;;;;;;OAcG;IACU,iBAAiB,CAAC,CAAC,GAAG,OAAO,EACxC,OAAO,EAAE,oBAAoB,GAAG;QAAE,IAAI,CAAC,EAAE,OAAO,EAAE,CAAA;KAAE,GACnD,OAAO,CAAC,CAAC,CAAC;CAOd"}
@@ -0,0 +1,280 @@
1
+ import { DisplayReactor, didToDisplayCodec, didTypeFromArray, } from "@ic-reactor/core";
2
+ import { CandidAdapter } from "./adapter";
3
+ import { IDL } from "@icp-sdk/core/candid";
4
+ // ============================================================================
5
+ // CandidDisplayReactor
6
+ // ============================================================================
7
+ /**
8
+ * CandidDisplayReactor combines the display transformation capabilities of
9
+ * DisplayReactor with dynamic Candid parsing from CandidReactor.
10
+ *
11
+ * This class provides:
12
+ * - **Display transformations**: Automatic type conversion between Candid and
13
+ * display-friendly types (bigint ↔ string, Principal ↔ string, etc.)
14
+ * - **Validation**: Optional argument validation with display types
15
+ * - **Dynamic Candid parsing**: Initialize from Candid source or fetch from network
16
+ * - **Dynamic method registration**: Register methods at runtime with Candid signatures
17
+ *
18
+ * @typeParam A - The actor service type
19
+ *
20
+ * @example
21
+ * ```typescript
22
+ * import { CandidDisplayReactor } from "@ic-reactor/candid"
23
+ *
24
+ * const reactor = new CandidDisplayReactor({
25
+ * clientManager,
26
+ * canisterId: "ryjl3-tyaaa-aaaaa-aaaba-cai",
27
+ * })
28
+ *
29
+ * // Initialize from network (fetches Candid from canister)
30
+ * await reactor.initialize()
31
+ *
32
+ * // Or provide Candid source directly
33
+ * const reactor2 = new CandidDisplayReactor({
34
+ * clientManager,
35
+ * canisterId: "...",
36
+ * candid: `service : { greet : (text) -> (text) query }`
37
+ * })
38
+ * await reactor2.initialize()
39
+ *
40
+ * // Call methods with display types (strings instead of bigint/Principal)
41
+ * const result = await reactor.callMethod({
42
+ * functionName: "transfer",
43
+ * args: [{ to: "aaaaa-aa", amount: "1000000" }] // strings!
44
+ * })
45
+ *
46
+ * // Add validation
47
+ * reactor.registerValidator("transfer", ([input]) => {
48
+ * if (!input.to) {
49
+ * return { success: false, issues: [{ path: ["to"], message: "Required" }] }
50
+ * }
51
+ * return { success: true }
52
+ * })
53
+ * ```
54
+ */
55
+ export class CandidDisplayReactor extends DisplayReactor {
56
+ constructor(config) {
57
+ // If idlFactory/actor are missing, use a dummy one to satisfy DisplayReactor constructor
58
+ const superConfig = { ...config };
59
+ if (!superConfig.idlFactory && !superConfig.actor) {
60
+ // Use `any` for IDL to avoid type compatibility issues across package versions
61
+ superConfig.idlFactory = (config) => config.IDL.Service({});
62
+ }
63
+ super(superConfig);
64
+ Object.defineProperty(this, "adapter", {
65
+ enumerable: true,
66
+ configurable: true,
67
+ writable: true,
68
+ value: void 0
69
+ });
70
+ Object.defineProperty(this, "candidSource", {
71
+ enumerable: true,
72
+ configurable: true,
73
+ writable: true,
74
+ value: void 0
75
+ });
76
+ this.candidSource = config.candid;
77
+ this.adapter = new CandidAdapter({
78
+ clientManager: this.clientManager,
79
+ });
80
+ }
81
+ // ══════════════════════════════════════════════════════════════════════════
82
+ // INITIALIZATION
83
+ // ══════════════════════════════════════════════════════════════════════════
84
+ /**
85
+ * Initializes the reactor by parsing the provided Candid string or fetching it from the network.
86
+ * This updates the internal service definition with the actual canister interface.
87
+ *
88
+ * After initialization, all DisplayReactor methods work with display type transformations.
89
+ *
90
+ * @example
91
+ * ```typescript
92
+ * const reactor = new CandidDisplayReactor({
93
+ * clientManager,
94
+ * canisterId: "ryjl3-tyaaa-aaaaa-aaaba-cai",
95
+ * })
96
+ *
97
+ * // Fetches Candid from the canister and initializes
98
+ * await reactor.initialize()
99
+ *
100
+ * // Now you can call methods with display types
101
+ * const balance = await reactor.callMethod({
102
+ * functionName: "icrc1_balance_of",
103
+ * args: [{ owner: "aaaaa-aa" }] // Principal as string!
104
+ * })
105
+ * ```
106
+ */
107
+ async initialize() {
108
+ let idlFactory;
109
+ if (this.candidSource) {
110
+ const definition = await this.adapter.parseCandidSource(this.candidSource);
111
+ idlFactory = definition.idlFactory;
112
+ }
113
+ else {
114
+ const definition = await this.adapter.getCandidDefinition(this.canisterId);
115
+ idlFactory = definition.idlFactory;
116
+ }
117
+ this.service = idlFactory({ IDL });
118
+ // Re-initialize codecs after service is updated
119
+ this.reinitializeCodecs();
120
+ }
121
+ /**
122
+ * Re-initialize the display codecs after the service has been updated.
123
+ * This is called automatically after initialize() or registerMethod().
124
+ */
125
+ reinitializeCodecs() {
126
+ const fields = this.getServiceInterface()?._fields;
127
+ if (!fields)
128
+ return;
129
+ // Access the private codecs map from DisplayReactor
130
+ const codecs = this.codecs;
131
+ for (const [methodName, funcType] of fields) {
132
+ // Skip if already exists
133
+ if (codecs.has(methodName))
134
+ continue;
135
+ const argsIdlType = didTypeFromArray(funcType.argTypes);
136
+ const retIdlType = didTypeFromArray(funcType.retTypes);
137
+ codecs.set(methodName, {
138
+ args: didToDisplayCodec(argsIdlType),
139
+ result: didToDisplayCodec(retIdlType),
140
+ });
141
+ }
142
+ }
143
+ // ══════════════════════════════════════════════════════════════════════════
144
+ // DYNAMIC METHOD REGISTRATION
145
+ // ══════════════════════════════════════════════════════════════════════════
146
+ /**
147
+ * Register a dynamic method by its Candid signature.
148
+ * After registration, all DisplayReactor methods work with display type transformations.
149
+ *
150
+ * @example
151
+ * ```typescript
152
+ * // Register a method
153
+ * await reactor.registerMethod({
154
+ * functionName: "icrc1_balance_of",
155
+ * candid: "(record { owner : principal }) -> (nat) query"
156
+ * })
157
+ *
158
+ * // Now use with display types!
159
+ * const balance = await reactor.callMethod({
160
+ * functionName: "icrc1_balance_of",
161
+ * args: [{ owner: "aaaaa-aa" }] // Principal as string
162
+ * })
163
+ * // balance is string (not bigint) due to display transformation
164
+ * ```
165
+ */
166
+ async registerMethod(options) {
167
+ const { functionName, candid } = options;
168
+ // Check if method already registered
169
+ const existing = this.service._fields.find(([name]) => name === functionName);
170
+ if (existing)
171
+ return;
172
+ // Parse the Candid signature
173
+ const serviceSource = candid.includes("service :")
174
+ ? candid
175
+ : `service : { ${functionName} : ${candid}; }`;
176
+ const { idlFactory } = await this.adapter.parseCandidSource(serviceSource);
177
+ const parsedService = idlFactory({ IDL });
178
+ const funcField = parsedService._fields.find(([name]) => name === functionName);
179
+ if (!funcField) {
180
+ throw new Error(`Method "${functionName}" not found in the provided Candid signature`);
181
+ }
182
+ // Inject into our service
183
+ this.service._fields.push(funcField);
184
+ // Re-initialize codecs for the new method
185
+ this.reinitializeCodecs();
186
+ }
187
+ /**
188
+ * Register multiple methods at once.
189
+ *
190
+ * @example
191
+ * ```typescript
192
+ * await reactor.registerMethods([
193
+ * { functionName: "icrc1_balance_of", candid: "(record { owner : principal }) -> (nat) query" },
194
+ * { functionName: "icrc1_transfer", candid: "(record { to : principal; amount : nat }) -> (variant { Ok : nat; Err : text })" }
195
+ * ])
196
+ * ```
197
+ */
198
+ async registerMethods(methods) {
199
+ await Promise.all(methods.map((m) => this.registerMethod(m)));
200
+ }
201
+ /**
202
+ * Check if a method is registered (either from initialize or registerMethod).
203
+ */
204
+ hasMethod(functionName) {
205
+ return this.service._fields.some(([name]) => name === functionName);
206
+ }
207
+ /**
208
+ * Get all registered method names.
209
+ */
210
+ getMethodNames() {
211
+ return this.service._fields.map(([name]) => name);
212
+ }
213
+ // ══════════════════════════════════════════════════════════════════════════
214
+ // DYNAMIC CALL SHORTCUTS
215
+ // ══════════════════════════════════════════════════════════════════════════
216
+ /**
217
+ * Perform a dynamic update call in one step with display type transformations.
218
+ * Registers the method if not already registered, then calls it.
219
+ *
220
+ * @example
221
+ * ```typescript
222
+ * const result = await reactor.callDynamic({
223
+ * functionName: "transfer",
224
+ * candid: "(record { to : principal; amount : nat }) -> (variant { Ok : nat; Err : text })",
225
+ * args: [{ to: "aaaaa-aa", amount: "100" }] // Display types!
226
+ * })
227
+ * ```
228
+ */
229
+ async callDynamic(options) {
230
+ await this.registerMethod(options);
231
+ return this.callMethod({
232
+ functionName: options.functionName,
233
+ args: options.args,
234
+ });
235
+ }
236
+ /**
237
+ * Perform a dynamic query call in one step with display type transformations.
238
+ * Registers the method if not already registered, then calls it.
239
+ *
240
+ * @example
241
+ * ```typescript
242
+ * const balance = await reactor.queryDynamic({
243
+ * functionName: "icrc1_balance_of",
244
+ * candid: "(record { owner : principal }) -> (nat) query",
245
+ * args: [{ owner: "aaaaa-aa" }] // Display types!
246
+ * })
247
+ * // balance is string (not BigInt)
248
+ * ```
249
+ */
250
+ async queryDynamic(options) {
251
+ await this.registerMethod(options);
252
+ return this.callMethod({
253
+ functionName: options.functionName,
254
+ args: options.args,
255
+ });
256
+ }
257
+ /**
258
+ * Fetch with dynamic Candid and TanStack Query caching.
259
+ * Registers the method if not already registered, then fetches with caching.
260
+ * Results are transformed to display types.
261
+ *
262
+ * @example
263
+ * ```typescript
264
+ * const balance = await reactor.fetchQueryDynamic({
265
+ * functionName: "icrc1_balance_of",
266
+ * candid: "(record { owner : principal }) -> (nat) query",
267
+ * args: [{ owner: "aaaaa-aa" }]
268
+ * })
269
+ * // Subsequent calls with same args return cached result
270
+ * ```
271
+ */
272
+ async fetchQueryDynamic(options) {
273
+ await this.registerMethod(options);
274
+ return this.fetchQuery({
275
+ functionName: options.functionName,
276
+ args: options.args,
277
+ });
278
+ }
279
+ }
280
+ //# sourceMappingURL=display-reactor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"display-reactor.js","sourceRoot":"","sources":["../src/display-reactor.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAkB1C,+EAA+E;AAC/E,uBAAuB;AACvB,+EAA+E;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,MAAM,OAAO,oBAAoC,SAAQ,cAAiB;IAIxE,YAAY,MAAyC;QACnD,yFAAyF;QACzF,MAAM,WAAW,GAAG,EAAE,GAAG,MAAM,EAAE,CAAA;QAEjC,IAAI,CAAC,WAAW,CAAC,UAAU,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;YAClD,+EAA+E;YAC/E,WAAW,CAAC,UAAU,GAAG,CAAC,MAAoB,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;QAC3E,CAAC;QAED,KAAK,CAAC,WAA0C,CAAC,CAAA;QAZ5C;;;;;WAAsB;QACrB;;;;;WAAqB;QAa3B,IAAI,CAAC,YAAY,GAAG,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QAEpD,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAA;QAClC,OAAO,IAAI,CAAC,UAAU,CAAC;YACrB,YAAY,EAAE,OAAO,CAAC,YAAmB;YACzC,IAAI,EAAE,OAAO,CAAC,IAAW;SAC1B,CAAM,CAAA;IACT,CAAC;CACF"}
package/dist/index.d.ts CHANGED
@@ -3,4 +3,5 @@ export * from "./types";
3
3
  export * from "./constants";
4
4
  export * from "./utils";
5
5
  export * from "./reactor";
6
+ export * from "./display-reactor";
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACzC,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACzC,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,mBAAmB,CAAA"}
package/dist/index.js CHANGED
@@ -3,4 +3,5 @@ export * from "./types";
3
3
  export * from "./constants";
4
4
  export * from "./utils";
5
5
  export * from "./reactor";
6
+ export * from "./display-reactor";
6
7
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACzC,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACzC,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,mBAAmB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ic-reactor/candid",
3
- "version": "3.0.1-beta.0",
3
+ "version": "3.0.2-beta.0",
4
4
  "description": "IC Reactor Candid Adapter - Fetch and parse Candid definitions from Internet Computer canisters",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -41,7 +41,7 @@
41
41
  "author": "Behrad Deylami",
42
42
  "license": "MIT",
43
43
  "dependencies": {
44
- "@ic-reactor/core": "^3.0.1-beta.0"
44
+ "@ic-reactor/core": "^3.0.2-beta.0"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@icp-sdk/core": "^5.0.0"
@@ -56,9 +56,9 @@
56
56
  },
57
57
  "size-limit": [
58
58
  {
59
- "name": "Candid Adapter",
59
+ "name": "Candid Package",
60
60
  "path": "dist/index.js",
61
- "limit": "10 KB",
61
+ "limit": "30 KB",
62
62
  "gzip": true
63
63
  }
64
64
  ],