@xyo-network/react-chain-network 1.7.1 → 1.7.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,110 +1,4 @@
1
- import { AvatarProps, MenuItemProps, AlertProps } from '@mui/material';
2
- import * as React from 'react';
3
- import React__default, { DetailedHTMLProps, ImgHTMLAttributes, 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
- interface NetworkIconProps extends DetailedHTMLProps<ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement> {
21
- icon?: string;
22
- }
23
- declare const NetworkIcon: React__default.FC<NetworkIconProps>;
24
-
25
- interface NetworkMenuItemProps extends MenuItemProps {
26
- active?: boolean;
27
- network?: NetworkBootstrap;
28
- updateActiveNetwork?: (networkId: NetworkId) => void;
29
- }
30
- declare const NetworkMenuItem: React__default.FC<NetworkMenuItemProps>;
31
-
32
- interface NetworkStatusAlertProps extends AlertProps {
33
- status?: NetworkStatus$1;
34
- }
35
- declare const NetworkStatusAlert: React__default.FC<NetworkStatusAlertProps>;
36
-
37
- interface NetworkStatusProps extends PropsWithChildren<AlertProps> {
38
- }
39
- declare const NetworkStatus: React__default.FC<NetworkStatusProps>;
40
-
41
- declare const ChainNetworkContext: React.Context<({
42
- activeNetwork?: _xyo_network_chain_network_model.NetworkBootstrap;
43
- chainNetworkError?: Error;
44
- networks?: _xyo_network_chain_network_model.NetworkBootstrap[];
45
- updateActiveNetwork?: (networkId: _xyo_network_chain_network_model.NetworkBootstrap["id"]) => void;
46
- } & {
47
- provided: true;
48
- }) | (_xylabs_react_shared.FixedValues<_xylabs_react_shared.ProvidedContextExState<{
49
- activeNetwork?: _xyo_network_chain_network_model.NetworkBootstrap;
50
- chainNetworkError?: Error;
51
- networks?: _xyo_network_chain_network_model.NetworkBootstrap[];
52
- updateActiveNetwork?: (networkId: _xyo_network_chain_network_model.NetworkBootstrap["id"]) => void;
53
- }>, never> & {
54
- provided: false;
55
- }) | (_xylabs_react_shared.FixedValues<_xylabs_react_shared.NotProvidedContextExState<{
56
- activeNetwork?: _xyo_network_chain_network_model.NetworkBootstrap;
57
- chainNetworkError?: Error;
58
- networks?: _xyo_network_chain_network_model.NetworkBootstrap[];
59
- updateActiveNetwork?: (networkId: _xyo_network_chain_network_model.NetworkBootstrap["id"]) => void;
60
- }>, never> & {
61
- provided: false;
62
- })>;
63
-
64
- interface ChainNetworkProviderProps extends PropsWithChildren {
65
- getActiveNetwork?: () => Promise<NetworkBootstrap | undefined>;
66
- networks?: NetworkBootstrap[];
67
- setActiveNetwork?: (networkId: NetworkBootstrap['id']) => Promise<NetworkBootstrap>;
68
- }
69
- declare const ChainNetworkProvider: React__default.FC<ChainNetworkProviderProps>;
70
-
71
- type ChainNetworkState = ContextExState<{
72
- activeNetwork?: NetworkBootstrap;
73
- chainNetworkError?: Error;
74
- networks?: NetworkBootstrap[];
75
- updateActiveNetwork?: (networkId: NetworkBootstrap['id']) => void;
76
- }>;
77
-
78
- declare const useChainNetwork: (required?: boolean) => Omit<{
79
- activeNetwork?: _xyo_network_chain_network_model.NetworkBootstrap;
80
- chainNetworkError?: Error;
81
- networks?: _xyo_network_chain_network_model.NetworkBootstrap[];
82
- updateActiveNetwork?: (networkId: _xyo_network_chain_network_model.NetworkBootstrap["id"]) => void;
83
- } & {
84
- provided: true;
85
- }, "provided"> | Omit<_xylabs_react_shared.NotProvidedContextExState<ChainNetworkState>, "provided">;
86
-
87
- 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];
88
- 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];
89
- 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];
90
-
91
- declare const useActiveNetworkNetwork: () => _xyo_network_xl1_rpc.MemoryXyoNetwork | undefined;
92
-
93
- declare const useActiveNetworkRunner: () => _xyo_network_xl1_rpc.JsonRpcXyoRunner | undefined;
94
-
95
- /**
96
- * Get the viewer for the active network, first from the wallet or fallback to HTTP RPC
97
- * @returns - XyoViewer for the active network
98
- */
99
- declare const useViewerInPage: () => _xyo_network_xl1_rpc.JsonRpcXyoViewer | undefined;
100
-
101
- /**
102
- * Get the viewer directly from the active network
103
- * @returns - The viewer for the active network
104
- */
105
- declare const useViewerInWallet: () => _xyo_network_xl1_rpc.JsonRpcXyoViewer | undefined;
106
-
107
- declare const usePollNetworkStatus: () => readonly [NetworkStatus$1 | undefined, Error | undefined];
108
-
109
- export { ActiveNetworkAvatar, ChainNetworkContext, ChainNetworkProvider, NetworkAvatar, NetworkIcon, NetworkMenuItem, NetworkStatus, NetworkStatusAlert, useActiveNetworkCurrentBlock, useActiveNetworkCurrentBlockInPage, useActiveNetworkCurrentBlockInWallet, useActiveNetworkNetwork, useActiveNetworkRunner, useChainNetwork, usePollNetworkStatus, useViewerInPage, useViewerInWallet };
110
- export type { ChainNetworkProviderProps, ChainNetworkState, NetworkIconProps, NetworkMenuItemProps, NetworkStatusAlertProps, NetworkStatusProps };
1
+ export * from './components/index.ts';
2
+ export * from './context/index.ts';
3
+ export * from './hooks/index.ts';
4
+ //# sourceMappingURL=index.d.ts.map
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.7.1",
4
+ "version": "1.7.3",
5
5
  "description": "XYO Layer One React SDK",
