@xyo-network/react-chain-blockchain 1.18.0 → 1.18.2
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/account/BalanceHistoryFlexbox.d.ts +1 -1
- package/dist/browser/components/account/BalanceHistoryFlexbox.d.ts.map +1 -1
- package/dist/browser/components/account/helpers/formatBalanceMagnitude.d.ts +1 -1
- package/dist/browser/components/account/helpers/formatBalanceMagnitude.d.ts.map +1 -1
- package/dist/browser/components/account/hooks/usePagedAccountBalanceHistory.d.ts +1 -1
- package/dist/browser/components/account/hooks/usePagedAccountBalanceHistory.d.ts.map +1 -1
- package/dist/browser/components/block/ProducerChip.d.ts +1 -1
- package/dist/browser/components/block/ProducerChip.d.ts.map +1 -1
- package/dist/browser/components/block/helpers/blockProducer.d.ts +6 -2
- package/dist/browser/components/block/helpers/blockProducer.d.ts.map +1 -1
- package/dist/browser/components/block/helpers/payloadCountsFromBlock.d.ts +1 -1
- package/dist/browser/components/block/helpers/payloadCountsFromBlock.d.ts.map +1 -1
- package/dist/browser/components/block/hooks/useBlockProducer.d.ts +6 -2
- package/dist/browser/components/block/hooks/useBlockProducer.d.ts.map +1 -1
- package/dist/browser/components/block/hooks/usePayloadCountsFromBlock.d.ts +1 -1
- package/dist/browser/components/block/hooks/usePayloadCountsFromBlock.d.ts.map +1 -1
- package/dist/browser/components/block/menu/Expanded.d.ts +1 -1
- package/dist/browser/components/block/menu/Expanded.d.ts.map +1 -1
- package/dist/browser/components/block/table/cell/lib/BlockTableCellProps.d.ts +1 -1
- package/dist/browser/components/block/table/cell/lib/BlockTableCellProps.d.ts.map +1 -1
- package/dist/browser/components/chain/hooks/useOnBlock.d.ts +21 -13
- package/dist/browser/components/chain/hooks/useOnBlock.d.ts.map +1 -1
- package/dist/browser/components/index.d.ts +1 -0
- package/dist/browser/components/index.d.ts.map +1 -1
- package/dist/browser/components/payload/builder/transfer/Form.d.ts.map +1 -1
- package/dist/browser/components/payload/builder/transfer/builder/SingleFlexbox.d.ts.map +1 -1
- package/dist/browser/components/payload/fields/BlockNumberTextField.d.ts +1 -1
- package/dist/browser/components/payload/fields/BlockNumberTextField.d.ts.map +1 -1
- package/dist/browser/components/payload/fields/XyoAddressTextField.d.ts.map +1 -1
- package/dist/browser/components/rate/SpanTypography.d.ts +8 -0
- package/dist/browser/components/rate/SpanTypography.d.ts.map +1 -0
- package/dist/browser/components/rate/SpeedTypography.d.ts +7 -0
- package/dist/browser/components/rate/SpeedTypography.d.ts.map +1 -0
- package/dist/browser/components/rate/TimeTypography.d.ts +7 -0
- package/dist/browser/components/rate/TimeTypography.d.ts.map +1 -0
- package/dist/browser/components/rate/flexbox/FlexBox.d.ts +7 -0
- package/dist/browser/components/rate/flexbox/FlexBox.d.ts.map +1 -0
- package/dist/browser/components/rate/flexbox/FlexBox.stories.d.ts +10 -0
- package/dist/browser/components/rate/flexbox/FlexBox.stories.d.ts.map +1 -0
- package/dist/browser/components/rate/flexbox/index.d.ts +2 -0
- package/dist/browser/components/rate/flexbox/index.d.ts.map +1 -0
- package/dist/browser/components/rate/gauge/Container.d.ts +15 -0
- package/dist/browser/components/rate/gauge/Container.d.ts.map +1 -0
- package/dist/browser/components/rate/gauge/Container.stories.d.ts +12 -0
- package/dist/browser/components/rate/gauge/Container.stories.d.ts.map +1 -0
- package/dist/browser/components/rate/gauge/Pointer.d.ts +6 -0
- package/dist/browser/components/rate/gauge/Pointer.d.ts.map +1 -0
- package/dist/browser/components/rate/gauge/Ticks.d.ts +38 -0
- package/dist/browser/components/rate/gauge/Ticks.d.ts.map +1 -0
- package/dist/browser/components/rate/gauge/WithLabel.d.ts +5 -0
- package/dist/browser/components/rate/gauge/WithLabel.d.ts.map +1 -0
- package/dist/browser/components/rate/gauge/WithLabel.stories.d.ts +11 -0
- package/dist/browser/components/rate/gauge/WithLabel.stories.d.ts.map +1 -0
- package/dist/browser/components/rate/gauge/helpers/blockRateConversions.d.ts +4 -0
- package/dist/browser/components/rate/gauge/helpers/blockRateConversions.d.ts.map +1 -0
- package/dist/browser/components/rate/gauge/helpers/index.d.ts +2 -0
- package/dist/browser/components/rate/gauge/helpers/index.d.ts.map +1 -0
- package/dist/browser/components/rate/gauge/index.d.ts +5 -0
- package/dist/browser/components/rate/gauge/index.d.ts.map +1 -0
- package/dist/browser/components/rate/index.d.ts +7 -0
- package/dist/browser/components/rate/index.d.ts.map +1 -0
- package/dist/browser/components/rate/support/MetricTypography.d.ts +11 -0
- package/dist/browser/components/rate/support/MetricTypography.d.ts.map +1 -0
- package/dist/browser/components/rate/support/index.d.ts +2 -0
- package/dist/browser/components/rate/support/index.d.ts.map +1 -0
- package/dist/browser/components/transactions/TransactionsQuickTipButton.d.ts +1 -1
- package/dist/browser/components/transactions/TransactionsQuickTipButton.d.ts.map +1 -1
- package/dist/browser/components/transactions/submit/Builder.d.ts +1 -1
- package/dist/browser/components/transactions/submit/Builder.d.ts.map +1 -1
- package/dist/browser/context/analyzer/state.d.ts +1 -1
- package/dist/browser/context/analyzer/state.d.ts.map +1 -1
- package/dist/browser/context/chain/Provider.d.ts.map +1 -1
- package/dist/browser/context/chain/State.d.ts +1 -2
- package/dist/browser/context/chain/State.d.ts.map +1 -1
- package/dist/browser/helpers/rate/index.d.ts +2 -0
- package/dist/browser/helpers/rate/index.d.ts.map +1 -0
- package/dist/browser/helpers/rate/rateUnitToLabel.d.ts +3 -0
- package/dist/browser/helpers/rate/rateUnitToLabel.d.ts.map +1 -0
- package/dist/browser/helpers/txsFromBlock.d.ts +4 -22
- package/dist/browser/helpers/txsFromBlock.d.ts.map +1 -1
- package/dist/browser/hooks/chain-iterator/useChainIteratorParams.d.ts +47 -143
- package/dist/browser/hooks/chain-iterator/useChainIteratorParams.d.ts.map +1 -1
- package/dist/browser/hooks/useTxsFromBlock.d.ts +2 -22
- package/dist/browser/hooks/useTxsFromBlock.d.ts.map +1 -1
- package/dist/browser/index.mjs +735 -342
- package/dist/browser/index.mjs.map +1 -1
- package/dist/browser/types/BlockComponentProps.d.ts +1 -1
- package/dist/browser/types/BlockComponentProps.d.ts.map +1 -1
- package/dist/browser/types/BlockComponents.d.ts +1 -1
- package/dist/browser/types/BlockComponents.d.ts.map +1 -1
- package/dist/browser/types/render/BlockChainRenderProps.d.ts +1 -2
- package/dist/browser/types/render/BlockChainRenderProps.d.ts.map +1 -1
- package/package.json +37 -38
- package/src/components/account/BalanceHistoryFlexbox.stories.tsx +1 -1
- package/src/components/account/BalanceHistoryFlexbox.tsx +2 -2
- package/src/components/account/helpers/formatBalanceMagnitude.ts +1 -1
- package/src/components/account/hooks/usePagedAccountBalanceHistory.ts +9 -14
- package/src/components/account/table/BalanceHistoryTableEx.stories.tsx +2 -2
- package/src/components/account/table/RawAmountTableCell.tsx +1 -1
- package/src/components/block/ProducerChip.tsx +1 -1
- package/src/components/block/helpers/blockProducer.ts +1 -1
- package/src/components/block/helpers/payloadCountsFromBlock.ts +1 -1
- package/src/components/block/hooks/useBlockProducer.ts +1 -1
- package/src/components/block/hooks/usePayloadCountsFromBlock.ts +1 -1
- package/src/components/block/menu/Expanded.tsx +1 -1
- package/src/components/block/table/cell/lib/BlockTableCellProps.ts +1 -1
- package/src/components/chain/hooks/useOnBlock.ts +12 -12
- package/src/components/index.ts +1 -0
- package/src/components/payload/builder/producer-intent/Form.tsx +1 -1
- package/src/components/payload/builder/transfer/Form.tsx +6 -4
- package/src/components/payload/builder/transfer/builder/SingleFlexbox.tsx +12 -15
- package/src/components/payload/fields/BlockNumberTextField.tsx +1 -1
- package/src/components/payload/fields/XyoAddressTextField.tsx +10 -3
- package/src/components/rate/SpanTypography.tsx +20 -0
- package/src/components/rate/SpeedTypography.tsx +17 -0
- package/src/components/rate/TimeTypography.tsx +17 -0
- package/src/components/rate/flexbox/FlexBox.stories.tsx +44 -0
- package/src/components/rate/flexbox/FlexBox.tsx +31 -0
- package/src/components/rate/flexbox/index.ts +1 -0
- package/src/components/rate/gauge/Container.stories.tsx +77 -0
- package/src/components/rate/gauge/Container.tsx +75 -0
- package/src/components/rate/gauge/Pointer.tsx +67 -0
- package/src/components/rate/gauge/Ticks.tsx +122 -0
- package/src/components/rate/gauge/WithLabel.stories.tsx +70 -0
- package/src/components/rate/gauge/WithLabel.tsx +20 -0
- package/src/components/rate/gauge/helpers/blockRateConversions.ts +104 -0
- package/src/components/rate/gauge/helpers/index.ts +1 -0
- package/src/components/rate/gauge/index.ts +4 -0
- package/src/components/rate/index.ts +6 -0
- package/src/components/rate/support/MetricTypography.tsx +78 -0
- package/src/components/rate/support/index.ts +1 -0
- package/src/components/transactions/TransactionsQuickTipButton.tsx +15 -10
- package/src/components/transactions/submit/Builder.tsx +2 -2
- package/src/components/transactions/submit/SubmitChain.tsx +2 -2
- package/src/context/analyzer/Provider.tsx +3 -3
- package/src/context/analyzer/state.ts +1 -1
- package/src/context/chain/Provider.tsx +28 -21
- package/src/context/chain/State.ts +1 -2
- package/src/helpers/rate/index.ts +1 -0
- package/src/helpers/rate/rateUnitToLabel.ts +27 -0
- package/src/helpers/txsFromBlock.ts +4 -2
- package/src/hooks/chain-iterator/useChainIteratorParams.ts +13 -4
- package/src/hooks/useTxsFromBlock.ts +1 -1
- package/src/stories/ChainArchivistDecorator.tsx +1 -1
- package/src/stories/ChainArchivistDelayedInsertDecorator.tsx +2 -2
- package/src/types/BlockComponentProps.ts +1 -1
- package/src/types/BlockComponents.ts +1 -1
- package/src/types/render/BlockChainRenderProps.ts +1 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Hash } from '@xylabs/sdk-js';
|
|
2
|
-
import type { HydratedBlockWithHashMeta } from '@xyo-network/xl1-
|
|
2
|
+
import type { HydratedBlockWithHashMeta } from '@xyo-network/xl1-sdk';
|
|
3
3
|
/** Interface for all components that render a single block */
|
|
4
4
|
export interface BlockComponentProps {
|
|
5
5
|
block: HydratedBlockWithHashMeta;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockComponentProps.d.ts","sourceRoot":"","sources":["../../../src/types/BlockComponentProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"BlockComponentProps.d.ts","sourceRoot":"","sources":["../../../src/types/BlockComponentProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AAErE,8DAA8D;AAC9D,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,yBAAyB,CAAA;IAChC,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B;AAED,gFAAgF;AAChF,MAAM,WAAW,0BAA2B,SAAQ,mBAAmB;IACrE,YAAY,EAAE,IAAI,EAAE,CAAA;CACrB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { NodesWithKeys } from '@xylabs/react-animation';
|
|
2
|
-
import type { HydratedBlock } from '@xyo-network/xl1-
|
|
2
|
+
import type { HydratedBlock } from '@xyo-network/xl1-sdk';
|
|
3
3
|
/** Interface for all block components meant to be rendered in a chain */
|
|
4
4
|
export interface BlockChainRenderComponent extends NodesWithKeys {
|
|
5
5
|
block: HydratedBlock;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockComponents.d.ts","sourceRoot":"","sources":["../../../src/types/BlockComponents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"BlockComponents.d.ts","sourceRoot":"","sources":["../../../src/types/BlockComponents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEzD,yEAAyE;AACzE,MAAM,WAAW,yBAA0B,SAAQ,aAAa;IAC9D,KAAK,EAAE,aAAa,CAAA;CACrB"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { CreatableName, Hash } from '@xylabs/sdk-js';
|
|
2
2
|
import type { Payload, WithStorageMeta } from '@xyo-network/payload-model';
|
|
3
|
-
import type { ChainId } from '@xyo-network/xl1-
|
|
4
|
-
import type { PayloadMapRead } from '@xyo-network/xl1-protocol-sdk';
|
|
3
|
+
import type { ChainId, PayloadMapRead } from '@xyo-network/xl1-sdk';
|
|
5
4
|
/** Props that control the rendering (not blockchain specific) */
|
|
6
5
|
export interface RenderProps {
|
|
7
6
|
maxBlocks?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockChainRenderProps.d.ts","sourceRoot":"","sources":["../../../../src/types/render/BlockChainRenderProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC1E,OAAO,KAAK,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"BlockChainRenderProps.d.ts","sourceRoot":"","sources":["../../../../src/types/render/BlockChainRenderProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC1E,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAEnE,iEAAiE;AACjE,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,sDAAsD;AACtD,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,cAAc,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAA;IACnD,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,IAAI,EAAE,aAAa,CAAA;CACpB;AAED,uCAAuC;AACvC,MAAM,WAAW,qBAAsB,SAAQ,kBAAkB,EAAE,WAAW;CAE7E;AAED,gFAAgF;AAChF,MAAM,WAAW,yBAAyB;IACxC,qBAAqB,CAAC,EAAE,qBAAqB,CAAA;IAC7C,KAAK,CAAC,EAAE,KAAK,CAAA;CACd"}
|
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.18.
|
|
4
|
+
"version": "1.18.2",
|
|
5
5
|
"description": "XYO Layer One React SDK Blockchain",
|
|
6
6
|
"homepage": "https://xylabs.com",
|
|
7
7
|
"bugs": {
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"package-cycle": "echo Nothing to do"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@storybook/react-vite": "~10.
|
|
51
|
-
"@xylabs/axios": "~5.0.
|
|
50
|
+
"@storybook/react-vite": "~10.2.0",
|
|
51
|
+
"@xylabs/axios": "~5.0.64",
|
|
52
52
|
"@xylabs/react-animation": "~7.1.9",
|
|
53
53
|
"@xylabs/react-error": "~7.1.9",
|
|
54
54
|
"@xylabs/react-flexbox": "~7.1.9",
|
|
@@ -56,53 +56,51 @@
|
|
|
56
56
|
"@xylabs/react-quick-tip-button": "~7.1.9",
|
|
57
57
|
"@xylabs/react-shared": "~7.1.9",
|
|
58
58
|
"@xylabs/react-theme": "~7.1.9",
|
|
59
|
-
"@xylabs/sdk-js": "~5.0.
|
|
60
|
-
"@xyo-network/account": "~5.2.
|
|
61
|
-
"@xyo-network/archivist-memory": "~5.2.
|
|
62
|
-
"@xyo-network/archivist-model": "~5.2.
|
|
63
|
-
"@xyo-network/boundwitness-builder": "~5.2.
|
|
64
|
-
"@xyo-network/boundwitness-model": "~5.2.
|
|
65
|
-
"@xyo-network/chain-analyze": "~1.18.
|
|
66
|
-
"@xyo-network/chain-protocol": "~1.18.
|
|
67
|
-
"@xyo-network/chain-wrappers": "~1.18.
|
|
68
|
-
"@xyo-network/module-model": "~5.2.
|
|
69
|
-
"@xyo-network/payload-builder": "~5.2.
|
|
70
|
-
"@xyo-network/payload-model": "~5.2.
|
|
59
|
+
"@xylabs/sdk-js": "~5.0.64",
|
|
60
|
+
"@xyo-network/account": "~5.2.25",
|
|
61
|
+
"@xyo-network/archivist-memory": "~5.2.25",
|
|
62
|
+
"@xyo-network/archivist-model": "~5.2.25",
|
|
63
|
+
"@xyo-network/boundwitness-builder": "~5.2.25",
|
|
64
|
+
"@xyo-network/boundwitness-model": "~5.2.25",
|
|
65
|
+
"@xyo-network/chain-analyze": "~1.18.2",
|
|
66
|
+
"@xyo-network/chain-protocol": "~1.18.2",
|
|
67
|
+
"@xyo-network/chain-wrappers": "~1.18.2",
|
|
68
|
+
"@xyo-network/module-model": "~5.2.25",
|
|
69
|
+
"@xyo-network/payload-builder": "~5.2.25",
|
|
70
|
+
"@xyo-network/payload-model": "~5.2.25",
|
|
71
71
|
"@xyo-network/react-boundwitness-plugin": "~7.4.2",
|
|
72
|
-
"@xyo-network/react-chain-blockies": "~1.18.
|
|
73
|
-
"@xyo-network/react-chain-provider": "~1.18.
|
|
74
|
-
"@xyo-network/react-chain-shared": "~1.18.
|
|
72
|
+
"@xyo-network/react-chain-blockies": "~1.18.2",
|
|
73
|
+
"@xyo-network/react-chain-provider": "~1.18.2",
|
|
74
|
+
"@xyo-network/react-chain-shared": "~1.18.2",
|
|
75
75
|
"@xyo-network/react-error": "~7.4.2",
|
|
76
76
|
"@xyo-network/react-event": "~7.4.2",
|
|
77
77
|
"@xyo-network/react-payload-raw-info": "~7.4.2",
|
|
78
78
|
"@xyo-network/react-payload-table": "~7.4.2",
|
|
79
79
|
"@xyo-network/react-shared": "~7.4.2",
|
|
80
80
|
"@xyo-network/react-table": "~7.4.2",
|
|
81
|
-
"@xyo-network/xl1-
|
|
82
|
-
"@xyo-network/xl1-protocol-sdk": "~1.18.0"
|
|
81
|
+
"@xyo-network/xl1-sdk": "~1.19.4"
|
|
83
82
|
},
|
|
84
83
|
"devDependencies": {
|
|
85
84
|
"@emotion/react": "~11.14.0",
|
|
86
85
|
"@emotion/styled": "~11.14.1",
|
|
87
|
-
"@mui/icons-material": "~7.3.
|
|
88
|
-
"@mui/material": "~7.3.
|
|
89
|
-
"@types/react": "~19.2.
|
|
86
|
+
"@mui/icons-material": "~7.3.7",
|
|
87
|
+
"@mui/material": "~7.3.7",
|
|
88
|
+
"@types/react": "~19.2.9",
|
|
90
89
|
"@xylabs/react-button": "~7.1.9",
|
|
91
|
-
"@xylabs/sdk-js": "~5.0.
|
|
92
|
-
"@xylabs/ts-scripts-yarn3": "~7.2
|
|
93
|
-
"@xylabs/tsconfig": "~7.2
|
|
94
|
-
"@xylabs/tsconfig-dom": "~7.2
|
|
95
|
-
"@xylabs/tsconfig-react": "~7.2
|
|
96
|
-
"@xyo-network/api-models": "~5.2.
|
|
97
|
-
"@xyo-network/bridge-http": "~5.2.
|
|
98
|
-
"@xyo-network/xl1-
|
|
99
|
-
"
|
|
100
|
-
"axios": "^1.13.2",
|
|
90
|
+
"@xylabs/sdk-js": "~5.0.64",
|
|
91
|
+
"@xylabs/ts-scripts-yarn3": "~7.3.2",
|
|
92
|
+
"@xylabs/tsconfig": "~7.3.2",
|
|
93
|
+
"@xylabs/tsconfig-dom": "~7.3.2",
|
|
94
|
+
"@xylabs/tsconfig-react": "~7.3.2",
|
|
95
|
+
"@xyo-network/api-models": "~5.2.25",
|
|
96
|
+
"@xyo-network/bridge-http": "~5.2.25",
|
|
97
|
+
"@xyo-network/xl1-sdk": "~1.19.4",
|
|
98
|
+
"axios": "^1.13.3",
|
|
101
99
|
"eslint": "^9.39.2",
|
|
102
|
-
"react": "~19.2.
|
|
103
|
-
"react-dom": "~19.2.
|
|
104
|
-
"react-router-dom": "^7.
|
|
105
|
-
"storybook": "~10.
|
|
100
|
+
"react": "~19.2.4",
|
|
101
|
+
"react-dom": "~19.2.4",
|
|
102
|
+
"react-router-dom": "^7.13.0",
|
|
103
|
+
"storybook": "~10.2.0",
|
|
106
104
|
"typescript": "~5.9.3"
|
|
107
105
|
},
|
|
108
106
|
"peerDependencies": {
|
|
@@ -110,6 +108,7 @@
|
|
|
110
108
|
"@emotion/styled": "~11",
|
|
111
109
|
"@mui/icons-material": ">=6 <8",
|
|
112
110
|
"@mui/material": ">=6 <8",
|
|
111
|
+
"@mui/x-charts": "~8.23.0",
|
|
113
112
|
"axios": "^1",
|
|
114
113
|
"react": "~19",
|
|
115
114
|
"react-dom": "~19",
|
|
@@ -119,4 +118,4 @@
|
|
|
119
118
|
"access": "restricted"
|
|
120
119
|
},
|
|
121
120
|
"docs": "dist/docs.json"
|
|
122
|
-
}
|
|
121
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Meta, StoryFn } from '@storybook/react-vite'
|
|
2
2
|
import type { Address } from '@xylabs/sdk-js'
|
|
3
3
|
import { useHttpRpcViewer } from '@xyo-network/react-chain-provider'
|
|
4
|
-
import { LocalNetwork } from '@xyo-network/xl1-
|
|
4
|
+
import { LocalNetwork } from '@xyo-network/xl1-sdk'
|
|
5
5
|
import React from 'react'
|
|
6
6
|
|
|
7
7
|
import { AccountBalanceHistoryFlexBox } from './BalanceHistoryFlexbox.tsx'
|
|
@@ -5,8 +5,8 @@ import { type Address } from '@xylabs/sdk-js'
|
|
|
5
5
|
import { isDefined } from '@xylabs/sdk-js'
|
|
6
6
|
import { useAccountBalanceHistory } from '@xyo-network/react-chain-provider'
|
|
7
7
|
import { ErrorRender } from '@xyo-network/react-error'
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
8
|
+
import type { XyoViewer } from '@xyo-network/xl1-sdk'
|
|
9
|
+
import { AttoXL1 } from '@xyo-network/xl1-sdk'
|
|
10
10
|
import React from 'react'
|
|
11
11
|
|
|
12
12
|
import { formatBalanceMagnitude } from './helpers/index.ts'
|
|
@@ -2,11 +2,8 @@ import type { Address } from '@xylabs/sdk-js'
|
|
|
2
2
|
import { isDefined } from '@xylabs/sdk-js'
|
|
3
3
|
import type { AccountBalanceHistoryItemFormatted } from '@xyo-network/react-chain-provider'
|
|
4
4
|
import { useAccountBalanceHistory } from '@xyo-network/react-chain-provider'
|
|
5
|
-
import type { XL1BlockRange } from '@xyo-network/xl1-
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
useCallback, useMemo, useState,
|
|
9
|
-
} from 'react'
|
|
5
|
+
import type { XL1BlockRange, XyoViewer } from '@xyo-network/xl1-sdk'
|
|
6
|
+
import { useCallback, useState } from 'react'
|
|
10
7
|
|
|
11
8
|
export const usePagedAccountBalanceHistory = (address?: Address, viewer?: XyoViewer, maxPage = 1) => {
|
|
12
9
|
const [updatedBlockRange, setUpdatedBlockRange] = useState<XL1BlockRange>()
|
|
@@ -14,16 +11,14 @@ export const usePagedAccountBalanceHistory = (address?: Address, viewer?: XyoVie
|
|
|
14
11
|
const [results, error, loading] = useAccountBalanceHistory(address, viewer, maxPage, updatedBlockRange)
|
|
15
12
|
|
|
16
13
|
const { history, truncated } = results || {}
|
|
14
|
+
const [previousHistory, setPreviousHistory] = useState(history)
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
}, [history])
|
|
16
|
+
// Reset paged history when address changes
|
|
17
|
+
if (isDefined(history) && history !== previousHistory) {
|
|
18
|
+
setPagedHistory([...pagedHistory ?? [], ...history])
|
|
19
|
+
setPreviousHistory(history)
|
|
20
|
+
}
|
|
25
21
|
|
|
26
|
-
const firstBlock = isDefined(history) ? history.at(0)?.blockNumber : undefined
|
|
27
22
|
const lastBlock = isDefined(history) ? history.at(-1)?.blockNumber : undefined
|
|
28
23
|
const historyComplete = isDefined(history) && history.length === 0
|
|
29
24
|
|
|
@@ -32,7 +27,7 @@ export const usePagedAccountBalanceHistory = (address?: Address, viewer?: XyoVie
|
|
|
32
27
|
const newEndBlock = lastBlock - 1
|
|
33
28
|
setUpdatedBlockRange([0, newEndBlock] as XL1BlockRange)
|
|
34
29
|
}
|
|
35
|
-
}, [
|
|
30
|
+
}, [lastBlock, truncated])
|
|
36
31
|
|
|
37
32
|
return {
|
|
38
33
|
pagedHistory,
|
|
@@ -10,8 +10,8 @@ import { useAccountBalanceHistory, useHttpRpcViewer } from '@xyo-network/react-c
|
|
|
10
10
|
import { ErrorRender } from '@xyo-network/react-error'
|
|
11
11
|
import type { Event } from '@xyo-network/react-event'
|
|
12
12
|
import { useEvent } from '@xyo-network/react-event'
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
13
|
+
import type { XL1BlockRange } from '@xyo-network/xl1-sdk'
|
|
14
|
+
import { LocalNetwork } from '@xyo-network/xl1-sdk'
|
|
15
15
|
import { useState } from 'react'
|
|
16
16
|
|
|
17
17
|
import { usePagedAccountBalanceHistory } from '../hooks/index.ts'
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import { isDefined, toHex } from '@xylabs/sdk-js'
|
|
6
6
|
import type { BalanceTransactionType } from '@xyo-network/react-chain-provider'
|
|
7
7
|
import { useEvent } from '@xyo-network/react-event'
|
|
8
|
-
import { XL1Amount } from '@xyo-network/xl1-
|
|
8
|
+
import { XL1Amount } from '@xyo-network/xl1-sdk'
|
|
9
9
|
import React from 'react'
|
|
10
10
|
|
|
11
11
|
import type { BalanceHistoryEventNouns } from './types/index.ts'
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
EthAddressWrapper, isString, isUndefined, toAddress,
|
|
5
5
|
} from '@xylabs/sdk-js'
|
|
6
6
|
import { BlockiesAvatar } from '@xyo-network/react-chain-blockies'
|
|
7
|
-
import type { HydratedBlock } from '@xyo-network/xl1-
|
|
7
|
+
import type { HydratedBlock } from '@xyo-network/xl1-sdk'
|
|
8
8
|
import React, { useMemo } from 'react'
|
|
9
9
|
|
|
10
10
|
import { ChipSkeleton } from './ChipSkeleton.tsx'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BoundWitnessSchema } from '@xyo-network/boundwitness-model'
|
|
2
|
-
import { type HydratedBlock, isTransactionBoundWitness } from '@xyo-network/xl1-
|
|
2
|
+
import { type HydratedBlock, isTransactionBoundWitness } from '@xyo-network/xl1-sdk'
|
|
3
3
|
|
|
4
4
|
export const payloadCountsFromBlock = ([block, payloads]: HydratedBlock): [number, number] => {
|
|
5
5
|
const publicPayloads = block.payload_schemas.filter(schema => schema !== BoundWitnessSchema)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MoreVert } from '@mui/icons-material'
|
|
2
2
|
import { IconButton, Menu } from '@mui/material'
|
|
3
3
|
import { BWJsonMenuItem, BWPreviousHashMenuItem } from '@xyo-network/react-boundwitness-plugin'
|
|
4
|
-
import type { HydratedBlock } from '@xyo-network/xl1-
|
|
4
|
+
import type { HydratedBlock } from '@xyo-network/xl1-sdk'
|
|
5
5
|
import React from 'react'
|
|
6
6
|
|
|
7
7
|
import { useAnchorElement } from '../hooks/index.ts'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TableCellProps } from '@mui/material'
|
|
2
|
-
import type { HydratedBlockWithHashMeta } from '@xyo-network/xl1-
|
|
2
|
+
import type { HydratedBlockWithHashMeta } from '@xyo-network/xl1-sdk'
|
|
3
3
|
|
|
4
4
|
export interface BlockTableCellProps extends TableCellProps {
|
|
5
5
|
block?: HydratedBlockWithHashMeta
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HydratedBlock } from '@xyo-network/xl1-
|
|
1
|
+
import type { HydratedBlock } from '@xyo-network/xl1-sdk'
|
|
2
2
|
import { useEffect, useRef } from 'react'
|
|
3
3
|
|
|
4
4
|
export type PollingState = 'paused' | 'running'
|
|
@@ -14,15 +14,15 @@ export const useOnBlock = (
|
|
|
14
14
|
* But, since we get new blockComponents regardless, the hook rerenders anyway so consumers can get
|
|
15
15
|
* the latest blocksWhilePaused value without having to rely on a state update.
|
|
16
16
|
*/
|
|
17
|
-
const
|
|
17
|
+
const blocksWhilePausedRef = useRef<HydratedBlock[]>([])
|
|
18
18
|
// Because the useEffect has liveHead AND pollingState, every time the polling state changes, the hook will
|
|
19
19
|
// run a second time with the live head from the previous run. This is why we need to keep track of the last
|
|
20
20
|
// live head so we can compare it to the current live head and prevent the hook from adding the same block twice
|
|
21
|
-
const
|
|
21
|
+
const lastLiveHeadRef = useRef<HydratedBlock | undefined>(liveHead)
|
|
22
22
|
|
|
23
23
|
useEffect(() => {
|
|
24
|
-
const lastLiveHeadBlock =
|
|
25
|
-
const blocksWhilePausedBlock =
|
|
24
|
+
const lastLiveHeadBlock = lastLiveHeadRef.current?.[0]
|
|
25
|
+
const blocksWhilePausedBlock = lastLiveHeadRef.current?.[0]
|
|
26
26
|
const liveHeadBlock = liveHead?.[0]
|
|
27
27
|
|
|
28
28
|
// use lastLiveHead to prevent the hook from adding the same block multiple times
|
|
@@ -30,26 +30,26 @@ export const useOnBlock = (
|
|
|
30
30
|
|
|
31
31
|
if (liveHead && onAddBlock) {
|
|
32
32
|
// update lastLiveHead
|
|
33
|
-
|
|
33
|
+
lastLiveHeadRef.current = liveHead
|
|
34
34
|
|
|
35
35
|
// if the polling state is paused and the block is new, add it to the blocksWhilePaused array
|
|
36
36
|
const isNewBlock = initialHeadNumber !== liveHeadBlock?.block && liveHeadBlock?.block !== blocksWhilePausedBlock?.block
|
|
37
37
|
if (pollingState === 'paused' && isNewBlock) {
|
|
38
|
-
|
|
38
|
+
blocksWhilePausedRef.current.push(liveHead)
|
|
39
39
|
} else if (pollingState === 'running') {
|
|
40
40
|
// if the polling state is running, add the blocksWhilePaused
|
|
41
|
-
if (
|
|
42
|
-
for (const block of
|
|
41
|
+
if (blocksWhilePausedRef.current.length > 0) {
|
|
42
|
+
for (const block of blocksWhilePausedRef.current) {
|
|
43
43
|
void onAddBlock(block)
|
|
44
44
|
}
|
|
45
45
|
// clear the blocksWhilePaused array
|
|
46
|
-
|
|
46
|
+
blocksWhilePausedRef.current = []
|
|
47
47
|
}
|
|
48
48
|
// add the liveHead block
|
|
49
49
|
void onAddBlock(liveHead)
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
}, [liveHead, pollingState])
|
|
52
|
+
}, [initialHeadNumber, liveHead, onAddBlock, pollingState])
|
|
53
53
|
|
|
54
|
-
return
|
|
54
|
+
return blocksWhilePausedRef
|
|
55
55
|
}
|
package/src/components/index.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Button, FormControl } from '@mui/material'
|
|
|
2
2
|
import { usePromise } from '@xylabs/react-promise'
|
|
3
3
|
import type { Address } from '@xylabs/sdk-js'
|
|
4
4
|
import { createProducerChainStakeIntent } from '@xyo-network/chain-protocol'
|
|
5
|
-
import type { XL1BlockNumber } from '@xyo-network/xl1-
|
|
5
|
+
import type { XL1BlockNumber } from '@xyo-network/xl1-sdk'
|
|
6
6
|
import type { MouseEventHandler } from 'react'
|
|
7
7
|
import React, { useState } from 'react'
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Button, FormControl } from '@mui/material'
|
|
2
2
|
import type { Address, Hex } from '@xylabs/sdk-js'
|
|
3
3
|
import { isAddress } from '@xylabs/sdk-js'
|
|
4
|
-
import type { Transfer } from '@xyo-network/xl1-
|
|
5
|
-
import { TransferSchema } from '@xyo-network/xl1-
|
|
4
|
+
import type { Transfer } from '@xyo-network/xl1-sdk'
|
|
5
|
+
import { TransferSchema } from '@xyo-network/xl1-sdk'
|
|
6
6
|
import type { MouseEventHandler } from 'react'
|
|
7
7
|
import React, { useMemo, useState } from 'react'
|
|
8
8
|
|
|
@@ -17,6 +17,8 @@ export const TransferBuilderForm: React.FC<TransferBuilderFormProps> = ({ onBuil
|
|
|
17
17
|
const [fromAddress, setFromAddress] = useState<Address>()
|
|
18
18
|
const [transfers, setTransfers] = useState<TransferAmount[]>([])
|
|
19
19
|
|
|
20
|
+
const [epoch] = useState(() => Date.now())
|
|
21
|
+
|
|
20
22
|
const transferPayload: Transfer | undefined = useMemo(() => {
|
|
21
23
|
if (isAddress(fromAddress) && transfers.length > 0) {
|
|
22
24
|
const transfersRecord = {} as Transfer['transfers']
|
|
@@ -28,10 +30,10 @@ export const TransferBuilderForm: React.FC<TransferBuilderFormProps> = ({ onBuil
|
|
|
28
30
|
from: fromAddress,
|
|
29
31
|
schema: TransferSchema,
|
|
30
32
|
transfers: transfersRecord,
|
|
31
|
-
epoch
|
|
33
|
+
epoch,
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
|
-
}, [fromAddress, transfers])
|
|
36
|
+
}, [fromAddress, transfers, epoch])
|
|
35
37
|
|
|
36
38
|
const onBuildLocal: MouseEventHandler<HTMLButtonElement> = () => {
|
|
37
39
|
if (onBuild && transferPayload) onBuild?.(transferPayload)
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
import type { FlexBoxProps } from '@xylabs/react-flexbox'
|
|
6
6
|
import { FlexRow } from '@xylabs/react-flexbox'
|
|
7
7
|
import type { Address } from '@xylabs/sdk-js'
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
isAddress, isDefinedNotNull, toHex,
|
|
10
|
+
} from '@xylabs/sdk-js'
|
|
9
11
|
import { BigIntInput } from '@xyo-network/react-shared'
|
|
10
|
-
import React, {
|
|
11
|
-
useEffect, useMemo, useState,
|
|
12
|
-
} from 'react'
|
|
12
|
+
import React, { useEffect, useState } from 'react'
|
|
13
13
|
|
|
14
14
|
import { XyoAddressTextField } from '../../../fields/index.ts'
|
|
15
15
|
import type { TransferAmount } from '../Transfer.ts'
|
|
@@ -26,19 +26,16 @@ export const SingleTransferBuilderFlexbox: React.FC<SingleTransferBuilderFlexbox
|
|
|
26
26
|
const [toAddress, setToAddress] = useState<Address>()
|
|
27
27
|
const [amount, setAmount] = useState<bigint>()
|
|
28
28
|
|
|
29
|
-
const transferAmount = useMemo(() => {
|
|
30
|
-
if (isAddress(toAddress) && amount !== undefined) {
|
|
31
|
-
return {
|
|
32
|
-
...singleTransfer,
|
|
33
|
-
amount: toHex(amount),
|
|
34
|
-
to: toAddress,
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}, [toAddress, amount])
|
|
38
|
-
|
|
39
29
|
useEffect(() => {
|
|
30
|
+
const transferAmount = isAddress(toAddress) && isDefinedNotNull(amount)
|
|
31
|
+
? {
|
|
32
|
+
...singleTransfer,
|
|
33
|
+
amount: toHex(amount),
|
|
34
|
+
to: toAddress,
|
|
35
|
+
}
|
|
36
|
+
: undefined
|
|
40
37
|
if (transferAmount) onTransferUpdated?.(transferAmount)
|
|
41
|
-
}, [
|
|
38
|
+
}, [amount, onTransferUpdated, singleTransfer, toAddress])
|
|
42
39
|
|
|
43
40
|
return (
|
|
44
41
|
<FlexRow alignItems="start" gap={1} {...props}>
|
|
@@ -2,7 +2,7 @@ import type { StandardTextFieldProps } from '@mui/material'
|
|
|
2
2
|
import {
|
|
3
3
|
FormControl, FormHelperText, TextField,
|
|
4
4
|
} from '@mui/material'
|
|
5
|
-
import { toXL1BlockNumber, type XL1BlockNumber } from '@xyo-network/xl1-
|
|
5
|
+
import { toXL1BlockNumber, type XL1BlockNumber } from '@xyo-network/xl1-sdk'
|
|
6
6
|
import type { ChangeEventHandler } from 'react'
|
|
7
7
|
import React, { useState } from 'react'
|
|
8
8
|
|
|
@@ -3,8 +3,10 @@ import {
|
|
|
3
3
|
FormControl, FormHelperText, TextField,
|
|
4
4
|
} from '@mui/material'
|
|
5
5
|
import type { Address } from '@xylabs/sdk-js'
|
|
6
|
-
import {
|
|
7
|
-
|
|
6
|
+
import {
|
|
7
|
+
asAddress, isAddress, isDefined,
|
|
8
|
+
} from '@xylabs/sdk-js'
|
|
9
|
+
import React, { useState } from 'react'
|
|
8
10
|
|
|
9
11
|
interface XyoAddressTextFieldProps extends Omit<StandardTextFieldProps, 'value'> {
|
|
10
12
|
onAddressChanged?: (address?: Address) => void
|
|
@@ -18,7 +20,12 @@ export const XyoAddressTextField: React.FC<XyoAddressTextFieldProps> = ({
|
|
|
18
20
|
const [address, setAddress] = useState<string>('')
|
|
19
21
|
const [addressError, setAddressError] = useState<Error>()
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
const [previousResetValue, setPreviousResetValue] = useState<number | undefined>(resetValue)
|
|
24
|
+
|
|
25
|
+
if (isDefined(resetValue) && resetValue !== previousResetValue) {
|
|
26
|
+
setPreviousResetValue(resetValue)
|
|
27
|
+
setAddress('')
|
|
28
|
+
}
|
|
22
29
|
|
|
23
30
|
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
24
31
|
const { value } = event.target
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ViewAgendaOutlined } from '@mui/icons-material'
|
|
2
|
+
import { Tooltip, type TypographyProps } from '@mui/material'
|
|
3
|
+
import type { XL1BlockRange } from '@xyo-network/xl1-sdk'
|
|
4
|
+
|
|
5
|
+
import { MetricTypography } from './support/index.ts'
|
|
6
|
+
|
|
7
|
+
export interface BlockRateSpanTypographyProps extends TypographyProps {
|
|
8
|
+
range?: XL1BlockRange
|
|
9
|
+
span?: number
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const BlockRateSpanTypography: React.FC<BlockRateSpanTypographyProps> = ({
|
|
13
|
+
range, span, sx, ...props
|
|
14
|
+
}) => {
|
|
15
|
+
return (
|
|
16
|
+
<Tooltip title={`Block Range: ${range?.join(' - ')}`}>
|
|
17
|
+
<MetricTypography icon={<ViewAgendaOutlined fontSize="large" />} metric={span} label="blocks" {...props} />
|
|
18
|
+
</Tooltip>
|
|
19
|
+
)
|
|
20
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SpeedOutlined } from '@mui/icons-material'
|
|
2
|
+
import type { TypographyProps } from '@mui/material'
|
|
3
|
+
|
|
4
|
+
import { MetricTypography } from './support/index.ts'
|
|
5
|
+
|
|
6
|
+
export interface BlockRateSpeedTypographyProps extends TypographyProps {
|
|
7
|
+
rate?: number
|
|
8
|
+
rateUnitLabel?: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const BlockRateSpeedTypography: React.FC<BlockRateSpeedTypographyProps> = ({
|
|
12
|
+
rate, rateUnitLabel, ...props
|
|
13
|
+
}) => {
|
|
14
|
+
return (
|
|
15
|
+
<MetricTypography icon={<SpeedOutlined fontSize="large" />} metric={rate} label={rateUnitLabel} {...props} />
|
|
16
|
+
)
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TimelapseOutlined } from '@mui/icons-material'
|
|
2
|
+
import { type TypographyProps } from '@mui/material'
|
|
3
|
+
|
|
4
|
+
import { MetricTypography } from './support/index.ts'
|
|
5
|
+
|
|
6
|
+
export interface BlockRateTimeTypographyProps extends TypographyProps {
|
|
7
|
+
rateUnit?: string
|
|
8
|
+
timeDifference?: number
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const BlockRateTimeTypography: React.FC<BlockRateTimeTypographyProps> = ({
|
|
12
|
+
rateUnit, timeDifference, sx, ...props
|
|
13
|
+
}) => {
|
|
14
|
+
return (
|
|
15
|
+
<MetricTypography icon={<TimelapseOutlined fontSize="large" />} metric={timeDifference} label={rateUnit} {...props} />
|
|
16
|
+
)
|
|
17
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Meta, StoryFn } from '@storybook/react-vite'
|
|
2
|
+
import type { BlockRate } from '@xyo-network/xl1-sdk'
|
|
3
|
+
import { asXL1BlockRange } from '@xyo-network/xl1-sdk'
|
|
4
|
+
|
|
5
|
+
import { BlockRateFlexBox } from './FlexBox.tsx'
|
|
6
|
+
|
|
7
|
+
const blockRateSeconds: BlockRate = {
|
|
8
|
+
range: asXL1BlockRange([100, 200], true),
|
|
9
|
+
span: 100,
|
|
10
|
+
rate: 0.12,
|
|
11
|
+
rateUnit: 'seconds',
|
|
12
|
+
timeDifference: (100 * 12),
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const blockRateMinutes: BlockRate = {
|
|
16
|
+
range: asXL1BlockRange([100, 200], true),
|
|
17
|
+
span: 100,
|
|
18
|
+
rate: 12,
|
|
19
|
+
rateUnit: 'minutes',
|
|
20
|
+
timeDifference: (100 * 12) / 60,
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default {
|
|
24
|
+
title: 'BlockRate/FlexBox',
|
|
25
|
+
component: BlockRateFlexBox,
|
|
26
|
+
} satisfies Meta<typeof BlockRateFlexBox>
|
|
27
|
+
|
|
28
|
+
const Template: StoryFn<typeof BlockRateFlexBox> = (args) => {
|
|
29
|
+
return <BlockRateFlexBox {...args} />
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const Default = Template.bind({})
|
|
33
|
+
Default.args = {}
|
|
34
|
+
|
|
35
|
+
const WithBlockRateSeconds = Template.bind({})
|
|
36
|
+
WithBlockRateSeconds.args = { blockRate: blockRateSeconds }
|
|
37
|
+
|
|
38
|
+
const WithBlockRateMinutes = Template.bind({})
|
|
39
|
+
WithBlockRateMinutes.args = { blockRate: blockRateMinutes }
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
Default, WithBlockRateMinutes,
|
|
43
|
+
WithBlockRateSeconds,
|
|
44
|
+
}
|