@xyo-network/react-chain-boundwitness 1.8.4 → 1.10.0

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.
@@ -1,6 +1,3 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
1
  // src/components/block/BlockBoundWitnessDetails.tsx
5
2
  import { filterAs } from "@xylabs/array";
6
3
  import { ErrorRender as ErrorRender2 } from "@xylabs/react-error";
@@ -9,11 +6,16 @@ import { usePromise as usePromise3 } from "@xylabs/react-promise";
9
6
  import { isBoundWitness } from "@xyo-network/boundwitness-model";
10
7
  import { HydratedBlockWrapper } from "@xyo-network/chain-wrappers";
11
8
  import { PayloadBuilder } from "@xyo-network/payload-builder";
12
- import { BoundWitnessPayloadsTable, BoundWitnessSignatureTable, HashHeadingPaper, HeadingPaper as HeadingPaper2 } from "@xyo-network/react-boundwitness-plugin";
9
+ import {
10
+ BoundWitnessPayloadsTable,
11
+ BoundWitnessSignatureTable,
12
+ HashHeadingPaper,
13
+ HeadingPaper as HeadingPaper2
14
+ } from "@xyo-network/react-boundwitness-plugin";
13
15
  import { useTxsFromBlock } from "@xyo-network/react-chain-blockchain";
14
16
  import { usePayloadHash as usePayloadHash2 } from "@xyo-network/react-shared";
15
17
  import { isTransactionBoundWitness } from "@xyo-network/xl1-protocol";
16
- import React6, { useMemo as useMemo3 } from "react";
18
+ import { useMemo as useMemo3 } from "react";
17
19
  import { FaSignature } from "react-icons/fa";
18
20
  import { GrTransaction } from "react-icons/gr";
19
21
  import { VscSymbolMethod as VscSymbolMethod2, VscSymbolNamespace as VscSymbolNamespace2 } from "react-icons/vsc";
@@ -21,79 +23,78 @@ import { VscSymbolMethod as VscSymbolMethod2, VscSymbolNamespace as VscSymbolNam
21
23
  // src/lib/formatFees.ts
22
24
  import { isUndefined } from "@xylabs/typeof";
23
25
  import { bigIntToFixedPointString } from "@xyo-network/chain-utils";
24
- var formatFee = /* @__PURE__ */ __name((fee) => {
26
+ var formatFee = (fee) => {
25
27
  if (isUndefined(fee)) return "N/A";
26
28
  const stringValue = bigIntToFixedPointString(fee, 12);
27
29
  if (stringValue === "0") return stringValue;
28
30
  return stringValue;
29
- }, "formatFee");
31
+ };
30
32
 
31
33
  // src/lib/formatNumber.ts
32
- var formatNumber = /* @__PURE__ */ __name((num) => {
34
+ var formatNumber = (num) => {
33
35
  return num.toLocaleString(navigator.language ?? "en-US");
34
- }, "formatNumber");
36
+ };
35
37
 
36
38
  // src/lib/formatPayloadsForTable.ts
37
- var formatPayloadsForTable = /* @__PURE__ */ __name((pairs) => {
39
+ var formatPayloadsForTable = (pairs) => {
38
40
  let hashes = [];
39
41
  let schemas = [];
40
42
  for (const [bw, hash] of pairs ?? []) {
41
43
  hashes.push(hash);
42
44
  schemas.push(bw?.schema ?? "");
43
45
  }
44
- return {
45
- hashes,
46
- schemas
47
- };
48
- }, "formatPayloadsForTable");
46
+ return { hashes, schemas };
47
+ };
49
48
 
50
49
  // src/lib/formatResults.ts
51
- var formatResults = /* @__PURE__ */ __name((results) => {
52
- const result = {
53
- labels: [],
54
- values: []
55
- };
50
+ var formatResults = (results) => {
51
+ const result = { labels: [], values: [] };
56
52
  for (const [label, value] of Object.entries(results)) {
57
53
  result.labels.push(label);
58
54
  result.values.push(value);
59
55
  }
60
56
  return result;
61
- }, "formatResults");
57
+ };
62
58
 
63
59
  // src/components/PayloadTable.tsx
64
60
  import { InfoOutline } from "@mui/icons-material";
65
61
  import { Tooltip } from "@mui/material";
66
62
  import { FlexCol } from "@xylabs/react-flexbox";
67
63
  import { isDefined } from "@xylabs/typeof";
68
- import { BoundWitnessPayloadTableBody, BoundWitnessPayloadTableHead, HeadingPaper } from "@xyo-network/react-boundwitness-plugin";
64
+ import {
65
+ BoundWitnessPayloadTableBody,
66
+ BoundWitnessPayloadTableHead,
67
+ HeadingPaper
68
+ } from "@xyo-network/react-boundwitness-plugin";
69
69
  import { TableEx } from "@xyo-network/react-table";
70
- import React from "react";
71
70
  import { VscSymbolMethod } from "react-icons/vsc";
72
- var PayloadTableFlexbox = /* @__PURE__ */ __name(({ IconComponent, eventNoun, hashes, schemas, headingTitle, clickableFields, tooltip, ...props }) => {
73
- const resolvedIconComponent = IconComponent ?? /* @__PURE__ */ React.createElement(VscSymbolMethod, null);
74
- return /* @__PURE__ */ React.createElement(FlexCol, {
75
- alignItems: "stretch",
76
- rowGap: 1,
77
- ...props
78
- }, /* @__PURE__ */ React.createElement(HeadingPaper, {
79
- AdornmentEnd: isDefined(tooltip) ? /* @__PURE__ */ React.createElement(Tooltip, {
80
- title: tooltip
81
- }, /* @__PURE__ */ React.createElement(InfoOutline, {
82
- fontSize: "small",
83
- sx: {
84
- py: 2,
85
- px: 1
71
+ import { jsx, jsxs } from "react/jsx-runtime";
72
+ var PayloadTableFlexbox = ({
73
+ IconComponent,
74
+ eventNoun,
75
+ hashes,
76
+ schemas,
77
+ headingTitle,
78
+ clickableFields,
79
+ tooltip,
80
+ ...props
81
+ }) => {
82
+ const resolvedIconComponent = IconComponent ?? /* @__PURE__ */ jsx(VscSymbolMethod, {});
83
+ return /* @__PURE__ */ jsxs(FlexCol, { alignItems: "stretch", rowGap: 1, ...props, children: [
84
+ /* @__PURE__ */ jsx(
85
+ HeadingPaper,
86
+ {
87
+ AdornmentEnd: isDefined(tooltip) ? /* @__PURE__ */ jsx(Tooltip, { title: tooltip, children: /* @__PURE__ */ jsx(InfoOutline, { fontSize: "small", sx: { py: 2, px: 1 } }) }) : null,
88
+ IconComponent: resolvedIconComponent,
89
+ heading: headingTitle
86
90
  }
87
- })) : null,
88
- IconComponent: resolvedIconComponent,
89
- heading: headingTitle
90
- }), /* @__PURE__ */ React.createElement(TableEx, null, /* @__PURE__ */ React.createElement(BoundWitnessPayloadTableHead, null), /* @__PURE__ */ React.createElement(BoundWitnessPayloadTableBody, {
91
- payloadHashes: hashes,
92
- payloadSchemas: schemas,
93
- eventNoun,
94
- clickableFields
95
- })));
96
- }, "PayloadTableFlexbox");
91
+ ),
92
+ /* @__PURE__ */ jsxs(TableEx, { children: [
93
+ /* @__PURE__ */ jsx(BoundWitnessPayloadTableHead, {}),
94
+ /* @__PURE__ */ jsx(BoundWitnessPayloadTableBody, { payloadHashes: hashes, payloadSchemas: schemas, eventNoun, clickableFields })
95
+ ] })
96
+ ] });
97
+ };
97
98
 
98
99
  // src/components/block/card/actions/BlockBoundWitnessActions.tsx
99
100
  import { DataObject as DataObjectIcon } from "@mui/icons-material";
@@ -102,7 +103,6 @@ import { FlexRow } from "@xylabs/react-flexbox";
102
103
  import { QuickTipButton } from "@xylabs/react-quick-tip-button";
103
104
  import { BWPreviousHashQuickTipButton } from "@xyo-network/react-boundwitness-plugin";
104
105
  import { usePayloadHash } from "@xyo-network/react-shared";
105
- import React3 from "react";
106
106
 
107
107
  // src/components/block/card/actions/BlockBoundWitnessVerification.tsx
108
108
  import { CancelRounded as CancelRoundedIcon } from "@mui/icons-material";
@@ -112,22 +112,17 @@ import { usePromise } from "@xylabs/react-promise";
112
112
  import { isDefined as isDefined2 } from "@xylabs/typeof";
113
113
  import { validateBlock } from "@xyo-network/chain-validation";
114
114
  import { isBlockBoundWitness } from "@xyo-network/xl1-protocol";
115
- import React2, { useMemo } from "react";
116
- var InvalidIcon = /* @__PURE__ */ __name(({ ref, ...props }) => /* @__PURE__ */ React2.createElement(CancelRoundedIcon, {
117
- color: "error",
118
- ref,
119
- ...props
120
- }), "InvalidIcon");
115
+ import { useMemo } from "react";
116
+ import { jsx as jsx2 } from "react/jsx-runtime";
117
+ var InvalidIcon = ({ ref, ...props }) => /* @__PURE__ */ jsx2(CancelRoundedIcon, { color: "error", ref, ...props });
121
118
  InvalidIcon.displayName = "InvalidIcon";
122
- var BlockBoundWitnessVerification = /* @__PURE__ */ __name(({ block, ...props }) => {
119
+ var BlockBoundWitnessVerification = ({ block, ...props }) => {
123
120
  const [validationErrors, validateError] = usePromise(async () => {
124
121
  if (isDefined2(block)) {
125
122
  const resolvedBlock = assertEx(isBlockBoundWitness(block) ? block : void 0, () => "Block must be a BlockBoundWitness");
126
123
  return await validateBlock(resolvedBlock);
127
124
  }
128
- }, [
129
- block
130
- ]);
125
+ }, [block]);
131
126
  const resolvedErrors = useMemo(() => {
132
127
  const errors = [];
133
128
  if (isDefined2(validationErrors)) {
@@ -136,98 +131,101 @@ var BlockBoundWitnessVerification = /* @__PURE__ */ __name(({ block, ...props })
136
131
  if (isDefined2(validateError)) errors.push(validateError);
137
132
  return errors;
138
133
  }
139
- }, [
140
- validateError,
141
- validationErrors
142
- ]);
143
- return /* @__PURE__ */ React2.createElement(ErrorQuickTipButton, {
144
- boundWitnessType: "Block",
145
- errors: resolvedErrors,
146
- ...props
147
- });
148
- }, "BlockBoundWitnessVerification");
134
+ }, [validateError, validationErrors]);
135
+ return /* @__PURE__ */ jsx2(ErrorQuickTipButton, { boundWitnessType: "Block", errors: resolvedErrors, ...props });
136
+ };
149
137
 
