@xyo-network/react-diviner 2.45.0-rc.15 → 2.45.0-rc.17

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,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useDiviner = void 0;
3
+ exports.useWrappedDiviner = exports.useDiviner = void 0;
4
4
  const diviner_1 = require("@xyo-network/diviner");
5
5
  const react_node_1 = require("@xyo-network/react-node");
6
- exports.useDiviner = (0, react_node_1.createUseModuleHook)((module) => diviner_1.DivinerWrapper.tryWrap(module), react_node_1.useNode);
6
+ const useDiviner = (nameOrAddress) => (0, react_node_1.useModule)(nameOrAddress);
7
+ exports.useDiviner = useDiviner;
8
+ exports.useWrappedDiviner = (0, react_node_1.WrappedModuleHookFactory)(diviner_1.DivinerWrapper);
7
9
  //# sourceMappingURL=useDiviner.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDiviner.js","sourceRoot":"","sources":["../../../src/hooks/useDiviner.tsx"],"names":[],"mappings":";;;AAAA,kDAAoE;AACpE,wDAAsE;AAEzD,QAAA,UAAU,GAAG,IAAA,gCAAmB,EAAgC,CAAC,MAAM,EAAE,EAAE,CAAC,wBAAc,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,oBAAO,CAAC,CAAA"}
1
+ {"version":3,"file":"useDiviner.js","sourceRoot":"","sources":["../../../src/hooks/useDiviner.tsx"],"names":[],"mappings":";;;AAAA,kDAAoE;AACpE,wDAA6E;AAEtE,MAAM,UAAU,GAAG,CAAC,aAAsB,EAAE,EAAE,CAAC,IAAA,sBAAS,EAAgB,aAAa,CAAC,CAAA;AAAhF,QAAA,UAAU,cAAsE;AAEhF,QAAA,iBAAiB,GAAG,IAAA,qCAAwB,EAAC,wBAAc,CAAC,CAAA"}
package/dist/docs.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "fileName": "packages/modules/packages/diviner/src/hooks/useDiviner.tsx",
18
18
  "line": 4,
19
19
  "character": 13,
20
- "url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/d1ecbe2d7cb/packages/modules/packages/diviner/src/hooks/useDiviner.tsx#L4"
20
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/3f15245d6e5/packages/modules/packages/diviner/src/hooks/useDiviner.tsx#L4"
21
21
  }
22
22
  ],
