@xyo-network/react-chain-blockchain 1.0.11 → 1.0.13
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/index.mjs +26 -11
- package/dist/browser/index.mjs.map +1 -1
- package/dist/types/components/block/helpers/tsxFromBlock.d.ts +1 -1
- package/dist/types/components/block/hooks/useTxsFromBlock.d.ts +1 -1
- package/dist/types/components/block/table/row/TableRow.d.ts +2 -1
- package/dist/types/components/block/table/row/TableRow.d.ts.map +1 -1
- package/dist/types/components/transactions/submit/Builder.d.ts.map +1 -1
- package/dist/types/components/transactions/submit/SubmitChain.d.ts.map +1 -1
- package/package.json +26 -25
- package/src/components/block/BlockHeadingFlexbox.stories.tsx +1 -2
- package/src/components/block/table/row/TableRow.stories.tsx +1 -2
- package/src/components/block/table/row/TableRow.tsx +4 -3
- package/src/components/transactions/submit/Builder.tsx +8 -2
- package/src/components/transactions/submit/SubmitChain.tsx +2 -2
- package/src/stories/ChainArchivistDecorator.tsx +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { HydratedBlock } from '@xyo-network/chain-model';
|
|
2
2
|
export declare const txsFromBlock: (block: HydratedBlock) => Promise<[import("@xylabs/object").DeepRestrictToStringKeys<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
|
|
3
3
|
schema: string;
|
|
4
|
-
}> & Partial<import("@xyo-network/payload-model").PayloadMetaFields> & import("@xyo-network/payload-model").StorageMeta & import("@xylabs/object").DeepRestrictToStringKeys<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("@xyo-network/boundwitness-model").BoundWitnessFields & {
|
|
4
|
+
}> & Partial<import("@xyo-network/payload-model").PayloadMetaFields> & import("@xyo-network/chain-model").ElevatedFields & import("@xyo-network/chain-model").FromFields & import("@xyo-network/payload-model").StorageMeta & import("@xylabs/object").DeepRestrictToStringKeys<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("@xyo-network/boundwitness-model").BoundWitnessFields & {
|
|
5
5
|
schema: "network.xyo.boundwitness";
|
|
6
6
|
}> & import("@xyo-network/boundwitness-model").BoundWitnessMeta & {
|
|
7
7
|
$signatures: import("@xylabs/hex").Hex[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { HydratedBlock } from '@xyo-network/chain-model';
|
|
2
2
|
export declare const useTxsFromBlock: (block?: HydratedBlock) => [[import("@xylabs/object").DeepRestrictToStringKeys<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
|
|
3
3
|
schema: string;
|
|
4
|
-
}> & Partial<import("@xyo-network/payload-model").PayloadMetaFields> & import("@xyo-network/payload-model").StorageMeta & import("@xylabs/object").DeepRestrictToStringKeys<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("@xyo-network/boundwitness-model").BoundWitnessFields & {
|
|
4
|
+
}> & Partial<import("@xyo-network/payload-model").PayloadMetaFields> & import("@xyo-network/chain-model").ElevatedFields & import("@xyo-network/chain-model").FromFields & import("@xyo-network/payload-model").StorageMeta & import("@xylabs/object").DeepRestrictToStringKeys<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("@xyo-network/boundwitness-model").BoundWitnessFields & {
|
|
5
5
|
schema: "network.xyo.boundwitness";
|
|
6
6
|
}> & import("@xyo-network/boundwitness-model").BoundWitnessMeta & {
|
|
7
7
|
$signatures: import("@xylabs/hex").Hex[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { TableRowProps } from '@mui/material';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import type { BlockComponentProps } from '../../../../types/index.ts';
|
|
3
|
-
export interface BlockChainTableRowProps extends BlockComponentProps {
|
|
4
|
+
export interface BlockChainTableRowProps extends BlockComponentProps, TableRowProps {
|
|
4
5
|
linked?: boolean;
|
|
5
6
|
}
|
|
6
7
|
export declare const BlockChainTableRow: React.FC<BlockChainTableRowProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableRow.d.ts","sourceRoot":"","sources":["../../../../../../src/components/block/table/row/TableRow.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TableRow.d.ts","sourceRoot":"","sources":["../../../../../../src/components/block/table/row/TableRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAElD,OAAO,KAAkB,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAOrE,MAAM,WAAW,uBAAwB,SAAQ,mBAAmB,EAAE,aAAa;IACjF,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAgBhE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Builder.d.ts","sourceRoot":"","sources":["../../../../../src/components/transactions/submit/Builder.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"Builder.d.ts","sourceRoot":"","sources":["../../../../../src/components/transactions/submit/Builder.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAA;AAE7E,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,6BAA6B,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACvE;AAED,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA0CrE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubmitChain.d.ts","sourceRoot":"","sources":["../../../../../src/components/transactions/submit/SubmitChain.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAmB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"SubmitChain.d.ts","sourceRoot":"","sources":["../../../../../src/components/transactions/submit/SubmitChain.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAQvC,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EA8D1C,CAAA"}
|
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.0.
|
|
4
|
+
"version": "1.0.13",
|
|
5
5
|
"description": "XYO Layer One React SDK Blockchain",
|
|
6
6
|
"homepage": "https://xylabs.com",
|
|
7
7
|
"bugs": {
|
|
@@ -46,20 +46,21 @@
|
|
|
46
46
|
"@xylabs/react-identicon": "^6.0.9",
|
|
47
47
|
"@xylabs/react-promise": "^6.0.9",
|
|
48
48
|
"@xylabs/react-quick-tip-button": "^6.0.9",
|
|
49
|
-
"@xyo-network/account": "^3.10.
|
|
50
|
-
"@xyo-network/api-models": "^3.10.
|
|
51
|
-
"@xyo-network/archivist-model": "^3.10.
|
|
52
|
-
"@xyo-network/boundwitness-builder": "^3.10.
|
|
53
|
-
"@xyo-network/
|
|
54
|
-
"@xyo-network/
|
|
55
|
-
"@xyo-network/chain-
|
|
56
|
-
"@xyo-network/chain-
|
|
57
|
-
"@xyo-network/chain-
|
|
58
|
-
"@xyo-network/
|
|
59
|
-
"@xyo-network/
|
|
60
|
-
"@xyo-network/payload-
|
|
61
|
-
"@xyo-network/
|
|
62
|
-
"@xyo-network/react-chain-
|
|
49
|
+
"@xyo-network/account": "^3.10.5",
|
|
50
|
+
"@xyo-network/api-models": "^3.10.5",
|
|
51
|
+
"@xyo-network/archivist-model": "^3.10.5",
|
|
52
|
+
"@xyo-network/boundwitness-builder": "^3.10.5",
|
|
53
|
+
"@xyo-network/boundwitness-model": "^3.10.5",
|
|
54
|
+
"@xyo-network/bridge-http": "^3.10.5",
|
|
55
|
+
"@xyo-network/chain-ethereum": "^1.0.13",
|
|
56
|
+
"@xyo-network/chain-model": "^1.0.13",
|
|
57
|
+
"@xyo-network/chain-protocol": "^1.0.13",
|
|
58
|
+
"@xyo-network/chain-services": "^1.0.13",
|
|
59
|
+
"@xyo-network/module-model": "^3.10.5",
|
|
60
|
+
"@xyo-network/payload-builder": "^3.10.5",
|
|
61
|
+
"@xyo-network/payload-model": "^3.10.5",
|
|
62
|
+
"@xyo-network/react-chain-blockies": "^1.0.13",
|
|
63
|
+
"@xyo-network/react-chain-boundwitness": "^1.0.13",
|
|
63
64
|
"@xyo-network/react-event": "^5.0.7",
|
|
64
65
|
"@xyo-network/react-payload-raw-info": "^5.0.7",
|
|
65
66
|
"@xyo-network/react-payload-table": "^5.0.7",
|
|
@@ -69,22 +70,22 @@
|
|
|
69
70
|
"devDependencies": {
|
|
70
71
|
"@emotion/react": "^11.14.0",
|
|
71
72
|
"@emotion/styled": "^11.14.0",
|
|
72
|
-
"@mui/icons-material": "^6.4.
|
|
73
|
-
"@mui/material": "^6.4.
|
|
74
|
-
"@mui/styles": "^6.4.
|
|
75
|
-
"@storybook/react": "^8.6.
|
|
73
|
+
"@mui/icons-material": "^6.4.9",
|
|
74
|
+
"@mui/material": "^6.4.9",
|
|
75
|
+
"@mui/styles": "^6.4.9",
|
|
76
|
+
"@storybook/react": "^8.6.10",
|
|
76
77
|
"@types/react": "^19.0.12",
|
|
77
78
|
"@xylabs/delay": "^4.7.11",
|
|
78
79
|
"@xylabs/hex": "^4.7.11",
|
|
79
|
-
"@xylabs/ts-scripts-yarn3": "^6.1.
|
|
80
|
-
"@xylabs/tsconfig-react": "^6.1.
|
|
81
|
-
"@xyo-network/archivist-memory": "^3.10.
|
|
82
|
-
"@xyo-network/chain-utils": "^1.0.
|
|
83
|
-
"eslint": "^9.
|
|
80
|
+
"@xylabs/ts-scripts-yarn3": "^6.1.11",
|
|
81
|
+
"@xylabs/tsconfig-react": "^6.1.11",
|
|
82
|
+
"@xyo-network/archivist-memory": "^3.10.5",
|
|
83
|
+
"@xyo-network/chain-utils": "^1.0.13",
|
|
84
|
+
"eslint": "^9.23.0",
|
|
84
85
|
"react": "^19.0.0",
|
|
85
86
|
"react-dom": "^19.0.0",
|
|
86
87
|
"react-router-dom": "^7.4.0",
|
|
87
|
-
"storybook": "^8.6.
|
|
88
|
+
"storybook": "^8.6.10",
|
|
88
89
|
"typescript": "^5.8.2"
|
|
89
90
|
},
|
|
90
91
|
"peerDependencies": {
|
|
@@ -2,7 +2,6 @@ import {
|
|
|
2
2
|
Alert, AlertTitle, List, ListItem, Stack,
|
|
3
3
|
} from '@mui/material'
|
|
4
4
|
import type { Meta, StoryFn } from '@storybook/react'
|
|
5
|
-
import type { BlockBoundWitness } from '@xyo-network/chain-model'
|
|
6
5
|
import React, { useState } from 'react'
|
|
7
6
|
|
|
8
7
|
import { buildRandomBlockChainBlocksOnly } from '../../stories/index.ts'
|
|
@@ -15,7 +14,7 @@ export default {
|
|
|
15
14
|
component: BlockHeadingFlexbox,
|
|
16
15
|
} as Meta
|
|
17
16
|
|
|
18
|
-
const blocks = await buildRandomBlockChainBlocksOnly()
|
|
17
|
+
const blocks = await buildRandomBlockChainBlocksOnly()
|
|
19
18
|
|
|
20
19
|
const Template: StoryFn<typeof BlockHeadingFlexbox> = args => <BlockHeadingFlexbox {...args} />
|
|
21
20
|
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { Table, TableBody } from '@mui/material'
|
|
2
2
|
import type { Meta, StoryFn } from '@storybook/react'
|
|
3
|
-
import type { BlockBoundWitness } from '@xyo-network/chain-model'
|
|
4
3
|
import React from 'react'
|
|
5
4
|
|
|
6
5
|
import { buildRandomBlockChainBlocksOnly } from '../../../../stories/index.ts'
|
|
7
6
|
import { BlockChainTableRow } from './TableRow.tsx'
|
|
8
7
|
|
|
9
|
-
const [block] = await buildRandomBlockChainBlocksOnly(1)
|
|
8
|
+
const [block] = await buildRandomBlockChainBlocksOnly(1)
|
|
10
9
|
|
|
11
10
|
export default {
|
|
12
11
|
title: 'Block/TableRow',
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TableRowProps } from '@mui/material'
|
|
1
2
|
import { TableRow } from '@mui/material'
|
|
2
3
|
import React, { useMemo } from 'react'
|
|
3
4
|
|
|
@@ -8,18 +9,18 @@ import {
|
|
|
8
9
|
BlockVerificationTableCell,
|
|
9
10
|
} from '../cell/index.ts'
|
|
10
11
|
|
|
11
|
-
export interface BlockChainTableRowProps extends BlockComponentProps {
|
|
12
|
+
export interface BlockChainTableRowProps extends BlockComponentProps, TableRowProps {
|
|
12
13
|
linked?: boolean
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
export const BlockChainTableRow: React.FC<BlockChainTableRowProps> = ({
|
|
16
17
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
17
|
-
block, defaultExpanded, linked, ...props
|
|
18
|
+
block, defaultExpanded, linked, sx, ...props
|
|
18
19
|
}) => {
|
|
19
20
|
const linkedTableCellProps = useMemo(() => ({ block, linked }), [block, linked])
|
|
20
21
|
const defaultTableCellProps = useMemo(() => ({ block }), [block])
|
|
21
22
|
return (
|
|
22
|
-
<TableRow {...props}>
|
|
23
|
+
<TableRow sx={{ overflowY: 'scroll', ...sx }} {...props}>
|
|
23
24
|
<BlockHashTableCell {...defaultTableCellProps} />
|
|
24
25
|
<BlockNumberTableCell {...linkedTableCellProps} />
|
|
25
26
|
<BlockTransactionCountTableCell {...linkedTableCellProps} />
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Button, FormControl, TextField,
|
|
3
3
|
} from '@mui/material'
|
|
4
|
-
import type
|
|
4
|
+
import { type Address, toHex } from '@xylabs/hex'
|
|
5
5
|
import { FlexCol } from '@xylabs/react-flexbox'
|
|
6
6
|
import type { TransactionBoundWitnessFields } from '@xyo-network/chain-model'
|
|
7
|
+
import { defaultFees } from '@xyo-network/chain-protocol'
|
|
7
8
|
import React from 'react'
|
|
8
9
|
|
|
9
10
|
export interface ChainTransactionBuilder {
|
|
@@ -18,9 +19,14 @@ export const ChainTransactionBuilder: React.FC<ChainTransactionBuilder> = ({ onS
|
|
|
18
19
|
// TODO - more field level validation
|
|
19
20
|
const chainTx: TransactionBoundWitnessFields = {
|
|
20
21
|
chain: formData.get('chain') as Address,
|
|
21
|
-
gas: formData.get('gas') as Hex,
|
|
22
22
|
nbf: Number.parseInt(formData.get('nbf') as string),
|
|
23
23
|
exp: Number.parseInt(formData.get('exp') as string),
|
|
24
|
+
fees: {
|
|
25
|
+
gasLimit: toHex(defaultFees.gasLimit),
|
|
26
|
+
gasPrice: toHex(defaultFees.gasPrice),
|
|
27
|
+
base: toHex(defaultFees.base),
|
|
28
|
+
priority: toHex(defaultFees.priority),
|
|
29
|
+
},
|
|
24
30
|
nonce: [],
|
|
25
31
|
}
|
|
26
32
|
|
|
@@ -19,9 +19,10 @@ import { ChainTransactionBuilder } from './Builder.tsx'
|
|
|
19
19
|
import { ChainTransactionNetwork } from './Network.tsx'
|
|
20
20
|
|
|
21
21
|
const BETA_PENDING_TRANSACTIONS_ARCHIVIST = 'https://beta.api.chain.xyo.network/8050fee682a2762f504d5449d8269a6f17f0b693'
|
|
22
|
+
const defaultNetwork = new URL(BETA_PENDING_TRANSACTIONS_ARCHIVIST)
|
|
22
23
|
|
|
23
24
|
export const SubmitChainTransaction: React.FC = () => {
|
|
24
|
-
const [network, setNetwork] = useState<URL>(
|
|
25
|
+
const [network, setNetwork] = useState<URL>(defaultNetwork)
|
|
25
26
|
const [result, setResult] = useState<ModuleQueryResult>()
|
|
26
27
|
const [error, setError] = useState<Error>()
|
|
27
28
|
|
|
@@ -31,7 +32,6 @@ export const SubmitChainTransaction: React.FC = () => {
|
|
|
31
32
|
const [transactionBoundWitness] = await buildTransaction(
|
|
32
33
|
chainTx.chain,
|
|
33
34
|
[],
|
|
34
|
-
BigInt(`0x${chainTx.gas}`),
|
|
35
35
|
randomAccount,
|
|
36
36
|
chainTx.nbf,
|
|
37
37
|
chainTx.exp,
|
|
@@ -40,5 +40,5 @@ export const ChainArchivistDecorator: Decorator = (Story, context) => {
|
|
|
40
40
|
},
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
return blockChainRenderProps?.chainArchivist ? <Story {...props} /> :
|
|
43
|
+
return blockChainRenderProps?.chainArchivist ? <Story {...props} /> : <CircularProgress />
|
|
44
44
|
}
|