@xyo-network/react-chain-blockchain 1.20.4 → 1.20.8

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/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-blockchain",
4
- "version": "1.20.4",
4
+ "version": "1.20.8",
5
5
  "description": "XYO Layer One React SDK Blockchain",
6
6
  "homepage": "https://xylabs.com",
7
7
  "bugs": {
@@ -47,7 +47,6 @@
47
47
  "package-cycle": "echo Nothing to do"
48
48
  },
49
49
  "dependencies": {
50
- "@storybook/react-vite": "^10.2.17",
51
50
  "@xylabs/react-animation": "~7.1.17",
52
51
  "@xylabs/react-error": "~7.1.17",
53
52
  "@xylabs/react-flexbox": "~7.1.17",
@@ -55,50 +54,51 @@
55
54
  "@xylabs/react-quick-tip-button": "~7.1.17",
56
55
  "@xylabs/react-shared": "~7.1.17",
57
56
  "@xylabs/react-theme": "~7.1.17",
58
- "@xylabs/sdk-js": "~5.0.80",
59
- "@xyo-network/boundwitness-model": "~5.3.15",
60
- "@xyo-network/chain-analyze": "~1.20.4",
61
- "@xyo-network/chain-protocol": "~1.20.4",
62
- "@xyo-network/chain-wrappers": "~1.20.4",
57
+ "@xylabs/sdk-js": "~5.0.86",
58
+ "@xyo-network/boundwitness-model": "~5.3.16",
59
+ "@xyo-network/chain-analyze": "~1.20.8",
60
+ "@xyo-network/chain-protocol": "~1.20.8",
61
+ "@xyo-network/chain-wrappers": "~1.20.8",
63
62
  "@xyo-network/react-boundwitness-plugin": "~7.5.5",
64
- "@xyo-network/react-chain-blockies": "~1.20.4",
65
- "@xyo-network/react-chain-provider": "~1.20.4",
66
- "@xyo-network/react-chain-shared": "~1.20.4",
63
+ "@xyo-network/react-chain-blockies": "~1.20.8",
64
+ "@xyo-network/react-chain-provider": "~1.20.8",
65
+ "@xyo-network/react-chain-shared": "~1.20.8",
67
66
  "@xyo-network/react-error": "~7.5.5",
68
67
  "@xyo-network/react-event": "~7.5.5",
69
68
  "@xyo-network/react-payload-raw-info": "~7.5.5",
70
69
  "@xyo-network/react-payload-table": "~7.5.5",
71
70
  "@xyo-network/react-shared": "~7.5.5",
72
71
  "@xyo-network/react-table": "~7.5.5",
73
- "@xyo-network/sdk-js": "~5.3.15",
74
- "@xyo-network/xl1-sdk": "~1.25.20"
72
+ "@xyo-network/sdk-js": "~5.3.16",
73
+ "@xyo-network/xl1-sdk": "~1.25.33"
75
74
  },