150
138
  // src/components/block/card/actions/BlockBoundWitnessActions.tsx
151
- var BlockBoundWitnessActions = /* @__PURE__ */ __name(({ boundwitness, validationIconColors = false, ...props }) => {
139
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
140
+ var BlockBoundWitnessActions = ({
141
+ boundwitness,
142
+ validationIconColors = false,
143
+ ...props
144
+ }) => {
152
145
  const hash = usePayloadHash(boundwitness);
153
- return /* @__PURE__ */ React3.createElement(FlexRow, props, boundwitness?.previous_hashes.length === 0 ? null : /* @__PURE__ */ React3.createElement(BWPreviousHashQuickTipButton, {
154
- boundwitness
155
- }), /* @__PURE__ */ React3.createElement(BlockBoundWitnessVerification, {
156
- iconColors: validationIconColors,
157
- block: boundwitness
158
- }), /* @__PURE__ */ React3.createElement(QuickTipButton, {
159
- Icon: DataObjectIcon,
160
- title: `JSON for ${ellipsize(hash ?? "", 8)}`,
161
- dialogProps: {
162
- fullWidth: true,
163
- maxWidth: "md"
164
- }
165
- }, /* @__PURE__ */ React3.createElement("pre", {
166
- style: {
167
- wordBreak: "break-all"
168
- }
169
- }, boundwitness ? JSON.stringify(boundwitness, null, 2) : null)));
170
- }, "BlockBoundWitnessActions");
146
+ return /* @__PURE__ */ jsxs2(FlexRow, { ...props, children: [
147
+ boundwitness?.previous_hashes.length === 0 ? null : /* @__PURE__ */ jsx3(BWPreviousHashQuickTipButton, { boundwitness }),
148
+ /* @__PURE__ */ jsx3(BlockBoundWitnessVerification, { iconColors: validationIconColors, block: boundwitness }),
149
+ /* @__PURE__ */ jsx3(
150
+ QuickTipButton,
151
+ {
152
+ Icon: DataObjectIcon,
153
+ title: `JSON for ${ellipsize(hash ?? "", 8)}`,
154
+ dialogProps: { fullWidth: true, maxWidth: "md" },
155
+ children: /* @__PURE__ */ jsx3("pre", { style: { wordBreak: "break-all" }, children: boundwitness ? JSON.stringify(boundwitness, null, 2) : null })
156
+ }
157
+ )
158
+ ] });
159
+ };
171
160
 
172
161
  // src/components/block/card/Card.tsx
173
- import { Card, CardContent, Grid, Skeleton, Stack } from "@mui/material";
162
+ import {
163
+ Card,
164
+ CardContent,
165
+ Grid,
166
+ Skeleton,
167
+ Stack
168
+ } from "@mui/material";
174
169
  import { ErrorRender } from "@xylabs/react-error";
175
170
  import { DetailsStack, LabelValueStack } from "@xyo-network/react-chain-shared";
176
- import React5 from "react";
177
171
  import { GrSteps } from "react-icons/gr";
178
172
  import { IoStatsChartOutline } from "react-icons/io5";
179
173
  import { VscSymbolNamespace } from "react-icons/vsc";
180
174
 
181
175
  // src/components/block/card/CardHeader.tsx
182
- import { CardHeader, Link, Tooltip as Tooltip2, Typography } from "@mui/material";
176
+ import {
177
+ CardHeader,
178
+ Link,
179
+ Tooltip as Tooltip2,
180
+ Typography
181
+ } from "@mui/material";
183
182
  import { BlockiesAvatarAddress } from "@xyo-network/react-chain-blockies";
184
183
  import { useEvent } from "@xyo-network/react-event";
185
- import React4 from "react";
186
- var BlockBoundWitnessCardHeader = /* @__PURE__ */ __name(({ linked = true, address }) => {
184
+ import { jsx as jsx4 } from "react/jsx-runtime";
185
+ var BlockBoundWitnessCardHeader = ({ linked = true, address }) => {
187
186
  const [ref, dispatch] = useEvent();
188
- return /* @__PURE__ */ React4.createElement(CardHeader, {
189
- ref,
190
- title: /* @__PURE__ */ React4.createElement(Typography, {
191
- onClick: /* @__PURE__ */ __name(() => linked && dispatch("address", "click", address), "onClick"),
192
- variant: "body2",
193
- sx: {
194
- maxWidth: "100%",
195
- textOverflow: "ellipsis",
196
- overflow: "hidden",
197
- fontFamily: "monospace"
198
- }
199
- }, linked ? /* @__PURE__ */ React4.createElement(Link, {
200
- sx: {
201
- cursor: "pointer"
202
- }
203
- }, address) : address),
204
- avatar: /* @__PURE__ */ React4.createElement(Tooltip2, {
205
- title: `Address - ${address}`
206
- }, /* @__PURE__ */ React4.createElement(BlockiesAvatarAddress, {
207
- address,
208
- onClick: /* @__PURE__ */ __name(() => dispatch("address", "click", address), "onClick"),
209
- size: 21,
210
- sx: {
211
- cursor: "pointer"
212
- }
213
- }))
214
- });
215
- }, "BlockBoundWitnessCardHeader");
187
+ return /* @__PURE__ */ jsx4(
188
+ CardHeader,
189
+ {
190
+ ref,
191
+ title: /* @__PURE__ */ jsx4(
192
+ Typography,
193
+ {
194
+ onClick: () => linked && dispatch("address", "click", address),
195
+ variant: "body2",
196
+ sx: {
197
+ maxWidth: "100%",
198
+ textOverflow: "ellipsis",
199
+ overflow: "hidden",
200
+ fontFamily: "monospace"
201
+ },
202
+ children: linked ? /* @__PURE__ */ jsx4(Link, { sx: { cursor: "pointer" }, children: address }) : address
203
+ }
204
+ ),
205
+ avatar: /* @__PURE__ */ jsx4(Tooltip2, { title: `Address - ${address}`, children: /* @__PURE__ */ jsx4(
206
+ BlockiesAvatarAddress,
207
+ {
208
+ address,
209
+ onClick: () => dispatch("address", "click", address),
210
+ size: 21,
211
+ sx: { cursor: "pointer" }
212
+ }
213
+ ) })
214
+ }
215
+ );
216
+ };
216
217
 
