@xyo-network/react-chain-boundwitness 1.3.28 → 1.3.30

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.
@@ -136,142 +136,224 @@ var BlockBoundWitnessDetails = /* @__PURE__ */ __name(({ block, paper, children,
136
136
  }, "BlockBoundWitnessDetails");
137
137
 
138
138
  // src/components/transactions/card/Card.tsx
139
- import { Card, CardContent, Grid, Typography as Typography2 } from "@mui/material";
139
+ import { Card, CardContent, Grid, Typography as Typography3 } from "@mui/material";
140
140
  import { isUndefined } from "@xylabs/typeof";
141
141
  import { bigIntToFixedPointString } from "@xyo-network/chain-utils";
142
- import React4, { useCallback } from "react";
142
+ import React5, { useMemo as useMemo3 } from "react";
143
143
  import { GiReceiveMoney, GiSandsOfTime } from "react-icons/gi";
144
144
  import { IoStatsChartOutline } from "react-icons/io5";
145
145
  import { MdOutlineAlternateEmail } from "react-icons/md";
146
146
 
147
147
  // src/components/transactions/card/DetailsStack.tsx
148
- import { Icon, Stack, styled, Typography } from "@mui/material";
149
- import React3 from "react";
150
- var DetailsStack = /* @__PURE__ */ __name(({ IconComponent, heading, children, ...props }) => {
148
+ import { Stack, styled, Tooltip, Typography, useTheme } from "@mui/material";
149
+ import { isDefined } from "@xylabs/typeof";
150
+ import React3, { useMemo as useMemo2 } from "react";
151
+ var DetailsStack = /* @__PURE__ */ __name(({ IconComponent, heading, children, tooltipTitle, ...props }) => {
152
+ const theme = useTheme();
153
+ const hasTooltip = isDefined(tooltipTitle);
154
+ const resolvedIconComponent = useMemo2(() => {
155
+ return IconComponent ? /* @__PURE__ */ React3.createElement(IconComponent, {
156
+ style: {
157
+ /** height and marginTop adjusted to account for font not filling container with line-height: 1 */
158
+ height: "0.85rem",
159
+ marginTop: 0.5,
160
+ marginLeft: theme.spacing(1)
161
+ }
162
+ }) : /* @__PURE__ */ React3.createElement(React3.Fragment, null);
163
+ }, [
164
+ IconComponent
165
+ ]);
151
166
  return /* @__PURE__ */ React3.createElement(Stack, {
152
- direction: "row",
153
- mb: 1,
154
- gap: 1,
155
- ...props
156
- }, IconComponent && /* @__PURE__ */ React3.createElement(Icon, {
157
- fontSize: "small",
158
- sx: {
159
- mr: 0.25
160
- }
161
- }, /* @__PURE__ */ React3.createElement(IconComponent, {
162
- style: {
163
- height: "0.7em"
164
- }
165
- })), /* @__PURE__ */ React3.createElement(Stack, {
166
167
  direction: "column",
168
+ flexGrow: 1,
167
169
  flexWrap: "wrap",
168
- mb: 1
169
- }, /* @__PURE__ */ React3.createElement(SectionHeadingTypography, null, heading), children));
170
+ minWidth: "1px",
171
+ ...props
172
+ }, /* @__PURE__ */ React3.createElement(SectionHeadingTypography, null, heading, hasTooltip ? /* @__PURE__ */ React3.createElement(Tooltip, {
173
+ title: tooltipTitle
174
+ }, resolvedIconComponent) : resolvedIconComponent), children);
170
175
  }, "DetailsStack");
171
176
  var SectionHeadingTypography = styled(Typography, {
172
177
  name: "SectionHeadingTypography"
173
178
  })(({ theme }) => ({
174
- display: "inline-flex",
175
- alignItems: "baseline",
179
+ display: "flex",
176
180
  fontFamily: "monospace",
177
- fontSize: 16,
178
- marginBottom: theme.spacing(0.75)
181
+ lineHeight: 1,
182
+ marginBottom: theme.spacing(1.5)
179
183
  }));
180
184
 
181
- // src/components/transactions/card/Card.tsx
182
- var TransactionBoundWitnessCard = /* @__PURE__ */ __name(({ wrapper, ...props }) => {
183
- if (!wrapper) return null;
184
- const formatFee = useCallback((fee) => {
185
- if (isUndefined(fee)) return;
186
- return bigIntToFixedPointString(fee, 12);
187
- }, []);
188
- return /* @__PURE__ */ React4.createElement(Card, props, /* @__PURE__ */ React4.createElement(CardContent, {
185
+ // src/components/transactions/card/LabelValueStack.tsx
186
+ import { Stack as Stack2, Typography as Typography2, useTheme as useTheme2 } from "@mui/material";
187
+ import React4 from "react";
188
+ var LabelValueStack = /* @__PURE__ */ __name(({ labels, values, ...props }) => {
189
+ const theme = useTheme2();
190
+ return /* @__PURE__ */ React4.createElement(Stack2, {
191
+ flexDirection: "row",
192
+ flexGrow: 1,
193
+ ...props
194
+ }, /* @__PURE__ */ React4.createElement(Stack2, null, labels.map((label) => /* @__PURE__ */ React4.createElement(Typography2, {
195
+ fontWeight: "300",
196
+ key: label,
197
+ variant: "body2",
198
+ sx: {
199
+ borderBottom: `1px solid ${theme.vars?.palette.divider}`,
200
+ opacity: 0.7
201
+ }
202
+ }, label, ":"))), /* @__PURE__ */ React4.createElement(Stack2, {
203
+ alignItems: "end",
204
+ flexGrow: 1
205
+ }, values.map((value) => /* @__PURE__ */ React4.createElement(Typography2, {
206
+ fontFamily: "monospace",
207
+ variant: "body2",
208
+ key: value,
209
+ width: "100%",
189
210
  sx: {
190
211
  display: "flex",
191
- flexDirection: "row",
192
- gap: 2,
193
- flexWrap: "wrap"
212
+ justifyContent: "end",
213
+ borderBottom: `1px solid ${theme.vars?.palette.divider}`
194
214
  }
195
- }, /* @__PURE__ */ React4.createElement(Grid, {
215
+ }, value))));
216
+ }, "LabelValueStack");
217
+
218
+ // src/components/transactions/card/Card.tsx
219
+ var formatFee = /* @__PURE__ */ __name((fee) => {
220
+ if (isUndefined(fee)) return;
221
+ const stringValue = bigIntToFixedPointString(fee, 12);
222
+ if (stringValue === "0") return "0.0";
223
+ return stringValue;
224
+ }, "formatFee");
225
+ var TransactionBoundWitnessCard = /* @__PURE__ */ __name(({ wrapper, ...props }) => {
226
+ if (!wrapper) return null;
227
+ const stats = useMemo3(() => {
228
+ const labels = [
229
+ "Reward",
230
+ "Elevated Payloads",
231
+ "Total Payloads",
232
+ "Signatures"
233
+ ];
234
+ const values = [
235
+ wrapper.reward().toLocaleString(navigator.language ?? "en-US"),
236
+ wrapper.elevatedPayloadCount.toLocaleString(navigator.language ?? "en-US"),
237
+ wrapper.payloadCount.toLocaleString(navigator.language ?? "en-US"),
238
+ wrapper.signatureCount.toLocaleString(navigator.language ?? "en-US"),
239
+ ,
240
+ ];
241
+ return {
242
+ labels,
243
+ values
244
+ };
245
+ }, [
246
+ wrapper
247
+ ]);
248
+ const fees = useMemo3(() => {
249
+ const labels = [
250
+ "Base",
251
+ "Gas",
252
+ "Priority",
253
+ "Gas Limit"
254
+ ];
255
+ const values = [
256
+ formatFee(wrapper.fees.base),
257
+ formatFee(wrapper.fees.gasPrice),
258
+ formatFee(wrapper.fees.priority),
259
+ formatFee(wrapper.fees.gasLimit)
260
+ ];
261
+ return {
262
+ labels,
263
+ values
264
+ };
265
+ }, [
266
+ wrapper
267
+ ]);
268
+ const blockDuration = useMemo3(() => {
269
+ const labels = [
270
+ "Expiration",
271
+ "Not Before"
272
+ ];
273
+ const values = [
274
+ wrapper.boundWitness.exp.toLocaleString(navigator.language ?? "en-US"),
275
+ wrapper.boundWitness.nbf.toLocaleString(navigator.language ?? "en-US")
276
+ ];
277
+ return {
278
+ labels,
279
+ values
280
+ };
281
+ }, [
282
+ wrapper
283
+ ]);
284
+ return /* @__PURE__ */ React5.createElement(Card, props, /* @__PURE__ */ React5.createElement(CardContent, null, /* @__PURE__ */ React5.createElement(Grid, {
196
285
  container: true,
197
- spacing: 3,
286
+ spacing: 6,
198
287
  sx: {
199
288
  width: "100%"
200
289
  }
201
- }, /* @__PURE__ */ React4.createElement(Grid, {
290
+ }, /* @__PURE__ */ React5.createElement(Grid, {
202
291
  size: {
203
292
  xs: 12
204
293
  }
205
- }, /* @__PURE__ */ React4.createElement(DetailsStack, {
294
+ }, /* @__PURE__ */ React5.createElement(DetailsStack, {
206
295
  IconComponent: MdOutlineAlternateEmail,
207
- heading: "From:"
208
- }, /* @__PURE__ */ React4.createElement(Typography2, {
296
+ heading: "From:",
297
+ tooltipTitle: "Address of the sender"
298
+ }, /* @__PURE__ */ React5.createElement(Typography3, {
209
299
  variant: "body2",
210
300
  sx: {
211
301
  maxWidth: "100%",
212
302
  textOverflow: "ellipsis",
213
- overflow: "hidden"
303
+ overflow: "hidden",
304
+ fontFamily: "monospace"
214
305
  }
215
- }, wrapper?.boundWitness.from))), /* @__PURE__ */ React4.createElement(Grid, {
306
+ }, wrapper?.boundWitness.from))), /* @__PURE__ */ React5.createElement(Grid, {
216
307
  size: {
217
308
  xs: 12,
218
309
  sm: 6,
219
310
  md: 4
220
311
  }
221
- }, /* @__PURE__ */ React4.createElement(DetailsStack, {
312
+ }, /* @__PURE__ */ React5.createElement(DetailsStack, {
222
313
  IconComponent: IoStatsChartOutline,
223
- heading: "Stats"
224
- }, /* @__PURE__ */ React4.createElement(Typography2, {
225
- variant: "body2"
226
- }, "Reward:", " ", wrapper?.reward()), /* @__PURE__ */ React4.createElement(Typography2, {
227
- variant: "body2"
228
- }, "Elevated Payloads:", " ", wrapper?.elevatedPayloadCount), /* @__PURE__ */ React4.createElement(Typography2, {
229
- variant: "body2"
230
- }, "Total Payloads:", " ", wrapper?.payloadCount), /* @__PURE__ */ React4.createElement(Typography2, {
231
- variant: "body2"
232
- }, "Signatures:", " ", wrapper?.signatureCount))), /* @__PURE__ */ React4.createElement(Grid, {
314
+ heading: "Stats",
315
+ tooltipTitle: "Transaction Statistics"
316
+ }, /* @__PURE__ */ React5.createElement(LabelValueStack, {
317
+ labels: stats.labels,
318
+ values: stats.values
319
+ }))), /* @__PURE__ */ React5.createElement(Grid, {
233
320
  size: {
234
321
  xs: 12,
235
322
  sm: 6,
236
323
  md: 4
237
324
  }
238
- }, /* @__PURE__ */ React4.createElement(DetailsStack, {
325
+ }, /* @__PURE__ */ React5.createElement(DetailsStack, {
239
326
  IconComponent: GiReceiveMoney,
240
- heading: "Fees"
241
- }, /* @__PURE__ */ React4.createElement(Typography2, {
242
- variant: "body2"
243
- }, "Base:", " ", formatFee(wrapper?.fees.base)), /* @__PURE__ */ React4.createElement(Typography2, {
244
- variant: "body2"
245
- }, "Gas:", " ", formatFee(wrapper?.fees.gasPrice)), /* @__PURE__ */ React4.createElement(Typography2, {
246
- variant: "body2"
247
- }, "Priority:", " ", formatFee(wrapper?.fees.priority)), /* @__PURE__ */ React4.createElement(Typography2, {
248
- variant: "body2"
249
- }, "Gas Limit:", " ", formatFee(wrapper?.fees.gasLimit)))), /* @__PURE__ */ React4.createElement(Grid, {
327
+ heading: "Fees",
328
+ tooltipTitle: "Fees offered to the producer"
329
+ }, /* @__PURE__ */ React5.createElement(LabelValueStack, {
330
+ labels: fees.labels,
331
+ values: fees.values
332
+ }))), /* @__PURE__ */ React5.createElement(Grid, {
250
333
  size: {
251
334
  xs: 12,
252
335
  sm: 6,
253
336
  md: 4
254
337
  }
255
- }, /* @__PURE__ */ React4.createElement(DetailsStack, {
338
+ }, /* @__PURE__ */ React5.createElement(DetailsStack, {
256
339
  IconComponent: GiSandsOfTime,
257
- heading: "Block Duration"
258
- }, /* @__PURE__ */ React4.createElement(Typography2, {
259
- variant: "body2"
260
- }, "Expiration:", " ", wrapper?.boundWitness.exp), /* @__PURE__ */ React4.createElement(Typography2, {
261
- variant: "body2"
262
- }, "Not Before:", " ", wrapper?.boundWitness?.nbf))))));
340
+ heading: "Block Duration",
341
+ tooltipTitle: "Block window for the transaction to be valid"
342
+ }, /* @__PURE__ */ React5.createElement(LabelValueStack, {
343
+ labels: blockDuration.labels,
344
+ values: blockDuration.values
345
+ }))))));
263
346
  }, "TransactionBoundWitnessCard");
264
347
 
265
348
  // src/components/transactions/TransactionDetails.tsx
266
- import { Divider as Divider2 } from "@mui/material";
267
349
  import { ErrorRender as ErrorRender2 } from "@xylabs/react-error";
268
350
  import { FlexCol as FlexCol3 } from "@xylabs/react-flexbox";
269
351
  import { usePromise as usePromise2 } from "@xylabs/react-promise";
270
- import { isDefined } from "@xylabs/typeof";
352
+ import { isDefined as isDefined2 } from "@xylabs/typeof";
271
353
  import { SignedHydratedTransactionWrapper } from "@xyo-network/chain-wrappers";
272
354
  import { PayloadBuilder as PayloadBuilder2 } from "@xyo-network/payload-builder";
273
355
  import { BoundWitnessSignatureTable as BoundWitnessSignatureTable2, BWActions as BWActions2, HashHeadingPaper as HashHeadingPaper2, HeadingPaper as HeadingPaper3 } from "@xyo-network/react-boundwitness-plugin";
274
- import React5 from "react";
356
+ import React6 from "react";
275
357
  import { FaSignature as FaSignature2 } from "react-icons/fa";
276
358
  import { VscSymbolMethod as VscSymbolMethod3 } from "react-icons/vsc";
277
359
  var TransactionBoundWitnessDetails = /* @__PURE__ */ __name(({ transaction, ...props }) => {
@@ -283,7 +365,7 @@ var TransactionBoundWitnessDetails = /* @__PURE__ */ __name(({ transaction, ...p
283
365
  transaction
284
366
  ]);
285
367
  const [elevatedPayloadSets, elevatedPayloadSetsError] = usePromise2(async () => {
286
- if (isDefined(wrapper)) {
368
+ if (isDefined2(wrapper)) {
287
369
  const elevatedPayloads = wrapper.elevatedPayloads;
288
370
  const pairs = await PayloadBuilder2.hashPairs(elevatedPayloads);
289
371
  return formatPayloadsForTable(pairs);
@@ -297,53 +379,49 @@ var TransactionBoundWitnessDetails = /* @__PURE__ */ __name(({ transaction, ...p
297
379
  wrapper
298
380
  ]);
299
381
  const { hashes: elevatedPayloadHashes, schemas: elevatedPayloadSchemas } = elevatedPayloadSets ?? {};
300
- return /* @__PURE__ */ React5.createElement(FlexCol3, {
382
+ return /* @__PURE__ */ React6.createElement(FlexCol3, {
301
383
  alignItems: "stretch",
302
- rowGap: 4,
384
+ rowGap: 2,
303
385
  ...props
304
- }, /* @__PURE__ */ React5.createElement(HashHeadingPaper2, {
386
+ }, /* @__PURE__ */ React6.createElement(HashHeadingPaper2, {
305
387
  hash: wrapper?.boundWitness?._hash,
306
388
  paperProps: {
307
389
  sx: {
308
390
  p: 2
309
391
  }
310
392
  },
311
- AdornmentEnd: /* @__PURE__ */ React5.createElement(BWActions2, {
393
+ AdornmentEnd: /* @__PURE__ */ React6.createElement(BWActions2, {
312
394
  boundwitness: wrapper?.boundWitness
313
395
  }),
314
396
  identiconProps: {
315
397
  p: 0.75,
316
398
  size: 24
317
399
  }
318
- }), /* @__PURE__ */ React5.createElement(ErrorRender2, {
400
+ }), /* @__PURE__ */ React6.createElement(ErrorRender2, {
319
401
  error: wrapperError,
320
402
  scope: "wrapperError:TransactionBoundWitnessDetails.tsx"
321
- }), /* @__PURE__ */ React5.createElement(ErrorRender2, {
403
+ }), /* @__PURE__ */ React6.createElement(ErrorRender2, {
322
404
  error: elevatedPayloadSetsError,
323
405
  scope: "elevatedPayloadSetsError:TransactionBoundWitnessDetails.tsx"
324
- }), /* @__PURE__ */ React5.createElement(Divider2, {
325
- flexItem: true
326
- }), /* @__PURE__ */ React5.createElement(TransactionBoundWitnessCard, {
406
+ }), /* @__PURE__ */ React6.createElement(TransactionBoundWitnessCard, {
327
407
  elevation: 4,
328
408
  wrapper
329
- }), /* @__PURE__ */ React5.createElement(Divider2, {
330
- flexItem: true
331
- }), /* @__PURE__ */ React5.createElement(BWPayloadTableFlexbox, {
332
- IconComponent: /* @__PURE__ */ React5.createElement(VscSymbolMethod3, null),
409
+ }), /* @__PURE__ */ React6.createElement(BWPayloadTableFlexbox, {
410
+ IconComponent: /* @__PURE__ */ React6.createElement(VscSymbolMethod3, null),
333
411
  hashes: elevatedPayloadHashes,
334
412
  headingTitle: "Elevated Payloads",
335
413
  schemas: elevatedPayloadSchemas,
336
414
  sx: {
337
415
  mb: 1
338
416
  }
339
- }), /* @__PURE__ */ React5.createElement(FlexCol3, {
417
+ }), /* @__PURE__ */ React6.createElement(FlexCol3, {
340
418
  alignItems: "stretch",
341
419
  rowGap: 1,
342
420
  mb: 1
343
- }, /* @__PURE__ */ React5.createElement(HeadingPaper3, {
344
- IconComponent: /* @__PURE__ */ React5.createElement(FaSignature2, null),
421
+ }, /* @__PURE__ */ React6.createElement(HeadingPaper3, {
422
+ IconComponent: /* @__PURE__ */ React6.createElement(FaSignature2, null),
345
423
  heading: "Signatures"
346
- }), /* @__PURE__ */ React5.createElement(BoundWitnessSignatureTable2, {
424
+ }), /* @__PURE__ */ React6.createElement(BoundWitnessSignatureTable2, {
347
425
  block: wrapper?.boundWitness
348
426
  })));
349
427
  }, "TransactionBoundWitnessDetails");
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/block/BlockBoundWitnessDetails.tsx","../../src/lib/formatPayloadsForTable.ts","../../src/components/BwPayloadTable.tsx","../../src/components/transactions/card/Card.tsx","../../src/components/transactions/card/DetailsStack.tsx","../../src/components/transactions/TransactionDetails.tsx"],"sourcesContent":["import { Divider } from '@mui/material'\nimport { filterAs } from '@xylabs/array'\nimport { ErrorRender } from '@xylabs/react-error'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport { usePromise } from '@xylabs/react-promise'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport {\n BoundWitnessPayloadsTable,\n BoundWitnessSignatureTable,\n BWActions,\n HashHeadingPaper,\n HeadingPaper,\n} from '@xyo-network/react-boundwitness-plugin'\nimport { useTxsFromBlock } from '@xyo-network/react-chain-blockchain'\nimport { usePayloadHash } from '@xyo-network/react-shared'\nimport { isTransactionBoundWitness, type SignedHydratedBlock } from '@xyo-network/xl1-protocol'\nimport React, { useMemo } from 'react'\nimport { FaSignature } from 'react-icons/fa'\nimport { GrTransaction } from 'react-icons/gr'\nimport { VscSymbolMethod, VscSymbolNamespace } from 'react-icons/vsc'\n\nimport { formatPayloadsForTable } from '../../lib/index.ts'\nimport type { TransactionBoundWitnessEvents } from '../../types/index.ts'\nimport { BWPayloadTableFlexbox } from '../BwPayloadTable.tsx'\n\nexport interface BoundWitnessDetailsProps extends FlexBoxProps {\n block?: SignedHydratedBlock\n}\n\nexport const BlockBoundWitnessDetails = ({\n block, paper, children, ...props\n}: BoundWitnessDetailsProps) => {\n const boundWitness = block?.[0]\n const payloads = block?.[1]\n\n const hash = usePayloadHash(boundWitness)\n\n const [transactions, txFromBlockError] = useTxsFromBlock(block)\n\n const { hashes: txHashes, schemas: txSchemas } = useMemo(() => formatPayloadsForTable(transactions ?? []), [transactions])\n\n const [nonTxBoundWitnesses, bwsFromBlockError] = usePromise(async () => {\n const bws = filterAs(payloads ?? [], payload =>\n (!isTransactionBoundWitness(payload) && isBoundWitness(payload)) ? payload : undefined)\n return await PayloadBuilder.hashPairs(bws)\n }, [payloads])\n\n const { hashes: nonTxBwHashes, schemas: nonTxBwSchemas } = useMemo(() => formatPayloadsForTable(nonTxBoundWitnesses ?? []), [nonTxBoundWitnesses])\n const hasNonTxBoundWitnesses = (nonTxBoundWitnesses?.length ?? 0) > 0\n\n return (\n <FlexCol alignItems=\"stretch\" rowGap={4} {...props}>\n <ErrorRender error={txFromBlockError ?? bwsFromBlockError} scope=\"BlockBoundWitnessDetails.tsx\" />\n <HashHeadingPaper\n hash={hash}\n paperProps={{ sx: { p: 2 } }}\n AdornmentEnd={<BWActions boundwitness={boundWitness} />}\n identiconProps={{ p: 0.75, size: 24 }}\n />\n <Divider flexItem />\n {(transactions?.length ?? 0) > 0 && (\n <BWPayloadTableFlexbox<TransactionBoundWitnessEvents>\n IconComponent={<GrTransaction />}\n eventNoun=\"transaction\"\n hashes={txHashes}\n headingTitle=\"Transactions\"\n schemas={txSchemas}\n sx={{ mb: 1 }}\n />\n )}\n <FlexCol alignItems=\"stretch\" rowGap={1} mb={1}>\n <HeadingPaper IconComponent={<VscSymbolNamespace />} heading=\"Payloads\" />\n <BoundWitnessPayloadsTable boundwitness={boundWitness} />\n </FlexCol>\n {hasNonTxBoundWitnesses\n ? (\n <BWPayloadTableFlexbox<TransactionBoundWitnessEvents>\n IconComponent={<VscSymbolMethod />}\n eventNoun=\"boundwitness\"\n hashes={nonTxBwHashes}\n headingTitle=\"Bound Witnesses\"\n schemas={nonTxBwSchemas}\n sx={{ mb: 1 }}\n />\n )\n : null}\n <FlexCol alignItems=\"stretch\" rowGap={1} mb={1}>\n <HeadingPaper IconComponent={<FaSignature />} heading=\"Signatures\" />\n <BoundWitnessSignatureTable block={boundWitness} />\n </FlexCol>\n </FlexCol>\n )\n}\n","import type { Hash } from '@xylabs/hex'\nimport type { Payload } from '@xyo-network/payload-model'\n\nexport const formatPayloadsForTable = (pairs: [Payload, Hash][]) => {\n let hashes: Hash[] = []\n let schemas: string[] = []\n for (const [bw, hash] of pairs ?? []) {\n hashes.push(hash)\n schemas.push(bw?.schema ?? '')\n }\n return { hashes, schemas }\n}\n","import type { Hash } from '@xylabs/hex'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport {\n BoundWitnessPayloadTableBody, BoundWitnessPayloadTableHead, HeadingPaper,\n} from '@xyo-network/react-boundwitness-plugin'\nimport type { EventNoun, ExtendEventNoun } from '@xyo-network/react-event'\nimport { TableEx } from '@xyo-network/react-table'\nimport React from 'react'\nimport { VscSymbolMethod } from 'react-icons/vsc'\n\nexport interface BWPayloadTableFlexboxProps<TNoun extends ExtendEventNoun = EventNoun> extends FlexBoxProps {\n IconComponent?: React.ReactNode\n eventNoun?: TNoun\n hashes?: Hash[]\n headingTitle?: string\n schemas?: string[]\n}\n\nexport const BWPayloadTableFlexbox = <TNoun extends ExtendEventNoun = EventNoun>({\n IconComponent,\n eventNoun,\n hashes,\n schemas,\n headingTitle,\n ...props\n}: BWPayloadTableFlexboxProps<TNoun>) => {\n const resolvedIconComponent = IconComponent ?? <VscSymbolMethod />\n return (\n <FlexCol alignItems=\"stretch\" rowGap={1} {...props}>\n <HeadingPaper IconComponent={resolvedIconComponent} heading={headingTitle} />\n <TableEx>\n <BoundWitnessPayloadTableHead />\n <BoundWitnessPayloadTableBody<TNoun> payloadHashes={hashes} payloadSchemas={schemas} eventNoun={eventNoun} />\n </TableEx>\n </FlexCol>\n )\n}\n","import type { CardProps } from '@mui/material'\nimport {\n Card, CardContent, Grid, Typography,\n} from '@mui/material'\nimport { isUndefined } from '@xylabs/typeof'\nimport { bigIntToFixedPointString } from '@xyo-network/chain-utils'\nimport type { SignedHydratedTransactionInstance } from '@xyo-network/xl1-protocol-sdk'\nimport React, { useCallback } from 'react'\nimport { GiReceiveMoney, GiSandsOfTime } from 'react-icons/gi'\nimport { IoStatsChartOutline } from 'react-icons/io5'\nimport { MdOutlineAlternateEmail } from 'react-icons/md'\n\nimport { DetailsStack } from './DetailsStack.tsx'\n\nexport interface TransactionBoundWitnessCardProps extends CardProps {\n wrapper?: SignedHydratedTransactionInstance\n}\n\nexport const TransactionBoundWitnessCard: React.FC<TransactionBoundWitnessCardProps> = ({ wrapper, ...props }) => {\n if (!wrapper) return null\n\n const formatFee = useCallback((fee?: bigint) => {\n if (isUndefined(fee)) return\n return bigIntToFixedPointString(fee, 12)\n }, [])\n\n return (\n <Card {...props}>\n <CardContent sx={{\n display: 'flex', flexDirection: 'row', gap: 2, flexWrap: 'wrap',\n }}\n >\n <Grid container spacing={3} sx={{ width: '100%' }}>\n <Grid size={{ xs: 12 }}>\n <DetailsStack IconComponent={MdOutlineAlternateEmail} heading=\"From:\">\n <Typography\n variant=\"body2\"\n sx={{\n maxWidth: '100%', textOverflow: 'ellipsis', overflow: 'hidden',\n }}\n >\n {wrapper?.boundWitness.from}\n </Typography>\n </DetailsStack>\n </Grid>\n <Grid size={{\n xs: 12, sm: 6, md: 4,\n }}\n >\n <DetailsStack IconComponent={IoStatsChartOutline} heading=\"Stats\">\n <Typography variant=\"body2\">\n Reward:\n {' '}\n {wrapper?.reward()}\n </Typography>\n <Typography variant=\"body2\">\n Elevated Payloads:\n {' '}\n {wrapper?.elevatedPayloadCount}\n </Typography>\n <Typography variant=\"body2\">\n Total Payloads:\n {' '}\n {wrapper?.payloadCount}\n </Typography>\n <Typography variant=\"body2\">\n Signatures:\n {' '}\n {wrapper?.signatureCount}\n </Typography>\n </DetailsStack>\n </Grid>\n <Grid size={{\n xs: 12, sm: 6, md: 4,\n }}\n >\n <DetailsStack IconComponent={GiReceiveMoney} heading=\"Fees\">\n <Typography variant=\"body2\">\n Base:\n {' '}\n {formatFee(wrapper?.fees.base)}\n </Typography>\n <Typography variant=\"body2\">\n Gas:\n {' '}\n {formatFee(wrapper?.fees.gasPrice)}\n </Typography>\n <Typography variant=\"body2\">\n Priority:\n {' '}\n {formatFee(wrapper?.fees.priority)}\n </Typography>\n <Typography variant=\"body2\">\n Gas Limit:\n {' '}\n {formatFee(wrapper?.fees.gasLimit)}\n </Typography>\n </DetailsStack>\n </Grid>\n <Grid size={{\n xs: 12, sm: 6, md: 4,\n }}\n >\n <DetailsStack IconComponent={GiSandsOfTime} heading=\"Block Duration\">\n <Typography variant=\"body2\">\n Expiration:\n {' '}\n {wrapper?.boundWitness.exp}\n </Typography>\n <Typography variant=\"body2\">\n Not Before:\n {' '}\n {wrapper?.boundWitness?.nbf}\n </Typography>\n </DetailsStack>\n </Grid>\n </Grid>\n </CardContent>\n </Card>\n )\n}\n","import type { StackProps } from '@mui/material'\nimport {\n Icon, Stack, styled, Typography,\n} from '@mui/material'\nimport type { ComponentType, SVGAttributes } from 'react'\nimport React from 'react'\n\nexport interface DetailsStackProps extends StackProps {\n IconComponent?: ComponentType<SVGAttributes<SVGElement>>\n heading?: string\n}\n\nexport const DetailsStack: React.FC<DetailsStackProps> = ({\n IconComponent, heading, children, ...props\n}) => {\n return (\n <Stack direction=\"row\" mb={1} gap={1} {...props}>\n {IconComponent && <Icon fontSize=\"small\" sx={{ mr: 0.25 }}><IconComponent style={{ height: '0.7em' }} /></Icon>}\n <Stack direction=\"column\" flexWrap=\"wrap\" mb={1}>\n <SectionHeadingTypography>\n {heading}\n </SectionHeadingTypography>\n {children}\n </Stack>\n </Stack>\n )\n}\n\nconst SectionHeadingTypography = styled(Typography, { name: 'SectionHeadingTypography' })(({ theme }) => ({\n display: 'inline-flex',\n alignItems: 'baseline',\n fontFamily: 'monospace',\n fontSize: 16,\n marginBottom: theme.spacing(0.75),\n}))\n","import { Divider } from '@mui/material'\nimport { ErrorRender } from '@xylabs/react-error'\nimport { type FlexBoxProps, FlexCol } from '@xylabs/react-flexbox'\nimport { usePromise } from '@xylabs/react-promise'\nimport { isDefined } from '@xylabs/typeof'\nimport { SignedHydratedTransactionWrapper } from '@xyo-network/chain-wrappers'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport {\n BoundWitnessSignatureTable, BWActions, HashHeadingPaper, HeadingPaper,\n} from '@xyo-network/react-boundwitness-plugin'\nimport type { SignedHydratedTransaction } from '@xyo-network/xl1-protocol'\nimport React from 'react'\nimport { FaSignature } from 'react-icons/fa'\nimport { VscSymbolMethod } from 'react-icons/vsc'\n\nimport { formatPayloadsForTable } from '../../lib/index.ts'\nimport { BWPayloadTableFlexbox } from '../BwPayloadTable.tsx'\nimport { TransactionBoundWitnessCard } from './card/index.ts'\n\nexport interface TransactionBoundWitnessDetailsProps extends FlexBoxProps {\n transaction?: SignedHydratedTransaction | null\n}\n\nexport const TransactionBoundWitnessDetails: React.FC<TransactionBoundWitnessDetailsProps> = ({ transaction, ...props }) => {\n const [wrapper, wrapperError] = usePromise(async () => {\n if (transaction) {\n return await SignedHydratedTransactionWrapper.parse(transaction)\n }\n }, [transaction])\n\n const [elevatedPayloadSets, elevatedPayloadSetsError] = usePromise(async () => {\n if (isDefined(wrapper)) {\n const elevatedPayloads = wrapper.elevatedPayloads\n const pairs = await PayloadBuilder.hashPairs(elevatedPayloads)\n return formatPayloadsForTable(pairs)\n } else {\n return { hashes: [], schemas: [] }\n }\n }, [wrapper])\n\n const { hashes: elevatedPayloadHashes, schemas: elevatedPayloadSchemas } = elevatedPayloadSets ?? {}\n\n return (\n <FlexCol alignItems=\"stretch\" rowGap={4} {...props}>\n <HashHeadingPaper\n hash={wrapper?.boundWitness?._hash}\n paperProps={{ sx: { p: 2 } }}\n AdornmentEnd={<BWActions boundwitness={wrapper?.boundWitness} />}\n identiconProps={{ p: 0.75, size: 24 }}\n />\n <ErrorRender error={wrapperError} scope=\"wrapperError:TransactionBoundWitnessDetails.tsx\" />\n <ErrorRender error={elevatedPayloadSetsError} scope=\"elevatedPayloadSetsError:TransactionBoundWitnessDetails.tsx\" />\n <Divider flexItem />\n <TransactionBoundWitnessCard elevation={4} wrapper={wrapper} />\n <Divider flexItem />\n <BWPayloadTableFlexbox\n IconComponent={<VscSymbolMethod />}\n hashes={elevatedPayloadHashes}\n headingTitle=\"Elevated Payloads\"\n schemas={elevatedPayloadSchemas}\n sx={{ mb: 1 }}\n />\n <FlexCol alignItems=\"stretch\" rowGap={1} mb={1}>\n <HeadingPaper IconComponent={<FaSignature />} heading=\"Signatures\" />\n <BoundWitnessSignatureTable block={wrapper?.boundWitness} />\n </FlexCol>\n </FlexCol>\n )\n}\n"],"mappings":";;;;AAAA,SAASA,eAAe;AACxB,SAASC,gBAAgB;AACzB,SAASC,mBAAmB;AAE5B,SAASC,WAAAA,gBAAe;AACxB,SAASC,kBAAkB;AAC3B,SAASC,sBAAsB;AAC/B,SAASC,sBAAsB;AAC/B,SACEC,2BACAC,4BACAC,WACAC,kBACAC,gBAAAA,qBACK;AACP,SAASC,uBAAuB;AAChC,SAASC,sBAAsB;AAC/B,SAASC,iCAA2D;AACpE,OAAOC,UAASC,eAAe;AAC/B,SAASC,mBAAmB;AAC5B,SAASC,qBAAqB;AAC9B,SAASC,mBAAAA,kBAAiBC,0BAA0B;;;AClB7C,IAAMC,yBAAyB,wBAACC,UAAAA;AACrC,MAAIC,SAAiB,CAAA;AACrB,MAAIC,UAAoB,CAAA;AACxB,aAAW,CAACC,IAAIC,IAAAA,KAASJ,SAAS,CAAA,GAAI;AACpCC,WAAOI,KAAKD,IAAAA;AACZF,YAAQG,KAAKF,IAAIG,UAAU,EAAA;EAC7B;AACA,SAAO;IAAEL;IAAQC;EAAQ;AAC3B,GARsC;;;ACDtC,SAASK,eAAe;AACxB,SACEC,8BAA8BC,8BAA8BC,oBACvD;AAEP,SAASC,eAAe;AACxB,OAAOC,WAAW;AAClB,SAASC,uBAAuB;AAUzB,IAAMC,wBAAwB,wBAA4C,EAC/EC,eACAC,WACAC,QACAC,SACAC,cACA,GAAGC,MAAAA,MAC+B;AAClC,QAAMC,wBAAwBN,iBAAiB,sBAAA,cAACO,iBAAAA,IAAAA;AAChD,SACE,sBAAA,cAACC,SAAAA;IAAQC,YAAW;IAAUC,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,cAAAA,IAAAA;IAAgBC,SAAQ;MACtD,gBAAA9B,OAAA,cAAC+B,6BAAAA;IAA2BC,OAAOjD,SAASuB;;AAIpD,GA7C6F;","names":["Divider","filterAs","ErrorRender","FlexCol","usePromise","isBoundWitness","PayloadBuilder","BoundWitnessPayloadsTable","BoundWitnessSignatureTable","BWActions","HashHeadingPaper","HeadingPaper","useTxsFromBlock","usePayloadHash","isTransactionBoundWitness","React","useMemo","FaSignature","GrTransaction","VscSymbolMethod","VscSymbolNamespace","formatPayloadsForTable","pairs","hashes","schemas","bw","hash","push","schema","FlexCol","BoundWitnessPayloadTableBody","BoundWitnessPayloadTableHead","HeadingPaper","TableEx","React","VscSymbolMethod","BWPayloadTableFlexbox","IconComponent","eventNoun","hashes","schemas","headingTitle","props","resolvedIconComponent","VscSymbolMethod","FlexCol","alignItems","rowGap","HeadingPaper","heading","TableEx","BoundWitnessPayloadTableHead","BoundWitnessPayloadTableBody","payloadHashes","payloadSchemas","BlockBoundWitnessDetails","block","paper","children","props","boundWitness","payloads","hash","usePayloadHash","transactions","txFromBlockError","useTxsFromBlock","hashes","txHashes","schemas","txSchemas","useMemo","formatPayloadsForTable","nonTxBoundWitnesses","bwsFromBlockError","usePromise","bws","filterAs","payload","isTransactionBoundWitness","isBoundWitness","undefined","PayloadBuilder","hashPairs","nonTxBwHashes","nonTxBwSchemas","hasNonTxBoundWitnesses","length","React","FlexCol","alignItems","rowGap","ErrorRender","error","scope","HashHeadingPaper","paperProps","sx","p","AdornmentEnd","BWActions","boundwitness","identiconProps","size","Divider","flexItem","BWPayloadTableFlexbox","IconComponent","GrTransaction","eventNoun","headingTitle","mb","HeadingPaper","VscSymbolNamespace","heading","BoundWitnessPayloadsTable","VscSymbolMethod","FaSignature","BoundWitnessSignatureTable","Card","CardContent","Grid","Typography","isUndefined","bigIntToFixedPointString","React","useCallback","GiReceiveMoney","GiSandsOfTime","IoStatsChartOutline","MdOutlineAlternateEmail","Icon","Stack","styled","Typography","React","DetailsStack","IconComponent","heading","children","props","React","Stack","direction","mb","gap","Icon","fontSize","sx","mr","style","height","flexWrap","SectionHeadingTypography","styled","Typography","name","theme","display","alignItems","fontFamily","marginBottom","spacing","TransactionBoundWitnessCard","wrapper","props","formatFee","useCallback","fee","isUndefined","bigIntToFixedPointString","React","Card","CardContent","sx","display","flexDirection","gap","flexWrap","Grid","container","spacing","width","size","xs","DetailsStack","IconComponent","MdOutlineAlternateEmail","heading","Typography","variant","maxWidth","textOverflow","overflow","boundWitness","from","sm","md","IoStatsChartOutline","reward","elevatedPayloadCount","payloadCount","signatureCount","GiReceiveMoney","fees","base","gasPrice","priority","gasLimit","GiSandsOfTime","exp","nbf","Divider","ErrorRender","FlexCol","usePromise","isDefined","SignedHydratedTransactionWrapper","PayloadBuilder","BoundWitnessSignatureTable","BWActions","HashHeadingPaper","HeadingPaper","React","FaSignature","VscSymbolMethod","TransactionBoundWitnessDetails","transaction","props","wrapper","wrapperError","usePromise","SignedHydratedTransactionWrapper","parse","elevatedPayloadSets","elevatedPayloadSetsError","isDefined","elevatedPayloads","pairs","PayloadBuilder","hashPairs","formatPayloadsForTable","hashes","schemas","elevatedPayloadHashes","elevatedPayloadSchemas","React","FlexCol","alignItems","rowGap","HashHeadingPaper","hash","boundWitness","_hash","paperProps","sx","p","AdornmentEnd","BWActions","boundwitness","identiconProps","size","ErrorRender","error","scope","Divider","flexItem","TransactionBoundWitnessCard","elevation","BWPayloadTableFlexbox","IconComponent","VscSymbolMethod","headingTitle","mb","HeadingPaper","FaSignature","heading","BoundWitnessSignatureTable","block"]}
1
+ {"version":3,"sources":["../../src/components/block/BlockBoundWitnessDetails.tsx","../../src/lib/formatPayloadsForTable.ts","../../src/components/BwPayloadTable.tsx","../../src/components/transactions/card/Card.tsx","../../src/components/transactions/card/DetailsStack.tsx","../../src/components/transactions/card/LabelValueStack.tsx","../../src/components/transactions/TransactionDetails.tsx"],"sourcesContent":["import { Divider } from '@mui/material'\nimport { filterAs } from '@xylabs/array'\nimport { ErrorRender } from '@xylabs/react-error'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport { usePromise } from '@xylabs/react-promise'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport {\n BoundWitnessPayloadsTable,\n BoundWitnessSignatureTable,\n BWActions,\n HashHeadingPaper,\n HeadingPaper,\n} from '@xyo-network/react-boundwitness-plugin'\nimport { useTxsFromBlock } from '@xyo-network/react-chain-blockchain'\nimport { usePayloadHash } from '@xyo-network/react-shared'\nimport { isTransactionBoundWitness, type SignedHydratedBlock } from '@xyo-network/xl1-protocol'\nimport React, { useMemo } from 'react'\nimport { FaSignature } from 'react-icons/fa'\nimport { GrTransaction } from 'react-icons/gr'\nimport { VscSymbolMethod, VscSymbolNamespace } from 'react-icons/vsc'\n\nimport { formatPayloadsForTable } from '../../lib/index.ts'\nimport type { TransactionBoundWitnessEvents } from '../../types/index.ts'\nimport { BWPayloadTableFlexbox } from '../BwPayloadTable.tsx'\n\nexport interface BoundWitnessDetailsProps extends FlexBoxProps {\n block?: SignedHydratedBlock\n}\n\nexport const BlockBoundWitnessDetails = ({\n block, paper, children, ...props\n}: BoundWitnessDetailsProps) => {\n const boundWitness = block?.[0]\n const payloads = block?.[1]\n\n const hash = usePayloadHash(boundWitness)\n\n const [transactions, txFromBlockError] = useTxsFromBlock(block)\n\n const { hashes: txHashes, schemas: txSchemas } = useMemo(() => formatPayloadsForTable(transactions ?? []), [transactions])\n\n const [nonTxBoundWitnesses, bwsFromBlockError] = usePromise(async () => {\n const bws = filterAs(payloads ?? [], payload =>\n (!isTransactionBoundWitness(payload) && isBoundWitness(payload)) ? payload : undefined)\n return await PayloadBuilder.hashPairs(bws)\n }, [payloads])\n\n const { hashes: nonTxBwHashes, schemas: nonTxBwSchemas } = useMemo(() => formatPayloadsForTable(nonTxBoundWitnesses ?? []), [nonTxBoundWitnesses])\n const hasNonTxBoundWitnesses = (nonTxBoundWitnesses?.length ?? 0) > 0\n\n return (\n <FlexCol alignItems=\"stretch\" rowGap={4} {...props}>\n <ErrorRender error={txFromBlockError ?? bwsFromBlockError} scope=\"BlockBoundWitnessDetails.tsx\" />\n <HashHeadingPaper\n hash={hash}\n paperProps={{ sx: { p: 2 } }}\n AdornmentEnd={<BWActions boundwitness={boundWitness} />}\n identiconProps={{ p: 0.75, size: 24 }}\n />\n <Divider flexItem />\n {(transactions?.length ?? 0) > 0 && (\n <BWPayloadTableFlexbox<TransactionBoundWitnessEvents>\n IconComponent={<GrTransaction />}\n eventNoun=\"transaction\"\n hashes={txHashes}\n headingTitle=\"Transactions\"\n schemas={txSchemas}\n sx={{ mb: 1 }}\n />\n )}\n <FlexCol alignItems=\"stretch\" rowGap={1} mb={1}>\n <HeadingPaper IconComponent={<VscSymbolNamespace />} heading=\"Payloads\" />\n <BoundWitnessPayloadsTable boundwitness={boundWitness} />\n </FlexCol>\n {hasNonTxBoundWitnesses\n ? (\n <BWPayloadTableFlexbox<TransactionBoundWitnessEvents>\n IconComponent={<VscSymbolMethod />}\n eventNoun=\"boundwitness\"\n hashes={nonTxBwHashes}\n headingTitle=\"Bound Witnesses\"\n schemas={nonTxBwSchemas}\n sx={{ mb: 1 }}\n />\n )\n : null}\n <FlexCol alignItems=\"stretch\" rowGap={1} mb={1}>\n <HeadingPaper IconComponent={<FaSignature />} heading=\"Signatures\" />\n <BoundWitnessSignatureTable block={boundWitness} />\n </FlexCol>\n </FlexCol>\n )\n}\n","import type { Hash } from '@xylabs/hex'\nimport type { Payload } from '@xyo-network/payload-model'\n\nexport const formatPayloadsForTable = (pairs: [Payload, Hash][]) => {\n let hashes: Hash[] = []\n let schemas: string[] = []\n for (const [bw, hash] of pairs ?? []) {\n hashes.push(hash)\n schemas.push(bw?.schema ?? '')\n }\n return { hashes, schemas }\n}\n","import type { Hash } from '@xylabs/hex'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport {\n BoundWitnessPayloadTableBody, BoundWitnessPayloadTableHead, HeadingPaper,\n} from '@xyo-network/react-boundwitness-plugin'\nimport type { EventNoun, ExtendEventNoun } from '@xyo-network/react-event'\nimport { TableEx } from '@xyo-network/react-table'\nimport React from 'react'\nimport { VscSymbolMethod } from 'react-icons/vsc'\n\nexport interface BWPayloadTableFlexboxProps<TNoun extends ExtendEventNoun = EventNoun> extends FlexBoxProps {\n IconComponent?: React.ReactNode\n eventNoun?: TNoun\n hashes?: Hash[]\n headingTitle?: string\n schemas?: string[]\n}\n\nexport const BWPayloadTableFlexbox = <TNoun extends ExtendEventNoun = EventNoun>({\n IconComponent,\n eventNoun,\n hashes,\n schemas,\n headingTitle,\n ...props\n}: BWPayloadTableFlexboxProps<TNoun>) => {\n const resolvedIconComponent = IconComponent ?? <VscSymbolMethod />\n return (\n <FlexCol alignItems=\"stretch\" rowGap={1} {...props}>\n <HeadingPaper IconComponent={resolvedIconComponent} heading={headingTitle} />\n <TableEx>\n <BoundWitnessPayloadTableHead />\n <BoundWitnessPayloadTableBody<TNoun> payloadHashes={hashes} payloadSchemas={schemas} eventNoun={eventNoun} />\n </TableEx>\n </FlexCol>\n )\n}\n","import type { CardProps } from '@mui/material'\nimport {\n Card, CardContent, Grid, Typography,\n} from '@mui/material'\nimport { isUndefined } from '@xylabs/typeof'\nimport { bigIntToFixedPointString } from '@xyo-network/chain-utils'\nimport type { SignedHydratedTransactionInstance } from '@xyo-network/xl1-protocol-sdk'\nimport React, { useMemo } from 'react'\nimport { GiReceiveMoney, GiSandsOfTime } from 'react-icons/gi'\nimport { IoStatsChartOutline } from 'react-icons/io5'\nimport { MdOutlineAlternateEmail } from 'react-icons/md'\n\nimport { DetailsStack } from './DetailsStack.tsx'\nimport { LabelValueStack } from './LabelValueStack.tsx'\n\nconst formatFee = (fee?: bigint) => {\n if (isUndefined(fee)) return\n const stringValue = bigIntToFixedPointString(fee, 12)\n if (stringValue === '0') return '0.0'\n return stringValue\n}\n\nexport interface TransactionBoundWitnessCardProps extends CardProps {\n wrapper?: SignedHydratedTransactionInstance\n}\n\nexport const TransactionBoundWitnessCard: React.FC<TransactionBoundWitnessCardProps> = ({ wrapper, ...props }) => {\n if (!wrapper) return null\n\n const stats = useMemo(() => {\n const labels = [\n 'Reward',\n 'Elevated Payloads',\n 'Total Payloads',\n 'Signatures',\n ]\n\n const values: (string | undefined)[] = [\n wrapper.reward().toLocaleString(navigator.language ?? 'en-US'),\n wrapper.elevatedPayloadCount.toLocaleString(navigator.language ?? 'en-US'),\n wrapper.payloadCount.toLocaleString(navigator.language ?? 'en-US'),\n wrapper.signatureCount.toLocaleString(navigator.language ?? 'en-US'),,\n ]\n\n return { labels, values } as const\n }, [wrapper])\n\n const fees = useMemo(() => {\n const labels = [\n 'Base',\n 'Gas',\n 'Priority',\n 'Gas Limit',\n ]\n const values = [\n formatFee(wrapper.fees.base),\n formatFee(wrapper.fees.gasPrice),\n formatFee(wrapper.fees.priority),\n formatFee(wrapper.fees.gasLimit),\n ]\n\n return { labels, values } as const\n }, [wrapper])\n\n const blockDuration = useMemo(() => {\n const labels = [\n 'Expiration',\n 'Not Before',\n ]\n\n const values = [\n wrapper.boundWitness.exp.toLocaleString(navigator.language ?? 'en-US'),\n wrapper.boundWitness.nbf.toLocaleString(navigator.language ?? 'en-US'),\n ]\n\n return { labels, values } as const\n }, [wrapper])\n\n return (\n <Card {...props}>\n <CardContent>\n <Grid container spacing={6} sx={{ width: '100%' }}>\n <Grid size={{ xs: 12 }}>\n <DetailsStack IconComponent={MdOutlineAlternateEmail} heading=\"From:\" tooltipTitle=\"Address of the sender\">\n <Typography\n variant=\"body2\"\n sx={{\n maxWidth: '100%', textOverflow: 'ellipsis', overflow: 'hidden', fontFamily: 'monospace',\n }}\n >\n {wrapper?.boundWitness.from}\n </Typography>\n </DetailsStack>\n </Grid>\n <Grid size={{\n xs: 12, sm: 6, md: 4,\n }}\n >\n <DetailsStack IconComponent={IoStatsChartOutline} heading=\"Stats\" tooltipTitle=\"Transaction Statistics\">\n <LabelValueStack labels={stats.labels} values={stats.values} />\n </DetailsStack>\n </Grid>\n <Grid size={{\n xs: 12, sm: 6, md: 4,\n }}\n >\n <DetailsStack IconComponent={GiReceiveMoney} heading=\"Fees\" tooltipTitle=\"Fees offered to the producer\">\n <LabelValueStack labels={fees.labels} values={fees.values} />\n </DetailsStack>\n </Grid>\n <Grid size={{\n xs: 12, sm: 6, md: 4,\n }}\n >\n <DetailsStack IconComponent={GiSandsOfTime} heading=\"Block Duration\" tooltipTitle=\"Block window for the transaction to be valid\">\n <LabelValueStack labels={blockDuration.labels} values={blockDuration.values} />\n </DetailsStack>\n </Grid>\n </Grid>\n </CardContent>\n </Card>\n )\n}\n","import type { StackProps } from '@mui/material'\nimport {\n Stack, styled, Tooltip, Typography,\n useTheme,\n} from '@mui/material'\nimport { isDefined } from '@xylabs/typeof'\nimport type { ComponentType, SVGAttributes } from 'react'\nimport React, { useMemo } from 'react'\n\nexport interface DetailsStackProps extends StackProps {\n IconComponent?: ComponentType<SVGAttributes<SVGElement>>\n heading?: string\n tooltipTitle?: string\n}\n\nexport const DetailsStack: React.FC<DetailsStackProps> = ({\n IconComponent, heading, children, tooltipTitle, ...props\n}) => {\n const theme = useTheme()\n\n const hasTooltip = isDefined(tooltipTitle)\n const resolvedIconComponent = useMemo(() => {\n return IconComponent\n ? (\n <IconComponent\n style={{\n /** height and marginTop adjusted to account for font not filling container with line-height: 1 */\n height: '0.85rem',\n marginTop: 0.5,\n marginLeft: theme.spacing(1),\n }}\n />\n )\n : <></>\n }, [IconComponent])\n\n return (\n <Stack direction=\"column\" flexGrow={1} flexWrap=\"wrap\" minWidth=\"1px\" {...props}>\n <SectionHeadingTypography>\n {heading}\n {hasTooltip\n ? (\n <Tooltip title={tooltipTitle}>\n {resolvedIconComponent}\n </Tooltip>\n )\n : resolvedIconComponent}\n </SectionHeadingTypography>\n {children}\n </Stack>\n )\n}\n\nconst SectionHeadingTypography = styled(Typography, { name: 'SectionHeadingTypography' })(({ theme }) => ({\n display: 'flex',\n fontFamily: 'monospace',\n lineHeight: 1,\n marginBottom: theme.spacing(1.5),\n}))\n","import type { StackProps } from '@mui/material'\nimport {\n Stack, Typography, useTheme,\n} from '@mui/material'\nimport React from 'react'\n\nexport interface LabelValueStackProps extends StackProps {\n labels: string[]\n values: (string | undefined)[]\n}\n\nexport const LabelValueStack: React.FC<LabelValueStackProps> = ({\n labels, values, ...props\n}) => {\n const theme = useTheme()\n\n return (\n <Stack flexDirection=\"row\" flexGrow={1} {...props}>\n <Stack>\n {labels.map(label => (\n <Typography\n fontWeight=\"300\"\n key={label}\n variant=\"body2\"\n sx={{ borderBottom: `1px solid ${theme.vars?.palette.divider}`, opacity: 0.7 }}\n >\n {label}\n :\n </Typography>\n ))}\n </Stack>\n <Stack alignItems=\"end\" flexGrow={1}>\n {values.map(value => (\n <Typography\n fontFamily=\"monospace\"\n variant=\"body2\"\n key={value}\n width=\"100%\"\n sx={{\n display: 'flex', justifyContent: 'end', borderBottom: `1px solid ${theme.vars?.palette.divider}`,\n }}\n >\n {value}\n </Typography>\n ))}\n </Stack>\n </Stack>\n )\n}\n","import { Divider } from '@mui/material'\nimport { ErrorRender } from '@xylabs/react-error'\nimport { type FlexBoxProps, FlexCol } from '@xylabs/react-flexbox'\nimport { usePromise } from '@xylabs/react-promise'\nimport { isDefined } from '@xylabs/typeof'\nimport { SignedHydratedTransactionWrapper } from '@xyo-network/chain-wrappers'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport {\n BoundWitnessSignatureTable, BWActions, HashHeadingPaper, HeadingPaper,\n} from '@xyo-network/react-boundwitness-plugin'\nimport type { SignedHydratedTransaction } from '@xyo-network/xl1-protocol'\nimport React from 'react'\nimport { FaSignature } from 'react-icons/fa'\nimport { VscSymbolMethod } from 'react-icons/vsc'\n\nimport { formatPayloadsForTable } from '../../lib/index.ts'\nimport { BWPayloadTableFlexbox } from '../BwPayloadTable.tsx'\nimport { TransactionBoundWitnessCard } from './card/index.ts'\n\nexport interface TransactionBoundWitnessDetailsProps extends FlexBoxProps {\n transaction?: SignedHydratedTransaction | null\n}\n\nexport const TransactionBoundWitnessDetails: React.FC<TransactionBoundWitnessDetailsProps> = ({ transaction, ...props }) => {\n const [wrapper, wrapperError] = usePromise(async () => {\n if (transaction) {\n return await SignedHydratedTransactionWrapper.parse(transaction)\n }\n }, [transaction])\n\n const [elevatedPayloadSets, elevatedPayloadSetsError] = usePromise(async () => {\n if (isDefined(wrapper)) {\n const elevatedPayloads = wrapper.elevatedPayloads\n const pairs = await PayloadBuilder.hashPairs(elevatedPayloads)\n return formatPayloadsForTable(pairs)\n } else {\n return { hashes: [], schemas: [] }\n }\n }, [wrapper])\n\n const { hashes: elevatedPayloadHashes, schemas: elevatedPayloadSchemas } = elevatedPayloadSets ?? {}\n\n return (\n <FlexCol alignItems=\"stretch\" rowGap={2} {...props}>\n <HashHeadingPaper\n hash={wrapper?.boundWitness?._hash}\n paperProps={{ sx: { p: 2 } }}\n AdornmentEnd={<BWActions boundwitness={wrapper?.boundWitness} />}\n identiconProps={{ p: 0.75, size: 24 }}\n />\n <ErrorRender error={wrapperError} scope=\"wrapperError:TransactionBoundWitnessDetails.tsx\" />\n <ErrorRender error={elevatedPayloadSetsError} scope=\"elevatedPayloadSetsError:TransactionBoundWitnessDetails.tsx\" />\n <TransactionBoundWitnessCard elevation={4} wrapper={wrapper} />\n <BWPayloadTableFlexbox\n IconComponent={<VscSymbolMethod />}\n hashes={elevatedPayloadHashes}\n headingTitle=\"Elevated Payloads\"\n schemas={elevatedPayloadSchemas}\n sx={{ mb: 1 }}\n />\n <FlexCol alignItems=\"stretch\" rowGap={1} mb={1}>\n <HeadingPaper IconComponent={<FaSignature />} heading=\"Signatures\" />\n <BoundWitnessSignatureTable block={wrapper?.boundWitness} />\n </FlexCol>\n </FlexCol>\n )\n}\n"],"mappings":";;;;AAAA,SAASA,eAAe;AACxB,SAASC,gBAAgB;AACzB,SA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ACI,mBAAAA;IACCC,MAAMtB,SAASuB,cAAcC;IAC7BC,YAAY;MAAEC,IAAI;QAAEC,GAAG;MAAE;IAAE;IAC3BC,cAAc,gBAAAX,OAAA,cAACY,YAAAA;MAAUC,cAAc9B,SAASuB;;IAChDQ,gBAAgB;MAAEJ,GAAG;MAAMK,MAAM;IAAG;MAEtC,gBAAAf,OAAA,cAACgB,cAAAA;IAAYC,OAAOjC;IAAckC,OAAM;MACxC,gBAAAlB,OAAA,cAACgB,cAAAA;IAAYC,OAAO5B;IAA0B6B,OAAM;MACpD,gBAAAlB,OAAA,cAACmB,6BAAAA;IAA4BC,WAAW;IAAGrC;MAC3C,gBAAAiB,OAAA,cAACqB,uBAAAA;IACCC,eAAe,gBAAAtB,OAAA,cAACuB,kBAAAA,IAAAA;IAChB3B,QAAQE;IACR0B,cAAa;IACb3B,SAASE;IACTU,IAAI;MAAEgB,IAAI;IAAE;MAEd,gBAAAzB,OAAA,cAACC,UAAAA;IAAQC,YAAW;IAAUC,QAAQ;IAAGsB,IAAI;KAC3C,gBAAAzB,OAAA,cAAC0B,eAAAA;IAAaJ,eAAe,gBAAAtB,OAAA,cAAC2B,cAAAA,IAAAA;IAAgBC,SAAQ;MACtD,gBAAA5B,OAAA,cAAC6B,6BAAAA;IAA2BC,OAAO/C,SAASuB;;AAIpD,GA3C6F;","names":["Divider","filterAs","ErrorRender","FlexCol","usePromise","isBoundWitness","PayloadBuilder","BoundWitnessPayloadsTable","BoundWitnessSignatureTable","BWActions","HashHeadingPaper","HeadingPaper","useTxsFromBlock","usePayloadHash","isTransactionBoundWitness","React","useMemo","FaSignature","GrTransaction","VscSymbolMethod","VscSymbolNamespace","formatPayloadsForTable","pairs","hashes","schemas","bw","hash","push","schema","FlexCol","BoundWitnessPayloadTableBody","BoundWitnessPayloadTableHead","HeadingPaper","TableEx","React","VscSymbolMethod","BWPayloadTableFlexbox","IconComponent","eventNoun","hashes","schemas","headingTitle","props","resolvedIconComponent","VscSymbolMethod","FlexCol","alignItems","rowGap","HeadingPaper","heading","TableEx","BoundWitnessPayloadTableHead","BoundWitnessPayloadTableBody","payloadHashes","payloadSchemas","BlockBoundWitnessDetails","block","paper","children","props","boundWitness","payloads","hash","usePayloadHash","transactions","txFromBlockError","useTxsFromBlock","hashes","txHashes","schemas","txSchemas","useMemo","formatPayloadsForTable","nonTxBoundWitnesses","bwsFromBlockError","usePromise","bws","filterAs","payload","isTransactionBoundWitness","isBoundWitness","undefined","PayloadBuilder","hashPairs","nonTxBwHashes","nonTxBwSchemas","hasNonTxBoundWitnesses","length","React","FlexCol","alignItems","rowGap","ErrorRender","error","scope","HashHeadingPaper","paperProps","sx","p","AdornmentEnd","BWActions","boundwitness","identiconProps","size","Divider","flexItem","BWPayloadTableFlexbox","IconComponent","GrTransaction","eventNoun","headingTitle","mb","HeadingPaper","VscSymbolNamespace","heading","BoundWitnessPayloadsTable","VscSymbolMethod","FaSignature","BoundWitnessSignatureTable","Card","CardContent","Grid","Typography","isUndefined","bigIntToFixedPointString","React","useMemo","GiReceiveMoney","GiSandsOfTime","IoStatsChartOutline","MdOutlineAlternateEmail","Stack","styled","Tooltip","Typography","useTheme","isDefined","React","useMemo","DetailsStack","IconComponent","heading","children","tooltipTitle","props","theme","useTheme","hasTooltip","isDefined","resolvedIconComponent","useMemo","React","style","height","marginTop","marginLeft","spacing","Stack","direction","flexGrow","flexWrap","minWidth","SectionHeadingTypography","Tooltip","title","styled","Typography","name","display","fontFamily","lineHeight","marginBottom","Stack","Typography","useTheme","React","LabelValueStack","labels","values","props","theme","useTheme","React","Stack","flexDirection","flexGrow","map","label","Typography","fontWeight","key","variant","sx","borderBottom","vars","palette","divider","opacity","alignItems","value","fontFamily","width","display","justifyContent","formatFee","fee","isUndefined","stringValue","bigIntToFixedPointString","TransactionBoundWitnessCard","wrapper","props","stats","useMemo","labels","values","reward","toLocaleString","navigator","language","elevatedPayloadCount","payloadCount","signatureCount","fees","base","gasPrice","priority","gasLimit","blockDuration","boundWitness","exp","nbf","React","Card","CardContent","Grid","container","spacing","sx","width","size","xs","DetailsStack","IconComponent","MdOutlineAlternateEmail","heading","tooltipTitle","Typography","variant","maxWidth","textOverflow","overflow","fontFamily","from","sm","md","IoStatsChartOutline","LabelValueStack","GiReceiveMoney","GiSandsOfTime","ErrorRender","FlexCol","usePromise","isDefined","SignedHydratedTransactionWrapper","PayloadBuilder","BoundWitnessSignatureTable","BWActions","HashHeadingPaper","HeadingPaper","React","FaSignature","VscSymbolMethod","TransactionBoundWitnessDetails","transaction","props","wrapper","wrapperError","usePromise","SignedHydratedTransactionWrapper","parse","elevatedPayloadSets","elevatedPayloadSetsError","isDefined","elevatedPayloads","pairs","PayloadBuilder","hashPairs","formatPayloadsForTable","hashes","schemas","elevatedPayloadHashes","elevatedPayloadSchemas","React","FlexCol","alignItems","rowGap","HashHeadingPaper","hash","boundWitness","_hash","paperProps","sx","p","AdornmentEnd","BWActions","boundwitness","identiconProps","size","ErrorRender","error","scope","TransactionBoundWitnessCard","elevation","BWPayloadTableFlexbox","IconComponent","VscSymbolMethod","headingTitle","mb","HeadingPaper","FaSignature","heading","BoundWitnessSignatureTable","block"]}
@@ -1 +1 @@
1
- {"version":3,"file":"TransactionDetails.d.ts","sourceRoot":"","sources":["../../../../src/components/transactions/TransactionDetails.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAW,MAAM,uBAAuB,CAAA;AAQlE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAA;AAC1E,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,MAAM,WAAW,mCAAoC,SAAQ,YAAY;IACvE,WAAW,CAAC,EAAE,yBAAyB,GAAG,IAAI,CAAA;CAC/C;AAED,eAAO,MAAM,8BAA8B,EAAE,KAAK,CAAC,EAAE,CAAC,mCAAmC,CA6CxF,CAAA"}
1
+ {"version":3,"file":"TransactionDetails.d.ts","sourceRoot":"","sources":["../../../../src/components/transactions/TransactionDetails.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAW,MAAM,uBAAuB,CAAA;AAQlE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAA;AAC1E,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,MAAM,WAAW,mCAAoC,SAAQ,YAAY;IACvE,WAAW,CAAC,EAAE,yBAAyB,GAAG,IAAI,CAAA;CAC/C;AAED,eAAO,MAAM,8BAA8B,EAAE,KAAK,CAAC,EAAE,CAAC,mCAAmC,CA2CxF,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../../../src/components/transactions/card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAM9C,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,+BAA+B,CAAA;AACtF,OAAO,KAAsB,MAAM,OAAO,CAAA;AAO1C,MAAM,WAAW,gCAAiC,SAAQ,SAAS;IACjE,OAAO,CAAC,EAAE,iCAAiC,CAAA;CAC5C;AAED,eAAO,MAAM,2BAA2B,EAAE,KAAK,CAAC,EAAE,CAAC,gCAAgC,CAsGlF,CAAA"}
1
+ {"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../../../src/components/transactions/card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAM9C,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,+BAA+B,CAAA;AACtF,OAAO,KAAkB,MAAM,OAAO,CAAA;AAetC,MAAM,WAAW,gCAAiC,SAAQ,SAAS;IACjE,OAAO,CAAC,EAAE,iCAAiC,CAAA;CAC5C;AAED,eAAO,MAAM,2BAA2B,EAAE,KAAK,CAAC,EAAE,CAAC,gCAAgC,CAgGlF,CAAA"}
@@ -4,6 +4,7 @@ import React from 'react';
4
4
  export interface DetailsStackProps extends StackProps {
5
5
  IconComponent?: ComponentType<SVGAttributes<SVGElement>>;
6
6
  heading?: string;
7
+ tooltipTitle?: string;
7
8
  }
8
9
  export declare const DetailsStack: React.FC<DetailsStackProps>;
9
10
  //# sourceMappingURL=DetailsStack.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DetailsStack.d.ts","sourceRoot":"","sources":["../../../../../src/components/transactions/card/DetailsStack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAI/C,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AACzD,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,WAAW,iBAAkB,SAAQ,UAAU;IACnD,aAAa,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,CAAA;IACxD,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAcpD,CAAA"}
1
+ {"version":3,"file":"DetailsStack.d.ts","sourceRoot":"","sources":["../../../../../src/components/transactions/card/DetailsStack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAM/C,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AACzD,OAAO,KAAkB,MAAM,OAAO,CAAA;AAEtC,MAAM,WAAW,iBAAkB,SAAQ,UAAU;IACnD,aAAa,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,CAAA;IACxD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAoCpD,CAAA"}
@@ -0,0 +1,8 @@
1
+ import type { StackProps } from '@mui/material';
2
+ import React from 'react';
3
+ export interface LabelValueStackProps extends StackProps {
4
+ labels: string[];
5
+ values: (string | undefined)[];
6
+ }
7
+ export declare const LabelValueStack: React.FC<LabelValueStackProps>;
8
+ //# sourceMappingURL=LabelValueStack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LabelValueStack.d.ts","sourceRoot":"","sources":["../../../../../src/components/transactions/card/LabelValueStack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAI/C,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,WAAW,oBAAqB,SAAQ,UAAU;IACtD,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,MAAM,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAAA;CAC/B;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAqC1D,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "http://json.schemastore.org/package.json",
3
3
  "name": "@xyo-network/react-chain-boundwitness",
4
- "version": "1.3.28",
4
+ "version": "1.3.30",
5
5
  "description": "XYO Layer One React SDK BoundWitness",
6
6
  "homepage": "https://xylabs.com",
7
7
  "bugs": {
@@ -40,18 +40,18 @@
40
40
  "@xylabs/react-flexbox": "^6.3.1",
41
41
  "@xylabs/react-promise": "^6.3.1",
42
42
  "@xylabs/typeof": "^4.9.18",
43
- "@xyo-network/boundwitness-model": "^3.15.10",
44
- "@xyo-network/chain-utils": "^1.3.28",
45
- "@xyo-network/chain-wrappers": "^1.3.28",
46
- "@xyo-network/payload-builder": "^3.15.10",
47
- "@xyo-network/payload-model": "^3.15.10",
43
+ "@xyo-network/boundwitness-model": "^3.16.1",
44
+ "@xyo-network/chain-utils": "^1.3.30",
45
+ "@xyo-network/chain-wrappers": "^1.3.30",
46
+ "@xyo-network/payload-builder": "^3.16.1",
47
+ "@xyo-network/payload-model": "^3.16.1",
48
48
  "@xyo-network/react-boundwitness-plugin": "^5.3.4",
49
- "@xyo-network/react-chain-blockchain": "^1.3.28",
49
+ "@xyo-network/react-chain-blockchain": "^1.3.30",
50
50
  "@xyo-network/react-event": "^5.3.4",
51
51
  "@xyo-network/react-shared": "^5.3.4",
52
52
  "@xyo-network/react-table": "^5.3.4",
53
53
  "@xyo-network/xl1-protocol": "^1.3.17",
54
- "@xyo-network/xl1-protocol-sdk": "^1.3.28",
54
+ "@xyo-network/xl1-protocol-sdk": "^1.3.30",
55
55
  "react-icons": "^5.5.0"
56
56
  },
57
57
  "devDependencies": {
@@ -59,11 +59,11 @@
59
59
  "@emotion/styled": "^11.14.0",
60
60
  "@mui/icons-material": "^7.1.0",
61
61
  "@mui/material": "^7.1.0",
62
- "@storybook/react": "^8.6.12",
62
+ "@storybook/react": "^8.6.14",
63
63
  "@xylabs/ts-scripts-yarn3": "^6.5.7",
64
64
  "@xylabs/tsconfig-react": "^6.5.7",
65
- "@xyo-network/chain-protocol": "^1.3.28",
66
- "@xyo-network/react-chain-shared": "^1.3.28",
65
+ "@xyo-network/chain-protocol": "^1.3.30",
66
+ "@xyo-network/react-chain-shared": "^1.3.30",
67
67
  "knip": "^5.56.0",
68
68
  "react": "^19.1.0",
69
69
  "react-dom": "^19.1.0",
@@ -41,7 +41,7 @@ export const TransactionBoundWitnessDetails: React.FC<TransactionBoundWitnessDet
41
41
  const { hashes: elevatedPayloadHashes, schemas: elevatedPayloadSchemas } = elevatedPayloadSets ?? {}
42
42
 
43
43
  return (
44
- <FlexCol alignItems="stretch" rowGap={4} {...props}>
44
+ <FlexCol alignItems="stretch" rowGap={2} {...props}>
45
45
  <HashHeadingPaper
46
46
  hash={wrapper?.boundWitness?._hash}
47
47
  paperProps={{ sx: { p: 2 } }}
@@ -50,9 +50,7 @@ export const TransactionBoundWitnessDetails: React.FC<TransactionBoundWitnessDet
50
50
  />
51
51
  <ErrorRender error={wrapperError} scope="wrapperError:TransactionBoundWitnessDetails.tsx" />
52
52
  <ErrorRender error={elevatedPayloadSetsError} scope="elevatedPayloadSetsError:TransactionBoundWitnessDetails.tsx" />
53
- <Divider flexItem />
54
53
  <TransactionBoundWitnessCard elevation={4} wrapper={wrapper} />
55
- <Divider flexItem />
56
54
  <BWPayloadTableFlexbox
57
55
  IconComponent={<VscSymbolMethod />}
58
56
  hashes={elevatedPayloadHashes}
@@ -5,12 +5,20 @@ import {
5
5
  import { isUndefined } from '@xylabs/typeof'
6
6
  import { bigIntToFixedPointString } from '@xyo-network/chain-utils'
7
7
  import type { SignedHydratedTransactionInstance } from '@xyo-network/xl1-protocol-sdk'
8
- import React, { useCallback } from 'react'
8
+ import React, { useMemo } from 'react'
9
9
  import { GiReceiveMoney, GiSandsOfTime } from 'react-icons/gi'
10
10
  import { IoStatsChartOutline } from 'react-icons/io5'
11
11
  import { MdOutlineAlternateEmail } from 'react-icons/md'
12
12
 
13
13
  import { DetailsStack } from './DetailsStack.tsx'
14
+ import { LabelValueStack } from './LabelValueStack.tsx'
15
+
16
+ const formatFee = (fee?: bigint) => {
17
+ if (isUndefined(fee)) return
18
+ const stringValue = bigIntToFixedPointString(fee, 12)
19
+ if (stringValue === '0') return '0.0'
20
+ return stringValue
21
+ }
14
22
 
15
23
  export interface TransactionBoundWitnessCardProps extends CardProps {
16
24
  wrapper?: SignedHydratedTransactionInstance
@@ -19,24 +27,65 @@ export interface TransactionBoundWitnessCardProps extends CardProps {
19
27
  export const TransactionBoundWitnessCard: React.FC<TransactionBoundWitnessCardProps> = ({ wrapper, ...props }) => {
20
28
  if (!wrapper) return null
21
29
 
22
- const formatFee = useCallback((fee?: bigint) => {
23
- if (isUndefined(fee)) return
24
- return bigIntToFixedPointString(fee, 12)
25
- }, [])
30
+ const stats = useMemo(() => {
31
+ const labels = [
32
+ 'Reward',
33
+ 'Elevated Payloads',
34
+ 'Total Payloads',
35
+ 'Signatures',
36
+ ]
37
+
38
+ const values: (string | undefined)[] = [
39
+ wrapper.reward().toLocaleString(navigator.language ?? 'en-US'),
40
+ wrapper.elevatedPayloadCount.toLocaleString(navigator.language ?? 'en-US'),
41
+ wrapper.payloadCount.toLocaleString(navigator.language ?? 'en-US'),
42
+ wrapper.signatureCount.toLocaleString(navigator.language ?? 'en-US'),,
43
+ ]
44
+
45
+ return { labels, values } as const
46
+ }, [wrapper])
47
+
48
+ const fees = useMemo(() => {
49
+ const labels = [
50
+ 'Base',
51
+ 'Gas',
52
+ 'Priority',
53
+ 'Gas Limit',
54
+ ]
55
+ const values = [
56
+ formatFee(wrapper.fees.base),
57
+ formatFee(wrapper.fees.gasPrice),
58
+ formatFee(wrapper.fees.priority),
59
+ formatFee(wrapper.fees.gasLimit),
60
+ ]
61
+
62
+ return { labels, values } as const
63
+ }, [wrapper])
64
+
65
+ const blockDuration = useMemo(() => {
66
+ const labels = [
67
+ 'Expiration',
68
+ 'Not Before',
69
+ ]
70
+
71
+ const values = [
72
+ wrapper.boundWitness.exp.toLocaleString(navigator.language ?? 'en-US'),
73
+ wrapper.boundWitness.nbf.toLocaleString(navigator.language ?? 'en-US'),
74
+ ]
75
+
76
+ return { labels, values } as const
77
+ }, [wrapper])
26
78
 
27
79
  return (
28
80
  <Card {...props}>
29
- <CardContent sx={{
30
- display: 'flex', flexDirection: 'row', gap: 2, flexWrap: 'wrap',
31
- }}
32
- >
33
- <Grid container spacing={3} sx={{ width: '100%' }}>
81
+ <CardContent>
82
+ <Grid container spacing={6} sx={{ width: '100%' }}>
34
83
  <Grid size={{ xs: 12 }}>
35
- <DetailsStack IconComponent={MdOutlineAlternateEmail} heading="From:">
84
+ <DetailsStack IconComponent={MdOutlineAlternateEmail} heading="From:" tooltipTitle="Address of the sender">
36
85
  <Typography
37
86
  variant="body2"
38
87
  sx={{
39
- maxWidth: '100%', textOverflow: 'ellipsis', overflow: 'hidden',
88
+ maxWidth: '100%', textOverflow: 'ellipsis', overflow: 'hidden', fontFamily: 'monospace',
40
89
  }}
41
90
  >
42
91
  {wrapper?.boundWitness.from}
@@ -47,71 +96,24 @@ export const TransactionBoundWitnessCard: React.FC<TransactionBoundWitnessCardPr
47
96
  xs: 12, sm: 6, md: 4,
48
97
  }}
49
98
  >
50
- <DetailsStack IconComponent={IoStatsChartOutline} heading="Stats">
51
- <Typography variant="body2">
52
- Reward:
53
- {' '}
54
- {wrapper?.reward()}
55
- </Typography>
56
- <Typography variant="body2">
57
- Elevated Payloads:
58
- {' '}
59
- {wrapper?.elevatedPayloadCount}
60
- </Typography>
61
- <Typography variant="body2">
62
- Total Payloads:
63
- {' '}
64
- {wrapper?.payloadCount}
65
- </Typography>
66
- <Typography variant="body2">
67
- Signatures:
68
- {' '}
69
- {wrapper?.signatureCount}
70
- </Typography>
99
+ <DetailsStack IconComponent={IoStatsChartOutline} heading="Stats" tooltipTitle="Transaction Statistics">
100
+ <LabelValueStack labels={stats.labels} values={stats.values} />
71
101
  </DetailsStack>
72
102
  </Grid>
73
103
  <Grid size={{
74
104
  xs: 12, sm: 6, md: 4,
75
105
  }}
76
106
  >
77
- <DetailsStack IconComponent={GiReceiveMoney} heading="Fees">
78
- <Typography variant="body2">
79
- Base:
80
- {' '}
81
- {formatFee(wrapper?.fees.base)}
82
- </Typography>
83
- <Typography variant="body2">
84
- Gas:
85
- {' '}
86
- {formatFee(wrapper?.fees.gasPrice)}
87
- </Typography>
88
- <Typography variant="body2">
89
- Priority:
90
- {' '}
91
- {formatFee(wrapper?.fees.priority)}
92
- </Typography>
93
- <Typography variant="body2">
94
- Gas Limit:
95
- {' '}
96
- {formatFee(wrapper?.fees.gasLimit)}
97
- </Typography>
107
+ <DetailsStack IconComponent={GiReceiveMoney} heading="Fees" tooltipTitle="Fees offered to the producer">
108
+ <LabelValueStack labels={fees.labels} values={fees.values} />
98
109
  </DetailsStack>
99
110
  </Grid>
100
111
  <Grid size={{
101
112
  xs: 12, sm: 6, md: 4,
102
113
  }}
103
114
  >
104
- <DetailsStack IconComponent={GiSandsOfTime} heading="Block Duration">
105
- <Typography variant="body2">
106
- Expiration:
107
- {' '}
108
- {wrapper?.boundWitness.exp}
109
- </Typography>
110
- <Typography variant="body2">
111
- Not Before:
112
- {' '}
113
- {wrapper?.boundWitness?.nbf}
114
- </Typography>
115
+ <DetailsStack IconComponent={GiSandsOfTime} heading="Block Duration" tooltipTitle="Block window for the transaction to be valid">
116
+ <LabelValueStack labels={blockDuration.labels} values={blockDuration.values} />
115
117
  </DetailsStack>
116
118
  </Grid>
117
119
  </Grid>
@@ -1,35 +1,59 @@
1
1
  import type { StackProps } from '@mui/material'
2
2
  import {
3
- Icon, Stack, styled, Typography,
3
+ Stack, styled, Tooltip, Typography,
4
+ useTheme,
4
5
  } from '@mui/material'
6
+ import { isDefined } from '@xylabs/typeof'
5
7
  import type { ComponentType, SVGAttributes } from 'react'
6
- import React from 'react'
8
+ import React, { useMemo } from 'react'
7
9
 
8
10
  export interface DetailsStackProps extends StackProps {
9
11
  IconComponent?: ComponentType<SVGAttributes<SVGElement>>
10
12
  heading?: string
13
+ tooltipTitle?: string
11
14
  }
12
15
 
13
16
  export const DetailsStack: React.FC<DetailsStackProps> = ({
14
- IconComponent, heading, children, ...props
17
+ IconComponent, heading, children, tooltipTitle, ...props
15
18
  }) => {
19
+ const theme = useTheme()
20
+
21
+ const hasTooltip = isDefined(tooltipTitle)
22
+ const resolvedIconComponent = useMemo(() => {
23
+ return IconComponent
24
+ ? (
25
+ <IconComponent
26
+ style={{
27
+ /** height and marginTop adjusted to account for font not filling container with line-height: 1 */
28
+ height: '0.85rem',
29
+ marginTop: 0.5,
30
+ marginLeft: theme.spacing(1),
31
+ }}
32
+ />
33
+ )
34
+ : <></>
35
+ }, [IconComponent])
36
+
16
37
  return (
17
- <Stack direction="row" mb={1} gap={1} {...props}>
18
- {IconComponent && <Icon fontSize="small" sx={{ mr: 0.25 }}><IconComponent style={{ height: '0.7em' }} /></Icon>}
19
- <Stack direction="column" flexWrap="wrap" mb={1}>
20
- <SectionHeadingTypography>
21
- {heading}
22
- </SectionHeadingTypography>
23
- {children}
24
- </Stack>
38
+ <Stack direction="column" flexGrow={1} flexWrap="wrap" minWidth="1px" {...props}>
39
+ <SectionHeadingTypography>
40
+ {heading}
41
+ {hasTooltip
42
+ ? (
43
+ <Tooltip title={tooltipTitle}>
44
+ {resolvedIconComponent}
45
+ </Tooltip>
46
+ )
47
+ : resolvedIconComponent}
48
+ </SectionHeadingTypography>
49
+ {children}
25
50
  </Stack>
26
51
  )
27
52
  }
28
53
 
29
54
  const SectionHeadingTypography = styled(Typography, { name: 'SectionHeadingTypography' })(({ theme }) => ({
30
- display: 'inline-flex',
31
- alignItems: 'baseline',
55
+ display: 'flex',
32
56
  fontFamily: 'monospace',
33
- fontSize: 16,
34
- marginBottom: theme.spacing(0.75),
57
+ lineHeight: 1,
58
+ marginBottom: theme.spacing(1.5),
35
59
  }))
@@ -0,0 +1,49 @@
1
+ import type { StackProps } from '@mui/material'
2
+ import {
3
+ Stack, Typography, useTheme,
4
+ } from '@mui/material'
5
+ import React from 'react'
6
+
7
+ export interface LabelValueStackProps extends StackProps {
8
+ labels: string[]
9
+ values: (string | undefined)[]
10
+ }
11
+
12
+ export const LabelValueStack: React.FC<LabelValueStackProps> = ({
13
+ labels, values, ...props
14
+ }) => {
15
+ const theme = useTheme()
16
+
17
+ return (
18
+ <Stack flexDirection="row" flexGrow={1} {...props}>
19
+ <Stack>
20
+ {labels.map(label => (
21
+ <Typography
22
+ fontWeight="300"
23
+ key={label}
24
+ variant="body2"
25
+ sx={{ borderBottom: `1px solid ${theme.vars?.palette.divider}`, opacity: 0.7 }}
26
+ >
27
+ {label}
28
+ :
29
+ </Typography>
30
+ ))}
31
+ </Stack>
32
+ <Stack alignItems="end" flexGrow={1}>
33
+ {values.map(value => (
34
+ <Typography
35
+ fontFamily="monospace"
36
+ variant="body2"
37
+ key={value}
38
+ width="100%"
39
+ sx={{
40
+ display: 'flex', justifyContent: 'end', borderBottom: `1px solid ${theme.vars?.palette.divider}`,
41
+ }}
42
+ >
43
+ {value}
44
+ </Typography>
45
+ ))}
46
+ </Stack>
47
+ </Stack>
48
+ )
49
+ }