76
75
  "devDependencies": {
77
76
  "@emotion/react": "~11.14.0",
78
77
  "@emotion/styled": "~11.14.1",
79
78
  "@mui/icons-material": "~7.3.9",
80
79
  "@mui/material": "~7.3.9",
80
+ "@storybook/react-vite": "^10.3.3",
81
81
  "@textea/json-viewer": "~4.0.1",
82
82
  "@types/react": "~19.2.14",
83
83
  "@xylabs/react-button": "~7.1.17",
84
- "@xylabs/sdk-js": "~5.0.80",
85
- "@xylabs/ts-scripts-yarn3": "~7.4.10",
86
- "@xylabs/tsconfig": "~7.4.10",
87
- "@xylabs/tsconfig-dom": "~7.4.10",
88
- "@xylabs/tsconfig-react": "~7.4.10",
89
- "@xyo-network/bridge-http": "~5.3.15",
90
- "@xyo-network/sdk-js": "~5.3.15",
91
- "@xyo-network/xl1-sdk": "~1.25.20",
84
+ "@xylabs/sdk-js": "~5.0.86",
85
+ "@xylabs/ts-scripts-yarn3": "~7.4.25",
86
+ "@xylabs/tsconfig": "~7.4.25",
87
+ "@xylabs/tsconfig-dom": "~7.4.25",
88
+ "@xylabs/tsconfig-react": "~7.4.25",
89
+ "@xyo-network/bridge-http": "~5.3.16",
90
+ "@xyo-network/react-chain-network": "~1.20.8",
91
+ "@xyo-network/sdk-js": "~5.3.16",
92
+ "@xyo-network/xl1-sdk": "~1.25.33",
92
93
  "axios": "^1.13.6",
93
- "eslint": "^9.39.4",
94
94
  "ethers": "^6.16.0",
95
95
  "react": "~19.2.4",
96
96
  "react-dom": "~19.2.4",
97
- "react-router-dom": "^7.13.1",
98
- "rollbar": "^3.0.0",
99
- "storybook": "^10.2.17",
97
+ "react-router-dom": "^7.13.2",
98
+ "rollbar": "^3.1.0",
99
+ "storybook": "^10.3.3",
100
100
  "typescript": "~5.9.3",
101
- "vite": "^7.3.1",
101
+ "vite": "^8.0.2",
102
102
  "zod": "^4.3.6"
103
103
  },
