@xyo-network/xl1-react-transaction 1.21.3 → 1.23.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 +1 @@
1
- {"version":3,"file":"TransactionStackProgress.d.ts","sourceRoot":"","sources":["../../../../src/confirmation/components/TransactionStackProgress.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAG/C,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAIN,MAAM,OAAO,CAAA;AAMd,MAAM,WAAW,6BAA8B,SAAQ,UAAU;IAC/D,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC,6BAA6B,CAiE5E,CAAA"}
1
+ {"version":3,"file":"TransactionStackProgress.d.ts","sourceRoot":"","sources":["../../../../src/confirmation/components/TransactionStackProgress.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAG/C,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAIN,MAAM,OAAO,CAAA;AAMd,MAAM,WAAW,6BAA8B,SAAQ,UAAU;IAC/D,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC,6BAA6B,CAyE5E,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"BlockConfirmationStats.d.ts","sourceRoot":"","sources":["../../../../../src/confirmation/components/support/BlockConfirmationStats.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,WAAW,2BAA2B;IAC1C,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAChC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;CACxB;AAED,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CA4BxE,CAAA"}
1
+ {"version":3,"file":"BlockConfirmationStats.d.ts","sourceRoot":"","sources":["../../../../../src/confirmation/components/support/BlockConfirmationStats.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,WAAW,2BAA2B;IAC1C,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAChC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;CACxB;AAED,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CAiCxE,CAAA"}
@@ -147,7 +147,7 @@ var useBlockRangeState = /* @__PURE__ */ __name((blockRange, confirmedInBlock, c
147
147
  }, "useBlockRangeState");
148
148
 
149
149
  // src/confirmation/components/support/BlockConfirmationStats.tsx
150
- import { CheckCircleOutline } from "@mui/icons-material";
150
+ import { CheckCircleOutlined } from "@mui/icons-material";
151
151
  import { Grow, Stack, Typography } from "@mui/material";
152
152
  import { isDefined as isDefined6 } from "@xylabs/sdk-js";
153
153
  import React from "react";
@@ -162,7 +162,7 @@ var BlockConfirmationStats = /* @__PURE__ */ __name(({ confirmed, currentBlockCo
162
162
  }
163
163
  }, "Current Block:", " ", currentBlockNumberValue, " ", /* @__PURE__ */ React.createElement(Grow, {
164
164
  in: confirmed
165
- }, /* @__PURE__ */ React.createElement(CheckCircleOutline, {
165
+ }, /* @__PURE__ */ React.createElement(CheckCircleOutlined, {
166
166
  sx: {
167
167
  width: "0.8em",
168
168
  height: "0.8em"
@@ -170,8 +170,8 @@ var BlockConfirmationStats = /* @__PURE__ */ __name(({ confirmed, currentBlockCo
170
170
  color: "success"
171
171
  }))), /* @__PURE__ */ React.createElement(Typography, {
172
172
  variant: "caption",
173
- color: "warning.light",
174
173
  sx: {
174
+ color: "warning.light",
175
175
  opacity: 0.75
176
176
  }
177
177
  }, "Passed Blocks:", " ", isDefined6(passedBlocks) && passedBlocks.length > 0 ? passedBlocks.map((block) => new Intl.NumberFormat().format(block)).join(", ") : "N/A"));
@@ -261,8 +261,10 @@ var TransactionStackProgress = /* @__PURE__ */ __name(({ blockRange, confirmedIn
261
261
  direction: "row",
262
262
  ...props
263
263
  }, /* @__PURE__ */ React3.createElement(Stack3, {
264
- width: "100%",
265
- gap: 1
264
+ sx: {
265
+ width: "100%",
266
+ gap: 1
267
+ }
266
268
  }, /* @__PURE__ */ React3.createElement(Stack3, null, /* @__PURE__ */ React3.createElement(LinearProgress, {
267
269
  ref: progressElementRef,
268
270
  variant: "determinate",
@@ -270,7 +272,9 @@ var TransactionStackProgress = /* @__PURE__ */ __name(({ blockRange, confirmedIn
270
272
  color: progressColor
271
273
  }), /* @__PURE__ */ React3.createElement(Stack3, {
272
274
  direction: "row",
273
- justifyContent: "space-between"
275
+ sx: {
276
+ justifyContent: "space-between"
277
+ }
274
278
  }, range.map((block) => {
275
279
  const blockColor = blockFormatters.color(block);
276
280
  const blockStatus = blockFormatters.confirmationStatus(block);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/confirmation/components/TransactionStackProgress.tsx","../../src/confirmation/helpers/BlockFormatters.ts","../../src/confirmation/helpers/blockProgressColor.ts","../../src/confirmation/helpers/createFilledRange.ts","../../src/confirmation/helpers/getBlockProgress.ts","../../src/confirmation/helpers/isCurrentBlockPassedRange.ts","../../src/confirmation/helpers/passedBlocksInRange.ts","../../src/confirmation/hooks/useBlockRangeState.ts","../../src/confirmation/components/support/BlockConfirmationStats.tsx","../../src/confirmation/components/support/BlockRangeEntryStack.tsx"],"sourcesContent":["import type { StackProps } from '@mui/material'\nimport { LinearProgress, Stack } from '@mui/material'\nimport { isDefined } from '@xylabs/sdk-js'\nimport { type BlockRange } from '@xyo-network/xl1-sdk'\nimport React, {\n useLayoutEffect,\n useMemo,\n useRef, useState,\n} from 'react'\n\nimport { BlockFormatters, getBlockProgress } from '../helpers/index.ts'\nimport { useBlockRangeState } from '../hooks/index.ts'\nimport { BlockConfirmationStats, BlockRangeEntryStack } from './support/index.ts'\n\nexport interface TransactionStackProgressProps extends StackProps {\n blockRange?: BlockRange\n confirmedInBlock?: number\n currentBlockNumber?: number\n}\n\nexport const TransactionStackProgress: React.FC<TransactionStackProgressProps> = ({\n blockRange, confirmedInBlock, currentBlockNumber, ...props\n}) => {\n const blockPositionsRef = useRef<Record<number, HTMLSpanElement | null>>({})\n const updateBlockPositionRefs = (blockNumber: number, ref: HTMLSpanElement | null) => {\n blockPositionsRef.current[blockNumber] = ref\n }\n\n const progressElementRef = useRef<HTMLDivElement | null>(null)\n\n const {\n passedBlocks, progressColor, range, isConfirmed, isExpired,\n } = useBlockRangeState(blockRange, confirmedInBlock, currentBlockNumber)\n\n const blockFormatters = useMemo(() => new BlockFormatters({ confirmedInBlock, currentBlockNumber }), [confirmedInBlock, currentBlockNumber])\n\n const [progressValue, setProgressValue] = useState(0)\n\n useLayoutEffect(() => {\n // prevent updates if the current block is past the confirmed block\n if (isDefined(currentBlockNumber) && isDefined(confirmedInBlock) && currentBlockNumber > confirmedInBlock) {\n return\n }\n const currentBlockNumberElement = isDefined(currentBlockNumber) ? blockPositionsRef.current[currentBlockNumber] : null\n const progressElement = progressElementRef.current\n // since we are relying on htmlElements, we have to use layout effect\n setProgressValue(getBlockProgress(\n currentBlockNumber,\n currentBlockNumberElement,\n progressElement,\n ))\n }, [confirmedInBlock, currentBlockNumber])\n\n return (\n <Stack direction=\"row\" {...props}>\n <Stack width=\"100%\" gap={1}>\n <Stack>\n <LinearProgress ref={progressElementRef} variant=\"determinate\" value={isExpired ? 100 : progressValue} color={progressColor} />\n <Stack direction=\"row\" justifyContent=\"space-between\">\n {range.map((block) => {\n const blockColor = blockFormatters.color(block)\n const blockStatus = blockFormatters.confirmationStatus(block)\n const formattedBlockNumber = blockFormatters.formatNumber(block)\n return (\n <BlockRangeEntryStack\n key={block}\n block={block}\n blockColor={blockColor}\n blockStatus={blockStatus}\n formattedBlockNumber={formattedBlockNumber}\n updateBlockPositionRefs={updateBlockPositionRefs}\n />\n )\n })}\n </Stack>\n </Stack>\n <BlockConfirmationStats\n confirmed={isConfirmed}\n currentBlockColor={isDefined(currentBlockNumber) ? blockFormatters.color(currentBlockNumber) : 'text.secondary'}\n currentBlockNumberValue={isDefined(currentBlockNumber) ? new Intl.NumberFormat().format(currentBlockNumber) : 'N/A'}\n passedBlocks={passedBlocks}\n />\n </Stack>\n </Stack>\n )\n}\n","import { isDefined } from '@xylabs/sdk-js'\n\nexport type BlockConfirmationStatus = 'confirmed' | 'missed' | 'pending'\n\ninterface BlockFormattersParams {\n confirmedInBlock: number | undefined\n currentBlockNumber: number | undefined\n}\n\nexport class BlockFormatters {\n private readonly params: BlockFormattersParams\n\n constructor(params: BlockFormattersParams) {\n this.params = params\n }\n\n color(blockNumber: number): string {\n const { currentBlockNumber, confirmedInBlock } = this.params\n if (blockNumber === currentBlockNumber) {\n return isDefined(confirmedInBlock) && confirmedInBlock === blockNumber ? 'success.dark' : 'text'\n }\n const status = this.confirmationStatus(blockNumber)\n switch (status) {\n case 'confirmed': {\n return 'success.dark'\n }\n case 'missed': {\n return 'warning.light'\n }\n case 'pending': {\n return 'text.secondary'\n }\n default: {\n return 'text.secondary'\n }\n }\n }\n\n confirmationStatus(blockNumber: number): BlockConfirmationStatus | undefined {\n const { currentBlockNumber, confirmedInBlock } = this.params\n if (isDefined(currentBlockNumber)) {\n if (isDefined(confirmedInBlock) && blockNumber === confirmedInBlock) {\n return 'confirmed'\n }\n return currentBlockNumber > blockNumber ? 'missed' : 'pending'\n }\n }\n\n formatNumber(blockNumber: number) {\n return blockNumber.toString().length <= 5 ? new Intl.NumberFormat().format(blockNumber) : `${blockNumber.toString().slice(-2)}`\n }\n}\n","import type { LinearProgressProps } from '@mui/material'\nimport { isDefined } from '@xylabs/sdk-js'\n\nexport const blockProgressColor = (\n confirmedInBlock: number | undefined,\n isExpired: boolean | undefined,\n): LinearProgressProps['color'] => {\n if (isDefined(confirmedInBlock)) {\n return 'success'\n }\n if (isExpired) {\n return 'error'\n }\n return 'primary'\n}\n","import { isUndefined } from '@xylabs/sdk-js'\n\nexport const createFilledRange = (range?: [number, number]): number[] => {\n if (isUndefined(range)) {\n return []\n }\n const [start, end] = range\n if (end < start) {\n console.warn('Invalid range: end is less than start')\n return []\n }\n\n const result: number[] = []\n\n for (let i = start; i <= end; i++) {\n result.push(i)\n }\n\n return result\n}\n","import { isUndefined, isUndefinedOrNull } from '@xylabs/sdk-js'\n\nexport const getBlockProgress = (\n currentBlockNumber: number | undefined,\n currentBlockRef: HTMLSpanElement | null,\n progressElementRef: HTMLDivElement | null,\n) => {\n if (isUndefined(currentBlockNumber) || isUndefinedOrNull(currentBlockRef) || isUndefinedOrNull(progressElementRef)) {\n return 0\n }\n\n const currentBlockOffsetLeft = currentBlockRef.offsetLeft\n const currentBlockOffsetWidth = currentBlockRef.clientWidth / 2\n const currentBlockCenterOffsetLeft = currentBlockOffsetLeft + currentBlockOffsetWidth\n const parentOffsetLeft = progressElementRef.offsetLeft\n const parentWidth = progressElementRef.clientWidth\n\n const relativePosition = currentBlockCenterOffsetLeft - parentOffsetLeft\n const progress = (relativePosition / parentWidth) * 100\n\n return Math.min(Math.max(progress, 0), 100)\n}\n","import { isDefined } from '@xylabs/sdk-js'\nimport type { BlockRange } from '@xyo-network/xl1-sdk'\n\nexport const isCurrentBlockPassedRange = (\n blockRange: BlockRange | undefined,\n currentBlockNumber: number | undefined,\n) => {\n if (!isDefined(blockRange) || !isDefined(currentBlockNumber)) {\n return false\n }\n const [, end] = blockRange\n return currentBlockNumber > end\n}\n","import { isDefined } from '@xylabs/sdk-js'\n\nexport const passedBlocksInRange = (\n range: number[] | undefined,\n currentBlockNumber: number | undefined,\n) => {\n if (!isDefined(currentBlockNumber) || !isDefined(range)) {\n return []\n }\n const [start] = range\n return range.filter(block => block < currentBlockNumber && block >= start)\n}\n","import type { LinearProgressProps } from '@mui/material'\nimport { isDefined } from '@xylabs/sdk-js'\nimport type { BlockRange } from '@xyo-network/xl1-sdk'\nimport { useMemo } from 'react'\n\nimport {\n blockProgressColor, createFilledRange, isCurrentBlockPassedRange, passedBlocksInRange,\n} from '../helpers/index.ts'\n\ninterface BlockRangeState {\n isConfirmed: boolean\n isExpired: boolean\n passedBlocks: number[]\n progressColor: LinearProgressProps['color']\n range: number[]\n}\n\nexport const useBlockRangeState = (\n blockRange: BlockRange | undefined,\n confirmedInBlock: number | undefined,\n currentBlockNumber?: number | undefined,\n): BlockRangeState => {\n const range = useMemo(() => createFilledRange((blockRange)), [blockRange])\n\n const isExpired = useMemo(() => isCurrentBlockPassedRange(blockRange, currentBlockNumber), [blockRange, currentBlockNumber])\n\n const passedBlocks = useMemo(() => passedBlocksInRange(range, currentBlockNumber), [currentBlockNumber, range])\n\n const progressColor = useMemo(() => blockProgressColor(confirmedInBlock, isExpired), [confirmedInBlock, isExpired])\n\n const isConfirmed = isDefined(confirmedInBlock)\n\n return {\n isConfirmed, isExpired, passedBlocks, progressColor, range,\n }\n}\n","import { CheckCircleOutline } from '@mui/icons-material'\nimport {\n Grow, Stack, Typography,\n} from '@mui/material'\nimport { isDefined } from '@xylabs/sdk-js'\nimport React from 'react'\n\nexport interface BlockConfirmationStatsProps {\n confirmed?: boolean\n currentBlockColor?: string\n currentBlockNumberValue?: string\n passedBlocks?: number[]\n}\n\nexport const BlockConfirmationStats: React.FC<BlockConfirmationStatsProps> = ({\n confirmed, currentBlockColor, currentBlockNumberValue, passedBlocks,\n}) => {\n return (\n <Stack>\n <Typography\n variant=\"caption\"\n color={currentBlockColor}\n sx={{\n display: 'inline-flex', alignItems: 'center', gap: 0.5,\n }}\n >\n Current Block:\n {' '}\n {currentBlockNumberValue}\n {' '}\n <Grow in={confirmed}>\n <CheckCircleOutline sx={{ width: '0.8em', height: '0.8em' }} color=\"success\" />\n </Grow>\n </Typography>\n <Typography variant=\"caption\" color=\"warning.light\" sx={{ opacity: 0.75 }}>\n Passed Blocks:\n {' '}\n {isDefined(passedBlocks) && passedBlocks.length > 0 ? passedBlocks.map(block => new Intl.NumberFormat().format(block)).join(', ') : 'N/A'}\n </Typography>\n\n </Stack>\n )\n}\n","import type { BoxProps, StackProps } from '@mui/material'\nimport {\n Box, Stack, styled, Tooltip, Typography,\n} from '@mui/material'\nimport React from 'react'\n\nimport type { BlockConfirmationStatus } from '../../helpers/index.ts'\n\nexport interface BlockRangeEntryStackProps extends StackProps {\n block: number\n blockColor: string\n blockStatus: BlockConfirmationStatus | undefined\n formattedBlockNumber: string\n updateBlockPositionRefs?: (blockNumber: number, ref: HTMLSpanElement | null) => void\n}\n\nexport const BlockRangeEntryStack: React.FC<BlockRangeEntryStackProps> = ({\n block, blockColor, blockStatus, formattedBlockNumber, updateBlockPositionRefs, sx, ...props\n}) => {\n return (\n <Stack\n ref={(ref) => { if (updateBlockPositionRefs) updateBlockPositionRefs(block, ref) }}\n key={block}\n sx={{ position: 'relative', ...sx }}\n {...props}\n >\n <Box\n component=\"span\"\n sx={{\n display: 'flex', position: 'relative', width: '100%', height: 5,\n }}\n >\n <StyledBlockNumberIndicator component=\"span\" sx={{ backgroundColor: blockColor }} />\n </Box>\n <Tooltip\n title={`Block: ${new Intl.NumberFormat().format(block)} (${blockStatus})`}\n placement=\"top\"\n arrow\n >\n <Typography\n variant=\"caption\"\n sx={{\n color: blockColor,\n cursor: 'pointer',\n opacity: blockStatus === 'missed' ? 0.75 : 1,\n }}\n >\n {formattedBlockNumber}\n </Typography>\n </Tooltip>\n </Stack>\n )\n}\n\nconst StyledBlockNumberIndicator = styled(Box, { name: 'StyledBlockNumberIndicator' })<BoxProps>(({ theme }) => {\n return theme.unstable_sx({\n position: 'absolute',\n left: 'calc(50% - 1px)',\n transform: 'calc(translateX(-50%) - 1px)',\n height: 3,\n width: '1px',\n backgroundColor: 'primary.main',\n })\n})\n"],"mappings":";;;;AACA,SAASA,gBAAgBC,SAAAA,cAAa;AACtC,SAASC,aAAAA,kBAAiB;AAE1B,OAAOC,UACLC,iBACAC,WAAAA,UACAC,QAAQC,gBACH;;;ACRP,SAASC,iBAAiB;AASnB,IAAMC,kBAAN,MAAMA;EATb,OASaA;;;EACMC;EAEjB,YAAYA,QAA+B;AACzC,SAAKA,SAASA;EAChB;EAEAC,MAAMC,aAA6B;AACjC,UAAM,EAAEC,oBAAoBC,iBAAgB,IAAK,KAAKJ;AACtD,QAAIE,gBAAgBC,oBAAoB;AACtC,aAAOE,UAAUD,gBAAAA,KAAqBA,qBAAqBF,cAAc,iBAAiB;IAC5F;AACA,UAAMI,SAAS,KAAKC,mBAAmBL,WAAAA;AACvC,YAAQI,QAAAA;MACN,KAAK,aAAa;AAChB,eAAO;MACT;MACA,KAAK,UAAU;AACb,eAAO;MACT;MACA,KAAK,WAAW;AACd,eAAO;MACT;MACA,SAAS;AACP,eAAO;MACT;IACF;EACF;EAEAC,mBAAmBL,aAA0D;AAC3E,UAAM,EAAEC,oBAAoBC,iBAAgB,IAAK,KAAKJ;AACtD,QAAIK,UAAUF,kBAAAA,GAAqB;AACjC,UAAIE,UAAUD,gBAAAA,KAAqBF,gBAAgBE,kBAAkB;AACnE,eAAO;MACT;AACA,aAAOD,qBAAqBD,cAAc,WAAW;IACvD;EACF;EAEAM,aAAaN,aAAqB;AAChC,WAAOA,YAAYO,SAAQ,EAAGC,UAAU,IAAI,IAAIC,KAAKC,aAAY,EAAGC,OAAOX,WAAAA,IAAe,GAAGA,YAAYO,SAAQ,EAAGK,MAAM,EAAC,CAAA;EAC7H;AACF;;;AClDA,SAASC,a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AO,GAAG3B;KACzB,gBAAAyB,OAAA,cAACC,QAAAA;IAAME,OAAM;IAAOC,KAAK;KACvB,gBAAAJ,OAAA,cAACC,QAAAA,MACC,gBAAAD,OAAA,cAACK,gBAAAA;IAAezB,KAAKE;IAAoBwB,SAAQ;IAAcC,OAAOpB,YAAY,MAAMK;IAAegB,OAAOxB;MAC9G,gBAAAgB,OAAA,cAACC,QAAAA;IAAMC,WAAU;IAAMO,gBAAe;KACnCxB,MAAMyB,IAAI,CAACC,UAAAA;AACV,UAAMC,aAAavB,gBAAgBmB,MAAMG,KAAAA;AACzC,UAAME,cAAcxB,gBAAgByB,mBAAmBH,KAAAA;AACvD,UAAMI,uBAAuB1B,gBAAgB2B,aAAaL,KAAAA;AAC1D,WACE,gBAAAX,OAAA,cAACiB,sBAAAA;MACCC,KAAKP;MACLA;MACAC;MACAC;MACAE;MACArC;;EAGN,CAAA,CAAA,CAAA,GAGJ,gBAAAsB,OAAA,cAACmB,wBAAAA;IACCC,WAAWlC;IACXmC,mBAAmBzB,WAAUtB,kBAAAA,IAAsBe,gBAAgBmB,MAAMlC,kBAAAA,IAAsB;IAC/FgD,yBAAyB1B,WAAUtB,kBAAAA,IAAsB,IAAIiD,KAAKC,aAAY,EAAGC,OAAOnD,kBAAAA,IAAsB;IAC9GS;;AAKV,GAjEiF;","names":["LinearProgress","Stack","isDefined","React","useLayoutEffect","useMemo","useRef","useState","isDefined","BlockFormatters","params","color","blockNumber","currentBlockNumber","confirmedInBlock","isDefined","status","confirmationStatus","formatNumber","toString","length","Intl","NumberFormat","format","slice","isDefined","blockProgressColor","confirmedInBlock","isExpired","isDefined","isUndefined","createFilledRange","range","isUndefined","start","end","console","warn","result","i","push","isUndefined","isUndefinedOrNull","getBlockProgress","currentBlockNumber","currentBlockRef","progressElementRef","isUndefined","isUndefinedOrNull","currentBlockOffsetLeft","offsetLeft","currentBlockOffsetWidth","clientWidth","currentBlockCenterOffsetLeft","parentOffsetLeft","parentWidth","relativePosition","progress","Math","min","max","isDefined","isCurrentBlockPassedRange","blockRange","currentBlockNumber","isDefined","end","isDefined","passedBlocksInRange","range","currentBlockNumber","isDefined","start","filter","block","isDefined","useMemo","useBlockRangeState","blockRange","confirmedInBlock","currentBlockNumber","range","useMemo","createFilledRange","isExpired","isCurrentBlockPassedRange","passedBlocks","passedBlocksInRange","progressColor","blockProgressColor","isConfirmed","isDefined","CheckCircleOutline","Grow","Stack","Typography","isDefined","React","BlockConfirmationStats","confirmed","currentBlockColor","currentBlockNumberValue","passedBlocks","Stack","Typography","variant","color","sx","display","alignItems","gap","Grow","in","CheckCircleOutline","width","height","opacity","isDefined","length","map","block","Intl","NumberFormat","format","join","Box","Stack","styled","Tooltip","Typography","React","BlockRangeEntryStack","block","blockColor","blockStatus","formattedBlockNumber","updateBlockPositionRefs","sx","props","React","Stack","ref","key","position","Box","component","display","width","height","StyledBlockNumberIndicator","backgroundColor","Tooltip","title","Intl","NumberFormat","format","placement","arrow","Typography","variant","color","cursor","opacity","styled","name","theme","unstable_sx","left","transform","TransactionStackProgress","blockRange","confirmedInBlock","currentBlockNumber","props","blockPositionsRef","useRef","updateBlockPositionRefs","blockNumber","ref","current","progressElementRef","passedBlocks","progressColor","range","isConfirmed","isExpired","useBlockRangeState","blockFormatters","useMemo","BlockFormatters","progressValue","setProgressValue","useState","useLayoutEffect","isDefined","currentBlockNumberElement","progressElement","getBlockProgress","React","Stack","direction","width","gap","LinearProgress","variant","value","color","justifyContent","map","block","blockColor","blockStatus","confirmationStatus","formattedBlockNumber","formatNumber","BlockRangeEntryStack","key","BlockConfirmationStats","confirmed","currentBlockColor","currentBlockNumberValue","Intl","NumberFormat","format"]}
1
+ {"version":3,"sources":["../../src/confirmation/components/TransactionStackProgress.tsx","../../src/confirmation/helpers/BlockFormatters.ts","../../src/confirmation/helpers/blockProgressColor.ts","../../src/confirmation/helpers/createFilledRange.ts","../../src/confirmation/helpers/getBlockProgress.ts","../../src/confirmation/helpers/isCurrentBlockPassedRange.ts","../../src/confirmation/helpers/passedBlocksInRange.ts","../../src/confirmation/hooks/useBlockRangeState.ts","../../src/confirmation/components/support/BlockConfirmationStats.tsx","../../src/confirmation/components/support/BlockRangeEntryStack.tsx"],"sourcesContent":["import type { StackProps } from '@mui/material'\nimport { LinearProgress, Stack } from '@mui/material'\nimport { isDefined } from '@xylabs/sdk-js'\nimport { type BlockRange } from '@xyo-network/xl1-sdk'\nimport React, {\n useLayoutEffect,\n useMemo,\n useRef, useState,\n} from 'react'\n\nimport { BlockFormatters, getBlockProgress } from '../helpers/index.ts'\nimport { useBlockRangeState } from '../hooks/index.ts'\nimport { BlockConfirmationStats, BlockRangeEntryStack } from './support/index.ts'\n\nexport interface TransactionStackProgressProps extends StackProps {\n blockRange?: BlockRange\n confirmedInBlock?: number\n currentBlockNumber?: number\n}\n\nexport const TransactionStackProgress: React.FC<TransactionStackProgressProps> = ({\n blockRange, confirmedInBlock, currentBlockNumber, ...props\n}) => {\n const blockPositionsRef = useRef<Record<number, HTMLSpanElement | null>>({})\n const updateBlockPositionRefs = (blockNumber: number, ref: HTMLSpanElement | null) => {\n blockPositionsRef.current[blockNumber] = ref\n }\n\n const progressElementRef = useRef<HTMLDivElement | null>(null)\n\n const {\n passedBlocks, progressColor, range, isConfirmed, isExpired,\n } = useBlockRangeState(blockRange, confirmedInBlock, currentBlockNumber)\n\n const blockFormatters = useMemo(() => new BlockFormatters({ confirmedInBlock, currentBlockNumber }), [confirmedInBlock, currentBlockNumber])\n\n const [progressValue, setProgressValue] = useState(0)\n\n useLayoutEffect(() => {\n // prevent updates if the current block is past the confirmed block\n if (isDefined(currentBlockNumber) && isDefined(confirmedInBlock) && currentBlockNumber > confirmedInBlock) {\n return\n }\n const currentBlockNumberElement = isDefined(currentBlockNumber) ? blockPositionsRef.current[currentBlockNumber] : null\n const progressElement = progressElementRef.current\n // since we are relying on htmlElements, we have to use layout effect\n setProgressValue(getBlockProgress(\n currentBlockNumber,\n currentBlockNumberElement,\n progressElement,\n ))\n }, [confirmedInBlock, currentBlockNumber])\n\n return (\n <Stack direction=\"row\" {...props}>\n <Stack\n sx={{\n width: '100%',\n gap: 1,\n }}\n >\n <Stack>\n <LinearProgress ref={progressElementRef} variant=\"determinate\" value={isExpired ? 100 : progressValue} color={progressColor} />\n <Stack\n direction=\"row\"\n sx={{ justifyContent: 'space-between' }}\n >\n {range.map((block) => {\n const blockColor = blockFormatters.color(block)\n const blockStatus = blockFormatters.confirmationStatus(block)\n const formattedBlockNumber = blockFormatters.formatNumber(block)\n return (\n <BlockRangeEntryStack\n key={block}\n block={block}\n blockColor={blockColor}\n blockStatus={blockStatus}\n formattedBlockNumber={formattedBlockNumber}\n updateBlockPositionRefs={updateBlockPositionRefs}\n />\n )\n })}\n </Stack>\n </Stack>\n <BlockConfirmationStats\n confirmed={isConfirmed}\n currentBlockColor={isDefined(currentBlockNumber) ? blockFormatters.color(currentBlockNumber) : 'text.secondary'}\n currentBlockNumberValue={isDefined(currentBlockNumber) ? new Intl.NumberFormat().format(currentBlockNumber) : 'N/A'}\n passedBlocks={passedBlocks}\n />\n </Stack>\n </Stack>\n )\n}\n","import { isDefined } from '@xylabs/sdk-js'\n\nexport type BlockConfirmationStatus = 'confirmed' | 'missed' | 'pending'\n\ninterface BlockFormattersParams {\n confirmedInBlock: number | undefined\n currentBlockNumber: number | undefined\n}\n\nexport class BlockFormatters {\n private readonly params: BlockFormattersParams\n\n constructor(params: BlockFormattersParams) {\n this.params = params\n }\n\n color(blockNumber: number): string {\n const { currentBlockNumber, confirmedInBlock } = this.params\n if (blockNumber === currentBlockNumber) {\n return isDefined(confirmedInBlock) && confirmedInBlock === blockNumber ? 'success.dark' : 'text'\n }\n const status = this.confirmationStatus(blockNumber)\n switch (status) {\n case 'confirmed': {\n return 'success.dark'\n }\n case 'missed': {\n return 'warning.light'\n }\n case 'pending': {\n return 'text.secondary'\n }\n default: {\n return 'text.secondary'\n }\n }\n }\n\n confirmationStatus(blockNumber: number): BlockConfirmationStatus | undefined {\n const { currentBlockNumber, confirmedInBlock } = this.params\n if (isDefined(currentBlockNumber)) {\n if (isDefined(confirmedInBlock) && blockNumber === confirmedInBlock) {\n return 'confirmed'\n }\n return currentBlockNumber > blockNumber ? 'missed' : 'pending'\n }\n }\n\n formatNumber(blockNumber: number) {\n return blockNumber.toString().length <= 5 ? new Intl.NumberFormat().format(blockNumber) : `${blockNumber.toString().slice(-2)}`\n }\n}\n","import type { LinearProgressProps } from '@mui/material'\nimport { isDefined } from '@xylabs/sdk-js'\n\nexport const blockProgressColor = (\n confirmedInBlock: number | undefined,\n isExpired: boolean | undefined,\n): LinearProgressProps['color'] => {\n if (isDefined(confirmedInBlock)) {\n return 'success'\n }\n if (isExpired) {\n return 'error'\n }\n return 'primary'\n}\n","import { isUndefined } from '@xylabs/sdk-js'\n\nexport const createFilledRange = (range?: [number, number]): number[] => {\n if (isUndefined(range)) {\n return []\n }\n const [start, end] = range\n if (end < start) {\n console.warn('Invalid range: end is less than start')\n return []\n }\n\n const result: number[] = []\n\n for (let i = start; i <= end; i++) {\n result.push(i)\n }\n\n return result\n}\n","import { isUndefined, isUndefinedOrNull } from '@xylabs/sdk-js'\n\nexport const getBlockProgress = (\n currentBlockNumber: number | undefined,\n currentBlockRef: HTMLSpanElement | null,\n progressElementRef: HTMLDivElement | null,\n) => {\n if (isUndefined(currentBlockNumber) || isUndefinedOrNull(currentBlockRef) || isUndefinedOrNull(progressElementRef)) {\n return 0\n }\n\n const currentBlockOffsetLeft = currentBlockRef.offsetLeft\n const currentBlockOffsetWidth = currentBlockRef.clientWidth / 2\n const currentBlockCenterOffsetLeft = currentBlockOffsetLeft + currentBlockOffsetWidth\n const parentOffsetLeft = progressElementRef.offsetLeft\n const parentWidth = progressElementRef.clientWidth\n\n const relativePosition = currentBlockCenterOffsetLeft - parentOffsetLeft\n const progress = (relativePosition / parentWidth) * 100\n\n return Math.min(Math.max(progress, 0), 100)\n}\n","import { isDefined } from '@xylabs/sdk-js'\nimport type { BlockRange } from '@xyo-network/xl1-sdk'\n\nexport const isCurrentBlockPassedRange = (\n blockRange: BlockRange | undefined,\n currentBlockNumber: number | undefined,\n) => {\n if (!isDefined(blockRange) || !isDefined(currentBlockNumber)) {\n return false\n }\n const [, end] = blockRange\n return currentBlockNumber > end\n}\n","import { isDefined } from '@xylabs/sdk-js'\n\nexport const passedBlocksInRange = (\n range: number[] | undefined,\n currentBlockNumber: number | undefined,\n) => {\n if (!isDefined(currentBlockNumber) || !isDefined(range)) {\n return []\n }\n const [start] = range\n return range.filter(block => block < currentBlockNumber && block >= start)\n}\n","import type { LinearProgressProps } from '@mui/material'\nimport { isDefined } from '@xylabs/sdk-js'\nimport type { BlockRange } from '@xyo-network/xl1-sdk'\nimport { useMemo } from 'react'\n\nimport {\n blockProgressColor, createFilledRange, isCurrentBlockPassedRange, passedBlocksInRange,\n} from '../helpers/index.ts'\n\ninterface BlockRangeState {\n isConfirmed: boolean\n isExpired: boolean\n passedBlocks: number[]\n progressColor: LinearProgressProps['color']\n range: number[]\n}\n\nexport const useBlockRangeState = (\n blockRange: BlockRange | undefined,\n confirmedInBlock: number | undefined,\n currentBlockNumber?: number | undefined,\n): BlockRangeState => {\n const range = useMemo(() => createFilledRange((blockRange)), [blockRange])\n\n const isExpired = useMemo(() => isCurrentBlockPassedRange(blockRange, currentBlockNumber), [blockRange, currentBlockNumber])\n\n const passedBlocks = useMemo(() => passedBlocksInRange(range, currentBlockNumber), [currentBlockNumber, range])\n\n const progressColor = useMemo(() => blockProgressColor(confirmedInBlock, isExpired), [confirmedInBlock, isExpired])\n\n const isConfirmed = isDefined(confirmedInBlock)\n\n return {\n isConfirmed, isExpired, passedBlocks, progressColor, range,\n }\n}\n","import { CheckCircleOutlined } from '@mui/icons-material'\nimport {\n Grow, Stack, Typography,\n} from '@mui/material'\nimport { isDefined } from '@xylabs/sdk-js'\nimport React from 'react'\n\nexport interface BlockConfirmationStatsProps {\n confirmed?: boolean\n currentBlockColor?: string\n currentBlockNumberValue?: string\n passedBlocks?: number[]\n}\n\nexport const BlockConfirmationStats: React.FC<BlockConfirmationStatsProps> = ({\n confirmed, currentBlockColor, currentBlockNumberValue, passedBlocks,\n}) => {\n return (\n <Stack>\n <Typography\n variant=\"caption\"\n color={currentBlockColor}\n sx={{\n display: 'inline-flex', alignItems: 'center', gap: 0.5,\n }}\n >\n Current Block:\n {' '}\n {currentBlockNumberValue}\n {' '}\n <Grow in={confirmed}>\n <CheckCircleOutlined sx={{ width: '0.8em', height: '0.8em' }} color=\"success\" />\n </Grow>\n </Typography>\n <Typography\n variant=\"caption\"\n sx={{\n color: 'warning.light',\n opacity: 0.75,\n }}\n >\n Passed Blocks:\n {' '}\n {isDefined(passedBlocks) && passedBlocks.length > 0 ? passedBlocks.map(block => new Intl.NumberFormat().format(block)).join(', ') : 'N/A'}\n </Typography>\n </Stack>\n )\n}\n","import type { BoxProps, StackProps } from '@mui/material'\nimport {\n Box, Stack, styled, Tooltip, Typography,\n} from '@mui/material'\nimport React from 'react'\n\nimport type { BlockConfirmationStatus } from '../../helpers/index.ts'\n\nexport interface BlockRangeEntryStackProps extends StackProps {\n block: number\n blockColor: string\n blockStatus: BlockConfirmationStatus | undefined\n formattedBlockNumber: string\n updateBlockPositionRefs?: (blockNumber: number, ref: HTMLSpanElement | null) => void\n}\n\nexport const BlockRangeEntryStack: React.FC<BlockRangeEntryStackProps> = ({\n block, blockColor, blockStatus, formattedBlockNumber, updateBlockPositionRefs, sx, ...props\n}) => {\n return (\n <Stack\n ref={(ref) => { if (updateBlockPositionRefs) updateBlockPositionRefs(block, ref) }}\n key={block}\n sx={{ position: 'relative', ...sx }}\n {...props}\n >\n <Box\n component=\"span\"\n sx={{\n display: 'flex', position: 'relative', width: '100%', height: 5,\n }}\n >\n <StyledBlockNumberIndicator component=\"span\" sx={{ backgroundColor: blockColor }} />\n </Box>\n <Tooltip\n title={`Block: ${new Intl.NumberFormat().format(block)} (${blockStatus})`}\n placement=\"top\"\n arrow\n >\n <Typography\n variant=\"caption\"\n sx={{\n color: blockColor,\n cursor: 'pointer',\n opacity: blockStatus === 'missed' ? 0.75 : 1,\n }}\n >\n {formattedBlockNumber}\n </Typography>\n </Tooltip>\n </Stack>\n )\n}\n\nconst StyledBlockNumberIndicator = styled(Box, { name: 'StyledBlockNumberIndicator' })<BoxProps>(({ theme }) => {\n return theme.unstable_sx({\n position: 'absolute',\n left: 'calc(50% - 1px)',\n transform: 'calc(translateX(-50%) - 1px)',\n height: 3,\n width: '1px',\n backgroundColor: 'primary.main',\n })\n})\n"],"mappings":";;;;AACA,SAASA,gBAAgBC,SAAAA,cAAa;AACtC,SAASC,aAAAA,kBAAiB;AAE1B,OAAOC,UACLC,iBACAC,WAAAA,UACAC,QAAQC,gBACH;;;ACRP,SAASC,iBAAiB;AASnB,IAAMC,kBAAN,MAAMA;EATb,OASaA;;;EACMC;EAEjB,YAAYA,QAA+B;AACzC,SAAKA,SAASA;EAChB;EAEAC,MAAMC,aAA6B;AACjC,UAAM,EAAEC,oBAAoBC,iBAAgB,IAAK,KAAKJ;AACtD,QAAIE,gBAAgBC,oBAAoB;AACtC,aAAOE,UAAUD,gBAAAA,KAAqBA,qBAAqBF,cAAc,iBAAiB;IAC5F;AACA,UAAMI,SAAS,KAAKC,mBAAmBL,WAAAA;AACvC,YAAQI,QAAAA;MACN,KAAK,aAAa;AAChB,eAAO;MACT;MACA,KAAK,UAAU;AACb,eAAO;MACT;MACA,KAAK,WAAW;AACd,eAAO;MACT;MACA,SAAS;AACP,eAAO;MACT;IACF;EACF;EAEAC,mBAAmBL,aAA0D;AAC3E,UAAM,EAAEC,oBAAoBC,iBAAgB,IAAK,KAAKJ;AACtD,QAAIK,UAAUF,kBAAAA,GAAqB;AACjC,UAAIE,UAAUD,gBAAAA,KAAqBF,gBAAgBE,kBAAkB;AACnE,eAAO;MACT;AACA,aAAOD,qBAAqBD,cAAc,WAAW;IACvD;EACF;EAEAM,aAAaN,aAAqB;AAChC,WAAOA,YAAYO,SAAQ,EAAGC,UAAU,IAAI,IAAI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AC,eAAAA,CAAAA;EAEJ,GAAG;IAACzB;IAAkBC;GAAmB;AAEzC,SACE,gBAAA0B,OAAA,cAACC,QAAAA;IAAMC,WAAU;IAAO,GAAG3B;KACzB,gBAAAyB,OAAA,cAACC,QAAAA;IACCE,IAAI;MACFC,OAAO;MACPC,KAAK;IACP;KAEA,gBAAAL,OAAA,cAACC,QAAAA,MACC,gBAAAD,OAAA,cAACM,gBAAAA;IAAe1B,KAAKE;IAAoByB,SAAQ;IAAcC,OAAOrB,YAAY,MAAMK;IAAeiB,OAAOzB;MAC9G,gBAAAgB,OAAA,cAACC,QAAAA;IACCC,WAAU;IACVC,IAAI;MAAEO,gBAAgB;IAAgB;KAErCzB,MAAM0B,IAAI,CAACC,UAAAA;AACV,UAAMC,aAAaxB,gBAAgBoB,MAAMG,KAAAA;AACzC,UAAME,cAAczB,gBAAgB0B,mBAAmBH,KAAAA;AACvD,UAAMI,uBAAuB3B,gBAAgB4B,aAAaL,KAAAA;AAC1D,WACE,gBAAAZ,OAAA,cAACkB,sBAAAA;MACCC,KAAKP;MACLA;MACAC;MACAC;MACAE;MACAtC;;EAGN,CAAA,CAAA,CAAA,GAGJ,gBAAAsB,OAAA,cAACoB,wBAAAA;IACCC,WAAWnC;IACXoC,mBAAmB1B,WAAUtB,kBAAAA,IAAsBe,gBAAgBoB,MAAMnC,kBAAAA,IAAsB;IAC/FiD,yBAAyB3B,WAAUtB,kBAAAA,IAAsB,IAAIkD,KAAKC,aAAY,EAAGC,OAAOpD,kBAAAA,IAAsB;IAC9GS;;AAKV,GAzEiF;","names":["LinearProgress","Stack","isDefined","React","useLayoutEffect","useMemo","useRef","useState","isDefined","BlockFormatters","params","color","blockNumber","currentBlockNumber","confirmedInBlock","isDefined","status","confirmationStatus","formatNumber","toString","length","Intl","NumberFormat","format","slice","isDefined","blockProgressColor","confirmedInBlock","isExpired","isDefined","isUndefined","createFilledRange","range","isUndefined","start","end","console","warn","result","i","push","isUndefined","isUndefinedOrNull","getBlockProgress","currentBlockNumber","currentBlockRef","progressElementRef","isUndefined","isUndefinedOrNull","currentBlockOffsetLeft","offsetLeft","currentBlockOffsetWidth","clientWidth","currentBlockCenterOffsetLeft","parentOffsetLeft","parentWidth","relativePosition","progress","Math","min","max","isDefined","isCurrentBlockPassedRange","blockRange","currentBlockNumber","isDefined","end","isDefined","passedBlocksInRange","range","currentBlockNumber","isDefined","start","filter","block","isDefined","useMemo","useBlockRangeState","blockRange","confirmedInBlock","currentBlockNumber","range","useMemo","createFilledRange","isExpired","isCurrentBlockPassedRange","passedBlocks","passedBlocksInRange","progressColor","blockProgressColor","isConfirmed","isDefined","CheckCircleOutlined","Grow","Stack","Typography","isDefined","React","BlockConfirmationStats","confirmed","currentBlockColor","currentBlockNumberValue","passedBlocks","Stack","Typography","variant","color","sx","display","alignItems","gap","Grow","in","CheckCircleOutlined","width","height","opacity","isDefined","length","map","block","Intl","NumberFormat","format","join","Box","Stack","styled","Tooltip","Typography","React","BlockRangeEntryStack","block","blockColor","blockStatus","formattedBlockNumber","updateBlockPositionRefs","sx","props","React","Stack","ref","key","position","Box","component","display","width","height","StyledBlockNumberIndicator","backgroundColor","Tooltip","title","Intl","NumberFormat","format","placement","arrow","Typography","variant","color","cursor","opacity","styled","name","theme","unstable_sx","left","transform","TransactionStackProgress","blockRange","confirmedInBlock","currentBlockNumber","props","blockPositionsRef","useRef","updateBlockPositionRefs","blockNumber","ref","current","progressElementRef","passedBlocks","progressColor","range","isConfirmed","isExpired","useBlockRangeState","blockFormatters","useMemo","BlockFormatters","progressValue","setProgressValue","useState","useLayoutEffect","isDefined","currentBlockNumberElement","progressElement","getBlockProgress","React","Stack","direction","sx","width","gap","LinearProgress","variant","value","color","justifyContent","map","block","blockColor","blockStatus","confirmationStatus","formattedBlockNumber","formatNumber","BlockRangeEntryStack","key","BlockConfirmationStats","confirmed","currentBlockColor","currentBlockNumberValue","Intl","NumberFormat","format"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "http://json.schemastore.org/package.json",
3
3
  "name": "@xyo-network/xl1-react-transaction",
4
- "version": "1.21.3",
4
+ "version": "1.23.0",
5
5
  "description": "XYO Layer One API",
6
6
  "homepage": "https://xylabs.com",
7
7
  "bugs": {
@@ -40,11 +40,11 @@
40
40
  ],
41
41
  "devDependencies": {
42
42
  "@bitauth/libauth": "~3.0.0",
43
- "@metamask/json-rpc-engine": "^10.3.0",
43
+ "@metamask/json-rpc-engine": "^10.5.0",
44
44
  "@metamask/providers": "^22.1.1",
45
45
  "@metamask/utils": "~11.11.0",
46
- "@mui/icons-material": "^7.3.11",
47
- "@mui/material": "^7.3.11",
46
+ "@mui/icons-material": "~9.0",
47
+ "@mui/material": "~9.0",
48
48
  "@opentelemetry/api": "^1.9.1",
49
49
  "@opentelemetry/sdk-trace-base": "^2.7.1",
50
50
  "@scure/base": "~2.2.0",
@@ -55,10 +55,10 @@
55
55
  "@xylabs/geo": "^5.1.2",
56
56
  "@xylabs/sdk-js": "^5.1.2",
57
57
  "@xylabs/threads": "~5.1.2",
58
- "@xylabs/toolchain": "~7.13.15",
59
- "@xylabs/tsconfig": "~7.13.15",
60
- "@xylabs/tsconfig-dom": "~7.13.15",
61
- "@xylabs/tsconfig-react": "~7.13.15",
58
+ "@xylabs/toolchain": "~7.13.24",
59
+ "@xylabs/tsconfig": "~7.13.24",
60
+ "@xylabs/tsconfig-dom": "~7.13.24",
61
+ "@xylabs/tsconfig-react": "~7.13.24",
62
62
  "@xyo-network/account": "~5.6.2",
63
63
  "@xyo-network/account-model": "~5.6.3",
64
64
  "@xyo-network/api": "~5.6.2",
@@ -78,7 +78,7 @@
78
78
  "@xyo-network/sdk-protocol-js": "~5.6.3",
79
79
  "@xyo-network/wallet": "~5.6.2",
80
80
  "@xyo-network/wallet-model": "^5.6.3",
81
- "@xyo-network/xl1-sdk": "^1.28.5",
81
+ "@xyo-network/xl1-sdk": "^1.30.1",
82
82
  "ajv": "^8.20.0",
83
83
  "async-mutex": "^0.5.0",
84
84
  "bn.js": "^5.2.3",
@@ -101,8 +101,8 @@
101
101
  "storybook": "^10.3.6",
102
102
  "typescript": "~5.9.3",
103
103
  "uuid": "~14.0.0",
104
- "vite": "^8.0.10",
105
- "vitest": "^4.1.5",
104
+ "vite": "^8.0.12",
105
+ "vitest": "^4.1.6",
106
106
  "wasm-feature-detect": "~1.8.0",
107
107
  "webextension-polyfill": "^0.12.0",
108
108
  "zod": "~4.4.3"
@@ -112,8 +112,8 @@
112
112
  "@metamask/json-rpc-engine": "^10.3",
113
113
  "@metamask/providers": "^22.1",
114
114
  "@metamask/utils": "~11.11",
115
- "@mui/icons-material": "^7.3",
116
- "@mui/material": "^7.3",
115
+ "@mui/icons-material": "~9.0",
116
+ "@mui/material": "~9.0",
117
117
  "@opentelemetry/api": "^1.9",
118
118
  "@opentelemetry/sdk-trace-base": "^2.7",
119
119
  "@scure/base": "~2.2",