217
218
  // src/components/block/card/hooks/useDetails.ts
218
219
  import { usePromise as usePromise2 } from "@xylabs/react-promise";
219
220
  import { StepSizes } from "@xyo-network/xl1-protocol";
220
221
  import { useMemo as useMemo2 } from "react";
221
- var generateStepHashText = /* @__PURE__ */ __name((blockNumber, stepHashIndex) => {
222
+ var generateStepHashText = (blockNumber, stepHashIndex) => {
222
223
  const stepSize = StepSizes[stepHashIndex];
223
224
  const stepStart = blockNumber - stepSize + 1;
224
225
  const stepStop = blockNumber;
225
- return [
226
- `Step ${stepHashIndex} (${stepSize})`,
227
- `${formatNumber(stepStart)} - ${formatNumber(stepStop)}`
228
- ];
229
- }, "generateStepHashText");
230
- var useBlockDetails = /* @__PURE__ */ __name((wrapper, viewer) => {
226
+ return [`Step ${stepHashIndex} (${stepSize})`, `${formatNumber(stepStart)} - ${formatNumber(stepStop)}`];
227
+ };
228
+ var useBlockDetails = (wrapper, viewer) => {
231
229
  const stats = useMemo2(() => {
232
230
  const stats2 = {
233
231
  Height: formatNumber(wrapper.boundWitness.block),
@@ -236,18 +234,14 @@ var useBlockDetails = /* @__PURE__ */ __name((wrapper, viewer) => {
236
234
  $epoch: wrapper.boundWitness.$epoch.toString()
237
235
  };
238
236
  return formatResults(stats2);
239
- }, [
240
- wrapper
241
- ]);
237
+ }, [wrapper]);
242
238
  const payloads = useMemo2(() => {
243
239
  const payloads2 = {
244
240
  "Transactions": formatNumber(wrapper.transactionCount),
245
241
  "Total Payloads": formatNumber(wrapper.payloadCount)
246
242
  };
247
243
  return formatResults(payloads2);
248
- }, [
249
- wrapper
250
- ]);
244
+ }, [wrapper]);
251
245
  const [stepHashes, stepHashesError, stepHashesLoading] = usePromise2(async () => {
252
246
  if (viewer) {
253
247
  const stepHashes2 = {};
@@ -269,15 +263,7 @@ var useBlockDetails = /* @__PURE__ */ __name((wrapper, viewer) => {
269
263
  }
270
264
  return formatResults(stepHashes2);
271
265
  }
272
- }, [
273
- wrapper,
274
- viewer
275
- ], {
276
- defaultValue: {
277
- labels: [],
278
- values: []
279
- }
280
- });
266
+ }, [wrapper, viewer], { defaultValue: { labels: [], values: [] } });
281
267
  return {
282
268
  stats,
283
269
  payloads,
@@ -285,184 +271,144 @@ var useBlockDetails = /* @__PURE__ */ __name((wrapper, viewer) => {
285
271
  stepHashesError,
286
272
  stepHashesLoading
287
273
  };
288
- }, "useBlockDetails");
274
+ };
289
275
 
290
276
  // src/components/block/card/Card.tsx
291
- var BlockBoundWitnessCard = /* @__PURE__ */ __name(({ linkedAddress = true, viewer, wrapper, ...props }) => {
277
+ import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
278
+ var BlockBoundWitnessCard = ({
279
+ linkedAddress = true,
280
+ viewer,
281
+ wrapper,
282
+ ...props
283
+ }) => {
292
284
  if (!wrapper) return null;
293
- const { stats, payloads, stepHashes, stepHashesError, stepHashesLoading } = useBlockDetails(wrapper, viewer);
294
- return /* @__PURE__ */ React5.createElement(Card, props, wrapper?.boundWitness.addresses.map((address) => /* @__PURE__ */ React5.createElement(BlockBoundWitnessCardHeader, {
295
- key: address,
296
- address,
297
- linked: linkedAddress
298
- })), /* @__PURE__ */ React5.createElement(ErrorRender, {
299
- error: stepHashesError,
300
- scope: "BlockBoundWitnessCard.tsx:stepHashesError"
301
- }), /* @__PURE__ */ React5.createElement(CardContent, null, /* @__PURE__ */ React5.createElement(Grid, {
302
- container: true,
303
- spacing: 6,
304
- sx: {
305
- width: "100%"
306
- }
307
- }, /* @__PURE__ */ React5.createElement(Grid, {
308
- size: {
309
- xs: 12,
310
- sm: 6,
311
- md: 4
312
- }
313
- }, /* @__PURE__ */ React5.createElement(DetailsStack, {
314
- IconComponent: IoStatsChartOutline,
315
- heading: "Stats",
316
- tooltipTitle: "Transaction Statistics"
317
- }, /* @__PURE__ */ React5.createElement(LabelValueStack, {
318
- labels: stats.labels,
319
- values: stats.values
320
- }))), /* @__PURE__ */ React5.createElement(Grid, {
321
- size: {
322
- xs: 12,
323
- sm: 6,
324
- md: 4
325
- }
326
- }, /* @__PURE__ */ React5.createElement(DetailsStack, {
327
- IconComponent: VscSymbolNamespace,
328
- heading: "Payloads",
329
- tooltipTitle: "Payloads within the Block"
330
- }, /* @__PURE__ */ React5.createElement(LabelValueStack, {
331
- labels: payloads.labels,
332
- values: payloads.values
333
- }))), /* @__PURE__ */ React5.createElement(Grid, {
334
- size: {
335
- xs: 12,
336
- sm: 6,
337
- md: 4
338
- }
339
- }, /* @__PURE__ */ React5.createElement(DetailsStack, {
340
- IconComponent: GrSteps,
341
- heading: "Step Hashes",
342
- tooltipTitle: "Step Hashes for the Block"
343
- }, stepHashesLoading === "pending" ? /* @__PURE__ */ React5.createElement(Stack, {
344
- gap: 0.25
345
- }, /* @__PURE__ */ React5.createElement(Skeleton, {
346
- variant: "text",
347
- width: "100%",
348
- height: 20
349
- }), /* @__PURE__ */ React5.createElement(Skeleton, {
350
- variant: "text",
351
- width: "100%",
352
- height: 20
353
- }), /* @__PURE__ */ React5.createElement(Skeleton, {
354
- variant: "text",
355
- width: "100%",
356
- height: 20
357
- }), /* @__PURE__ */ React5.createElement(Skeleton, {
358
- variant: "text",
359
- width: "100%",
360
- height: 20
361
- })) : null, /* @__PURE__ */ React5.createElement(LabelValueStack, {
362
- labels: stepHashes?.labels ?? [],
363
- values: stepHashes?.values ?? []
364
- }))))));
365
- }, "BlockBoundWitnessCard");
285
+ const {
286
+ stats,
287
+ payloads,
288
+ stepHashes,
289
+ stepHashesError,
290
+ stepHashesLoading
291
+ } = useBlockDetails(wrapper, viewer);
292
+ return /* @__PURE__ */ jsxs3(Card, { ...props, children: [
293
+ wrapper?.boundWitness.addresses.map((address) => /* @__PURE__ */ jsx5(BlockBoundWitnessCardHeader, { address, linked: linkedAddress }, address)),
294
+ /* @__PURE__ */ jsx5(ErrorRender, { error: stepHashesError, scope: "BlockBoundWitnessCard.tsx:stepHashesError" }),
295
+ /* @__PURE__ */ jsx5(CardContent, { children: /* @__PURE__ */ jsxs3(Grid, { container: true, spacing: 6, sx: { width: "100%" }, children: [
296
+ /* @__PURE__ */ jsx5(
297
+ Grid,
298
+ {
299
+ size: {
300
+ xs: 12,
301
+ sm: 6,
302
+ md: 4
303
+ },
304
+ children: /* @__PURE__ */ jsx5(DetailsStack, { IconComponent: IoStatsChartOutline, heading: "Stats", tooltipTitle: "Transaction Statistics", children: /* @__PURE__ */ jsx5(LabelValueStack, { labels: stats.labels, values: stats.values }) })
305
+ }
306
+ ),
307
+ /* @__PURE__ */ jsx5(
308
+ Grid,
309
+ {
310
+ size: {
311
+ xs: 12,
312
+ sm: 6,
313
+ md: 4
314
+ },
315
+ children: /* @__PURE__ */ jsx5(DetailsStack, { IconComponent: VscSymbolNamespace, heading: "Payloads", tooltipTitle: "Payloads within the Block", children: /* @__PURE__ */ jsx5(LabelValueStack, { labels: payloads.labels, values: payloads.values }) })
316
+ }
317
+ ),
318
+ /* @__PURE__ */ jsx5(
319
+ Grid,
320
+ {
321
+ size: {
322
+ xs: 12,
323
+ sm: 6,
324
+ md: 4
325
+ },
326
+ children: /* @__PURE__ */ jsxs3(DetailsStack, { IconComponent: GrSteps, heading: "Step Hashes", tooltipTitle: "Step Hashes for the Block", children: [
327
+ stepHashesLoading === "pending" ? /* @__PURE__ */ jsxs3(Stack, { gap: 0.25, children: [
328
+ /* @__PURE__ */ jsx5(Skeleton, { variant: "text", width: "100%", height: 20 }),
329
+ /* @__PURE__ */ jsx5(Skeleton, { variant: "text", width: "100%", height: 20 }),
330
+ /* @__PURE__ */ jsx5(Skeleton, { variant: "text", width: "100%", height: 20 }),
331
+ /* @__PURE__ */ jsx5(Skeleton, { variant: "text", width: "100%", height: 20 })
332
+ ] }) : null,
333
+ /* @__PURE__ */ jsx5(LabelValueStack, { labels: stepHashes?.labels ?? [], values: stepHashes?.values ?? [] })
334
+ ] })
335
+ }
336
+ )
337
+ ] }) })
338
+ ] });
339
+ };
366
340
 
