@ic-reactor/core 1.5.1 → 1.5.3

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.
package/README.md CHANGED
@@ -19,7 +19,7 @@ yarn add @ic-reactor/core
19
19
  or you can use the UMD version:
20
20
 
21
21
  ```html
22
- <script src="https://github.com/B3Pay/ic-reactor/releases/download/v1.5.0/ic-reactor-core.min.js"></script>
22
+ <script src="https://github.com/B3Pay/ic-reactor/releases/download/v1.5.2/ic-reactor-core.min.js"></script>
23
23
  ```
24
24
 
25
25
  ### Using `createReactorCore`
@@ -1,4 +1,4 @@
1
- import type { CanisterId, ActorMethodParameters, ActorMethodReturnType, ActorStore, ActorManagerParameters, FunctionName, VisitService, BaseActor, ActorMethodState, MethodAttributes } from "./types";
1
+ import type { ActorMethodParameters, ActorMethodReturnType, ActorStore, ActorManagerParameters, FunctionName, VisitService, BaseActor, ActorMethodState, MethodAttributes } from "./types";
2
2
  import { IDL } from "@dfinity/candid";
3
3
  import type { AgentManager } from "../agent";
4
4
  import type { UpdateAgentParameters } from "../../types";
@@ -8,7 +8,7 @@ export declare class ActorManager<A = BaseActor> {
8
8
  private _agentManager;
9
9
  private _unsubscribeAgent;
10
10
  private _subscribers;
11
- canisterId: CanisterId;
11
+ canisterId: string;
12
12
  actorStore: ActorStore<A>;
13
13
  visitFunction: VisitService<A>;
14
14
  methodAttributes: MethodAttributes<A>;
@@ -76,7 +76,7 @@ class ActorManager {
76
76
  };
77
77
  this.initializeActor = (agent) => {
78
78
  var _a;
79
- console.info(`Initializing actor ${this.canisterId} on ${((_a = agent.isLocal) === null || _a === void 0 ? void 0 : _a.call(agent)) ? "local" : "ic"} network`);
79
+ console.info(`Initializing actor ${this.canisterId} on ${((_a = agent.isLocal) === null || _a === void 0 ? void 0 : _a.call(agent)) === true ? "local" : "ic"} network`);
80
80
  const { _idlFactory, canisterId } = this;
81
81
  this.updateState({
82
82
  initializing: true,
@@ -139,7 +139,7 @@ class ActorManager {
139
139
  if (!canisterId) {
140
140
  throw new Error("CanisterId is required!");
141
141
  }
142
- this.canisterId = canisterId;
142
+ this.canisterId = canisterId.toString();
143
143
  if (!idlFactory) {
144
144
  throw new Error("IDL factory is required!");
145
145
  }
@@ -139,7 +139,7 @@ class AgentManager {
139
139
  };
140
140
  this.getIsLocal = () => {
141
141
  var _a, _b;
142
- return ((_b = (_a = this._agent).isLocal) === null || _b === void 0 ? void 0 : _b.call(_a)) || false;
142
+ return ((_b = (_a = this._agent).isLocal) === null || _b === void 0 ? void 0 : _b.call(_a)) === true;
143
143
  };
144
144
  this.getAgentState = () => {
145
145
  return this.agentStore.getState();
@@ -32,7 +32,9 @@ class CandidAdapter {
32
32
  }
33
33
  getDefaultDidJsId() {
34
34
  var _a, _b;
35
- return ((_b = (_a = this.agent).isLocal) === null || _b === void 0 ? void 0 : _b.call(_a)) ? constants_1.DEFAULT_LOCAL_DIDJS_ID : constants_1.DEFAULT_IC_DIDJS_ID;
35
+ return ((_b = (_a = this.agent).isLocal) === null || _b === void 0 ? void 0 : _b.call(_a)) === true
36
+ ? constants_1.DEFAULT_LOCAL_DIDJS_ID
37
+ : constants_1.DEFAULT_IC_DIDJS_ID;
36
38
  }
37
39
  getCandidDefinition(canisterId) {
38
40
  return __awaiter(this, void 0, void 0, function* () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ic-reactor/core",
3
- "version": "1.5.1",
3
+ "version": "1.5.3",
4
4
  "description": "A library for intracting with the Internet Computer canisters",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -52,5 +52,5 @@
52
52
  "engines": {
53
53
  "node": ">=10"
54
54
  },
55
- "gitHead": "48a4c5b4c82e639abcbe5997cd1f5e721d7a6764"
55
+ "gitHead": "8a92edfc841cfd1899f008a094846166886e8f33"
56
56
  }