@xyo-network/react-chain-blockchain 1.17.0 → 1.17.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/chain/index.d.ts +0 -1
- package/dist/browser/components/chain/index.d.ts.map +1 -1
- package/dist/browser/hooks/chain-iterator/index.d.ts +0 -2
- package/dist/browser/hooks/chain-iterator/index.d.ts.map +1 -1
- package/dist/browser/index.mjs +352 -613
- package/dist/browser/index.mjs.map +1 -1
- package/package.json +48 -48
- package/src/components/chain/index.ts +0 -1
- package/src/hooks/chain-iterator/index.ts +0 -2
- package/dist/browser/components/chain/render/index.d.ts +0 -2
- package/dist/browser/components/chain/render/index.d.ts.map +0 -1
- package/dist/browser/components/chain/render/static/flexbox/Flexbox.d.ts +0 -5
- package/dist/browser/components/chain/render/static/flexbox/Flexbox.d.ts.map +0 -1
- package/dist/browser/components/chain/render/static/flexbox/Flexbox.stories.d.ts +0 -8
- package/dist/browser/components/chain/render/static/flexbox/Flexbox.stories.d.ts.map +0 -1
- package/dist/browser/components/chain/render/static/flexbox/index.d.ts +0 -2
- package/dist/browser/components/chain/render/static/flexbox/index.d.ts.map +0 -1
- package/dist/browser/components/chain/render/static/flexbox/variants/Base.d.ts +0 -4
- package/dist/browser/components/chain/render/static/flexbox/variants/Base.d.ts.map +0 -1
- package/dist/browser/components/chain/render/static/flexbox/variants/WithAnalysis.d.ts +0 -4
- package/dist/browser/components/chain/render/static/flexbox/variants/WithAnalysis.d.ts.map +0 -1
- package/dist/browser/components/chain/render/static/flexbox/variants/index.d.ts +0 -3
- package/dist/browser/components/chain/render/static/flexbox/variants/index.d.ts.map +0 -1
- package/dist/browser/components/chain/render/static/hooks/index.d.ts +0 -2
- package/dist/browser/components/chain/render/static/hooks/index.d.ts.map +0 -1
- package/dist/browser/components/chain/render/static/hooks/useStaticBlockRenderComponents.d.ts +0 -11
- package/dist/browser/components/chain/render/static/hooks/useStaticBlockRenderComponents.d.ts.map +0 -1
- package/dist/browser/components/chain/render/static/index.d.ts +0 -2
- package/dist/browser/components/chain/render/static/index.d.ts.map +0 -1
- package/dist/browser/components/chain/render/static/table/Ex.d.ts +0 -5
- package/dist/browser/components/chain/render/static/table/Ex.d.ts.map +0 -1
- package/dist/browser/components/chain/render/static/table/Ex.stories.d.ts +0 -8
- package/dist/browser/components/chain/render/static/table/Ex.stories.d.ts.map +0 -1
- package/dist/browser/components/chain/render/static/table/variants/Base.d.ts +0 -4
- package/dist/browser/components/chain/render/static/table/variants/Base.d.ts.map +0 -1
- package/dist/browser/components/chain/render/static/table/variants/WithAnalysis.d.ts +0 -4
- package/dist/browser/components/chain/render/static/table/variants/WithAnalysis.d.ts.map +0 -1
- package/dist/browser/components/chain/render/static/table/variants/index.d.ts +0 -3
- package/dist/browser/components/chain/render/static/table/variants/index.d.ts.map +0 -1
- package/dist/browser/hooks/chain-iterator/ChainIteratorStore.d.ts +0 -24
- package/dist/browser/hooks/chain-iterator/ChainIteratorStore.d.ts.map +0 -1
- package/dist/browser/hooks/chain-iterator/useChainIteratorUpdatingHead.d.ts +0 -10
- package/dist/browser/hooks/chain-iterator/useChainIteratorUpdatingHead.d.ts.map +0 -1
- package/src/components/chain/render/index.ts +0 -1
- package/src/components/chain/render/static/flexbox/Flexbox.stories.tsx +0 -37
- package/src/components/chain/render/static/flexbox/Flexbox.tsx +0 -3
- package/src/components/chain/render/static/flexbox/index.ts +0 -1
- package/src/components/chain/render/static/flexbox/variants/Base.tsx +0 -31
- package/src/components/chain/render/static/flexbox/variants/WithAnalysis.tsx +0 -24
- package/src/components/chain/render/static/flexbox/variants/index.ts +0 -2
- package/src/components/chain/render/static/hooks/index.ts +0 -1
- package/src/components/chain/render/static/hooks/useStaticBlockRenderComponents.ts +0 -38
- package/src/components/chain/render/static/index.ts +0 -1
- package/src/components/chain/render/static/table/Ex.stories.tsx +0 -35
- package/src/components/chain/render/static/table/Ex.tsx +0 -3
- package/src/components/chain/render/static/table/variants/Base.tsx +0 -29
- package/src/components/chain/render/static/table/variants/WithAnalysis.tsx +0 -11
- package/src/components/chain/render/static/table/variants/index.ts +0 -2
- package/src/hooks/chain-iterator/ChainIteratorStore.ts +0 -87
- package/src/hooks/chain-iterator/useChainIteratorUpdatingHead.ts +0 -56
package/dist/browser/index.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import { isDefined as isDefined7 } from "@xylabs/sdk-js";
|
|
|
8
8
|
import { useAccountBalanceHistory } from "@xyo-network/react-chain-provider";
|
|
9
9
|
import { ErrorRender as ErrorRender3 } from "@xyo-network/react-error";
|
|
10
10
|
import { AttoXL1 } from "@xyo-network/xl1-protocol";
|
|
11
|
-
import
|
|
11
|
+
import React30 from "react";
|
|
12
12
|
|
|
13
13
|
// src/components/account/helpers/formatBalanceMagnitude.ts
|
|
14
14
|
import { XL1Amount } from "@xyo-network/xl1-protocol";
|
|
@@ -32,68 +32,23 @@ var formatBalance = /* @__PURE__ */ __name((balance) => {
|
|
|
32
32
|
import { TableBody as TableBody2, TableCell as TableCell14, TableHead as TableHead2, TableRow as TableRow4 } from "@mui/material";
|
|
33
33
|
import { isDefined as isDefined6 } from "@xylabs/sdk-js";
|
|
34
34
|
import { TableEx as TableEx2 } from "@xyo-network/react-table";
|
|
35
|
-
import
|
|
35
|
+
import React29 from "react";
|
|
36
36
|
|
|
37
37
|
// src/components/account/table/BalanceHistoryTableRow.tsx
|
|
38
38
|
import { TableCell as TableCell13, TableRow as TableRow3 } from "@mui/material";
|
|
39
39
|
import { RawInfoIconButton } from "@xyo-network/react-payload-raw-info";
|
|
40
|
-
import
|
|
40
|
+
import React28, { useMemo as useMemo9 } from "react";
|
|
41
41
|
|
|
42
42
|
// src/components/block/BlockHeadingFlexbox.tsx
|
|
43
43
|
import { FlexCol as FlexCol2, FlexRow as FlexRow2 } from "@xylabs/react-flexbox";
|
|
44
44
|
import { BWVerification, HashHeadingPaper } from "@xyo-network/react-boundwitness-plugin";
|
|
45
45
|
import { usePayloadHash } from "@xyo-network/react-shared";
|
|
46
|
-
import
|
|
46
|
+
import React12 from "react";
|
|
47
47
|
|
|
48
48
|
// src/context/analyzer/context.ts
|
|
49
49
|
import { createContextEx } from "@xylabs/react-shared";
|
|
50
50
|
var ChainAnalyzersContext = createContextEx();
|
|
51
51
|
|
|
52
|
-
// src/context/analyzer/Provider.tsx
|
|
53
|
-
import { isUndefined } from "@xylabs/sdk-js";
|
|
54
|
-
import React, { useCallback, useMemo, useState } from "react";
|
|
55
|
-
var ChainAnalyzersProvider = /* @__PURE__ */ __name(({ analyzers: analyzersProp, children }) => {
|
|
56
|
-
const [analyzersState, setAnalyzersState] = useState(analyzersProp ?? {});
|
|
57
|
-
const [statsUpdated, setStatsUpdated] = useState(Date.now());
|
|
58
|
-
const analyzers = useMemo(() => ({
|
|
59
|
-
...analyzersProp,
|
|
60
|
-
...analyzersState
|
|
61
|
-
}), [
|
|
62
|
-
analyzersProp
|
|
63
|
-
]);
|
|
64
|
-
const addAnalyzers = useCallback((analyzers2) => {
|
|
65
|
-
if (isUndefined(analyzers2)) return;
|
|
66
|
-
setAnalyzersState((prev) => ({
|
|
67
|
-
...prev,
|
|
68
|
-
...analyzers2
|
|
69
|
-
}));
|
|
70
|
-
}, []);
|
|
71
|
-
const onBlock = useCallback(async (hydratedBlock) => {
|
|
72
|
-
await Promise.resolve();
|
|
73
|
-
for (const analyzer of Object.values(analyzers)) {
|
|
74
|
-
void analyzer.onBlock(hydratedBlock);
|
|
75
|
-
setStatsUpdated(Date.now());
|
|
76
|
-
}
|
|
77
|
-
}, [
|
|
78
|
-
analyzers
|
|
79
|
-
]);
|
|
80
|
-
const value = useMemo(() => ({
|
|
81
|
-
analyzers,
|
|
82
|
-
addAnalyzers,
|
|
83
|
-
onBlock,
|
|
84
|
-
statsUpdated,
|
|
85
|
-
provided: true
|
|
86
|
-
}), [
|
|
87
|
-
analyzers,
|
|
88
|
-
addAnalyzers,
|
|
89
|
-
onBlock,
|
|
90
|
-
statsUpdated
|
|
91
|
-
]);
|
|
92
|
-
return /* @__PURE__ */ React.createElement(ChainAnalyzersContext, {
|
|
93
|
-
value
|
|
94
|
-
}, children);
|
|
95
|
-
}, "ChainAnalyzersProvider");
|
|
96
|
-
|
|
97
52
|
// src/context/analyzer/use.ts
|
|
98
53
|
import { useContextEx } from "@xylabs/react-shared";
|
|
99
54
|
var useChainAnalyzersContext = /* @__PURE__ */ __name((required = false) => useContextEx(ChainAnalyzersContext, "ChainAnalyzers", required), "useChainAnalyzersContext");
|
|
@@ -103,11 +58,11 @@ import { createContextEx as createContextEx2 } from "@xylabs/react-shared";
|
|
|
103
58
|
var ChainInfoContext = createContextEx2();
|
|
104
59
|
|
|
105
60
|
// src/context/chain/Provider.tsx
|
|
106
|
-
import
|
|
61
|
+
import React, { useMemo, useState } from "react";
|
|
107
62
|
var ChainInfoProvider = /* @__PURE__ */ __name(({ children, chainArchivist: chainArchivistProp, chainId: chainIdProp, chainIterator: chainIteratorProp }) => {
|
|
108
|
-
const [chainArchivist, setChainArchivist] =
|
|
109
|
-
const [chainId, setChainId] =
|
|
110
|
-
const [chainIterator, setChainIterator] =
|
|
63
|
+
const [chainArchivist, setChainArchivist] = useState(chainArchivistProp);
|
|
64
|
+
const [chainId, setChainId] = useState(chainIdProp);
|
|
65
|
+
const [chainIterator, setChainIterator] = useState(chainIteratorProp);
|
|
111
66
|
const updateChainArchivist = /* @__PURE__ */ __name((chainArchivist2) => {
|
|
112
67
|
setChainArchivist(chainArchivist2);
|
|
113
68
|
}, "updateChainArchivist");
|
|
@@ -117,22 +72,22 @@ var ChainInfoProvider = /* @__PURE__ */ __name(({ children, chainArchivist: chai
|
|
|
117
72
|
const updateChainIterator = /* @__PURE__ */ __name((chainIterator2) => {
|
|
118
73
|
setChainIterator(chainIterator2);
|
|
119
74
|
}, "updateChainIterator");
|
|
120
|
-
|
|
75
|
+
useMemo(() => {
|
|
121
76
|
updateChainArchivist(chainArchivistProp);
|
|
122
77
|
}, [
|
|
123
78
|
chainArchivistProp
|
|
124
79
|
]);
|
|
125
|
-
|
|
80
|
+
useMemo(() => {
|
|
126
81
|
updateChainId(chainIdProp);
|
|
127
82
|
}, [
|
|
128
83
|
chainIdProp
|
|
129
84
|
]);
|
|
130
|
-
|
|
85
|
+
useMemo(() => {
|
|
131
86
|
updateChainIterator(chainIteratorProp);
|
|
132
87
|
}, [
|
|
133
88
|
chainIteratorProp
|
|
134
89
|
]);
|
|
135
|
-
const chainState =
|
|
90
|
+
const chainState = useMemo(() => ({
|
|
136
91
|
chainArchivist,
|
|
137
92
|
chainId,
|
|
138
93
|
chainIterator,
|
|
@@ -148,7 +103,7 @@ var ChainInfoProvider = /* @__PURE__ */ __name(({ children, chainArchivist: chai
|
|
|
148
103
|
updateChainId,
|
|
149
104
|
updateChainIterator
|
|
150
105
|
]);
|
|
151
|
-
return /* @__PURE__ */
|
|
106
|
+
return /* @__PURE__ */ React.createElement(ChainInfoContext, {
|
|
152
107
|
value: chainState
|
|
153
108
|
}, children);
|
|
154
109
|
}, "ChainInfoProvider");
|
|
@@ -166,7 +121,7 @@ import { Button, FormControl, TextField } from "@mui/material";
|
|
|
166
121
|
import { FlexCol } from "@xylabs/react-flexbox";
|
|
167
122
|
import { toHex } from "@xylabs/sdk-js";
|
|
168
123
|
import { defaultTransactionFees, toXL1BlockNumber } from "@xyo-network/xl1-protocol";
|
|
169
|
-
import
|
|
124
|
+
import React2 from "react";
|
|
170
125
|
var ChainTransactionBuilder = /* @__PURE__ */ __name(({ onSubmitTx }) => {
|
|
171
126
|
const handleSubmit = /* @__PURE__ */ __name(async (event) => {
|
|
172
127
|
event.preventDefault();
|
|
@@ -184,38 +139,38 @@ var ChainTransactionBuilder = /* @__PURE__ */ __name(({ onSubmitTx }) => {
|
|
|
184
139
|
};
|
|
185
140
|
await onSubmitTx?.(chainTx);
|
|
186
141
|
}, "handleSubmit");
|
|
187
|
-
return /* @__PURE__ */
|
|
142
|
+
return /* @__PURE__ */ React2.createElement("form", {
|
|
188
143
|
onSubmit: /* @__PURE__ */ __name((event) => void handleSubmit(event), "onSubmit"),
|
|
189
144
|
style: {
|
|
190
145
|
width: "100%"
|
|
191
146
|
}
|
|
192
|
-
}, /* @__PURE__ */
|
|
147
|
+
}, /* @__PURE__ */ React2.createElement(FlexCol, {
|
|
193
148
|
gap: 2
|
|
194
|
-
}, /* @__PURE__ */
|
|
149
|
+
}, /* @__PURE__ */ React2.createElement(FormControl, {
|
|
195
150
|
fullWidth: true
|
|
196
|
-
}, /* @__PURE__ */
|
|
151
|
+
}, /* @__PURE__ */ React2.createElement(TextField, {
|
|
197
152
|
label: "Chain Address",
|
|
198
153
|
name: "chain",
|
|
199
154
|
required: true
|
|
200
|
-
})), /* @__PURE__ */
|
|
155
|
+
})), /* @__PURE__ */ React2.createElement(FormControl, {
|
|
201
156
|
fullWidth: true
|
|
202
|
-
}, /* @__PURE__ */
|
|
157
|
+
}, /* @__PURE__ */ React2.createElement(TextField, {
|
|
203
158
|
label: "Gas",
|
|
204
159
|
name: "gas",
|
|
205
160
|
required: true
|
|
206
|
-
})), /* @__PURE__ */
|
|
161
|
+
})), /* @__PURE__ */ React2.createElement(FormControl, {
|
|
207
162
|
fullWidth: true
|
|
208
|
-
}, /* @__PURE__ */
|
|
163
|
+
}, /* @__PURE__ */ React2.createElement(TextField, {
|
|
209
164
|
label: "Not Before Block",
|
|
210
165
|
name: "nbf",
|
|
211
166
|
required: true
|
|
212
|
-
})), /* @__PURE__ */
|
|
167
|
+
})), /* @__PURE__ */ React2.createElement(FormControl, {
|
|
213
168
|
fullWidth: true
|
|
214
|
-
}, /* @__PURE__ */
|
|
169
|
+
}, /* @__PURE__ */ React2.createElement(TextField, {
|
|
215
170
|
label: "Not After Block",
|
|
216
171
|
name: "exp",
|
|
217
172
|
required: true
|
|
218
|
-
})), /* @__PURE__ */
|
|
173
|
+
})), /* @__PURE__ */ React2.createElement(Button, {
|
|
219
174
|
type: "submit",
|
|
220
175
|
variant: "contained"
|
|
221
176
|
}, "Submit")));
|
|
@@ -223,9 +178,9 @@ var ChainTransactionBuilder = /* @__PURE__ */ __name(({ onSubmitTx }) => {
|
|
|
223
178
|
|
|
224
179
|
// src/components/transactions/submit/Network.tsx
|
|
225
180
|
import { FormControl as FormControl2, FormHelperText, TextField as TextField2 } from "@mui/material";
|
|
226
|
-
import
|
|
181
|
+
import React3, { useState as useState2 } from "react";
|
|
227
182
|
var ChainTransactionNetwork = /* @__PURE__ */ __name(({ network, onNetworkChange, ...props }) => {
|
|
228
|
-
const [error, setError] =
|
|
183
|
+
const [error, setError] = useState2();
|
|
229
184
|
const handleChange = /* @__PURE__ */ __name((event) => {
|
|
230
185
|
try {
|
|
231
186
|
const url = new URL(event.target.value);
|
|
@@ -236,16 +191,16 @@ var ChainTransactionNetwork = /* @__PURE__ */ __name(({ network, onNetworkChange
|
|
|
236
191
|
setError(error2);
|
|
237
192
|
}
|
|
238
193
|
}, "handleChange");
|
|
239
|
-
return /* @__PURE__ */
|
|
194
|
+
return /* @__PURE__ */ React3.createElement(FormControl2, {
|
|
240
195
|
fullWidth: true
|
|
241
|
-
}, /* @__PURE__ */
|
|
196
|
+
}, /* @__PURE__ */ React3.createElement(TextField2, {
|
|
242
197
|
label: "Network",
|
|
243
198
|
name: "network",
|
|
244
199
|
onChange: handleChange,
|
|
245
200
|
required: true,
|
|
246
201
|
value: network,
|
|
247
202
|
...props
|
|
248
|
-
}), /* @__PURE__ */
|
|
203
|
+
}), /* @__PURE__ */ React3.createElement(FormHelperText, {
|
|
249
204
|
sx: {
|
|
250
205
|
color: error ? "red" : void 0
|
|
251
206
|
}
|
|
@@ -263,13 +218,13 @@ import { QueryBoundWitnessBuilder } from "@xyo-network/boundwitness-builder";
|
|
|
263
218
|
import { PayloadBuilder } from "@xyo-network/payload-builder";
|
|
264
219
|
import { buildTransaction } from "@xyo-network/xl1-protocol-sdk";
|
|
265
220
|
import { Axios } from "axios";
|
|
266
|
-
import
|
|
221
|
+
import React4, { useState as useState3 } from "react";
|
|
267
222
|
var BETA_PENDING_TRANSACTIONS_ARCHIVIST = "https://beta.api.chain.xyo.network/8050fee682a2762f504d5449d8269a6f17f0b693";
|
|
268
223
|
var defaultNetwork = new URL(BETA_PENDING_TRANSACTIONS_ARCHIVIST);
|
|
269
224
|
var SubmitChainTransaction = /* @__PURE__ */ __name(() => {
|
|
270
|
-
const [network, setNetwork] =
|
|
271
|
-
const [result, setResult] =
|
|
272
|
-
const [error, setError] =
|
|
225
|
+
const [network, setNetwork] = useState3(defaultNetwork);
|
|
226
|
+
const [result, setResult] = useState3();
|
|
227
|
+
const [error, setError] = useState3();
|
|
273
228
|
const onSubmitTx = /* @__PURE__ */ __name(async (chainTx) => {
|
|
274
229
|
if (network) {
|
|
275
230
|
const randomAccount = await Account.random();
|
|
@@ -298,46 +253,46 @@ var SubmitChainTransaction = /* @__PURE__ */ __name(() => {
|
|
|
298
253
|
const onNetworkChange = /* @__PURE__ */ __name((url) => {
|
|
299
254
|
setNetwork(url);
|
|
300
255
|
}, "onNetworkChange");
|
|
301
|
-
return /* @__PURE__ */
|
|
256
|
+
return /* @__PURE__ */ React4.createElement(Grid, {
|
|
302
257
|
container: true
|
|
303
|
-
}, /* @__PURE__ */
|
|
258
|
+
}, /* @__PURE__ */ React4.createElement(Grid, {
|
|
304
259
|
size: {
|
|
305
260
|
xs: 12,
|
|
306
261
|
sm: 6,
|
|
307
262
|
md: 4
|
|
308
263
|
}
|
|
309
|
-
}, /* @__PURE__ */
|
|
264
|
+
}, /* @__PURE__ */ React4.createElement(FlexGrowCol, {
|
|
310
265
|
alignItems: "start",
|
|
311
266
|
gap: 2
|
|
312
|
-
}, /* @__PURE__ */
|
|
267
|
+
}, /* @__PURE__ */ React4.createElement(ChainTransactionNetwork, {
|
|
313
268
|
network,
|
|
314
269
|
onNetworkChange
|
|
315
|
-
}), network ? /* @__PURE__ */
|
|
270
|
+
}), network ? /* @__PURE__ */ React4.createElement(ChainTransactionBuilder, {
|
|
316
271
|
onSubmitTx
|
|
317
|
-
}) : null, result?.[2].length === 0 ? /* @__PURE__ */
|
|
272
|
+
}) : null, result?.[2].length === 0 ? /* @__PURE__ */ React4.createElement(Alert, {
|
|
318
273
|
severity: "success"
|
|
319
|
-
}, "Success") : null, error ? /* @__PURE__ */
|
|
274
|
+
}, "Success") : null, error ? /* @__PURE__ */ React4.createElement(ErrorRender, {
|
|
320
275
|
error
|
|
321
|
-
}) : null, result?.[2] && result?.[2].length > 0 ? /* @__PURE__ */
|
|
276
|
+
}) : null, result?.[2] && result?.[2].length > 0 ? /* @__PURE__ */ React4.createElement(ErrorRender, {
|
|
322
277
|
error: new Error("Failed insert...see result below")
|
|
323
|
-
}) : null, result ? /* @__PURE__ */
|
|
278
|
+
}) : null, result ? /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement(Typography, {
|
|
324
279
|
variant: "h6"
|
|
325
|
-
}, "Result:"), /* @__PURE__ */
|
|
280
|
+
}, "Result:"), /* @__PURE__ */ React4.createElement("pre", null, JSON.stringify(result, null, 2))) : null)));
|
|
326
281
|
}, "SubmitChainTransaction");
|
|
327
282
|
|
|
328
283
|
// src/components/transactions/TransactionCountChip.tsx
|
|
329
284
|
import CompareArrowsIcon from "@mui/icons-material/CompareArrows";
|
|
330
285
|
import { Chip, Icon } from "@mui/material";
|
|
331
|
-
import
|
|
286
|
+
import React5, { useMemo as useMemo2 } from "react";
|
|
332
287
|
var TransactionCountChip = /* @__PURE__ */ __name(({ transactions, sx, ...props }) => {
|
|
333
|
-
const label =
|
|
288
|
+
const label = useMemo2(() => {
|
|
334
289
|
if (!transactions) return "0";
|
|
335
290
|
return transactions?.length > 10 ? "+10" : transactions.length;
|
|
336
291
|
}, [
|
|
337
292
|
transactions
|
|
338
293
|
]);
|
|
339
|
-
return /* @__PURE__ */
|
|
340
|
-
avatar: /* @__PURE__ */
|
|
294
|
+
return /* @__PURE__ */ React5.createElement(Chip, {
|
|
295
|
+
avatar: /* @__PURE__ */ React5.createElement(Icon, null, /* @__PURE__ */ React5.createElement(CompareArrowsIcon, null)),
|
|
341
296
|
label,
|
|
342
297
|
title: transactions ? `Block contains ${transactions.length} transactions` : void 0,
|
|
343
298
|
sx: {
|
|
@@ -356,80 +311,12 @@ import { Alert as Alert2, AlertTitle, Collapse, Snackbar, Typography as Typograp
|
|
|
356
311
|
import { ErrorRender as ErrorRender2 } from "@xylabs/react-error";
|
|
357
312
|
import { FlexGrowCol as FlexGrowCol2, FlexGrowRow, FlexRow } from "@xylabs/react-flexbox";
|
|
358
313
|
import { QuickTipButton } from "@xylabs/react-quick-tip-button";
|
|
359
|
-
import
|
|
360
|
-
|
|
361
|
-
// src/hooks/chain-iterator/ChainIteratorStore.ts
|
|
362
|
-
import { assertEx } from "@xylabs/sdk-js";
|
|
363
|
-
import { ChainBlockNumberIterationService } from "@xyo-network/chain-services";
|
|
364
|
-
import { PayloadBuilder as PayloadBuilder2 } from "@xyo-network/payload-builder";
|
|
365
|
-
import { hydrateBlock } from "@xyo-network/xl1-protocol-sdk";
|
|
366
|
-
var ChainIteratorStore = class _ChainIteratorStore {
|
|
367
|
-
static {
|
|
368
|
-
__name(this, "ChainIteratorStore");
|
|
369
|
-
}
|
|
370
|
-
_chainIterator;
|
|
371
|
-
_externalListeners = [];
|
|
372
|
-
_internalUnsubscribes = [];
|
|
373
|
-
_values;
|
|
374
|
-
get chainIterator() {
|
|
375
|
-
return assertEx(this._chainIterator, () => "ChainIteratorStore has not been initialized");
|
|
376
|
-
}
|
|
377
|
-
get values() {
|
|
378
|
-
return assertEx(this._values, () => "ChainIteratorStore values have not been initialized");
|
|
379
|
-
}
|
|
380
|
-
static async create(params) {
|
|
381
|
-
const instance = new _ChainIteratorStore();
|
|
382
|
-
const chainIterator = await ChainBlockNumberIterationService.create(params);
|
|
383
|
-
instance._chainIterator = chainIterator;
|
|
384
|
-
const head = await chainIterator.head();
|
|
385
|
-
const hydratedHead = await hydrateBlock({
|
|
386
|
-
chainMap: params.chainMap
|
|
387
|
-
}, await PayloadBuilder2.hash(head));
|
|
388
|
-
instance._values = {
|
|
389
|
-
chainIterator,
|
|
390
|
-
head: hydratedHead
|
|
391
|
-
};
|
|
392
|
-
const headUpdatedListener = /* @__PURE__ */ __name(async ({ blocks }) => {
|
|
393
|
-
const hydratedBlock = await hydrateBlock({
|
|
394
|
-
chainMap: params.chainMap
|
|
395
|
-
}, await PayloadBuilder2.hash(blocks?.[0]));
|
|
396
|
-
instance._values = {
|
|
397
|
-
chainIterator,
|
|
398
|
-
head: hydratedBlock
|
|
399
|
-
};
|
|
400
|
-
instance.emitChange();
|
|
401
|
-
}, "headUpdatedListener");
|
|
402
|
-
const unsubscribe = chainIterator.on("headUpdated", headUpdatedListener);
|
|
403
|
-
const weakRefListener = new WeakRef(unsubscribe);
|
|
404
|
-
instance._internalUnsubscribes.push(weakRefListener);
|
|
405
|
-
return instance;
|
|
406
|
-
}
|
|
407
|
-
cleanup() {
|
|
408
|
-
for (const unsubscribeRef of this._internalUnsubscribes) {
|
|
409
|
-
const unsubscribe = unsubscribeRef.deref();
|
|
410
|
-
unsubscribe?.();
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
getSnapshot() {
|
|
414
|
-
return this.values;
|
|
415
|
-
}
|
|
416
|
-
subscribe(onStoreChange) {
|
|
417
|
-
this._externalListeners.push(onStoreChange);
|
|
418
|
-
return () => {
|
|
419
|
-
this._externalListeners = this._externalListeners.filter((l) => l !== onStoreChange);
|
|
420
|
-
};
|
|
421
|
-
}
|
|
422
|
-
emitChange() {
|
|
423
|
-
for (const listener of this._externalListeners) {
|
|
424
|
-
listener();
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
};
|
|
314
|
+
import React6, { Fragment, useMemo as useMemo3, useState as useState4 } from "react";
|
|
428
315
|
|
|
429
316
|
// src/hooks/chain-iterator/useChainIteratorParams.ts
|
|
430
317
|
import { usePromise } from "@xylabs/react-promise";
|
|
431
318
|
import { isHash } from "@xylabs/sdk-js";
|
|
432
|
-
import { assertEx
|
|
319
|
+
import { assertEx, isDefined } from "@xylabs/sdk-js";
|
|
433
320
|
import { BoundWitnessBuilder } from "@xyo-network/boundwitness-builder";
|
|
434
321
|
import { isBlockBoundWitness } from "@xyo-network/xl1-protocol";
|
|
435
322
|
import { getDefaultConfig } from "@xyo-network/xl1-protocol-sdk";
|
|
@@ -441,15 +328,15 @@ var resolveDefinedHead = /* @__PURE__ */ __name(async (head, chainArchivist) =>
|
|
|
441
328
|
const [currentHead] = await new BoundWitnessBuilder().build();
|
|
442
329
|
return currentHead;
|
|
443
330
|
} else {
|
|
444
|
-
return
|
|
331
|
+
return assertEx(isBlockBoundWitness(headPayload) ? headPayload : void 0, () => `Expected a block bound witness: ${JSON.stringify(headPayload)}`);
|
|
445
332
|
}
|
|
446
333
|
}, "resolveDefinedHead");
|
|
447
334
|
var useChainIteratorParams = /* @__PURE__ */ __name(({ chainMap, chainId, head, name }) => {
|
|
448
335
|
return usePromise(async () => {
|
|
449
336
|
if (isDefined(chainMap) && isDefined(chainId) && isHash(head)) {
|
|
450
337
|
const result = await chainMap.get(head);
|
|
451
|
-
const foundResult =
|
|
452
|
-
const resolvedHead =
|
|
338
|
+
const foundResult = assertEx(result, () => `Head not found: ${head}`);
|
|
339
|
+
const resolvedHead = assertEx(isBlockBoundWitness(foundResult) ? foundResult : void 0, () => `Head is not a boundwitness: ${JSON.stringify(foundResult)}`);
|
|
453
340
|
const config = getDefaultConfig();
|
|
454
341
|
config.chain.id = chainId;
|
|
455
342
|
return {
|
|
@@ -467,65 +354,24 @@ var useChainIteratorParams = /* @__PURE__ */ __name(({ chainMap, chainId, head,
|
|
|
467
354
|
]);
|
|
468
355
|
}, "useChainIteratorParams");
|
|
469
356
|
|
|
470
|
-
// src/hooks/chain-iterator/useChainIteratorUpdatingHead.ts
|
|
471
|
-
import { toHex as toHex2 } from "@xylabs/sdk-js";
|
|
472
|
-
import { findMostRecentBlock } from "@xyo-network/xl1-protocol-sdk";
|
|
473
|
-
import { useEffect, useState as useState5 } from "react";
|
|
474
|
-
var useChainIteratorUpdatingHead = /* @__PURE__ */ __name(({ chainIterator, interval = 500, maxBlocks, chainArchivist }) => {
|
|
475
|
-
const [error, setError] = useState5();
|
|
476
|
-
useEffect(() => {
|
|
477
|
-
let pollArchivistTimeout;
|
|
478
|
-
const pollingFunction = /* @__PURE__ */ __name(async () => {
|
|
479
|
-
if (chainIterator && chainArchivist) {
|
|
480
|
-
try {
|
|
481
|
-
const currentHead = await chainIterator.head();
|
|
482
|
-
const mostRecentBlock = await findMostRecentBlock(chainArchivist);
|
|
483
|
-
if (mostRecentBlock) {
|
|
484
|
-
const currentBlockNumber = currentHead?.block ?? -1;
|
|
485
|
-
const nextBlockNumber = mostRecentBlock.block;
|
|
486
|
-
if (nextBlockNumber > currentBlockNumber) {
|
|
487
|
-
console.debug("Found more recent head:", toHex2(nextBlockNumber));
|
|
488
|
-
console.debug("Updating head:", `${toHex2(nextBlockNumber)}`);
|
|
489
|
-
await chainIterator.updateHead(mostRecentBlock);
|
|
490
|
-
console.debug("Updated head:", `${toHex2(nextBlockNumber)}`);
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
} catch (e) {
|
|
494
|
-
setError(e);
|
|
495
|
-
console.error(e);
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
pollArchivistTimeout = setTimeout(() => void pollingFunction(), interval);
|
|
499
|
-
}, "pollingFunction");
|
|
500
|
-
void pollingFunction();
|
|
501
|
-
return () => clearInterval(pollArchivistTimeout);
|
|
502
|
-
}, [
|
|
503
|
-
interval,
|
|
504
|
-
chainIterator,
|
|
505
|
-
chainArchivist,
|
|
506
|
-
maxBlocks
|
|
507
|
-
]);
|
|
508
|
-
return error;
|
|
509
|
-
}, "useChainIteratorUpdatingHead");
|
|
510
|
-
|
|
511
357
|
// src/hooks/useIterateChain.ts
|
|
512
358
|
import { usePromise as usePromise2 } from "@xylabs/react-promise";
|
|
513
|
-
import { assertEx as
|
|
514
|
-
import { ChainBlockNumberIterationService
|
|
515
|
-
import { PayloadBuilder as
|
|
359
|
+
import { assertEx as assertEx2 } from "@xylabs/sdk-js";
|
|
360
|
+
import { ChainBlockNumberIterationService } from "@xyo-network/chain-services";
|
|
361
|
+
import { PayloadBuilder as PayloadBuilder2 } from "@xyo-network/payload-builder";
|
|
516
362
|
import { isBlockBoundWitness as isBlockBoundWitness2 } from "@xyo-network/xl1-protocol";
|
|
517
|
-
import { hydrateBlock
|
|
363
|
+
import { hydrateBlock } from "@xyo-network/xl1-protocol-sdk";
|
|
518
364
|
var getHydratedBlock = /* @__PURE__ */ __name(async (chainMap, head) => {
|
|
519
|
-
const headHash = await
|
|
520
|
-
return await
|
|
365
|
+
const headHash = await PayloadBuilder2.hash(head);
|
|
366
|
+
return await hydrateBlock({
|
|
521
367
|
chainMap
|
|
522
368
|
}, headHash);
|
|
523
369
|
}, "getHydratedBlock");
|
|
524
370
|
var iterateChain = /* @__PURE__ */ __name(async (chainIteratorParams, maxDepth) => {
|
|
525
371
|
const { chainMap, head } = chainIteratorParams ?? {};
|
|
526
|
-
const headPayload =
|
|
527
|
-
const headBlockBoundWitness =
|
|
528
|
-
const chainIterator = await
|
|
372
|
+
const headPayload = assertEx2(isBlockBoundWitness2(head) ? head : null, () => "Head is not a Block Bound Witness");
|
|
373
|
+
const headBlockBoundWitness = assertEx2(isBlockBoundWitness2(headPayload) ? headPayload : null, () => "Invalid head block");
|
|
374
|
+
const chainIterator = await ChainBlockNumberIterationService.create({
|
|
529
375
|
head: headBlockBoundWitness,
|
|
530
376
|
chainMap
|
|
531
377
|
});
|
|
@@ -559,12 +405,12 @@ import { usePromise as usePromise3 } from "@xylabs/react-promise";
|
|
|
559
405
|
|
|
560
406
|
// src/helpers/txsFromBlock.ts
|
|
561
407
|
import { HydratedBlockWrapper } from "@xyo-network/chain-wrappers";
|
|
562
|
-
import { PayloadBuilder as
|
|
408
|
+
import { PayloadBuilder as PayloadBuilder3 } from "@xyo-network/payload-builder";
|
|
563
409
|
var txsFromBlock = /* @__PURE__ */ __name(async (block) => {
|
|
564
410
|
const wrapper = await HydratedBlockWrapper.parse(block);
|
|
565
411
|
const txs = wrapper.transactions;
|
|
566
412
|
const txPayloads = txs.map((tx) => tx.boundWitness);
|
|
567
|
-
return await
|
|
413
|
+
return await PayloadBuilder3.hashPairs(txPayloads);
|
|
568
414
|
}, "txsFromBlock");
|
|
569
415
|
|
|
570
416
|
// src/hooks/useTxsFromBlock.ts
|
|
@@ -581,9 +427,9 @@ var useTxsFromBlock = /* @__PURE__ */ __name((block) => {
|
|
|
581
427
|
// src/components/transactions/TransactionsQuickTipButton.tsx
|
|
582
428
|
var TransactionsQuickTipButton = /* @__PURE__ */ __name(({ block, ...props }) => {
|
|
583
429
|
const [transactions, transactionsError] = useTxsFromBlock(block);
|
|
584
|
-
const [copied, setCopied] =
|
|
585
|
-
const [showError, setShowError] =
|
|
586
|
-
|
|
430
|
+
const [copied, setCopied] = useState4(false);
|
|
431
|
+
const [showError, setShowError] = useState4(false);
|
|
432
|
+
useMemo3(() => transactionsError ? setShowError(true) : setShowError(false), [
|
|
587
433
|
transactionsError
|
|
588
434
|
]);
|
|
589
435
|
const onCopy = /* @__PURE__ */ __name(async (transactionHash) => {
|
|
@@ -593,7 +439,7 @@ var TransactionsQuickTipButton = /* @__PURE__ */ __name(({ block, ...props }) =>
|
|
|
593
439
|
setCopied(false);
|
|
594
440
|
}, 5e3);
|
|
595
441
|
}, "onCopy");
|
|
596
|
-
return /* @__PURE__ */
|
|
442
|
+
return /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(QuickTipButton, {
|
|
597
443
|
Icon: Paid,
|
|
598
444
|
disabled: transactions?.length === 0,
|
|
599
445
|
hoverText: `Transaction Count: ${transactions?.length ?? 0}`,
|
|
@@ -603,41 +449,41 @@ var TransactionsQuickTipButton = /* @__PURE__ */ __name(({ block, ...props }) =>
|
|
|
603
449
|
maxWidth: "md"
|
|
604
450
|
},
|
|
605
451
|
...props
|
|
606
|
-
}, transactions?.length === 0 ? null : /* @__PURE__ */
|
|
452
|
+
}, transactions?.length === 0 ? null : /* @__PURE__ */ React6.createElement(FlexGrowCol2, {
|
|
607
453
|
gap: 1,
|
|
608
454
|
alignItems: "stretch"
|
|
609
|
-
}, transactions?.map(([transaction, hash]) => /* @__PURE__ */
|
|
455
|
+
}, transactions?.map(([transaction, hash]) => /* @__PURE__ */ React6.createElement(Fragment, {
|
|
610
456
|
key: hash
|
|
611
|
-
}, /* @__PURE__ */
|
|
457
|
+
}, /* @__PURE__ */ React6.createElement(FlexGrowRow, {
|
|
612
458
|
gap: 2,
|
|
613
459
|
justifyContent: "start"
|
|
614
|
-
}, /* @__PURE__ */
|
|
460
|
+
}, /* @__PURE__ */ React6.createElement(ContentCopyIcon, {
|
|
615
461
|
sx: {
|
|
616
462
|
cursor: "pointer"
|
|
617
463
|
},
|
|
618
464
|
onClick: /* @__PURE__ */ __name(() => void onCopy(hash), "onClick")
|
|
619
|
-
}), /* @__PURE__ */
|
|
465
|
+
}), /* @__PURE__ */ React6.createElement(Typography2, {
|
|
620
466
|
sx: {
|
|
621
467
|
overflow: "hidden",
|
|
622
468
|
textOverflow: "ellipsis",
|
|
623
469
|
whiteSpace: "nowrap"
|
|
624
470
|
}
|
|
625
|
-
}, hash)), /* @__PURE__ */
|
|
471
|
+
}, hash)), /* @__PURE__ */ React6.createElement(FlexRow, null, /* @__PURE__ */ React6.createElement(Collapse, {
|
|
626
472
|
in: copied,
|
|
627
473
|
unmountOnExit: true
|
|
628
|
-
}, /* @__PURE__ */
|
|
474
|
+
}, /* @__PURE__ */ React6.createElement(Alert2, null, /* @__PURE__ */ React6.createElement(AlertTitle, null, "Previous hash copied to clipboard")))))))), /* @__PURE__ */ React6.createElement(Snackbar, {
|
|
629
475
|
open: showError,
|
|
630
476
|
onClose: /* @__PURE__ */ __name(() => setShowError(false), "onClose")
|
|
631
|
-
}, /* @__PURE__ */
|
|
477
|
+
}, /* @__PURE__ */ React6.createElement(ErrorRender2, {
|
|
632
478
|
error: transactionsError,
|
|
633
479
|
scope: "TransactionsQuickTipButton"
|
|
634
480
|
})));
|
|
635
481
|
}, "TransactionsQuickTipButton");
|
|
636
482
|
|
|
637
483
|
// src/components/block/hooks/useAnchorElement.ts
|
|
638
|
-
import { useRef, useState as
|
|
484
|
+
import { useRef, useState as useState5 } from "react";
|
|
639
485
|
var useAnchorElement = /* @__PURE__ */ __name(() => {
|
|
640
|
-
const [anchorEl, setAnchorEl] =
|
|
486
|
+
const [anchorEl, setAnchorEl] = useState5(null);
|
|
641
487
|
const anchorRef = useRef(null);
|
|
642
488
|
const open = Boolean(anchorEl);
|
|
643
489
|
const handleClick = /* @__PURE__ */ __name((event) => {
|
|
@@ -662,9 +508,9 @@ var useBlockHeadingEvents = /* @__PURE__ */ __name((...args) => {
|
|
|
662
508
|
}, "useBlockHeadingEvents");
|
|
663
509
|
|
|
664
510
|
// src/components/block/hooks/useBlockProducer.ts
|
|
665
|
-
import { useMemo as
|
|
511
|
+
import { useMemo as useMemo4 } from "react";
|
|
666
512
|
var useBlockProducer = /* @__PURE__ */ __name((block) => {
|
|
667
|
-
return
|
|
513
|
+
return useMemo4(() => {
|
|
668
514
|
if (block) {
|
|
669
515
|
const producer = block[0].addresses[0];
|
|
670
516
|
return producer;
|
|
@@ -675,7 +521,7 @@ var useBlockProducer = /* @__PURE__ */ __name((block) => {
|
|
|
675
521
|
}, "useBlockProducer");
|
|
676
522
|
|
|
677
523
|
// src/components/block/hooks/useDynamicBlockComponents.ts
|
|
678
|
-
import { useState as
|
|
524
|
+
import { useState as useState6 } from "react";
|
|
679
525
|
|
|
680
526
|
// src/components/block/helpers/blockProducer.ts
|
|
681
527
|
var blockProducer = /* @__PURE__ */ __name((block) => {
|
|
@@ -683,13 +529,13 @@ var blockProducer = /* @__PURE__ */ __name((block) => {
|
|
|
683
529
|
}, "blockProducer");
|
|
684
530
|
|
|
685
531
|
// src/components/block/helpers/buildBlockChainRenderComponent.tsx
|
|
686
|
-
import
|
|
532
|
+
import React7 from "react";
|
|
687
533
|
var buildBlockChainRenderComponent = /* @__PURE__ */ __name(async (BlockComponent, blockComponentProps) => {
|
|
688
534
|
const { block, ...remainingProps } = blockComponentProps;
|
|
689
535
|
const blockTxs = await txsFromBlock(block);
|
|
690
536
|
const txHashes = blockTxs.map(([_, hash]) => hash);
|
|
691
537
|
const item = {
|
|
692
|
-
child: /* @__PURE__ */
|
|
538
|
+
child: /* @__PURE__ */ React7.createElement(BlockComponent, {
|
|
693
539
|
block,
|
|
694
540
|
transactions: txHashes,
|
|
695
541
|
...remainingProps
|
|
@@ -716,7 +562,7 @@ var payloadCountsFromBlock = /* @__PURE__ */ __name(([block, payloads]) => {
|
|
|
716
562
|
// src/components/block/hooks/useDynamicBlockComponents.ts
|
|
717
563
|
var useDynamicBlockComponents = /* @__PURE__ */ __name((BlockComponent, params, maxBlocks) => {
|
|
718
564
|
const { chainMap } = params ?? {};
|
|
719
|
-
const [blockChainRenderComponents, setBlockChainRenderComponents] =
|
|
565
|
+
const [blockChainRenderComponents, setBlockChainRenderComponents] = useState6([]);
|
|
720
566
|
const { onBlock } = useChainAnalyzersContext();
|
|
721
567
|
const onAddBlock = /* @__PURE__ */ __name(async (block) => {
|
|
722
568
|
if (!block || !chainMap) return;
|
|
@@ -745,9 +591,9 @@ var useDynamicBlockComponents = /* @__PURE__ */ __name((BlockComponent, params,
|
|
|
745
591
|
}, "useDynamicBlockComponents");
|
|
746
592
|
|
|
747
593
|
// src/components/block/hooks/usePayloadCountsFromBlock.ts
|
|
748
|
-
import { useMemo as
|
|
594
|
+
import { useMemo as useMemo5 } from "react";
|
|
749
595
|
var usePayloadCountsFromBlock = /* @__PURE__ */ __name((block) => {
|
|
750
|
-
return
|
|
596
|
+
return useMemo5(() => {
|
|
751
597
|
if (block) {
|
|
752
598
|
return [
|
|
753
599
|
...payloadCountsFromBlock(block),
|
|
@@ -795,9 +641,9 @@ var useStaticBlockComponents = /* @__PURE__ */ __name((BlockComponent, params, b
|
|
|
795
641
|
|
|
796
642
|
// src/components/block/LinkedDivider.tsx
|
|
797
643
|
import { Divider, Stack } from "@mui/material";
|
|
798
|
-
import
|
|
644
|
+
import React8 from "react";
|
|
799
645
|
var LinkedDivider = /* @__PURE__ */ __name(() => {
|
|
800
|
-
return /* @__PURE__ */
|
|
646
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(Stack, {
|
|
801
647
|
className: "divider-spacer",
|
|
802
648
|
justifyContent: "end",
|
|
803
649
|
sx: {
|
|
@@ -805,7 +651,7 @@ var LinkedDivider = /* @__PURE__ */ __name(() => {
|
|
|
805
651
|
height: 24,
|
|
806
652
|
justifyContent: "end"
|
|
807
653
|
}
|
|
808
|
-
}, /* @__PURE__ */
|
|
654
|
+
}, /* @__PURE__ */ React8.createElement(Divider, {
|
|
809
655
|
className: "divider",
|
|
810
656
|
orientation: "vertical",
|
|
811
657
|
flexItem: true,
|
|
@@ -821,16 +667,16 @@ var LinkedDivider = /* @__PURE__ */ __name(() => {
|
|
|
821
667
|
import { MoreVert } from "@mui/icons-material";
|
|
822
668
|
import { IconButton, Menu } from "@mui/material";
|
|
823
669
|
import { BWJsonMenuItem, BWPreviousHashMenuItem } from "@xyo-network/react-boundwitness-plugin";
|
|
824
|
-
import
|
|
670
|
+
import React9 from "react";
|
|
825
671
|
var BlockMenuExpanded = /* @__PURE__ */ __name(({ block }) => {
|
|
826
672
|
const { anchorEl, anchorRef, open, handleClick, handleClose } = useAnchorElement();
|
|
827
|
-
return /* @__PURE__ */
|
|
673
|
+
return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(IconButton, {
|
|
828
674
|
ref: anchorRef,
|
|
829
675
|
size: "small",
|
|
830
676
|
onClick: handleClick
|
|
831
|
-
}, /* @__PURE__ */
|
|
677
|
+
}, /* @__PURE__ */ React9.createElement(MoreVert, {
|
|
832
678
|
fontSize: "inherit"
|
|
833
|
-
})), /* @__PURE__ */
|
|
679
|
+
})), /* @__PURE__ */ React9.createElement(Menu, {
|
|
834
680
|
open,
|
|
835
681
|
anchorEl,
|
|
836
682
|
anchorOrigin: {
|
|
@@ -838,11 +684,11 @@ var BlockMenuExpanded = /* @__PURE__ */ __name(({ block }) => {
|
|
|
838
684
|
vertical: "bottom"
|
|
839
685
|
},
|
|
840
686
|
onClose: handleClose
|
|
841
|
-
}, /* @__PURE__ */
|
|
687
|
+
}, /* @__PURE__ */ React9.createElement(BWPreviousHashMenuItem, {
|
|
842
688
|
boundwitness: block?.[0],
|
|
843
689
|
dense: true,
|
|
844
690
|
onDialogClose: handleClose
|
|
845
|
-
}), /* @__PURE__ */
|
|
691
|
+
}), /* @__PURE__ */ React9.createElement(BWJsonMenuItem, {
|
|
846
692
|
boundwitness: block?.[0],
|
|
847
693
|
dense: true,
|
|
848
694
|
onDialogClose: handleClose
|
|
@@ -851,15 +697,15 @@ var BlockMenuExpanded = /* @__PURE__ */ __name(({ block }) => {
|
|
|
851
697
|
|
|
852
698
|
// src/components/block/ProducerChip.tsx
|
|
853
699
|
import { Chip as Chip2 } from "@mui/material";
|
|
854
|
-
import { EthAddressWrapper, isString, isUndefined
|
|
700
|
+
import { EthAddressWrapper, isString, isUndefined, toAddress } from "@xylabs/sdk-js";
|
|
855
701
|
import { BlockiesAvatar } from "@xyo-network/react-chain-blockies";
|
|
856
|
-
import
|
|
702
|
+
import React11, { useMemo as useMemo6 } from "react";
|
|
857
703
|
|
|
858
704
|
// src/components/block/ChipSkeleton.tsx
|
|
859
705
|
import { Skeleton } from "@mui/material";
|
|
860
|
-
import
|
|
706
|
+
import React10 from "react";
|
|
861
707
|
var ChipSkeleton = /* @__PURE__ */ __name((props) => {
|
|
862
|
-
return /* @__PURE__ */
|
|
708
|
+
return /* @__PURE__ */ React10.createElement(Skeleton, {
|
|
863
709
|
width: 100,
|
|
864
710
|
...props
|
|
865
711
|
});
|
|
@@ -867,13 +713,13 @@ var ChipSkeleton = /* @__PURE__ */ __name((props) => {
|
|
|
867
713
|
|
|
868
714
|
// src/components/block/ProducerChip.tsx
|
|
869
715
|
var formatProducerAddress = /* @__PURE__ */ __name((address) => {
|
|
870
|
-
if (
|
|
716
|
+
if (isUndefined(address) || !isString(address)) return void 0;
|
|
871
717
|
const formattedAddress = toAddress(address);
|
|
872
718
|
return EthAddressWrapper.parse(formattedAddress)?.toShortString(4);
|
|
873
719
|
}, "formatProducerAddress");
|
|
874
720
|
var BlockProducerChip = /* @__PURE__ */ __name(({ block, ...props }) => {
|
|
875
721
|
const blockProducer2 = block?.[0].addresses[0];
|
|
876
|
-
return /* @__PURE__ */
|
|
722
|
+
return /* @__PURE__ */ React11.createElement(BlockAddressChip, {
|
|
877
723
|
address: blockProducer2,
|
|
878
724
|
toolTipTitle: `Block producer: ${blockProducer2}`,
|
|
879
725
|
...props
|
|
@@ -881,16 +727,16 @@ var BlockProducerChip = /* @__PURE__ */ __name(({ block, ...props }) => {
|
|
|
881
727
|
}, "BlockProducerChip");
|
|
882
728
|
var BlockAddressChip = /* @__PURE__ */ __name(({ address, sx, toolTipTitle, ...props }) => {
|
|
883
729
|
const shortedBlockProducer = address === void 0 ? null : formatProducerAddress(address);
|
|
884
|
-
const avatar =
|
|
730
|
+
const avatar = useMemo6(() => address === "" ? void 0 : /* @__PURE__ */ React11.createElement(BlockiesAvatar, {
|
|
885
731
|
blockiesOptions: {
|
|
886
732
|
seed: address
|
|
887
733
|
}
|
|
888
734
|
}), [
|
|
889
735
|
address
|
|
890
736
|
]);
|
|
891
|
-
return /* @__PURE__ */
|
|
737
|
+
return /* @__PURE__ */ React11.createElement(Chip2, {
|
|
892
738
|
avatar,
|
|
893
|
-
label: shortedBlockProducer ?? /* @__PURE__ */
|
|
739
|
+
label: shortedBlockProducer ?? /* @__PURE__ */ React11.createElement(ChipSkeleton, {
|
|
894
740
|
width: 115
|
|
895
741
|
}),
|
|
896
742
|
title: toolTipTitle,
|
|
@@ -913,12 +759,12 @@ var BlockHeadingFlexbox = /* @__PURE__ */ __name(({ block, defaultExpanded, tran
|
|
|
913
759
|
event.stopPropagation();
|
|
914
760
|
blockHeadingListener("transaction-count", "click", JSON.stringify(transactions2));
|
|
915
761
|
}, "handleTransactionCountClick");
|
|
916
|
-
return /* @__PURE__ */
|
|
762
|
+
return /* @__PURE__ */ React12.createElement(FlexCol2, {
|
|
917
763
|
className: "block-heading-flexbox",
|
|
918
764
|
alignItems: "stretch",
|
|
919
765
|
ref: blockHeadingRef,
|
|
920
766
|
onClick: /* @__PURE__ */ __name(() => blockHeadingListener("block-hash", "click", hash), "onClick")
|
|
921
|
-
}, /* @__PURE__ */
|
|
767
|
+
}, /* @__PURE__ */ React12.createElement(LinkedDivider, null), /* @__PURE__ */ React12.createElement(HashHeadingPaper, {
|
|
922
768
|
hash,
|
|
923
769
|
heading: block?.[0].block === void 0 ? "" : block?.[0].block.toString(),
|
|
924
770
|
paperProps: {
|
|
@@ -927,24 +773,24 @@ var BlockHeadingFlexbox = /* @__PURE__ */ __name(({ block, defaultExpanded, tran
|
|
|
927
773
|
width: "100%"
|
|
928
774
|
}
|
|
929
775
|
},
|
|
930
|
-
AdornmentEnd: /* @__PURE__ */
|
|
776
|
+
AdornmentEnd: /* @__PURE__ */ React12.createElement(FlexRow2, {
|
|
931
777
|
gap: 1
|
|
932
|
-
}, /* @__PURE__ */
|
|
778
|
+
}, /* @__PURE__ */ React12.createElement(BlockProducerChip, {
|
|
933
779
|
block
|
|
934
|
-
}), /* @__PURE__ */
|
|
780
|
+
}), /* @__PURE__ */ React12.createElement(TransactionCountChip, {
|
|
935
781
|
onClick: /* @__PURE__ */ __name((e) => handleTransactionCountClick(e, transactions ?? []), "onClick"),
|
|
936
782
|
transactions
|
|
937
|
-
}), /* @__PURE__ */
|
|
783
|
+
}), /* @__PURE__ */ React12.createElement(BWVerification, {
|
|
938
784
|
iconColors: true,
|
|
939
785
|
boundwitness: block?.[0]
|
|
940
|
-
}), /* @__PURE__ */
|
|
786
|
+
}), /* @__PURE__ */ React12.createElement("span", {
|
|
941
787
|
style: {
|
|
942
788
|
// maxWidth is required for css animation to work and 28px is the width of the icon button
|
|
943
789
|
display: "flex",
|
|
944
790
|
transition: "max-width .5s",
|
|
945
791
|
maxWidth: expanded ? "28px" : 0
|
|
946
792
|
}
|
|
947
|
-
}, /* @__PURE__ */
|
|
793
|
+
}, /* @__PURE__ */ React12.createElement(BlockMenuExpanded, {
|
|
948
794
|
block
|
|
949
795
|
}))),
|
|
950
796
|
identiconProps: {
|
|
@@ -957,10 +803,10 @@ var BlockHeadingFlexbox = /* @__PURE__ */ __name(({ block, defaultExpanded, tran
|
|
|
957
803
|
// src/components/block/table/cell/BlockNumber.tsx
|
|
958
804
|
import { Link, TableCell, Tooltip, Typography as Typography3 } from "@mui/material";
|
|
959
805
|
import { useEvent as useEvent2 } from "@xyo-network/react-event";
|
|
960
|
-
import
|
|
806
|
+
import React13 from "react";
|
|
961
807
|
var BlockNumberTableCell = /* @__PURE__ */ __name(({ block, linked, ...props }) => {
|
|
962
808
|
const blockNumber = block?.[0].block;
|
|
963
|
-
return /* @__PURE__ */
|
|
809
|
+
return /* @__PURE__ */ React13.createElement(BlockNumberTableCellInner, {
|
|
964
810
|
blockNumber,
|
|
965
811
|
linked,
|
|
966
812
|
...props
|
|
@@ -969,15 +815,15 @@ var BlockNumberTableCell = /* @__PURE__ */ __name(({ block, linked, ...props })
|
|
|
969
815
|
var BlockNumberTableCellInner = /* @__PURE__ */ __name(({ blockNumber, linked, ...props }) => {
|
|
970
816
|
const [ref, dispatch] = useEvent2();
|
|
971
817
|
const handleClick = /* @__PURE__ */ __name(() => dispatch("block-number", "click", blockNumber?.toString() ?? ""), "handleClick");
|
|
972
|
-
return /* @__PURE__ */
|
|
818
|
+
return /* @__PURE__ */ React13.createElement(TableCell, {
|
|
973
819
|
ref,
|
|
974
820
|
...props
|
|
975
|
-
}, /* @__PURE__ */
|
|
821
|
+
}, /* @__PURE__ */ React13.createElement(Tooltip, {
|
|
976
822
|
title: `Block Number: ${blockNumber}`
|
|
977
|
-
}, /* @__PURE__ */
|
|
823
|
+
}, /* @__PURE__ */ React13.createElement(Typography3, {
|
|
978
824
|
component: "span",
|
|
979
825
|
variant: "body1"
|
|
980
|
-
}, linked ? /* @__PURE__ */
|
|
826
|
+
}, linked ? /* @__PURE__ */ React13.createElement(Link, {
|
|
981
827
|
onClick: handleClick,
|
|
982
828
|
sx: {
|
|
983
829
|
cursor: "pointer"
|
|
@@ -988,7 +834,7 @@ var BlockNumberTableCellInner = /* @__PURE__ */ __name(({ blockNumber, linked, .
|
|
|
988
834
|
// src/components/block/table/cell/Epoch.tsx
|
|
989
835
|
import { Skeleton as Skeleton2, TableCell as TableCell2, Tooltip as Tooltip2, Typography as Typography4 } from "@mui/material";
|
|
990
836
|
import { isDefined as isDefined3 } from "@xylabs/sdk-js";
|
|
991
|
-
import
|
|
837
|
+
import React14 from "react";
|
|
992
838
|
|
|
993
839
|
// src/components/block/table/cell/lib/timeFunctions.ts
|
|
994
840
|
var dateFormat = Intl.DateTimeFormat(globalThis.navigator.language ?? "en-US", {
|
|
@@ -1054,24 +900,24 @@ var BlockEpochTableCell = /* @__PURE__ */ __name(({ block, linked, ...props }) =
|
|
|
1054
900
|
const epoch = block?.[0]?.$epoch;
|
|
1055
901
|
const dateTime = dateFormat.format(epoch);
|
|
1056
902
|
const age = isDefined3(epoch) ? timeAgo(epoch) : void 0;
|
|
1057
|
-
return /* @__PURE__ */
|
|
903
|
+
return /* @__PURE__ */ React14.createElement(TableCell2, props, /* @__PURE__ */ React14.createElement(Tooltip2, {
|
|
1058
904
|
title: `Block Epoch: ${dateTime}`
|
|
1059
|
-
}, /* @__PURE__ */
|
|
905
|
+
}, /* @__PURE__ */ React14.createElement(Typography4, {
|
|
1060
906
|
component: "span",
|
|
1061
907
|
variant: "body1"
|
|
1062
|
-
}, age ?? /* @__PURE__ */
|
|
908
|
+
}, age ?? /* @__PURE__ */ React14.createElement(Skeleton2, {
|
|
1063
909
|
width: 115
|
|
1064
910
|
}))));
|
|
1065
911
|
}, "BlockEpochTableCell");
|
|
1066
912
|
var BlockEpochTableCellInner = /* @__PURE__ */ __name(({ epoch, linked, ...props }) => {
|
|
1067
913
|
const dateTime = dateFormat.format(epoch);
|
|
1068
914
|
const age = isDefined3(epoch) ? timeAgo(epoch) : void 0;
|
|
1069
|
-
return /* @__PURE__ */
|
|
915
|
+
return /* @__PURE__ */ React14.createElement(TableCell2, props, /* @__PURE__ */ React14.createElement(Tooltip2, {
|
|
1070
916
|
title: `Block Epoch: ${dateTime}`
|
|
1071
|
-
}, /* @__PURE__ */
|
|
917
|
+
}, /* @__PURE__ */ React14.createElement(Typography4, {
|
|
1072
918
|
component: "span",
|
|
1073
919
|
variant: "body1"
|
|
1074
|
-
}, age ?? /* @__PURE__ */
|
|
920
|
+
}, age ?? /* @__PURE__ */ React14.createElement(Skeleton2, {
|
|
1075
921
|
width: 115
|
|
1076
922
|
}))));
|
|
1077
923
|
}, "BlockEpochTableCellInner");
|
|
@@ -1080,12 +926,12 @@ var BlockEpochTableCellInner = /* @__PURE__ */ __name(({ epoch, linked, ...props
|
|
|
1080
926
|
import { Link as Link2, TableCell as TableCell3, Tooltip as Tooltip3 } from "@mui/material";
|
|
1081
927
|
import { isHash as isHash2 } from "@xylabs/sdk-js";
|
|
1082
928
|
import { usePayloadRootHash } from "@xyo-network/react-shared";
|
|
1083
|
-
import
|
|
929
|
+
import React16, { useState as useState7 } from "react";
|
|
1084
930
|
|
|
1085
931
|
// src/components/FeatureNotAvailable.tsx
|
|
1086
932
|
import { Button as Button2, Dialog, DialogActions, DialogContent, DialogTitle } from "@mui/material";
|
|
1087
|
-
import
|
|
1088
|
-
var FeatureNotAvailable = /* @__PURE__ */ __name(({ featureName = "Feature", ...props }) => /* @__PURE__ */
|
|
933
|
+
import React15 from "react";
|
|
934
|
+
var FeatureNotAvailable = /* @__PURE__ */ __name(({ featureName = "Feature", ...props }) => /* @__PURE__ */ React15.createElement(Dialog, props, /* @__PURE__ */ React15.createElement(DialogTitle, null, `${featureName} Not Available`), /* @__PURE__ */ React15.createElement(DialogContent, null, "This feature is not currently available. Either you do not have access to it or it is currently undergoing maintenance."), /* @__PURE__ */ React15.createElement(DialogActions, null, /* @__PURE__ */ React15.createElement(Button2, {
|
|
1089
935
|
onClick: /* @__PURE__ */ __name((e) => props.onClose?.(e, "backdropClick"), "onClick")
|
|
1090
936
|
}, "Close"))), "FeatureNotAvailable");
|
|
1091
937
|
|
|
@@ -1116,19 +962,19 @@ var useLinkedBlockItem = /* @__PURE__ */ __name((noun, data) => {
|
|
|
1116
962
|
var BlockHashTableCell = /* @__PURE__ */ __name(({ block, notAvailableDialog, linked, ...props }) => {
|
|
1117
963
|
const hash = usePayloadRootHash(block?.[0]);
|
|
1118
964
|
const [ref, handleClick] = useLinkedBlockItem("block-hash", hash);
|
|
1119
|
-
const [notAvailable, setNotAvailable] =
|
|
965
|
+
const [notAvailable, setNotAvailable] = useState7(false);
|
|
1120
966
|
const shortenedHash = isHash2(hash) ? `${hash.slice(0, 4)}...${hash.slice(-5, -1)}` : void 0;
|
|
1121
|
-
return /* @__PURE__ */
|
|
967
|
+
return /* @__PURE__ */ React16.createElement(TableCell3, {
|
|
1122
968
|
ref,
|
|
1123
969
|
...props
|
|
1124
|
-
}, /* @__PURE__ */
|
|
970
|
+
}, /* @__PURE__ */ React16.createElement(Tooltip3, {
|
|
1125
971
|
title: `Block Hash: ${hash}`
|
|
1126
|
-
}, linked ? /* @__PURE__ */
|
|
972
|
+
}, linked ? /* @__PURE__ */ React16.createElement(Link2, {
|
|
1127
973
|
sx: {
|
|
1128
974
|
cursor: "pointer"
|
|
1129
975
|
},
|
|
1130
976
|
onClick: linked ? handleClick : () => setNotAvailable(true)
|
|
1131
|
-
}, shortenedHash ?? /* @__PURE__ */
|
|
977
|
+
}, shortenedHash ?? /* @__PURE__ */ React16.createElement(ChipSkeleton, null)) : /* @__PURE__ */ React16.createElement("span", null, shortenedHash ?? /* @__PURE__ */ React16.createElement(ChipSkeleton, null))), notAvailableDialog && notAvailable ? /* @__PURE__ */ React16.createElement(FeatureNotAvailable, {
|
|
1132
978
|
featureName: "Block Details",
|
|
1133
979
|
open: notAvailable,
|
|
1134
980
|
onClick: /* @__PURE__ */ __name(() => setNotAvailable(false), "onClick")
|
|
@@ -1142,31 +988,31 @@ import { FlexRow as FlexRow3 } from "@xylabs/react-flexbox";
|
|
|
1142
988
|
import { ellipsize, isHash as isHash3 } from "@xylabs/sdk-js";
|
|
1143
989
|
import { JsonViewerEx } from "@xyo-network/react-payload-raw-info";
|
|
1144
990
|
import { usePayloadRootHash as usePayloadRootHash2 } from "@xyo-network/react-shared";
|
|
1145
|
-
import
|
|
991
|
+
import React17, { useState as useState8 } from "react";
|
|
1146
992
|
var BlockJsonViewTableCell = /* @__PURE__ */ __name(({ block, ...props }) => {
|
|
1147
|
-
const [open, setOpen] =
|
|
993
|
+
const [open, setOpen] = useState8(false);
|
|
1148
994
|
const onClose = /* @__PURE__ */ __name(() => setOpen(false), "onClose");
|
|
1149
995
|
const hash = usePayloadRootHash2(block?.[0]);
|
|
1150
996
|
const title = isHash3(hash) ? `JSON for ${ellipsize(hash, 5)}` : "JSON";
|
|
1151
|
-
return /* @__PURE__ */
|
|
997
|
+
return /* @__PURE__ */ React17.createElement(TableCell4, props, /* @__PURE__ */ React17.createElement(FlexRow3, {
|
|
1152
998
|
onClick: /* @__PURE__ */ __name((e) => e.stopPropagation(), "onClick"),
|
|
1153
999
|
sx: {
|
|
1154
1000
|
width: "100%"
|
|
1155
1001
|
}
|
|
1156
|
-
}, /* @__PURE__ */
|
|
1002
|
+
}, /* @__PURE__ */ React17.createElement(IconButton2, {
|
|
1157
1003
|
onClick: /* @__PURE__ */ __name(() => setOpen(true), "onClick")
|
|
1158
|
-
}, /* @__PURE__ */
|
|
1004
|
+
}, /* @__PURE__ */ React17.createElement(DataObject, null)), /* @__PURE__ */ React17.createElement(Dialog2, {
|
|
1159
1005
|
open,
|
|
1160
1006
|
onClose
|
|
1161
|
-
}, /* @__PURE__ */
|
|
1007
|
+
}, /* @__PURE__ */ React17.createElement(DialogTitle2, null, title), /* @__PURE__ */ React17.createElement(DialogContent2, null, /* @__PURE__ */ React17.createElement(JsonViewerEx, {
|
|
1162
1008
|
value: block
|
|
1163
|
-
})), /* @__PURE__ */
|
|
1009
|
+
})), /* @__PURE__ */ React17.createElement(DialogActions2, {
|
|
1164
1010
|
sx: {
|
|
1165
1011
|
display: "flex",
|
|
1166
1012
|
flexDirection: "row",
|
|
1167
1013
|
justifyContent: "end"
|
|
1168
1014
|
}
|
|
1169
|
-
}, /* @__PURE__ */
|
|
1015
|
+
}, /* @__PURE__ */ React17.createElement(Button3, {
|
|
1170
1016
|
variant: "contained",
|
|
1171
1017
|
onClick: onClose
|
|
1172
1018
|
}, "Close")))));
|
|
@@ -1175,7 +1021,7 @@ var BlockJsonViewTableCell = /* @__PURE__ */ __name(({ block, ...props }) => {
|
|
|
1175
1021
|
// src/components/block/table/cell/PayloadCounts.tsx
|
|
1176
1022
|
import { Error as Error2 } from "@mui/icons-material";
|
|
1177
1023
|
import { Link as Link3, TableCell as TableCell5, Tooltip as Tooltip4 } from "@mui/material";
|
|
1178
|
-
import
|
|
1024
|
+
import React18 from "react";
|
|
1179
1025
|
var BlockPayloadCountsTableCell = /* @__PURE__ */ __name(({ block, linked, ...props }) => {
|
|
1180
1026
|
const [publicPayloads, privatePayloads, error] = usePayloadCountsFromBlock(block);
|
|
1181
1027
|
const data = block && privatePayloads !== void 0 && publicPayloads !== void 0 ? {
|
|
@@ -1185,32 +1031,32 @@ var BlockPayloadCountsTableCell = /* @__PURE__ */ __name(({ block, linked, ...pr
|
|
|
1185
1031
|
} : void 0;
|
|
1186
1032
|
const payloadCount = (publicPayloads ?? 0) + (privatePayloads ?? 0);
|
|
1187
1033
|
const [ref, handleClick] = useLinkedBlockItem("payload-counts", data);
|
|
1188
|
-
return /* @__PURE__ */
|
|
1034
|
+
return /* @__PURE__ */ React18.createElement(TableCell5, {
|
|
1189
1035
|
ref,
|
|
1190
1036
|
...props
|
|
1191
|
-
}, /* @__PURE__ */
|
|
1037
|
+
}, /* @__PURE__ */ React18.createElement("span", null, error ? /* @__PURE__ */ React18.createElement(Tooltip4, {
|
|
1192
1038
|
title: error.message
|
|
1193
|
-
}, /* @__PURE__ */
|
|
1039
|
+
}, /* @__PURE__ */ React18.createElement(Error2, {
|
|
1194
1040
|
color: "error"
|
|
1195
|
-
})) : null, linked ? /* @__PURE__ */
|
|
1041
|
+
})) : null, linked ? /* @__PURE__ */ React18.createElement(Tooltip4, {
|
|
1196
1042
|
title: `Public Payloads: ${publicPayloads ?? "--"} Private Payloads: ${privatePayloads ?? "--"}`
|
|
1197
|
-
}, /* @__PURE__ */
|
|
1043
|
+
}, /* @__PURE__ */ React18.createElement(Link3, {
|
|
1198
1044
|
onClick: handleClick,
|
|
1199
1045
|
sx: {
|
|
1200
1046
|
cursor: "pointer"
|
|
1201
1047
|
}
|
|
1202
|
-
}, payloadCount)) : /* @__PURE__ */
|
|
1048
|
+
}, payloadCount)) : /* @__PURE__ */ React18.createElement(Tooltip4, {
|
|
1203
1049
|
title: `Public Payloads: ${publicPayloads ?? "--"} Private Payloads: ${privatePayloads ?? "--"}`
|
|
1204
|
-
}, /* @__PURE__ */
|
|
1050
|
+
}, /* @__PURE__ */ React18.createElement("span", null, payloadCount))));
|
|
1205
1051
|
}, "BlockPayloadCountsTableCell");
|
|
1206
1052
|
|
|
1207
1053
|
// src/components/block/table/cell/Producer.tsx
|
|
1208
1054
|
import { TableCell as TableCell6, Tooltip as Tooltip5 } from "@mui/material";
|
|
1209
|
-
import
|
|
1055
|
+
import React19, { useState as useState9 } from "react";
|
|
1210
1056
|
var BlockProducerTableCell = /* @__PURE__ */ __name(({ block, linked, notAvailableDialog, producerChipProps, ...props }) => {
|
|
1211
1057
|
const [ref, handleClick] = useLinkedBlockItem("block-producer", JSON.stringify(block));
|
|
1212
1058
|
const producer = useBlockProducer(block);
|
|
1213
|
-
return /* @__PURE__ */
|
|
1059
|
+
return /* @__PURE__ */ React19.createElement(BlockProducerTableCellInner, {
|
|
1214
1060
|
address: producer,
|
|
1215
1061
|
handleClick,
|
|
1216
1062
|
linked,
|
|
@@ -1221,10 +1067,10 @@ var BlockProducerTableCell = /* @__PURE__ */ __name(({ block, linked, notAvailab
|
|
|
1221
1067
|
});
|
|
1222
1068
|
}, "BlockProducerTableCell");
|
|
1223
1069
|
var BlockProducerTableCellInner = /* @__PURE__ */ __name(({ address, handleClick, linked, notAvailableDialog, producerChipProps, ...props }) => {
|
|
1224
|
-
const [notAvailable, setNotAvailable] =
|
|
1225
|
-
return /* @__PURE__ */
|
|
1070
|
+
const [notAvailable, setNotAvailable] = useState9(false);
|
|
1071
|
+
return /* @__PURE__ */ React19.createElement(TableCell6, props, /* @__PURE__ */ React19.createElement(Tooltip5, {
|
|
1226
1072
|
title: `Block Producer: ${address}`
|
|
1227
|
-
}, /* @__PURE__ */
|
|
1073
|
+
}, /* @__PURE__ */ React19.createElement(BlockAddressChip, {
|
|
1228
1074
|
sx: {
|
|
1229
1075
|
cursor: "pointer"
|
|
1230
1076
|
},
|
|
@@ -1232,7 +1078,7 @@ var BlockProducerTableCellInner = /* @__PURE__ */ __name(({ address, handleClick
|
|
|
1232
1078
|
address,
|
|
1233
1079
|
toolTipTitle: `Block Producer: ${address}`,
|
|
1234
1080
|
...producerChipProps
|
|
1235
|
-
})), notAvailableDialog && notAvailable ? /* @__PURE__ */
|
|
1081
|
+
})), notAvailableDialog && notAvailable ? /* @__PURE__ */ React19.createElement(FeatureNotAvailable, {
|
|
1236
1082
|
featureName: "Producer Details",
|
|
1237
1083
|
open: notAvailable,
|
|
1238
1084
|
onClick: /* @__PURE__ */ __name(() => setNotAvailable(false), "onClick")
|
|
@@ -1242,10 +1088,10 @@ var BlockProducerTableCellInner = /* @__PURE__ */ __name(({ address, handleClick
|
|
|
1242
1088
|
// src/components/block/table/cell/TransactionCount.tsx
|
|
1243
1089
|
import { Error as Error3 } from "@mui/icons-material";
|
|
1244
1090
|
import { Link as Link4, TableCell as TableCell7, Tooltip as Tooltip6 } from "@mui/material";
|
|
1245
|
-
import
|
|
1091
|
+
import React20, { useMemo as useMemo7 } from "react";
|
|
1246
1092
|
var BlockTransactionCountTableCell = /* @__PURE__ */ __name(({ block, linked, ...props }) => {
|
|
1247
1093
|
const [transactions, error] = useTxsFromBlock(block);
|
|
1248
|
-
const txHashes =
|
|
1094
|
+
const txHashes = useMemo7(() => transactions?.map(([, hash]) => hash), [
|
|
1249
1095
|
transactions
|
|
1250
1096
|
]);
|
|
1251
1097
|
const data = block && transactions !== void 0 ? {
|
|
@@ -1253,14 +1099,14 @@ var BlockTransactionCountTableCell = /* @__PURE__ */ __name(({ block, linked, ..
|
|
|
1253
1099
|
block: block[0]._hash
|
|
1254
1100
|
} : void 0;
|
|
1255
1101
|
const [ref, handleClick] = useLinkedBlockItem("transaction-count", data);
|
|
1256
|
-
return /* @__PURE__ */
|
|
1102
|
+
return /* @__PURE__ */ React20.createElement(TableCell7, {
|
|
1257
1103
|
ref,
|
|
1258
1104
|
...props
|
|
1259
|
-
}, /* @__PURE__ */
|
|
1105
|
+
}, /* @__PURE__ */ React20.createElement("span", null, error ? /* @__PURE__ */ React20.createElement(Tooltip6, {
|
|
1260
1106
|
title: error.message
|
|
1261
|
-
}, /* @__PURE__ */
|
|
1107
|
+
}, /* @__PURE__ */ React20.createElement(Error3, {
|
|
1262
1108
|
color: "error"
|
|
1263
|
-
})) : null, linked ? /* @__PURE__ */
|
|
1109
|
+
})) : null, linked ? /* @__PURE__ */ React20.createElement(Link4, {
|
|
1264
1110
|
onClick: handleClick,
|
|
1265
1111
|
sx: {
|
|
1266
1112
|
cursor: "pointer"
|
|
@@ -1273,17 +1119,17 @@ import { CheckCircleOutlineRounded } from "@mui/icons-material";
|
|
|
1273
1119
|
import { TableCell as TableCell8 } from "@mui/material";
|
|
1274
1120
|
import { FlexRow as FlexRow4 } from "@xylabs/react-flexbox";
|
|
1275
1121
|
import { BWVerification as BWVerification2 } from "@xyo-network/react-boundwitness-plugin";
|
|
1276
|
-
import
|
|
1122
|
+
import React21 from "react";
|
|
1277
1123
|
var BlockVerificationTableCell = /* @__PURE__ */ __name(({ block, linked, deepValidation, ...props }) => {
|
|
1278
|
-
return /* @__PURE__ */
|
|
1124
|
+
return /* @__PURE__ */ React21.createElement(TableCell8, props, /* @__PURE__ */ React21.createElement(FlexRow4, {
|
|
1279
1125
|
onClick: /* @__PURE__ */ __name((e) => e.stopPropagation(), "onClick"),
|
|
1280
1126
|
sx: {
|
|
1281
1127
|
width: "100%"
|
|
1282
1128
|
}
|
|
1283
|
-
}, deepValidation ? /* @__PURE__ */
|
|
1129
|
+
}, deepValidation ? /* @__PURE__ */ React21.createElement(BWVerification2, {
|
|
1284
1130
|
iconColors: true,
|
|
1285
1131
|
boundwitness: block?.[0]
|
|
1286
|
-
}) : /* @__PURE__ */
|
|
1132
|
+
}) : /* @__PURE__ */ React21.createElement(CheckCircleOutlineRounded, {
|
|
1287
1133
|
color: "success"
|
|
1288
1134
|
})));
|
|
1289
1135
|
}, "BlockVerificationTableCell");
|
|
@@ -1291,57 +1137,57 @@ var BlockVerificationTableCell = /* @__PURE__ */ __name(({ block, linked, deepVa
|
|
|
1291
1137
|
// src/components/block/table/Ex.tsx
|
|
1292
1138
|
import { TableBody } from "@mui/material";
|
|
1293
1139
|
import { TableEx } from "@xyo-network/react-table";
|
|
1294
|
-
import
|
|
1140
|
+
import React23 from "react";
|
|
1295
1141
|
|
|
1296
1142
|
// src/components/block/table/head/TableHead.tsx
|
|
1297
1143
|
import { InfoOutline } from "@mui/icons-material";
|
|
1298
1144
|
import { TableCell as TableCell9, TableHead, TableRow, Tooltip as Tooltip7, Typography as Typography5 } from "@mui/material";
|
|
1299
1145
|
import { FlexRow as FlexRow5 } from "@xylabs/react-flexbox";
|
|
1300
|
-
import
|
|
1146
|
+
import React22 from "react";
|
|
1301
1147
|
var ToolTipTableCell = /* @__PURE__ */ __name(({ children, align, title, ...props }) => {
|
|
1302
|
-
return /* @__PURE__ */
|
|
1148
|
+
return /* @__PURE__ */ React22.createElement(TableCell9, {
|
|
1303
1149
|
title,
|
|
1304
1150
|
...props
|
|
1305
|
-
}, /* @__PURE__ */
|
|
1151
|
+
}, /* @__PURE__ */ React22.createElement(FlexRow5, {
|
|
1306
1152
|
justifyContent: align
|
|
1307
|
-
}, /* @__PURE__ */
|
|
1153
|
+
}, /* @__PURE__ */ React22.createElement(Typography5, {
|
|
1308
1154
|
variant: "body2"
|
|
1309
|
-
}, children), "\xA0", /* @__PURE__ */
|
|
1155
|
+
}, children), "\xA0", /* @__PURE__ */ React22.createElement(Tooltip7, {
|
|
1310
1156
|
title
|
|
1311
|
-
}, /* @__PURE__ */
|
|
1157
|
+
}, /* @__PURE__ */ React22.createElement(InfoOutline, {
|
|
1312
1158
|
fontSize: "small"
|
|
1313
1159
|
}))));
|
|
1314
1160
|
}, "ToolTipTableCell");
|
|
1315
1161
|
var BlockchainTableHead = /* @__PURE__ */ __name(() => {
|
|
1316
|
-
return /* @__PURE__ */
|
|
1162
|
+
return /* @__PURE__ */ React22.createElement(TableHead, null, /* @__PURE__ */ React22.createElement(TableRow, null, /* @__PURE__ */ React22.createElement(ToolTipTableCell, {
|
|
1317
1163
|
align: "left",
|
|
1318
1164
|
title: "The block number that is included in the block"
|
|
1319
|
-
}, "Block"), /* @__PURE__ */
|
|
1165
|
+
}, "Block"), /* @__PURE__ */ React22.createElement(ToolTipTableCell, {
|
|
1320
1166
|
title: "The hash of the block",
|
|
1321
1167
|
sx: {
|
|
1322
1168
|
width: "20%"
|
|
1323
1169
|
}
|
|
1324
|
-
}, "Hash"), /* @__PURE__ */
|
|
1170
|
+
}, "Hash"), /* @__PURE__ */ React22.createElement(ToolTipTableCell, {
|
|
1325
1171
|
title: "The epoch of the block",
|
|
1326
1172
|
sx: {
|
|
1327
1173
|
width: "20%"
|
|
1328
1174
|
}
|
|
1329
|
-
}, "Epoch"), /* @__PURE__ */
|
|
1175
|
+
}, "Epoch"), /* @__PURE__ */ React22.createElement(ToolTipTableCell, {
|
|
1330
1176
|
align: "left",
|
|
1331
1177
|
title: "The address of the block producer that produced the block",
|
|
1332
1178
|
sx: {
|
|
1333
1179
|
width: "20%"
|
|
1334
1180
|
}
|
|
1335
|
-
}, "Block Producer"), /* @__PURE__ */
|
|
1181
|
+
}, "Block Producer"), /* @__PURE__ */ React22.createElement(ToolTipTableCell, {
|
|
1336
1182
|
align: "left",
|
|
1337
1183
|
title: "Count of transactions that are included in the block"
|
|
1338
|
-
}, "Transactions"), /* @__PURE__ */
|
|
1184
|
+
}, "Transactions"), /* @__PURE__ */ React22.createElement(ToolTipTableCell, {
|
|
1339
1185
|
align: "left",
|
|
1340
1186
|
title: "Count of public and private payload counts for the block"
|
|
1341
|
-
}, "Payloads"), /* @__PURE__ */
|
|
1187
|
+
}, "Payloads"), /* @__PURE__ */ React22.createElement(ToolTipTableCell, {
|
|
1342
1188
|
align: "center",
|
|
1343
1189
|
title: "The result of the local validation check for the block"
|
|
1344
|
-
}, "Valid"), /* @__PURE__ */
|
|
1190
|
+
}, "Valid"), /* @__PURE__ */ React22.createElement(ToolTipTableCell, {
|
|
1345
1191
|
align: "center",
|
|
1346
1192
|
title: "Link to display the raw JSON of the block"
|
|
1347
1193
|
}, "JSON")));
|
|
@@ -1349,10 +1195,10 @@ var BlockchainTableHead = /* @__PURE__ */ __name(() => {
|
|
|
1349
1195
|
|
|
1350
1196
|
// src/components/block/table/Ex.tsx
|
|
1351
1197
|
var BlockchainTableEx = /* @__PURE__ */ __name(({ ref, children, ...props }) => {
|
|
1352
|
-
return /* @__PURE__ */
|
|
1198
|
+
return /* @__PURE__ */ React23.createElement(TableEx, {
|
|
1353
1199
|
ref,
|
|
1354
1200
|
...props
|
|
1355
|
-
}, /* @__PURE__ */
|
|
1201
|
+
}, /* @__PURE__ */ React23.createElement(BlockchainTableHead, null), /* @__PURE__ */ React23.createElement(TableBody, null, children));
|
|
1356
1202
|
}, "BlockchainTableEx");
|
|
1357
1203
|
BlockchainTableEx.displayName = "BlockchainTableEx";
|
|
1358
1204
|
|
|
@@ -1360,16 +1206,16 @@ BlockchainTableEx.displayName = "BlockchainTableEx";
|
|
|
1360
1206
|
import { TableRow as TableRow2, useTheme } from "@mui/material";
|
|
1361
1207
|
import { alphaCss } from "@xylabs/react-theme";
|
|
1362
1208
|
import { usePayloadRootHash as usePayloadRootHash3 } from "@xyo-network/react-shared";
|
|
1363
|
-
import
|
|
1209
|
+
import React24, { useMemo as useMemo8 } from "react";
|
|
1364
1210
|
var BlockChainTableRow = /* @__PURE__ */ __name(({ block, deepValidation, defaultExpanded, linked, sx, ...props }) => {
|
|
1365
|
-
const linkedTableCellProps =
|
|
1211
|
+
const linkedTableCellProps = useMemo8(() => ({
|
|
1366
1212
|
block,
|
|
1367
1213
|
linked
|
|
1368
1214
|
}), [
|
|
1369
1215
|
block,
|
|
1370
1216
|
linked
|
|
1371
1217
|
]);
|
|
1372
|
-
const defaultTableCellProps =
|
|
1218
|
+
const defaultTableCellProps = useMemo8(() => ({
|
|
1373
1219
|
block
|
|
1374
1220
|
}), [
|
|
1375
1221
|
block
|
|
@@ -1377,7 +1223,7 @@ var BlockChainTableRow = /* @__PURE__ */ __name(({ block, deepValidation, defaul
|
|
|
1377
1223
|
const hash = usePayloadRootHash3(block?.[0]);
|
|
1378
1224
|
const [ref, handleClick] = useLinkedBlockItem("block-hash", hash);
|
|
1379
1225
|
const theme = useTheme();
|
|
1380
|
-
return /* @__PURE__ */
|
|
1226
|
+
return /* @__PURE__ */ React24.createElement(TableRow2, {
|
|
1381
1227
|
onClick: linked ? handleClick : void 0,
|
|
1382
1228
|
ref,
|
|
1383
1229
|
sx: {
|
|
@@ -1389,47 +1235,47 @@ var BlockChainTableRow = /* @__PURE__ */ __name(({ block, deepValidation, defaul
|
|
|
1389
1235
|
...sx
|
|
1390
1236
|
},
|
|
1391
1237
|
...props
|
|
1392
|
-
}, /* @__PURE__ */
|
|
1238
|
+
}, /* @__PURE__ */ React24.createElement(BlockNumberTableCell, {
|
|
1393
1239
|
align: "left",
|
|
1394
1240
|
...linkedTableCellProps
|
|
1395
|
-
}), /* @__PURE__ */
|
|
1241
|
+
}), /* @__PURE__ */ React24.createElement(BlockHashTableCell, {
|
|
1396
1242
|
align: "left",
|
|
1397
1243
|
...linkedTableCellProps
|
|
1398
|
-
}), /* @__PURE__ */
|
|
1244
|
+
}), /* @__PURE__ */ React24.createElement(BlockEpochTableCell, {
|
|
1399
1245
|
align: "left",
|
|
1400
1246
|
...linkedTableCellProps
|
|
1401
|
-
}), /* @__PURE__ */
|
|
1247
|
+
}), /* @__PURE__ */ React24.createElement(BlockProducerTableCell, {
|
|
1402
1248
|
align: "left",
|
|
1403
1249
|
...linkedTableCellProps
|
|
1404
|
-
}), /* @__PURE__ */
|
|
1250
|
+
}), /* @__PURE__ */ React24.createElement(BlockTransactionCountTableCell, {
|
|
1405
1251
|
align: "left",
|
|
1406
1252
|
...linkedTableCellProps
|
|
1407
|
-
}), /* @__PURE__ */
|
|
1253
|
+
}), /* @__PURE__ */ React24.createElement(BlockPayloadCountsTableCell, {
|
|
1408
1254
|
align: "left",
|
|
1409
1255
|
...linkedTableCellProps
|
|
1410
|
-
}), /* @__PURE__ */
|
|
1256
|
+
}), /* @__PURE__ */ React24.createElement(BlockVerificationTableCell, {
|
|
1411
1257
|
deepValidation,
|
|
1412
1258
|
...defaultTableCellProps
|
|
1413
|
-
}), /* @__PURE__ */
|
|
1259
|
+
}), /* @__PURE__ */ React24.createElement(BlockJsonViewTableCell, defaultTableCellProps));
|
|
1414
1260
|
}, "BlockChainTableRow");
|
|
1415
1261
|
|
|
1416
1262
|
// src/components/account/table/cell/AddressTableCell.tsx
|
|
1417
1263
|
import { TableCell as TableCell10, Tooltip as Tooltip8 } from "@mui/material";
|
|
1418
1264
|
import { useEvent as useEvent4 } from "@xyo-network/react-event";
|
|
1419
|
-
import
|
|
1265
|
+
import React25 from "react";
|
|
1420
1266
|
var AddressTableCell = /* @__PURE__ */ __name(({ address, linked, toolTipTitle, sx, ...props }) => {
|
|
1421
1267
|
const [ref, dispatch] = useEvent4();
|
|
1422
1268
|
const handleClick = /* @__PURE__ */ __name(() => dispatch("address", "click", address), "handleClick");
|
|
1423
|
-
return /* @__PURE__ */
|
|
1269
|
+
return /* @__PURE__ */ React25.createElement(TableCell10, {
|
|
1424
1270
|
ref,
|
|
1425
1271
|
sx: {
|
|
1426
1272
|
cursor: linked ? "pointer" : "default",
|
|
1427
1273
|
...sx
|
|
1428
1274
|
},
|
|
1429
1275
|
...props
|
|
1430
|
-
}, /* @__PURE__ */
|
|
1276
|
+
}, /* @__PURE__ */ React25.createElement(Tooltip8, {
|
|
1431
1277
|
title: toolTipTitle
|
|
1432
|
-
}, /* @__PURE__ */
|
|
1278
|
+
}, /* @__PURE__ */ React25.createElement(BlockAddressChip, {
|
|
1433
1279
|
address,
|
|
1434
1280
|
onClick: handleClick
|
|
1435
1281
|
})));
|
|
@@ -1439,20 +1285,20 @@ var AddressTableCell = /* @__PURE__ */ __name(({ address, linked, toolTipTitle,
|
|
|
1439
1285
|
import { Link as Link5, TableCell as TableCell11, Tooltip as Tooltip9, Typography as Typography6 } from "@mui/material";
|
|
1440
1286
|
import { ellipsize as ellipsize2, isDefined as isDefined4 } from "@xylabs/sdk-js";
|
|
1441
1287
|
import { useEvent as useEvent5 } from "@xyo-network/react-event";
|
|
1442
|
-
import
|
|
1288
|
+
import React26 from "react";
|
|
1443
1289
|
var HashTableCell = /* @__PURE__ */ __name(({ hash, linked, toolTipTitle, sx, ...props }) => {
|
|
1444
1290
|
const [ref, dispatch] = useEvent5();
|
|
1445
1291
|
const handleClick = /* @__PURE__ */ __name(() => dispatch("tx-hash", "click", hash), "handleClick");
|
|
1446
1292
|
const shortenedHash = isDefined4(hash) ? ellipsize2(hash, 6) : "N/A";
|
|
1447
|
-
return /* @__PURE__ */
|
|
1293
|
+
return /* @__PURE__ */ React26.createElement(TableCell11, {
|
|
1448
1294
|
ref,
|
|
1449
1295
|
...props
|
|
1450
|
-
}, hash ? /* @__PURE__ */
|
|
1296
|
+
}, hash ? /* @__PURE__ */ React26.createElement(Tooltip9, {
|
|
1451
1297
|
title: toolTipTitle
|
|
1452
|
-
}, /* @__PURE__ */
|
|
1298
|
+
}, /* @__PURE__ */ React26.createElement(Typography6, {
|
|
1453
1299
|
component: "span",
|
|
1454
1300
|
variant: "body1"
|
|
1455
|
-
}, linked ? /* @__PURE__ */
|
|
1301
|
+
}, linked ? /* @__PURE__ */ React26.createElement(Link5, {
|
|
1456
1302
|
onClick: handleClick,
|
|
1457
1303
|
sx: {
|
|
1458
1304
|
cursor: "pointer"
|
|
@@ -1462,13 +1308,13 @@ var HashTableCell = /* @__PURE__ */ __name(({ hash, linked, toolTipTitle, sx, ..
|
|
|
1462
1308
|
|
|
1463
1309
|
// src/components/account/table/RawAmountTableCell.tsx
|
|
1464
1310
|
import { Link as Link6, TableCell as TableCell12, Tooltip as Tooltip10 } from "@mui/material";
|
|
1465
|
-
import { isDefined as isDefined5, toHex as
|
|
1311
|
+
import { isDefined as isDefined5, toHex as toHex2 } from "@xylabs/sdk-js";
|
|
1466
1312
|
import { useEvent as useEvent6 } from "@xyo-network/react-event";
|
|
1467
1313
|
import { XL1Amount as XL1Amount2 } from "@xyo-network/xl1-protocol";
|
|
1468
|
-
import
|
|
1314
|
+
import React27 from "react";
|
|
1469
1315
|
var RawAmountTableCell = /* @__PURE__ */ __name(({ amount, linked, sx, type, ...props }) => {
|
|
1470
1316
|
const [ref, dispatch] = useEvent6();
|
|
1471
|
-
const handleClick = /* @__PURE__ */ __name(() => dispatch("amount", "click", isDefined5(amount) ?
|
|
1317
|
+
const handleClick = /* @__PURE__ */ __name(() => dispatch("amount", "click", isDefined5(amount) ? toHex2(amount) : ""), "handleClick");
|
|
1472
1318
|
const formatAmount = /* @__PURE__ */ __name((amount2) => {
|
|
1473
1319
|
if (!isDefined5(amount2)) {
|
|
1474
1320
|
return "N/A";
|
|
@@ -1482,52 +1328,52 @@ var RawAmountTableCell = /* @__PURE__ */ __name(({ amount, linked, sx, type, ...
|
|
|
1482
1328
|
locale: navigator.language
|
|
1483
1329
|
});
|
|
1484
1330
|
}, "formatAmount");
|
|
1485
|
-
return /* @__PURE__ */
|
|
1331
|
+
return /* @__PURE__ */ React27.createElement(TableCell12, {
|
|
1486
1332
|
ref,
|
|
1487
1333
|
...props
|
|
1488
|
-
}, /* @__PURE__ */
|
|
1334
|
+
}, /* @__PURE__ */ React27.createElement(Tooltip10, {
|
|
1489
1335
|
title: `Raw Amount: ${amount}`
|
|
1490
|
-
}, linked ? /* @__PURE__ */
|
|
1336
|
+
}, linked ? /* @__PURE__ */ React27.createElement(Link6, {
|
|
1491
1337
|
onClick: handleClick,
|
|
1492
1338
|
sx: {
|
|
1493
1339
|
cursor: "pointer"
|
|
1494
1340
|
}
|
|
1495
|
-
}, type === "send" ? "-" : "", formatAmount(amount)) : /* @__PURE__ */
|
|
1341
|
+
}, type === "send" ? "-" : "", formatAmount(amount)) : /* @__PURE__ */ React27.createElement("span", null, type === "send" ? "-" : "", formatAmount(amount))));
|
|
1496
1342
|
}, "RawAmountTableCell");
|
|
1497
1343
|
|
|
1498
1344
|
// src/components/account/table/BalanceHistoryTableRow.tsx
|
|
1499
1345
|
var BalanceHistoryTableRow = /* @__PURE__ */ __name(({ linked, row, ...props }) => {
|
|
1500
1346
|
const { amount, blockNumber, debug, from, key, timestamp, to, type, txHash } = row ?? {};
|
|
1501
|
-
const linkedTableCallProps =
|
|
1347
|
+
const linkedTableCallProps = useMemo9(() => ({
|
|
1502
1348
|
linked
|
|
1503
1349
|
}), [
|
|
1504
1350
|
linked
|
|
1505
1351
|
]);
|
|
1506
|
-
return /* @__PURE__ */
|
|
1352
|
+
return /* @__PURE__ */ React28.createElement(TableRow3, {
|
|
1507
1353
|
key,
|
|
1508
1354
|
...props
|
|
1509
|
-
}, /* @__PURE__ */
|
|
1355
|
+
}, /* @__PURE__ */ React28.createElement(HashTableCell, {
|
|
1510
1356
|
hash: txHash,
|
|
1511
1357
|
toolTipTitle: `Transaction Hash: ${txHash}`,
|
|
1512
1358
|
...linkedTableCallProps
|
|
1513
|
-
}), /* @__PURE__ */
|
|
1359
|
+
}), /* @__PURE__ */ React28.createElement(BlockNumberTableCellInner, {
|
|
1514
1360
|
blockNumber,
|
|
1515
1361
|
...linkedTableCallProps
|
|
1516
|
-
}), /* @__PURE__ */
|
|
1362
|
+
}), /* @__PURE__ */ React28.createElement(BlockEpochTableCellInner, {
|
|
1517
1363
|
epoch: timestamp,
|
|
1518
1364
|
...linkedTableCallProps
|
|
1519
|
-
}), /* @__PURE__ */
|
|
1365
|
+
}), /* @__PURE__ */ React28.createElement(AddressTableCell, {
|
|
1520
1366
|
address: from,
|
|
1521
1367
|
toolTipTitle: `From Address: ${from}`,
|
|
1522
1368
|
...linkedTableCallProps
|
|
1523
|
-
}), /* @__PURE__ */
|
|
1369
|
+
}), /* @__PURE__ */ React28.createElement(AddressTableCell, {
|
|
1524
1370
|
address: to,
|
|
1525
1371
|
toolTipTitle: `To Address: ${to}`,
|
|
1526
1372
|
...linkedTableCallProps
|
|
1527
|
-
}), /* @__PURE__ */
|
|
1373
|
+
}), /* @__PURE__ */ React28.createElement(RawAmountTableCell, {
|
|
1528
1374
|
amount,
|
|
1529
1375
|
type
|
|
1530
|
-
}), /* @__PURE__ */
|
|
1376
|
+
}), /* @__PURE__ */ React28.createElement(TableCell13, null, /* @__PURE__ */ React28.createElement(RawInfoIconButton, {
|
|
1531
1377
|
rawValue: debug
|
|
1532
1378
|
})));
|
|
1533
1379
|
}, "BalanceHistoryTableRow");
|
|
@@ -1545,9 +1391,9 @@ var TableHeadingLabels = [
|
|
|
1545
1391
|
|
|
1546
1392
|
// src/components/account/table/BalanceHistoryTableEx.tsx
|
|
1547
1393
|
var AccountBalanceHistoryTableEx = /* @__PURE__ */ __name(({ history, linked, ...props }) => {
|
|
1548
|
-
return isDefined6(history) ? /* @__PURE__ */
|
|
1394
|
+
return isDefined6(history) ? /* @__PURE__ */ React29.createElement(TableEx2, props, /* @__PURE__ */ React29.createElement(TableHead2, null, /* @__PURE__ */ React29.createElement(TableRow4, null, TableHeadingLabels.map((heading) => /* @__PURE__ */ React29.createElement(TableCell14, {
|
|
1549
1395
|
key: heading
|
|
1550
|
-
}, heading)))), /* @__PURE__ */
|
|
1396
|
+
}, heading)))), /* @__PURE__ */ React29.createElement(TableBody2, null, history?.map((row) => /* @__PURE__ */ React29.createElement(BalanceHistoryTableRow, {
|
|
1551
1397
|
key: row.key,
|
|
1552
1398
|
linked,
|
|
1553
1399
|
row
|
|
@@ -1564,16 +1410,16 @@ var AccountBalanceHistoryFlexBox = /* @__PURE__ */ __name(({ address, refresh, v
|
|
|
1564
1410
|
],
|
|
1565
1411
|
history: void 0
|
|
1566
1412
|
};
|
|
1567
|
-
return isDefined7(history) && isDefined7(address) ? /* @__PURE__ */
|
|
1413
|
+
return isDefined7(history) && isDefined7(address) ? /* @__PURE__ */ React30.createElement(FlexCol3, props, /* @__PURE__ */ React30.createElement(ErrorRender3, {
|
|
1568
1414
|
error,
|
|
1569
1415
|
scope: "AccountBalanceHistoryTable"
|
|
1570
|
-
}), /* @__PURE__ */
|
|
1416
|
+
}), /* @__PURE__ */ React30.createElement(Typography7, {
|
|
1571
1417
|
variant: "h6",
|
|
1572
1418
|
gutterBottom: true
|
|
1573
|
-
}, formatBalanceMagnitude(balance)), truncated ? /* @__PURE__ */
|
|
1419
|
+
}, formatBalanceMagnitude(balance)), truncated ? /* @__PURE__ */ React30.createElement(Typography7, {
|
|
1574
1420
|
variant: "caption",
|
|
1575
1421
|
gutterBottom: true
|
|
1576
|
-
}, "Ranged Balance from", " ", history.at(-1).blockNumber, " ", "-", " ", history[0].blockNumber) : null, /* @__PURE__ */
|
|
1422
|
+
}, "Ranged Balance from", " ", history.at(-1).blockNumber, " ", "-", " ", history[0].blockNumber) : null, /* @__PURE__ */ React30.createElement(AccountBalanceHistoryTableEx, {
|
|
1577
1423
|
history
|
|
1578
1424
|
})) : null;
|
|
1579
1425
|
}, "AccountBalanceHistoryFlexBox");
|
|
@@ -1581,13 +1427,13 @@ var AccountBalanceHistoryFlexBox = /* @__PURE__ */ __name(({ address, refresh, v
|
|
|
1581
1427
|
// src/components/account/hooks/usePagedAccountBalanceHistory.ts
|
|
1582
1428
|
import { isDefined as isDefined8 } from "@xylabs/sdk-js";
|
|
1583
1429
|
import { useAccountBalanceHistory as useAccountBalanceHistory2 } from "@xyo-network/react-chain-provider";
|
|
1584
|
-
import { useCallback
|
|
1430
|
+
import { useCallback, useMemo as useMemo10, useState as useState10 } from "react";
|
|
1585
1431
|
var usePagedAccountBalanceHistory = /* @__PURE__ */ __name((address, viewer, maxPage = 1) => {
|
|
1586
|
-
const [updatedBlockRange, setUpdatedBlockRange] =
|
|
1587
|
-
const [pagedHistory, setPagedHistory] =
|
|
1432
|
+
const [updatedBlockRange, setUpdatedBlockRange] = useState10();
|
|
1433
|
+
const [pagedHistory, setPagedHistory] = useState10();
|
|
1588
1434
|
const [results, error, loading] = useAccountBalanceHistory2(address, viewer, maxPage, updatedBlockRange);
|
|
1589
1435
|
const { history, truncated } = results || {};
|
|
1590
|
-
|
|
1436
|
+
useMemo10(() => {
|
|
1591
1437
|
if (isDefined8(history)) {
|
|
1592
1438
|
setPagedHistory((pagedHistory2) => {
|
|
1593
1439
|
return [
|
|
@@ -1602,7 +1448,7 @@ var usePagedAccountBalanceHistory = /* @__PURE__ */ __name((address, viewer, max
|
|
|
1602
1448
|
const firstBlock = isDefined8(history) ? history.at(0)?.blockNumber : void 0;
|
|
1603
1449
|
const lastBlock = isDefined8(history) ? history.at(-1)?.blockNumber : void 0;
|
|
1604
1450
|
const historyComplete = isDefined8(history) && history.length === 0;
|
|
1605
|
-
const updateRange =
|
|
1451
|
+
const updateRange = useCallback(() => {
|
|
1606
1452
|
if (isDefined8(lastBlock) && lastBlock > 0 && truncated) {
|
|
1607
1453
|
const newEndBlock = lastBlock - 1;
|
|
1608
1454
|
setUpdatedBlockRange([
|
|
@@ -1628,29 +1474,29 @@ var usePagedAccountBalanceHistory = /* @__PURE__ */ __name((address, viewer, max
|
|
|
1628
1474
|
import { Autorenew, Pause } from "@mui/icons-material";
|
|
1629
1475
|
import { Alert as Alert3, AlertTitle as AlertTitle2, Grow, Icon as Icon2, IconButton as IconButton4, Tooltip as Tooltip11 } from "@mui/material";
|
|
1630
1476
|
import { FlexRow as FlexRow6 } from "@xylabs/react-flexbox";
|
|
1631
|
-
import
|
|
1477
|
+
import React35, { memo } from "react";
|
|
1632
1478
|
|
|
1633
1479
|
// src/components/chain/stats/Dialog.tsx
|
|
1634
1480
|
import { QueryStats } from "@mui/icons-material";
|
|
1635
1481
|
import { Dialog as Dialog3, DialogContent as DialogContent3, DialogTitle as DialogTitle3, IconButton as IconButton3 } from "@mui/material";
|
|
1636
|
-
import
|
|
1482
|
+
import React33, { useState as useState11 } from "react";
|
|
1637
1483
|
|
|
1638
1484
|
// src/components/chain/stats/producer/ProducerFlexbox.tsx
|
|
1639
1485
|
import { ListItem, styled, Typography as Typography8 } from "@mui/material";
|
|
1640
1486
|
import { ErrorRender as ErrorRender4 } from "@xylabs/react-error";
|
|
1641
1487
|
import { FlexCol as FlexCol4 } from "@xylabs/react-flexbox";
|
|
1642
1488
|
import { isChainSummaryProducers } from "@xyo-network/chain-analyze";
|
|
1643
|
-
import
|
|
1489
|
+
import React32, { useMemo as useMemo11 } from "react";
|
|
1644
1490
|
|
|
1645
1491
|
// src/components/chain/stats/producer/Table.tsx
|
|
1646
1492
|
import { Table, TableBody as TableBody3, TableCell as TableCell15, TableHead as TableHead3, TableRow as TableRow5, useTheme as useTheme2 } from "@mui/material";
|
|
1647
1493
|
import { BlockiesAvatar as BlockiesAvatar2 } from "@xyo-network/react-chain-blockies";
|
|
1648
|
-
import
|
|
1494
|
+
import React31 from "react";
|
|
1649
1495
|
var ChainProducerStatsTable = /* @__PURE__ */ __name(({ producers, ...props }) => {
|
|
1650
1496
|
const theme = useTheme2();
|
|
1651
|
-
return /* @__PURE__ */
|
|
1497
|
+
return /* @__PURE__ */ React31.createElement(Table, props, /* @__PURE__ */ React31.createElement(TableHead3, null, /* @__PURE__ */ React31.createElement(TableRow5, null, /* @__PURE__ */ React31.createElement(TableCell15, null, "Address"), /* @__PURE__ */ React31.createElement(TableCell15, null, "Blocks Produced"), /* @__PURE__ */ React31.createElement(TableCell15, null, "Rewards Earned Produced"))), /* @__PURE__ */ React31.createElement(TableBody3, null, producers?.map((producer) => /* @__PURE__ */ React31.createElement(TableRow5, {
|
|
1652
1498
|
key: producer.address
|
|
1653
|
-
}, /* @__PURE__ */
|
|
1499
|
+
}, /* @__PURE__ */ React31.createElement(TableCell15, null, /* @__PURE__ */ React31.createElement(BlockiesAvatar2, {
|
|
1654
1500
|
blockiesOptions: {
|
|
1655
1501
|
seed: producer.address
|
|
1656
1502
|
},
|
|
@@ -1658,12 +1504,12 @@ var ChainProducerStatsTable = /* @__PURE__ */ __name(({ producers, ...props }) =
|
|
|
1658
1504
|
height: theme.spacing(2.75),
|
|
1659
1505
|
width: theme.spacing(2.75)
|
|
1660
1506
|
}
|
|
1661
|
-
})), /* @__PURE__ */
|
|
1507
|
+
})), /* @__PURE__ */ React31.createElement(TableCell15, null, producer.blocksProduced.toString()), /* @__PURE__ */ React31.createElement(TableCell15, null, producer.rewardsEarned.toString())))));
|
|
1662
1508
|
}, "ChainProducerStatsTable");
|
|
1663
1509
|
|
|
1664
1510
|
// src/components/chain/stats/producer/ProducerFlexbox.tsx
|
|
1665
1511
|
var BlockProducerStatsFlexbox = /* @__PURE__ */ __name(({ payload, ...props }) => {
|
|
1666
|
-
const [producer, producerError] =
|
|
1512
|
+
const [producer, producerError] = useMemo11(() => {
|
|
1667
1513
|
if (payload) {
|
|
1668
1514
|
return isChainSummaryProducers(payload) ? [
|
|
1669
1515
|
payload
|
|
@@ -1677,19 +1523,19 @@ var BlockProducerStatsFlexbox = /* @__PURE__ */ __name(({ payload, ...props }) =
|
|
|
1677
1523
|
}, [
|
|
1678
1524
|
payload
|
|
1679
1525
|
]);
|
|
1680
|
-
const producersArray =
|
|
1526
|
+
const producersArray = useMemo11(() => Object.values(producer?.producers ?? {}), [
|
|
1681
1527
|
producer
|
|
1682
1528
|
]);
|
|
1683
|
-
return /* @__PURE__ */
|
|
1529
|
+
return /* @__PURE__ */ React32.createElement(FlexCol4, {
|
|
1684
1530
|
alignItems: "start",
|
|
1685
1531
|
gap: 1,
|
|
1686
1532
|
...props
|
|
1687
|
-
}, /* @__PURE__ */
|
|
1533
|
+
}, /* @__PURE__ */ React32.createElement(ErrorRender4, {
|
|
1688
1534
|
error: producerError,
|
|
1689
1535
|
scope: "BlockProducerStatsFlexbox"
|
|
1690
|
-
}), /* @__PURE__ */
|
|
1536
|
+
}), /* @__PURE__ */ React32.createElement(Typography8, {
|
|
1691
1537
|
fontSize: "1rem"
|
|
1692
|
-
}, "Block Producers"), /* @__PURE__ */
|
|
1538
|
+
}, "Block Producers"), /* @__PURE__ */ React32.createElement(ChainProducerStatsTable, {
|
|
1693
1539
|
producers: producersArray
|
|
1694
1540
|
}));
|
|
1695
1541
|
}, "BlockProducerStatsFlexbox");
|
|
@@ -1701,18 +1547,18 @@ var StyledListItem = styled(ListItem)(() => ({
|
|
|
1701
1547
|
// src/components/chain/stats/Dialog.tsx
|
|
1702
1548
|
var ChainAnalyzerStatsDialog = /* @__PURE__ */ __name((props) => {
|
|
1703
1549
|
const { analyzers, statsUpdated } = useChainAnalyzersContext();
|
|
1704
|
-
return /* @__PURE__ */
|
|
1550
|
+
return /* @__PURE__ */ React33.createElement(Dialog3, props, /* @__PURE__ */ React33.createElement(DialogTitle3, null, "Chain Analysis"), /* @__PURE__ */ React33.createElement(DialogContent3, null, statsUpdated > 0 ? Object.entries(analyzers).map(([id2, analyzer]) => /* @__PURE__ */ React33.createElement("div", {
|
|
1705
1551
|
key: id2
|
|
1706
|
-
}, id2 === "producers" ? /* @__PURE__ */
|
|
1552
|
+
}, id2 === "producers" ? /* @__PURE__ */ React33.createElement(BlockProducerStatsFlexbox, {
|
|
1707
1553
|
payload: analyzer.result()
|
|
1708
1554
|
}) : null)) : null));
|
|
1709
1555
|
}, "ChainAnalyzerStatsDialog");
|
|
1710
1556
|
var ChainAnalyzerStatsDialogFromContext = /* @__PURE__ */ __name((props) => {
|
|
1711
|
-
const [open, setOpen] =
|
|
1557
|
+
const [open, setOpen] = useState11(false);
|
|
1712
1558
|
const handleClose = /* @__PURE__ */ __name(() => setOpen(false), "handleClose");
|
|
1713
|
-
return /* @__PURE__ */
|
|
1559
|
+
return /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement(IconButton3, {
|
|
1714
1560
|
onClick: /* @__PURE__ */ __name(() => setOpen(true), "onClick")
|
|
1715
|
-
}, /* @__PURE__ */
|
|
1561
|
+
}, /* @__PURE__ */ React33.createElement(QueryStats, null)), /* @__PURE__ */ React33.createElement(ChainAnalyzerStatsDialog, {
|
|
1716
1562
|
onClose: handleClose,
|
|
1717
1563
|
open,
|
|
1718
1564
|
...props
|
|
@@ -1721,19 +1567,19 @@ var ChainAnalyzerStatsDialogFromContext = /* @__PURE__ */ __name((props) => {
|
|
|
1721
1567
|
|
|
1722
1568
|
// src/components/chain/controls/PulseSvgIcon.tsx
|
|
1723
1569
|
import { createSvgIcon, keyframes, styled as styled2 } from "@mui/material";
|
|
1724
|
-
import
|
|
1725
|
-
var PulseSvgIcon = createSvgIcon(/* @__PURE__ */
|
|
1570
|
+
import React34 from "react";
|
|
1571
|
+
var PulseSvgIcon = createSvgIcon(/* @__PURE__ */ React34.createElement("svg", {
|
|
1726
1572
|
viewBox: "0 0 80 80",
|
|
1727
1573
|
version: "1.1",
|
|
1728
1574
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1729
|
-
}, /* @__PURE__ */
|
|
1575
|
+
}, /* @__PURE__ */ React34.createElement("g", {
|
|
1730
1576
|
transform: "translate(34,34)"
|
|
1731
|
-
}, /* @__PURE__ */
|
|
1577
|
+
}, /* @__PURE__ */ React34.createElement("circle", {
|
|
1732
1578
|
className: "core",
|
|
1733
1579
|
cx: "0",
|
|
1734
1580
|
cy: "0",
|
|
1735
1581
|
r: "6"
|
|
1736
|
-
}), /* @__PURE__ */
|
|
1582
|
+
}), /* @__PURE__ */ React34.createElement("circle", {
|
|
1737
1583
|
className: "radar",
|
|
1738
1584
|
cx: "0",
|
|
1739
1585
|
cy: "0",
|
|
@@ -1797,24 +1643,24 @@ var StyledPulseSvgIcon = styled2(PulseSvgIcon)(({ theme }) => {
|
|
|
1797
1643
|
var PollingControlsFlexbox = /* @__PURE__ */ __name(({ blocksBehind, pollingState, setPollingState }) => {
|
|
1798
1644
|
const paused = pollingState === "paused";
|
|
1799
1645
|
const running = pollingState === "running";
|
|
1800
|
-
return /* @__PURE__ */
|
|
1646
|
+
return /* @__PURE__ */ React35.createElement(FlexRow6, {
|
|
1801
1647
|
justifyContent: "space-between",
|
|
1802
1648
|
width: "100%"
|
|
1803
|
-
}, /* @__PURE__ */
|
|
1649
|
+
}, /* @__PURE__ */ React35.createElement(FlexRow6, {
|
|
1804
1650
|
gap: 2
|
|
1805
|
-
}, running ? /* @__PURE__ */
|
|
1651
|
+
}, running ? /* @__PURE__ */ React35.createElement(IconButton4, {
|
|
1806
1652
|
onClick: /* @__PURE__ */ __name(() => setPollingState?.("paused"), "onClick"),
|
|
1807
1653
|
title: "Pause Block Stream"
|
|
1808
|
-
}, /* @__PURE__ */
|
|
1654
|
+
}, /* @__PURE__ */ React35.createElement(Pause, null)) : null, paused ? /* @__PURE__ */ React35.createElement(IconButton4, {
|
|
1809
1655
|
onClick: /* @__PURE__ */ __name(() => setPollingState?.("running"), "onClick"),
|
|
1810
1656
|
title: "Re-Sync Block Stream"
|
|
1811
|
-
}, /* @__PURE__ */
|
|
1657
|
+
}, /* @__PURE__ */ React35.createElement(Autorenew, null)) : null, /* @__PURE__ */ React35.createElement(ChainAnalyzerStatsDialogFromContext, null)), /* @__PURE__ */ React35.createElement(FlexRow6, {
|
|
1812
1658
|
gap: 2
|
|
1813
|
-
}, /* @__PURE__ */
|
|
1659
|
+
}, /* @__PURE__ */ React35.createElement(Grow, {
|
|
1814
1660
|
in: (blocksBehind ?? 0) > 0
|
|
1815
|
-
}, /* @__PURE__ */
|
|
1661
|
+
}, /* @__PURE__ */ React35.createElement(Tooltip11, {
|
|
1816
1662
|
title: "Click to Re-Sync"
|
|
1817
|
-
}, /* @__PURE__ */
|
|
1663
|
+
}, /* @__PURE__ */ React35.createElement(Alert3, {
|
|
1818
1664
|
sx: {
|
|
1819
1665
|
py: 0,
|
|
1820
1666
|
px: 1,
|
|
@@ -1822,11 +1668,11 @@ var PollingControlsFlexbox = /* @__PURE__ */ __name(({ blocksBehind, pollingStat
|
|
|
1822
1668
|
},
|
|
1823
1669
|
severity: "warning",
|
|
1824
1670
|
onClick: /* @__PURE__ */ __name(() => setPollingState?.("running"), "onClick")
|
|
1825
|
-
}, /* @__PURE__ */
|
|
1671
|
+
}, /* @__PURE__ */ React35.createElement(AlertTitle2, {
|
|
1826
1672
|
sx: {
|
|
1827
1673
|
mb: 0
|
|
1828
1674
|
}
|
|
1829
|
-
}, "Behind:", " ", blocksBehind)))), /* @__PURE__ */
|
|
1675
|
+
}, "Behind:", " ", blocksBehind)))), /* @__PURE__ */ React35.createElement(Icon2, null, /* @__PURE__ */ React35.createElement(StyledPulseSvgIcon, {
|
|
1830
1676
|
className: running ? "" : "paused"
|
|
1831
1677
|
}))));
|
|
1832
1678
|
}, "PollingControlsFlexbox");
|
|
@@ -1834,23 +1680,23 @@ var MemoizedPollingControlsFlexbox = /* @__PURE__ */ memo(PollingControlsFlexbox
|
|
|
1834
1680
|
|
|
1835
1681
|
// src/components/chain/dialog/Dialog.tsx
|
|
1836
1682
|
import { Button as Button4, Dialog as Dialog4, DialogActions as DialogActions3, DialogContent as DialogContent4 } from "@mui/material";
|
|
1837
|
-
import
|
|
1683
|
+
import React36 from "react";
|
|
1838
1684
|
var TransactionsDialog = /* @__PURE__ */ __name(({ onClose, ...props }) => {
|
|
1839
|
-
return /* @__PURE__ */
|
|
1685
|
+
return /* @__PURE__ */ React36.createElement(Dialog4, {
|
|
1840
1686
|
onClose,
|
|
1841
1687
|
...props
|
|
1842
|
-
}, /* @__PURE__ */
|
|
1688
|
+
}, /* @__PURE__ */ React36.createElement(DialogContent4, null, "Transactions Dialog"), /* @__PURE__ */ React36.createElement(DialogActions3, null, /* @__PURE__ */ React36.createElement(Button4, {
|
|
1843
1689
|
variant: "outlined",
|
|
1844
1690
|
onClick: /* @__PURE__ */ __name((e) => onClose?.(e, "escapeKeyDown"), "onClick")
|
|
1845
1691
|
}, "Close")));
|
|
1846
1692
|
}, "TransactionsDialog");
|
|
1847
1693
|
|
|
1848
1694
|
// src/components/chain/hooks/useOnBlock.ts
|
|
1849
|
-
import { useEffect
|
|
1695
|
+
import { useEffect, useRef as useRef2 } from "react";
|
|
1850
1696
|
var useOnBlock = /* @__PURE__ */ __name((initialHeadNumber, onAddBlock, liveHead, pollingState) => {
|
|
1851
1697
|
const blocksWhilePaused = useRef2([]);
|
|
1852
1698
|
const lastLiveHead = useRef2(liveHead);
|
|
1853
|
-
|
|
1699
|
+
useEffect(() => {
|
|
1854
1700
|
const lastLiveHeadBlock = lastLiveHead.current?.[0];
|
|
1855
1701
|
const blocksWhilePausedBlock = lastLiveHead.current?.[0];
|
|
1856
1702
|
const liveHeadBlock = liveHead?.[0];
|
|
@@ -1879,9 +1725,9 @@ var useOnBlock = /* @__PURE__ */ __name((initialHeadNumber, onAddBlock, liveHead
|
|
|
1879
1725
|
|
|
1880
1726
|
// src/components/chain/pagination/BlockChainPagination.tsx
|
|
1881
1727
|
import { TablePaginationActions } from "@xyo-network/react-payload-table";
|
|
1882
|
-
import
|
|
1728
|
+
import React37 from "react";
|
|
1883
1729
|
var BlockChainPagination = /* @__PURE__ */ __name(({ count = 0, onPageChange, page, rowsPerPage = 10 }) => {
|
|
1884
|
-
return /* @__PURE__ */
|
|
1730
|
+
return /* @__PURE__ */ React37.createElement(TablePaginationActions, {
|
|
1885
1731
|
count,
|
|
1886
1732
|
onPageChange,
|
|
1887
1733
|
page,
|
|
@@ -1890,10 +1736,10 @@ var BlockChainPagination = /* @__PURE__ */ __name(({ count = 0, onPageChange, pa
|
|
|
1890
1736
|
}, "BlockChainPagination");
|
|
1891
1737
|
|
|
1892
1738
|
// src/components/chain/pagination/hooks/usePagination.tsx
|
|
1893
|
-
import { useMemo as
|
|
1739
|
+
import { useMemo as useMemo12, useState as useState12 } from "react";
|
|
1894
1740
|
var useChainPagination = /* @__PURE__ */ __name((pageSize, blockComponents) => {
|
|
1895
|
-
const [page, setPage] =
|
|
1896
|
-
const paginatedBlockComponents =
|
|
1741
|
+
const [page, setPage] = useState12(0);
|
|
1742
|
+
const paginatedBlockComponents = useMemo12(() => {
|
|
1897
1743
|
const startIndex = page * pageSize;
|
|
1898
1744
|
const endIndex = startIndex + pageSize;
|
|
1899
1745
|
return blockComponents?.slice(startIndex, endIndex);
|
|
@@ -1912,15 +1758,6 @@ var useChainPagination = /* @__PURE__ */ __name((pageSize, blockComponents) => {
|
|
|
1912
1758
|
};
|
|
1913
1759
|
}, "useChainPagination");
|
|
1914
1760
|
|
|
1915
|
-
// src/components/chain/render/static/flexbox/variants/Base.tsx
|
|
1916
|
-
import { ErrorRender as ErrorRender5 } from "@xylabs/react-error";
|
|
1917
|
-
import { FlexCol as FlexCol6, FlexGrowRow as FlexGrowRow2 } from "@xylabs/react-flexbox";
|
|
1918
|
-
import React40 from "react";
|
|
1919
|
-
|
|
1920
|
-
// src/components/chain/list/Animated.tsx
|
|
1921
|
-
import { AnimatedList } from "@xylabs/react-animation";
|
|
1922
|
-
import React39 from "react";
|
|
1923
|
-
|
|
1924
1761
|
// src/components/chain/styled/BlockListWrapperFlexbox.tsx
|
|
1925
1762
|
import { styled as styled3 } from "@mui/material";
|
|
1926
1763
|
import { FlexCol as FlexCol5 } from "@xylabs/react-flexbox";
|
|
@@ -1938,117 +1775,22 @@ var BlockListWrapperFlexBox = styled3(FlexCol5, {
|
|
|
1938
1775
|
}
|
|
1939
1776
|
}));
|
|
1940
1777
|
|
|
1941
|
-
// src/components/chain/list/Animated.tsx
|
|
1942
|
-
var BlockListAnimated = /* @__PURE__ */ __name(({ blockChainRenderComponents }) => {
|
|
1943
|
-
return /* @__PURE__ */ React39.createElement(BlockListWrapperFlexBox, {
|
|
1944
|
-
alignItems: "stretch",
|
|
1945
|
-
width: "100%"
|
|
1946
|
-
}, /* @__PURE__ */ React39.createElement(AnimatedList, {
|
|
1947
|
-
fullWidth: true,
|
|
1948
|
-
items: blockChainRenderComponents
|
|
1949
|
-
}));
|
|
1950
|
-
}, "BlockListAnimated");
|
|
1951
|
-
|
|
1952
|
-
// src/components/chain/render/static/hooks/useStaticBlockRenderComponents.ts
|
|
1953
|
-
import { exists } from "@xylabs/sdk-js";
|
|
1954
|
-
import { useMemo as useMemo14 } from "react";
|
|
1955
|
-
var DEFAULT_PAGE_SIZE = 25;
|
|
1956
|
-
var useStaticBlockRenderComponents = /* @__PURE__ */ __name((BlockComponent, blockChainRenderProps) => {
|
|
1957
|
-
const { maxBlocks } = blockChainRenderProps ?? {};
|
|
1958
|
-
const pageSize = blockChainRenderProps?.pageSize ?? DEFAULT_PAGE_SIZE;
|
|
1959
|
-
const chainIteratorParams = useMemo14(() => blockChainRenderProps ?? {
|
|
1960
|
-
name: "unknown"
|
|
1961
|
-
}, [
|
|
1962
|
-
blockChainRenderProps
|
|
1963
|
-
]);
|
|
1964
|
-
const [params, paramsError] = useChainIteratorParams(chainIteratorParams);
|
|
1965
|
-
const [blocks, blocksError] = useIterateChain(params, maxBlocks);
|
|
1966
|
-
const { blockComponents, errors: blockComponentsError } = useStaticBlockComponents(BlockComponent, params, blocks);
|
|
1967
|
-
const { onPageChange, page, paginatedBlockComponents } = useChainPagination(pageSize, blockComponents);
|
|
1968
|
-
return {
|
|
1969
|
-
paginatedBlockComponents,
|
|
1970
|
-
blockComponents,
|
|
1971
|
-
errors: [
|
|
1972
|
-
paramsError,
|
|
1973
|
-
blocksError,
|
|
1974
|
-
blockComponentsError
|
|
1975
|
-
].filter(exists),
|
|
1976
|
-
onPageChange,
|
|
1977
|
-
page,
|
|
1978
|
-
pageSize
|
|
1979
|
-
};
|
|
1980
|
-
}, "useStaticBlockRenderComponents");
|
|
1981
|
-
|
|
1982
|
-
// src/components/chain/render/static/flexbox/variants/Base.tsx
|
|
1983
|
-
var StaticListBase = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props }) => {
|
|
1984
|
-
const { blockComponents, errors, paginatedBlockComponents, onPageChange, page, pageSize } = useStaticBlockRenderComponents(BlockHeadingFlexbox, blockChainRenderProps);
|
|
1985
|
-
return /* @__PURE__ */ React40.createElement(FlexCol6, {
|
|
1986
|
-
alignItems: "start",
|
|
1987
|
-
gap: 2,
|
|
1988
|
-
width: "100%",
|
|
1989
|
-
...props
|
|
1990
|
-
}, errors?.map((error) => /* @__PURE__ */ React40.createElement(ErrorRender5, {
|
|
1991
|
-
error,
|
|
1992
|
-
key: error.name,
|
|
1993
|
-
scope: "StaticBlockchainFlexboxInner"
|
|
1994
|
-
})), (paginatedBlockComponents?.length ?? 0) > 0 ? /* @__PURE__ */ React40.createElement(FlexGrowRow2, {
|
|
1995
|
-
justifyContent: "space-between",
|
|
1996
|
-
width: "100%"
|
|
1997
|
-
}, /* @__PURE__ */ React40.createElement(ChainAnalyzerStatsDialogFromContext, null), /* @__PURE__ */ React40.createElement(BlockChainPagination, {
|
|
1998
|
-
count: blockComponents?.length ?? 0,
|
|
1999
|
-
onPageChange,
|
|
2000
|
-
page,
|
|
2001
|
-
rowsPerPage: pageSize
|
|
2002
|
-
})) : null, /* @__PURE__ */ React40.createElement(BlockListAnimated, {
|
|
2003
|
-
blockChainRenderComponents: paginatedBlockComponents
|
|
2004
|
-
}));
|
|
2005
|
-
}, "StaticListBase");
|
|
2006
|
-
|
|
2007
|
-
// src/components/chain/render/static/flexbox/variants/WithAnalysis.tsx
|
|
2008
|
-
import { isAddress } from "@xylabs/sdk-js";
|
|
2009
|
-
import { ChainProducersAnalyzer } from "@xyo-network/chain-analyze";
|
|
2010
|
-
import React41, { useMemo as useMemo15 } from "react";
|
|
2011
|
-
var WithAnalysis = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props }) => {
|
|
2012
|
-
const { chainId } = blockChainRenderProps ?? {};
|
|
2013
|
-
const analyzers = useMemo15(() => {
|
|
2014
|
-
if (isAddress(chainId)) {
|
|
2015
|
-
return {
|
|
2016
|
-
producers: new ChainProducersAnalyzer()
|
|
2017
|
-
};
|
|
2018
|
-
}
|
|
2019
|
-
}, [
|
|
2020
|
-
chainId
|
|
2021
|
-
]);
|
|
2022
|
-
return /* @__PURE__ */ React41.createElement(ChainAnalyzersProvider, {
|
|
2023
|
-
analyzers
|
|
2024
|
-
}, /* @__PURE__ */ React41.createElement(StaticListBase, {
|
|
2025
|
-
blockChainRenderProps,
|
|
2026
|
-
...props
|
|
2027
|
-
}));
|
|
2028
|
-
}, "WithAnalysis");
|
|
2029
|
-
|
|
2030
|
-
// src/components/chain/render/static/flexbox/Flexbox.tsx
|
|
2031
|
-
var StaticBlockchainRenderFlexBox = {
|
|
2032
|
-
Base: StaticListBase,
|
|
2033
|
-
WithAnalysis
|
|
2034
|
-
};
|
|
2035
|
-
|
|
2036
1778
|
// src/components/payload/builder/Flexbox.tsx
|
|
2037
|
-
import { FlexCol as
|
|
1779
|
+
import { FlexCol as FlexCol6 } from "@xylabs/react-flexbox";
|
|
2038
1780
|
import { JsonViewerEx as JsonViewerEx2 } from "@xyo-network/react-payload-raw-info";
|
|
2039
|
-
import
|
|
1781
|
+
import React38, { useState as useState13 } from "react";
|
|
2040
1782
|
var PayloadBuilderFlexbox = /* @__PURE__ */ __name(({ BuilderComponent, onBuild, ...props }) => {
|
|
2041
|
-
const [payload, setPayload] =
|
|
1783
|
+
const [payload, setPayload] = useState13();
|
|
2042
1784
|
const onBuildLocal = /* @__PURE__ */ __name((payload2) => {
|
|
2043
1785
|
onBuild?.(payload2);
|
|
2044
1786
|
setPayload(payload2);
|
|
2045
1787
|
}, "onBuildLocal");
|
|
2046
|
-
return /* @__PURE__ */
|
|
1788
|
+
return /* @__PURE__ */ React38.createElement(FlexCol6, {
|
|
2047
1789
|
gap: 2,
|
|
2048
1790
|
...props
|
|
2049
|
-
}, /* @__PURE__ */
|
|
1791
|
+
}, /* @__PURE__ */ React38.createElement(BuilderComponent, {
|
|
2050
1792
|
onBuild: onBuildLocal
|
|
2051
|
-
}), payload ? /* @__PURE__ */
|
|
1793
|
+
}), payload ? /* @__PURE__ */ React38.createElement(JsonViewerEx2, {
|
|
2052
1794
|
value: payload
|
|
2053
1795
|
}) : null);
|
|
2054
1796
|
}, "PayloadBuilderFlexbox");
|
|
@@ -2057,14 +1799,14 @@ var PayloadBuilderFlexbox = /* @__PURE__ */ __name(({ BuilderComponent, onBuild,
|
|
|
2057
1799
|
import { Button as Button5, FormControl as FormControl5 } from "@mui/material";
|
|
2058
1800
|
import { usePromise as usePromise5 } from "@xylabs/react-promise";
|
|
2059
1801
|
import { createProducerChainStakeIntent } from "@xyo-network/chain-protocol";
|
|
2060
|
-
import
|
|
1802
|
+
import React41, { useState as useState16 } from "react";
|
|
2061
1803
|
|
|
2062
1804
|
// src/components/payload/fields/BlockNumberTextField.tsx
|
|
2063
1805
|
import { FormControl as FormControl3, FormHelperText as FormHelperText2, TextField as TextField3 } from "@mui/material";
|
|
2064
1806
|
import { toXL1BlockNumber as toXL1BlockNumber2 } from "@xyo-network/xl1-protocol";
|
|
2065
|
-
import
|
|
1807
|
+
import React39, { useState as useState14 } from "react";
|
|
2066
1808
|
var BlockNumberTextField = /* @__PURE__ */ __name(({ errorMessage, onBlockNumberChanged, onChange, ...props }) => {
|
|
2067
|
-
const [blockNumber, setBlockNumber] =
|
|
1809
|
+
const [blockNumber, setBlockNumber] = useState14();
|
|
2068
1810
|
const handleChange = /* @__PURE__ */ __name((e) => {
|
|
2069
1811
|
const value = e.target.value.replaceAll(/\D/g, "");
|
|
2070
1812
|
setBlockNumber(value.length > 0 ? Number(value) : void 0);
|
|
@@ -2072,15 +1814,15 @@ var BlockNumberTextField = /* @__PURE__ */ __name(({ errorMessage, onBlockNumber
|
|
|
2072
1814
|
onChange?.(e);
|
|
2073
1815
|
}, "handleChange");
|
|
2074
1816
|
const errored = errorMessage !== void 0;
|
|
2075
|
-
return /* @__PURE__ */
|
|
1817
|
+
return /* @__PURE__ */ React39.createElement(FormControl3, {
|
|
2076
1818
|
fullWidth: true
|
|
2077
|
-
}, /* @__PURE__ */
|
|
1819
|
+
}, /* @__PURE__ */ React39.createElement(TextField3, {
|
|
2078
1820
|
error: errored,
|
|
2079
1821
|
onChange: handleChange,
|
|
2080
1822
|
type: "number",
|
|
2081
1823
|
value: blockNumber ?? "",
|
|
2082
1824
|
...props
|
|
2083
|
-
}), errored ? /* @__PURE__ */
|
|
1825
|
+
}), errored ? /* @__PURE__ */ React39.createElement(FormHelperText2, {
|
|
2084
1826
|
sx: {
|
|
2085
1827
|
color: "error.main"
|
|
2086
1828
|
}
|
|
@@ -2089,19 +1831,19 @@ var BlockNumberTextField = /* @__PURE__ */ __name(({ errorMessage, onBlockNumber
|
|
|
2089
1831
|
|
|
2090
1832
|
// src/components/payload/fields/XyoAddressTextField.tsx
|
|
2091
1833
|
import { FormControl as FormControl4, FormHelperText as FormHelperText3, TextField as TextField4 } from "@mui/material";
|
|
2092
|
-
import { asAddress, isAddress
|
|
2093
|
-
import
|
|
1834
|
+
import { asAddress, isAddress } from "@xylabs/sdk-js";
|
|
1835
|
+
import React40, { useMemo as useMemo13, useState as useState15 } from "react";
|
|
2094
1836
|
var XyoAddressTextField = /* @__PURE__ */ __name(({ onAddressChanged, onChange, resetValue, ...props }) => {
|
|
2095
|
-
const [address, setAddress] =
|
|
2096
|
-
const [addressError, setAddressError] =
|
|
2097
|
-
|
|
1837
|
+
const [address, setAddress] = useState15("");
|
|
1838
|
+
const [addressError, setAddressError] = useState15();
|
|
1839
|
+
useMemo13(() => setAddress(""), [
|
|
2098
1840
|
resetValue
|
|
2099
1841
|
]);
|
|
2100
1842
|
const handleChange = /* @__PURE__ */ __name((event) => {
|
|
2101
1843
|
const { value } = event.target;
|
|
2102
1844
|
onChange?.(event);
|
|
2103
1845
|
const xyoAddress = asAddress(value);
|
|
2104
|
-
if (
|
|
1846
|
+
if (isAddress(xyoAddress)) {
|
|
2105
1847
|
onAddressChanged?.(xyoAddress);
|
|
2106
1848
|
}
|
|
2107
1849
|
setAddressError(void 0);
|
|
@@ -2109,20 +1851,20 @@ var XyoAddressTextField = /* @__PURE__ */ __name(({ onAddressChanged, onChange,
|
|
|
2109
1851
|
}, "handleChange");
|
|
2110
1852
|
const handleBlur = /* @__PURE__ */ __name(() => {
|
|
2111
1853
|
const xyoAddress = asAddress(address);
|
|
2112
|
-
if (!
|
|
1854
|
+
if (!isAddress(xyoAddress)) {
|
|
2113
1855
|
setAddressError(new Error("Invalid address"));
|
|
2114
1856
|
onAddressChanged?.();
|
|
2115
1857
|
}
|
|
2116
1858
|
}, "handleBlur");
|
|
2117
|
-
return /* @__PURE__ */
|
|
1859
|
+
return /* @__PURE__ */ React40.createElement(FormControl4, {
|
|
2118
1860
|
fullWidth: true
|
|
2119
|
-
}, /* @__PURE__ */
|
|
1861
|
+
}, /* @__PURE__ */ React40.createElement(TextField4, {
|
|
2120
1862
|
error: !!addressError,
|
|
2121
1863
|
onBlur: handleBlur,
|
|
2122
1864
|
onChange: handleChange,
|
|
2123
1865
|
value: address,
|
|
2124
1866
|
...props
|
|
2125
|
-
}), addressError ? /* @__PURE__ */
|
|
1867
|
+
}), addressError ? /* @__PURE__ */ React40.createElement(FormHelperText3, {
|
|
2126
1868
|
sx: {
|
|
2127
1869
|
color: "error.main"
|
|
2128
1870
|
}
|
|
@@ -2131,10 +1873,10 @@ var XyoAddressTextField = /* @__PURE__ */ __name(({ onAddressChanged, onChange,
|
|
|
2131
1873
|
|
|
2132
1874
|
// src/components/payload/builder/producer-intent/Form.tsx
|
|
2133
1875
|
var ProducerIntentBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
2134
|
-
const [delegate, setDelegate] =
|
|
2135
|
-
const [exp, setExp] =
|
|
2136
|
-
const [nbf, setNbf] =
|
|
2137
|
-
const [blockRangeError, setBlockRangeError] =
|
|
1876
|
+
const [delegate, setDelegate] = useState16();
|
|
1877
|
+
const [exp, setExp] = useState16();
|
|
1878
|
+
const [nbf, setNbf] = useState16();
|
|
1879
|
+
const [blockRangeError, setBlockRangeError] = useState16();
|
|
2138
1880
|
const [intentPayload] = usePromise5(async () => {
|
|
2139
1881
|
if (exp !== void 0 && nbf !== void 0) {
|
|
2140
1882
|
if (exp <= nbf) {
|
|
@@ -2155,33 +1897,33 @@ var ProducerIntentBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
2155
1897
|
const onBuildLocal = /* @__PURE__ */ __name(() => {
|
|
2156
1898
|
if (onBuild && intentPayload) onBuild?.(intentPayload);
|
|
2157
1899
|
}, "onBuildLocal");
|
|
2158
|
-
return /* @__PURE__ */
|
|
1900
|
+
return /* @__PURE__ */ React41.createElement(React41.Fragment, null, /* @__PURE__ */ React41.createElement(FormControl5, {
|
|
2159
1901
|
fullWidth: true
|
|
2160
|
-
}, /* @__PURE__ */
|
|
1902
|
+
}, /* @__PURE__ */ React41.createElement(XyoAddressTextField, {
|
|
2161
1903
|
label: "Delegate",
|
|
2162
1904
|
name: "delegate",
|
|
2163
1905
|
onAddressChanged: setDelegate,
|
|
2164
1906
|
required: true,
|
|
2165
1907
|
size: "small"
|
|
2166
|
-
})), /* @__PURE__ */
|
|
1908
|
+
})), /* @__PURE__ */ React41.createElement(FormControl5, {
|
|
2167
1909
|
fullWidth: true
|
|
2168
|
-
}, /* @__PURE__ */
|
|
1910
|
+
}, /* @__PURE__ */ React41.createElement(BlockNumberTextField, {
|
|
2169
1911
|
errorMessage: blockRangeError?.message,
|
|
2170
1912
|
label: "Expires",
|
|
2171
1913
|
name: "exp",
|
|
2172
1914
|
onBlockNumberChanged: setExp,
|
|
2173
1915
|
required: true,
|
|
2174
1916
|
size: "small"
|
|
2175
|
-
})), /* @__PURE__ */
|
|
1917
|
+
})), /* @__PURE__ */ React41.createElement(FormControl5, {
|
|
2176
1918
|
fullWidth: true
|
|
2177
|
-
}, /* @__PURE__ */
|
|
1919
|
+
}, /* @__PURE__ */ React41.createElement(BlockNumberTextField, {
|
|
2178
1920
|
errorMessage: blockRangeError?.message,
|
|
2179
1921
|
label: "Not Before",
|
|
2180
1922
|
name: "nbf",
|
|
2181
1923
|
onBlockNumberChanged: setNbf,
|
|
2182
1924
|
required: true,
|
|
2183
1925
|
size: "small"
|
|
2184
|
-
})), /* @__PURE__ */
|
|
1926
|
+
})), /* @__PURE__ */ React41.createElement(Button5, {
|
|
2185
1927
|
disabled: !intentPayload,
|
|
2186
1928
|
variant: "contained",
|
|
2187
1929
|
onClick: onBuildLocal
|
|
@@ -2189,29 +1931,29 @@ var ProducerIntentBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
2189
1931
|
}, "ProducerIntentBuilderForm");
|
|
2190
1932
|
|
|
2191
1933
|
// src/components/payload/builder/transfer/Flexbox.tsx
|
|
2192
|
-
import
|
|
1934
|
+
import React44 from "react";
|
|
2193
1935
|
|
|
2194
1936
|
// src/components/payload/builder/transfer/Form.tsx
|
|
2195
1937
|
import { Button as Button6, FormControl as FormControl7 } from "@mui/material";
|
|
2196
|
-
import { isAddress as
|
|
1938
|
+
import { isAddress as isAddress3 } from "@xylabs/sdk-js";
|
|
2197
1939
|
import { TransferSchema } from "@xyo-network/xl1-protocol";
|
|
2198
|
-
import
|
|
1940
|
+
import React43, { useMemo as useMemo15, useState as useState18 } from "react";
|
|
2199
1941
|
|
|
2200
1942
|
// src/components/payload/builder/transfer/builder/SingleFlexbox.tsx
|
|
2201
1943
|
import { RemoveCircle } from "@mui/icons-material";
|
|
2202
1944
|
import { FormControl as FormControl6, Icon as Icon3, IconButton as IconButton5 } from "@mui/material";
|
|
2203
1945
|
import { FlexRow as FlexRow7 } from "@xylabs/react-flexbox";
|
|
2204
|
-
import { isAddress as
|
|
1946
|
+
import { isAddress as isAddress2, toHex as toHex3 } from "@xylabs/sdk-js";
|
|
2205
1947
|
import { BigIntInput } from "@xyo-network/react-shared";
|
|
2206
|
-
import
|
|
1948
|
+
import React42, { useEffect as useEffect2, useMemo as useMemo14, useState as useState17 } from "react";
|
|
2207
1949
|
var SingleTransferBuilderFlexbox = /* @__PURE__ */ __name(({ onTransferUpdated, onRemoveTransfer, singleTransfer, ...props }) => {
|
|
2208
|
-
const [toAddress3, setToAddress] =
|
|
2209
|
-
const [amount, setAmount] =
|
|
2210
|
-
const transferAmount =
|
|
2211
|
-
if (
|
|
1950
|
+
const [toAddress3, setToAddress] = useState17();
|
|
1951
|
+
const [amount, setAmount] = useState17();
|
|
1952
|
+
const transferAmount = useMemo14(() => {
|
|
1953
|
+
if (isAddress2(toAddress3) && amount !== void 0) {
|
|
2212
1954
|
return {
|
|
2213
1955
|
...singleTransfer,
|
|
2214
|
-
amount:
|
|
1956
|
+
amount: toHex3(amount),
|
|
2215
1957
|
to: toAddress3
|
|
2216
1958
|
};
|
|
2217
1959
|
}
|
|
@@ -2219,42 +1961,42 @@ var SingleTransferBuilderFlexbox = /* @__PURE__ */ __name(({ onTransferUpdated,
|
|
|
2219
1961
|
toAddress3,
|
|
2220
1962
|
amount
|
|
2221
1963
|
]);
|
|
2222
|
-
|
|
1964
|
+
useEffect2(() => {
|
|
2223
1965
|
if (transferAmount) onTransferUpdated?.(transferAmount);
|
|
2224
1966
|
}, [
|
|
2225
1967
|
transferAmount
|
|
2226
1968
|
]);
|
|
2227
|
-
return /* @__PURE__ */
|
|
1969
|
+
return /* @__PURE__ */ React42.createElement(FlexRow7, {
|
|
2228
1970
|
alignItems: "start",
|
|
2229
1971
|
gap: 1,
|
|
2230
1972
|
...props
|
|
2231
|
-
}, /* @__PURE__ */
|
|
1973
|
+
}, /* @__PURE__ */ React42.createElement(FormControl6, {
|
|
2232
1974
|
fullWidth: true
|
|
2233
|
-
}, /* @__PURE__ */
|
|
1975
|
+
}, /* @__PURE__ */ React42.createElement(XyoAddressTextField, {
|
|
2234
1976
|
label: "To",
|
|
2235
1977
|
name: "to",
|
|
2236
1978
|
onAddressChanged: setToAddress,
|
|
2237
1979
|
required: true,
|
|
2238
1980
|
size: "small"
|
|
2239
|
-
})), /* @__PURE__ */
|
|
1981
|
+
})), /* @__PURE__ */ React42.createElement(FormControl6, {
|
|
2240
1982
|
fullWidth: true
|
|
2241
|
-
}, /* @__PURE__ */
|
|
1983
|
+
}, /* @__PURE__ */ React42.createElement(BigIntInput.TextField, {
|
|
2242
1984
|
label: "Amount",
|
|
2243
1985
|
name: "amount",
|
|
2244
1986
|
onChangeFixedPoint: setAmount,
|
|
2245
1987
|
required: true,
|
|
2246
1988
|
size: "small"
|
|
2247
|
-
})), /* @__PURE__ */
|
|
1989
|
+
})), /* @__PURE__ */ React42.createElement(IconButton5, {
|
|
2248
1990
|
onClick: /* @__PURE__ */ __name(() => onRemoveTransfer?.(singleTransfer.transferId), "onClick")
|
|
2249
|
-
}, /* @__PURE__ */
|
|
1991
|
+
}, /* @__PURE__ */ React42.createElement(Icon3, null, /* @__PURE__ */ React42.createElement(RemoveCircle, null))));
|
|
2250
1992
|
}, "SingleTransferBuilderFlexbox");
|
|
2251
1993
|
|
|
2252
1994
|
// src/components/payload/builder/transfer/Form.tsx
|
|
2253
1995
|
var TransferBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
2254
|
-
const [fromAddress, setFromAddress] =
|
|
2255
|
-
const [transfers, setTransfers] =
|
|
2256
|
-
const transferPayload =
|
|
2257
|
-
if (
|
|
1996
|
+
const [fromAddress, setFromAddress] = useState18();
|
|
1997
|
+
const [transfers, setTransfers] = useState18([]);
|
|
1998
|
+
const transferPayload = useMemo15(() => {
|
|
1999
|
+
if (isAddress3(fromAddress) && transfers.length > 0) {
|
|
2258
2000
|
const transfersRecord = {};
|
|
2259
2001
|
for (const transfer of transfers) {
|
|
2260
2002
|
transfersRecord[transfer.to] = transfer.amount;
|
|
@@ -2295,19 +2037,19 @@ var TransferBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
2295
2037
|
return transfer;
|
|
2296
2038
|
}));
|
|
2297
2039
|
}, "onTransferUpdated");
|
|
2298
|
-
return /* @__PURE__ */
|
|
2040
|
+
return /* @__PURE__ */ React43.createElement(React43.Fragment, null, /* @__PURE__ */ React43.createElement(FormControl7, {
|
|
2299
2041
|
fullWidth: true
|
|
2300
|
-
}, /* @__PURE__ */
|
|
2042
|
+
}, /* @__PURE__ */ React43.createElement(XyoAddressTextField, {
|
|
2301
2043
|
label: "From",
|
|
2302
2044
|
name: "from",
|
|
2303
2045
|
onAddressChanged: setFromAddress,
|
|
2304
2046
|
required: true,
|
|
2305
2047
|
size: "small"
|
|
2306
|
-
})), /* @__PURE__ */
|
|
2048
|
+
})), /* @__PURE__ */ React43.createElement(Button6, {
|
|
2307
2049
|
onClick: onTransferAdded,
|
|
2308
2050
|
size: "small",
|
|
2309
2051
|
variant: "contained"
|
|
2310
|
-
}, "Add Transfer"), transfers.map((transfer) => /* @__PURE__ */
|
|
2052
|
+
}, "Add Transfer"), transfers.map((transfer) => /* @__PURE__ */ React43.createElement(SingleTransferBuilderFlexbox, {
|
|
2311
2053
|
key: transfer.transferId,
|
|
2312
2054
|
onTransferUpdated,
|
|
2313
2055
|
onRemoveTransfer: onTransferRemoved,
|
|
@@ -2315,7 +2057,7 @@ var TransferBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
2315
2057
|
sx: {
|
|
2316
2058
|
width: "100%"
|
|
2317
2059
|
}
|
|
2318
|
-
})), /* @__PURE__ */
|
|
2060
|
+
})), /* @__PURE__ */ React43.createElement(Button6, {
|
|
2319
2061
|
disabled: !transferPayload,
|
|
2320
2062
|
variant: "contained",
|
|
2321
2063
|
onClick: onBuildLocal
|
|
@@ -2323,7 +2065,7 @@ var TransferBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
2323
2065
|
}, "TransferBuilderForm");
|
|
2324
2066
|
|
|
2325
2067
|
// src/components/payload/builder/transfer/Flexbox.tsx
|
|
2326
|
-
var TransferBuilderFlexbox = /* @__PURE__ */ __name(({ onBuild, ...props }) => /* @__PURE__ */
|
|
2068
|
+
var TransferBuilderFlexbox = /* @__PURE__ */ __name(({ onBuild, ...props }) => /* @__PURE__ */ React44.createElement(PayloadBuilderFlexbox, {
|
|
2327
2069
|
gap: 4,
|
|
2328
2070
|
alignItems: "start",
|
|
2329
2071
|
BuilderComponent: TransferBuilderForm,
|
|
@@ -2338,10 +2080,10 @@ import { MemoryArchivist } from "@xyo-network/archivist-memory";
|
|
|
2338
2080
|
import { ArchivistConfigSchema } from "@xyo-network/archivist-model";
|
|
2339
2081
|
import { buildRandomBlockChain } from "@xyo-network/react-chain-shared";
|
|
2340
2082
|
import { flattenHydratedBlocks } from "@xyo-network/xl1-protocol-sdk";
|
|
2341
|
-
import
|
|
2083
|
+
import React45, { useEffect as useEffect3 } from "react";
|
|
2342
2084
|
|
|
2343
2085
|
// src/lib/getChainArchivist.ts
|
|
2344
|
-
import { assertEx as
|
|
2086
|
+
import { assertEx as assertEx3 } from "@xylabs/sdk-js";
|
|
2345
2087
|
import { asArchivistInstance } from "@xyo-network/archivist-model";
|
|
2346
2088
|
import { HttpBridge, HttpBridgeConfigSchema } from "@xyo-network/bridge-http";
|
|
2347
2089
|
var getChainArchivistFromBridge = /* @__PURE__ */ __name(async (params) => {
|
|
@@ -2356,8 +2098,8 @@ var getChainArchivistFromBridge = /* @__PURE__ */ __name(async (params) => {
|
|
|
2356
2098
|
config
|
|
2357
2099
|
});
|
|
2358
2100
|
const resolved = await bridge.resolve(chainArchivistModuleId);
|
|
2359
|
-
const mod =
|
|
2360
|
-
return
|
|
2101
|
+
const mod = assertEx3(resolved, () => `Module ${chainArchivistModuleId} not found`);
|
|
2102
|
+
return assertEx3(asArchivistInstance(mod), () => `Module ${chainArchivistModuleId} is not an archivist`);
|
|
2361
2103
|
}, "getChainArchivistFromBridge");
|
|
2362
2104
|
|
|
2363
2105
|
// src/lib/getChainId.ts
|
|
@@ -2389,7 +2131,7 @@ var ChainArchivistDecorator = /* @__PURE__ */ __name((Story, { args, ...context
|
|
|
2389
2131
|
}, [
|
|
2390
2132
|
randomBlockChain
|
|
2391
2133
|
]);
|
|
2392
|
-
|
|
2134
|
+
useEffect3(() => {
|
|
2393
2135
|
if (blockChainRenderPropsError) {
|
|
2394
2136
|
console.error(blockChainRenderPropsError);
|
|
2395
2137
|
}
|
|
@@ -2407,7 +2149,7 @@ var ChainArchivistDecorator = /* @__PURE__ */ __name((Story, { args, ...context
|
|
|
2407
2149
|
}
|
|
2408
2150
|
}
|
|
2409
2151
|
};
|
|
2410
|
-
return blockChainRenderProps?.chainArchivist ? /* @__PURE__ */
|
|
2152
|
+
return blockChainRenderProps?.chainArchivist ? /* @__PURE__ */ React45.createElement(Story, props) : /* @__PURE__ */ React45.createElement(CircularProgress, null);
|
|
2411
2153
|
}, "ChainArchivistDecorator");
|
|
2412
2154
|
|
|
2413
2155
|
// src/stories/ChainArchivistDelayedInsertDecorator.tsx
|
|
@@ -2418,10 +2160,10 @@ import { MemoryArchivist as MemoryArchivist2 } from "@xyo-network/archivist-memo
|
|
|
2418
2160
|
import { ArchivistConfigSchema as ArchivistConfigSchema2 } from "@xyo-network/archivist-model";
|
|
2419
2161
|
import { buildRandomBlockChain as buildRandomBlockChain2 } from "@xyo-network/react-chain-shared";
|
|
2420
2162
|
import { flattenHydratedBlock } from "@xyo-network/xl1-protocol-sdk";
|
|
2421
|
-
import
|
|
2163
|
+
import React46, { useEffect as useEffect4, useState as useState19 } from "react";
|
|
2422
2164
|
var chainArchivistRef;
|
|
2423
2165
|
var ChainArchivistDelayedInsertDecorator = /* @__PURE__ */ __name((Story, context) => {
|
|
2424
|
-
const [firstBlock, setFirstBlock] =
|
|
2166
|
+
const [firstBlock, setFirstBlock] = useState19();
|
|
2425
2167
|
const [randomBlockChain] = usePromise7(async () => await buildRandomBlockChain2(), []);
|
|
2426
2168
|
const [chainArchivist] = usePromise7(async () => {
|
|
2427
2169
|
if (chainArchivistRef) {
|
|
@@ -2449,7 +2191,7 @@ var ChainArchivistDelayedInsertDecorator = /* @__PURE__ */ __name((Story, contex
|
|
|
2449
2191
|
chainArchivist,
|
|
2450
2192
|
randomBlockChain
|
|
2451
2193
|
]);
|
|
2452
|
-
|
|
2194
|
+
useEffect4(() => {
|
|
2453
2195
|
if (delayedInsertError) {
|
|
2454
2196
|
console.error(delayedInsertError);
|
|
2455
2197
|
}
|
|
@@ -2477,17 +2219,17 @@ var ChainArchivistDelayedInsertDecorator = /* @__PURE__ */ __name((Story, contex
|
|
|
2477
2219
|
}
|
|
2478
2220
|
}
|
|
2479
2221
|
};
|
|
2480
|
-
return firstBlock ? /* @__PURE__ */
|
|
2222
|
+
return firstBlock ? /* @__PURE__ */ React46.createElement(Story, props) : /* @__PURE__ */ React46.createElement(CircularProgress2, null);
|
|
2481
2223
|
}, "ChainArchivistDelayedInsertDecorator");
|
|
2482
2224
|
|
|
2483
2225
|
// src/stories/ChainInfoContextDecorator.tsx
|
|
2484
2226
|
import { usePromise as usePromise8 } from "@xylabs/react-promise";
|
|
2485
|
-
import { assertEx as
|
|
2486
|
-
import { ChainBlockNumberIterationService as
|
|
2227
|
+
import { assertEx as assertEx4, isDefined as isDefined9 } from "@xylabs/sdk-js";
|
|
2228
|
+
import { ChainBlockNumberIterationService as ChainBlockNumberIterationService2 } from "@xyo-network/chain-services";
|
|
2487
2229
|
import { findFirstMatching } from "@xyo-network/chain-utils";
|
|
2488
2230
|
import { isBlockBoundWitness as isBlockBoundWitness3 } from "@xyo-network/xl1-protocol";
|
|
2489
2231
|
import { readPayloadMapFromStore } from "@xyo-network/xl1-protocol-sdk";
|
|
2490
|
-
import
|
|
2232
|
+
import React47 from "react";
|
|
2491
2233
|
var archivistConfig = {
|
|
2492
2234
|
url: "http://localhost:8080",
|
|
2493
2235
|
chainArchivistModuleId: "XYOPublic:XYOChain:Chain"
|
|
@@ -2502,10 +2244,10 @@ var ChainInfoContextDecorator = /* @__PURE__ */ __name((Story, context) => {
|
|
|
2502
2244
|
}, []);
|
|
2503
2245
|
const [chainIterator] = usePromise8(async () => {
|
|
2504
2246
|
if (isDefined9(chainArchivist) && isDefined9(chainId)) {
|
|
2505
|
-
const firstMatch =
|
|
2506
|
-
const head =
|
|
2247
|
+
const firstMatch = assertEx4(await findFirstMatching(chainArchivist), () => `No head found in archivist: ${chainArchivist.id} `);
|
|
2248
|
+
const head = assertEx4(isBlockBoundWitness3(firstMatch) ? firstMatch : void 0, () => `Expected a block bound witness: ${JSON.stringify(firstMatch)}`);
|
|
2507
2249
|
const chainMap = readPayloadMapFromStore(chainArchivist);
|
|
2508
|
-
return await
|
|
2250
|
+
return await ChainBlockNumberIterationService2.create({
|
|
2509
2251
|
chainMap,
|
|
2510
2252
|
head
|
|
2511
2253
|
});
|
|
@@ -2514,11 +2256,11 @@ var ChainInfoContextDecorator = /* @__PURE__ */ __name((Story, context) => {
|
|
|
2514
2256
|
chainArchivist,
|
|
2515
2257
|
chainId
|
|
2516
2258
|
]);
|
|
2517
|
-
return /* @__PURE__ */
|
|
2259
|
+
return /* @__PURE__ */ React47.createElement(ChainInfoProvider, {
|
|
2518
2260
|
chainArchivist,
|
|
2519
2261
|
chainId,
|
|
2520
2262
|
chainIterator
|
|
2521
|
-
}, /* @__PURE__ */
|
|
2263
|
+
}, /* @__PURE__ */ React47.createElement(Story, context));
|
|
2522
2264
|
}, "ChainInfoContextDecorator");
|
|
2523
2265
|
export {
|
|
2524
2266
|
AccountBalanceHistoryFlexBox,
|
|
@@ -2550,7 +2292,6 @@ export {
|
|
|
2550
2292
|
ChainArchivistDecorator,
|
|
2551
2293
|
ChainArchivistDelayedInsertDecorator,
|
|
2552
2294
|
ChainInfoContextDecorator,
|
|
2553
|
-
ChainIteratorStore,
|
|
2554
2295
|
ChainTransactionBuilder,
|
|
2555
2296
|
ChainTransactionNetwork,
|
|
2556
2297
|
ChipSkeleton,
|
|
@@ -2561,7 +2302,6 @@ export {
|
|
|
2561
2302
|
PollingControlsFlexbox,
|
|
2562
2303
|
ProducerIntentBuilderForm,
|
|
2563
2304
|
PulseSvgIcon,
|
|
2564
|
-
StaticBlockchainRenderFlexBox,
|
|
2565
2305
|
StyledPulseSvgIcon,
|
|
2566
2306
|
SubmitChainTransaction,
|
|
2567
2307
|
TableHeadingLabels,
|
|
@@ -2580,7 +2320,6 @@ export {
|
|
|
2580
2320
|
useBlockHeadingEvents,
|
|
2581
2321
|
useBlockProducer,
|
|
2582
2322
|
useChainIteratorParams,
|
|
2583
|
-
useChainIteratorUpdatingHead,
|
|
2584
2323
|
useChainPagination,
|
|
2585
2324
|
useDynamicBlockComponents,
|
|
2586
2325
|
useIterateChain,
|