@ic-reactor/core 1.4.2 → 1.5.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.4.1/ic-reactor-core.min.js"></script>
22
+ <script src="https://github.com/B3Pay/ic-reactor/releases/download/v1.4.2/ic-reactor-core.min.js"></script>
23
23
  ```
24
24
 
25
25
  ### Using `createReactorCore`
@@ -101,27 +101,27 @@ import { createAgentManager } from "@ic-reactor/core"
101
101
  export const agentManager = createAgentManager() // Connects to IC network by default
102
102
  ```
103
103
 
104
- Then you can create a reactor for each canister:
104
+ Then you can create a Actor for each canister:
105
105
 
106
106
  ```typescript
107
107
  // Assuming you've already set up `candidA`, `candidB`, and `agentManager`
108
108
  import { createActorManager } from "@ic-reactor/core"
109
- import candidA from "./declarations/candidA"
110
- import candidB from "./declarations/candidB"
109
+ import * as candidA from "./declarations/candidA"
110
+ import * as candidB from "./declarations/candidB"
111
111
  import { agentManager } from "./agent"
112
112
 
113
- type CandidA = typeof candidA
114
- type CandidB = typeof candidB
113
+ type CandidA = typeof candidA.candidA
114
+ type CandidB = typeof candidB.candidB
115
115
 
116
116
  const actorA = createActorManager<CandidA>({
117
117
  agentManager,
118
- canisterId: canisterIdA,
118
+ canisterId: candidA.canisterId,
119
119
  idlFactory: candidA.idlFactory,
120
120
  })
121
121
 
122
122
  const actorB = createActorManager<CandidB>({
123
123
  agentManager,
124
- canisterId: canisterIdB,
124
+ canisterId: candidB.canisterId,
125
125
  idlFactory: candidB.idlFactory,
126
126
  })
127
127
  ```
@@ -129,17 +129,16 @@ const actorB = createActorManager<CandidB>({
129
129
  You can now use the `actorA` and `actorB` instances to interact with their respective canisters:
130
130
 
131
131
  ```typescript
132
- // Example usage with CanisterA calling a method that requires one argument
133
- const { dataPromise: versionActorA } = actorA.queryCall({
132
+ const { dataPromise: version } = actorA.queryCall({
134
133
  functionName: "version",
135
134
  })
136
- console.log("Response from CanisterA method:", await versionActorA)
135
+ console.log("Response from CanisterA method:", await version)
137
136
 
138
- // Example usage with CanisterB calling a different method also with two arguments
139
- const { dataPromise: versionActorB } = actorB.queryCall({
140
- functionName: "version",
137
+ const { dataPromise: balance } = actorB.queryCall({
138
+ functionName: "balance",
139
+ args: [principal, []],
141
140
  })
142
- console.log("Response from CanisterB method:", await versionActorB)
141
+ console.log("Response from CanisterB method:", await balance)
143
142
  ```
144
143
 
145
144
  ### Using Candid Adapter
@@ -6,6 +6,6 @@ import type { BaseActor, CreateReactorStoreParameters } from "./types";
6
6
  * It also creates a new actor manager with the given options.
7
7
  *
8
8
  * @category Main
9
- * @includeExample ./packages/core/README.md:200-226
9
+ * @includeExample ./packages/core/README.md:200-225
10
10
  */
11
11
  export declare const createReactorStore: <A = BaseActor>(config: CreateReactorStoreParameters) => ActorManager<A>;
@@ -21,7 +21,7 @@ const createAgentManager_1 = require("./createAgentManager");
21
21
  * It also creates a new actor manager with the given options.
22
22
  *
23
23
  * @category Main
24
- * @includeExample ./packages/core/README.md:200-226
24
+ * @includeExample ./packages/core/README.md:200-225
25
25
  */
26
26
  const createReactorStore = (config) => {
27
27
  const withLocalEnv = config.withProcessEnv
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ic-reactor/core",
3
- "version": "1.4.2",
3
+ "version": "1.5.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",
@@ -52,5 +52,5 @@
52
52
  "engines": {
53
53
  "node": ">=10"
54
54
  },
55
- "gitHead": "89bab92f75cbbe39c9bdd6a0ac60344c6844ce5d"
55
+ "gitHead": "02efba3e5948cb004777b8b54d623c4c537d3354"
56
56
  }