@ic-reactor/react 1.5.4 → 1.5.5-beta.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.
package/dist/context/agent.js
CHANGED
|
@@ -20,7 +20,6 @@ const core_1 = require("@ic-reactor/core");
|
|
|
20
20
|
const agentHooks_1 = require("../helpers/agentHooks");
|
|
21
21
|
const authHooks_1 = require("../helpers/authHooks");
|
|
22
22
|
const extractAgentContext_1 = require("../helpers/extractAgentContext");
|
|
23
|
-
const utils_1 = require("../utils");
|
|
24
23
|
/**
|
|
25
24
|
* Creates a React context for managing IC agent and authentication states, providing hooks for interacting with the IC blockchain.
|
|
26
25
|
* This function initializes an `AgentContext` with a set of utilities and hooks based on the provided agent configuration.
|
|
@@ -97,10 +96,9 @@ const createAgentContext = (config = {}) => {
|
|
|
97
96
|
const { disableAuthenticateOnMount: defaultDisable } = config, contextOptions = __rest(config, ["disableAuthenticateOnMount"]);
|
|
98
97
|
const AgentContext = react_1.default.createContext(null);
|
|
99
98
|
const AgentProvider = (_a) => {
|
|
100
|
-
var { children, agentManager: mybeAgentManager,
|
|
99
|
+
var { children, agentManager: mybeAgentManager, disableAuthenticateOnMount = defaultDisable !== null && defaultDisable !== void 0 ? defaultDisable : false } = _a, options = __rest(_a, ["children", "agentManager", "disableAuthenticateOnMount"]);
|
|
101
100
|
const hooks = react_1.default.useMemo(() => {
|
|
102
|
-
const
|
|
103
|
-
const agentManager = mybeAgentManager !== null && mybeAgentManager !== void 0 ? mybeAgentManager : (0, core_1.createAgentManager)(Object.assign(Object.assign({ withLocalEnv }, options), contextOptions));
|
|
101
|
+
const agentManager = mybeAgentManager !== null && mybeAgentManager !== void 0 ? mybeAgentManager : (0, core_1.createAgentManager)(Object.assign(Object.assign({}, options), contextOptions));
|
|
104
102
|
if (!disableAuthenticateOnMount) {
|
|
105
103
|
agentManager.authenticate();
|
|
106
104
|
}
|
package/dist/createReactor.d.ts
CHANGED
|
@@ -35,9 +35,9 @@ import type { BaseActor, CreateReactorParameters, CreateReactorReturnType } from
|
|
|
35
35
|
* canisterId,
|
|
36
36
|
* idlFactory,
|
|
37
37
|
* host: "https://localhost:8000", // IC network host |
|
|
38
|
-
* withLocalEnv: true, // Set true for local network
|
|
38
|
+
* withLocalEnv: true, // Set true for local network | one of these
|
|
39
39
|
* withProcessEnv: true, // Use process.env to determine host |
|
|
40
|
-
* port: 8000, // Port number for local network
|
|
40
|
+
* port: 8000, // Port number for local network
|
|
41
41
|
* };
|
|
42
42
|
*
|
|
43
43
|
* export type YourActor = typeof yourActor;
|
package/dist/createReactor.js
CHANGED
|
@@ -39,9 +39,9 @@ const helpers_1 = require("./helpers");
|
|
|
39
39
|
* canisterId,
|
|
40
40
|
* idlFactory,
|
|
41
41
|
* host: "https://localhost:8000", // IC network host |
|
|
42
|
-
* withLocalEnv: true, // Set true for local network
|
|
42
|
+
* withLocalEnv: true, // Set true for local network | one of these
|
|
43
43
|
* withProcessEnv: true, // Use process.env to determine host |
|
|
44
|
-
* port: 8000, // Port number for local network
|
|
44
|
+
* port: 8000, // Port number for local network
|
|
45
45
|
* };
|
|
46
46
|
*
|
|
47
47
|
* export type YourActor = typeof yourActor;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ic-reactor/react",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.5-beta.1",
|
|
4
4
|
"description": "A React library for interacting with Internet Computer canisters",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"node": ">=10"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@ic-reactor/core": "^1.5.
|
|
38
|
+
"@ic-reactor/core": "^1.5.4-beta.1",
|
|
39
39
|
"zustand-utils": "^1.3"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"react": ">=16.8",
|
|
48
48
|
"zustand": "4.5"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "8ebd455fbb68d838b5bd5a477c004306560397bb"
|
|
51
51
|
}
|