367
341
  // src/components/block/BlockBoundWitnessDetails.tsx
368
- var BlockBoundWitnessDetails = /* @__PURE__ */ __name(({ block, paper, viewer, children, ...props }) => {
342
+ import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
343
+ var BlockBoundWitnessDetails = ({
344
+ block,
345
+ paper,
346
+ viewer,
347
+ children,
348
+ ...props
349
+ }) => {
369
350
  const [wrapper, wrapperError] = usePromise3(async () => {
370
351
  if (block) {
371
352
  return await HydratedBlockWrapper.parse(block);
372
353
  }
373
- }, [
374
- block
375
- ]);
354
+ }, [block]);
376
355
  const boundWitness = block?.[0];
377
356
  const payloads = block?.[1];
378
357
  const hash = usePayloadHash2(boundWitness);
379
358
  const [transactions, txFromBlockError] = useTxsFromBlock(block);
380
- const { hashes: txHashes, schemas: txSchemas } = useMemo3(() => formatPayloadsForTable(transactions ?? []), [
381
- transactions
382
- ]);
359
+ const { hashes: txHashes, schemas: txSchemas } = useMemo3(() => formatPayloadsForTable(transactions ?? []), [transactions]);
383
360
  const [nonTxBoundWitnesses, bwsFromBlockError] = usePromise3(async () => {
384
361
  const bws = filterAs(payloads ?? [], (payload) => !isTransactionBoundWitness(payload) && isBoundWitness(payload) ? payload : void 0);
385
362
  return await PayloadBuilder.hashPairs(bws);
386
- }, [
387
- payloads
388
- ]);
389
- const { hashes: nonTxBwHashes, schemas: nonTxBwSchemas } = useMemo3(() => formatPayloadsForTable(nonTxBoundWitnesses ?? []), [
390
- nonTxBoundWitnesses
391
- ]);
363
+ }, [payloads]);
364
+ const { hashes: nonTxBwHashes, schemas: nonTxBwSchemas } = useMemo3(() => formatPayloadsForTable(nonTxBoundWitnesses ?? []), [nonTxBoundWitnesses]);
392
365
  const hasNonTxBoundWitnesses = (nonTxBoundWitnesses?.length ?? 0) > 0;
393
- return /* @__PURE__ */ React6.createElement(FlexCol2, {
394
- alignItems: "stretch",
395
- rowGap: 4,
396
- ...props
397
- }, /* @__PURE__ */ React6.createElement(ErrorRender2, {
398
- error: txFromBlockError ?? bwsFromBlockError,
399
- scope: "BlockBoundWitnessDetails.tsx"
400
- }), /* @__PURE__ */ React6.createElement(ErrorRender2, {
401
- error: wrapperError,
402
- scope: "BlockBoundWitnessDetails.tsx:wrapperError"
403
- }), /* @__PURE__ */ React6.createElement(HashHeadingPaper, {
404
- hash,
405
- paperProps: {
406
- sx: {
407
- p: 2
366
+ return /* @__PURE__ */ jsxs4(FlexCol2, { alignItems: "stretch", rowGap: 4, ...props, children: [
367
+ /* @__PURE__ */ jsx6(ErrorRender2, { error: txFromBlockError ?? bwsFromBlockError, scope: "BlockBoundWitnessDetails.tsx" }),
368
+ /* @__PURE__ */ jsx6(ErrorRender2, { error: wrapperError, scope: "BlockBoundWitnessDetails.tsx:wrapperError" }),
369
+ /* @__PURE__ */ jsx6(
370
+ HashHeadingPaper,
371
+ {
372
+ hash,
373
+ paperProps: { sx: { p: 2 } },
374
+ AdornmentEnd: /* @__PURE__ */ jsx6(BlockBoundWitnessActions, { boundwitness: boundWitness }),
375
+ identiconProps: { p: 0.75, size: 24 }
408
376
  }
409
- },
410
- AdornmentEnd: /* @__PURE__ */ React6.createElement(BlockBoundWitnessActions, {
411
- boundwitness: boundWitness
412
- }),
413
- identiconProps: {
414
- p: 0.75,
415
- size: 24
416
- }
417
- }), /* @__PURE__ */ React6.createElement(BlockBoundWitnessCard, {
418
- elevation: 4,
419
- viewer,
420
- wrapper
421
- }), (transactions?.length ?? 0) > 0 && /* @__PURE__ */ React6.createElement(PayloadTableFlexbox, {
422
- IconComponent: /* @__PURE__ */ React6.createElement(GrTransaction, null),
423
- eventNoun: "transaction",
424
- clickableFields: [
425
- "hash"
426
- ],
427
- hashes: txHashes,
428
- headingTitle: "Transactions",
429
- schemas: txSchemas,
430
- sx: {
431
- mb: 1
432
- }
433
- }), /* @__PURE__ */ React6.createElement(FlexCol2, {
434
- alignItems: "stretch",
435
- rowGap: 1,
436
- mb: 1
437
- }, /* @__PURE__ */ React6.createElement(HeadingPaper2, {
438
- IconComponent: /* @__PURE__ */ React6.createElement(VscSymbolNamespace2, null),
439
- heading: "Payloads"
440
- }), /* @__PURE__ */ React6.createElement(BoundWitnessPayloadsTable, {
441
- boundwitness: boundWitness,
442
- eventNoun: "payload",
443
- clickableFields: [
444
- "hash"
445
- ]
446
- })), hasNonTxBoundWitnesses ? /* @__PURE__ */ React6.createElement(PayloadTableFlexbox, {
447
- IconComponent: /* @__PURE__ */ React6.createElement(VscSymbolMethod2, null),
448
- eventNoun: "boundwitness",
449
- hashes: nonTxBwHashes,
450
- headingTitle: "Bound Witnesses",
451
- schemas: nonTxBwSchemas,
452
- sx: {
453
- mb: 1
454
- }
455
- }) : null, /* @__PURE__ */ React6.createElement(FlexCol2, {
456
- alignItems: "stretch",
457
- rowGap: 1,
458
- mb: 1
459
- }, /* @__PURE__ */ React6.createElement(HeadingPaper2, {
460
- IconComponent: /* @__PURE__ */ React6.createElement(FaSignature, null),
461
- heading: "Signatures"
462
- }), /* @__PURE__ */ React6.createElement(BoundWitnessSignatureTable, {
463
- block: boundWitness
464
- })));
465
- }, "BlockBoundWitnessDetails");
377
+ ),
378
+ /* @__PURE__ */ jsx6(BlockBoundWitnessCard, { elevation: 4, viewer, wrapper }),
379
+ (transactions?.length ?? 0) > 0 && /* @__PURE__ */ jsx6(
380
+ PayloadTableFlexbox,
381
+ {
382
+ IconComponent: /* @__PURE__ */ jsx6(GrTransaction, {}),
383
+ eventNoun: "transaction",
384
+ clickableFields: ["hash"],
385
+ hashes: txHashes,
386
+ headingTitle: "Transactions",
387
+ schemas: txSchemas,
388
+ sx: { mb: 1 }
389
+ }
390
+ ),
391
+ /* @__PURE__ */ jsxs4(FlexCol2, { alignItems: "stretch", rowGap: 1, mb: 1, children: [
392
+ /* @__PURE__ */ jsx6(HeadingPaper2, { IconComponent: /* @__PURE__ */ jsx6(VscSymbolNamespace2, {}), heading: "Payloads" }),
393
+ /* @__PURE__ */ jsx6(BoundWitnessPayloadsTable, { boundwitness: boundWitness, eventNoun: "payload", clickableFields: ["hash"] })
394
+ ] }),
395
+ hasNonTxBoundWitnesses ? /* @__PURE__ */ jsx6(
396
+ PayloadTableFlexbox,
397
+ {
398
+ IconComponent: /* @__PURE__ */ jsx6(VscSymbolMethod2, {}),
399
+ eventNoun: "boundwitness",
400
+ hashes: nonTxBwHashes,
401
+ headingTitle: "Bound Witnesses",
402
+ schemas: nonTxBwSchemas,
403
+ sx: { mb: 1 }
404
+ }
405
+ ) : null,
406
+ /* @__PURE__ */ jsxs4(FlexCol2, { alignItems: "stretch", rowGap: 1, mb: 1, children: [
407
+ /* @__PURE__ */ jsx6(HeadingPaper2, { IconComponent: /* @__PURE__ */ jsx6(FaSignature, {}), heading: "Signatures" }),
408
+ /* @__PURE__ */ jsx6(BoundWitnessSignatureTable, { block: boundWitness })
409
+ ] })
410
+ ] });
411
+ };
466
412
 
