@xyo-network/react-chain-network 1.6.6 → 1.7.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/dist/browser/components/status/Alert.stories.d.ts +10 -0
- package/dist/browser/components/status/Alert.stories.d.ts.map +1 -0
- package/dist/browser/index.d.ts +109 -0
- package/package.json +15 -15
- package/dist/types/index.d.ts +0 -4
- /package/dist/{types → browser}/components/index.d.ts +0 -0
- /package/dist/{types → browser}/components/index.d.ts.map +0 -0
- /package/dist/{types → browser}/components/menu/Avatar.d.ts +0 -0
- /package/dist/{types → browser}/components/menu/Avatar.d.ts.map +0 -0
- /package/dist/{types → browser}/components/menu/Icon.d.ts +0 -0
- /package/dist/{types → browser}/components/menu/Icon.d.ts.map +0 -0
- /package/dist/{types → browser}/components/menu/MenuItem.d.ts +0 -0
- /package/dist/{types → browser}/components/menu/MenuItem.d.ts.map +0 -0
- /package/dist/{types → browser}/components/menu/index.d.ts +0 -0
- /package/dist/{types → browser}/components/menu/index.d.ts.map +0 -0
- /package/dist/{types → browser}/components/status/Alert.d.ts +0 -0
- /package/dist/{types → browser}/components/status/Alert.d.ts.map +0 -0
- /package/dist/{types → browser}/components/status/Dialog.d.ts +0 -0
- /package/dist/{types → browser}/components/status/Dialog.d.ts.map +0 -0
- /package/dist/{types → browser}/components/status/NetworkStatus.d.ts +0 -0
- /package/dist/{types → browser}/components/status/NetworkStatus.d.ts.map +0 -0
- /package/dist/{types → browser}/components/status/index.d.ts +0 -0
- /package/dist/{types → browser}/components/status/index.d.ts.map +0 -0
- /package/dist/{types → browser}/context/index.d.ts +0 -0
- /package/dist/{types → browser}/context/index.d.ts.map +0 -0
- /package/dist/{types → browser}/context/network/Provider.d.ts +0 -0
- /package/dist/{types → browser}/context/network/Provider.d.ts.map +0 -0
- /package/dist/{types → browser}/context/network/context.d.ts +0 -0
- /package/dist/{types → browser}/context/network/context.d.ts.map +0 -0
- /package/dist/{types → browser}/context/network/index.d.ts +0 -0
- /package/dist/{types → browser}/context/network/index.d.ts.map +0 -0
- /package/dist/{types → browser}/context/network/state.d.ts +0 -0
- /package/dist/{types → browser}/context/network/state.d.ts.map +0 -0
- /package/dist/{types → browser}/context/network/use.d.ts +0 -0
- /package/dist/{types → browser}/context/network/use.d.ts.map +0 -0
- /package/dist/{types → browser}/hooks/index.d.ts +0 -0
- /package/dist/{types → browser}/hooks/index.d.ts.map +0 -0
- /package/dist/{types → browser}/hooks/provider/index.d.ts +0 -0
- /package/dist/{types → browser}/hooks/provider/index.d.ts.map +0 -0
- /package/dist/{types → browser}/hooks/provider/useActiveNetworkCurrentBlock.d.ts +0 -0
- /package/dist/{types → browser}/hooks/provider/useActiveNetworkCurrentBlock.d.ts.map +0 -0
- /package/dist/{types → browser}/hooks/provider/useActiveNetworkNetwork.d.ts +0 -0
- /package/dist/{types → browser}/hooks/provider/useActiveNetworkNetwork.d.ts.map +0 -0
- /package/dist/{types → browser}/hooks/provider/useActiveNetworkRunner.d.ts +0 -0
- /package/dist/{types → browser}/hooks/provider/useActiveNetworkRunner.d.ts.map +0 -0
- /package/dist/{types → browser}/hooks/provider/useViewerInPage.d.ts +0 -0
- /package/dist/{types → browser}/hooks/provider/useViewerInPage.d.ts.map +0 -0
- /package/dist/{types → browser}/hooks/provider/useViewerInWallet.d.ts +0 -0
- /package/dist/{types → browser}/hooks/provider/useViewerInWallet.d.ts.map +0 -0
- /package/dist/{types → browser}/hooks/status/index.d.ts +0 -0
- /package/dist/{types → browser}/hooks/status/index.d.ts.map +0 -0
- /package/dist/{types → browser}/hooks/status/usePollNetworkStatus.d.ts +0 -0
- /package/dist/{types → browser}/hooks/status/usePollNetworkStatus.d.ts.map +0 -0
- /package/dist/{types → browser}/index.d.ts.map +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
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("./Alert.tsx").NetworkStatusAlertProps>;
|
|
5
|
+
declare const WithOnlineStatus: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react-vite").ReactRenderer, import("./Alert.tsx").NetworkStatusAlertProps>;
|
|
6
|
+
declare const WithOfflineStatus: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react-vite").ReactRenderer, import("./Alert.tsx").NetworkStatusAlertProps>;
|
|
7
|
+
declare const WithDegradedStatus: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react-vite").ReactRenderer, import("./Alert.tsx").NetworkStatusAlertProps>;
|
|
8
|
+
declare const WithUnknownStatus: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react-vite").ReactRenderer, import("./Alert.tsx").NetworkStatusAlertProps>;
|
|
9
|
+
export { Default, WithDegradedStatus, WithOfflineStatus, WithOnlineStatus, WithUnknownStatus, };
|
|
10
|
+
//# sourceMappingURL=Alert.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Alert.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/status/Alert.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,uBAAuB,CAAA;wBAoDrD,IAAI;AAHT,wBAGS;AAIT,QAAA,MAAM,OAAO,iJAAoB,CAAA;AAGjC,QAAA,MAAM,gBAAgB,iJAAoB,CAAA;AAG1C,QAAA,MAAM,iBAAiB,iJAAoB,CAAA;AAG3C,QAAA,MAAM,kBAAkB,iJAAoB,CAAA;AAG5C,QAAA,MAAM,iBAAiB,iJAAoB,CAAA;AAG3C,OAAO,EACL,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,iBAAiB,GACpF,CAAA"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { AvatarProps, IconProps, MenuItemProps, AlertProps } from '@mui/material';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import React__default, { PropsWithChildren } from 'react';
|
|
4
|
+
import * as _xyo_network_chain_network_model from '@xyo-network/chain-network-model';
|
|
5
|
+
import { NetworkBootstrap } from '@xyo-network/chain-network-model';
|
|
6
|
+
import * as _xyo_network_xl1_protocol from '@xyo-network/xl1-protocol';
|
|
7
|
+
import { NetworkId, NetworkStatus as NetworkStatus$1, XyoViewer } from '@xyo-network/xl1-protocol';
|
|
8
|
+
import * as _xylabs_react_shared from '@xylabs/react-shared';
|
|
9
|
+
import { ContextExState } from '@xylabs/react-shared';
|
|
10
|
+
import * as _xylabs_react_promise from '@xylabs/react-promise';
|
|
11
|
+
import * as _xyo_network_payload_model from '@xyo-network/payload-model';
|
|
12
|
+
import * as _xyo_network_xl1_rpc from '@xyo-network/xl1-rpc';
|
|
13
|
+
|
|
14
|
+
declare const NetworkAvatar: React__default.FC<AvatarProps & {
|
|
15
|
+
icon?: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
}>;
|
|
18
|
+
declare const ActiveNetworkAvatar: React__default.FC<AvatarProps>;
|
|
19
|
+
|
|
20
|
+
declare const NetworkIcon: React__default.FC<IconProps & {
|
|
21
|
+
icon?: string;
|
|
22
|
+
}>;
|
|
23
|
+
|
|
24
|
+
interface NetworkMenuItemProps extends MenuItemProps {
|
|
25
|
+
active?: boolean;
|
|
26
|
+
network?: NetworkBootstrap;
|
|
27
|
+
updateActiveNetwork?: (networkId: NetworkId) => void;
|
|
28
|
+
}
|
|
29
|
+
declare const NetworkMenuItem: React__default.FC<NetworkMenuItemProps>;
|
|
30
|
+
|
|
31
|
+
interface NetworkStatusAlertProps extends AlertProps {
|
|
32
|
+
status?: NetworkStatus$1;
|
|
33
|
+
}
|
|
34
|
+
declare const NetworkStatusAlert: React__default.FC<NetworkStatusAlertProps>;
|
|
35
|
+
|
|
36
|
+
interface NetworkStatusProps extends PropsWithChildren<AlertProps> {
|
|
37
|
+
}
|
|
38
|
+
declare const NetworkStatus: React__default.FC<NetworkStatusProps>;
|
|
39
|
+
|
|
40
|
+
declare const ChainNetworkContext: React.Context<({
|
|
41
|
+
activeNetwork?: _xyo_network_chain_network_model.NetworkBootstrap;
|
|
42
|
+
chainNetworkError?: Error;
|
|
43
|
+
networks?: _xyo_network_chain_network_model.NetworkBootstrap[];
|
|
44
|
+
updateActiveNetwork?: (networkId: _xyo_network_chain_network_model.NetworkBootstrap["id"]) => void;
|
|
45
|
+
} & {
|
|
46
|
+
provided: true;
|
|
47
|
+
}) | (_xylabs_react_shared.FixedValues<_xylabs_react_shared.ProvidedContextExState<{
|
|
48
|
+
activeNetwork?: _xyo_network_chain_network_model.NetworkBootstrap;
|
|
49
|
+
chainNetworkError?: Error;
|
|
50
|
+
networks?: _xyo_network_chain_network_model.NetworkBootstrap[];
|
|
51
|
+
updateActiveNetwork?: (networkId: _xyo_network_chain_network_model.NetworkBootstrap["id"]) => void;
|
|
52
|
+
}>, never> & {
|
|
53
|
+
provided: false;
|
|
54
|
+
}) | (_xylabs_react_shared.FixedValues<_xylabs_react_shared.NotProvidedContextExState<{
|
|
55
|
+
activeNetwork?: _xyo_network_chain_network_model.NetworkBootstrap;
|
|
56
|
+
chainNetworkError?: Error;
|
|
57
|
+
networks?: _xyo_network_chain_network_model.NetworkBootstrap[];
|
|
58
|
+
updateActiveNetwork?: (networkId: _xyo_network_chain_network_model.NetworkBootstrap["id"]) => void;
|
|
59
|
+
}>, never> & {
|
|
60
|
+
provided: false;
|
|
61
|
+
})>;
|
|
62
|
+
|
|
63
|
+
interface ChainNetworkProviderProps extends PropsWithChildren {
|
|
64
|
+
getActiveNetwork?: () => Promise<NetworkBootstrap | undefined>;
|
|
65
|
+
networks?: NetworkBootstrap[];
|
|
66
|
+
setActiveNetwork?: (networkId: NetworkBootstrap['id']) => Promise<NetworkBootstrap>;
|
|
67
|
+
}
|
|
68
|
+
declare const ChainNetworkProvider: React__default.FC<ChainNetworkProviderProps>;
|
|
69
|
+
|
|
70
|
+
type ChainNetworkState = ContextExState<{
|
|
71
|
+
activeNetwork?: NetworkBootstrap;
|
|
72
|
+
chainNetworkError?: Error;
|
|
73
|
+
networks?: NetworkBootstrap[];
|
|
74
|
+
updateActiveNetwork?: (networkId: NetworkBootstrap['id']) => void;
|
|
75
|
+
}>;
|
|
76
|
+
|
|
77
|
+
declare const useChainNetwork: (required?: boolean) => Omit<{
|
|
78
|
+
activeNetwork?: _xyo_network_chain_network_model.NetworkBootstrap;
|
|
79
|
+
chainNetworkError?: Error;
|
|
80
|
+
networks?: _xyo_network_chain_network_model.NetworkBootstrap[];
|
|
81
|
+
updateActiveNetwork?: (networkId: _xyo_network_chain_network_model.NetworkBootstrap["id"]) => void;
|
|
82
|
+
} & {
|
|
83
|
+
provided: true;
|
|
84
|
+
}, "provided"> | Omit<_xylabs_react_shared.NotProvidedContextExState<ChainNetworkState>, "provided">;
|
|
85
|
+
|
|
86
|
+
declare const useActiveNetworkCurrentBlock: (refresh?: number, viewer?: XyoViewer) => [_xyo_network_xl1_protocol.HydratedBlock<_xyo_network_xl1_protocol.BlockBoundWitness, _xyo_network_payload_model.Payload> | undefined, Error | undefined, _xylabs_react_promise.UsePromiseState | undefined];
|
|
87
|
+
declare const useActiveNetworkCurrentBlockInPage: (refresh?: number) => [_xyo_network_xl1_protocol.HydratedBlock<_xyo_network_xl1_protocol.BlockBoundWitness, _xyo_network_payload_model.Payload> | undefined, Error | undefined, _xylabs_react_promise.UsePromiseState | undefined];
|
|
88
|
+
declare const useActiveNetworkCurrentBlockInWallet: (refresh?: number) => [_xyo_network_xl1_protocol.HydratedBlock<_xyo_network_xl1_protocol.BlockBoundWitness, _xyo_network_payload_model.Payload> | undefined, Error | undefined, _xylabs_react_promise.UsePromiseState | undefined];
|
|
89
|
+
|
|
90
|
+
declare const useActiveNetworkNetwork: () => _xyo_network_xl1_rpc.MemoryXyoNetwork | undefined;
|
|
91
|
+
|
|
92
|
+
declare const useActiveNetworkRunner: () => _xyo_network_xl1_rpc.JsonRpcXyoRunner | undefined;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Get the viewer for the active network, first from the wallet or fallback to HTTP RPC
|
|
96
|
+
* @returns - XyoViewer for the active network
|
|
97
|
+
*/
|
|
98
|
+
declare const useViewerInPage: () => _xyo_network_xl1_rpc.JsonRpcXyoViewer | undefined;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Get the viewer directly from the active network
|
|
102
|
+
* @returns - The viewer for the active network
|
|
103
|
+
*/
|
|
104
|
+
declare const useViewerInWallet: () => _xyo_network_xl1_rpc.JsonRpcXyoViewer | undefined;
|
|
105
|
+
|
|
106
|
+
declare const usePollNetworkStatus: () => readonly [NetworkStatus$1 | undefined, Error | undefined];
|
|
107
|
+
|
|
108
|
+
export { ActiveNetworkAvatar, ChainNetworkContext, ChainNetworkProvider, NetworkAvatar, NetworkIcon, NetworkMenuItem, NetworkStatus, NetworkStatusAlert, useActiveNetworkCurrentBlock, useActiveNetworkCurrentBlockInPage, useActiveNetworkCurrentBlockInWallet, useActiveNetworkNetwork, useActiveNetworkRunner, useChainNetwork, usePollNetworkStatus, useViewerInPage, useViewerInWallet };
|
|
109
|
+
export type { ChainNetworkProviderProps, ChainNetworkState, NetworkMenuItemProps, NetworkStatusAlertProps, NetworkStatusProps };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@xyo-network/react-chain-network",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.7.0",
|
|
5
5
|
"description": "XYO Layer One React SDK",
|
|
6
6
|
"homepage": "https://xylabs.com",
|
|
7
7
|
"bugs": {
|
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
"exports": {
|
|
24
24
|
".": {
|
|
25
25
|
"browser": {
|
|
26
|
-
"types": "./dist/
|
|
26
|
+
"types": "./dist/browser/index.d.ts",
|
|
27
27
|
"default": "./dist/browser/index.mjs"
|
|
28
28
|
},
|
|
29
|
-
"types": "./dist/
|
|
29
|
+
"types": "./dist/browser/index.d.ts",
|
|
30
30
|
"default": "./dist/browser/index.mjs"
|
|
31
31
|
},
|
|
32
32
|
"./package.json": "./package.json"
|
|
33
33
|
},
|
|
34
34
|
"module": "dist/browser/index.mjs",
|
|
35
|
-
"types": "dist/
|
|
35
|
+
"types": "dist/browser/index.d.ts",
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build-storybook": "storybook build",
|
|
38
38
|
"start": "storybook dev -p 6006"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@xylabs/delay": "^4.13.
|
|
42
|
-
"@xylabs/react-error": "^6.3.
|
|
43
|
-
"@xylabs/react-promise": "^6.3.
|
|
44
|
-
"@xylabs/react-shared": "^6.3.
|
|
45
|
-
"@xylabs/typeof": "^4.13.
|
|
46
|
-
"@xyo-network/chain-network-model": "^1.
|
|
47
|
-
"@xyo-network/react-chain-provider": "^1.
|
|
48
|
-
"@xyo-network/react-chain-shared": "^1.
|
|
49
|
-
"@xyo-network/xl1-protocol": "^1.6.
|
|
41
|
+
"@xylabs/delay": "^4.13.15",
|
|
42
|
+
"@xylabs/react-error": "^6.3.10",
|
|
43
|
+
"@xylabs/react-promise": "^6.3.10",
|
|
44
|
+
"@xylabs/react-shared": "^6.3.10",
|
|
45
|
+
"@xylabs/typeof": "^4.13.15",
|
|
46
|
+
"@xyo-network/chain-network-model": "^1.7.0",
|
|
47
|
+
"@xyo-network/react-chain-provider": "^1.7.0",
|
|
48
|
+
"@xyo-network/react-chain-shared": "^1.7.0",
|
|
49
|
+
"@xyo-network/xl1-protocol": "^1.6.4"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@emotion/react": "^11.14.0",
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"@mui/material": "^7.2.0",
|
|
56
56
|
"@storybook/react-vite": "^9.0.16",
|
|
57
57
|
"@types/react": "^19.1.8",
|
|
58
|
-
"@xylabs/ts-scripts-yarn3": "^
|
|
59
|
-
"@xylabs/tsconfig-react": "^
|
|
58
|
+
"@xylabs/ts-scripts-yarn3": "^7.0.0-rc.23",
|
|
59
|
+
"@xylabs/tsconfig-react": "^7.0.0-rc.23",
|
|
60
60
|
"knip": "^5.61.3",
|
|
61
61
|
"react": "^19.1.0",
|
|
62
62
|
"react-dom": "^19.1.0",
|
package/dist/types/index.d.ts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|