@xyo-network/react-chain-provider 1.15.2 → 1.15.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/README.md +241 -7
- package/dist/browser/components/connected/ConnectAccountsStack.d.ts +14 -0
- package/dist/browser/components/connected/ConnectAccountsStack.d.ts.map +1 -0
- package/dist/browser/components/connected/ConnectAccountsStack.stories.d.ts +6 -0
- package/dist/browser/components/connected/ConnectAccountsStack.stories.d.ts.map +1 -0
- package/dist/browser/components/connected/account/Connected.d.ts +5 -0
- package/dist/browser/components/connected/account/Connected.d.ts.map +1 -0
- package/dist/browser/components/connected/account/index.d.ts +2 -0
- package/dist/browser/components/connected/account/index.d.ts.map +1 -0
- package/dist/browser/components/connected/index.d.ts +3 -0
- package/dist/browser/components/connected/index.d.ts.map +1 -0
- package/dist/browser/components/index.d.ts +2 -0
- package/dist/browser/components/index.d.ts.map +1 -0
- package/dist/browser/hooks/client/helpers/findCaveat.d.ts +4 -0
- package/dist/browser/hooks/client/helpers/findCaveat.d.ts.map +1 -0
- package/dist/browser/hooks/client/helpers/index.d.ts +2 -0
- package/dist/browser/hooks/client/helpers/index.d.ts.map +1 -0
- package/dist/browser/hooks/client/index.d.ts +4 -0
- package/dist/browser/hooks/client/index.d.ts.map +1 -0
- package/dist/browser/hooks/client/permissions/index.d.ts +3 -0
- package/dist/browser/hooks/client/permissions/index.d.ts.map +1 -0
- package/dist/browser/hooks/client/permissions/usePermissions.d.ts +7 -0
- package/dist/browser/hooks/client/permissions/usePermissions.d.ts.map +1 -0
- package/dist/browser/hooks/client/permissions/usePermissionsAccounts.d.ts +2 -0
- package/dist/browser/hooks/client/permissions/usePermissionsAccounts.d.ts.map +1 -0
- package/dist/browser/hooks/{useClient.d.ts → client/useClient.d.ts} +2 -1
- package/dist/browser/hooks/client/useClient.d.ts.map +1 -0
- package/dist/browser/hooks/{useGateway.d.ts → client/useGateway.d.ts} +2 -1
- package/dist/browser/hooks/client/useGateway.d.ts.map +1 -0
- package/dist/browser/hooks/helpers/getXyoClient.d.ts +4 -2
- package/dist/browser/hooks/helpers/getXyoClient.d.ts.map +1 -1
- package/dist/browser/hooks/index.d.ts +1 -2
- package/dist/browser/hooks/index.d.ts.map +1 -1
- package/dist/browser/hooks/useConnectAccount.d.ts +4 -2
- package/dist/browser/hooks/useConnectAccount.d.ts.map +1 -1
- package/dist/browser/hooks/useCurrentBlock.d.ts +1 -1
- package/dist/browser/hooks/useCurrentBlock.d.ts.map +1 -1
- package/dist/browser/hooks/viewer/UseStepRewardWeightTest.stories.d.ts +12 -0
- package/dist/browser/hooks/viewer/UseStepRewardWeightTest.stories.d.ts.map +1 -0
- package/dist/browser/hooks/viewer/useViewerFromWallet.d.ts +1 -1
- package/dist/browser/hooks/viewer/useViewerFromWallet.d.ts.map +1 -1
- package/dist/browser/hooks/viewer/useViewerFromWallet.stories.d.ts.map +1 -1
- package/dist/browser/index.d.ts +1 -0
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.mjs +233 -144
- package/dist/browser/index.mjs.map +1 -1
- package/package.json +31 -22
- package/src/components/connected/ConnectAccountsStack.stories.tsx +16 -0
- package/src/components/connected/ConnectAccountsStack.tsx +41 -0
- package/src/components/connected/account/Connected.tsx +19 -0
- package/src/components/connected/account/index.ts +1 -0
- package/src/components/connected/index.ts +2 -0
- package/src/components/index.ts +1 -0
- package/src/hooks/client/helpers/findCaveat.ts +19 -0
- package/src/hooks/client/helpers/index.ts +1 -0
- package/src/hooks/client/index.ts +3 -0
- package/src/hooks/client/permissions/index.ts +2 -0
- package/src/hooks/client/permissions/usePermissions.ts +14 -0
- package/src/hooks/client/permissions/usePermissionsAccounts.ts +38 -0
- package/src/hooks/{useClient.ts → client/useClient.ts} +15 -7
- package/src/hooks/{useGateway.ts → client/useGateway.ts} +4 -3
- package/src/hooks/helpers/getXyoClient.ts +9 -6
- package/src/hooks/index.ts +1 -2
- package/src/hooks/useConnectAccount.ts +11 -10
- package/src/hooks/useCurrentBlock.ts +3 -2
- package/src/hooks/viewer/UseStepRewardWeightTest.stories.tsx +82 -0
- package/src/hooks/viewer/useViewerFromWallet.stories.tsx +15 -8
- package/src/hooks/viewer/useViewerFromWallet.ts +12 -22
- package/src/index.ts +1 -0
- package/dist/browser/hooks/UseConnectAccount.stories.d.ts +0 -9
- package/dist/browser/hooks/UseConnectAccount.stories.d.ts.map +0 -1
- package/dist/browser/hooks/useClient.d.ts.map +0 -1
- package/dist/browser/hooks/useGateway.d.ts.map +0 -1
- package/dist/browser/hooks/viewer/resolveGateway.d.ts +0 -11
- package/dist/browser/hooks/viewer/resolveGateway.d.ts.map +0 -1
- package/src/hooks/UseConnectAccount.stories.tsx +0 -35
- package/src/hooks/viewer/resolveGateway.ts +0 -54
package/README.md
CHANGED
|
@@ -20,16 +20,62 @@ XYO Layer One API
|
|
|
20
20
|
|
|
21
21
|
## Functions
|
|
22
22
|
|
|
23
|
+
- [listenForClientInjection](#functions/listenForClientInjection)
|
|
24
|
+
- [getXyoClient](#functions/getXyoClient)
|
|
23
25
|
- [useAddressBalance](#functions/useAddressBalance)
|
|
26
|
+
- [useClient](#functions/useClient)
|
|
27
|
+
- [useConnectAccount](#functions/useConnectAccount)
|
|
24
28
|
- [useCurrentBlock](#functions/useCurrentBlock)
|
|
29
|
+
- [useGateway](#functions/useGateway)
|
|
25
30
|
- [useHttpRpcRunner](#functions/useHttpRpcRunner)
|
|
26
31
|
- [useNetwork](#functions/useNetwork)
|
|
27
32
|
- [useSigner](#functions/useSigner)
|
|
33
|
+
- [useCheckLocalRpc](#functions/useCheckLocalRpc)
|
|
34
|
+
- [useCheckSequenceRpc](#functions/useCheckSequenceRpc)
|
|
35
|
+
- [useCheckRpc](#functions/useCheckRpc)
|
|
28
36
|
- [useHttpRpcViewer](#functions/useHttpRpcViewer)
|
|
29
37
|
- [useViewerFromWallet](#functions/useViewerFromWallet)
|
|
30
38
|
|
|
31
39
|
### functions
|
|
32
40
|
|
|
41
|
+
### <a id="getXyoClient"></a>getXyoClient
|
|
42
|
+
|
|
43
|
+
[**@xyo-network/react-chain-provider**](#../README)
|
|
44
|
+
|
|
45
|
+
***
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
function getXyoClient(): Promise<undefined | XyoClient>;
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Returns
|
|
52
|
+
|
|
53
|
+
`Promise`\<`undefined` \| `XyoClient`\>
|
|
54
|
+
|
|
55
|
+
### <a id="listenForClientInjection"></a>listenForClientInjection
|
|
56
|
+
|
|
57
|
+
[**@xyo-network/react-chain-provider**](#../README)
|
|
58
|
+
|
|
59
|
+
***
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
function listenForClientInjection(onClientReady, onTimeout): void;
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Parameters
|
|
66
|
+
|
|
67
|
+
### onClientReady
|
|
68
|
+
|
|
69
|
+
() => `void`
|
|
70
|
+
|
|
71
|
+
### onTimeout
|
|
72
|
+
|
|
73
|
+
() => `void`
|
|
74
|
+
|
|
75
|
+
## Returns
|
|
76
|
+
|
|
77
|
+
`void`
|
|
78
|
+
|
|
33
79
|
### <a id="useAddressBalance"></a>useAddressBalance
|
|
34
80
|
|
|
35
81
|
[**@xyo-network/react-chain-provider**](#../README)
|
|
@@ -47,7 +93,9 @@ function useAddressBalance(
|
|
|
47
93
|
|
|
48
94
|
### address?
|
|
49
95
|
|
|
50
|
-
`Lowercase`\<`string
|
|
96
|
+
`Brand`\<`Brand`\<`Lowercase`\<`string`\>, \{
|
|
97
|
+
\}\>, \{
|
|
98
|
+
\}\>
|
|
51
99
|
|
|
52
100
|
### viewer?
|
|
53
101
|
|
|
@@ -64,7 +112,11 @@ function useAddressBalance(
|
|
|
64
112
|
### address
|
|
65
113
|
|
|
66
114
|
```ts
|
|
67
|
-
address:
|
|
115
|
+
address:
|
|
116
|
+
| undefined
|
|
117
|
+
| Brand<Brand<Lowercase<string>, {
|
|
118
|
+
}>, {
|
|
119
|
+
}>;
|
|
68
120
|
```
|
|
69
121
|
|
|
70
122
|
### balanceForAddress
|
|
@@ -95,6 +147,150 @@ error: undefined | Error = balancesError;
|
|
|
95
147
|
|
|
96
148
|
```ts
|
|
97
149
|
loading: boolean;
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### <a id="useCheckLocalRpc"></a>useCheckLocalRpc
|
|
153
|
+
|
|
154
|
+
[**@xyo-network/react-chain-provider**](#../README)
|
|
155
|
+
|
|
156
|
+
***
|
|
157
|
+
|
|
158
|
+
```ts
|
|
159
|
+
function useCheckLocalRpc(): object;
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Returns
|
|
163
|
+
|
|
164
|
+
`object`
|
|
165
|
+
|
|
166
|
+
### isLocalProducer
|
|
167
|
+
|
|
168
|
+
```ts
|
|
169
|
+
isLocalProducer: boolean;
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### error
|
|
173
|
+
|
|
174
|
+
```ts
|
|
175
|
+
error: undefined | Error;
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### <a id="useCheckRpc"></a>useCheckRpc
|
|
179
|
+
|
|
180
|
+
[**@xyo-network/react-chain-provider**](#../README)
|
|
181
|
+
|
|
182
|
+
***
|
|
183
|
+
|
|
184
|
+
```ts
|
|
185
|
+
function useCheckRpc(endpoint?): object;
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## Parameters
|
|
189
|
+
|
|
190
|
+
### endpoint?
|
|
191
|
+
|
|
192
|
+
`string`
|
|
193
|
+
|
|
194
|
+
## Returns
|
|
195
|
+
|
|
196
|
+
`object`
|
|
197
|
+
|
|
198
|
+
### isLocalProducer
|
|
199
|
+
|
|
200
|
+
```ts
|
|
201
|
+
isLocalProducer: boolean;
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### error
|
|
205
|
+
|
|
206
|
+
```ts
|
|
207
|
+
error: undefined | Error;
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### <a id="useCheckSequenceRpc"></a>useCheckSequenceRpc
|
|
211
|
+
|
|
212
|
+
[**@xyo-network/react-chain-provider**](#../README)
|
|
213
|
+
|
|
214
|
+
***
|
|
215
|
+
|
|
216
|
+
```ts
|
|
217
|
+
function useCheckSequenceRpc(): object;
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## Returns
|
|
221
|
+
|
|
222
|
+
`object`
|
|
223
|
+
|
|
224
|
+
### isLocalProducer
|
|
225
|
+
|
|
226
|
+
```ts
|
|
227
|
+
isLocalProducer: boolean;
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### error
|
|
231
|
+
|
|
232
|
+
```ts
|
|
233
|
+
error: undefined | Error;
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### <a id="useClient"></a>useClient
|
|
237
|
+
|
|
238
|
+
[**@xyo-network/react-chain-provider**](#../README)
|
|
239
|
+
|
|
240
|
+
***
|
|
241
|
+
|
|
242
|
+
```ts
|
|
243
|
+
function useClient(): ClientState;
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
## Returns
|
|
247
|
+
|
|
248
|
+
`ClientState`
|
|
249
|
+
|
|
250
|
+
### <a id="useConnectAccount"></a>useConnectAccount
|
|
251
|
+
|
|
252
|
+
[**@xyo-network/react-chain-provider**](#../README)
|
|
253
|
+
|
|
254
|
+
***
|
|
255
|
+
|
|
256
|
+
```ts
|
|
257
|
+
function useConnectAccount(gatewayName): object;
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
## Parameters
|
|
261
|
+
|
|
262
|
+
### gatewayName
|
|
263
|
+
|
|
264
|
+
`GatewayName` = `MainNetwork.id`
|
|
265
|
+
|
|
266
|
+
## Returns
|
|
267
|
+
|
|
268
|
+
`object`
|
|
269
|
+
|
|
270
|
+
### address
|
|
271
|
+
|
|
272
|
+
```ts
|
|
273
|
+
address: undefined | string;
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### connectSigner()
|
|
277
|
+
|
|
278
|
+
```ts
|
|
279
|
+
connectSigner: () => Promise<Brand<Brand<Lowercase<string>, {
|
|
280
|
+
}>, {
|
|
281
|
+
}>>;
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
### Returns
|
|
285
|
+
|
|
286
|
+
`Promise`\<`Brand`\<`Brand`\<`Lowercase`\<`string`\>, \{
|
|
287
|
+
\}\>, \{
|
|
288
|
+
\}\>\>
|
|
289
|
+
|
|
290
|
+
### error
|
|
291
|
+
|
|
292
|
+
```ts
|
|
293
|
+
error: null | Error;
|
|
98
294
|
```
|
|
99
295
|
|
|
100
296
|
### <a id="useCurrentBlock"></a>useCurrentBlock
|
|
@@ -121,6 +317,44 @@ function useCurrentBlock(refresh, viewer?): [undefined | HydratedBlock, undefine
|
|
|
121
317
|
|
|
122
318
|
\[`undefined` \| `HydratedBlock`, `undefined` \| `Error`, `undefined` \| `UsePromiseState`\]
|
|
123
319
|
|
|
320
|
+
### <a id="useGateway"></a>useGateway
|
|
321
|
+
|
|
322
|
+
[**@xyo-network/react-chain-provider**](#../README)
|
|
323
|
+
|
|
324
|
+
***
|
|
325
|
+
|
|
326
|
+
```ts
|
|
327
|
+
function useGateway(gatewayName?): object;
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
## Parameters
|
|
331
|
+
|
|
332
|
+
### gatewayName?
|
|
333
|
+
|
|
334
|
+
`GatewayName`
|
|
335
|
+
|
|
336
|
+
## Returns
|
|
337
|
+
|
|
338
|
+
`object`
|
|
339
|
+
|
|
340
|
+
### gateway
|
|
341
|
+
|
|
342
|
+
```ts
|
|
343
|
+
gateway: undefined | XyoGatewayProvider;
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
### isLoading
|
|
347
|
+
|
|
348
|
+
```ts
|
|
349
|
+
isLoading: boolean;
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
### error
|
|
353
|
+
|
|
354
|
+
```ts
|
|
355
|
+
error: null | Error;
|
|
356
|
+
```
|
|
357
|
+
|
|
124
358
|
### <a id="useHttpRpcRunner"></a>useHttpRpcRunner
|
|
125
359
|
|
|
126
360
|
[**@xyo-network/react-chain-provider**](#../README)
|
|
@@ -195,7 +429,7 @@ function useSigner(_provider?, account?): undefined | XyoSigner;
|
|
|
195
429
|
|
|
196
430
|
### \_provider?
|
|
197
431
|
|
|
198
|
-
`
|
|
432
|
+
`XyoConnection`
|
|
199
433
|
|
|
200
434
|
### account?
|
|
201
435
|
|
|
@@ -212,7 +446,7 @@ function useSigner(_provider?, account?): undefined | XyoSigner;
|
|
|
212
446
|
***
|
|
213
447
|
|
|
214
448
|
```ts
|
|
215
|
-
function useViewerFromWallet(networkId?):
|
|
449
|
+
function useViewerFromWallet(networkId?): any;
|
|
216
450
|
```
|
|
217
451
|
|
|
218
452
|
Creates a JsonRpcXyoViewer instance based on the provided networkId.
|
|
@@ -221,15 +455,15 @@ Creates a JsonRpcXyoViewer instance based on the provided networkId.
|
|
|
221
455
|
|
|
222
456
|
### networkId?
|
|
223
457
|
|
|
224
|
-
`
|
|
458
|
+
`GatewayName`
|
|
225
459
|
|
|
226
460
|
a network id like 'sequence', 'local', etc.
|
|
227
461
|
|
|
228
462
|
## Returns
|
|
229
463
|
|
|
230
|
-
`
|
|
464
|
+
`any`
|
|
231
465
|
|
|
232
|
-
An instance of
|
|
466
|
+
An instance of XyoViewer if the networkId is found in wallet gateways
|
|
233
467
|
otherwise undefined.
|
|
234
468
|
|
|
235
469
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { StackProps } from '@mui/material';
|
|
2
|
+
import type { ComponentType, MouseEventHandler } from 'react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
export interface ConnectClientAccountsStackProps extends StackProps {
|
|
5
|
+
AccountComponent: ComponentType<{
|
|
6
|
+
account?: string;
|
|
7
|
+
}>;
|
|
8
|
+
ConnectComponent: ComponentType<{
|
|
9
|
+
onClick?: MouseEventHandler<HTMLElement>;
|
|
10
|
+
}>;
|
|
11
|
+
timeout?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare const ConnectAccountsStack: React.FC<ConnectClientAccountsStackProps>;
|
|
14
|
+
//# sourceMappingURL=ConnectAccountsStack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectAccountsStack.d.ts","sourceRoot":"","sources":["../../../../src/components/connected/ConnectAccountsStack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAM/C,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAC7D,OAAO,KAAK,MAAM,OAAO,CAAA;AASzB,MAAM,WAAW,+BAAgC,SAAQ,UAAU;IACjE,gBAAgB,EAAE,aAAa,CAAC;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACrD,gBAAgB,EAAE,aAAa,CAAC;QAAE,OAAO,CAAC,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAA;KAAE,CAAC,CAAA;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,+BAA+B,CAkB1E,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Meta } from '@storybook/react-vite';
|
|
2
|
+
declare const _default: Meta;
|
|
3
|
+
export default _default;
|
|
4
|
+
declare const Default: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react-vite").ReactRenderer, import("./ConnectAccountsStack.tsx").ConnectClientAccountsStackProps>;
|
|
5
|
+
export { Default };
|
|
6
|
+
//# sourceMappingURL=ConnectAccountsStack.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectAccountsStack.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/connected/ConnectAccountsStack.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,uBAAuB,CAAA;wBAQrD,IAAI;AAHT,wBAGS;AAIT,QAAA,MAAM,OAAO,wKAAoB,CAAA;AAGjC,OAAO,EAAE,OAAO,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Connected.d.ts","sourceRoot":"","sources":["../../../../../src/components/connected/account/Connected.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAW1D,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/connected/account/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/connected/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,4BAA4B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CaveatTypes, XyoPermissions } from '@xyo-network/xl1-protocol';
|
|
2
|
+
import type { ParentCapability } from '@xyo-network/xl1-rpc';
|
|
3
|
+
export declare const findCaveat: (permissions: XyoPermissions, targetCapability: ParentCapability, targetCaveatType: CaveatTypes) => Promise<string | number | boolean | import("@xyo-network/xl1-protocol").InvokerPermission[] | import("@xylabs/object").JsonObject | import("@xylabs/object").JsonArray>;
|
|
4
|
+
//# sourceMappingURL=findCaveat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findCaveat.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/client/helpers/findCaveat.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAE5D,eAAO,MAAM,UAAU,GACrB,aAAa,cAAc,EAC3B,kBAAkB,gBAAgB,EAClC,kBAAkB,WAAW,4KAW9B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/client/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/client/permissions/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,6BAA6B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePermissions.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/client/permissions/usePermissions.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc;;;;;CAW1B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePermissionsAccounts.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/client/permissions/usePermissionsAccounts.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,qBAAqB,uHAejC,CAAA"}
|
|
@@ -3,7 +3,8 @@ interface ClientState {
|
|
|
3
3
|
client?: XyoClient;
|
|
4
4
|
error: Error | null;
|
|
5
5
|
isLoading: boolean;
|
|
6
|
+
timedout: boolean;
|
|
6
7
|
}
|
|
7
|
-
export declare const useClient: () => ClientState;
|
|
8
|
+
export declare const useClient: (timeout?: number) => ClientState;
|
|
8
9
|
export {};
|
|
9
10
|
//# sourceMappingURL=useClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useClient.d.ts","sourceRoot":"","sources":["../../../../src/hooks/client/useClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAK1D,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;IACnB,SAAS,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,OAAO,CAAA;CAClB;AAoDD,eAAO,MAAM,SAAS,GAAI,UAAU,MAAM,gBAGzC,CAAA"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { GatewayName } from '@xyo-network/xl1-protocol';
|
|
2
|
-
export declare const useGateway: (gatewayName?: GatewayName) => {
|
|
2
|
+
export declare const useGateway: (gatewayName?: GatewayName, timeout?: number) => {
|
|
3
3
|
gateway: import("@xyo-network/xl1-protocol").XyoGatewayProvider | undefined;
|
|
4
4
|
isLoading: boolean;
|
|
5
5
|
error: Error | null;
|
|
6
|
+
timedout: boolean;
|
|
6
7
|
};
|
|
7
8
|
//# sourceMappingURL=useGateway.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGateway.d.ts","sourceRoot":"","sources":["../../../../src/hooks/client/useGateway.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAI5D,eAAO,MAAM,UAAU,GAAI,cAAc,WAAW,EAAE,UAAU,MAAM;;;;;CAUrE,CAAA"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { XyoClient } from '@xyo-network/xl1-protocol';
|
|
2
|
-
export declare const listenForClientInjection: (onClientReady: () => void, onTimeout: () => void) => void;
|
|
3
|
-
|
|
2
|
+
export declare const listenForClientInjection: (onClientReady: () => void, timeout: number, onTimeout: () => void) => void;
|
|
3
|
+
type ReturnType = XyoClient | undefined | null;
|
|
4
|
+
export declare function getXyoClient(timeout?: number): Promise<ReturnType>;
|
|
5
|
+
export {};
|
|
4
6
|
//# sourceMappingURL=getXyoClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getXyoClient.d.ts","sourceRoot":"","sources":["../../../../src/hooks/helpers/getXyoClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAQ1D,eAAO,MAAM,wBAAwB,GAAI,eAAe,MAAM,IAAI,EAAE,WAAW,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"getXyoClient.d.ts","sourceRoot":"","sources":["../../../../src/hooks/helpers/getXyoClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAQ1D,eAAO,MAAM,wBAAwB,GAAI,eAAe,MAAM,IAAI,EAAE,SAAS,MAAM,EAAE,WAAW,MAAM,IAAI,SAYzG,CAAA;AAED,KAAK,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,IAAI,CAAA;AAE9C,wBAAsB,YAAY,CAAC,OAAO,SAA0B,GAAG,OAAO,CAAC,UAAU,CAAC,CAezF"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
export * from './client/index.ts';
|
|
1
2
|
export * from './helpers/index.ts';
|
|
2
3
|
export * from './useAddressBalance.ts';
|
|
3
|
-
export * from './useClient.ts';
|
|
4
4
|
export * from './useConnectAccount.ts';
|
|
5
5
|
export * from './useCurrentBlock.ts';
|
|
6
|
-
export * from './useGateway.ts';
|
|
7
6
|
export * from './useHttpRpcRunner.ts';
|
|
8
7
|
export * from './useNetwork.ts';
|
|
9
8
|
export * from './useSigner.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,wBAAwB,CAAA;AACtC,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,mBAAmB,CAAA"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { GatewayName } from '@xyo-network/xl1-protocol';
|
|
2
|
-
export declare const useConnectAccount: (gatewayName?: GatewayName) => {
|
|
2
|
+
export declare const useConnectAccount: (gatewayName?: GatewayName, timeout?: number) => {
|
|
3
3
|
address: string | undefined;
|
|
4
4
|
connectSigner: () => Promise<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
5
5
|
readonly __hex: true;
|
|
6
6
|
}>, {
|
|
7
7
|
readonly __address: true;
|
|
8
8
|
}>>;
|
|
9
|
-
error: Error |
|
|
9
|
+
error: Error | undefined;
|
|
10
|
+
gateway: import("@xyo-network/xl1-protocol").XyoGatewayProvider | undefined;
|
|
11
|
+
timedout: boolean;
|
|
10
12
|
};
|
|
11
13
|
//# sourceMappingURL=useConnectAccount.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConnectAccount.d.ts","sourceRoot":"","sources":["../../../src/hooks/useConnectAccount.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAK5D,eAAO,MAAM,iBAAiB,GAAI,cAAa,WAA4B
|
|
1
|
+
{"version":3,"file":"useConnectAccount.d.ts","sourceRoot":"","sources":["../../../src/hooks/useConnectAccount.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAK5D,eAAO,MAAM,iBAAiB,GAAI,cAAa,WAA4B,EAAE,UAAU,MAAM;;;;;;;;;;CAoB5F,CAAA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { XyoViewer } from '@xyo-network/xl1-protocol';
|
|
2
|
-
export declare const useCurrentBlock: (refresh?: number, viewer?: XyoViewer) => [import("@xyo-network/xl1-protocol").HydratedBlock | undefined, Error | undefined, import("@xylabs/react-promise").UsePromiseState | undefined];
|
|
2
|
+
export declare const useCurrentBlock: (refresh?: number, viewer?: XyoViewer | null) => [import("@xyo-network/xl1-protocol").HydratedBlock | undefined, Error | undefined, import("@xylabs/react-promise").UsePromiseState | undefined];
|
|
3
3
|
//# sourceMappingURL=useCurrentBlock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCurrentBlock.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCurrentBlock.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCurrentBlock.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCurrentBlock.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAE1D,eAAO,MAAM,eAAe,GAAI,gBAAW,EAAE,SAAS,SAAS,GAAG,IAAI,oJAOrE,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { StoryFn } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare const UseStepRewardWeightTest: React.FC;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: React.FC<{}>;
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
9
|
+
export declare const Template: StoryFn<typeof UseStepRewardWeightTest>;
|
|
10
|
+
declare const Default: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react-vite").ReactRenderer, {}>;
|
|
11
|
+
export { Default };
|
|
12
|
+
//# sourceMappingURL=UseStepRewardWeightTest.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UseStepRewardWeightTest.stories.d.ts","sourceRoot":"","sources":["../../../../src/hooks/viewer/UseStepRewardWeightTest.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAQpD,OAAO,KAAmB,MAAM,OAAO,CAAA;AAWvC,QAAA,MAAM,uBAAuB,EAAE,KAAK,CAAC,EA8CpC,CAAA;;;;;AAED,wBAGC;AAED,eAAO,MAAM,QAAQ,EAAE,OAAO,CAAC,OAAO,uBAAuB,CAAiD,CAAA;AAE9G,QAAA,MAAM,OAAO,sGAAoB,CAAA;AAGjC,OAAO,EAAE,OAAO,EAAE,CAAA"}
|
|
@@ -5,5 +5,5 @@ import type { GatewayName } from '@xyo-network/xl1-protocol';
|
|
|
5
5
|
* @returns An instance of XyoViewer if the networkId is found in wallet gateways
|
|
6
6
|
* otherwise undefined.
|
|
7
7
|
*/
|
|
8
|
-
export declare const useViewerFromWallet: (networkId?: GatewayName) => import("@xyo-network/xl1-protocol").XyoViewer | undefined;
|
|
8
|
+
export declare const useViewerFromWallet: (networkId?: GatewayName) => [import("@xyo-network/xl1-protocol").XyoViewer | null | undefined, Error | undefined, import("@xylabs/react-promise").UsePromiseState | undefined];
|
|
9
9
|
//# sourceMappingURL=useViewerFromWallet.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useViewerFromWallet.d.ts","sourceRoot":"","sources":["../../../../src/hooks/viewer/useViewerFromWallet.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useViewerFromWallet.d.ts","sourceRoot":"","sources":["../../../../src/hooks/viewer/useViewerFromWallet.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAI5D;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAAI,YAAY,WAAW,uJAa1D,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useViewerFromWallet.stories.d.ts","sourceRoot":"","sources":["../../../../src/hooks/viewer/useViewerFromWallet.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useViewerFromWallet.stories.d.ts","sourceRoot":"","sources":["../../../../src/hooks/viewer/useViewerFromWallet.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAQpD,OAAO,KAAmB,MAAM,OAAO,CAAA;AAOvC,QAAA,MAAM,gCAAgC,EAAE,KAAK,CAAC,EA6C7C,CAAA;;;;;AAED,wBAGC;AAED,eAAO,MAAM,QAAQ,EAAE,OAAO,CAAC,OAAO,gCAAgC,CAA0D,CAAA;AAEhI,QAAA,MAAM,OAAO,sGAAoB,CAAA;AAGjC,OAAO,EAAE,OAAO,EAAE,CAAA"}
|
package/dist/browser/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,kBAAkB,CAAA"}
|