467
413
  // src/components/transactions/card/actions/TransactionActions.tsx
468
414
  import { DataObject as DataObjectIcon2 } from "@mui/icons-material";
@@ -471,7 +417,6 @@ import { FlexRow as FlexRow2 } from "@xylabs/react-flexbox";
471
417
  import { QuickTipButton as QuickTipButton2 } from "@xylabs/react-quick-tip-button";
472
418
  import { BWPreviousHashQuickTipButton as BWPreviousHashQuickTipButton2 } from "@xyo-network/react-boundwitness-plugin";
473
419
  import { usePayloadHash as usePayloadHash3 } from "@xyo-network/react-shared";
474
- import React8 from "react";
475
420
 
476
421
  // src/components/transactions/card/actions/TransactionVerification.tsx
477
422
  import { CancelRounded as CancelRoundedIcon2 } from "@mui/icons-material";
@@ -481,22 +426,17 @@ import { usePromise as usePromise4 } from "@xylabs/react-promise";
481
426
  import { isDefined as isDefined3 } from "@xylabs/typeof";
482
427
  import { isHydratedTransaction } from "@xyo-network/xl1-protocol";
483
428
  import { validateTransaction } from "@xyo-network/xl1-validation";
484
- import React7, { useMemo as useMemo4 } from "react";
485
- var InvalidIcon2 = /* @__PURE__ */ __name(({ ref, ...props }) => /* @__PURE__ */ React7.createElement(CancelRoundedIcon2, {
486
- color: "error",
487
- ref,
488
- ...props
489
- }), "InvalidIcon");
429
+ import { useMemo as useMemo4 } from "react";
430
+ import { jsx as jsx7 } from "react/jsx-runtime";
431
+ var InvalidIcon2 = ({ ref, ...props }) => /* @__PURE__ */ jsx7(CancelRoundedIcon2, { color: "error", ref, ...props });
490
432
  InvalidIcon2.displayName = "InvalidIcon";
491
- var TransactionVerification = /* @__PURE__ */ __name(({ transaction, ...props }) => {
433
+ var TransactionVerification = ({ transaction, ...props }) => {
492
434
  const [validationErrors, validateError] = usePromise4(async () => {
493
435
  if (isDefined3(transaction)) {
494
436
  const resolvedTransaction = assertEx2(isHydratedTransaction(transaction) ? transaction : void 0, () => "Transaction must be a HydratedTransaction");
495
437
  return await validateTransaction(resolvedTransaction);
496
438
  }
497
- }, [
498
- transaction
499
- ]);
439
+ }, [transaction]);
500
440
  const resolvedErrors = useMemo4(() => {
501
441
  const errors = [];
502
442
  if (isDefined3(validationErrors)) {
@@ -505,52 +445,53 @@ var TransactionVerification = /* @__PURE__ */ __name(({ transaction, ...props })
505
445
  if (isDefined3(validateError)) errors.push(validateError);
506
446
  return errors;
507
447
  }
508
- }, [
509
- validateError,
510
- validationErrors
511
- ]);
512
- return /* @__PURE__ */ React7.createElement(ErrorQuickTipButton2, {
513
- boundWitnessType: "Transaction",
514
- errors: resolvedErrors,
515
- ...props
516
- });
517
- }, "TransactionVerification");
448
+ }, [validateError, validationErrors]);
449
+ return /* @__PURE__ */ jsx7(ErrorQuickTipButton2, { boundWitnessType: "Transaction", errors: resolvedErrors, ...props });
450
+ };
518
451
 
519
452
  // src/components/transactions/card/actions/TransactionActions.tsx
520
- var TransactionActions = /* @__PURE__ */ __name(({ transaction, validationIconColors = false, ...props }) => {
453
+ import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
454
+ var TransactionActions = ({
455
+ transaction,
456
+ validationIconColors = false,
457
+ ...props
458
+ }) => {
521
459
  const txBw = transaction?.[0];
522
460
  const hash = usePayloadHash3(txBw);
523
- return /* @__PURE__ */ React8.createElement(FlexRow2, props, txBw?.previous_hashes.length === 0 ? null : /* @__PURE__ */ React8.createElement(BWPreviousHashQuickTipButton2, {
524
- boundwitness: txBw
525
- }), /* @__PURE__ */ React8.createElement(TransactionVerification, {
526
- iconColors: validationIconColors,
527
- transaction
528
- }), /* @__PURE__ */ React8.createElement(QuickTipButton2, {
529
- Icon: DataObjectIcon2,
530
- title: `JSON for ${ellipsize2(hash ?? "", 8)}`,
531
- dialogProps: {
532
- fullWidth: true,
533
- maxWidth: "md"
534
- }
535
- }, /* @__PURE__ */ React8.createElement("pre", {
536
- style: {
537
- wordBreak: "break-all"
538
- }
539
- }, transaction ? JSON.stringify(transaction, null, 2) : null)));
540
- }, "TransactionActions");
461
+ return /* @__PURE__ */ jsxs5(FlexRow2, { ...props, children: [
462
+ txBw?.previous_hashes.length === 0 ? null : /* @__PURE__ */ jsx8(BWPreviousHashQuickTipButton2, { boundwitness: txBw }),
463
+ /* @__PURE__ */ jsx8(TransactionVerification, { iconColors: validationIconColors, transaction }),
464
+ /* @__PURE__ */ jsx8(
465
+ QuickTipButton2,
466
+ {
467
+ Icon: DataObjectIcon2,
468
+ title: `JSON for ${ellipsize2(hash ?? "", 8)}`,
469
+ dialogProps: { fullWidth: true, maxWidth: "md" },
470
+ children: /* @__PURE__ */ jsx8("pre", { style: { wordBreak: "break-all" }, children: transaction ? JSON.stringify(transaction, null, 2) : null })
471
+ }
472
+ )
473
+ ] });
474
+ };
541
475
 
