@xyo-network/react-chain-blockchain 1.16.16 → 1.16.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/components/account/hooks/index.d.ts +2 -0
- package/dist/browser/components/account/hooks/index.d.ts.map +1 -0
- package/dist/browser/components/account/hooks/usePagedAccountBalanceHistory.d.ts +11 -0
- package/dist/browser/components/account/hooks/usePagedAccountBalanceHistory.d.ts.map +1 -0
- package/dist/browser/components/account/index.d.ts +1 -0
- package/dist/browser/components/account/index.d.ts.map +1 -1
- package/dist/browser/components/account/table/BalanceHistoryTableEx.stories.d.ts +2 -1
- package/dist/browser/components/account/table/BalanceHistoryTableEx.stories.d.ts.map +1 -1
- package/dist/browser/components/account/table/BalanceHistoryTableRow.d.ts +1 -0
- package/dist/browser/components/account/table/BalanceHistoryTableRow.d.ts.map +1 -1
- package/dist/browser/components/account/table/RawAmountTableCell.d.ts +1 -0
- package/dist/browser/components/account/table/RawAmountTableCell.d.ts.map +1 -1
- package/dist/browser/components/account/table/cell/AddressTableCell.d.ts +1 -0
- package/dist/browser/components/account/table/cell/AddressTableCell.d.ts.map +1 -1
- package/dist/browser/components/account/table/cell/HashTableCell.d.ts +1 -0
- package/dist/browser/components/account/table/cell/HashTableCell.d.ts.map +1 -1
- package/dist/browser/index.mjs +343 -293
- package/dist/browser/index.mjs.map +1 -1
- package/package.json +17 -13
- package/src/components/account/hooks/index.ts +1 -0
- package/src/components/account/hooks/usePagedAccountBalanceHistory.ts +44 -0
- package/src/components/account/index.ts +1 -0
- package/src/components/account/table/BalanceHistoryTableEx.stories.tsx +39 -6
- package/src/components/account/table/BalanceHistoryTableRow.tsx +1 -1
- package/src/components/account/table/RawAmountTableCell.tsx +1 -0
- package/src/components/account/table/cell/AddressTableCell.tsx +1 -0
- package/src/components/account/table/cell/HashTableCell.tsx +1 -0
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 React31 from "react";
|
|
12
12
|
|
|
13
13
|
// src/components/account/helpers/formatBalanceMagnitude.ts
|
|
14
14
|
import { XL1Amount } from "@xyo-network/xl1-protocol";
|
|
@@ -32,18 +32,18 @@ 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 React30 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 { useMemo as useMemo10 } from "react";
|
|
40
|
+
import React29, { useMemo as useMemo10 } 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 React13 from "react";
|
|
47
47
|
|
|
48
48
|
// src/context/analyzer/context.ts
|
|
49
49
|
import { createContextEx } from "@xylabs/react-shared";
|
|
@@ -51,7 +51,7 @@ var ChainAnalyzersContext = createContextEx();
|
|
|
51
51
|
|
|
52
52
|
// src/context/analyzer/Provider.tsx
|
|
53
53
|
import { isUndefined } from "@xylabs/sdk-js";
|
|
54
|
-
import
|
|
54
|
+
import React, { useCallback, useMemo, useState } from "react";
|
|
55
55
|
var ChainAnalyzersProvider = /* @__PURE__ */ __name(({ analyzers: analyzersProp, children }) => {
|
|
56
56
|
const [analyzersState, setAnalyzersState] = useState(analyzersProp ?? {});
|
|
57
57
|
const [statsUpdated, setStatsUpdated] = useState(Date.now());
|
|
@@ -89,7 +89,7 @@ var ChainAnalyzersProvider = /* @__PURE__ */ __name(({ analyzers: analyzersProp,
|
|
|
89
89
|
onBlock,
|
|
90
90
|
statsUpdated
|
|
91
91
|
]);
|
|
92
|
-
return /* @__PURE__ */
|
|
92
|
+
return /* @__PURE__ */ React.createElement(ChainAnalyzersContext, {
|
|
93
93
|
value
|
|
94
94
|
}, children);
|
|
95
95
|
}, "ChainAnalyzersProvider");
|
|
@@ -103,7 +103,7 @@ import { createContextEx as createContextEx2 } from "@xylabs/react-shared";
|
|
|
103
103
|
var ChainInfoContext = createContextEx2();
|
|
104
104
|
|
|
105
105
|
// src/context/chain/Provider.tsx
|
|
106
|
-
import
|
|
106
|
+
import React2, { useMemo as useMemo2, useState as useState2 } from "react";
|
|
107
107
|
var ChainInfoProvider = /* @__PURE__ */ __name(({ children, chainArchivist: chainArchivistProp, chainId: chainIdProp, chainIterator: chainIteratorProp }) => {
|
|
108
108
|
const [chainArchivist, setChainArchivist] = useState2(chainArchivistProp);
|
|
109
109
|
const [chainId, setChainId] = useState2(chainIdProp);
|
|
@@ -148,7 +148,7 @@ var ChainInfoProvider = /* @__PURE__ */ __name(({ children, chainArchivist: chai
|
|
|
148
148
|
updateChainId,
|
|
149
149
|
updateChainIterator
|
|
150
150
|
]);
|
|
151
|
-
return /* @__PURE__ */
|
|
151
|
+
return /* @__PURE__ */ React2.createElement(ChainInfoContext, {
|
|
152
152
|
value: chainState
|
|
153
153
|
}, children);
|
|
154
154
|
}, "ChainInfoProvider");
|
|
@@ -166,7 +166,7 @@ import { Button, FormControl, TextField } from "@mui/material";
|
|
|
166
166
|
import { FlexCol } from "@xylabs/react-flexbox";
|
|
167
167
|
import { toHex } from "@xylabs/sdk-js";
|
|
168
168
|
import { defaultTransactionFees } from "@xyo-network/xl1-protocol";
|
|
169
|
-
import
|
|
169
|
+
import React3 from "react";
|
|
170
170
|
var ChainTransactionBuilder = /* @__PURE__ */ __name(({ onSubmitTx }) => {
|
|
171
171
|
const handleSubmit = /* @__PURE__ */ __name(async (event) => {
|
|
172
172
|
event.preventDefault();
|
|
@@ -184,38 +184,38 @@ var ChainTransactionBuilder = /* @__PURE__ */ __name(({ onSubmitTx }) => {
|
|
|
184
184
|
};
|
|
185
185
|
await onSubmitTx?.(chainTx);
|
|
186
186
|
}, "handleSubmit");
|
|
187
|
-
return /* @__PURE__ */
|
|
187
|
+
return /* @__PURE__ */ React3.createElement("form", {
|
|
188
188
|
onSubmit: /* @__PURE__ */ __name((event) => void handleSubmit(event), "onSubmit"),
|
|
189
189
|
style: {
|
|
190
190
|
width: "100%"
|
|
191
191
|
}
|
|
192
|
-
}, /* @__PURE__ */
|
|
192
|
+
}, /* @__PURE__ */ React3.createElement(FlexCol, {
|
|
193
193
|
gap: 2
|
|
194
|
-
}, /* @__PURE__ */
|
|
194
|
+
}, /* @__PURE__ */ React3.createElement(FormControl, {
|
|
195
195
|
fullWidth: true
|
|
196
|
-
}, /* @__PURE__ */
|
|
196
|
+
}, /* @__PURE__ */ React3.createElement(TextField, {
|
|
197
197
|
label: "Chain Address",
|
|
198
198
|
name: "chain",
|
|
199
199
|
required: true
|
|
200
|
-
})), /* @__PURE__ */
|
|
200
|
+
})), /* @__PURE__ */ React3.createElement(FormControl, {
|
|
201
201
|
fullWidth: true
|
|
202
|
-
}, /* @__PURE__ */
|
|
202
|
+
}, /* @__PURE__ */ React3.createElement(TextField, {
|
|
203
203
|
label: "Gas",
|
|
204
204
|
name: "gas",
|
|
205
205
|
required: true
|
|
206
|
-
})), /* @__PURE__ */
|
|
206
|
+
})), /* @__PURE__ */ React3.createElement(FormControl, {
|
|
207
207
|
fullWidth: true
|
|
208
|
-
}, /* @__PURE__ */
|
|
208
|
+
}, /* @__PURE__ */ React3.createElement(TextField, {
|
|
209
209
|
label: "Not Before Block",
|
|
210
210
|
name: "nbf",
|
|
211
211
|
required: true
|
|
212
|
-
})), /* @__PURE__ */
|
|
212
|
+
})), /* @__PURE__ */ React3.createElement(FormControl, {
|
|
213
213
|
fullWidth: true
|
|
214
|
-
}, /* @__PURE__ */
|
|
214
|
+
}, /* @__PURE__ */ React3.createElement(TextField, {
|
|
215
215
|
label: "Not After Block",
|
|
216
216
|
name: "exp",
|
|
217
217
|
required: true
|
|
218
|
-
})), /* @__PURE__ */
|
|
218
|
+
})), /* @__PURE__ */ React3.createElement(Button, {
|
|
219
219
|
type: "submit",
|
|
220
220
|
variant: "contained"
|
|
221
221
|
}, "Submit")));
|
|
@@ -223,7 +223,7 @@ var ChainTransactionBuilder = /* @__PURE__ */ __name(({ onSubmitTx }) => {
|
|
|
223
223
|
|
|
224
224
|
// src/components/transactions/submit/Network.tsx
|
|
225
225
|
import { FormControl as FormControl2, FormHelperText, TextField as TextField2 } from "@mui/material";
|
|
226
|
-
import
|
|
226
|
+
import React4, { useState as useState3 } from "react";
|
|
227
227
|
var ChainTransactionNetwork = /* @__PURE__ */ __name(({ network, onNetworkChange, ...props }) => {
|
|
228
228
|
const [error, setError] = useState3();
|
|
229
229
|
const handleChange = /* @__PURE__ */ __name((event) => {
|
|
@@ -236,16 +236,16 @@ var ChainTransactionNetwork = /* @__PURE__ */ __name(({ network, onNetworkChange
|
|
|
236
236
|
setError(error2);
|
|
237
237
|
}
|
|
238
238
|
}, "handleChange");
|
|
239
|
-
return /* @__PURE__ */
|
|
239
|
+
return /* @__PURE__ */ React4.createElement(FormControl2, {
|
|
240
240
|
fullWidth: true
|
|
241
|
-
}, /* @__PURE__ */
|
|
241
|
+
}, /* @__PURE__ */ React4.createElement(TextField2, {
|
|
242
242
|
label: "Network",
|
|
243
243
|
name: "network",
|
|
244
244
|
onChange: handleChange,
|
|
245
245
|
required: true,
|
|
246
246
|
value: network,
|
|
247
247
|
...props
|
|
248
|
-
}), /* @__PURE__ */
|
|
248
|
+
}), /* @__PURE__ */ React4.createElement(FormHelperText, {
|
|
249
249
|
sx: {
|
|
250
250
|
color: error ? "red" : void 0
|
|
251
251
|
}
|
|
@@ -263,7 +263,7 @@ import { QueryBoundWitnessBuilder } from "@xyo-network/boundwitness-builder";
|
|
|
263
263
|
import { PayloadBuilder } from "@xyo-network/payload-builder";
|
|
264
264
|
import { buildTransaction } from "@xyo-network/xl1-protocol-sdk";
|
|
265
265
|
import { Axios } from "axios";
|
|
266
|
-
import
|
|
266
|
+
import React5, { useState as useState4 } from "react";
|
|
267
267
|
var BETA_PENDING_TRANSACTIONS_ARCHIVIST = "https://beta.api.chain.xyo.network/8050fee682a2762f504d5449d8269a6f17f0b693";
|
|
268
268
|
var defaultNetwork = new URL(BETA_PENDING_TRANSACTIONS_ARCHIVIST);
|
|
269
269
|
var SubmitChainTransaction = /* @__PURE__ */ __name(() => {
|
|
@@ -298,37 +298,37 @@ var SubmitChainTransaction = /* @__PURE__ */ __name(() => {
|
|
|
298
298
|
const onNetworkChange = /* @__PURE__ */ __name((url) => {
|
|
299
299
|
setNetwork(url);
|
|
300
300
|
}, "onNetworkChange");
|
|
301
|
-
return /* @__PURE__ */
|
|
301
|
+
return /* @__PURE__ */ React5.createElement(Grid, {
|
|
302
302
|
container: true
|
|
303
|
-
}, /* @__PURE__ */
|
|
303
|
+
}, /* @__PURE__ */ React5.createElement(Grid, {
|
|
304
304
|
size: {
|
|
305
305
|
xs: 12,
|
|
306
306
|
sm: 6,
|
|
307
307
|
md: 4
|
|
308
308
|
}
|
|
309
|
-
}, /* @__PURE__ */
|
|
309
|
+
}, /* @__PURE__ */ React5.createElement(FlexGrowCol, {
|
|
310
310
|
alignItems: "start",
|
|
311
311
|
gap: 2
|
|
312
|
-
}, /* @__PURE__ */
|
|
312
|
+
}, /* @__PURE__ */ React5.createElement(ChainTransactionNetwork, {
|
|
313
313
|
network,
|
|
314
314
|
onNetworkChange
|
|
315
|
-
}), network ? /* @__PURE__ */
|
|
315
|
+
}), network ? /* @__PURE__ */ React5.createElement(ChainTransactionBuilder, {
|
|
316
316
|
onSubmitTx
|
|
317
|
-
}) : null, result?.[2].length === 0 ? /* @__PURE__ */
|
|
317
|
+
}) : null, result?.[2].length === 0 ? /* @__PURE__ */ React5.createElement(Alert, {
|
|
318
318
|
severity: "success"
|
|
319
|
-
}, "Success") : null, error ? /* @__PURE__ */
|
|
319
|
+
}, "Success") : null, error ? /* @__PURE__ */ React5.createElement(ErrorRender, {
|
|
320
320
|
error
|
|
321
|
-
}) : null, result?.[2] && result?.[2].length > 0 ? /* @__PURE__ */
|
|
321
|
+
}) : null, result?.[2] && result?.[2].length > 0 ? /* @__PURE__ */ React5.createElement(ErrorRender, {
|
|
322
322
|
error: new Error("Failed insert...see result below")
|
|
323
|
-
}) : null, result ? /* @__PURE__ */
|
|
323
|
+
}) : null, result ? /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(Typography, {
|
|
324
324
|
variant: "h6"
|
|
325
|
-
}, "Result:"), /* @__PURE__ */
|
|
325
|
+
}, "Result:"), /* @__PURE__ */ React5.createElement("pre", null, JSON.stringify(result, null, 2))) : null)));
|
|
326
326
|
}, "SubmitChainTransaction");
|
|
327
327
|
|
|
328
328
|
// src/components/transactions/TransactionCountChip.tsx
|
|
329
329
|
import CompareArrowsIcon from "@mui/icons-material/CompareArrows";
|
|
330
330
|
import { Chip, Icon } from "@mui/material";
|
|
331
|
-
import
|
|
331
|
+
import React6, { useMemo as useMemo3 } from "react";
|
|
332
332
|
var TransactionCountChip = /* @__PURE__ */ __name(({ transactions, sx, ...props }) => {
|
|
333
333
|
const label = useMemo3(() => {
|
|
334
334
|
if (!transactions) return "0";
|
|
@@ -336,8 +336,8 @@ var TransactionCountChip = /* @__PURE__ */ __name(({ transactions, sx, ...props
|
|
|
336
336
|
}, [
|
|
337
337
|
transactions
|
|
338
338
|
]);
|
|
339
|
-
return /* @__PURE__ */
|
|
340
|
-
avatar: /* @__PURE__ */
|
|
339
|
+
return /* @__PURE__ */ React6.createElement(Chip, {
|
|
340
|
+
avatar: /* @__PURE__ */ React6.createElement(Icon, null, /* @__PURE__ */ React6.createElement(CompareArrowsIcon, null)),
|
|
341
341
|
label,
|
|
342
342
|
title: transactions ? `Block contains ${transactions.length} transactions` : void 0,
|
|
343
343
|
sx: {
|
|
@@ -356,7 +356,7 @@ import { Alert as Alert2, AlertTitle, Collapse, Snackbar, Typography as Typograp
|
|
|
356
356
|
import { ErrorRender as ErrorRender2 } from "@xylabs/react-error";
|
|
357
357
|
import { FlexGrowCol as FlexGrowCol2, FlexGrowRow, FlexRow } from "@xylabs/react-flexbox";
|
|
358
358
|
import { QuickTipButton } from "@xylabs/react-quick-tip-button";
|
|
359
|
-
import
|
|
359
|
+
import React7, { Fragment, useMemo as useMemo4, useState as useState6 } from "react";
|
|
360
360
|
|
|
361
361
|
// src/hooks/chain-iterator/ChainIteratorStore.ts
|
|
362
362
|
import { assertEx } from "@xylabs/sdk-js";
|
|
@@ -593,7 +593,7 @@ var TransactionsQuickTipButton = /* @__PURE__ */ __name(({ block, ...props }) =>
|
|
|
593
593
|
setCopied(false);
|
|
594
594
|
}, 5e3);
|
|
595
595
|
}, "onCopy");
|
|
596
|
-
return /* @__PURE__ */
|
|
596
|
+
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(QuickTipButton, {
|
|
597
597
|
Icon: Paid,
|
|
598
598
|
disabled: transactions?.length === 0,
|
|
599
599
|
hoverText: `Transaction Count: ${transactions?.length ?? 0}`,
|
|
@@ -603,32 +603,32 @@ var TransactionsQuickTipButton = /* @__PURE__ */ __name(({ block, ...props }) =>
|
|
|
603
603
|
maxWidth: "md"
|
|
604
604
|
},
|
|
605
605
|
...props
|
|
606
|
-
}, transactions?.length === 0 ? null : /* @__PURE__ */
|
|
606
|
+
}, transactions?.length === 0 ? null : /* @__PURE__ */ React7.createElement(FlexGrowCol2, {
|
|
607
607
|
gap: 1,
|
|
608
608
|
alignItems: "stretch"
|
|
609
|
-
}, transactions?.map(([transaction, hash]) => /* @__PURE__ */
|
|
609
|
+
}, transactions?.map(([transaction, hash]) => /* @__PURE__ */ React7.createElement(Fragment, {
|
|
610
610
|
key: hash
|
|
611
|
-
}, /* @__PURE__ */
|
|
611
|
+
}, /* @__PURE__ */ React7.createElement(FlexGrowRow, {
|
|
612
612
|
gap: 2,
|
|
613
613
|
justifyContent: "start"
|
|
614
|
-
}, /* @__PURE__ */
|
|
614
|
+
}, /* @__PURE__ */ React7.createElement(ContentCopyIcon, {
|
|
615
615
|
sx: {
|
|
616
616
|
cursor: "pointer"
|
|
617
617
|
},
|
|
618
618
|
onClick: /* @__PURE__ */ __name(() => void onCopy(hash), "onClick")
|
|
619
|
-
}), /* @__PURE__ */
|
|
619
|
+
}), /* @__PURE__ */ React7.createElement(Typography2, {
|
|
620
620
|
sx: {
|
|
621
621
|
overflow: "hidden",
|
|
622
622
|
textOverflow: "ellipsis",
|
|
623
623
|
whiteSpace: "nowrap"
|
|
624
624
|
}
|
|
625
|
-
}, hash)), /* @__PURE__ */
|
|
625
|
+
}, hash)), /* @__PURE__ */ React7.createElement(FlexRow, null, /* @__PURE__ */ React7.createElement(Collapse, {
|
|
626
626
|
in: copied,
|
|
627
627
|
unmountOnExit: true
|
|
628
|
-
}, /* @__PURE__ */
|
|
628
|
+
}, /* @__PURE__ */ React7.createElement(Alert2, null, /* @__PURE__ */ React7.createElement(AlertTitle, null, "Previous hash copied to clipboard")))))))), /* @__PURE__ */ React7.createElement(Snackbar, {
|
|
629
629
|
open: showError,
|
|
630
630
|
onClose: /* @__PURE__ */ __name(() => setShowError(false), "onClose")
|
|
631
|
-
}, /* @__PURE__ */
|
|
631
|
+
}, /* @__PURE__ */ React7.createElement(ErrorRender2, {
|
|
632
632
|
error: transactionsError,
|
|
633
633
|
scope: "TransactionsQuickTipButton"
|
|
634
634
|
})));
|
|
@@ -683,13 +683,13 @@ var blockProducer = /* @__PURE__ */ __name((block) => {
|
|
|
683
683
|
}, "blockProducer");
|
|
684
684
|
|
|
685
685
|
// src/components/block/helpers/buildBlockChainRenderComponent.tsx
|
|
686
|
-
import
|
|
686
|
+
import React8 from "react";
|
|
687
687
|
var buildBlockChainRenderComponent = /* @__PURE__ */ __name(async (BlockComponent, blockComponentProps) => {
|
|
688
688
|
const { block, ...remainingProps } = blockComponentProps;
|
|
689
689
|
const blockTxs = await txsFromBlock(block);
|
|
690
690
|
const txHashes = blockTxs.map(([_, hash]) => hash);
|
|
691
691
|
const item = {
|
|
692
|
-
child: /* @__PURE__ */
|
|
692
|
+
child: /* @__PURE__ */ React8.createElement(BlockComponent, {
|
|
693
693
|
block,
|
|
694
694
|
transactions: txHashes,
|
|
695
695
|
...remainingProps
|
|
@@ -795,9 +795,9 @@ var useStaticBlockComponents = /* @__PURE__ */ __name((BlockComponent, params, b
|
|
|
795
795
|
|
|
796
796
|
// src/components/block/LinkedDivider.tsx
|
|
797
797
|
import { Divider, Stack } from "@mui/material";
|
|
798
|
-
import
|
|
798
|
+
import React9 from "react";
|
|
799
799
|
var LinkedDivider = /* @__PURE__ */ __name(() => {
|
|
800
|
-
return /* @__PURE__ */
|
|
800
|
+
return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(Stack, {
|
|
801
801
|
className: "divider-spacer",
|
|
802
802
|
justifyContent: "end",
|
|
803
803
|
sx: {
|
|
@@ -805,7 +805,7 @@ var LinkedDivider = /* @__PURE__ */ __name(() => {
|
|
|
805
805
|
height: 24,
|
|
806
806
|
justifyContent: "end"
|
|
807
807
|
}
|
|
808
|
-
}, /* @__PURE__ */
|
|
808
|
+
}, /* @__PURE__ */ React9.createElement(Divider, {
|
|
809
809
|
className: "divider",
|
|
810
810
|
orientation: "vertical",
|
|
811
811
|
flexItem: true,
|
|
@@ -821,16 +821,16 @@ var LinkedDivider = /* @__PURE__ */ __name(() => {
|
|
|
821
821
|
import { MoreVert } from "@mui/icons-material";
|
|
822
822
|
import { IconButton, Menu } from "@mui/material";
|
|
823
823
|
import { BWJsonMenuItem, BWPreviousHashMenuItem } from "@xyo-network/react-boundwitness-plugin";
|
|
824
|
-
import
|
|
824
|
+
import React10 from "react";
|
|
825
825
|
var BlockMenuExpanded = /* @__PURE__ */ __name(({ block }) => {
|
|
826
826
|
const { anchorEl, anchorRef, open, handleClick, handleClose } = useAnchorElement();
|
|
827
|
-
return /* @__PURE__ */
|
|
827
|
+
return /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement(IconButton, {
|
|
828
828
|
ref: anchorRef,
|
|
829
829
|
size: "small",
|
|
830
830
|
onClick: handleClick
|
|
831
|
-
}, /* @__PURE__ */
|
|
831
|
+
}, /* @__PURE__ */ React10.createElement(MoreVert, {
|
|
832
832
|
fontSize: "inherit"
|
|
833
|
-
})), /* @__PURE__ */
|
|
833
|
+
})), /* @__PURE__ */ React10.createElement(Menu, {
|
|
834
834
|
open,
|
|
835
835
|
anchorEl,
|
|
836
836
|
anchorOrigin: {
|
|
@@ -838,11 +838,11 @@ var BlockMenuExpanded = /* @__PURE__ */ __name(({ block }) => {
|
|
|
838
838
|
vertical: "bottom"
|
|
839
839
|
},
|
|
840
840
|
onClose: handleClose
|
|
841
|
-
}, /* @__PURE__ */
|
|
841
|
+
}, /* @__PURE__ */ React10.createElement(BWPreviousHashMenuItem, {
|
|
842
842
|
boundwitness: block?.[0],
|
|
843
843
|
dense: true,
|
|
844
844
|
onDialogClose: handleClose
|
|
845
|
-
}), /* @__PURE__ */
|
|
845
|
+
}), /* @__PURE__ */ React10.createElement(BWJsonMenuItem, {
|
|
846
846
|
boundwitness: block?.[0],
|
|
847
847
|
dense: true,
|
|
848
848
|
onDialogClose: handleClose
|
|
@@ -853,13 +853,13 @@ var BlockMenuExpanded = /* @__PURE__ */ __name(({ block }) => {
|
|
|
853
853
|
import { Chip as Chip2 } from "@mui/material";
|
|
854
854
|
import { EthAddressWrapper, isString, isUndefined as isUndefined2, toAddress } from "@xylabs/sdk-js";
|
|
855
855
|
import { BlockiesAvatar } from "@xyo-network/react-chain-blockies";
|
|
856
|
-
import
|
|
856
|
+
import React12, { useMemo as useMemo7 } from "react";
|
|
857
857
|
|
|
858
858
|
// src/components/block/ChipSkeleton.tsx
|
|
859
859
|
import { Skeleton } from "@mui/material";
|
|
860
|
-
import
|
|
860
|
+
import React11 from "react";
|
|
861
861
|
var ChipSkeleton = /* @__PURE__ */ __name((props) => {
|
|
862
|
-
return /* @__PURE__ */
|
|
862
|
+
return /* @__PURE__ */ React11.createElement(Skeleton, {
|
|
863
863
|
width: 100,
|
|
864
864
|
...props
|
|
865
865
|
});
|
|
@@ -873,7 +873,7 @@ var formatProducerAddress = /* @__PURE__ */ __name((address) => {
|
|
|
873
873
|
}, "formatProducerAddress");
|
|
874
874
|
var BlockProducerChip = /* @__PURE__ */ __name(({ block, ...props }) => {
|
|
875
875
|
const blockProducer2 = block?.[0].addresses[0];
|
|
876
|
-
return /* @__PURE__ */
|
|
876
|
+
return /* @__PURE__ */ React12.createElement(BlockAddressChip, {
|
|
877
877
|
address: blockProducer2,
|
|
878
878
|
toolTipTitle: `Block producer: ${blockProducer2}`,
|
|
879
879
|
...props
|
|
@@ -881,16 +881,16 @@ var BlockProducerChip = /* @__PURE__ */ __name(({ block, ...props }) => {
|
|
|
881
881
|
}, "BlockProducerChip");
|
|
882
882
|
var BlockAddressChip = /* @__PURE__ */ __name(({ address, sx, toolTipTitle, ...props }) => {
|
|
883
883
|
const shortedBlockProducer = address === void 0 ? null : formatProducerAddress(address);
|
|
884
|
-
const avatar = useMemo7(() => address === "" ? void 0 : /* @__PURE__ */
|
|
884
|
+
const avatar = useMemo7(() => address === "" ? void 0 : /* @__PURE__ */ React12.createElement(BlockiesAvatar, {
|
|
885
885
|
blockiesOptions: {
|
|
886
886
|
seed: address
|
|
887
887
|
}
|
|
888
888
|
}), [
|
|
889
889
|
address
|
|
890
890
|
]);
|
|
891
|
-
return /* @__PURE__ */
|
|
891
|
+
return /* @__PURE__ */ React12.createElement(Chip2, {
|
|
892
892
|
avatar,
|
|
893
|
-
label: shortedBlockProducer ?? /* @__PURE__ */
|
|
893
|
+
label: shortedBlockProducer ?? /* @__PURE__ */ React12.createElement(ChipSkeleton, {
|
|
894
894
|
width: 115
|
|
895
895
|
}),
|
|
896
896
|
title: toolTipTitle,
|
|
@@ -913,12 +913,12 @@ var BlockHeadingFlexbox = /* @__PURE__ */ __name(({ block, defaultExpanded, tran
|
|
|
913
913
|
event.stopPropagation();
|
|
914
914
|
blockHeadingListener("transaction-count", "click", JSON.stringify(transactions2));
|
|
915
915
|
}, "handleTransactionCountClick");
|
|
916
|
-
return /* @__PURE__ */
|
|
916
|
+
return /* @__PURE__ */ React13.createElement(FlexCol2, {
|
|
917
917
|
className: "block-heading-flexbox",
|
|
918
918
|
alignItems: "stretch",
|
|
919
919
|
ref: blockHeadingRef,
|
|
920
920
|
onClick: /* @__PURE__ */ __name(() => blockHeadingListener("block-hash", "click", hash), "onClick")
|
|
921
|
-
}, /* @__PURE__ */
|
|
921
|
+
}, /* @__PURE__ */ React13.createElement(LinkedDivider, null), /* @__PURE__ */ React13.createElement(HashHeadingPaper, {
|
|
922
922
|
hash,
|
|
923
923
|
heading: block?.[0].block === void 0 ? "" : block?.[0].block.toString(),
|
|
924
924
|
paperProps: {
|
|
@@ -927,24 +927,24 @@ var BlockHeadingFlexbox = /* @__PURE__ */ __name(({ block, defaultExpanded, tran
|
|
|
927
927
|
width: "100%"
|
|
928
928
|
}
|
|
929
929
|
},
|
|
930
|
-
AdornmentEnd: /* @__PURE__ */
|
|
930
|
+
AdornmentEnd: /* @__PURE__ */ React13.createElement(FlexRow2, {
|
|
931
931
|
gap: 1
|
|
932
|
-
}, /* @__PURE__ */
|
|
932
|
+
}, /* @__PURE__ */ React13.createElement(BlockProducerChip, {
|
|
933
933
|
block
|
|
934
|
-
}), /* @__PURE__ */
|
|
934
|
+
}), /* @__PURE__ */ React13.createElement(TransactionCountChip, {
|
|
935
935
|
onClick: /* @__PURE__ */ __name((e) => handleTransactionCountClick(e, transactions ?? []), "onClick"),
|
|
936
936
|
transactions
|
|
937
|
-
}), /* @__PURE__ */
|
|
937
|
+
}), /* @__PURE__ */ React13.createElement(BWVerification, {
|
|
938
938
|
iconColors: true,
|
|
939
939
|
boundwitness: block?.[0]
|
|
940
|
-
}), /* @__PURE__ */
|
|
940
|
+
}), /* @__PURE__ */ React13.createElement("span", {
|
|
941
941
|
style: {
|
|
942
942
|
// maxWidth is required for css animation to work and 28px is the width of the icon button
|
|
943
943
|
display: "flex",
|
|
944
944
|
transition: "max-width .5s",
|
|
945
945
|
maxWidth: expanded ? "28px" : 0
|
|
946
946
|
}
|
|
947
|
-
}, /* @__PURE__ */
|
|
947
|
+
}, /* @__PURE__ */ React13.createElement(BlockMenuExpanded, {
|
|
948
948
|
block
|
|
949
949
|
}))),
|
|
950
950
|
identiconProps: {
|
|
@@ -957,10 +957,10 @@ var BlockHeadingFlexbox = /* @__PURE__ */ __name(({ block, defaultExpanded, tran
|
|
|
957
957
|
// src/components/block/table/cell/BlockNumber.tsx
|
|
958
958
|
import { Link, TableCell, Tooltip, Typography as Typography3 } from "@mui/material";
|
|
959
959
|
import { useEvent as useEvent2 } from "@xyo-network/react-event";
|
|
960
|
-
import
|
|
960
|
+
import React14 from "react";
|
|
961
961
|
var BlockNumberTableCell = /* @__PURE__ */ __name(({ block, linked, ...props }) => {
|
|
962
962
|
const blockNumber = block?.[0].block;
|
|
963
|
-
return /* @__PURE__ */
|
|
963
|
+
return /* @__PURE__ */ React14.createElement(BlockNumberTableCellInner, {
|
|
964
964
|
blockNumber,
|
|
965
965
|
linked,
|
|
966
966
|
...props
|
|
@@ -969,15 +969,15 @@ var BlockNumberTableCell = /* @__PURE__ */ __name(({ block, linked, ...props })
|
|
|
969
969
|
var BlockNumberTableCellInner = /* @__PURE__ */ __name(({ blockNumber, linked, ...props }) => {
|
|
970
970
|
const [ref, dispatch] = useEvent2();
|
|
971
971
|
const handleClick = /* @__PURE__ */ __name(() => dispatch("block-number", "click", blockNumber?.toString() ?? ""), "handleClick");
|
|
972
|
-
return /* @__PURE__ */
|
|
972
|
+
return /* @__PURE__ */ React14.createElement(TableCell, {
|
|
973
973
|
ref,
|
|
974
974
|
...props
|
|
975
|
-
}, /* @__PURE__ */
|
|
975
|
+
}, /* @__PURE__ */ React14.createElement(Tooltip, {
|
|
976
976
|
title: `Block Number: ${blockNumber}`
|
|
977
|
-
}, /* @__PURE__ */
|
|
977
|
+
}, /* @__PURE__ */ React14.createElement(Typography3, {
|
|
978
978
|
component: "span",
|
|
979
979
|
variant: "body1"
|
|
980
|
-
}, linked ? /* @__PURE__ */
|
|
980
|
+
}, linked ? /* @__PURE__ */ React14.createElement(Link, {
|
|
981
981
|
onClick: handleClick,
|
|
982
982
|
sx: {
|
|
983
983
|
cursor: "pointer"
|
|
@@ -988,7 +988,7 @@ var BlockNumberTableCellInner = /* @__PURE__ */ __name(({ blockNumber, linked, .
|
|
|
988
988
|
// src/components/block/table/cell/Epoch.tsx
|
|
989
989
|
import { Skeleton as Skeleton2, TableCell as TableCell2, Tooltip as Tooltip2, Typography as Typography4 } from "@mui/material";
|
|
990
990
|
import { isDefined as isDefined3 } from "@xylabs/sdk-js";
|
|
991
|
-
import
|
|
991
|
+
import React15 from "react";
|
|
992
992
|
|
|
993
993
|
// src/components/block/table/cell/lib/timeFunctions.ts
|
|
994
994
|
var dateFormat = Intl.DateTimeFormat(globalThis.navigator.language ?? "en-US", {
|
|
@@ -1054,24 +1054,24 @@ var BlockEpochTableCell = /* @__PURE__ */ __name(({ block, linked, ...props }) =
|
|
|
1054
1054
|
const epoch = block?.[0]?.$epoch;
|
|
1055
1055
|
const dateTime = dateFormat.format(epoch);
|
|
1056
1056
|
const age = isDefined3(epoch) ? timeAgo(epoch) : void 0;
|
|
1057
|
-
return /* @__PURE__ */
|
|
1057
|
+
return /* @__PURE__ */ React15.createElement(TableCell2, props, /* @__PURE__ */ React15.createElement(Tooltip2, {
|
|
1058
1058
|
title: `Block Epoch: ${dateTime}`
|
|
1059
|
-
}, /* @__PURE__ */
|
|
1059
|
+
}, /* @__PURE__ */ React15.createElement(Typography4, {
|
|
1060
1060
|
component: "span",
|
|
1061
1061
|
variant: "body1"
|
|
1062
|
-
}, age ?? /* @__PURE__ */
|
|
1062
|
+
}, age ?? /* @__PURE__ */ React15.createElement(Skeleton2, {
|
|
1063
1063
|
width: 115
|
|
1064
1064
|
}))));
|
|
1065
1065
|
}, "BlockEpochTableCell");
|
|
1066
1066
|
var BlockEpochTableCellInner = /* @__PURE__ */ __name(({ epoch, linked, ...props }) => {
|
|
1067
1067
|
const dateTime = dateFormat.format(epoch);
|
|
1068
1068
|
const age = isDefined3(epoch) ? timeAgo(epoch) : void 0;
|
|
1069
|
-
return /* @__PURE__ */
|
|
1069
|
+
return /* @__PURE__ */ React15.createElement(TableCell2, props, /* @__PURE__ */ React15.createElement(Tooltip2, {
|
|
1070
1070
|
title: `Block Epoch: ${dateTime}`
|
|
1071
|
-
}, /* @__PURE__ */
|
|
1071
|
+
}, /* @__PURE__ */ React15.createElement(Typography4, {
|
|
1072
1072
|
component: "span",
|
|
1073
1073
|
variant: "body1"
|
|
1074
|
-
}, age ?? /* @__PURE__ */
|
|
1074
|
+
}, age ?? /* @__PURE__ */ React15.createElement(Skeleton2, {
|
|
1075
1075
|
width: 115
|
|
1076
1076
|
}))));
|
|
1077
1077
|
}, "BlockEpochTableCellInner");
|
|
@@ -1080,12 +1080,12 @@ var BlockEpochTableCellInner = /* @__PURE__ */ __name(({ epoch, linked, ...props
|
|
|
1080
1080
|
import { Link as Link2, TableCell as TableCell3, Tooltip as Tooltip3 } from "@mui/material";
|
|
1081
1081
|
import { isHash as isHash2 } from "@xylabs/sdk-js";
|
|
1082
1082
|
import { usePayloadRootHash } from "@xyo-network/react-shared";
|
|
1083
|
-
import
|
|
1083
|
+
import React17, { useState as useState9 } from "react";
|
|
1084
1084
|
|
|
1085
1085
|
// src/components/FeatureNotAvailable.tsx
|
|
1086
1086
|
import { Button as Button2, Dialog, DialogActions, DialogContent, DialogTitle } from "@mui/material";
|
|
1087
|
-
import
|
|
1088
|
-
var FeatureNotAvailable = /* @__PURE__ */ __name(({ featureName = "Feature", ...props }) => /* @__PURE__ */
|
|
1087
|
+
import React16 from "react";
|
|
1088
|
+
var FeatureNotAvailable = /* @__PURE__ */ __name(({ featureName = "Feature", ...props }) => /* @__PURE__ */ React16.createElement(Dialog, props, /* @__PURE__ */ React16.createElement(DialogTitle, null, `${featureName} Not Available`), /* @__PURE__ */ React16.createElement(DialogContent, null, "This feature is not currently available. Either you do not have access to it or it is currently undergoing maintenance."), /* @__PURE__ */ React16.createElement(DialogActions, null, /* @__PURE__ */ React16.createElement(Button2, {
|
|
1089
1089
|
onClick: /* @__PURE__ */ __name((e) => props.onClose?.(e, "backdropClick"), "onClick")
|
|
1090
1090
|
}, "Close"))), "FeatureNotAvailable");
|
|
1091
1091
|
|
|
@@ -1118,17 +1118,17 @@ var BlockHashTableCell = /* @__PURE__ */ __name(({ block, notAvailableDialog, li
|
|
|
1118
1118
|
const [ref, handleClick] = useLinkedBlockItem("block-hash", hash);
|
|
1119
1119
|
const [notAvailable, setNotAvailable] = useState9(false);
|
|
1120
1120
|
const shortenedHash = isHash2(hash) ? `${hash.slice(0, 4)}...${hash.slice(-5, -1)}` : void 0;
|
|
1121
|
-
return /* @__PURE__ */
|
|
1121
|
+
return /* @__PURE__ */ React17.createElement(TableCell3, {
|
|
1122
1122
|
ref,
|
|
1123
1123
|
...props
|
|
1124
|
-
}, /* @__PURE__ */
|
|
1124
|
+
}, /* @__PURE__ */ React17.createElement(Tooltip3, {
|
|
1125
1125
|
title: `Block Hash: ${hash}`
|
|
1126
|
-
}, linked ? /* @__PURE__ */
|
|
1126
|
+
}, linked ? /* @__PURE__ */ React17.createElement(Link2, {
|
|
1127
1127
|
sx: {
|
|
1128
1128
|
cursor: "pointer"
|
|
1129
1129
|
},
|
|
1130
1130
|
onClick: linked ? handleClick : () => setNotAvailable(true)
|
|
1131
|
-
}, shortenedHash ?? /* @__PURE__ */
|
|
1131
|
+
}, shortenedHash ?? /* @__PURE__ */ React17.createElement(ChipSkeleton, null)) : /* @__PURE__ */ React17.createElement("span", null, shortenedHash ?? /* @__PURE__ */ React17.createElement(ChipSkeleton, null))), notAvailableDialog && notAvailable ? /* @__PURE__ */ React17.createElement(FeatureNotAvailable, {
|
|
1132
1132
|
featureName: "Block Details",
|
|
1133
1133
|
open: notAvailable,
|
|
1134
1134
|
onClick: /* @__PURE__ */ __name(() => setNotAvailable(false), "onClick")
|
|
@@ -1142,31 +1142,31 @@ import { FlexRow as FlexRow3 } from "@xylabs/react-flexbox";
|
|
|
1142
1142
|
import { ellipsize, isHash as isHash3 } from "@xylabs/sdk-js";
|
|
1143
1143
|
import { JsonViewerEx } from "@xyo-network/react-payload-raw-info";
|
|
1144
1144
|
import { usePayloadRootHash as usePayloadRootHash2 } from "@xyo-network/react-shared";
|
|
1145
|
-
import
|
|
1145
|
+
import React18, { useState as useState10 } from "react";
|
|
1146
1146
|
var BlockJsonViewTableCell = /* @__PURE__ */ __name(({ block, ...props }) => {
|
|
1147
1147
|
const [open, setOpen] = useState10(false);
|
|
1148
1148
|
const onClose = /* @__PURE__ */ __name(() => setOpen(false), "onClose");
|
|
1149
1149
|
const hash = usePayloadRootHash2(block?.[0]);
|
|
1150
1150
|
const title = isHash3(hash) ? `JSON for ${ellipsize(hash, 5)}` : "JSON";
|
|
1151
|
-
return /* @__PURE__ */
|
|
1151
|
+
return /* @__PURE__ */ React18.createElement(TableCell4, props, /* @__PURE__ */ React18.createElement(FlexRow3, {
|
|
1152
1152
|
onClick: /* @__PURE__ */ __name((e) => e.stopPropagation(), "onClick"),
|
|
1153
1153
|
sx: {
|
|
1154
1154
|
width: "100%"
|
|
1155
1155
|
}
|
|
1156
|
-
}, /* @__PURE__ */
|
|
1156
|
+
}, /* @__PURE__ */ React18.createElement(IconButton2, {
|
|
1157
1157
|
onClick: /* @__PURE__ */ __name(() => setOpen(true), "onClick")
|
|
1158
|
-
}, /* @__PURE__ */
|
|
1158
|
+
}, /* @__PURE__ */ React18.createElement(DataObject, null)), /* @__PURE__ */ React18.createElement(Dialog2, {
|
|
1159
1159
|
open,
|
|
1160
1160
|
onClose
|
|
1161
|
-
}, /* @__PURE__ */
|
|
1161
|
+
}, /* @__PURE__ */ React18.createElement(DialogTitle2, null, title), /* @__PURE__ */ React18.createElement(DialogContent2, null, /* @__PURE__ */ React18.createElement(JsonViewerEx, {
|
|
1162
1162
|
value: block
|
|
1163
|
-
})), /* @__PURE__ */
|
|
1163
|
+
})), /* @__PURE__ */ React18.createElement(DialogActions2, {
|
|
1164
1164
|
sx: {
|
|
1165
1165
|
display: "flex",
|
|
1166
1166
|
flexDirection: "row",
|
|
1167
1167
|
justifyContent: "end"
|
|
1168
1168
|
}
|
|
1169
|
-
}, /* @__PURE__ */
|
|
1169
|
+
}, /* @__PURE__ */ React18.createElement(Button3, {
|
|
1170
1170
|
variant: "contained",
|
|
1171
1171
|
onClick: onClose
|
|
1172
1172
|
}, "Close")))));
|
|
@@ -1175,7 +1175,7 @@ var BlockJsonViewTableCell = /* @__PURE__ */ __name(({ block, ...props }) => {
|
|
|
1175
1175
|
// src/components/block/table/cell/PayloadCounts.tsx
|
|
1176
1176
|
import { Error as Error2 } from "@mui/icons-material";
|
|
1177
1177
|
import { Link as Link3, TableCell as TableCell5, Tooltip as Tooltip4 } from "@mui/material";
|
|
1178
|
-
import
|
|
1178
|
+
import React19 from "react";
|
|
1179
1179
|
var BlockPayloadCountsTableCell = /* @__PURE__ */ __name(({ block, linked, ...props }) => {
|
|
1180
1180
|
const [publicPayloads, privatePayloads, error] = usePayloadCountsFromBlock(block);
|
|
1181
1181
|
const data = block && privatePayloads !== void 0 && publicPayloads !== void 0 ? {
|
|
@@ -1185,32 +1185,32 @@ var BlockPayloadCountsTableCell = /* @__PURE__ */ __name(({ block, linked, ...pr
|
|
|
1185
1185
|
} : void 0;
|
|
1186
1186
|
const payloadCount = (publicPayloads ?? 0) + (privatePayloads ?? 0);
|
|
1187
1187
|
const [ref, handleClick] = useLinkedBlockItem("payload-counts", data);
|
|
1188
|
-
return /* @__PURE__ */
|
|
1188
|
+
return /* @__PURE__ */ React19.createElement(TableCell5, {
|
|
1189
1189
|
ref,
|
|
1190
1190
|
...props
|
|
1191
|
-
}, /* @__PURE__ */
|
|
1191
|
+
}, /* @__PURE__ */ React19.createElement("span", null, error ? /* @__PURE__ */ React19.createElement(Tooltip4, {
|
|
1192
1192
|
title: error.message
|
|
1193
|
-
}, /* @__PURE__ */
|
|
1193
|
+
}, /* @__PURE__ */ React19.createElement(Error2, {
|
|
1194
1194
|
color: "error"
|
|
1195
|
-
})) : null, linked ? /* @__PURE__ */
|
|
1195
|
+
})) : null, linked ? /* @__PURE__ */ React19.createElement(Tooltip4, {
|
|
1196
1196
|
title: `Public Payloads: ${publicPayloads ?? "--"} Private Payloads: ${privatePayloads ?? "--"}`
|
|
1197
|
-
}, /* @__PURE__ */
|
|
1197
|
+
}, /* @__PURE__ */ React19.createElement(Link3, {
|
|
1198
1198
|
onClick: handleClick,
|
|
1199
1199
|
sx: {
|
|
1200
1200
|
cursor: "pointer"
|
|
1201
1201
|
}
|
|
1202
|
-
}, payloadCount)) : /* @__PURE__ */
|
|
1202
|
+
}, payloadCount)) : /* @__PURE__ */ React19.createElement(Tooltip4, {
|
|
1203
1203
|
title: `Public Payloads: ${publicPayloads ?? "--"} Private Payloads: ${privatePayloads ?? "--"}`
|
|
1204
|
-
}, /* @__PURE__ */
|
|
1204
|
+
}, /* @__PURE__ */ React19.createElement("span", null, payloadCount))));
|
|
1205
1205
|
}, "BlockPayloadCountsTableCell");
|
|
1206
1206
|
|
|
1207
1207
|
// src/components/block/table/cell/Producer.tsx
|
|
1208
1208
|
import { TableCell as TableCell6, Tooltip as Tooltip5 } from "@mui/material";
|
|
1209
|
-
import
|
|
1209
|
+
import React20, { useState as useState11 } from "react";
|
|
1210
1210
|
var BlockProducerTableCell = /* @__PURE__ */ __name(({ block, linked, notAvailableDialog, producerChipProps, ...props }) => {
|
|
1211
1211
|
const [ref, handleClick] = useLinkedBlockItem("block-producer", JSON.stringify(block));
|
|
1212
1212
|
const producer = useBlockProducer(block);
|
|
1213
|
-
return /* @__PURE__ */
|
|
1213
|
+
return /* @__PURE__ */ React20.createElement(BlockProducerTableCellInner, {
|
|
1214
1214
|
address: producer,
|
|
1215
1215
|
handleClick,
|
|
1216
1216
|
linked,
|
|
@@ -1222,9 +1222,9 @@ var BlockProducerTableCell = /* @__PURE__ */ __name(({ block, linked, notAvailab
|
|
|
1222
1222
|
}, "BlockProducerTableCell");
|
|
1223
1223
|
var BlockProducerTableCellInner = /* @__PURE__ */ __name(({ address, handleClick, linked, notAvailableDialog, producerChipProps, ...props }) => {
|
|
1224
1224
|
const [notAvailable, setNotAvailable] = useState11(false);
|
|
1225
|
-
return /* @__PURE__ */
|
|
1225
|
+
return /* @__PURE__ */ React20.createElement(TableCell6, props, /* @__PURE__ */ React20.createElement(Tooltip5, {
|
|
1226
1226
|
title: `Block Producer: ${address}`
|
|
1227
|
-
}, /* @__PURE__ */
|
|
1227
|
+
}, /* @__PURE__ */ React20.createElement(BlockAddressChip, {
|
|
1228
1228
|
sx: {
|
|
1229
1229
|
cursor: "pointer"
|
|
1230
1230
|
},
|
|
@@ -1232,7 +1232,7 @@ var BlockProducerTableCellInner = /* @__PURE__ */ __name(({ address, handleClick
|
|
|
1232
1232
|
address,
|
|
1233
1233
|
toolTipTitle: `Block Producer: ${address}`,
|
|
1234
1234
|
...producerChipProps
|
|
1235
|
-
})), notAvailableDialog && notAvailable ? /* @__PURE__ */
|
|
1235
|
+
})), notAvailableDialog && notAvailable ? /* @__PURE__ */ React20.createElement(FeatureNotAvailable, {
|
|
1236
1236
|
featureName: "Producer Details",
|
|
1237
1237
|
open: notAvailable,
|
|
1238
1238
|
onClick: /* @__PURE__ */ __name(() => setNotAvailable(false), "onClick")
|
|
@@ -1242,7 +1242,7 @@ var BlockProducerTableCellInner = /* @__PURE__ */ __name(({ address, handleClick
|
|
|
1242
1242
|
// src/components/block/table/cell/TransactionCount.tsx
|
|
1243
1243
|
import { Error as Error3 } from "@mui/icons-material";
|
|
1244
1244
|
import { Link as Link4, TableCell as TableCell7, Tooltip as Tooltip6 } from "@mui/material";
|
|
1245
|
-
import
|
|
1245
|
+
import React21, { useMemo as useMemo8 } from "react";
|
|
1246
1246
|
var BlockTransactionCountTableCell = /* @__PURE__ */ __name(({ block, linked, ...props }) => {
|
|
1247
1247
|
const [transactions, error] = useTxsFromBlock(block);
|
|
1248
1248
|
const txHashes = useMemo8(() => transactions?.map(([, hash]) => hash), [
|
|
@@ -1253,14 +1253,14 @@ var BlockTransactionCountTableCell = /* @__PURE__ */ __name(({ block, linked, ..
|
|
|
1253
1253
|
block: block[0]._hash
|
|
1254
1254
|
} : void 0;
|
|
1255
1255
|
const [ref, handleClick] = useLinkedBlockItem("transaction-count", data);
|
|
1256
|
-
return /* @__PURE__ */
|
|
1256
|
+
return /* @__PURE__ */ React21.createElement(TableCell7, {
|
|
1257
1257
|
ref,
|
|
1258
1258
|
...props
|
|
1259
|
-
}, /* @__PURE__ */
|
|
1259
|
+
}, /* @__PURE__ */ React21.createElement("span", null, error ? /* @__PURE__ */ React21.createElement(Tooltip6, {
|
|
1260
1260
|
title: error.message
|
|
1261
|
-
}, /* @__PURE__ */
|
|
1261
|
+
}, /* @__PURE__ */ React21.createElement(Error3, {
|
|
1262
1262
|
color: "error"
|
|
1263
|
-
})) : null, linked ? /* @__PURE__ */
|
|
1263
|
+
})) : null, linked ? /* @__PURE__ */ React21.createElement(Link4, {
|
|
1264
1264
|
onClick: handleClick,
|
|
1265
1265
|
sx: {
|
|
1266
1266
|
cursor: "pointer"
|
|
@@ -1273,17 +1273,17 @@ import { CheckCircleOutlineRounded } from "@mui/icons-material";
|
|
|
1273
1273
|
import { TableCell as TableCell8 } from "@mui/material";
|
|
1274
1274
|
import { FlexRow as FlexRow4 } from "@xylabs/react-flexbox";
|
|
1275
1275
|
import { BWVerification as BWVerification2 } from "@xyo-network/react-boundwitness-plugin";
|
|
1276
|
-
import
|
|
1276
|
+
import React22 from "react";
|
|
1277
1277
|
var BlockVerificationTableCell = /* @__PURE__ */ __name(({ block, linked, deepValidation, ...props }) => {
|
|
1278
|
-
return /* @__PURE__ */
|
|
1278
|
+
return /* @__PURE__ */ React22.createElement(TableCell8, props, /* @__PURE__ */ React22.createElement(FlexRow4, {
|
|
1279
1279
|
onClick: /* @__PURE__ */ __name((e) => e.stopPropagation(), "onClick"),
|
|
1280
1280
|
sx: {
|
|
1281
1281
|
width: "100%"
|
|
1282
1282
|
}
|
|
1283
|
-
}, deepValidation ? /* @__PURE__ */
|
|
1283
|
+
}, deepValidation ? /* @__PURE__ */ React22.createElement(BWVerification2, {
|
|
1284
1284
|
iconColors: true,
|
|
1285
1285
|
boundwitness: block?.[0]
|
|
1286
|
-
}) : /* @__PURE__ */
|
|
1286
|
+
}) : /* @__PURE__ */ React22.createElement(CheckCircleOutlineRounded, {
|
|
1287
1287
|
color: "success"
|
|
1288
1288
|
})));
|
|
1289
1289
|
}, "BlockVerificationTableCell");
|
|
@@ -1291,57 +1291,57 @@ var BlockVerificationTableCell = /* @__PURE__ */ __name(({ block, linked, deepVa
|
|
|
1291
1291
|
// src/components/block/table/Ex.tsx
|
|
1292
1292
|
import { TableBody } from "@mui/material";
|
|
1293
1293
|
import { TableEx } from "@xyo-network/react-table";
|
|
1294
|
-
import
|
|
1294
|
+
import React24 from "react";
|
|
1295
1295
|
|
|
1296
1296
|
// src/components/block/table/head/TableHead.tsx
|
|
1297
1297
|
import { InfoOutline } from "@mui/icons-material";
|
|
1298
1298
|
import { TableCell as TableCell9, TableHead, TableRow, Tooltip as Tooltip7, Typography as Typography5 } from "@mui/material";
|
|
1299
1299
|
import { FlexRow as FlexRow5 } from "@xylabs/react-flexbox";
|
|
1300
|
-
import
|
|
1300
|
+
import React23 from "react";
|
|
1301
1301
|
var ToolTipTableCell = /* @__PURE__ */ __name(({ children, align, title, ...props }) => {
|
|
1302
|
-
return /* @__PURE__ */
|
|
1302
|
+
return /* @__PURE__ */ React23.createElement(TableCell9, {
|
|
1303
1303
|
title,
|
|
1304
1304
|
...props
|
|
1305
|
-
}, /* @__PURE__ */
|
|
1305
|
+
}, /* @__PURE__ */ React23.createElement(FlexRow5, {
|
|
1306
1306
|
justifyContent: align
|
|
1307
|
-
}, /* @__PURE__ */
|
|
1307
|
+
}, /* @__PURE__ */ React23.createElement(Typography5, {
|
|
1308
1308
|
variant: "body2"
|
|
1309
|
-
}, children), "\xA0", /* @__PURE__ */
|
|
1309
|
+
}, children), "\xA0", /* @__PURE__ */ React23.createElement(Tooltip7, {
|
|
1310
1310
|
title
|
|
1311
|
-
}, /* @__PURE__ */
|
|
1311
|
+
}, /* @__PURE__ */ React23.createElement(InfoOutline, {
|
|
1312
1312
|
fontSize: "small"
|
|
1313
1313
|
}))));
|
|
1314
1314
|
}, "ToolTipTableCell");
|
|
1315
1315
|
var BlockchainTableHead = /* @__PURE__ */ __name(() => {
|
|
1316
|
-
return /* @__PURE__ */
|
|
1316
|
+
return /* @__PURE__ */ React23.createElement(TableHead, null, /* @__PURE__ */ React23.createElement(TableRow, null, /* @__PURE__ */ React23.createElement(ToolTipTableCell, {
|
|
1317
1317
|
align: "left",
|
|
1318
1318
|
title: "The block number that is included in the block"
|
|
1319
|
-
}, "Block"), /* @__PURE__ */
|
|
1319
|
+
}, "Block"), /* @__PURE__ */ React23.createElement(ToolTipTableCell, {
|
|
1320
1320
|
title: "The hash of the block",
|
|
1321
1321
|
sx: {
|
|
1322
1322
|
width: "20%"
|
|
1323
1323
|
}
|
|
1324
|
-
}, "Hash"), /* @__PURE__ */
|
|
1324
|
+
}, "Hash"), /* @__PURE__ */ React23.createElement(ToolTipTableCell, {
|
|
1325
1325
|
title: "The epoch of the block",
|
|
1326
1326
|
sx: {
|
|
1327
1327
|
width: "20%"
|
|
1328
1328
|
}
|
|
1329
|
-
}, "Epoch"), /* @__PURE__ */
|
|
1329
|
+
}, "Epoch"), /* @__PURE__ */ React23.createElement(ToolTipTableCell, {
|
|
1330
1330
|
align: "left",
|
|
1331
1331
|
title: "The address of the block producer that produced the block",
|
|
1332
1332
|
sx: {
|
|
1333
1333
|
width: "20%"
|
|
1334
1334
|
}
|
|
1335
|
-
}, "Block Producer"), /* @__PURE__ */
|
|
1335
|
+
}, "Block Producer"), /* @__PURE__ */ React23.createElement(ToolTipTableCell, {
|
|
1336
1336
|
align: "left",
|
|
1337
1337
|
title: "Count of transactions that are included in the block"
|
|
1338
|
-
}, "Transactions"), /* @__PURE__ */
|
|
1338
|
+
}, "Transactions"), /* @__PURE__ */ React23.createElement(ToolTipTableCell, {
|
|
1339
1339
|
align: "left",
|
|
1340
1340
|
title: "Count of public and private payload counts for the block"
|
|
1341
|
-
}, "Payloads"), /* @__PURE__ */
|
|
1341
|
+
}, "Payloads"), /* @__PURE__ */ React23.createElement(ToolTipTableCell, {
|
|
1342
1342
|
align: "center",
|
|
1343
1343
|
title: "The result of the local validation check for the block"
|
|
1344
|
-
}, "Valid"), /* @__PURE__ */
|
|
1344
|
+
}, "Valid"), /* @__PURE__ */ React23.createElement(ToolTipTableCell, {
|
|
1345
1345
|
align: "center",
|
|
1346
1346
|
title: "Link to display the raw JSON of the block"
|
|
1347
1347
|
}, "JSON")));
|
|
@@ -1349,10 +1349,10 @@ var BlockchainTableHead = /* @__PURE__ */ __name(() => {
|
|
|
1349
1349
|
|
|
1350
1350
|
// src/components/block/table/Ex.tsx
|
|
1351
1351
|
var BlockchainTableEx = /* @__PURE__ */ __name(({ ref, children, ...props }) => {
|
|
1352
|
-
return /* @__PURE__ */
|
|
1352
|
+
return /* @__PURE__ */ React24.createElement(TableEx, {
|
|
1353
1353
|
ref,
|
|
1354
1354
|
...props
|
|
1355
|
-
}, /* @__PURE__ */
|
|
1355
|
+
}, /* @__PURE__ */ React24.createElement(BlockchainTableHead, null), /* @__PURE__ */ React24.createElement(TableBody, null, children));
|
|
1356
1356
|
}, "BlockchainTableEx");
|
|
1357
1357
|
BlockchainTableEx.displayName = "BlockchainTableEx";
|
|
1358
1358
|
|
|
@@ -1360,7 +1360,7 @@ BlockchainTableEx.displayName = "BlockchainTableEx";
|
|
|
1360
1360
|
import { TableRow as TableRow2, useTheme } from "@mui/material";
|
|
1361
1361
|
import { alphaCss } from "@xylabs/react-theme";
|
|
1362
1362
|
import { usePayloadRootHash as usePayloadRootHash3 } from "@xyo-network/react-shared";
|
|
1363
|
-
import
|
|
1363
|
+
import React25, { useMemo as useMemo9 } from "react";
|
|
1364
1364
|
var BlockChainTableRow = /* @__PURE__ */ __name(({ block, deepValidation, defaultExpanded, linked, sx, ...props }) => {
|
|
1365
1365
|
const linkedTableCellProps = useMemo9(() => ({
|
|
1366
1366
|
block,
|
|
@@ -1377,7 +1377,7 @@ var BlockChainTableRow = /* @__PURE__ */ __name(({ block, deepValidation, defaul
|
|
|
1377
1377
|
const hash = usePayloadRootHash3(block?.[0]);
|
|
1378
1378
|
const [ref, handleClick] = useLinkedBlockItem("block-hash", hash);
|
|
1379
1379
|
const theme = useTheme();
|
|
1380
|
-
return /* @__PURE__ */
|
|
1380
|
+
return /* @__PURE__ */ React25.createElement(TableRow2, {
|
|
1381
1381
|
onClick: linked ? handleClick : void 0,
|
|
1382
1382
|
ref,
|
|
1383
1383
|
sx: {
|
|
@@ -1389,46 +1389,47 @@ var BlockChainTableRow = /* @__PURE__ */ __name(({ block, deepValidation, defaul
|
|
|
1389
1389
|
...sx
|
|
1390
1390
|
},
|
|
1391
1391
|
...props
|
|
1392
|
-
}, /* @__PURE__ */
|
|
1392
|
+
}, /* @__PURE__ */ React25.createElement(BlockNumberTableCell, {
|
|
1393
1393
|
align: "left",
|
|
1394
1394
|
...linkedTableCellProps
|
|
1395
|
-
}), /* @__PURE__ */
|
|
1395
|
+
}), /* @__PURE__ */ React25.createElement(BlockHashTableCell, {
|
|
1396
1396
|
align: "left",
|
|
1397
1397
|
...linkedTableCellProps
|
|
1398
|
-
}), /* @__PURE__ */
|
|
1398
|
+
}), /* @__PURE__ */ React25.createElement(BlockEpochTableCell, {
|
|
1399
1399
|
align: "left",
|
|
1400
1400
|
...linkedTableCellProps
|
|
1401
|
-
}), /* @__PURE__ */
|
|
1401
|
+
}), /* @__PURE__ */ React25.createElement(BlockProducerTableCell, {
|
|
1402
1402
|
align: "left",
|
|
1403
1403
|
...linkedTableCellProps
|
|
1404
|
-
}), /* @__PURE__ */
|
|
1404
|
+
}), /* @__PURE__ */ React25.createElement(BlockTransactionCountTableCell, {
|
|
1405
1405
|
align: "left",
|
|
1406
1406
|
...linkedTableCellProps
|
|
1407
|
-
}), /* @__PURE__ */
|
|
1407
|
+
}), /* @__PURE__ */ React25.createElement(BlockPayloadCountsTableCell, {
|
|
1408
1408
|
align: "left",
|
|
1409
1409
|
...linkedTableCellProps
|
|
1410
|
-
}), /* @__PURE__ */
|
|
1410
|
+
}), /* @__PURE__ */ React25.createElement(BlockVerificationTableCell, {
|
|
1411
1411
|
deepValidation,
|
|
1412
1412
|
...defaultTableCellProps
|
|
1413
|
-
}), /* @__PURE__ */
|
|
1413
|
+
}), /* @__PURE__ */ React25.createElement(BlockJsonViewTableCell, defaultTableCellProps));
|
|
1414
1414
|
}, "BlockChainTableRow");
|
|
1415
1415
|
|
|
1416
1416
|
// src/components/account/table/cell/AddressTableCell.tsx
|
|
1417
1417
|
import { TableCell as TableCell10, Tooltip as Tooltip8 } from "@mui/material";
|
|
1418
1418
|
import { useEvent as useEvent4 } from "@xyo-network/react-event";
|
|
1419
|
+
import React26 from "react";
|
|
1419
1420
|
var AddressTableCell = /* @__PURE__ */ __name(({ address, linked, toolTipTitle, sx, ...props }) => {
|
|
1420
1421
|
const [ref, dispatch] = useEvent4();
|
|
1421
1422
|
const handleClick = /* @__PURE__ */ __name(() => dispatch("address", "click", address), "handleClick");
|
|
1422
|
-
return /* @__PURE__ */
|
|
1423
|
+
return /* @__PURE__ */ React26.createElement(TableCell10, {
|
|
1423
1424
|
ref,
|
|
1424
1425
|
sx: {
|
|
1425
1426
|
cursor: linked ? "pointer" : "default",
|
|
1426
1427
|
...sx
|
|
1427
1428
|
},
|
|
1428
1429
|
...props
|
|
1429
|
-
}, /* @__PURE__ */
|
|
1430
|
+
}, /* @__PURE__ */ React26.createElement(Tooltip8, {
|
|
1430
1431
|
title: toolTipTitle
|
|
1431
|
-
}, /* @__PURE__ */
|
|
1432
|
+
}, /* @__PURE__ */ React26.createElement(BlockAddressChip, {
|
|
1432
1433
|
address,
|
|
1433
1434
|
onClick: handleClick
|
|
1434
1435
|
})));
|
|
@@ -1438,19 +1439,20 @@ var AddressTableCell = /* @__PURE__ */ __name(({ address, linked, toolTipTitle,
|
|
|
1438
1439
|
import { Link as Link5, TableCell as TableCell11, Tooltip as Tooltip9, Typography as Typography6 } from "@mui/material";
|
|
1439
1440
|
import { ellipsize as ellipsize2, isDefined as isDefined4 } from "@xylabs/sdk-js";
|
|
1440
1441
|
import { useEvent as useEvent5 } from "@xyo-network/react-event";
|
|
1442
|
+
import React27 from "react";
|
|
1441
1443
|
var HashTableCell = /* @__PURE__ */ __name(({ hash, linked, toolTipTitle, sx, ...props }) => {
|
|
1442
1444
|
const [ref, dispatch] = useEvent5();
|
|
1443
1445
|
const handleClick = /* @__PURE__ */ __name(() => dispatch("tx-hash", "click", hash), "handleClick");
|
|
1444
1446
|
const shortenedHash = isDefined4(hash) ? ellipsize2(hash, 6) : "N/A";
|
|
1445
|
-
return /* @__PURE__ */
|
|
1447
|
+
return /* @__PURE__ */ React27.createElement(TableCell11, {
|
|
1446
1448
|
ref,
|
|
1447
1449
|
...props
|
|
1448
|
-
}, hash ? /* @__PURE__ */
|
|
1450
|
+
}, hash ? /* @__PURE__ */ React27.createElement(Tooltip9, {
|
|
1449
1451
|
title: toolTipTitle
|
|
1450
|
-
}, /* @__PURE__ */
|
|
1452
|
+
}, /* @__PURE__ */ React27.createElement(Typography6, {
|
|
1451
1453
|
component: "span",
|
|
1452
1454
|
variant: "body1"
|
|
1453
|
-
}, linked ? /* @__PURE__ */
|
|
1455
|
+
}, linked ? /* @__PURE__ */ React27.createElement(Link5, {
|
|
1454
1456
|
onClick: handleClick,
|
|
1455
1457
|
sx: {
|
|
1456
1458
|
cursor: "pointer"
|
|
@@ -1463,6 +1465,7 @@ import { Link as Link6, TableCell as TableCell12, Tooltip as Tooltip10 } from "@
|
|
|
1463
1465
|
import { isDefined as isDefined5, toHex as toHex3 } from "@xylabs/sdk-js";
|
|
1464
1466
|
import { useEvent as useEvent6 } from "@xyo-network/react-event";
|
|
1465
1467
|
import { XL1Amount as XL1Amount2 } from "@xyo-network/xl1-protocol";
|
|
1468
|
+
import React28 from "react";
|
|
1466
1469
|
var RawAmountTableCell = /* @__PURE__ */ __name(({ amount, linked, sx, type, ...props }) => {
|
|
1467
1470
|
const [ref, dispatch] = useEvent6();
|
|
1468
1471
|
const handleClick = /* @__PURE__ */ __name(() => dispatch("amount", "click", isDefined5(amount) ? toHex3(amount) : ""), "handleClick");
|
|
@@ -1479,17 +1482,17 @@ var RawAmountTableCell = /* @__PURE__ */ __name(({ amount, linked, sx, type, ...
|
|
|
1479
1482
|
locale: navigator.language
|
|
1480
1483
|
});
|
|
1481
1484
|
}, "formatAmount");
|
|
1482
|
-
return /* @__PURE__ */
|
|
1485
|
+
return /* @__PURE__ */ React28.createElement(TableCell12, {
|
|
1483
1486
|
ref,
|
|
1484
1487
|
...props
|
|
1485
|
-
}, /* @__PURE__ */
|
|
1488
|
+
}, /* @__PURE__ */ React28.createElement(Tooltip10, {
|
|
1486
1489
|
title: `Raw Amount: ${amount}`
|
|
1487
|
-
}, linked ? /* @__PURE__ */
|
|
1490
|
+
}, linked ? /* @__PURE__ */ React28.createElement(Link6, {
|
|
1488
1491
|
onClick: handleClick,
|
|
1489
1492
|
sx: {
|
|
1490
1493
|
cursor: "pointer"
|
|
1491
1494
|
}
|
|
1492
|
-
}, type === "send" ? "-" : "", formatAmount(amount)) : /* @__PURE__ */
|
|
1495
|
+
}, type === "send" ? "-" : "", formatAmount(amount)) : /* @__PURE__ */ React28.createElement("span", null, type === "send" ? "-" : "", formatAmount(amount))));
|
|
1493
1496
|
}, "RawAmountTableCell");
|
|
1494
1497
|
|
|
1495
1498
|
// src/components/account/table/BalanceHistoryTableRow.tsx
|
|
@@ -1500,31 +1503,31 @@ var BalanceHistoryTableRow = /* @__PURE__ */ __name(({ linked, row, ...props })
|
|
|
1500
1503
|
}), [
|
|
1501
1504
|
linked
|
|
1502
1505
|
]);
|
|
1503
|
-
return /* @__PURE__ */
|
|
1506
|
+
return /* @__PURE__ */ React29.createElement(TableRow3, {
|
|
1504
1507
|
key,
|
|
1505
1508
|
...props
|
|
1506
|
-
}, /* @__PURE__ */
|
|
1509
|
+
}, /* @__PURE__ */ React29.createElement(HashTableCell, {
|
|
1507
1510
|
hash: txHash,
|
|
1508
1511
|
toolTipTitle: `Transaction Hash: ${txHash}`,
|
|
1509
1512
|
...linkedTableCallProps
|
|
1510
|
-
}), /* @__PURE__ */
|
|
1513
|
+
}), /* @__PURE__ */ React29.createElement(BlockNumberTableCellInner, {
|
|
1511
1514
|
blockNumber,
|
|
1512
1515
|
...linkedTableCallProps
|
|
1513
|
-
}), /* @__PURE__ */
|
|
1516
|
+
}), /* @__PURE__ */ React29.createElement(BlockEpochTableCellInner, {
|
|
1514
1517
|
epoch: timestamp,
|
|
1515
1518
|
...linkedTableCallProps
|
|
1516
|
-
}), /* @__PURE__ */
|
|
1519
|
+
}), /* @__PURE__ */ React29.createElement(AddressTableCell, {
|
|
1517
1520
|
address: from,
|
|
1518
1521
|
toolTipTitle: `From Address: ${from}`,
|
|
1519
1522
|
...linkedTableCallProps
|
|
1520
|
-
}), /* @__PURE__ */
|
|
1523
|
+
}), /* @__PURE__ */ React29.createElement(AddressTableCell, {
|
|
1521
1524
|
address: to,
|
|
1522
1525
|
toolTipTitle: `To Address: ${to}`,
|
|
1523
1526
|
...linkedTableCallProps
|
|
1524
|
-
}), /* @__PURE__ */
|
|
1527
|
+
}), /* @__PURE__ */ React29.createElement(RawAmountTableCell, {
|
|
1525
1528
|
amount,
|
|
1526
1529
|
type
|
|
1527
|
-
}), /* @__PURE__ */
|
|
1530
|
+
}), /* @__PURE__ */ React29.createElement(TableCell13, null, /* @__PURE__ */ React29.createElement(RawInfoIconButton, {
|
|
1528
1531
|
rawValue: debug
|
|
1529
1532
|
})));
|
|
1530
1533
|
}, "BalanceHistoryTableRow");
|
|
@@ -1542,9 +1545,9 @@ var TableHeadingLabels = [
|
|
|
1542
1545
|
|
|
1543
1546
|
// src/components/account/table/BalanceHistoryTableEx.tsx
|
|
1544
1547
|
var AccountBalanceHistoryTableEx = /* @__PURE__ */ __name(({ history, linked, ...props }) => {
|
|
1545
|
-
return isDefined6(history) ? /* @__PURE__ */
|
|
1548
|
+
return isDefined6(history) ? /* @__PURE__ */ React30.createElement(TableEx2, props, /* @__PURE__ */ React30.createElement(TableHead2, null, /* @__PURE__ */ React30.createElement(TableRow4, null, TableHeadingLabels.map((heading) => /* @__PURE__ */ React30.createElement(TableCell14, {
|
|
1546
1549
|
key: heading
|
|
1547
|
-
}, heading)))), /* @__PURE__ */
|
|
1550
|
+
}, heading)))), /* @__PURE__ */ React30.createElement(TableBody2, null, history?.map((row) => /* @__PURE__ */ React30.createElement(BalanceHistoryTableRow, {
|
|
1548
1551
|
key: row.key,
|
|
1549
1552
|
linked,
|
|
1550
1553
|
row
|
|
@@ -1561,47 +1564,93 @@ var AccountBalanceHistoryFlexBox = /* @__PURE__ */ __name(({ address, refresh, v
|
|
|
1561
1564
|
],
|
|
1562
1565
|
history: void 0
|
|
1563
1566
|
};
|
|
1564
|
-
return isDefined7(history) && isDefined7(address) ? /* @__PURE__ */
|
|
1567
|
+
return isDefined7(history) && isDefined7(address) ? /* @__PURE__ */ React31.createElement(FlexCol3, props, /* @__PURE__ */ React31.createElement(ErrorRender3, {
|
|
1565
1568
|
error,
|
|
1566
1569
|
scope: "AccountBalanceHistoryTable"
|
|
1567
|
-
}), /* @__PURE__ */
|
|
1570
|
+
}), /* @__PURE__ */ React31.createElement(Typography7, {
|
|
1568
1571
|
variant: "h6",
|
|
1569
1572
|
gutterBottom: true
|
|
1570
|
-
}, formatBalanceMagnitude(balance)), truncated ? /* @__PURE__ */
|
|
1573
|
+
}, formatBalanceMagnitude(balance)), truncated ? /* @__PURE__ */ React31.createElement(Typography7, {
|
|
1571
1574
|
variant: "caption",
|
|
1572
1575
|
gutterBottom: true
|
|
1573
|
-
}, "Ranged Balance from", " ", history.at(-1).blockNumber, " ", "-", " ", history[0].blockNumber) : null, /* @__PURE__ */
|
|
1576
|
+
}, "Ranged Balance from", " ", history.at(-1).blockNumber, " ", "-", " ", history[0].blockNumber) : null, /* @__PURE__ */ React31.createElement(AccountBalanceHistoryTableEx, {
|
|
1574
1577
|
history
|
|
1575
1578
|
})) : null;
|
|
1576
1579
|
}, "AccountBalanceHistoryFlexBox");
|
|
1577
1580
|
|
|
1581
|
+
// src/components/account/hooks/usePagedAccountBalanceHistory.ts
|
|
1582
|
+
import { isDefined as isDefined8 } from "@xylabs/sdk-js";
|
|
1583
|
+
import { useAccountBalanceHistory as useAccountBalanceHistory2 } from "@xyo-network/react-chain-provider";
|
|
1584
|
+
import { useCallback as useCallback2, useMemo as useMemo11, useState as useState12 } from "react";
|
|
1585
|
+
var usePagedAccountBalanceHistory = /* @__PURE__ */ __name((address, viewer, maxPage = 1) => {
|
|
1586
|
+
const [updatedBlockRange, setUpdatedBlockRange] = useState12();
|
|
1587
|
+
const [pagedHistory, setPagedHistory] = useState12();
|
|
1588
|
+
const [results, error, loading] = useAccountBalanceHistory2(address, viewer, maxPage, updatedBlockRange);
|
|
1589
|
+
const { history, truncated } = results || {};
|
|
1590
|
+
useMemo11(() => {
|
|
1591
|
+
if (isDefined8(history)) {
|
|
1592
|
+
setPagedHistory((pagedHistory2) => {
|
|
1593
|
+
return [
|
|
1594
|
+
...pagedHistory2 ?? [],
|
|
1595
|
+
...history
|
|
1596
|
+
];
|
|
1597
|
+
});
|
|
1598
|
+
}
|
|
1599
|
+
}, [
|
|
1600
|
+
history
|
|
1601
|
+
]);
|
|
1602
|
+
const firstBlock = isDefined8(history) ? history.at(0)?.blockNumber : void 0;
|
|
1603
|
+
const lastBlock = isDefined8(history) ? history.at(-1)?.blockNumber : void 0;
|
|
1604
|
+
const historyComplete = isDefined8(history) && history.length === 0;
|
|
1605
|
+
const updateRange = useCallback2(() => {
|
|
1606
|
+
if (isDefined8(lastBlock) && lastBlock > 0 && truncated) {
|
|
1607
|
+
const newEndBlock = lastBlock - 1;
|
|
1608
|
+
setUpdatedBlockRange([
|
|
1609
|
+
0,
|
|
1610
|
+
newEndBlock
|
|
1611
|
+
]);
|
|
1612
|
+
}
|
|
1613
|
+
}, [
|
|
1614
|
+
firstBlock,
|
|
1615
|
+
lastBlock,
|
|
1616
|
+
truncated
|
|
1617
|
+
]);
|
|
1618
|
+
return {
|
|
1619
|
+
pagedHistory,
|
|
1620
|
+
historyComplete,
|
|
1621
|
+
updateRange,
|
|
1622
|
+
error,
|
|
1623
|
+
loading
|
|
1624
|
+
};
|
|
1625
|
+
}, "usePagedAccountBalanceHistory");
|
|
1626
|
+
|
|
1578
1627
|
// src/components/chain/controls/PollingControlsFlexbox.tsx
|
|
1579
1628
|
import { Autorenew, Pause } from "@mui/icons-material";
|
|
1580
1629
|
import { Alert as Alert3, AlertTitle as AlertTitle2, Grow, Icon as Icon2, IconButton as IconButton4, Tooltip as Tooltip11 } from "@mui/material";
|
|
1581
1630
|
import { FlexRow as FlexRow6 } from "@xylabs/react-flexbox";
|
|
1582
|
-
import
|
|
1631
|
+
import React36, { memo } from "react";
|
|
1583
1632
|
|
|
1584
1633
|
// src/components/chain/stats/Dialog.tsx
|
|
1585
1634
|
import { QueryStats } from "@mui/icons-material";
|
|
1586
1635
|
import { Dialog as Dialog3, DialogContent as DialogContent3, DialogTitle as DialogTitle3, IconButton as IconButton3 } from "@mui/material";
|
|
1587
|
-
import
|
|
1636
|
+
import React34, { useState as useState13 } from "react";
|
|
1588
1637
|
|
|
1589
1638
|
// src/components/chain/stats/producer/ProducerFlexbox.tsx
|
|
1590
1639
|
import { ListItem, styled, Typography as Typography8 } from "@mui/material";
|
|
1591
1640
|
import { ErrorRender as ErrorRender4 } from "@xylabs/react-error";
|
|
1592
1641
|
import { FlexCol as FlexCol4 } from "@xylabs/react-flexbox";
|
|
1593
1642
|
import { isChainSummaryProducers } from "@xyo-network/chain-analyze";
|
|
1594
|
-
import
|
|
1643
|
+
import React33, { useMemo as useMemo12 } from "react";
|
|
1595
1644
|
|
|
1596
1645
|
// src/components/chain/stats/producer/Table.tsx
|
|
1597
1646
|
import { Table, TableBody as TableBody3, TableCell as TableCell15, TableHead as TableHead3, TableRow as TableRow5, useTheme as useTheme2 } from "@mui/material";
|
|
1598
1647
|
import { BlockiesAvatar as BlockiesAvatar2 } from "@xyo-network/react-chain-blockies";
|
|
1599
|
-
import
|
|
1648
|
+
import React32 from "react";
|
|
1600
1649
|
var ChainProducerStatsTable = /* @__PURE__ */ __name(({ producers, ...props }) => {
|
|
1601
1650
|
const theme = useTheme2();
|
|
1602
|
-
return /* @__PURE__ */
|
|
1651
|
+
return /* @__PURE__ */ React32.createElement(Table, props, /* @__PURE__ */ React32.createElement(TableHead3, null, /* @__PURE__ */ React32.createElement(TableRow5, null, /* @__PURE__ */ React32.createElement(TableCell15, null, "Address"), /* @__PURE__ */ React32.createElement(TableCell15, null, "Blocks Produced"), /* @__PURE__ */ React32.createElement(TableCell15, null, "Rewards Earned Produced"))), /* @__PURE__ */ React32.createElement(TableBody3, null, producers?.map((producer) => /* @__PURE__ */ React32.createElement(TableRow5, {
|
|
1603
1652
|
key: producer.address
|
|
1604
|
-
}, /* @__PURE__ */
|
|
1653
|
+
}, /* @__PURE__ */ React32.createElement(TableCell15, null, /* @__PURE__ */ React32.createElement(BlockiesAvatar2, {
|
|
1605
1654
|
blockiesOptions: {
|
|
1606
1655
|
seed: producer.address
|
|
1607
1656
|
},
|
|
@@ -1609,12 +1658,12 @@ var ChainProducerStatsTable = /* @__PURE__ */ __name(({ producers, ...props }) =
|
|
|
1609
1658
|
height: theme.spacing(2.75),
|
|
1610
1659
|
width: theme.spacing(2.75)
|
|
1611
1660
|
}
|
|
1612
|
-
})), /* @__PURE__ */
|
|
1661
|
+
})), /* @__PURE__ */ React32.createElement(TableCell15, null, producer.blocksProduced.toString()), /* @__PURE__ */ React32.createElement(TableCell15, null, producer.rewardsEarned.toString())))));
|
|
1613
1662
|
}, "ChainProducerStatsTable");
|
|
1614
1663
|
|
|
1615
1664
|
// src/components/chain/stats/producer/ProducerFlexbox.tsx
|
|
1616
1665
|
var BlockProducerStatsFlexbox = /* @__PURE__ */ __name(({ payload, ...props }) => {
|
|
1617
|
-
const [producer, producerError] =
|
|
1666
|
+
const [producer, producerError] = useMemo12(() => {
|
|
1618
1667
|
if (payload) {
|
|
1619
1668
|
return isChainSummaryProducers(payload) ? [
|
|
1620
1669
|
payload
|
|
@@ -1628,19 +1677,19 @@ var BlockProducerStatsFlexbox = /* @__PURE__ */ __name(({ payload, ...props }) =
|
|
|
1628
1677
|
}, [
|
|
1629
1678
|
payload
|
|
1630
1679
|
]);
|
|
1631
|
-
const producersArray =
|
|
1680
|
+
const producersArray = useMemo12(() => Object.values(producer?.producers ?? {}), [
|
|
1632
1681
|
producer
|
|
1633
1682
|
]);
|
|
1634
|
-
return /* @__PURE__ */
|
|
1683
|
+
return /* @__PURE__ */ React33.createElement(FlexCol4, {
|
|
1635
1684
|
alignItems: "start",
|
|
1636
1685
|
gap: 1,
|
|
1637
1686
|
...props
|
|
1638
|
-
}, /* @__PURE__ */
|
|
1687
|
+
}, /* @__PURE__ */ React33.createElement(ErrorRender4, {
|
|
1639
1688
|
error: producerError,
|
|
1640
1689
|
scope: "BlockProducerStatsFlexbox"
|
|
1641
|
-
}), /* @__PURE__ */
|
|
1690
|
+
}), /* @__PURE__ */ React33.createElement(Typography8, {
|
|
1642
1691
|
fontSize: "1rem"
|
|
1643
|
-
}, "Block Producers"), /* @__PURE__ */
|
|
1692
|
+
}, "Block Producers"), /* @__PURE__ */ React33.createElement(ChainProducerStatsTable, {
|
|
1644
1693
|
producers: producersArray
|
|
1645
1694
|
}));
|
|
1646
1695
|
}, "BlockProducerStatsFlexbox");
|
|
@@ -1652,18 +1701,18 @@ var StyledListItem = styled(ListItem)(() => ({
|
|
|
1652
1701
|
// src/components/chain/stats/Dialog.tsx
|
|
1653
1702
|
var ChainAnalyzerStatsDialog = /* @__PURE__ */ __name((props) => {
|
|
1654
1703
|
const { analyzers, statsUpdated } = useChainAnalyzersContext();
|
|
1655
|
-
return /* @__PURE__ */
|
|
1704
|
+
return /* @__PURE__ */ React34.createElement(Dialog3, props, /* @__PURE__ */ React34.createElement(DialogTitle3, null, "Chain Analysis"), /* @__PURE__ */ React34.createElement(DialogContent3, null, statsUpdated > 0 ? Object.entries(analyzers).map(([id2, analyzer]) => /* @__PURE__ */ React34.createElement("div", {
|
|
1656
1705
|
key: id2
|
|
1657
|
-
}, id2 === "producers" ? /* @__PURE__ */
|
|
1706
|
+
}, id2 === "producers" ? /* @__PURE__ */ React34.createElement(BlockProducerStatsFlexbox, {
|
|
1658
1707
|
payload: analyzer.result()
|
|
1659
1708
|
}) : null)) : null));
|
|
1660
1709
|
}, "ChainAnalyzerStatsDialog");
|
|
1661
1710
|
var ChainAnalyzerStatsDialogFromContext = /* @__PURE__ */ __name((props) => {
|
|
1662
|
-
const [open, setOpen] =
|
|
1711
|
+
const [open, setOpen] = useState13(false);
|
|
1663
1712
|
const handleClose = /* @__PURE__ */ __name(() => setOpen(false), "handleClose");
|
|
1664
|
-
return /* @__PURE__ */
|
|
1713
|
+
return /* @__PURE__ */ React34.createElement(React34.Fragment, null, /* @__PURE__ */ React34.createElement(IconButton3, {
|
|
1665
1714
|
onClick: /* @__PURE__ */ __name(() => setOpen(true), "onClick")
|
|
1666
|
-
}, /* @__PURE__ */
|
|
1715
|
+
}, /* @__PURE__ */ React34.createElement(QueryStats, null)), /* @__PURE__ */ React34.createElement(ChainAnalyzerStatsDialog, {
|
|
1667
1716
|
onClose: handleClose,
|
|
1668
1717
|
open,
|
|
1669
1718
|
...props
|
|
@@ -1672,19 +1721,19 @@ var ChainAnalyzerStatsDialogFromContext = /* @__PURE__ */ __name((props) => {
|
|
|
1672
1721
|
|
|
1673
1722
|
// src/components/chain/controls/PulseSvgIcon.tsx
|
|
1674
1723
|
import { createSvgIcon, keyframes, styled as styled2 } from "@mui/material";
|
|
1675
|
-
import
|
|
1676
|
-
var PulseSvgIcon = createSvgIcon(/* @__PURE__ */
|
|
1724
|
+
import React35 from "react";
|
|
1725
|
+
var PulseSvgIcon = createSvgIcon(/* @__PURE__ */ React35.createElement("svg", {
|
|
1677
1726
|
viewBox: "0 0 80 80",
|
|
1678
1727
|
version: "1.1",
|
|
1679
1728
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1680
|
-
}, /* @__PURE__ */
|
|
1729
|
+
}, /* @__PURE__ */ React35.createElement("g", {
|
|
1681
1730
|
transform: "translate(34,34)"
|
|
1682
|
-
}, /* @__PURE__ */
|
|
1731
|
+
}, /* @__PURE__ */ React35.createElement("circle", {
|
|
1683
1732
|
className: "core",
|
|
1684
1733
|
cx: "0",
|
|
1685
1734
|
cy: "0",
|
|
1686
1735
|
r: "6"
|
|
1687
|
-
}), /* @__PURE__ */
|
|
1736
|
+
}), /* @__PURE__ */ React35.createElement("circle", {
|
|
1688
1737
|
className: "radar",
|
|
1689
1738
|
cx: "0",
|
|
1690
1739
|
cy: "0",
|
|
@@ -1748,24 +1797,24 @@ var StyledPulseSvgIcon = styled2(PulseSvgIcon)(({ theme }) => {
|
|
|
1748
1797
|
var PollingControlsFlexbox = /* @__PURE__ */ __name(({ blocksBehind, pollingState, setPollingState }) => {
|
|
1749
1798
|
const paused = pollingState === "paused";
|
|
1750
1799
|
const running = pollingState === "running";
|
|
1751
|
-
return /* @__PURE__ */
|
|
1800
|
+
return /* @__PURE__ */ React36.createElement(FlexRow6, {
|
|
1752
1801
|
justifyContent: "space-between",
|
|
1753
1802
|
width: "100%"
|
|
1754
|
-
}, /* @__PURE__ */
|
|
1803
|
+
}, /* @__PURE__ */ React36.createElement(FlexRow6, {
|
|
1755
1804
|
gap: 2
|
|
1756
|
-
}, running ? /* @__PURE__ */
|
|
1805
|
+
}, running ? /* @__PURE__ */ React36.createElement(IconButton4, {
|
|
1757
1806
|
onClick: /* @__PURE__ */ __name(() => setPollingState?.("paused"), "onClick"),
|
|
1758
1807
|
title: "Pause Block Stream"
|
|
1759
|
-
}, /* @__PURE__ */
|
|
1808
|
+
}, /* @__PURE__ */ React36.createElement(Pause, null)) : null, paused ? /* @__PURE__ */ React36.createElement(IconButton4, {
|
|
1760
1809
|
onClick: /* @__PURE__ */ __name(() => setPollingState?.("running"), "onClick"),
|
|
1761
1810
|
title: "Re-Sync Block Stream"
|
|
1762
|
-
}, /* @__PURE__ */
|
|
1811
|
+
}, /* @__PURE__ */ React36.createElement(Autorenew, null)) : null, /* @__PURE__ */ React36.createElement(ChainAnalyzerStatsDialogFromContext, null)), /* @__PURE__ */ React36.createElement(FlexRow6, {
|
|
1763
1812
|
gap: 2
|
|
1764
|
-
}, /* @__PURE__ */
|
|
1813
|
+
}, /* @__PURE__ */ React36.createElement(Grow, {
|
|
1765
1814
|
in: (blocksBehind ?? 0) > 0
|
|
1766
|
-
}, /* @__PURE__ */
|
|
1815
|
+
}, /* @__PURE__ */ React36.createElement(Tooltip11, {
|
|
1767
1816
|
title: "Click to Re-Sync"
|
|
1768
|
-
}, /* @__PURE__ */
|
|
1817
|
+
}, /* @__PURE__ */ React36.createElement(Alert3, {
|
|
1769
1818
|
sx: {
|
|
1770
1819
|
py: 0,
|
|
1771
1820
|
px: 1,
|
|
@@ -1773,11 +1822,11 @@ var PollingControlsFlexbox = /* @__PURE__ */ __name(({ blocksBehind, pollingStat
|
|
|
1773
1822
|
},
|
|
1774
1823
|
severity: "warning",
|
|
1775
1824
|
onClick: /* @__PURE__ */ __name(() => setPollingState?.("running"), "onClick")
|
|
1776
|
-
}, /* @__PURE__ */
|
|
1825
|
+
}, /* @__PURE__ */ React36.createElement(AlertTitle2, {
|
|
1777
1826
|
sx: {
|
|
1778
1827
|
mb: 0
|
|
1779
1828
|
}
|
|
1780
|
-
}, "Behind:", " ", blocksBehind)))), /* @__PURE__ */
|
|
1829
|
+
}, "Behind:", " ", blocksBehind)))), /* @__PURE__ */ React36.createElement(Icon2, null, /* @__PURE__ */ React36.createElement(StyledPulseSvgIcon, {
|
|
1781
1830
|
className: running ? "" : "paused"
|
|
1782
1831
|
}))));
|
|
1783
1832
|
}, "PollingControlsFlexbox");
|
|
@@ -1785,12 +1834,12 @@ var MemoizedPollingControlsFlexbox = /* @__PURE__ */ memo(PollingControlsFlexbox
|
|
|
1785
1834
|
|
|
1786
1835
|
// src/components/chain/dialog/Dialog.tsx
|
|
1787
1836
|
import { Button as Button4, Dialog as Dialog4, DialogActions as DialogActions3, DialogContent as DialogContent4 } from "@mui/material";
|
|
1788
|
-
import
|
|
1837
|
+
import React37 from "react";
|
|
1789
1838
|
var TransactionsDialog = /* @__PURE__ */ __name(({ onClose, ...props }) => {
|
|
1790
|
-
return /* @__PURE__ */
|
|
1839
|
+
return /* @__PURE__ */ React37.createElement(Dialog4, {
|
|
1791
1840
|
onClose,
|
|
1792
1841
|
...props
|
|
1793
|
-
}, /* @__PURE__ */
|
|
1842
|
+
}, /* @__PURE__ */ React37.createElement(DialogContent4, null, "Transactions Dialog"), /* @__PURE__ */ React37.createElement(DialogActions3, null, /* @__PURE__ */ React37.createElement(Button4, {
|
|
1794
1843
|
variant: "outlined",
|
|
1795
1844
|
onClick: /* @__PURE__ */ __name((e) => onClose?.(e, "escapeKeyDown"), "onClick")
|
|
1796
1845
|
}, "Close")));
|
|
@@ -1830,9 +1879,9 @@ var useOnBlock = /* @__PURE__ */ __name((initialHeadNumber, onAddBlock, liveHead
|
|
|
1830
1879
|
|
|
1831
1880
|
// src/components/chain/pagination/BlockChainPagination.tsx
|
|
1832
1881
|
import { TablePaginationActions } from "@xyo-network/react-payload-table";
|
|
1833
|
-
import
|
|
1882
|
+
import React38 from "react";
|
|
1834
1883
|
var BlockChainPagination = /* @__PURE__ */ __name(({ count = 0, onPageChange, page, rowsPerPage = 10 }) => {
|
|
1835
|
-
return /* @__PURE__ */
|
|
1884
|
+
return /* @__PURE__ */ React38.createElement(TablePaginationActions, {
|
|
1836
1885
|
count,
|
|
1837
1886
|
onPageChange,
|
|
1838
1887
|
page,
|
|
@@ -1841,10 +1890,10 @@ var BlockChainPagination = /* @__PURE__ */ __name(({ count = 0, onPageChange, pa
|
|
|
1841
1890
|
}, "BlockChainPagination");
|
|
1842
1891
|
|
|
1843
1892
|
// src/components/chain/pagination/hooks/usePagination.tsx
|
|
1844
|
-
import { useMemo as
|
|
1893
|
+
import { useMemo as useMemo13, useState as useState14 } from "react";
|
|
1845
1894
|
var useChainPagination = /* @__PURE__ */ __name((pageSize, blockComponents) => {
|
|
1846
|
-
const [page, setPage] =
|
|
1847
|
-
const paginatedBlockComponents =
|
|
1895
|
+
const [page, setPage] = useState14(0);
|
|
1896
|
+
const paginatedBlockComponents = useMemo13(() => {
|
|
1848
1897
|
const startIndex = page * pageSize;
|
|
1849
1898
|
const endIndex = startIndex + pageSize;
|
|
1850
1899
|
return blockComponents?.slice(startIndex, endIndex);
|
|
@@ -1866,11 +1915,11 @@ var useChainPagination = /* @__PURE__ */ __name((pageSize, blockComponents) => {
|
|
|
1866
1915
|
// src/components/chain/render/static/flexbox/variants/Base.tsx
|
|
1867
1916
|
import { ErrorRender as ErrorRender5 } from "@xylabs/react-error";
|
|
1868
1917
|
import { FlexCol as FlexCol6, FlexGrowRow as FlexGrowRow2 } from "@xylabs/react-flexbox";
|
|
1869
|
-
import
|
|
1918
|
+
import React40 from "react";
|
|
1870
1919
|
|
|
1871
1920
|
// src/components/chain/list/Animated.tsx
|
|
1872
1921
|
import { AnimatedList } from "@xylabs/react-animation";
|
|
1873
|
-
import
|
|
1922
|
+
import React39 from "react";
|
|
1874
1923
|
|
|
1875
1924
|
// src/components/chain/styled/BlockListWrapperFlexbox.tsx
|
|
1876
1925
|
import { styled as styled3 } from "@mui/material";
|
|
@@ -1891,10 +1940,10 @@ var BlockListWrapperFlexBox = styled3(FlexCol5, {
|
|
|
1891
1940
|
|
|
1892
1941
|
// src/components/chain/list/Animated.tsx
|
|
1893
1942
|
var BlockListAnimated = /* @__PURE__ */ __name(({ blockChainRenderComponents }) => {
|
|
1894
|
-
return /* @__PURE__ */
|
|
1943
|
+
return /* @__PURE__ */ React39.createElement(BlockListWrapperFlexBox, {
|
|
1895
1944
|
alignItems: "stretch",
|
|
1896
1945
|
width: "100%"
|
|
1897
|
-
}, /* @__PURE__ */
|
|
1946
|
+
}, /* @__PURE__ */ React39.createElement(AnimatedList, {
|
|
1898
1947
|
fullWidth: true,
|
|
1899
1948
|
items: blockChainRenderComponents
|
|
1900
1949
|
}));
|
|
@@ -1902,12 +1951,12 @@ var BlockListAnimated = /* @__PURE__ */ __name(({ blockChainRenderComponents })
|
|
|
1902
1951
|
|
|
1903
1952
|
// src/components/chain/render/static/hooks/useStaticBlockRenderComponents.ts
|
|
1904
1953
|
import { exists } from "@xylabs/sdk-js";
|
|
1905
|
-
import { useMemo as
|
|
1954
|
+
import { useMemo as useMemo14 } from "react";
|
|
1906
1955
|
var DEFAULT_PAGE_SIZE = 25;
|
|
1907
1956
|
var useStaticBlockRenderComponents = /* @__PURE__ */ __name((BlockComponent, blockChainRenderProps) => {
|
|
1908
1957
|
const { maxBlocks } = blockChainRenderProps ?? {};
|
|
1909
1958
|
const pageSize = blockChainRenderProps?.pageSize ?? DEFAULT_PAGE_SIZE;
|
|
1910
|
-
const chainIteratorParams =
|
|
1959
|
+
const chainIteratorParams = useMemo14(() => blockChainRenderProps ?? {
|
|
1911
1960
|
name: "unknown"
|
|
1912
1961
|
}, [
|
|
1913
1962
|
blockChainRenderProps
|
|
@@ -1933,24 +1982,24 @@ var useStaticBlockRenderComponents = /* @__PURE__ */ __name((BlockComponent, blo
|
|
|
1933
1982
|
// src/components/chain/render/static/flexbox/variants/Base.tsx
|
|
1934
1983
|
var StaticListBase = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props }) => {
|
|
1935
1984
|
const { blockComponents, errors, paginatedBlockComponents, onPageChange, page, pageSize } = useStaticBlockRenderComponents(BlockHeadingFlexbox, blockChainRenderProps);
|
|
1936
|
-
return /* @__PURE__ */
|
|
1985
|
+
return /* @__PURE__ */ React40.createElement(FlexCol6, {
|
|
1937
1986
|
alignItems: "start",
|
|
1938
1987
|
gap: 2,
|
|
1939
1988
|
width: "100%",
|
|
1940
1989
|
...props
|
|
1941
|
-
}, errors?.map((error) => /* @__PURE__ */
|
|
1990
|
+
}, errors?.map((error) => /* @__PURE__ */ React40.createElement(ErrorRender5, {
|
|
1942
1991
|
error,
|
|
1943
1992
|
key: error.name,
|
|
1944
1993
|
scope: "StaticBlockchainFlexboxInner"
|
|
1945
|
-
})), (paginatedBlockComponents?.length ?? 0) > 0 ? /* @__PURE__ */
|
|
1994
|
+
})), (paginatedBlockComponents?.length ?? 0) > 0 ? /* @__PURE__ */ React40.createElement(FlexGrowRow2, {
|
|
1946
1995
|
justifyContent: "space-between",
|
|
1947
1996
|
width: "100%"
|
|
1948
|
-
}, /* @__PURE__ */
|
|
1997
|
+
}, /* @__PURE__ */ React40.createElement(ChainAnalyzerStatsDialogFromContext, null), /* @__PURE__ */ React40.createElement(BlockChainPagination, {
|
|
1949
1998
|
count: blockComponents?.length ?? 0,
|
|
1950
1999
|
onPageChange,
|
|
1951
2000
|
page,
|
|
1952
2001
|
rowsPerPage: pageSize
|
|
1953
|
-
})) : null, /* @__PURE__ */
|
|
2002
|
+
})) : null, /* @__PURE__ */ React40.createElement(BlockListAnimated, {
|
|
1954
2003
|
blockChainRenderComponents: paginatedBlockComponents
|
|
1955
2004
|
}));
|
|
1956
2005
|
}, "StaticListBase");
|
|
@@ -1958,10 +2007,10 @@ var StaticListBase = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props }
|
|
|
1958
2007
|
// src/components/chain/render/static/flexbox/variants/WithAnalysis.tsx
|
|
1959
2008
|
import { isAddress } from "@xylabs/sdk-js";
|
|
1960
2009
|
import { ChainProducersAnalyzer } from "@xyo-network/chain-analyze";
|
|
1961
|
-
import
|
|
2010
|
+
import React41, { useMemo as useMemo15 } from "react";
|
|
1962
2011
|
var WithAnalysis = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props }) => {
|
|
1963
2012
|
const { chainId } = blockChainRenderProps ?? {};
|
|
1964
|
-
const analyzers =
|
|
2013
|
+
const analyzers = useMemo15(() => {
|
|
1965
2014
|
if (isAddress(chainId)) {
|
|
1966
2015
|
return {
|
|
1967
2016
|
producers: new ChainProducersAnalyzer()
|
|
@@ -1970,9 +2019,9 @@ var WithAnalysis = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props })
|
|
|
1970
2019
|
}, [
|
|
1971
2020
|
chainId
|
|
1972
2021
|
]);
|
|
1973
|
-
return /* @__PURE__ */
|
|
2022
|
+
return /* @__PURE__ */ React41.createElement(ChainAnalyzersProvider, {
|
|
1974
2023
|
analyzers
|
|
1975
|
-
}, /* @__PURE__ */
|
|
2024
|
+
}, /* @__PURE__ */ React41.createElement(StaticListBase, {
|
|
1976
2025
|
blockChainRenderProps,
|
|
1977
2026
|
...props
|
|
1978
2027
|
}));
|
|
@@ -1987,19 +2036,19 @@ var StaticBlockchainRenderFlexBox = {
|
|
|
1987
2036
|
// src/components/payload/builder/Flexbox.tsx
|
|
1988
2037
|
import { FlexCol as FlexCol7 } from "@xylabs/react-flexbox";
|
|
1989
2038
|
import { JsonViewerEx as JsonViewerEx2 } from "@xyo-network/react-payload-raw-info";
|
|
1990
|
-
import
|
|
2039
|
+
import React42, { useState as useState15 } from "react";
|
|
1991
2040
|
var PayloadBuilderFlexbox = /* @__PURE__ */ __name(({ BuilderComponent, onBuild, ...props }) => {
|
|
1992
|
-
const [payload, setPayload] =
|
|
2041
|
+
const [payload, setPayload] = useState15();
|
|
1993
2042
|
const onBuildLocal = /* @__PURE__ */ __name((payload2) => {
|
|
1994
2043
|
onBuild?.(payload2);
|
|
1995
2044
|
setPayload(payload2);
|
|
1996
2045
|
}, "onBuildLocal");
|
|
1997
|
-
return /* @__PURE__ */
|
|
2046
|
+
return /* @__PURE__ */ React42.createElement(FlexCol7, {
|
|
1998
2047
|
gap: 2,
|
|
1999
2048
|
...props
|
|
2000
|
-
}, /* @__PURE__ */
|
|
2049
|
+
}, /* @__PURE__ */ React42.createElement(BuilderComponent, {
|
|
2001
2050
|
onBuild: onBuildLocal
|
|
2002
|
-
}), payload ? /* @__PURE__ */
|
|
2051
|
+
}), payload ? /* @__PURE__ */ React42.createElement(JsonViewerEx2, {
|
|
2003
2052
|
value: payload
|
|
2004
2053
|
}) : null);
|
|
2005
2054
|
}, "PayloadBuilderFlexbox");
|
|
@@ -2007,13 +2056,13 @@ var PayloadBuilderFlexbox = /* @__PURE__ */ __name(({ BuilderComponent, onBuild,
|
|
|
2007
2056
|
// src/components/payload/builder/producer-intent/Form.tsx
|
|
2008
2057
|
import { Button as Button5, FormControl as FormControl5 } from "@mui/material";
|
|
2009
2058
|
import { createProducerChainStakeIntent } from "@xyo-network/chain-protocol";
|
|
2010
|
-
import
|
|
2059
|
+
import React45, { useMemo as useMemo17, useState as useState18 } from "react";
|
|
2011
2060
|
|
|
2012
2061
|
// src/components/payload/fields/BlockNumberTextField.tsx
|
|
2013
2062
|
import { FormControl as FormControl3, FormHelperText as FormHelperText2, TextField as TextField3 } from "@mui/material";
|
|
2014
|
-
import
|
|
2063
|
+
import React43, { useState as useState16 } from "react";
|
|
2015
2064
|
var BlockNumberTextField = /* @__PURE__ */ __name(({ errorMessage, onBlockNumberChanged, onChange, ...props }) => {
|
|
2016
|
-
const [blockNumber, setBlockNumber] =
|
|
2065
|
+
const [blockNumber, setBlockNumber] = useState16();
|
|
2017
2066
|
const handleChange = /* @__PURE__ */ __name((e) => {
|
|
2018
2067
|
const value = e.target.value.replaceAll(/\D/g, "");
|
|
2019
2068
|
setBlockNumber(value.length > 0 ? Number(value) : void 0);
|
|
@@ -2021,15 +2070,15 @@ var BlockNumberTextField = /* @__PURE__ */ __name(({ errorMessage, onBlockNumber
|
|
|
2021
2070
|
onChange?.(e);
|
|
2022
2071
|
}, "handleChange");
|
|
2023
2072
|
const errored = errorMessage !== void 0;
|
|
2024
|
-
return /* @__PURE__ */
|
|
2073
|
+
return /* @__PURE__ */ React43.createElement(FormControl3, {
|
|
2025
2074
|
fullWidth: true
|
|
2026
|
-
}, /* @__PURE__ */
|
|
2075
|
+
}, /* @__PURE__ */ React43.createElement(TextField3, {
|
|
2027
2076
|
error: errored,
|
|
2028
2077
|
onChange: handleChange,
|
|
2029
2078
|
type: "number",
|
|
2030
2079
|
value: blockNumber ?? "",
|
|
2031
2080
|
...props
|
|
2032
|
-
}), errored ? /* @__PURE__ */
|
|
2081
|
+
}), errored ? /* @__PURE__ */ React43.createElement(FormHelperText2, {
|
|
2033
2082
|
sx: {
|
|
2034
2083
|
color: "error.main"
|
|
2035
2084
|
}
|
|
@@ -2039,11 +2088,11 @@ var BlockNumberTextField = /* @__PURE__ */ __name(({ errorMessage, onBlockNumber
|
|
|
2039
2088
|
// src/components/payload/fields/XyoAddressTextField.tsx
|
|
2040
2089
|
import { FormControl as FormControl4, FormHelperText as FormHelperText3, TextField as TextField4 } from "@mui/material";
|
|
2041
2090
|
import { asAddress, isAddress as isAddress2 } from "@xylabs/sdk-js";
|
|
2042
|
-
import
|
|
2091
|
+
import React44, { useMemo as useMemo16, useState as useState17 } from "react";
|
|
2043
2092
|
var XyoAddressTextField = /* @__PURE__ */ __name(({ onAddressChanged, onChange, resetValue, ...props }) => {
|
|
2044
|
-
const [address, setAddress] =
|
|
2045
|
-
const [addressError, setAddressError] =
|
|
2046
|
-
|
|
2093
|
+
const [address, setAddress] = useState17("");
|
|
2094
|
+
const [addressError, setAddressError] = useState17();
|
|
2095
|
+
useMemo16(() => setAddress(""), [
|
|
2047
2096
|
resetValue
|
|
2048
2097
|
]);
|
|
2049
2098
|
const handleChange = /* @__PURE__ */ __name((event) => {
|
|
@@ -2063,15 +2112,15 @@ var XyoAddressTextField = /* @__PURE__ */ __name(({ onAddressChanged, onChange,
|
|
|
2063
2112
|
onAddressChanged?.();
|
|
2064
2113
|
}
|
|
2065
2114
|
}, "handleBlur");
|
|
2066
|
-
return /* @__PURE__ */
|
|
2115
|
+
return /* @__PURE__ */ React44.createElement(FormControl4, {
|
|
2067
2116
|
fullWidth: true
|
|
2068
|
-
}, /* @__PURE__ */
|
|
2117
|
+
}, /* @__PURE__ */ React44.createElement(TextField4, {
|
|
2069
2118
|
error: !!addressError,
|
|
2070
2119
|
onBlur: handleBlur,
|
|
2071
2120
|
onChange: handleChange,
|
|
2072
2121
|
value: address,
|
|
2073
2122
|
...props
|
|
2074
|
-
}), addressError ? /* @__PURE__ */
|
|
2123
|
+
}), addressError ? /* @__PURE__ */ React44.createElement(FormHelperText3, {
|
|
2075
2124
|
sx: {
|
|
2076
2125
|
color: "error.main"
|
|
2077
2126
|
}
|
|
@@ -2080,11 +2129,11 @@ var XyoAddressTextField = /* @__PURE__ */ __name(({ onAddressChanged, onChange,
|
|
|
2080
2129
|
|
|
2081
2130
|
// src/components/payload/builder/producer-intent/Form.tsx
|
|
2082
2131
|
var ProducerIntentBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
2083
|
-
const [delegate, setDelegate] =
|
|
2084
|
-
const [exp, setExp] =
|
|
2085
|
-
const [nbf, setNbf] =
|
|
2086
|
-
const [blockRangeError, setBlockRangeError] =
|
|
2087
|
-
const intentPayload =
|
|
2132
|
+
const [delegate, setDelegate] = useState18();
|
|
2133
|
+
const [exp, setExp] = useState18();
|
|
2134
|
+
const [nbf, setNbf] = useState18();
|
|
2135
|
+
const [blockRangeError, setBlockRangeError] = useState18();
|
|
2136
|
+
const intentPayload = useMemo17(() => {
|
|
2088
2137
|
if (exp !== void 0 && nbf !== void 0) {
|
|
2089
2138
|
if (exp <= nbf) {
|
|
2090
2139
|
setBlockRangeError(new Error("Expires must be greater than Not Before"));
|
|
@@ -2104,33 +2153,33 @@ var ProducerIntentBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
2104
2153
|
const onBuildLocal = /* @__PURE__ */ __name(() => {
|
|
2105
2154
|
if (onBuild && intentPayload) onBuild?.(intentPayload);
|
|
2106
2155
|
}, "onBuildLocal");
|
|
2107
|
-
return /* @__PURE__ */
|
|
2156
|
+
return /* @__PURE__ */ React45.createElement(React45.Fragment, null, /* @__PURE__ */ React45.createElement(FormControl5, {
|
|
2108
2157
|
fullWidth: true
|
|
2109
|
-
}, /* @__PURE__ */
|
|
2158
|
+
}, /* @__PURE__ */ React45.createElement(XyoAddressTextField, {
|
|
2110
2159
|
label: "Delegate",
|
|
2111
2160
|
name: "delegate",
|
|
2112
2161
|
onAddressChanged: setDelegate,
|
|
2113
2162
|
required: true,
|
|
2114
2163
|
size: "small"
|
|
2115
|
-
})), /* @__PURE__ */
|
|
2164
|
+
})), /* @__PURE__ */ React45.createElement(FormControl5, {
|
|
2116
2165
|
fullWidth: true
|
|
2117
|
-
}, /* @__PURE__ */
|
|
2166
|
+
}, /* @__PURE__ */ React45.createElement(BlockNumberTextField, {
|
|
2118
2167
|
errorMessage: blockRangeError?.message,
|
|
2119
2168
|
label: "Expires",
|
|
2120
2169
|
name: "exp",
|
|
2121
2170
|
onBlockNumberChanged: setExp,
|
|
2122
2171
|
required: true,
|
|
2123
2172
|
size: "small"
|
|
2124
|
-
})), /* @__PURE__ */
|
|
2173
|
+
})), /* @__PURE__ */ React45.createElement(FormControl5, {
|
|
2125
2174
|
fullWidth: true
|
|
2126
|
-
}, /* @__PURE__ */
|
|
2175
|
+
}, /* @__PURE__ */ React45.createElement(BlockNumberTextField, {
|
|
2127
2176
|
errorMessage: blockRangeError?.message,
|
|
2128
2177
|
label: "Not Before",
|
|
2129
2178
|
name: "nbf",
|
|
2130
2179
|
onBlockNumberChanged: setNbf,
|
|
2131
2180
|
required: true,
|
|
2132
2181
|
size: "small"
|
|
2133
|
-
})), /* @__PURE__ */
|
|
2182
|
+
})), /* @__PURE__ */ React45.createElement(Button5, {
|
|
2134
2183
|
disabled: !intentPayload,
|
|
2135
2184
|
variant: "contained",
|
|
2136
2185
|
onClick: onBuildLocal
|
|
@@ -2138,13 +2187,13 @@ var ProducerIntentBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
2138
2187
|
}, "ProducerIntentBuilderForm");
|
|
2139
2188
|
|
|
2140
2189
|
// src/components/payload/builder/transfer/Flexbox.tsx
|
|
2141
|
-
import
|
|
2190
|
+
import React48 from "react";
|
|
2142
2191
|
|
|
2143
2192
|
// src/components/payload/builder/transfer/Form.tsx
|
|
2144
2193
|
import { Button as Button6, FormControl as FormControl7 } from "@mui/material";
|
|
2145
2194
|
import { isAddress as isAddress4 } from "@xylabs/sdk-js";
|
|
2146
2195
|
import { TransferSchema } from "@xyo-network/xl1-protocol";
|
|
2147
|
-
import
|
|
2196
|
+
import React47, { useMemo as useMemo19, useState as useState20 } from "react";
|
|
2148
2197
|
|
|
2149
2198
|
// src/components/payload/builder/transfer/builder/SingleFlexbox.tsx
|
|
2150
2199
|
import { RemoveCircle } from "@mui/icons-material";
|
|
@@ -2152,11 +2201,11 @@ import { FormControl as FormControl6, Icon as Icon3, IconButton as IconButton5 }
|
|
|
2152
2201
|
import { FlexRow as FlexRow7 } from "@xylabs/react-flexbox";
|
|
2153
2202
|
import { isAddress as isAddress3, toHex as toHex4 } from "@xylabs/sdk-js";
|
|
2154
2203
|
import { BigIntInput } from "@xyo-network/react-shared";
|
|
2155
|
-
import
|
|
2204
|
+
import React46, { useEffect as useEffect3, useMemo as useMemo18, useState as useState19 } from "react";
|
|
2156
2205
|
var SingleTransferBuilderFlexbox = /* @__PURE__ */ __name(({ onTransferUpdated, onRemoveTransfer, singleTransfer, ...props }) => {
|
|
2157
|
-
const [toAddress3, setToAddress] =
|
|
2158
|
-
const [amount, setAmount] =
|
|
2159
|
-
const transferAmount =
|
|
2206
|
+
const [toAddress3, setToAddress] = useState19();
|
|
2207
|
+
const [amount, setAmount] = useState19();
|
|
2208
|
+
const transferAmount = useMemo18(() => {
|
|
2160
2209
|
if (isAddress3(toAddress3) && amount !== void 0) {
|
|
2161
2210
|
return {
|
|
2162
2211
|
...singleTransfer,
|
|
@@ -2173,36 +2222,36 @@ var SingleTransferBuilderFlexbox = /* @__PURE__ */ __name(({ onTransferUpdated,
|
|
|
2173
2222
|
}, [
|
|
2174
2223
|
transferAmount
|
|
2175
2224
|
]);
|
|
2176
|
-
return /* @__PURE__ */
|
|
2225
|
+
return /* @__PURE__ */ React46.createElement(FlexRow7, {
|
|
2177
2226
|
alignItems: "start",
|
|
2178
2227
|
gap: 1,
|
|
2179
2228
|
...props
|
|
2180
|
-
}, /* @__PURE__ */
|
|
2229
|
+
}, /* @__PURE__ */ React46.createElement(FormControl6, {
|
|
2181
2230
|
fullWidth: true
|
|
2182
|
-
}, /* @__PURE__ */
|
|
2231
|
+
}, /* @__PURE__ */ React46.createElement(XyoAddressTextField, {
|
|
2183
2232
|
label: "To",
|
|
2184
2233
|
name: "to",
|
|
2185
2234
|
onAddressChanged: setToAddress,
|
|
2186
2235
|
required: true,
|
|
2187
2236
|
size: "small"
|
|
2188
|
-
})), /* @__PURE__ */
|
|
2237
|
+
})), /* @__PURE__ */ React46.createElement(FormControl6, {
|
|
2189
2238
|
fullWidth: true
|
|
2190
|
-
}, /* @__PURE__ */
|
|
2239
|
+
}, /* @__PURE__ */ React46.createElement(BigIntInput.TextField, {
|
|
2191
2240
|
label: "Amount",
|
|
2192
2241
|
name: "amount",
|
|
2193
2242
|
onChangeFixedPoint: setAmount,
|
|
2194
2243
|
required: true,
|
|
2195
2244
|
size: "small"
|
|
2196
|
-
})), /* @__PURE__ */
|
|
2245
|
+
})), /* @__PURE__ */ React46.createElement(IconButton5, {
|
|
2197
2246
|
onClick: /* @__PURE__ */ __name(() => onRemoveTransfer?.(singleTransfer.transferId), "onClick")
|
|
2198
|
-
}, /* @__PURE__ */
|
|
2247
|
+
}, /* @__PURE__ */ React46.createElement(Icon3, null, /* @__PURE__ */ React46.createElement(RemoveCircle, null))));
|
|
2199
2248
|
}, "SingleTransferBuilderFlexbox");
|
|
2200
2249
|
|
|
2201
2250
|
// src/components/payload/builder/transfer/Form.tsx
|
|
2202
2251
|
var TransferBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
2203
|
-
const [fromAddress, setFromAddress] =
|
|
2204
|
-
const [transfers, setTransfers] =
|
|
2205
|
-
const transferPayload =
|
|
2252
|
+
const [fromAddress, setFromAddress] = useState20();
|
|
2253
|
+
const [transfers, setTransfers] = useState20([]);
|
|
2254
|
+
const transferPayload = useMemo19(() => {
|
|
2206
2255
|
if (isAddress4(fromAddress) && transfers.length > 0) {
|
|
2207
2256
|
const transfersRecord = {};
|
|
2208
2257
|
for (const transfer of transfers) {
|
|
@@ -2244,19 +2293,19 @@ var TransferBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
2244
2293
|
return transfer;
|
|
2245
2294
|
}));
|
|
2246
2295
|
}, "onTransferUpdated");
|
|
2247
|
-
return /* @__PURE__ */
|
|
2296
|
+
return /* @__PURE__ */ React47.createElement(React47.Fragment, null, /* @__PURE__ */ React47.createElement(FormControl7, {
|
|
2248
2297
|
fullWidth: true
|
|
2249
|
-
}, /* @__PURE__ */
|
|
2298
|
+
}, /* @__PURE__ */ React47.createElement(XyoAddressTextField, {
|
|
2250
2299
|
label: "From",
|
|
2251
2300
|
name: "from",
|
|
2252
2301
|
onAddressChanged: setFromAddress,
|
|
2253
2302
|
required: true,
|
|
2254
2303
|
size: "small"
|
|
2255
|
-
})), /* @__PURE__ */
|
|
2304
|
+
})), /* @__PURE__ */ React47.createElement(Button6, {
|
|
2256
2305
|
onClick: onTransferAdded,
|
|
2257
2306
|
size: "small",
|
|
2258
2307
|
variant: "contained"
|
|
2259
|
-
}, "Add Transfer"), transfers.map((transfer) => /* @__PURE__ */
|
|
2308
|
+
}, "Add Transfer"), transfers.map((transfer) => /* @__PURE__ */ React47.createElement(SingleTransferBuilderFlexbox, {
|
|
2260
2309
|
key: transfer.transferId,
|
|
2261
2310
|
onTransferUpdated,
|
|
2262
2311
|
onRemoveTransfer: onTransferRemoved,
|
|
@@ -2264,7 +2313,7 @@ var TransferBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
2264
2313
|
sx: {
|
|
2265
2314
|
width: "100%"
|
|
2266
2315
|
}
|
|
2267
|
-
})), /* @__PURE__ */
|
|
2316
|
+
})), /* @__PURE__ */ React47.createElement(Button6, {
|
|
2268
2317
|
disabled: !transferPayload,
|
|
2269
2318
|
variant: "contained",
|
|
2270
2319
|
onClick: onBuildLocal
|
|
@@ -2272,7 +2321,7 @@ var TransferBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
2272
2321
|
}, "TransferBuilderForm");
|
|
2273
2322
|
|
|
2274
2323
|
// src/components/payload/builder/transfer/Flexbox.tsx
|
|
2275
|
-
var TransferBuilderFlexbox = /* @__PURE__ */ __name(({ onBuild, ...props }) => /* @__PURE__ */
|
|
2324
|
+
var TransferBuilderFlexbox = /* @__PURE__ */ __name(({ onBuild, ...props }) => /* @__PURE__ */ React48.createElement(PayloadBuilderFlexbox, {
|
|
2276
2325
|
gap: 4,
|
|
2277
2326
|
alignItems: "start",
|
|
2278
2327
|
BuilderComponent: TransferBuilderForm,
|
|
@@ -2287,7 +2336,7 @@ import { MemoryArchivist } from "@xyo-network/archivist-memory";
|
|
|
2287
2336
|
import { ArchivistConfigSchema } from "@xyo-network/archivist-model";
|
|
2288
2337
|
import { buildRandomBlockChain } from "@xyo-network/react-chain-shared";
|
|
2289
2338
|
import { flattenHydratedBlocks } from "@xyo-network/xl1-protocol-sdk";
|
|
2290
|
-
import
|
|
2339
|
+
import React49, { useEffect as useEffect4 } from "react";
|
|
2291
2340
|
|
|
2292
2341
|
// src/lib/getChainArchivist.ts
|
|
2293
2342
|
import { assertEx as assertEx4 } from "@xylabs/sdk-js";
|
|
@@ -2356,7 +2405,7 @@ var ChainArchivistDecorator = /* @__PURE__ */ __name((Story, { args, ...context
|
|
|
2356
2405
|
}
|
|
2357
2406
|
}
|
|
2358
2407
|
};
|
|
2359
|
-
return blockChainRenderProps?.chainArchivist ? /* @__PURE__ */
|
|
2408
|
+
return blockChainRenderProps?.chainArchivist ? /* @__PURE__ */ React49.createElement(Story, props) : /* @__PURE__ */ React49.createElement(CircularProgress, null);
|
|
2360
2409
|
}, "ChainArchivistDecorator");
|
|
2361
2410
|
|
|
2362
2411
|
// src/stories/ChainArchivistDelayedInsertDecorator.tsx
|
|
@@ -2367,10 +2416,10 @@ import { MemoryArchivist as MemoryArchivist2 } from "@xyo-network/archivist-memo
|
|
|
2367
2416
|
import { ArchivistConfigSchema as ArchivistConfigSchema2 } from "@xyo-network/archivist-model";
|
|
2368
2417
|
import { buildRandomBlockChain as buildRandomBlockChain2 } from "@xyo-network/react-chain-shared";
|
|
2369
2418
|
import { flattenHydratedBlock } from "@xyo-network/xl1-protocol-sdk";
|
|
2370
|
-
import
|
|
2419
|
+
import React50, { useEffect as useEffect5, useState as useState21 } from "react";
|
|
2371
2420
|
var chainArchivistRef;
|
|
2372
2421
|
var ChainArchivistDelayedInsertDecorator = /* @__PURE__ */ __name((Story, context) => {
|
|
2373
|
-
const [firstBlock, setFirstBlock] =
|
|
2422
|
+
const [firstBlock, setFirstBlock] = useState21();
|
|
2374
2423
|
const [randomBlockChain] = usePromise6(async () => await buildRandomBlockChain2(), []);
|
|
2375
2424
|
const [chainArchivist] = usePromise6(async () => {
|
|
2376
2425
|
if (chainArchivistRef) {
|
|
@@ -2426,17 +2475,17 @@ var ChainArchivistDelayedInsertDecorator = /* @__PURE__ */ __name((Story, contex
|
|
|
2426
2475
|
}
|
|
2427
2476
|
}
|
|
2428
2477
|
};
|
|
2429
|
-
return firstBlock ? /* @__PURE__ */
|
|
2478
|
+
return firstBlock ? /* @__PURE__ */ React50.createElement(Story, props) : /* @__PURE__ */ React50.createElement(CircularProgress2, null);
|
|
2430
2479
|
}, "ChainArchivistDelayedInsertDecorator");
|
|
2431
2480
|
|
|
2432
2481
|
// src/stories/ChainInfoContextDecorator.tsx
|
|
2433
2482
|
import { usePromise as usePromise7 } from "@xylabs/react-promise";
|
|
2434
|
-
import { assertEx as assertEx5, isDefined as
|
|
2483
|
+
import { assertEx as assertEx5, isDefined as isDefined9 } from "@xylabs/sdk-js";
|
|
2435
2484
|
import { ChainBlockNumberIterationService as ChainBlockNumberIterationService3 } from "@xyo-network/chain-services";
|
|
2436
2485
|
import { findFirstMatching } from "@xyo-network/chain-utils";
|
|
2437
2486
|
import { isBlockBoundWitness as isBlockBoundWitness3 } from "@xyo-network/xl1-protocol";
|
|
2438
2487
|
import { readPayloadMapFromStore } from "@xyo-network/xl1-protocol-sdk";
|
|
2439
|
-
import
|
|
2488
|
+
import React51 from "react";
|
|
2440
2489
|
var archivistConfig = {
|
|
2441
2490
|
url: "http://localhost:8080",
|
|
2442
2491
|
chainArchivistModuleId: "XYOPublic:XYOChain:Chain"
|
|
@@ -2450,7 +2499,7 @@ var ChainInfoContextDecorator = /* @__PURE__ */ __name((Story, context) => {
|
|
|
2450
2499
|
return await getChainArchivistFromBridge(archivistConfig);
|
|
2451
2500
|
}, []);
|
|
2452
2501
|
const [chainIterator] = usePromise7(async () => {
|
|
2453
|
-
if (
|
|
2502
|
+
if (isDefined9(chainArchivist) && isDefined9(chainId)) {
|
|
2454
2503
|
const firstMatch = assertEx5(await findFirstMatching(chainArchivist), () => `No head found in archivist: ${chainArchivist.id} `);
|
|
2455
2504
|
const head = assertEx5(isBlockBoundWitness3(firstMatch) ? firstMatch : void 0, () => `Expected a block bound witness: ${JSON.stringify(firstMatch)}`);
|
|
2456
2505
|
const chainMap = readPayloadMapFromStore(chainArchivist);
|
|
@@ -2463,11 +2512,11 @@ var ChainInfoContextDecorator = /* @__PURE__ */ __name((Story, context) => {
|
|
|
2463
2512
|
chainArchivist,
|
|
2464
2513
|
chainId
|
|
2465
2514
|
]);
|
|
2466
|
-
return /* @__PURE__ */
|
|
2515
|
+
return /* @__PURE__ */ React51.createElement(ChainInfoProvider, {
|
|
2467
2516
|
chainArchivist,
|
|
2468
2517
|
chainId,
|
|
2469
2518
|
chainIterator
|
|
2470
|
-
}, /* @__PURE__ */
|
|
2519
|
+
}, /* @__PURE__ */ React51.createElement(Story, context));
|
|
2471
2520
|
}, "ChainInfoContextDecorator");
|
|
2472
2521
|
export {
|
|
2473
2522
|
AccountBalanceHistoryFlexBox,
|
|
@@ -2534,6 +2583,7 @@ export {
|
|
|
2534
2583
|
useDynamicBlockComponents,
|
|
2535
2584
|
useIterateChain,
|
|
2536
2585
|
useOnBlock,
|
|
2586
|
+
usePagedAccountBalanceHistory,
|
|
2537
2587
|
usePayloadCountsFromBlock,
|
|
2538
2588
|
useStaticBlockComponents,
|
|
2539
2589
|
useTxsFromBlock
|