23
23
  "signatures": [
@@ -30,7 +30,7 @@
30
30
  "parameters": [
31
31
  {
32
32
  "id": 3,
33
- "name": "name",
33
+ "name": "nameOrAddress",
34
34
  "kind": 32768,
35
35
  "kindString": "Parameter",
36
36
  "flags": {
@@ -147,322 +147,57 @@
147
147
  }
148
148
  ]
149
149
  }
150
- },
151
- {
152
- "id": 7,
153
- "name": "useDiviner",
154
- "kind": 4096,
155
- "kindString": "Call signature",
156
- "flags": {},
157
- "parameters": [
158
- {
159
- "id": 8,
160
- "name": "name",
161
- "kind": 32768,
162
- "kindString": "Parameter",
163
- "flags": {},
164
- "type": {
165
- "type": "union",
166
- "types": [
167
- {
168
- "type": "intrinsic",
169
- "name": "undefined"
170
- },
171
- {
172
- "type": "intrinsic",
173
- "name": "string"
174
- }
175
- ]
176
- }
177
- },
178
- {
179
- "id": 9,
180
- "name": "wrap",
181
- "kind": 32768,
182
- "kindString": "Parameter",
183
- "flags": {},
184
- "type": {
185
- "type": "union",
186
- "types": [
187
- {
188
- "type": "literal",
189
- "value": true
190
- },
191
- {
192
- "type": "reference",
193
- "name": "Account",
194
- "qualifiedName": "Account",
195
- "package": "@xyo-network/account"
196
- }
197
- ]
198
- }
199
- }
200
- ],
201
- "type": {
202
- "type": "tuple",
203
- "elements": [
204
- {
205
- "type": "union",
206
- "types": [
207
- {
208
- "type": "intrinsic",
209
- "name": "undefined"
210
- },
211
- {
212
- "type": "reference",
213
- "name": "DivinerWrapper",
214
- "qualifiedName": "DivinerWrapper",
215
- "package": "@xyo-network/diviner-wrapper"
216
- }
217
- ]
218
- },
219
- {
220
- "type": "union",
221
- "types": [
222
- {
223
- "type": "intrinsic",
224
- "name": "undefined"
225
- },
226
- {
227
- "type": "reference",
228
- "name": "Error",
229
- "qualifiedName": "Error",
230
- "package": "typescript"
231
- }
232
- ]
233
- }
234
- ]
235
- }
236
- },
150
+ }
151
+ ]
152
+ },
153
+ {
154
+ "id": 7,
155
+ "name": "useWrappedDiviner",
156
+ "kind": 64,
157
+ "kindString": "Function",
158
+ "flags": {},
159
+ "sources": [
237
160
  {
238
- "id": 10,
239
- "name": "useDiviner",
240
- "kind": 4096,
241
- "kindString": "Call signature",
242
- "flags": {},
243
- "parameters": [
244
- {
245
- "id": 11,
246
- "name": "wrap",
247
- "kind": 32768,
248
- "kindString": "Parameter",
249
- "flags": {},
250
- "type": {
251
- "type": "union",
252
- "types": [
253
- {
254
- "type": "literal",
255
- "value": true
256
- },
257
- {
258
- "type": "reference",
259
- "name": "Account",
260
- "qualifiedName": "Account",
261
- "package": "@xyo-network/account"
262
- }
263
- ]
264
- }
265
- }
266
- ],
267
- "type": {
268
- "type": "tuple",
269
- "elements": [
270
- {
271
- "type": "union",
272
- "types": [
273
- {
274
- "type": "intrinsic",
275
- "name": "undefined"
276
- },
277
- {
278
- "type": "reference",
279
- "name": "DivinerWrapper",
280
- "qualifiedName": "DivinerWrapper",
281
- "package": "@xyo-network/diviner-wrapper"
282
- }
283
- ]
284
- },
285
- {
286
- "type": "union",
287
- "types": [
288
- {
289
- "type": "intrinsic",
290
- "name": "undefined"
291
- },
292
- {
293
- "type": "reference",
294
- "name": "Error",
295
- "qualifiedName": "Error",
296
- "package": "typescript"
297
- }
298
- ]
299
- }
300
- ]
301
- }
302
- },
161
+ "fileName": "packages/modules/packages/diviner/src/hooks/useDiviner.tsx",
162
+ "line": 6,
163
+ "character": 13,
164
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/3f15245d6e5/packages/modules/packages/diviner/src/hooks/useDiviner.tsx#L6"
165
+ }
166
+ ],
167
+ "signatures": [
303
168
  {
304
- "id": 12,
305
- "name": "useDiviner",
169
+ "id": 8,
170
+ "name": "useWrappedDiviner",
306
171
  "kind": 4096,
307
172
  "kindString": "Call signature",
308
173
  "flags": {},
309
174
  "parameters": [
310
175
  {
311
- "id": 13,
312
- "name": "address",
176
+ "id": 9,
177
+ "name": "nameOrAddress",
313
178
  "kind": 32768,
314
179
  "kindString": "Parameter",
315
- "flags": {},
316
- "type": {
317
- "type": "intrinsic",
318
- "name": "string"
319
- }
320
- }
321
- ],
322
- "type": {
323
- "type": "tuple",
324
- "elements": [
325
- {
326
- "type": "union",
327
- "types": [
328
- {
329
- "type": "intrinsic",
330
- "name": "undefined"
331
- },
332
- {
333
- "type": "reference",
334
- "typeArguments": [
335
- {
336
- "type": "intersection",
337
- "types": [
338
- {
339
- "type": "reference",
340
- "name": "SchemaFields",
341
- "qualifiedName": "SchemaFields",
342
- "package": "@xyo-network/payload-model"
343
- },
344
- {
345
- "type": "reference",
346
- "name": "PayloadFields",
347
- "qualifiedName": "PayloadFields",
348
- "package": "@xyo-network/payload-model"
349
- },
350
- {
351
- "type": "reflection",
352
- "declaration": {
353
- "id": 14,
354
- "name": "__type",
355
- "kind": 65536,
356
- "kindString": "Type literal",
357
- "flags": {},
358
- "sources": [
359
- {
360
- "fileName": "node_modules/@xyo-network/module-model/dist/types/Config.d.ts",
361
- "line": 8,
362
- "character": 75
363
- }
364
- ]
365
- }
366
- },
367
- {
368
- "type": "reflection",
369
- "declaration": {
370
- "id": 15,
371
- "name": "__type",
372
- "kind": 65536,
373
- "kindString": "Type literal",
374
- "flags": {},
375
- "sources": [
376
- {
377
- "fileName": "node_modules/@xyo-network/diviner-model/dist/types/Config.d.ts",
378
- "line": 5,
379
- "character": 123
380
- }
381
- ]
382
- }
383
- },
384
- {
385
- "type": "reflection",
386
- "declaration": {
387
- "id": 16,
388
- "name": "__type",
389
- "kind": 65536,
390
- "kindString": "Type literal",
391
- "flags": {},
392
- "sources": [
393
- {
394
- "fileName": "node_modules/@xyo-network/payload-model/dist/types/XyoPayload.d.ts",
395
- "line": 18,
396
- "character": 17
397
- }
398
- ]
399
- }
400
- }
401
- ]
402
- }
403
- ],
404
- "name": "DivinerModule",
405
- "qualifiedName": "DivinerModule",
406
- "package": "@xyo-network/diviner-model"
407
- }
408
- ]
180
+ "flags": {
181
+ "isOptional": true
409
182
  },
410
- {
411
- "type": "union",
412
- "types": [
413
- {
414
- "type": "intrinsic",
415
- "name": "undefined"
416
- },
417
- {
418
- "type": "reference",
419
- "name": "Error",
420
- "qualifiedName": "Error",
421
- "package": "typescript"
422
- }
423
- ]
424
- }
425
- ]
426
- }
427
- },
428
- {
429
- "id": 17,
430
- "name": "useDiviner",
431
- "kind": 4096,
432
- "kindString": "Call signature",
433
- "flags": {},
434
- "parameters": [
435
- {
436
- "id": 18,
437
- "name": "address",
438
- "kind": 32768,
439
- "kindString": "Parameter",
440
- "flags": {},
441
183
  "type": {
442
184
  "type": "intrinsic",
443
185
  "name": "string"
444
186
  }
445
187
  },
446
188
  {
447
- "id": 19,
448
- "name": "wrap",
189
+ "id": 10,
190
+ "name": "account",
449
191
  "kind": 32768,
450
192
  "kindString": "Parameter",
451
- "flags": {},
193
+ "flags": {
194
+ "isOptional": true
195
+ },
452
196
  "type": {
453
- "type": "union",
454
- "types": [
455
- {
456
- "type": "literal",
457
- "value": true
458
- },
459
- {
460
- "type": "reference",
461
- "name": "Account",
462
- "qualifiedName": "Account",
463
- "package": "@xyo-network/account"
464
- }
465
- ]
197
+ "type": "reference",
198
+ "name": "AccountInstance",
199
+ "qualifiedName": "AccountInstance",
200
+ "package": "@xyo-network/account-model"
466
201
  }
467
202
  }
468
203
  ],
@@ -509,7 +244,8 @@
509
244
  {
510
245
  "title": "Functions",
511
246
  "children": [
512
- 1
247
+ 1,
248
+ 7
513
249
  ]
514
250
  }
515
251
  ],
@@ -518,7 +254,7 @@
518
254
  "fileName": "packages/modules/packages/diviner/src/index.ts",
519
255
  "line": 1,
520
256
  "character": 0,
521
- "url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/d1ecbe2d7cb/packages/modules/packages/diviner/src/index.ts#L1"
257
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/3f15245d6e5/packages/modules/packages/diviner/src/index.ts#L1"
522
258
  }
523
259
  ]
