@ic-reactor/core 1.10.2 → 1.10.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.
@@ -1,9 +1,8 @@
1
1
  import { HttpAgent } from "@dfinity/agent";
2
2
  import { AuthClient } from "@dfinity/auth-client";
3
3
  import type { AuthClientLoginOptions } from "../../types";
4
- import type { AgentStore, AgentManagerParameters, UpdateAgentParameters, AuthState, AuthStore } from "./types";
4
+ import type { AgentStore, AgentManagerParameters, UpdateAgentParameters, AuthStore } from "./types";
5
5
  export declare class AgentManager {
6
- private _anonymousAgent;
7
6
  private _agent;
8
7
  private _auth;
9
8
  private _subscribers;
@@ -12,7 +11,7 @@ export declare class AgentManager {
12
11
  private initialAgentState;
13
12
  private initialAuthState;
14
13
  private updateAgentState;
15
- updateAuthState: (newState: Partial<AuthState>, action?: string) => void;
14
+ private updateAuthState;
16
15
  constructor(options?: AgentManagerParameters);
17
16
  private initializeAgent;
18
17
  subscribeAgent: (callback: (agent: HttpAgent) => void, initialize?: boolean) => () => void;
@@ -46,7 +46,6 @@ class AgentManager {
46
46
  this.updateAgentState = (newState, action) => {
47
47
  this.agentStore.setState((state) => (Object.assign(Object.assign({}, state), newState)), false, action);
48
48
  };
49
- //TODO: make it private
50
49
  this.updateAuthState = (newState, action) => {
51
50
  this.authStore.setState((state) => (Object.assign(Object.assign({}, state), newState)), false, action);
52
51
  };
@@ -60,7 +59,6 @@ class AgentManager {
60
59
  if (network !== "ic") {
61
60
  try {
62
61
  yield this._agent.fetchRootKey();
63
- yield this._anonymousAgent.fetchRootKey();
64
62
  }
65
63
  catch (error) {
66
64
  this.updateAgentState({ error: error, initializing: false }, "error");
@@ -207,7 +205,6 @@ class AgentManager {
207
205
  name: "reactor-agent",
208
206
  store: "auth",
209
207
  });
210
- this._anonymousAgent = agent_1.HttpAgent.createSync(agentOptions);
211
208
  this._agent = agent_1.HttpAgent.createSync(agentOptions);
212
209
  this.initializeAgent();
213
210
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ic-reactor/core",
3
- "version": "1.10.2",
3
+ "version": "1.10.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",
@@ -56,5 +56,5 @@
56
56
  "engines": {
57
57
  "node": ">=10"
58
58
  },
59
- "gitHead": "3c9a15a85b8fcef02c5a3aaaeffecb91ad647ed2"
59
+ "gitHead": "1603c5f57869353d4a3d1c18d08f303b0d03fe6d"
60
60
  }