542
476
  // src/components/transactions/card/Card.tsx
543
- import { Card as Card2, CardContent as CardContent2, CardHeader as CardHeader2, Grid as Grid2, Link as Link2, Tooltip as Tooltip3, Typography as Typography2 } from "@mui/material";
477
+ import {
478
+ Card as Card2,
479
+ CardContent as CardContent2,
480
+ CardHeader as CardHeader2,
481
+ Grid as Grid2,
482
+ Link as Link2,
483
+ Tooltip as Tooltip3,
484
+ Typography as Typography2
485
+ } from "@mui/material";
544
486
  import { BlockiesAvatarAddress as BlockiesAvatarAddress2 } from "@xyo-network/react-chain-blockies";
545
487
  import { DetailsStack as DetailsStack2, LabelValueStack as LabelValueStack2 } from "@xyo-network/react-chain-shared";
546
488
  import { useEvent as useEvent2 } from "@xyo-network/react-event";
547
- import React9 from "react";
548
489
  import { GiReceiveMoney, GiSandsOfTime } from "react-icons/gi";
549
490
  import { IoStatsChartOutline as IoStatsChartOutline2 } from "react-icons/io5";
550
491
 
551
492
  // src/components/transactions/card/hooks/useDetails.ts
552
493
  import { useMemo as useMemo5 } from "react";
553
- var useTransactionDetails = /* @__PURE__ */ __name((wrapper) => {
494
+ var useTransactionDetails = (wrapper) => {
554
495
  const stats = useMemo5(() => {
555
496
  const stats2 = {
556
497
  "Reward": formatNumber(wrapper.reward()),
@@ -560,9 +501,7 @@ var useTransactionDetails = /* @__PURE__ */ __name((wrapper) => {
560
501
  "Signatures": formatNumber(wrapper.signatureCount)
561
502
  };
562
503
  return formatResults(stats2);
563
- }, [
564
- wrapper
565
- ]);
504
+ }, [wrapper]);
566
505
  const fees = useMemo5(() => {
567
506
  const fees2 = {
568
507
  "Base": formatFee(wrapper.fees.base),
@@ -571,113 +510,112 @@ var useTransactionDetails = /* @__PURE__ */ __name((wrapper) => {
571
510
  "Gas Limit": formatFee(wrapper.fees.gasLimit)
572
511
  };
573
512
  return formatResults(fees2);
574
- }, [
575
- wrapper
576
- ]);
513
+ }, [wrapper]);
577
514
  const blockDuration = useMemo5(() => {
578
515
  const blockDuration2 = {
579
516
  "Expiration": wrapper.boundWitness.exp.toLocaleString(navigator.language ?? "en-US"),
580
517
  "Not Before": wrapper.boundWitness.nbf.toLocaleString(navigator.language ?? "en-US")
581
518
  };
582
519
  return formatResults(blockDuration2);
583
- }, [
584
- wrapper
585
- ]);
520
+ }, [wrapper]);
586
521
  return {
587
522
  stats,
588
523
  fees,
589
524
  blockDuration
590
525
  };
591
- }, "useTransactionDetails");
526
+ };
592
527
 
593
528
  // src/components/transactions/card/Card.tsx