6
6
  "homepage": "https://xylabs.com",
7
7
  "bugs": {
@@ -38,15 +38,15 @@
38
38
  "start": "storybook dev -p 6006"
39
39
  },
40
40
  "dependencies": {
41
- "@xylabs/delay": "^4.13.15",
41
+ "@xylabs/delay": "^4.13.17",
42
42
  "@xylabs/react-error": "^6.3.11",
43
43
  "@xylabs/react-promise": "^6.3.11",
44
44
  "@xylabs/react-shared": "^6.3.11",
45
- "@xylabs/typeof": "^4.13.15",
46
- "@xyo-network/chain-network-model": "^1.7.1",
47
- "@xyo-network/react-chain-provider": "^1.7.1",
48
- "@xyo-network/react-chain-shared": "^1.7.1",
49
- "@xyo-network/xl1-protocol": "^1.6.4"
45
+ "@xylabs/typeof": "^4.13.17",
46
+ "@xyo-network/chain-network-model": "^1.7.3",
47
+ "@xyo-network/react-chain-provider": "^1.7.3",
48
+ "@xyo-network/react-chain-shared": "^1.7.3",
49
+ "@xyo-network/xl1-protocol": "^1.7.1"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@emotion/react": "^11.14.0",
@@ -55,12 +55,12 @@
55
55
  "@mui/material": "^7.2.0",
56
56
  "@storybook/react-vite": "^9.0.17",
57
57
  "@types/react": "^19.1.8",
58
- "@xylabs/ts-scripts-yarn3": "^7.0.0-rc.26",
59
- "@xylabs/tsconfig-react": "^7.0.0-rc.26",
58
+ "@xylabs/ts-scripts-yarn3": "^7.0.0-rc.27",
59
+ "@xylabs/tsconfig-react": "^7.0.0-rc.27",
60
60
  "knip": "^5.61.3",
61
61
  "react": "^19.1.0",
62
62
  "react-dom": "^19.1.0",
63
- "react-router-dom": "^7.6.3",
63
+ "react-router-dom": "^7.7.0",
64
64
  "typescript": "^5.8.3"
65
65
  },
66
66
  "peerDependencies": {