@xyo-network/react-chain-blockchain 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 +88 -59
- package/dist/browser/components/chain/render/index.d.ts +0 -1
- package/dist/browser/components/chain/render/index.d.ts.map +1 -1
- package/dist/browser/components/transactions/submit/Builder.d.ts.map +1 -1
- package/dist/browser/context/chain/Context.d.ts +3 -3
- package/dist/browser/context/chain/State.d.ts +2 -2
- package/dist/browser/context/chain/State.d.ts.map +1 -1
- package/dist/browser/context/chain/use.d.ts +1 -1
- package/dist/browser/hooks/chain-iterator/index.d.ts +0 -1
- package/dist/browser/hooks/chain-iterator/index.d.ts.map +1 -1
- package/dist/browser/hooks/chain-iterator/useChainIteratorParams.d.ts +8 -3
- package/dist/browser/hooks/chain-iterator/useChainIteratorParams.d.ts.map +1 -1
- package/dist/browser/hooks/useIterateChain.d.ts.map +1 -1
- package/dist/browser/index.mjs +371 -569
- package/dist/browser/index.mjs.map +1 -1
- package/dist/browser/stories/ChainInfoContextDecorator.d.ts.map +1 -1
- package/dist/browser/types/render/BlockChainRenderProps.d.ts +5 -4
- package/dist/browser/types/render/BlockChainRenderProps.d.ts.map +1 -1
- package/package.json +57 -57
- package/src/components/block/hooks/useDynamicBlockComponents.ts +2 -2
- package/src/components/block/hooks/useStaticBlockComponents.ts +1 -1
- package/src/components/chain/render/index.ts +0 -1
- package/src/components/transactions/submit/Builder.tsx +2 -2
- package/src/context/chain/State.ts +2 -2
- package/src/hooks/chain-iterator/ChainIteratorStore.ts +2 -2
- package/src/hooks/chain-iterator/index.ts +0 -1
- package/src/hooks/chain-iterator/useChainIteratorParams.ts +5 -5
- package/src/hooks/useIterateChain.ts +8 -7
- package/src/stories/ChainInfoContextDecorator.tsx +4 -1
- package/src/types/render/BlockChainRenderProps.ts +5 -4
- package/dist/browser/components/chain/render/dynamic/flexbox/Flexbox.d.ts +0 -6
- package/dist/browser/components/chain/render/dynamic/flexbox/Flexbox.d.ts.map +0 -1
- package/dist/browser/components/chain/render/dynamic/flexbox/Flexbox.stories.d.ts +0 -8
- package/dist/browser/components/chain/render/dynamic/flexbox/Flexbox.stories.d.ts.map +0 -1
- package/dist/browser/components/chain/render/dynamic/flexbox/Remote.stories.d.ts +0 -8
- package/dist/browser/components/chain/render/dynamic/flexbox/Remote.stories.d.ts.map +0 -1
- package/dist/browser/components/chain/render/dynamic/flexbox/index.d.ts +0 -2
- package/dist/browser/components/chain/render/dynamic/flexbox/index.d.ts.map +0 -1
- package/dist/browser/components/chain/render/dynamic/flexbox/variants/Base.d.ts +0 -4
- package/dist/browser/components/chain/render/dynamic/flexbox/variants/Base.d.ts.map +0 -1
- package/dist/browser/components/chain/render/dynamic/flexbox/variants/WithAnalysis.d.ts +0 -4
- package/dist/browser/components/chain/render/dynamic/flexbox/variants/WithAnalysis.d.ts.map +0 -1
- package/dist/browser/components/chain/render/dynamic/flexbox/variants/WithRemote.d.ts +0 -4
- package/dist/browser/components/chain/render/dynamic/flexbox/variants/WithRemote.d.ts.map +0 -1
- package/dist/browser/components/chain/render/dynamic/flexbox/variants/index.d.ts +0 -4
- package/dist/browser/components/chain/render/dynamic/flexbox/variants/index.d.ts.map +0 -1
- package/dist/browser/components/chain/render/dynamic/hooks/index.d.ts +0 -3
- package/dist/browser/components/chain/render/dynamic/hooks/index.d.ts.map +0 -1
- package/dist/browser/components/chain/render/dynamic/hooks/useDynamicBlockRenderComponents.d.ts +0 -10
- package/dist/browser/components/chain/render/dynamic/hooks/useDynamicBlockRenderComponents.d.ts.map +0 -1
- package/dist/browser/components/chain/render/dynamic/hooks/useRemoteBlockChainRenderProps.d.ts +0 -5
- package/dist/browser/components/chain/render/dynamic/hooks/useRemoteBlockChainRenderProps.d.ts.map +0 -1
- package/dist/browser/components/chain/render/dynamic/index.d.ts +0 -2
- package/dist/browser/components/chain/render/dynamic/index.d.ts.map +0 -1
- package/dist/browser/hooks/chain-iterator/useChainIteratorStore.d.ts +0 -4
- package/dist/browser/hooks/chain-iterator/useChainIteratorStore.d.ts.map +0 -1
- package/src/components/chain/render/dynamic/flexbox/Flexbox.stories.tsx +0 -34
- package/src/components/chain/render/dynamic/flexbox/Flexbox.tsx +0 -7
- package/src/components/chain/render/dynamic/flexbox/Remote.stories.tsx +0 -49
- package/src/components/chain/render/dynamic/flexbox/index.ts +0 -1
- package/src/components/chain/render/dynamic/flexbox/variants/Base.tsx +0 -27
- package/src/components/chain/render/dynamic/flexbox/variants/WithAnalysis.tsx +0 -26
- package/src/components/chain/render/dynamic/flexbox/variants/WithRemote.tsx +0 -19
- package/src/components/chain/render/dynamic/flexbox/variants/index.ts +0 -3
- package/src/components/chain/render/dynamic/hooks/index.ts +0 -2
- package/src/components/chain/render/dynamic/hooks/useDynamicBlockRenderComponents.ts +0 -37
- package/src/components/chain/render/dynamic/hooks/useRemoteBlockChainRenderProps.ts +0 -31
- package/src/components/chain/render/dynamic/index.ts +0 -1
- package/src/hooks/chain-iterator/useChainIteratorStore.ts +0 -66
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChainInfoContextDecorator.d.ts","sourceRoot":"","sources":["../../../src/stories/ChainInfoContextDecorator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"ChainInfoContextDecorator.d.ts","sourceRoot":"","sources":["../../../src/stories/ChainInfoContextDecorator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAqBtD,eAAO,MAAM,yBAAyB,EAAE,SA2BvC,CAAA"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { CreatableName } from '@xylabs/creatable';
|
|
2
2
|
import type { Hash } from '@xylabs/hex';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
3
|
+
import type { Payload, WithStorageMeta } from '@xyo-network/payload-model';
|
|
4
|
+
import type { ChainId } from '@xyo-network/xl1-protocol';
|
|
5
|
+
import type { PayloadMapRead } from '@xyo-network/xl1-protocol-sdk';
|
|
5
6
|
/** Props that control the rendering (not blockchain specific) */
|
|
6
7
|
export interface RenderProps {
|
|
7
8
|
maxBlocks?: number;
|
|
@@ -9,8 +10,8 @@ export interface RenderProps {
|
|
|
9
10
|
}
|
|
10
11
|
/** Fields needed to talk to a block chain iterator */
|
|
11
12
|
export interface BlockChainIterator {
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
chainId?: ChainId;
|
|
14
|
+
chainMap?: PayloadMapRead<WithStorageMeta<Payload>>;
|
|
14
15
|
head?: Hash;
|
|
15
16
|
name: CreatableName;
|
|
16
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockChainRenderProps.d.ts","sourceRoot":"","sources":["../../../../src/types/render/BlockChainRenderProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"BlockChainRenderProps.d.ts","sourceRoot":"","sources":["../../../../src/types/render/BlockChainRenderProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC1E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,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.15.
|
|
4
|
+
"version": "1.15.4",
|
|
5
5
|
"description": "XYO Layer One React SDK Blockchain",
|
|
6
6
|
"homepage": "https://xylabs.com",
|
|
7
7
|
"bugs": {
|
|
@@ -44,66 +44,66 @@
|
|
|
44
44
|
"package-cycle": "echo Nothing to do"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@storybook/react-vite": "~9.1.
|
|
48
|
-
"@xylabs/assert": "~5.0.
|
|
49
|
-
"@xylabs/axios": "~5.0.
|
|
50
|
-
"@xylabs/delay": "~5.0.
|
|
51
|
-
"@xylabs/eth-address": "~5.0.
|
|
52
|
-
"@xylabs/exists": "~5.0.
|
|
53
|
-
"@xylabs/hex": "~5.0.
|
|
54
|
-
"@xylabs/promise": "~5.0.
|
|
55
|
-
"@xylabs/react-animation": "~7.1.
|
|
56
|
-
"@xylabs/react-error": "~7.1.
|
|
57
|
-
"@xylabs/react-flexbox": "~7.1.
|
|
58
|
-
"@xylabs/react-promise": "~7.1.
|
|
59
|
-
"@xylabs/react-quick-tip-button": "~7.1.
|
|
60
|
-
"@xylabs/react-shared": "~7.1.
|
|
61
|
-
"@xylabs/react-theme": "~7.1.
|
|
62
|
-
"@xylabs/typeof": "~5.0.
|
|
63
|
-
"@xyo-network/account": "~5.1.
|
|
64
|
-
"@xyo-network/archivist-memory": "~5.1.
|
|
65
|
-
"@xyo-network/archivist-model": "~5.1.
|
|
66
|
-
"@xyo-network/boundwitness-builder": "~5.1.
|
|
67
|
-
"@xyo-network/boundwitness-model": "~5.1.
|
|
68
|
-
"@xyo-network/bridge-http": "~5.1.
|
|
69
|
-
"@xyo-network/chain-analyze": "~1.15.
|
|
70
|
-
"@xyo-network/chain-protocol": "~1.15.
|
|
71
|
-
"@xyo-network/chain-services": "~1.15.
|
|
72
|
-
"@xyo-network/chain-utils": "~1.15.
|
|
73
|
-
"@xyo-network/chain-wrappers": "~1.15.
|
|
74
|
-
"@xyo-network/module-model": "~5.1.
|
|
75
|
-
"@xyo-network/payload-builder": "~5.1.
|
|
76
|
-
"@xyo-network/payload-model": "~5.1.
|
|
77
|
-
"@xyo-network/react-boundwitness-plugin": "~7.3.
|
|
78
|
-
"@xyo-network/react-chain-blockies": "~1.15.
|
|
79
|
-
"@xyo-network/react-chain-shared": "~1.15.
|
|
80
|
-
"@xyo-network/react-event": "~7.3.
|
|
81
|
-
"@xyo-network/react-payload-raw-info": "~7.3.
|
|
82
|
-
"@xyo-network/react-payload-table": "~7.3.
|
|
83
|
-
"@xyo-network/react-shared": "~7.3.
|
|
84
|
-
"@xyo-network/react-table": "~7.3.
|
|
85
|
-
"@xyo-network/xl1-protocol": "~1.12.
|
|
86
|
-
"@xyo-network/xl1-protocol-sdk": "~1.15.
|
|
47
|
+
"@storybook/react-vite": "~9.1.10",
|
|
48
|
+
"@xylabs/assert": "~5.0.12",
|
|
49
|
+
"@xylabs/axios": "~5.0.12",
|
|
50
|
+
"@xylabs/delay": "~5.0.12",
|
|
51
|
+
"@xylabs/eth-address": "~5.0.12",
|
|
52
|
+
"@xylabs/exists": "~5.0.12",
|
|
53
|
+
"@xylabs/hex": "~5.0.12",
|
|
54
|
+
"@xylabs/promise": "~5.0.12",
|
|
55
|
+
"@xylabs/react-animation": "~7.1.3",
|
|
56
|
+
"@xylabs/react-error": "~7.1.3",
|
|
57
|
+
"@xylabs/react-flexbox": "~7.1.3",
|
|
58
|
+
"@xylabs/react-promise": "~7.1.3",
|
|
59
|
+
"@xylabs/react-quick-tip-button": "~7.1.3",
|
|
60
|
+
"@xylabs/react-shared": "~7.1.3",
|
|
61
|
+
"@xylabs/react-theme": "~7.1.3",
|
|
62
|
+
"@xylabs/typeof": "~5.0.12",
|
|
63
|
+
"@xyo-network/account": "~5.1.6",
|
|
64
|
+
"@xyo-network/archivist-memory": "~5.1.6",
|
|
65
|
+
"@xyo-network/archivist-model": "~5.1.6",
|
|
66
|
+
"@xyo-network/boundwitness-builder": "~5.1.6",
|
|
67
|
+
"@xyo-network/boundwitness-model": "~5.1.6",
|
|
68
|
+
"@xyo-network/bridge-http": "~5.1.6",
|
|
69
|
+
"@xyo-network/chain-analyze": "~1.15.4",
|
|
70
|
+
"@xyo-network/chain-protocol": "~1.15.4",
|
|
71
|
+
"@xyo-network/chain-services": "~1.15.4",
|
|
72
|
+
"@xyo-network/chain-utils": "~1.15.4",
|
|
73
|
+
"@xyo-network/chain-wrappers": "~1.15.4",
|
|
74
|
+
"@xyo-network/module-model": "~5.1.6",
|
|
75
|
+
"@xyo-network/payload-builder": "~5.1.6",
|
|
76
|
+
"@xyo-network/payload-model": "~5.1.6",
|
|
77
|
+
"@xyo-network/react-boundwitness-plugin": "~7.3.6",
|
|
78
|
+
"@xyo-network/react-chain-blockies": "~1.15.4",
|
|
79
|
+
"@xyo-network/react-chain-shared": "~1.15.4",
|
|
80
|
+
"@xyo-network/react-event": "~7.3.6",
|
|
81
|
+
"@xyo-network/react-payload-raw-info": "~7.3.6",
|
|
82
|
+
"@xyo-network/react-payload-table": "~7.3.6",
|
|
83
|
+
"@xyo-network/react-shared": "~7.3.6",
|
|
84
|
+
"@xyo-network/react-table": "~7.3.6",
|
|
85
|
+
"@xyo-network/xl1-protocol": "~1.12.69",
|
|
86
|
+
"@xyo-network/xl1-protocol-sdk": "~1.15.4"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
89
|
"@emotion/react": "~11.14.0",
|
|
90
90
|
"@emotion/styled": "~11.14.1",
|
|
91
|
-
"@mui/icons-material": "~7.3.
|
|
92
|
-
"@mui/material": "~7.3.
|
|
93
|
-
"@types/react": "~19.
|
|
94
|
-
"@xylabs/creatable": "~5.0.
|
|
95
|
-
"@xylabs/hex": "~5.0.
|
|
96
|
-
"@xylabs/ts-scripts-yarn3": "~7.1.
|
|
97
|
-
"@xylabs/tsconfig": "~7.1.
|
|
98
|
-
"@xylabs/tsconfig-dom": "~7.1.
|
|
99
|
-
"@xylabs/tsconfig-react": "~7.1.
|
|
100
|
-
"@xyo-network/api-models": "~5.1.
|
|
101
|
-
"eslint": "^9.
|
|
102
|
-
"react": "~19.
|
|
103
|
-
"react-dom": "~19.
|
|
104
|
-
"react-router-dom": "^7.9.
|
|
105
|
-
"storybook": "~9.1.
|
|
106
|
-
"typescript": "~5.9.
|
|
91
|
+
"@mui/icons-material": "~7.3.4",
|
|
92
|
+
"@mui/material": "~7.3.4",
|
|
93
|
+
"@types/react": "~19.2.2",
|
|
94
|
+
"@xylabs/creatable": "~5.0.12",
|
|
95
|
+
"@xylabs/hex": "~5.0.12",
|
|
96
|
+
"@xylabs/ts-scripts-yarn3": "~7.1.8",
|
|
97
|
+
"@xylabs/tsconfig": "~7.1.8",
|
|
98
|
+
"@xylabs/tsconfig-dom": "~7.1.8",
|
|
99
|
+
"@xylabs/tsconfig-react": "~7.1.8",
|
|
100
|
+
"@xyo-network/api-models": "~5.1.6",
|
|
101
|
+
"eslint": "^9.37.0",
|
|
102
|
+
"react": "~19.2.0",
|
|
103
|
+
"react-dom": "~19.2.0",
|
|
104
|
+
"react-router-dom": "^7.9.4",
|
|
105
|
+
"storybook": "~9.1.10",
|
|
106
|
+
"typescript": "~5.9.3"
|
|
107
107
|
},
|
|
108
108
|
"peerDependencies": {
|
|
109
109
|
"@emotion/react": "~11",
|
|
@@ -11,13 +11,13 @@ import type {
|
|
|
11
11
|
import { buildBlockChainRenderComponent } from '../helpers/index.ts'
|
|
12
12
|
|
|
13
13
|
export const useDynamicBlockComponents = (BlockComponent: ComponentType<BlockComponentWithTxsProps>, params?: XyoChainIteratorParams, maxBlocks?: number) => {
|
|
14
|
-
const {
|
|
14
|
+
const { chainMap } = params ?? {}
|
|
15
15
|
const [blockChainRenderComponents, setBlockChainRenderComponents] = useState<BlockChainRenderComponent[]>([])
|
|
16
16
|
|
|
17
17
|
const { onBlock } = useChainAnalyzersContext()
|
|
18
18
|
|
|
19
19
|
const onAddBlock = async (block: HydratedBlock | undefined) => {
|
|
20
|
-
if (!block || !
|
|
20
|
+
if (!block || !chainMap) return
|
|
21
21
|
|
|
22
22
|
const blockComponentProps: BlockComponentProps = { block }
|
|
23
23
|
const newBlockComponent = await buildBlockChainRenderComponent(BlockComponent, blockComponentProps)
|
|
@@ -17,7 +17,7 @@ export const useStaticBlockComponents = (
|
|
|
17
17
|
|
|
18
18
|
const [blockComponents, blockComponentsError] = usePromise(async () => {
|
|
19
19
|
const resolvedBlockWithStorage = blocks ?? []
|
|
20
|
-
if (!params?.
|
|
20
|
+
if (!params?.chainMap) return []
|
|
21
21
|
|
|
22
22
|
return await Promise.all(resolvedBlockWithStorage?.map(async (block) => {
|
|
23
23
|
// TODO: Figure out why this onBlock is always defined (per TS), even though the context is optional?
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from '@mui/material'
|
|
4
4
|
import { toHex } from '@xylabs/hex'
|
|
5
5
|
import { FlexCol } from '@xylabs/react-flexbox'
|
|
6
|
-
import type {
|
|
6
|
+
import type { ChainId, TransactionBoundWitnessFields } from '@xyo-network/xl1-protocol'
|
|
7
7
|
import { defaultTransactionFees } from '@xyo-network/xl1-protocol'
|
|
8
8
|
import React from 'react'
|
|
9
9
|
|
|
@@ -18,7 +18,7 @@ export const ChainTransactionBuilder: React.FC<ChainTransactionBuilder> = ({ onS
|
|
|
18
18
|
|
|
19
19
|
// TODO - more field level validation
|
|
20
20
|
const chainTx: TransactionBoundWitnessFields = {
|
|
21
|
-
chain: formData.get('chain') as
|
|
21
|
+
chain: formData.get('chain') as ChainId,
|
|
22
22
|
nbf: Number.parseInt(formData.get('nbf') as string),
|
|
23
23
|
exp: Number.parseInt(formData.get('exp') as string),
|
|
24
24
|
fees: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ContextExState } from '@xylabs/react-shared'
|
|
2
2
|
import type { ArchivistInstance } from '@xyo-network/archivist-model'
|
|
3
|
-
import type {
|
|
3
|
+
import type { ChainBlockNumberIteratorService, ChainId } from '@xyo-network/xl1-protocol'
|
|
4
4
|
|
|
5
5
|
export type ChainInfoState = ContextExState<{
|
|
6
6
|
chainArchivist?: ArchivistInstance
|
|
7
|
-
chainId?:
|
|
7
|
+
chainId?: ChainId
|
|
8
8
|
chainIterator?: ChainBlockNumberIteratorService
|
|
9
9
|
}>
|
|
@@ -35,7 +35,7 @@ export class ChainIteratorStore {
|
|
|
35
35
|
instance._chainIterator = chainIterator
|
|
36
36
|
|
|
37
37
|
const head = await chainIterator.head()
|
|
38
|
-
const hydratedHead = await hydrateBlock(params.
|
|
38
|
+
const hydratedHead = await hydrateBlock({ chainMap: params.chainMap }, await PayloadBuilder.hash(head))
|
|
39
39
|
|
|
40
40
|
// set the initial values
|
|
41
41
|
instance._values = {
|
|
@@ -45,7 +45,7 @@ export class ChainIteratorStore {
|
|
|
45
45
|
|
|
46
46
|
// set the internal listeners
|
|
47
47
|
const headUpdatedListener = async ({ blocks }: HeadEventArgs) => {
|
|
48
|
-
const hydratedBlock = await hydrateBlock(params.
|
|
48
|
+
const hydratedBlock = await hydrateBlock({ chainMap: params.chainMap }, await PayloadBuilder.hash(blocks?.[0]))
|
|
49
49
|
instance._values = {
|
|
50
50
|
chainIterator,
|
|
51
51
|
head: hydratedBlock,
|
|
@@ -26,11 +26,11 @@ export const resolveDefinedHead = async (head: Hash, chainArchivist: ReadArchivi
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export const useChainIteratorParams = ({
|
|
29
|
-
|
|
29
|
+
chainMap, chainId, head, name,
|
|
30
30
|
}: BlockChainIterator) => {
|
|
31
31
|
return usePromise(async () => {
|
|
32
|
-
if (isDefined(
|
|
33
|
-
const
|
|
32
|
+
if (isDefined(chainMap) && isDefined(chainId) && isHash(head)) {
|
|
33
|
+
const result = await chainMap.get(head)
|
|
34
34
|
const foundResult = assertEx(result, () => `Head not found: ${head}`)
|
|
35
35
|
const resolvedHead = assertEx(
|
|
36
36
|
isBlockBoundWitness(foundResult) ? foundResult : undefined,
|
|
@@ -39,8 +39,8 @@ export const useChainIteratorParams = ({
|
|
|
39
39
|
const config = getDefaultConfig()
|
|
40
40
|
config.chain.id = chainId
|
|
41
41
|
return {
|
|
42
|
-
|
|
42
|
+
chainMap, chainId, config, head: resolvedHead, name,
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
}, [
|
|
45
|
+
}, [chainMap, chainId, head])
|
|
46
46
|
}
|
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import { assertEx } from '@xylabs/assert'
|
|
2
2
|
import { usePromise } from '@xylabs/react-promise'
|
|
3
|
-
import type { ReadArchivist } from '@xyo-network/archivist-model'
|
|
4
3
|
import type { XyoChainIteratorParams } from '@xyo-network/chain-services'
|
|
5
4
|
import { ChainBlockNumberIterationService } from '@xyo-network/chain-services'
|
|
6
5
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
6
|
+
import type { Payload, WithStorageMeta } from '@xyo-network/payload-model'
|
|
7
7
|
import type { BlockBoundWitness, HydratedBlock } from '@xyo-network/xl1-protocol'
|
|
8
8
|
import { isBlockBoundWitness } from '@xyo-network/xl1-protocol'
|
|
9
|
+
import type { PayloadMapRead } from '@xyo-network/xl1-protocol-sdk'
|
|
9
10
|
import { hydrateBlock } from '@xyo-network/xl1-protocol-sdk'
|
|
10
11
|
|
|
11
|
-
const getHydratedBlock = async (
|
|
12
|
+
const getHydratedBlock = async (chainMap: PayloadMapRead<WithStorageMeta<Payload>>, head: BlockBoundWitness) => {
|
|
12
13
|
const headHash = await PayloadBuilder.hash(head)
|
|
13
|
-
return await hydrateBlock(
|
|
14
|
+
return await hydrateBlock({ chainMap }, headHash)
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
const iterateChain = async (chainIteratorParams?: XyoChainIteratorParams, maxDepth?: number) => {
|
|
17
|
-
const {
|
|
18
|
+
const { chainMap, head } = chainIteratorParams ?? {} as XyoChainIteratorParams
|
|
18
19
|
const headPayload = assertEx(isBlockBoundWitness(head) ? head : null, () => 'Head is not a Block Bound Witness')
|
|
19
20
|
// confirm the head is a block
|
|
20
21
|
const headBlockBoundWitness = assertEx(isBlockBoundWitness(headPayload) ? headPayload : null, () => 'Invalid head block')
|
|
21
22
|
// create the chain iterator
|
|
22
|
-
const chainIterator = await ChainBlockNumberIterationService.create({ head: headBlockBoundWitness,
|
|
23
|
+
const chainIterator = await ChainBlockNumberIterationService.create({ head: headBlockBoundWitness, chainMap })
|
|
23
24
|
|
|
24
25
|
// get head of the chain
|
|
25
26
|
const chainHead = await chainIterator.head()
|
|
26
|
-
let block = await getHydratedBlock(
|
|
27
|
+
let block = await getHydratedBlock(chainMap, chainHead)
|
|
27
28
|
|
|
28
29
|
// create the blocks array
|
|
29
30
|
const blocks: HydratedBlock[] = [block]
|
|
@@ -35,7 +36,7 @@ const iterateChain = async (chainIteratorParams?: XyoChainIteratorParams, maxDep
|
|
|
35
36
|
// get the next block
|
|
36
37
|
const [, next] = await chainIterator.previous(block[0].block, 2)
|
|
37
38
|
|
|
38
|
-
const nextHydratedBlock = await getHydratedBlock(
|
|
39
|
+
const nextHydratedBlock = await getHydratedBlock(chainMap, next)
|
|
39
40
|
// push the next block
|
|
40
41
|
blocks.push(nextHydratedBlock)
|
|
41
42
|
// set the next block as the current block
|
|
@@ -4,8 +4,10 @@ import { usePromise } from '@xylabs/react-promise'
|
|
|
4
4
|
import { isDefined } from '@xylabs/typeof'
|
|
5
5
|
import { ChainBlockNumberIterationService } from '@xyo-network/chain-services'
|
|
6
6
|
import { findFirstMatching } from '@xyo-network/chain-utils'
|
|
7
|
+
import type { Payload, WithStorageMeta } from '@xyo-network/payload-model'
|
|
7
8
|
import type { BlockBoundWitness } from '@xyo-network/xl1-protocol'
|
|
8
9
|
import { isBlockBoundWitness } from '@xyo-network/xl1-protocol'
|
|
10
|
+
import { readPayloadMapFromStore } from '@xyo-network/xl1-protocol-sdk'
|
|
9
11
|
import React from 'react'
|
|
10
12
|
|
|
11
13
|
import { ChainInfoProvider } from '../context/index.ts'
|
|
@@ -34,7 +36,8 @@ export const ChainInfoContextDecorator: Decorator = (Story, context) => {
|
|
|
34
36
|
const head: BlockBoundWitness = assertEx(isBlockBoundWitness(firstMatch)
|
|
35
37
|
? firstMatch
|
|
36
38
|
: undefined, () => `Expected a block bound witness: ${JSON.stringify(firstMatch)}`)
|
|
37
|
-
|
|
39
|
+
const chainMap = readPayloadMapFromStore<WithStorageMeta<Payload>>(chainArchivist)
|
|
40
|
+
return await ChainBlockNumberIterationService.create({ chainMap, head })
|
|
38
41
|
}
|
|
39
42
|
}, [chainArchivist, chainId])
|
|
40
43
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { CreatableName } from '@xylabs/creatable'
|
|
2
2
|
import type { Hash } from '@xylabs/hex'
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
3
|
+
import type { Payload, WithStorageMeta } from '@xyo-network/payload-model'
|
|
4
|
+
import type { ChainId } from '@xyo-network/xl1-protocol'
|
|
5
|
+
import type { PayloadMapRead } from '@xyo-network/xl1-protocol-sdk'
|
|
5
6
|
|
|
6
7
|
/** Props that control the rendering (not blockchain specific) */
|
|
7
8
|
export interface RenderProps {
|
|
@@ -11,8 +12,8 @@ export interface RenderProps {
|
|
|
11
12
|
|
|
12
13
|
/** Fields needed to talk to a block chain iterator */
|
|
13
14
|
export interface BlockChainIterator {
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
chainId?: ChainId
|
|
16
|
+
chainMap?: PayloadMapRead<WithStorageMeta<Payload>>
|
|
16
17
|
head?: Hash
|
|
17
18
|
name: CreatableName
|
|
18
19
|
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const DynamicBlockchainRenderFlexbox: {
|
|
2
|
-
Base: import("react").FC<import("../../../../../types/index.ts").BlockChainRenderFlexboxProps>;
|
|
3
|
-
WithAnalysis: import("react").FC<import("../../../../../types/index.ts").BlockChainRenderFlexboxProps>;
|
|
4
|
-
WithRemote: import("react").FC<import("../../../../../types/index.ts").RemoteBlockChainRenderFlexboxProps>;
|
|
5
|
-
};
|
|
6
|
-
//# sourceMappingURL=Flexbox.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Flexbox.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/chain/render/dynamic/flexbox/Flexbox.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,8BAA8B;;;;CAE1C,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
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("../../../../../types/index.ts").BlockChainRenderFlexboxProps>;
|
|
5
|
-
declare const WithLocalArchivist: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react-vite").ReactRenderer, import("../../../../../types/index.ts").BlockChainRenderFlexboxProps>;
|
|
6
|
-
declare const WithLocalArchivistPollMaxBlocks: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react-vite").ReactRenderer, import("../../../../../types/index.ts").BlockChainRenderFlexboxProps>;
|
|
7
|
-
export { Default, WithLocalArchivist, WithLocalArchivistPollMaxBlocks, };
|
|
8
|
-
//# sourceMappingURL=Flexbox.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Flexbox.stories.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/chain/render/dynamic/flexbox/Flexbox.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,uBAAuB,CAAA;wBAcrD,IAAI;AAHT,wBAGS;AAMT,QAAA,MAAM,OAAO,wKAAoB,CAAA;AAGjC,QAAA,MAAM,kBAAkB,wKAAoB,CAAA;AAI5C,QAAA,MAAM,+BAA+B,wKAAoB,CAAA;AAIzD,OAAO,EACL,OAAO,EAAE,kBAAkB,EAAE,+BAA+B,GAC7D,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
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("../../../../../types/index.ts").RemoteBlockChainRenderFlexboxProps>;
|
|
5
|
-
declare const WithLocalBridgedArchivist: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react-vite").ReactRenderer, import("../../../../../types/index.ts").RemoteBlockChainRenderFlexboxProps>;
|
|
6
|
-
declare const WithBetaBridgedArchivist: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react-vite").ReactRenderer, import("../../../../../types/index.ts").RemoteBlockChainRenderFlexboxProps>;
|
|
7
|
-
export { Default, WithBetaBridgedArchivist, WithLocalBridgedArchivist, };
|
|
8
|
-
//# sourceMappingURL=Remote.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Remote.stories.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/chain/render/dynamic/flexbox/Remote.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,uBAAuB,CAAA;wBAuBrD,IAAI;AAHT,wBAGS;AAMT,QAAA,MAAM,OAAO,8KAAoB,CAAA;AAGjC,QAAA,MAAM,yBAAyB,8KAAoB,CAAA;AAOnD,QAAA,MAAM,wBAAwB,8KAAoB,CAAA;AAOlD,OAAO,EACL,OAAO,EAAE,wBAAwB,EAAE,yBAAyB,GAC7D,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/chain/render/dynamic/flexbox/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Base.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/chain/render/dynamic/flexbox/variants/Base.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAA;AAMpF,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,4BAA4B,CAgBlE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WithAnalysis.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/chain/render/dynamic/flexbox/variants/WithAnalysis.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAkB,MAAM,OAAO,CAAA;AAItC,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAA;AAGpF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,4BAA4B,CAgB/D,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WithRemote.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/chain/render/dynamic/flexbox/variants/WithRemote.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,kCAAkC,CAAA;AAI1F,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,kCAAkC,CAWnE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/chain/render/dynamic/flexbox/variants/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/chain/render/dynamic/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,sCAAsC,CAAA;AACpD,cAAc,qCAAqC,CAAA"}
|
package/dist/browser/components/chain/render/dynamic/hooks/useDynamicBlockRenderComponents.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ComponentType } from 'react';
|
|
2
|
-
import type { BlockChainRenderProps, BlockComponentWithTxsProps } from '../../../../../types/index.ts';
|
|
3
|
-
export declare const useDynamicBlockRenderComponents: (BlockComponent: ComponentType<BlockComponentWithTxsProps>, blockChainRenderProps?: BlockChainRenderProps) => {
|
|
4
|
-
errors: (Error | undefined)[];
|
|
5
|
-
blockChainRenderComponents: import("../../../../../types/BlockComponents.ts").BlockChainRenderComponent[];
|
|
6
|
-
blocksWhilePaused: import("@xyo-network/xl1-protocol").HydratedBlock[];
|
|
7
|
-
updatePollingState: ((newState: import("../../../../../context/index.ts").PollingState) => void) | undefined;
|
|
8
|
-
pollingState: import("../../../../../context/index.ts").PollingState | undefined;
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=useDynamicBlockRenderComponents.d.ts.map
|
package/dist/browser/components/chain/render/dynamic/hooks/useDynamicBlockRenderComponents.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDynamicBlockRenderComponents.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/chain/render/dynamic/hooks/useDynamicBlockRenderComponents.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAK1C,OAAO,KAAK,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAA;AAKtG,eAAO,MAAM,+BAA+B,GAC1C,gBAAgB,aAAa,CAAC,0BAA0B,CAAC,EACzD,wBAAwB,qBAAqB;;;;;;CAuB9C,CAAA"}
|
package/dist/browser/components/chain/render/dynamic/hooks/useRemoteBlockChainRenderProps.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { ModuleIdentifier } from '@xyo-network/module-model';
|
|
2
|
-
import type { BlockChainRenderBaseProps, BlockChainRenderProps } from '../../../../../types/index.ts';
|
|
3
|
-
/** take blockChainRenderProps and remote archivist props and return with resolved chainArchivist */
|
|
4
|
-
export declare const useRemoteBlockChainRenderProps: (chainArchivistModuleId?: ModuleIdentifier, url?: string, blockChainRenderPropsArg?: BlockChainRenderProps) => BlockChainRenderBaseProps;
|
|
5
|
-
//# sourceMappingURL=useRemoteBlockChainRenderProps.d.ts.map
|
package/dist/browser/components/chain/render/dynamic/hooks/useRemoteBlockChainRenderProps.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useRemoteBlockChainRenderProps.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/chain/render/dynamic/hooks/useRemoteBlockChainRenderProps.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAIjE,OAAO,KAAK,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAErG,oGAAoG;AACpG,eAAO,MAAM,8BAA8B,GACzC,yBAAyB,gBAAgB,EACzC,MAAM,MAAM,EACZ,2BAA2B,qBAAqB,KAC/C,yBAiBF,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/chain/render/dynamic/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { XyoChainIteratorParams } from '@xyo-network/chain-services';
|
|
2
|
-
import type { ChainIteratorStoreValues } from './ChainIteratorStore.ts';
|
|
3
|
-
export declare const useChainIteratorStore: (chainIteratorParams?: XyoChainIteratorParams) => Partial<ChainIteratorStoreValues>;
|
|
4
|
-
//# sourceMappingURL=useChainIteratorStore.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useChainIteratorStore.d.ts","sourceRoot":"","sources":["../../../../src/hooks/chain-iterator/useChainIteratorStore.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAMzE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAA;AAOvE,eAAO,MAAM,qBAAqB,GAAI,sBAAsB,sBAAsB,sCAmDjF,CAAA"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryFn } from '@storybook/react-vite'
|
|
2
|
-
import type { CreatableName } from '@xylabs/creatable'
|
|
3
|
-
import React from 'react'
|
|
4
|
-
|
|
5
|
-
import { ChainArchivistDelayedInsertDecorator } from '../../../../../stories/index.ts'
|
|
6
|
-
import { DynamicBlockchainRenderFlexbox } from './Flexbox.tsx'
|
|
7
|
-
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
9
|
-
// @ts-expect-error
|
|
10
|
-
globalThis.rollbar = undefined
|
|
11
|
-
|
|
12
|
-
export default {
|
|
13
|
-
title: 'Blockchain/Dynamic/Flexbox/Local/WithAnalysis',
|
|
14
|
-
component: DynamicBlockchainRenderFlexbox.WithAnalysis,
|
|
15
|
-
} as Meta
|
|
16
|
-
|
|
17
|
-
const Template: StoryFn<typeof DynamicBlockchainRenderFlexbox.WithAnalysis> = (args) => {
|
|
18
|
-
return <DynamicBlockchainRenderFlexbox.WithAnalysis {...args} />
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const Default = Template.bind({})
|
|
22
|
-
Default.args = {}
|
|
23
|
-
|
|
24
|
-
const WithLocalArchivist = Template.bind({})
|
|
25
|
-
WithLocalArchivist.args = {}
|
|
26
|
-
WithLocalArchivist.decorators = [ChainArchivistDelayedInsertDecorator]
|
|
27
|
-
|
|
28
|
-
const WithLocalArchivistPollMaxBlocks = Template.bind({})
|
|
29
|
-
WithLocalArchivistPollMaxBlocks.args = { blockChainRenderProps: { maxBlocks: 4, name: 'unknown' as CreatableName } }
|
|
30
|
-
WithLocalArchivistPollMaxBlocks.decorators = [ChainArchivistDelayedInsertDecorator]
|
|
31
|
-
|
|
32
|
-
export {
|
|
33
|
-
Default, WithLocalArchivist, WithLocalArchivistPollMaxBlocks,
|
|
34
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryFn } from '@storybook/react-vite'
|
|
2
|
-
import type { CreatableName } from '@xylabs/creatable'
|
|
3
|
-
import React from 'react'
|
|
4
|
-
|
|
5
|
-
import { getChainId } from '../../../../../lib/index.ts'
|
|
6
|
-
import type { BlockChainRenderProps } from '../../../../../types/index.ts'
|
|
7
|
-
import { DynamicBlockchainRenderFlexbox } from './Flexbox.tsx'
|
|
8
|
-
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
10
|
-
// @ts-expect-error
|
|
11
|
-
globalThis.rollbar = undefined
|
|
12
|
-
|
|
13
|
-
const chainId = await getChainId()
|
|
14
|
-
|
|
15
|
-
const blockChainRenderProps: BlockChainRenderProps = {
|
|
16
|
-
name: 'unknown' as CreatableName,
|
|
17
|
-
chainId,
|
|
18
|
-
maxBlocks: 100,
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export default {
|
|
22
|
-
title: 'Blockchain/Dynamic/Flexbox/Remote/WithRemote',
|
|
23
|
-
component: DynamicBlockchainRenderFlexbox.WithRemote,
|
|
24
|
-
} as Meta
|
|
25
|
-
|
|
26
|
-
const Template: StoryFn<typeof DynamicBlockchainRenderFlexbox.WithRemote> = (args) => {
|
|
27
|
-
return <DynamicBlockchainRenderFlexbox.WithRemote {...args} />
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const Default = Template.bind({})
|
|
31
|
-
Default.args = {}
|
|
32
|
-
|
|
33
|
-
const WithLocalBridgedArchivist = Template.bind({})
|
|
34
|
-
WithLocalBridgedArchivist.args = {
|
|
35
|
-
url: 'http://localhost:8080',
|
|
36
|
-
chainArchivistModuleId: 'XYOChain:Chain:Finalized',
|
|
37
|
-
blockChainRenderProps,
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const WithBetaBridgedArchivist = Template.bind({})
|
|
41
|
-
WithBetaBridgedArchivist.args = {
|
|
42
|
-
url: 'https://beta.api.chain.xyo.network/',
|
|
43
|
-
chainArchivistModuleId: 'XYOChain:Chain:Finalized',
|
|
44
|
-
blockChainRenderProps,
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export {
|
|
48
|
-
Default, WithBetaBridgedArchivist, WithLocalBridgedArchivist,
|
|
49
|
-
}
|