594
- var TransactionBoundWitnessCard = /* @__PURE__ */ __name(({ linkedAddress = true, wrapper, ...props }) => {
529
+ import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
530
+ var TransactionBoundWitnessCard = ({
531
+ linkedAddress = true,
532
+ wrapper,
533
+ ...props
534
+ }) => {
595
535
  if (!wrapper) return null;
596
- const { stats, fees, blockDuration } = useTransactionDetails(wrapper);
536
+ const {
537
+ stats,
538
+ fees,
539
+ blockDuration
540
+ } = useTransactionDetails(wrapper);
597
541
  const [ref, dispatch] = useEvent2();
598
- return /* @__PURE__ */ React9.createElement(Card2, {
599
- ref,
600
- ...props
601
- }, /* @__PURE__ */ React9.createElement(CardHeader2, {
602
- title: /* @__PURE__ */ React9.createElement(Typography2, {
603
- onClick: /* @__PURE__ */ __name(() => linkedAddress && dispatch("address", "click", wrapper.boundWitness.from), "onClick"),
604
- variant: "body2",
605
- sx: {
606
- maxWidth: "100%",
607
- textOverflow: "ellipsis",
608
- overflow: "hidden",
609
- fontFamily: "monospace"
610
- }
611
- }, linkedAddress ? /* @__PURE__ */ React9.createElement(Link2, {
612
- sx: {
613
- cursor: "pointer"
614
- }
615
- }, wrapper?.boundWitness.from) : wrapper?.boundWitness.from),
616
- avatar: /* @__PURE__ */ React9.createElement(Tooltip3, {
617
- title: `From Address - ${wrapper?.boundWitness.from}`
618
- }, /* @__PURE__ */ React9.createElement(BlockiesAvatarAddress2, {
619
- address: wrapper?.boundWitness.from,
620
- onClick: /* @__PURE__ */ __name(() => dispatch("address", "click", wrapper.boundWitness.from), "onClick"),
621
- size: 21,
622
- sx: {
623
- cursor: "pointer"
542
+ return /* @__PURE__ */ jsxs6(Card2, { ref, ...props, children: [
543
+ /* @__PURE__ */ jsx9(
544
+ CardHeader2,
545
+ {
546
+ title: /* @__PURE__ */ jsx9(
547
+ Typography2,
548
+ {
549
+ onClick: () => linkedAddress && dispatch("address", "click", wrapper.boundWitness.from),
550
+ variant: "body2",
551
+ sx: {
552
+ maxWidth: "100%",
553
+ textOverflow: "ellipsis",
554
+ overflow: "hidden",
555
+ fontFamily: "monospace"
556
+ },
557
+ children: linkedAddress ? /* @__PURE__ */ jsx9(Link2, { sx: { cursor: "pointer" }, children: wrapper?.boundWitness.from }) : wrapper?.boundWitness.from
558
+ }
559
+ ),
560
+ avatar: /* @__PURE__ */ jsx9(Tooltip3, { title: `From Address - ${wrapper?.boundWitness.from}`, children: /* @__PURE__ */ jsx9(
561
+ BlockiesAvatarAddress2,
562
+ {
563
+ address: wrapper?.boundWitness.from,
564
+ onClick: () => dispatch("address", "click", wrapper.boundWitness.from),
565
+ size: 21,
566
+ sx: { cursor: "pointer" }
567
+ }
568
+ ) })
624
569
  }
625
- }))
626
- }), /* @__PURE__ */ React9.createElement(CardContent2, null, /* @__PURE__ */ React9.createElement(Grid2, {
627
- container: true,
628
- spacing: 6,
629
- sx: {
630
- width: "100%"
631
- }
632
- }, /* @__PURE__ */ React9.createElement(Grid2, {
633
- size: {
634
- xs: 12,
635
- sm: 6,
636
- md: 4
637
- }
638
- }, /* @__PURE__ */ React9.createElement(DetailsStack2, {
639
- IconComponent: IoStatsChartOutline2,
640
- heading: "Stats",
641
- tooltipTitle: "Transaction Statistics"
642
- }, /* @__PURE__ */ React9.createElement(LabelValueStack2, {
643
- labels: stats.labels,
644
- values: stats.values
645
- }))), /* @__PURE__ */ React9.createElement(Grid2, {
646
- size: {
647
- xs: 12,
648
- sm: 6,
649
- md: 4
650
- }
651
- }, /* @__PURE__ */ React9.createElement(DetailsStack2, {
652
- IconComponent: GiReceiveMoney,
653
- heading: "Fees",
654
- tooltipTitle: "Fees offered to the producer"
655
- }, /* @__PURE__ */ React9.createElement(LabelValueStack2, {
656
- labels: fees.labels,
657
- values: fees.values
658
- }))), /* @__PURE__ */ React9.createElement(Grid2, {
659
- size: {
660
- xs: 12,
661
- sm: 6,
662
- md: 4
663
- }
664
- }, /* @__PURE__ */ React9.createElement(DetailsStack2, {
665
- IconComponent: GiSandsOfTime,
666
- heading: "Block Duration",
667
- tooltipTitle: "Block window for the transaction to be valid"
668
- }, /* @__PURE__ */ React9.createElement(LabelValueStack2, {
669
- labels: blockDuration.labels,
670
- values: blockDuration.values
671
- }))))));
672
- }, "TransactionBoundWitnessCard");
570
+ ),
571
+ /* @__PURE__ */ jsx9(CardContent2, { children: /* @__PURE__ */ jsxs6(Grid2, { container: true, spacing: 6, sx: { width: "100%" }, children: [
572
+ /* @__PURE__ */ jsx9(
573
+ Grid2,
574
+ {
575
+ size: {
576
+ xs: 12,
577
+ sm: 6,
578
+ md: 4
579
+ },
580
+ children: /* @__PURE__ */ jsx9(DetailsStack2, { IconComponent: IoStatsChartOutline2, heading: "Stats", tooltipTitle: "Transaction Statistics", children: /* @__PURE__ */ jsx9(LabelValueStack2, { labels: stats.labels, values: stats.values }) })
581
+ }
582
+ ),
583
+ /* @__PURE__ */ jsx9(
584
+ Grid2,
585
+ {
586
+ size: {
587
+ xs: 12,
588
+ sm: 6,
589
+ md: 4
590
+ },
591
+ children: /* @__PURE__ */ jsx9(DetailsStack2, { IconComponent: GiReceiveMoney, heading: "Fees", tooltipTitle: "Fees offered to the producer", children: /* @__PURE__ */ jsx9(LabelValueStack2, { labels: fees.labels, values: fees.values }) })
592
+ }
593
+ ),
594
+ /* @__PURE__ */ jsx9(
595
+ Grid2,
596
+ {
597
+ size: {
598
+ xs: 12,
599
+ sm: 6,
600
+ md: 4
601
+ },
602
+ children: /* @__PURE__ */ jsx9(DetailsStack2, { IconComponent: GiSandsOfTime, heading: "Block Duration", tooltipTitle: "Block window for the transaction to be valid", children: /* @__PURE__ */ jsx9(LabelValueStack2, { labels: blockDuration.labels, values: blockDuration.values }) })
603
+ }
604
+ )
605
+ ] }) })
606
+ ] });
607
+ };
673
608
 
674
609
  // src/components/transactions/TransactionBoundWitnessDetails.tsx
675
610
  import { ErrorRender as ErrorRender3 } from "@xylabs/react-error";
676
611
  import { FlexCol as FlexCol3 } from "@xylabs/react-flexbox";
677
612
  import { usePromise as usePromise6 } from "@xylabs/react-promise";
678
- import { BoundWitnessSignatureTable as BoundWitnessSignatureTable2, HashHeadingPaper as HashHeadingPaper2, HeadingPaper as HeadingPaper3 } from "@xyo-network/react-boundwitness-plugin";
613
+ import {
614
+ BoundWitnessSignatureTable as BoundWitnessSignatureTable2,
615
+ HashHeadingPaper as HashHeadingPaper2,
616
+ HeadingPaper as HeadingPaper3
617
+ } from "@xyo-network/react-boundwitness-plugin";
679
618
  import { HydratedTransactionWrapper } from "@xyo-network/xl1-wrappers";
680
- import React10 from "react";
681
619
  import { FaSignature as FaSignature2 } from "react-icons/fa";
682
620
  import { VscSymbolNamespace as VscSymbolNamespace3 } from "react-icons/vsc";
683
621
 
@@ -688,41 +626,28 @@ import { isDefined as isDefined4 } from "@xylabs/typeof";
688
626
  import { PayloadBuilder as PayloadBuilder2 } from "@xyo-network/payload-builder";
689
627
  import { isSchema } from "@xyo-network/payload-model";
690
628
  import { useMemo as useMemo6, useState } from "react";
691
- var useTransactionPayloadTypes = /* @__PURE__ */ __name((wrapper) => {
629
+ var useTransactionPayloadTypes = (wrapper) => {
692
630
  const [elevatedPayloadSets, elevatedPayloadSetsError] = usePromise5(async () => {
693
631
  if (isDefined4(wrapper)) {
694
632
  const elevatedPayloads = wrapper.elevatedPayloads;
695
633
  const pairs = await PayloadBuilder2.hashPairs(elevatedPayloads);
696
634
  return formatPayloadsForTable(pairs);
697
635
  } else {
698
- return {
699
- hashes: [],
700
- schemas: []
701
- };
636
+ return { hashes: [], schemas: [] };
702
637
  }
703
- }, [
704
- wrapper
705
- ]);
638
+ }, [wrapper]);
706
639
  const [publicPayloads, publicPayloadsError] = usePromise5(async () => {
707
640
  if (isDefined4(wrapper)) {
708
641
  const publicPayloads2 = wrapper.publicExternalPayloads;
709
642
  const pairs = await PayloadBuilder2.hashPairs(publicPayloads2);
710
643
  return formatPayloadsForTable(pairs);
711
644
  } else {
712
- return {
713
- hashes: [],
714
- schemas: []
715
- };
645
+ return { hashes: [], schemas: [] };
716
646
  }
717
- }, [
718
- wrapper
719
- ]);
647
+ }, [wrapper]);
720
648
  const [referencedPayloadsError, setReferencedPayloadsError] = useState([]);
721
649
  const referencedPayloads = useMemo6(() => {
722
- const ret = {
723
- hashes: [],
724
- schemas: []
725
- };
650
+ const ret = { hashes: [], schemas: [] };
726
651
  if (isDefined4(wrapper)) {
727
652
  const referencedPayloads2 = wrapper.privateExternalPayloads;
728
653
  for (const [hash, schema] of Object.entries(referencedPayloads2)) {
@@ -736,20 +661,14 @@ var useTransactionPayloadTypes = /* @__PURE__ */ __name((wrapper) => {
736
661
  resolved = true;
737
662
  }
738
663
  if (!resolved) {
739
- setReferencedPayloadsError((prev) => [
740
- ...prev,
741
- new Error(`Unexpected payload or schema type for hash ${hash}: ${schema}`)
742
- ]);
664
+ setReferencedPayloadsError((prev) => [...prev, new Error(`Unexpected payload or schema type for hash ${hash}: ${schema}`)]);
743
665
  }
744
666
  }
745
667
  return ret;
746
668
  } else {
747
669
  return ret;
748
670
  }
749
- }, [
750
- wrapper,
751
- elevatedPayloadSets
752
- ]);
671
+ }, [wrapper, elevatedPayloadSets]);
753
672
  const { hashes: elevatedPayloadHashes, schemas: elevatedPayloadSchemas } = elevatedPayloadSets ?? {};
754
673
  const { hashes: publicPayloadHashes, schemas: publicPayloadSchemas } = publicPayloads ?? {};
755
674
  const { hashes: referencedPayloadHashes, schemas: referencedPayloadSchemas } = referencedPayloads ?? {};
@@ -764,104 +683,90 @@ var useTransactionPayloadTypes = /* @__PURE__ */ __name((wrapper) => {
764
683
  referencedPayloadSchemas,
765
684
  referencedPayloadsError
766
685
  };
767
- }, "useTransactionPayloadTypes");
686
+ };
768
687
 
769
688
  // src/components/transactions/TransactionBoundWitnessDetails.tsx
689
+ import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
770
690
  var nonClickableFields = [];