104
104
  "peerDependencies": {
@@ -1,18 +1,18 @@
1
1
  import type { Meta, StoryFn } from '@storybook/react-vite'
2
2
  import type { Address } from '@xylabs/sdk-js'
3
- import { useHttpRpcViewer } from '@xyo-network/react-chain-provider'
4
- import { LocalNetwork } from '@xyo-network/xl1-sdk'
5
- import React from 'react'
3
+ import { SequenceNetworkGatewayDecorator } from '@xyo-network/react-chain-network'
4
+ import { useViewerFromGateway } from '@xyo-network/react-chain-provider'
6
5
 
7
6
  import { AccountBalanceHistoryFlexBox } from './BalanceHistoryFlexbox.tsx'
8
7
 
9
8
  export default {
10
9
  title: 'AccountBalanceHistory/FlexBox',
11
10
  component: AccountBalanceHistoryFlexBox,
11
+ decorators: [SequenceNetworkGatewayDecorator],
12
12
  } as Meta
13
13
 
14
14
  const Template: StoryFn<typeof AccountBalanceHistoryFlexBox> = (args) => {
15
- const viewer = useHttpRpcViewer(LocalNetwork.url)
15
+ const viewer = useViewerFromGateway()
16
16
  return <AccountBalanceHistoryFlexBox viewer={viewer} {...args} />
17
17
  }
18
18
 
@@ -1,17 +1,15 @@
1
1
  import {
2
- Alert, AlertTitle,
3
- LinearProgress, Snackbar,
4
- Stack,
2
+ Alert, AlertTitle, LinearProgress, Snackbar, Stack,
5
3
  } from '@mui/material'
6
4
  import type { Meta, StoryFn } from '@storybook/react-vite'
7
5
  import { ButtonEx } from '@xylabs/react-button'
8
6
  import { type Address, isDefined } from '@xylabs/sdk-js'
9
- import { useAccountBalanceHistory, useHttpRpcViewer } from '@xyo-network/react-chain-provider'
7
+ import { SequenceNetworkGatewayDecorator, useViewerInPage } from '@xyo-network/react-chain-network'
8
+ import { useAccountBalanceHistory, useViewerFromGateway } from '@xyo-network/react-chain-provider'
10
9
  import { ErrorRender } from '@xyo-network/react-error'
11
10
  import type { Event } from '@xyo-network/react-event'
12
11
  import { useEvent } from '@xyo-network/react-event'
13
12
  import type { XL1BlockRange } from '@xyo-network/xl1-sdk'
14
- import { LocalNetwork } from '@xyo-network/xl1-sdk'
15
13
  import { useState } from 'react'
16
14
 
17
15
  import { usePagedAccountBalanceHistory } from '../hooks/index.ts'
@@ -20,14 +18,15 @@ import { AccountBalanceHistoryTableEx } from './BalanceHistoryTableEx.tsx'
20
18
  export default {
21
19
  title: 'AccountBalanceHistory/TableEx',
22
20
  component: AccountBalanceHistoryTableEx,
21
+ decorators: [SequenceNetworkGatewayDecorator],
23
22
  } as Meta
24
23
 
25
24
  const TEST_ADDRESS = 'aa9401662e9cd3ce8bb8a6ab92a35ed83e85ac67' as Address
26
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
25
+
27
26
  const TEST_ADDRESS_1 = '2b1a21d8c90e658d8bf1e2aad31c8dc892c353c1' as Address
28
27
 
29
28
  const useFetchBalanceHistory = (address?: Address, maxPage = 10, blockRange?: XL1BlockRange) => {
30
- const viewer = useHttpRpcViewer(LocalNetwork.url)
29
+ const viewer = useViewerFromGateway()
31
30
  return useAccountBalanceHistory(address, viewer, maxPage, blockRange)
32
31
  }
33
32
 
@@ -72,10 +71,10 @@ const TemplateLinked: StoryFn<typeof AccountBalanceHistoryTableEx> = (args) => {
72
71
  }
73
72
 
74
73
  const TemplatePaged: StoryFn<typeof AccountBalanceHistoryTableEx> = (args) => {
75
- const viewer = useHttpRpcViewer(LocalNetwork.url)
74
+ const viewer = useViewerInPage()
76
75
  const {
77
76
  pagedHistory, historyComplete, updateRange, error, loading,
78
- } = usePagedAccountBalanceHistory(TEST_ADDRESS, viewer, 1)
77
+ } = usePagedAccountBalanceHistory(TEST_ADDRESS_1, viewer, 1)
79
78
 
80
79
  return (
81
80
  <Stack gap={2}>
@@ -1,6 +1,4 @@
1
- import {
2
- ListItem, styled, Typography,
3
- } from '@mui/material'
1
+ import { Typography } from '@mui/material'
4
2
  import { ErrorRender } from '@xylabs/react-error'
5
3
  import { FlexCol } from '@xylabs/react-flexbox'
6
4
  import { isChainSummaryProducers } from '@xyo-network/chain-analyze'
@@ -32,8 +30,3 @@ export const BlockProducerStatsFlexbox: React.FC<BlockProducerStatsFlexboxProps>
32
30
  </FlexCol>
33
31
  )
34
32
  }
35
-
36
- export const StyledListItem = styled(ListItem)(() => ({
37
- paddingTop: 0,
38
- paddingBottom: 0,
39
- }))
@@ -29,14 +29,22 @@ export const XyoAddressTextField: React.FC<XyoAddressTextFieldProps> = ({
29
29
 
30
30
  const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
31
31
  const { value } = event.target
32
+ // allow the parent component to also respond to the change if they need to
32
33
  onChange?.(event)
33
34
 
35
+ // validate the address and call onAddressChanged if it's valid
34
36
  const xyoAddress = asAddress(value)
35
37
  if (isAddress(xyoAddress)) {
36
38
  onAddressChanged?.(xyoAddress)
39
+ setAddressError(undefined)
40
+ } else if (value === '') {
41
+ // if the input is empty, we clear the error but don't call onAddressChanged because there's no address
42
+ setAddressError(undefined)
43
+ } else {
44
+ // if the address is invalid, we set an error and call onAddressChanged with undefined to clear any previously set address
45
+ setAddressError(new Error('Invalid address'))
37
46
  }
38
47
 
39
- setAddressError(undefined)
40
48
  setAddress(value)
41
49
  }
42
50