524
260
  }
@@ -1,4 +1,5 @@
1
1
  import { DivinerWrapper } from '@xyo-network/diviner';
2
- import { createUseModuleHook, useNode } from '@xyo-network/react-node';
3
- export const useDiviner = createUseModuleHook((module) => DivinerWrapper.tryWrap(module), useNode);
2
+ import { useModule, WrappedModuleHookFactory } from '@xyo-network/react-node';
3
+ export const useDiviner = (nameOrAddress) => useModule(nameOrAddress);
4
+ export const useWrappedDiviner = WrappedModuleHookFactory(DivinerWrapper);
4
5
  //# sourceMappingURL=useDiviner.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDiviner.js","sourceRoot":"","sources":["../../../src/hooks/useDiviner.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACpE,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEtE,MAAM,CAAC,MAAM,UAAU,GAAG,mBAAmB,CAAgC,CAAC,MAAM,EAAE,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAA"}
1
+ {"version":3,"file":"useDiviner.js","sourceRoot":"","sources":["../../../src/hooks/useDiviner.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACpE,OAAO,EAAE,SAAS,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAA;AAE7E,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,aAAsB,EAAE,EAAE,CAAC,SAAS,CAAgB,aAAa,CAAC,CAAA;AAE7F,MAAM,CAAC,MAAM,iBAAiB,GAAG,wBAAwB,CAAC,cAAc,CAAC,CAAA"}
@@ -1,33 +1,16 @@
1
1
  import { DivinerModule, DivinerWrapper } from '@xyo-network/diviner';
2
- export declare const useDiviner: {
3
- (name?: string | undefined): [DivinerModule<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
4
- name?: string | undefined;
5
- security?: {
6
- allowAnonymous?: boolean | undefined;
7
- allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
8
- disallowed?: Record<string, string[]> | undefined;
9
- } | undefined;
10
- storeQueries?: boolean | undefined;
11
- } & {
12
- targetSchema?: string | undefined;
13
- } & {
14
- schema: string;
15
- }> | undefined, Error | undefined];
16
- (name: string | undefined, wrap: true | import("@xyo-network/account").Account): [DivinerWrapper | undefined, Error | undefined];
17
- (wrap: true | import("@xyo-network/account").Account): [DivinerWrapper | undefined, Error | undefined];
18
- (address: string): [DivinerModule<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
19
- name?: string | undefined;
20
- security?: {
21
- allowAnonymous?: boolean | undefined;
22
- allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
23
- disallowed?: Record<string, string[]> | undefined;
24
- } | undefined;
25
- storeQueries?: boolean | undefined;
26
- } & {
27
- targetSchema?: string | undefined;
28
- } & {
29
- schema: string;
30
- }> | undefined, Error | undefined];
31
- (address: string, wrap: true | import("@xyo-network/account").Account): [DivinerWrapper | undefined, Error | undefined];
32
- };
2
+ export declare const useDiviner: (nameOrAddress?: string) => [DivinerModule<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
3
+ name?: string | undefined;
4
+ security?: {
5
+ allowAnonymous?: boolean | undefined;
6
+ allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
7
+ disallowed?: Record<string, string[]> | undefined;
8
+ } | undefined;
9
+ storeQueries?: boolean | undefined;
10
+ } & {
11
+ targetSchema?: string | undefined;
12
+ } & {
13
+ schema: string;
14
+ }> | undefined, Error | undefined];
15
+ export declare const useWrappedDiviner: (nameOrAddress?: string | undefined, account?: import("@xyo-network/account-model").AccountInstance | undefined) => [DivinerWrapper | undefined, Error | undefined];
33
16
  //# sourceMappingURL=useDiviner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDiviner.d.ts","sourceRoot":"","sources":["../../../src/hooks/useDiviner.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAGpE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAA0G,CAAA"}
