@ic-reactor/core 1.3.0 → 1.4.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.
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.2.3/ic-reactor-core.min.js"></script>
22
+ <script src="https://github.com/B3Pay/ic-reactor/releases/download/v1.3.1/ic-reactor-core.min.js"></script>
23
23
  ```
24
24
 
25
25
  ### Using `createReactorCore`
@@ -116,13 +116,10 @@ class AgentManager {
116
116
  if (!this._auth) {
117
117
  throw new Error("Auth client not initialized");
118
118
  }
119
- yield this._auth.login(Object.assign(Object.assign({ identityProvider: this.getIsLocal()
119
+ yield this._auth.login(Object.assign({ identityProvider: this.getIsLocal()
120
120
  ? constants_1.LOCAL_INTERNET_IDENTITY_PROVIDER
121
- : constants_1.IC_INTERNET_IDENTITY_PROVIDER }, options), { onSuccess: () => __awaiter(this, void 0, void 0, function* () {
122
- var _b;
123
- yield this.authenticate();
124
- (_b = options === null || options === void 0 ? void 0 : options.onSuccess) === null || _b === void 0 ? void 0 : _b.call(options);
125
- }) }));
121
+ : constants_1.IC_INTERNET_IDENTITY_PROVIDER }, options));
122
+ yield this.authenticate();
126
123
  });
127
124
  this.logout = (options) => __awaiter(this, void 0, void 0, function* () {
128
125
  if (!this._auth) {
@@ -91,7 +91,7 @@ class CandidAdapter {
91
91
  });
92
92
  const js = yield didjs.did_to_js(candidSource);
93
93
  if (JSON.stringify(js) === JSON.stringify([])) {
94
- throw new Error("Cannot fetch candid file");
94
+ throw new Error("Cannot compile Candid to JavaScript");
95
95
  }
96
96
  const dataUri = "data:text/javascript;charset=utf-8," +
97
97
  encodeURIComponent(js[0]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ic-reactor/core",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
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",
@@ -26,18 +26,18 @@
26
26
  },
27
27
  "homepage": "https://b3pay.github.io/ic-reactor/modules/core.html",
28
28
  "peerDependencies": {
29
- "@dfinity/agent": ">=1.0",
30
- "@dfinity/auth-client": ">=1.0",
31
- "@dfinity/candid": ">=1.0",
32
- "@dfinity/identity": ">=1.0",
33
- "@dfinity/principal": ">=1.0"
29
+ "@dfinity/agent": "^1.2",
30
+ "@dfinity/auth-client": "^1.2",
31
+ "@dfinity/candid": "^1.2",
32
+ "@dfinity/identity": "^1.2",
33
+ "@dfinity/principal": "^1.2"
34
34
  },
35
35
  "dependencies": {
36
- "@dfinity/agent": ">=1.0",
37
- "@dfinity/auth-client": ">=1.0",
38
- "@dfinity/candid": ">=1.0",
39
- "@dfinity/identity": ">=1.0",
40
- "@dfinity/principal": ">=1.0",
36
+ "@dfinity/agent": "^1.2",
37
+ "@dfinity/auth-client": "^1.2",
38
+ "@dfinity/candid": "^1.2",
39
+ "@dfinity/identity": "^1.2",
40
+ "@dfinity/principal": "^1.2",
41
41
  "zustand": "^4.5"
42
42
  },
43
43
  "scripts": {
@@ -47,10 +47,10 @@
47
47
  "bundle:dev": "npx webpack --mode development",
48
48
  "bundle:prod": "npx webpack --mode production",
49
49
  "build": "npx tsc && npm run bundle",
50
- "clean": "npx rimraf dist"
50
+ "clean": "npx rimraf dist && npx rimraf umd && npx rimraf node_modules"
51
51
  },
52
52
  "engines": {
53
53
  "node": ">=10"
54
54
  },
55
- "gitHead": "25043c2d1a78b97e327995abaf13835ac511e5d6"
55
+ "gitHead": "a302e73db60f96faf9f0119ecdd02ee8dfcaa1df"
56
56
  }