@xyo-network/xl1-react-transaction 2.0.18 → 3.0.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.
- package/dist/browser/confirmation/components/TransactionStackProgress.d.ts.map +1 -1
- package/dist/browser/confirmation/components/support/BlockConfirmationStats.d.ts.map +1 -1
- package/dist/browser/confirmation/helpers/BlockFormatters.d.ts.map +1 -1
- package/dist/browser/confirmation/hooks/useBlockRangeState.d.ts +1 -1
- package/dist/browser/confirmation/hooks/useBlockRangeState.d.ts.map +1 -1
- package/dist/browser/index.mjs +20 -8
- package/dist/browser/index.mjs.map +3 -3
- package/package.json +13 -16
|
@@ -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,
|
|
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,CA+E5E,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockConfirmationStats.d.ts","sourceRoot":"","sources":["../../../../../src/confirmation/components/support/BlockConfirmationStats.tsx"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"BlockConfirmationStats.d.ts","sourceRoot":"","sources":["../../../../../src/confirmation/components/support/BlockConfirmationStats.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAkB,MAAM,OAAO,CAAA;AAEtC,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,CAuCxE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockFormatters.d.ts","sourceRoot":"","sources":["../../../../src/confirmation/helpers/BlockFormatters.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,uBAAuB,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAA;AAExE,UAAU,qBAAqB;IAC7B,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAA;IACpC,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAA;CACvC;AAED,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuB;gBAElC,MAAM,EAAE,qBAAqB;IAIzC,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM;IAsBlC,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,uBAAuB,GAAG,SAAS;IAU5E,YAAY,CAAC,WAAW,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"BlockFormatters.d.ts","sourceRoot":"","sources":["../../../../src/confirmation/helpers/BlockFormatters.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,uBAAuB,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAA;AAExE,UAAU,qBAAqB;IAC7B,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAA;IACpC,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAA;CACvC;AAED,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuB;gBAElC,MAAM,EAAE,qBAAqB;IAIzC,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM;IAsBlC,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,uBAAuB,GAAG,SAAS;IAU5E,YAAY,CAAC,WAAW,EAAE,MAAM;CAIjC"}
|
|
@@ -7,6 +7,6 @@ interface BlockRangeState {
|
|
|
7
7
|
progressColor: LinearProgressProps['color'];
|
|
8
8
|
range: number[];
|
|
9
9
|
}
|
|
10
|
-
export declare const useBlockRangeState: (blockRange: BlockRange | undefined, confirmedInBlock: number | undefined, currentBlockNumber?: number
|
|
10
|
+
export declare const useBlockRangeState: (blockRange: BlockRange | undefined, confirmedInBlock: number | undefined, currentBlockNumber?: number) => BlockRangeState;
|
|
11
11
|
export {};
|
|
12
12
|
//# sourceMappingURL=useBlockRangeState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBlockRangeState.d.ts","sourceRoot":"","sources":["../../../../src/confirmation/hooks/useBlockRangeState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAOtD,UAAU,eAAe;IACvB,WAAW,EAAE,OAAO,CAAA;IACpB,SAAS,EAAE,OAAO,CAAA;IAClB,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,aAAa,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAA;IAC3C,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB;AAED,eAAO,MAAM,kBAAkB,GAC7B,YAAY,UAAU,GAAG,SAAS,EAClC,kBAAkB,MAAM,GAAG,SAAS,EACpC,qBAAqB,MAAM,
|
|
1
|
+
{"version":3,"file":"useBlockRangeState.d.ts","sourceRoot":"","sources":["../../../../src/confirmation/hooks/useBlockRangeState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAOtD,UAAU,eAAe;IACvB,WAAW,EAAE,OAAO,CAAA;IACpB,SAAS,EAAE,OAAO,CAAA;IAClB,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,aAAa,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAA;IAC3C,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB;AAED,eAAO,MAAM,kBAAkB,GAC7B,YAAY,UAAU,GAAG,SAAS,EAClC,kBAAkB,MAAM,GAAG,SAAS,EACpC,qBAAqB,MAAM,KAC1B,eAcF,CAAA"}
|
package/dist/browser/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { LinearProgress, Stack as Stack3 } from "@mui/material";
|
|
|
3
3
|
import { isDefined as isDefined7 } from "@xylabs/sdk-js";
|
|
4
4
|
import {
|
|
5
5
|
useLayoutEffect,
|
|
6
|
-
useMemo as
|
|
6
|
+
useMemo as useMemo3,
|
|
7
7
|
useRef,
|
|
8
8
|
useState
|
|
9
9
|
} from "react";
|
|
@@ -46,7 +46,8 @@ var BlockFormatters = class {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
formatNumber(blockNumber) {
|
|
49
|
-
|
|
49
|
+
const numberFormat = new Intl.NumberFormat();
|
|
50
|
+
return blockNumber.toString().length <= 5 ? numberFormat.format(blockNumber) : blockNumber.toString().slice(-2);
|
|
50
51
|
}
|
|
51
52
|
};
|
|
52
53
|
|
|
@@ -56,7 +57,7 @@ var blockProgressColor = (confirmedInBlock, isExpired) => {
|
|
|
56
57
|
if (isDefined2(confirmedInBlock)) {
|
|
57
58
|
return "success";
|
|
58
59
|
}
|
|
59
|
-
if (isExpired) {
|
|
60
|
+
if (isExpired === true) {
|
|
60
61
|
return "error";
|
|
61
62
|
}
|
|
62
63
|
return "primary";
|
|
@@ -142,6 +143,7 @@ import {
|
|
|
142
143
|
Typography
|
|
143
144
|
} from "@mui/material";
|
|
144
145
|
import { isDefined as isDefined6 } from "@xylabs/sdk-js";
|
|
146
|
+
import { useMemo as useMemo2 } from "react";
|
|
145
147
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
146
148
|
var BlockConfirmationStats = ({
|
|
147
149
|
confirmed,
|
|
@@ -149,6 +151,11 @@ var BlockConfirmationStats = ({
|
|
|
149
151
|
currentBlockNumberValue,
|
|
150
152
|
passedBlocks
|
|
151
153
|
}) => {
|
|
154
|
+
const formattedPassedBlocks = useMemo2(() => {
|
|
155
|
+
if (!isDefined6(passedBlocks) || passedBlocks.length === 0) return "N/A";
|
|
156
|
+
const numberFormat = new Intl.NumberFormat();
|
|
157
|
+
return passedBlocks.map((block) => numberFormat.format(block)).join(", ");
|
|
158
|
+
}, [passedBlocks]);
|
|
152
159
|
return /* @__PURE__ */ jsxs(Stack, { children: [
|
|
153
160
|
/* @__PURE__ */ jsxs(
|
|
154
161
|
Typography,
|
|
@@ -165,7 +172,7 @@ var BlockConfirmationStats = ({
|
|
|
165
172
|
" ",
|
|
166
173
|
currentBlockNumberValue,
|
|
167
174
|
" ",
|
|
168
|
-
/* @__PURE__ */ jsx(Grow, { in: confirmed, children: /* @__PURE__ */ jsx(CheckCircleOutlined, { sx: { width: "0.8em", height: "0.8em" }, color: "success" }) })
|
|
175
|
+
/* @__PURE__ */ jsx(Grow, { in: confirmed === true, children: /* @__PURE__ */ jsx(CheckCircleOutlined, { sx: { width: "0.8em", height: "0.8em" }, color: "success" }) })
|
|
169
176
|
]
|
|
170
177
|
}
|
|
171
178
|
),
|
|
@@ -180,7 +187,7 @@ var BlockConfirmationStats = ({
|
|
|
180
187
|
children: [
|
|
181
188
|
"Passed Blocks:",
|
|
182
189
|
" ",
|
|
183
|
-
|
|
190
|
+
formattedPassedBlocks
|
|
184
191
|
]
|
|
185
192
|
}
|
|
186
193
|
)
|
|
@@ -230,7 +237,7 @@ var BlockRangeEntryStack = ({
|
|
|
230
237
|
/* @__PURE__ */ jsx2(
|
|
231
238
|
Tooltip,
|
|
232
239
|
{
|
|
233
|
-
title: `Block: ${
|
|
240
|
+
title: `Block: ${formattedBlockNumber} (${blockStatus ?? "unknown"})`,
|
|
234
241
|
placement: "top",
|
|
235
242
|
arrow: true,
|
|
236
243
|
children: /* @__PURE__ */ jsx2(
|
|
@@ -283,7 +290,7 @@ var TransactionStackProgress = ({
|
|
|
283
290
|
isConfirmed,
|
|
284
291
|
isExpired
|
|
285
292
|
} = useBlockRangeState(blockRange, confirmedInBlock, currentBlockNumber);
|
|
286
|
-
const blockFormatters =
|
|
293
|
+
const blockFormatters = useMemo3(() => new BlockFormatters({ confirmedInBlock, currentBlockNumber }), [confirmedInBlock, currentBlockNumber]);
|
|
287
294
|
const [progressValue, setProgressValue] = useState(0);
|
|
288
295
|
useLayoutEffect(() => {
|
|
289
296
|
if (isDefined7(currentBlockNumber) && isDefined7(confirmedInBlock) && currentBlockNumber > confirmedInBlock) {
|
|
@@ -297,6 +304,11 @@ var TransactionStackProgress = ({
|
|
|
297
304
|
progressElement
|
|
298
305
|
));
|
|
299
306
|
}, [confirmedInBlock, currentBlockNumber]);
|
|
307
|
+
const formattedCurrentBlockNumber = useMemo3(() => {
|
|
308
|
+
if (!isDefined7(currentBlockNumber)) return "N/A";
|
|
309
|
+
const numberFormat = new Intl.NumberFormat();
|
|
310
|
+
return numberFormat.format(currentBlockNumber);
|
|
311
|
+
}, [currentBlockNumber]);
|
|
300
312
|
return /* @__PURE__ */ jsx3(Stack3, { direction: "row", ...props, children: /* @__PURE__ */ jsxs3(
|
|
301
313
|
Stack3,
|
|
302
314
|
{
|
|
@@ -336,7 +348,7 @@ var TransactionStackProgress = ({
|
|
|
336
348
|
{
|
|
337
349
|
confirmed: isConfirmed,
|
|
338
350
|
currentBlockColor: isDefined7(currentBlockNumber) ? blockFormatters.color(currentBlockNumber) : "text.secondary",
|
|
339
|
-
currentBlockNumberValue:
|
|
351
|
+
currentBlockNumberValue: formattedCurrentBlockNumber,
|
|
340
352
|
passedBlocks
|
|
341
353
|
}
|
|
342
354
|
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
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"],
|
|
4
|
-
"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"],
|
|
5
|
-
"mappings": ";AACA,SAAS,gBAAgB,SAAAA,cAAa;AACtC,SAAS,aAAAC,kBAAiB;AAE1B;AAAA,EACE;AAAA,EACA,WAAAC;AAAA,EACA;AAAA,EAAQ;AAAA,OACH;;;ACRP,SAAS,iBAAiB;AASnB,IAAM,kBAAN,MAAsB;AAAA,EACV;AAAA,EAEjB,YAAY,QAA+B;AACzC,SAAK,SAAS;AAAA,EAChB;AAAA,EAEA,MAAM,aAA6B;AACjC,UAAM,EAAE,oBAAoB,iBAAiB,IAAI,KAAK;AACtD,QAAI,gBAAgB,oBAAoB;AACtC,aAAO,UAAU,gBAAgB,KAAK,qBAAqB,cAAc,iBAAiB;AAAA,IAC5F;AACA,UAAM,SAAS,KAAK,mBAAmB,WAAW;AAClD,YAAQ,QAAQ;AAAA,MACd,KAAK,aAAa;AAChB,eAAO;AAAA,MACT;AAAA,MACA,KAAK,UAAU;AACb,eAAO;AAAA,MACT;AAAA,MACA,KAAK,WAAW;AACd,eAAO;AAAA,MACT;AAAA,MACA,SAAS;AACP,eAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AAAA,EAEA,mBAAmB,aAA0D;AAC3E,UAAM,EAAE,oBAAoB,iBAAiB,IAAI,KAAK;AACtD,QAAI,UAAU,kBAAkB,GAAG;AACjC,UAAI,UAAU,gBAAgB,KAAK,gBAAgB,kBAAkB;AACnE,eAAO;AAAA,MACT;AACA,aAAO,qBAAqB,cAAc,WAAW;AAAA,IACvD;AAAA,EACF;AAAA,EAEA,aAAa,aAAqB;AAChC,WAAO,YAAY,SAAS,EAAE,UAAU,IAAI,
|
|
6
|
-
"names": ["Stack", "isDefined", "useMemo", "isDefined", "isUndefined", "isDefined", "isDefined", "isDefined", "isDefined", "isDefined", "Stack", "Typography", "jsx", "jsxs", "jsx", "jsxs", "useMemo", "isDefined", "Stack"]
|
|
4
|
+
"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 const formattedCurrentBlockNumber = useMemo(() => {\n if (!isDefined(currentBlockNumber)) return 'N/A'\n const numberFormat = new Intl.NumberFormat()\n return numberFormat.format(currentBlockNumber)\n }, [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={formattedCurrentBlockNumber}\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 const numberFormat = new Intl.NumberFormat()\n return blockNumber.toString().length <= 5 ? 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 === true) {\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,\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, { useMemo } 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 const formattedPassedBlocks = useMemo(() => {\n if (!isDefined(passedBlocks) || passedBlocks.length === 0) return 'N/A'\n const numberFormat = new Intl.NumberFormat()\n return passedBlocks.map(block => numberFormat.format(block)).join(', ')\n }, [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 === true}>\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 {formattedPassedBlocks}\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: ${formattedBlockNumber} (${blockStatus ?? 'unknown'})`}\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"],
|
|
5
|
+
"mappings": ";AACA,SAAS,gBAAgB,SAAAA,cAAa;AACtC,SAAS,aAAAC,kBAAiB;AAE1B;AAAA,EACE;AAAA,EACA,WAAAC;AAAA,EACA;AAAA,EAAQ;AAAA,OACH;;;ACRP,SAAS,iBAAiB;AASnB,IAAM,kBAAN,MAAsB;AAAA,EACV;AAAA,EAEjB,YAAY,QAA+B;AACzC,SAAK,SAAS;AAAA,EAChB;AAAA,EAEA,MAAM,aAA6B;AACjC,UAAM,EAAE,oBAAoB,iBAAiB,IAAI,KAAK;AACtD,QAAI,gBAAgB,oBAAoB;AACtC,aAAO,UAAU,gBAAgB,KAAK,qBAAqB,cAAc,iBAAiB;AAAA,IAC5F;AACA,UAAM,SAAS,KAAK,mBAAmB,WAAW;AAClD,YAAQ,QAAQ;AAAA,MACd,KAAK,aAAa;AAChB,eAAO;AAAA,MACT;AAAA,MACA,KAAK,UAAU;AACb,eAAO;AAAA,MACT;AAAA,MACA,KAAK,WAAW;AACd,eAAO;AAAA,MACT;AAAA,MACA,SAAS;AACP,eAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AAAA,EAEA,mBAAmB,aAA0D;AAC3E,UAAM,EAAE,oBAAoB,iBAAiB,IAAI,KAAK;AACtD,QAAI,UAAU,kBAAkB,GAAG;AACjC,UAAI,UAAU,gBAAgB,KAAK,gBAAgB,kBAAkB;AACnE,eAAO;AAAA,MACT;AACA,aAAO,qBAAqB,cAAc,WAAW;AAAA,IACvD;AAAA,EACF;AAAA,EAEA,aAAa,aAAqB;AAChC,UAAM,eAAe,IAAI,KAAK,aAAa;AAC3C,WAAO,YAAY,SAAS,EAAE,UAAU,IAAI,aAAa,OAAO,WAAW,IAAI,YAAY,S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AA;AAAA,oBAEC;AAAA,oBACA;AAAA,oBACA;AAAA,oBACA;AAAA,oBACA;AAAA;AAAA,kBALK;AAAA,gBAMP;AAAA,cAEJ,CAAC;AAAA;AAAA,UACH;AAAA,WACF;AAAA,QACA,gBAAAA;AAAA,UAAC;AAAA;AAAA,YACC,WAAW;AAAA,YACX,mBAAmBG,WAAU,kBAAkB,IAAI,gBAAgB,MAAM,kBAAkB,IAAI;AAAA,YAC/F,yBAAyB;AAAA,YACzB;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;",
|
|
6
|
+
"names": ["Stack", "isDefined", "useMemo", "isDefined", "isUndefined", "isDefined", "isDefined", "isDefined", "isDefined", "isDefined", "useMemo", "Stack", "Typography", "jsx", "jsxs", "jsx", "jsxs", "useMemo", "isDefined", "Stack"]
|
|
7
7
|
}
|
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": "
|
|
4
|
+
"version": "3.0.0",
|
|
5
5
|
"description": "XYO Layer One API",
|
|
6
6
|
"homepage": "https://xylabs.com",
|
|
7
7
|
"bugs": {
|
|
@@ -50,24 +50,22 @@
|
|
|
50
50
|
"@opentelemetry/sdk-trace-base": "^2.8.0",
|
|
51
51
|
"@scure/base": "~2.2.0",
|
|
52
52
|
"@scure/bip39": "~2.2.0",
|
|
53
|
-
"@storybook/react-vite": "^10.4.
|
|
53
|
+
"@storybook/react-vite": "^10.4.6",
|
|
54
54
|
"@types/react": "^19.2.17",
|
|
55
|
-
"@xylabs/geo": "^6.1.
|
|
56
|
-
"@xylabs/sdk-js": "^6.1.
|
|
57
|
-
"@xylabs/threads": "^6.1.
|
|
58
|
-
"@xylabs/toolchain": "~8.
|
|
59
|
-
"@xylabs/tsconfig": "~8.
|
|
60
|
-
"@xylabs/tsconfig-dom": "~8.
|
|
61
|
-
"@xylabs/tsconfig-react": "~8.
|
|
62
|
-
"@xyo-network/address": "^6.1.1",
|
|
55
|
+
"@xylabs/geo": "^6.1.3",
|
|
56
|
+
"@xylabs/sdk-js": "^6.1.3",
|
|
57
|
+
"@xylabs/threads": "^6.1.3",
|
|
58
|
+
"@xylabs/toolchain": "~8.2.7",
|
|
59
|
+
"@xylabs/tsconfig": "~8.2.7",
|
|
60
|
+
"@xylabs/tsconfig-dom": "~8.2.7",
|
|
61
|
+
"@xylabs/tsconfig-react": "~8.2.7",
|
|
63
62
|
"@xyo-network/sdk-js": "^6.1.0",
|
|
64
63
|
"@xyo-network/sdk-protocol-js": "~6.1.1",
|
|
65
|
-
"@xyo-network/xl1-sdk": "
|
|
64
|
+
"@xyo-network/xl1-sdk": "~3.0",
|
|
66
65
|
"ajv": "^8.20.0",
|
|
67
66
|
"async-mutex": "^0.5.0",
|
|
68
67
|
"cosmiconfig": "^9.0.2",
|
|
69
68
|
"debug": "~4.4.3",
|
|
70
|
-
"dotenv": "~17.4.2",
|
|
71
69
|
"eslint": "^10.5.0",
|
|
72
70
|
"ethers": "^6.16.0",
|
|
73
71
|
"hash-wasm": "~4.12.0",
|
|
@@ -76,11 +74,11 @@
|
|
|
76
74
|
"observable-fns": "~0.6.1",
|
|
77
75
|
"react": "^19.2.7",
|
|
78
76
|
"react-dom": "^19.2.7",
|
|
79
|
-
"storybook": "^10.4.
|
|
77
|
+
"storybook": "^10.4.6",
|
|
80
78
|
"typescript": "~6.0.3",
|
|
81
79
|
"uuid": "~14.0.0",
|
|
82
80
|
"vite": "^8.0.16",
|
|
83
|
-
"vitest": "^4.1.
|
|
81
|
+
"vitest": "^4.1.9",
|
|
84
82
|
"webextension-polyfill": "^0.12.0",
|
|
85
83
|
"zod": "~4.4.3"
|
|
86
84
|
},
|
|
@@ -99,10 +97,9 @@
|
|
|
99
97
|
"@xylabs/geo": "^6.0",
|
|
100
98
|
"@xylabs/sdk-js": "^6.0",
|
|
101
99
|
"@xylabs/threads": "^6.1",
|
|
102
|
-
"@xyo-network/address": "^6.0",
|
|
103
100
|
"@xyo-network/sdk-js": "^6.0",
|
|
104
101
|
"@xyo-network/sdk-protocol-js": "~6.1",
|
|
105
|
-
"@xyo-network/xl1-sdk": "^
|
|
102
|
+
"@xyo-network/xl1-sdk": "^3.0",
|
|
106
103
|
"ajv": "^8.20",
|
|
107
104
|
"async-mutex": "^0.5",
|
|
108
105
|
"cosmiconfig": "^9.0",
|