1
+ {"version":3,"file":"useDiviner.d.ts","sourceRoot":"","sources":["../../../src/hooks/useDiviner.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAGpE,eAAO,MAAM,UAAU,mBAAoB,MAAM;;;;;;;;;;;;kCAA4C,CAAA;AAE7F,eAAO,MAAM,iBAAiB,qKAA2C,CAAA"}
package/package.json CHANGED
@@ -14,9 +14,9 @@
14
14
  "@xylabs/react-flexbox": "^2.16.8",
15
15
  "@xylabs/react-shared": "^2.16.8",
16
16
  "@xyo-network/node": "^2.51.2",
17
- "@xyo-network/react-module": "^2.45.0-rc.15",
18
- "@xyo-network/react-node": "^2.45.0-rc.15",
19
- "@xyo-network/react-shared": "^2.45.0-rc.15",
17
+ "@xyo-network/react-module": "^2.45.0-rc.17",
18
+ "@xyo-network/react-node": "^2.45.0-rc.17",
19
+ "@xyo-network/react-shared": "^2.45.0-rc.17",
20
20
  "lodash": "^4.17.21"
21
21
  },
22
22
  "peerDependencies": {
@@ -33,13 +33,13 @@
33
33
  "devDependencies": {
34
34
  "@storybook/react": "^6.5.16",
35
35
  "@types/lodash": "^4.14.191",
36
- "@xylabs/ts-scripts-yarn3": "^2.16.0",
37
- "@xylabs/tsconfig-react": "^2.16.0",
36
+ "@xylabs/ts-scripts-yarn3": "^2.16.1",
37
+ "@xylabs/tsconfig-react": "^2.16.1",
38
38
  "@xyo-network/archivist": "^2.51.2",
39
39
  "@xyo-network/archivist-wrapper": "^2.51.2",
40
40
  "@xyo-network/module": "^2.51.2",
41
41
  "@xyo-network/payload-model": "^2.51.2",
42
- "@xyo-network/react-storybook": "^2.45.0-rc.15",
42
+ "@xyo-network/react-storybook": "^2.45.0-rc.17",
43
43
  "require-from-string": "^2.0.2",
44
44
  "typescript": "^4.9.5"
45
45
  },
@@ -85,6 +85,6 @@
85
85
  },
86
86
  "sideEffects": false,
87
87
  "types": "dist/types/index.d.ts",
88
- "version": "2.45.0-rc.15",
88
+ "version": "2.45.0-rc.17",
89
89
  "stableVersion": "2.44.1"
90
90
  }
@@ -1,4 +1,6 @@
1
1
  import { DivinerModule, DivinerWrapper } from '@xyo-network/diviner'
2
- import { createUseModuleHook, useNode } from '@xyo-network/react-node'
2
+ import { useModule, WrappedModuleHookFactory } from '@xyo-network/react-node'
3
3
 
4
- export const useDiviner = createUseModuleHook<DivinerModule, DivinerWrapper>((module) => DivinerWrapper.tryWrap(module), useNode)
4
+ export const useDiviner = (nameOrAddress?: string) => useModule<DivinerModule>(nameOrAddress)
5
+
6
+ export const useWrappedDiviner = WrappedModuleHookFactory(DivinerWrapper)