@ic-reactor/react 1.5.3 → 1.5.4
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/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IDL, ActorHooksReturnType, AgentHooksReturnType, AuthHooksReturnType, BaseActor, AgentManager, ActorManagerParameters, AgentManagerParameters } from "../types";
|
|
1
|
+
import type { IDL, ActorHooksReturnType, AgentHooksReturnType, AuthHooksReturnType, BaseActor, AgentManager, ActorManagerParameters, AgentManagerParameters, CanisterId } from "../types";
|
|
2
2
|
import type { PropsWithChildren } from "react";
|
|
3
3
|
export interface AgentContext extends AgentHooksReturnType, AuthHooksReturnType {
|
|
4
4
|
agentManager: AgentManager;
|
|
@@ -24,6 +24,6 @@ export interface ActorProviderProps extends CreateActorContextParameters {
|
|
|
24
24
|
}
|
|
25
25
|
export interface CreateActorContextParameters extends Omit<ActorManagerParameters, "idlFactory" | "agentManager" | "canisterId"> {
|
|
26
26
|
didjsId?: string;
|
|
27
|
-
canisterId?:
|
|
27
|
+
canisterId?: CanisterId;
|
|
28
28
|
idlFactory?: IDL.InterfaceFactory;
|
|
29
29
|
}
|
package/dist/helpers/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ServiceClass } from "@dfinity/candid/lib/cjs/idl";
|
|
3
|
-
import type { ActorState,
|
|
3
|
+
import type { ActorState, AuthClientLoginOptions, ActorMethodParameters, ActorMethodReturnType, Identity, Principal, FunctionName, VisitService, AuthState, HttpAgent, AgentState, BaseActor, MethodAttributes } from "@ic-reactor/core/dist/types";
|
|
4
4
|
export interface AgentHooksReturnType {
|
|
5
5
|
useAgent: () => HttpAgent | undefined;
|
|
6
6
|
useAgentState: () => AgentState;
|
|
@@ -39,7 +39,7 @@ export type LogoutParameters = {
|
|
|
39
39
|
returnTo?: string;
|
|
40
40
|
};
|
|
41
41
|
export interface UseActorState extends Omit<ActorState, "methodState"> {
|
|
42
|
-
canisterId:
|
|
42
|
+
canisterId: string;
|
|
43
43
|
}
|
|
44
44
|
export type UseSharedCallParameters<A, M extends FunctionName<A>> = {
|
|
45
45
|
functionName: M;
|
package/dist/hooks/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IDL } from "@dfinity/candid";
|
|
2
|
-
import { ActorHooksReturnType, ActorManagerParameters, BaseActor } from "../types";
|
|
2
|
+
import { ActorHooksReturnType, ActorManagerParameters, BaseActor, CanisterId } from "../types";
|
|
3
3
|
export interface UseActorParameters extends Omit<ActorManagerParameters, "idlFactory" | "agentManager" | "canisterId"> {
|
|
4
|
-
canisterId:
|
|
4
|
+
canisterId: CanisterId;
|
|
5
5
|
idlFactory?: IDL.InterfaceFactory;
|
|
6
6
|
didjsCanisterId?: string;
|
|
7
7
|
}
|
package/dist/hooks/useActor.js
CHANGED
|
@@ -96,7 +96,7 @@ const useActor = (config) => {
|
|
|
96
96
|
}
|
|
97
97
|
const [actorManager, setActorManager] = (0, react_1.useState)(null);
|
|
98
98
|
(0, react_1.useEffect)(() => {
|
|
99
|
-
if ((actorManager === null || actorManager === void 0 ? void 0 : actorManager.canisterId) !== canisterId) {
|
|
99
|
+
if ((actorManager === null || actorManager === void 0 ? void 0 : actorManager.canisterId) !== canisterId.toString()) {
|
|
100
100
|
setActorManager(null);
|
|
101
101
|
}
|
|
102
102
|
return actorManager === null || actorManager === void 0 ? void 0 : actorManager.cleanup();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ic-reactor/react",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.4",
|
|
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.3",
|
|
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": "8a92edfc841cfd1899f008a094846166886e8f33"
|
|
51
51
|
}
|