771
- var TransactionBoundWitnessDetails = /* @__PURE__ */ __name(({ transaction, ...props }) => {
691
+ var TransactionBoundWitnessDetails = ({ transaction, ...props }) => {
772
692
  const [wrapper, wrapperError] = usePromise6(async () => {
773
693
  if (transaction) {
774
694
  return await HydratedTransactionWrapper.parse(transaction);
775
695
  }
776
- }, [
777
- transaction
778
- ]);
779
- const { elevatedPayloadHashes, elevatedPayloadSchemas, elevatedPayloadSetsError, publicPayloadHashes, publicPayloadSchemas, publicPayloadsError, referencedPayloadHashes, referencedPayloadSchemas, referencedPayloadsError } = useTransactionPayloadTypes(wrapper);
780
- return /* @__PURE__ */ React10.createElement(FlexCol3, {
781
- alignItems: "stretch",
782
- rowGap: 2,
783
- ...props
784
- }, /* @__PURE__ */ React10.createElement(HashHeadingPaper2, {
785
- hash: wrapper?.boundWitness?._hash,
786
- paperProps: {
787
- sx: {
788
- p: 2
696
+ }, [transaction]);
697
+ const {
698
+ elevatedPayloadHashes,
699
+ elevatedPayloadSchemas,
700
+ elevatedPayloadSetsError,
701
+ publicPayloadHashes,
702
+ publicPayloadSchemas,
703
+ publicPayloadsError,
704
+ referencedPayloadHashes,
705
+ referencedPayloadSchemas,
706
+ referencedPayloadsError
707
+ } = useTransactionPayloadTypes(wrapper);
708
+ return /* @__PURE__ */ jsxs7(FlexCol3, { alignItems: "stretch", rowGap: 2, ...props, children: [
709
+ /* @__PURE__ */ jsx10(
710
+ HashHeadingPaper2,
711
+ {
712
+ hash: wrapper?.boundWitness?._hash,
713
+ paperProps: { sx: { p: 2 } },
714
+ AdornmentEnd: /* @__PURE__ */ jsx10(TransactionActions, { transaction }),
715
+ identiconProps: { p: 0.75, size: 24 }
789
716
  }
790
- },
791
- AdornmentEnd: /* @__PURE__ */ React10.createElement(TransactionActions, {
792
- transaction
793
- }),
794
- identiconProps: {
795
- p: 0.75,
796
- size: 24
797
- }
798
- }), /* @__PURE__ */ React10.createElement(ErrorRender3, {
799
- error: wrapperError,
800
- scope: "wrapperError:TransactionBoundWitnessDetails.tsx"
801
- }), /* @__PURE__ */ React10.createElement(ErrorRender3, {
802
- error: elevatedPayloadSetsError,
803
- scope: "elevatedPayloadSetsError:TransactionBoundWitnessDetails.tsx"
804
- }), /* @__PURE__ */ React10.createElement(ErrorRender3, {
805
- error: publicPayloadsError,
806
- scope: "publicPayloadsError:TransactionBoundWitnessDetails.tsx"
807
- }), referencedPayloadsError.map((error, index) => (
808
- // eslint-disable-next-line @eslint-react/no-array-index-key
809
- /* @__PURE__ */ React10.createElement(ErrorRender3, {
810
- key: index,
811
- error,
812
- scope: "referencedPayloadsError:TransactionBoundWitnessDetails.tsx"
813
- })
814
- )), /* @__PURE__ */ React10.createElement(TransactionBoundWitnessCard, {
815
- elevation: 4,
816
- wrapper
817
- }), /* @__PURE__ */ React10.createElement(PayloadTableFlexbox, {
818
- eventNoun: "payload",
819
- clickableFields: [
820
- "hash"
821
- ],
822
- tooltip: "Payloads included in the transaction that are elevated and validated.",
823
- IconComponent: /* @__PURE__ */ React10.createElement(VscSymbolNamespace3, null),
824
- hashes: elevatedPayloadHashes,
825
- headingTitle: "On Chain Payloads",
826
- schemas: elevatedPayloadSchemas,
827
- sx: {
828
- mb: 1
829
- }
830
- }), (publicPayloadHashes?.length ?? 0) > 0 && /* @__PURE__ */ React10.createElement(PayloadTableFlexbox, {
831
- eventNoun: "payload",
832
- clickableFields: [
833
- "hash"
834
- ],
835
- tooltip: "Public payloads included in the transaction.",
836
- IconComponent: /* @__PURE__ */ React10.createElement(VscSymbolNamespace3, null),
837
- hashes: publicPayloadHashes,
838
- headingTitle: "Public Payloads",
839
- schemas: publicPayloadSchemas,
840
- sx: {
841
- mb: 1
842
- }
843
- }), (referencedPayloadHashes?.length ?? 0) > 0 && /* @__PURE__ */ React10.createElement(PayloadTableFlexbox, {
844
- // TODO - bring back once the hashes can be searched via datalake
845
- tooltip: "Payload hashes referenced by the transaction but not included.",
846
- IconComponent: /* @__PURE__ */ React10.createElement(VscSymbolNamespace3, null),
847
- clickableFields: nonClickableFields,
848
- hashes: referencedPayloadHashes,
849
- headingTitle: "Referenced Payloads",
850
- schemas: referencedPayloadSchemas,
851
- sx: {
852
- mb: 1
853
- }
854
- }), /* @__PURE__ */ React10.createElement(FlexCol3, {
855
- alignItems: "stretch",
856
- rowGap: 1,
857
- mb: 1
858
- }, /* @__PURE__ */ React10.createElement(HeadingPaper3, {
859
- IconComponent: /* @__PURE__ */ React10.createElement(FaSignature2, null),
860
- heading: "Signatures"
861
- }), /* @__PURE__ */ React10.createElement(BoundWitnessSignatureTable2, {
862
- block: wrapper?.boundWitness
863
- })));
864
- }, "TransactionBoundWitnessDetails");
717
+ ),
718
+ /* @__PURE__ */ jsx10(ErrorRender3, { error: wrapperError, scope: "wrapperError:TransactionBoundWitnessDetails.tsx" }),
719
+ /* @__PURE__ */ jsx10(ErrorRender3, { error: elevatedPayloadSetsError, scope: "elevatedPayloadSetsError:TransactionBoundWitnessDetails.tsx" }),
720
+ /* @__PURE__ */ jsx10(ErrorRender3, { error: publicPayloadsError, scope: "publicPayloadsError:TransactionBoundWitnessDetails.tsx" }),
721
+ referencedPayloadsError.map((error, index) => (
722
+ // eslint-disable-next-line @eslint-react/no-array-index-key
723
+ /* @__PURE__ */ jsx10(ErrorRender3, { error, scope: "referencedPayloadsError:TransactionBoundWitnessDetails.tsx" }, index)
724
+ )),
725
+ /* @__PURE__ */ jsx10(TransactionBoundWitnessCard, { elevation: 4, wrapper }),
726
+ /* @__PURE__ */ jsx10(
727
+ PayloadTableFlexbox,
728
+ {
729
+ eventNoun: "payload",
730
+ clickableFields: ["hash"],
731
+ tooltip: "Payloads included in the transaction that are elevated and validated.",
732
+ IconComponent: /* @__PURE__ */ jsx10(VscSymbolNamespace3, {}),
733
+ hashes: elevatedPayloadHashes,
734
+ headingTitle: "On Chain Payloads",
735
+ schemas: elevatedPayloadSchemas,
736
+ sx: { mb: 1 }
737
+ }
738
+ ),
739
+ (publicPayloadHashes?.length ?? 0) > 0 && /* @__PURE__ */ jsx10(
740
+ PayloadTableFlexbox,
741
+ {
742
+ eventNoun: "payload",
743
+ clickableFields: ["hash"],
744
+ tooltip: "Public payloads included in the transaction.",
745
+ IconComponent: /* @__PURE__ */ jsx10(VscSymbolNamespace3, {}),
746
+ hashes: publicPayloadHashes,
747
+ headingTitle: "Public Payloads",
748
+ schemas: publicPayloadSchemas,
749
+ sx: { mb: 1 }
750
+ }
751
+ ),
752
+ (referencedPayloadHashes?.length ?? 0) > 0 && /* @__PURE__ */ jsx10(
753
+ PayloadTableFlexbox,
754
+ {
755
+ tooltip: "Payload hashes referenced by the transaction but not included.",
756
+ IconComponent: /* @__PURE__ */ jsx10(VscSymbolNamespace3, {}),
757
+ clickableFields: nonClickableFields,
758
+ hashes: referencedPayloadHashes,
759
+ headingTitle: "Referenced Payloads",
760
+ schemas: referencedPayloadSchemas,
761
+ sx: { mb: 1 }
762
+ }
763
+ ),
764
+ /* @__PURE__ */ jsxs7(FlexCol3, { alignItems: "stretch", rowGap: 1, mb: 1, children: [
765
+ /* @__PURE__ */ jsx10(HeadingPaper3, { IconComponent: /* @__PURE__ */ jsx10(FaSignature2, {}), heading: "Signatures" }),
766
+ /* @__PURE__ */ jsx10(BoundWitnessSignatureTable2, { block: wrapper?.boundWitness })
767
+ ] })
768
+ ] });
769
+ };
865
770
  export {
866
771
  BlockBoundWitnessDetails,
867
772
  PayloadTableFlexbox,