@xyo-network/xl1-react-client-sdk 2.0.12 → 2.0.14
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/client/components/connected/SignTransactionButton.d.ts +56 -0
- package/dist/browser/client/components/connected/SignTransactionButton.d.ts.map +1 -0
- package/dist/browser/client/components/connected/index.d.ts +1 -0
- package/dist/browser/client/components/connected/index.d.ts.map +1 -1
- package/dist/browser/client/index.mjs +177 -19
- package/dist/browser/client/index.mjs.map +4 -4
- package/dist/browser/index.mjs +210 -52
- package/dist/browser/index.mjs.map +4 -4
- package/package.json +10 -12
package/dist/browser/index.mjs
CHANGED
|
@@ -1655,6 +1655,163 @@ var DataLakeOperationsPanel = ({ timeout, ...props }) => {
|
|
|
1655
1655
|
);
|
|
1656
1656
|
};
|
|
1657
1657
|
|
|
1658
|
+
// src/client/components/connected/SignTransactionButton.tsx
|
|
1659
|
+
import {
|
|
1660
|
+
Alert as Alert11,
|
|
1661
|
+
Chip as Chip3,
|
|
1662
|
+
Divider as Divider4,
|
|
1663
|
+
Stack as Stack15,
|
|
1664
|
+
Typography as Typography13
|
|
1665
|
+
} from "@mui/material";
|
|
1666
|
+
import { ButtonEx as ButtonEx10 } from "@xylabs/react-button";
|
|
1667
|
+
import { PopoverErrorRender as PopoverErrorRender2 } from "@xylabs/react-error";
|
|
1668
|
+
import {
|
|
1669
|
+
assertEx as assertEx2,
|
|
1670
|
+
isDefined as isDefined12,
|
|
1671
|
+
isDefinedNotNull as isDefinedNotNull9
|
|
1672
|
+
} from "@xylabs/sdk-js";
|
|
1673
|
+
import { PayloadBuilder as PayloadBuilder2 } from "@xyo-network/sdk-js";
|
|
1674
|
+
import {
|
|
1675
|
+
asXL1BlockNumber,
|
|
1676
|
+
buildUnsignedTransaction,
|
|
1677
|
+
HashSchema as HashSchema2,
|
|
1678
|
+
SequenceNetwork as SequenceNetwork2
|
|
1679
|
+
} from "@xyo-network/xl1-sdk";
|
|
1680
|
+
import { useCallback as useCallback4, useState as useState13 } from "react";
|
|
1681
|
+
import { jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1682
|
+
var EMPTY_PAYLOADS = [];
|
|
1683
|
+
var SIGNER_PERMISSIONS = [
|
|
1684
|
+
{ xyoWallet_getAccounts: { restrictReturnedAccounts: [] } },
|
|
1685
|
+
{ xyoSigner_address: {} }
|
|
1686
|
+
];
|
|
1687
|
+
var SignTransactionButton = ({
|
|
1688
|
+
anchorOnChain = true,
|
|
1689
|
+
gatewayName = SequenceNetwork2.id,
|
|
1690
|
+
privateReferencedPayloads = EMPTY_PAYLOADS,
|
|
1691
|
+
referencedPayloads = EMPTY_PAYLOADS,
|
|
1692
|
+
timeout,
|
|
1693
|
+
...props
|
|
1694
|
+
}) => {
|
|
1695
|
+
const {
|
|
1696
|
+
gateway,
|
|
1697
|
+
error: gatewayError,
|
|
1698
|
+
timedout
|
|
1699
|
+
} = useGatewayFromWallet(gatewayName, timeout);
|
|
1700
|
+
const [signing, setSigning] = useState13(false);
|
|
1701
|
+
const [signError, setSignError] = useState13();
|
|
1702
|
+
const [signedHash, setSignedHash] = useState13();
|
|
1703
|
+
const signer = gateway?.signer;
|
|
1704
|
+
const viewer = gateway?.connection?.viewer;
|
|
1705
|
+
const canSign = isDefinedNotNull9(signer) && isDefinedNotNull9(viewer) && !signing;
|
|
1706
|
+
const handleSign = useCallback4(async () => {
|
|
1707
|
+
if (!isDefinedNotNull9(gateway)) return;
|
|
1708
|
+
const resolvedSigner = assertEx2(gateway.signer, () => "No signer available on gateway");
|
|
1709
|
+
const resolvedViewer = assertEx2(gateway.connection?.viewer, () => "No viewer available on gateway connection");
|
|
1710
|
+
setSignError(void 0);
|
|
1711
|
+
setSignedHash(void 0);
|
|
1712
|
+
setSigning(true);
|
|
1713
|
+
try {
|
|
1714
|
+
const chain = await resolvedViewer.chainId();
|
|
1715
|
+
const nbf = asXL1BlockNumber(await resolvedViewer.currentBlockNumber(), true);
|
|
1716
|
+
const exp = asXL1BlockNumber(nbf + 10, true);
|
|
1717
|
+
const from = await resolvedSigner.address();
|
|
1718
|
+
const referencedHashes = await PayloadBuilder2.hashes(referencedPayloads);
|
|
1719
|
+
const onChainPayloads = anchorOnChain && isDefined12(referencedHashes[0]) ? [{ schema: HashSchema2, hash: referencedHashes[0] }] : [];
|
|
1720
|
+
let tx = await buildUnsignedTransaction(
|
|
1721
|
+
chain,
|
|
1722
|
+
onChainPayloads,
|
|
1723
|
+
referencedPayloads,
|
|
1724
|
+
nbf,
|
|
1725
|
+
exp,
|
|
1726
|
+
from
|
|
1727
|
+
);
|
|
1728
|
+
if (privateReferencedPayloads.length > 0) {
|
|
1729
|
+
const privateHashes = await PayloadBuilder2.hashes(privateReferencedPayloads);
|
|
1730
|
+
const [bw, payloads] = tx;
|
|
1731
|
+
tx = [
|
|
1732
|
+
{
|
|
1733
|
+
...bw,
|
|
1734
|
+
payload_hashes: [...bw.payload_hashes, ...privateHashes],
|
|
1735
|
+
payload_schemas: [...bw.payload_schemas, ...privateReferencedPayloads.map((payload) => payload.schema)]
|
|
1736
|
+
},
|
|
1737
|
+
payloads
|
|
1738
|
+
];
|
|
1739
|
+
}
|
|
1740
|
+
const [signedBoundWitness] = await resolvedSigner.signTransaction(tx);
|
|
1741
|
+
setSignedHash(await PayloadBuilder2.hash(signedBoundWitness));
|
|
1742
|
+
} catch (e) {
|
|
1743
|
+
setSignError(e);
|
|
1744
|
+
} finally {
|
|
1745
|
+
setSigning(false);
|
|
1746
|
+
}
|
|
1747
|
+
}, [anchorOnChain, gateway, privateReferencedPayloads, referencedPayloads]);
|
|
1748
|
+
return /* @__PURE__ */ jsxs15(
|
|
1749
|
+
Stack15,
|
|
1750
|
+
{
|
|
1751
|
+
...props,
|
|
1752
|
+
sx: {
|
|
1753
|
+
gap: 3,
|
|
1754
|
+
alignItems: "stretch",
|
|
1755
|
+
...props.sx
|
|
1756
|
+
},
|
|
1757
|
+
children: [
|
|
1758
|
+
timedout ? /* @__PURE__ */ jsx15(Alert11, { severity: "warning", children: "Wallet not detected." }) : null,
|
|
1759
|
+
/* @__PURE__ */ jsxs15(Stack15, { sx: { gap: 1 }, children: [
|
|
1760
|
+
/* @__PURE__ */ jsx15(Typography13, { variant: "subtitle2", children: "1. Grant signer + account access" }),
|
|
1761
|
+
/* @__PURE__ */ jsx15(RequestPermissionsButton, { permissions: SIGNER_PERMISSIONS, timeout })
|
|
1762
|
+
] }),
|
|
1763
|
+
/* @__PURE__ */ jsx15(Divider4, {}),
|
|
1764
|
+
/* @__PURE__ */ jsxs15(Stack15, { sx: { gap: 1, alignItems: "start" }, children: [
|
|
1765
|
+
/* @__PURE__ */ jsx15(Typography13, { variant: "subtitle2", children: "2. Sign the transaction" }),
|
|
1766
|
+
/* @__PURE__ */ jsxs15(Typography13, { variant: "caption", sx: { color: "text.secondary" }, children: [
|
|
1767
|
+
"Opens the wallet's Sign page with",
|
|
1768
|
+
" ",
|
|
1769
|
+
anchorOnChain ? "1 on-chain anchor, " : "no on-chain payloads, ",
|
|
1770
|
+
referencedPayloads.length,
|
|
1771
|
+
" ",
|
|
1772
|
+
"referenced, and",
|
|
1773
|
+
" ",
|
|
1774
|
+
privateReferencedPayloads.length,
|
|
1775
|
+
" ",
|
|
1776
|
+
"private referenced payload",
|
|
1777
|
+
privateReferencedPayloads.length === 1 ? "" : "s",
|
|
1778
|
+
". The signed transaction is returned here and not broadcast."
|
|
1779
|
+
] }),
|
|
1780
|
+
/* @__PURE__ */ jsxs15(Stack15, { direction: "row", sx: { gap: 1, alignItems: "center" }, children: [
|
|
1781
|
+
/* @__PURE__ */ jsx15(
|
|
1782
|
+
ButtonEx10,
|
|
1783
|
+
{
|
|
1784
|
+
variant: "contained",
|
|
1785
|
+
size: "small",
|
|
1786
|
+
disabled: !canSign,
|
|
1787
|
+
busy: signing,
|
|
1788
|
+
onClick: () => void handleSign(),
|
|
1789
|
+
children: "Sign transaction"
|
|
1790
|
+
}
|
|
1791
|
+
),
|
|
1792
|
+
/* @__PURE__ */ jsx15(PopoverErrorRender2, { error: gatewayError ?? signError, scope: "SignTransactionButton" })
|
|
1793
|
+
] }),
|
|
1794
|
+
isDefined12(signedHash) ? /* @__PURE__ */ jsxs15(
|
|
1795
|
+
Stack15,
|
|
1796
|
+
{
|
|
1797
|
+
direction: "row",
|
|
1798
|
+
sx: {
|
|
1799
|
+
alignItems: "center",
|
|
1800
|
+
flexWrap: "wrap",
|
|
1801
|
+
gap: 1
|
|
1802
|
+
},
|
|
1803
|
+
children: [
|
|
1804
|
+
/* @__PURE__ */ jsx15(Chip3, { label: "Signed", size: "small", color: "success" }),
|
|
1805
|
+
/* @__PURE__ */ jsx15(Typography13, { variant: "body2", sx: { fontFamily: "monospace", wordBreak: "break-all" }, children: signedHash })
|
|
1806
|
+
]
|
|
1807
|
+
}
|
|
1808
|
+
) : null
|
|
1809
|
+
] })
|
|
1810
|
+
]
|
|
1811
|
+
}
|
|
1812
|
+
);
|
|
1813
|
+
};
|
|
1814
|
+
|
|
1658
1815
|
// src/client/context/GatewayContext.ts
|
|
1659
1816
|
import { createContextEx } from "@xylabs/react-shared";
|
|
1660
1817
|
var GatewayContext = createContextEx();
|
|
@@ -1667,14 +1824,14 @@ var InPageGatewaysContext = createContextEx2();
|
|
|
1667
1824
|
import { DefaultNetworks as DefaultNetworks2 } from "@xyo-network/xl1-sdk";
|
|
1668
1825
|
import {
|
|
1669
1826
|
startTransition,
|
|
1670
|
-
useCallback as
|
|
1827
|
+
useCallback as useCallback5,
|
|
1671
1828
|
useEffect as useEffect5,
|
|
1672
1829
|
useMemo as useMemo5,
|
|
1673
|
-
useState as
|
|
1830
|
+
useState as useState14
|
|
1674
1831
|
} from "react";
|
|
1675
1832
|
|
|
1676
1833
|
// src/client/context/in-page/lib/buildGateway.ts
|
|
1677
|
-
import { assertEx as
|
|
1834
|
+
import { assertEx as assertEx3, isDefined as isDefined13 } from "@xylabs/sdk-js";
|
|
1678
1835
|
import {
|
|
1679
1836
|
basicRemoteRunnerLocator,
|
|
1680
1837
|
basicRemoteViewerLocator,
|
|
@@ -1683,24 +1840,24 @@ import {
|
|
|
1683
1840
|
} from "@xyo-network/xl1-sdk";
|
|
1684
1841
|
var buildGateway = async (gatewayName, signerTransport) => {
|
|
1685
1842
|
const network = DefaultNetworks.find((network2) => network2.id === gatewayName);
|
|
1686
|
-
const resolvedNetwork =
|
|
1843
|
+
const resolvedNetwork = assertEx3(network, () => `No network found for id ${gatewayName}`);
|
|
1687
1844
|
const remoteConfig = {
|
|
1688
1845
|
rpc: {
|
|
1689
1846
|
protocol: "http",
|
|
1690
1847
|
url: `${resolvedNetwork.url}/rpc`
|
|
1691
1848
|
}
|
|
1692
1849
|
};
|
|
1693
|
-
const locator =
|
|
1850
|
+
const locator = isDefined13(signerTransport) ? await basicRemoteRunnerLocator(gatewayName, remoteConfig, signerTransport) : await basicRemoteViewerLocator(gatewayName, remoteConfig);
|
|
1694
1851
|
return await locator.getInstance(XyoGatewayMoniker);
|
|
1695
1852
|
};
|
|
1696
1853
|
|
|
1697
1854
|
// src/client/context/in-page/Provider.tsx
|
|
1698
|
-
import { jsx as
|
|
1855
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1699
1856
|
var InPageGatewaysProvider = ({ signerTransport, children }) => {
|
|
1700
|
-
const [gateways, setGateways] =
|
|
1701
|
-
const [errors, setErrors] =
|
|
1702
|
-
const [previousSignerTransport, setPreviousSignerTransport] =
|
|
1703
|
-
const clearAll =
|
|
1857
|
+
const [gateways, setGateways] = useState14({});
|
|
1858
|
+
const [errors, setErrors] = useState14({});
|
|
1859
|
+
const [previousSignerTransport, setPreviousSignerTransport] = useState14(signerTransport);
|
|
1860
|
+
const clearAll = useCallback5(() => {
|
|
1704
1861
|
setGateways({});
|
|
1705
1862
|
setErrors({});
|
|
1706
1863
|
}, []);
|
|
@@ -1747,7 +1904,7 @@ var InPageGatewaysProvider = ({ signerTransport, children }) => {
|
|
|
1747
1904
|
};
|
|
1748
1905
|
return value2;
|
|
1749
1906
|
}, [clearAll, errors, gateways]);
|
|
1750
|
-
return /* @__PURE__ */
|
|
1907
|
+
return /* @__PURE__ */ jsx16(InPageGatewaysContext, { value, children });
|
|
1751
1908
|
};
|
|
1752
1909
|
|
|
1753
1910
|
// src/client/context/in-page/useProvidedInPageGateways.ts
|
|
@@ -1756,9 +1913,9 @@ var useProvidedInPageGateways = (required = true) => useContextEx(InPageGateways
|
|
|
1756
1913
|
|
|
1757
1914
|
// src/client/context/providers/GatewayProvider.tsx
|
|
1758
1915
|
import { ErrorRender as ErrorRender9 } from "@xylabs/react-error";
|
|
1759
|
-
import { isDefinedNotNull as
|
|
1916
|
+
import { isDefinedNotNull as isDefinedNotNull10, isNull as isNull2 } from "@xylabs/sdk-js";
|
|
1760
1917
|
import { useMemo as useMemo6 } from "react";
|
|
1761
|
-
import { jsx as
|
|
1918
|
+
import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1762
1919
|
var GatewayProvider = ({ gatewayName, children }) => {
|
|
1763
1920
|
const {
|
|
1764
1921
|
gateway: gatewayFromWallet,
|
|
@@ -1780,7 +1937,7 @@ var GatewayProvider = ({ gatewayName, children }) => {
|
|
|
1780
1937
|
walletGateway: null
|
|
1781
1938
|
}
|
|
1782
1939
|
};
|
|
1783
|
-
} else if (
|
|
1940
|
+
} else if (isDefinedNotNull10(gatewayFromWallet)) {
|
|
1784
1941
|
return {
|
|
1785
1942
|
defaultGateway: gatewayFromWallet,
|
|
1786
1943
|
gateways: {
|
|
@@ -1813,8 +1970,8 @@ var GatewayProvider = ({ gatewayName, children }) => {
|
|
|
1813
1970
|
gateways,
|
|
1814
1971
|
clearAll
|
|
1815
1972
|
]);
|
|
1816
|
-
return /* @__PURE__ */
|
|
1817
|
-
/* @__PURE__ */
|
|
1973
|
+
return /* @__PURE__ */ jsxs16(GatewayContext, { value, children: [
|
|
1974
|
+
/* @__PURE__ */ jsx17(ErrorRender9, { error: gatewayFromConfigError }),
|
|
1818
1975
|
children
|
|
1819
1976
|
] });
|
|
1820
1977
|
};
|
|
@@ -1822,7 +1979,7 @@ var GatewayProvider = ({ gatewayName, children }) => {
|
|
|
1822
1979
|
// src/client/context/providers/WalletGatewayProvider.tsx
|
|
1823
1980
|
import { ErrorRender as ErrorRender10 } from "@xylabs/react-error";
|
|
1824
1981
|
import { useMemo as useMemo7 } from "react";
|
|
1825
|
-
import { jsx as
|
|
1982
|
+
import { jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1826
1983
|
var WalletGatewayProvider = ({ gatewayName, children }) => {
|
|
1827
1984
|
const {
|
|
1828
1985
|
gateway: gatewayFromWallet,
|
|
@@ -1850,8 +2007,8 @@ var WalletGatewayProvider = ({ gatewayName, children }) => {
|
|
|
1850
2007
|
gatewayFromWalletError,
|
|
1851
2008
|
gateways
|
|
1852
2009
|
]);
|
|
1853
|
-
return /* @__PURE__ */
|
|
1854
|
-
/* @__PURE__ */
|
|
2010
|
+
return /* @__PURE__ */ jsxs17(GatewayContext, { value, children: [
|
|
2011
|
+
/* @__PURE__ */ jsx18(ErrorRender10, { error: gatewayFromWalletError }),
|
|
1855
2012
|
children
|
|
1856
2013
|
] });
|
|
1857
2014
|
};
|
|
@@ -1861,17 +2018,17 @@ import { useContextEx as useContextEx2 } from "@xylabs/react-shared";
|
|
|
1861
2018
|
var useProvidedGateway = (required = true) => useContextEx2(GatewayContext, "Gateway", required);
|
|
1862
2019
|
|
|
1863
2020
|
// src/model/types/XyoGlobal.ts
|
|
1864
|
-
import { isDefinedNotNull as
|
|
2021
|
+
import { isDefinedNotNull as isDefinedNotNull11, isObject } from "@xylabs/sdk-js";
|
|
1865
2022
|
var isXyoGlobal = (obj) => {
|
|
1866
|
-
return
|
|
2023
|
+
return isDefinedNotNull11(obj) && isObject(obj) && "client" in obj && "connections" in obj && "errors" in obj && "sessionId" in obj && "walletExtensionId" in obj;
|
|
1867
2024
|
};
|
|
1868
2025
|
var isUninitializedXyoGlobal = (obj) => {
|
|
1869
|
-
return
|
|
2026
|
+
return isDefinedNotNull11(obj) && isObject(obj) && "connections" in obj && "sessionId" in obj && "walletExtensionId" in obj && !("client" in obj) && "errors" in obj && Array.isArray(obj.errors) && obj.errors.length === 0;
|
|
1870
2027
|
};
|
|
1871
2028
|
|
|
1872
2029
|
// src/shared/components/menu-item/ActiveMenuItem.tsx
|
|
1873
2030
|
import { MenuItem as MenuItem3, useTheme } from "@mui/material";
|
|
1874
|
-
import { jsx as
|
|
2031
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1875
2032
|
var ActiveMenuItem = ({
|
|
1876
2033
|
active,
|
|
1877
2034
|
children,
|
|
@@ -1879,7 +2036,7 @@ var ActiveMenuItem = ({
|
|
|
1879
2036
|
...props
|
|
1880
2037
|
}) => {
|
|
1881
2038
|
const theme = useTheme();
|
|
1882
|
-
return /* @__PURE__ */
|
|
2039
|
+
return /* @__PURE__ */ jsx19(
|
|
1883
2040
|
MenuItem3,
|
|
1884
2041
|
{
|
|
1885
2042
|
disableRipple: true,
|
|
@@ -1911,14 +2068,14 @@ var ActiveMenuItem = ({
|
|
|
1911
2068
|
|
|
1912
2069
|
// src/shared/components/stack/DetailsStack.tsx
|
|
1913
2070
|
import {
|
|
1914
|
-
Stack as
|
|
2071
|
+
Stack as Stack16,
|
|
1915
2072
|
Tooltip as Tooltip2,
|
|
1916
|
-
Typography as
|
|
2073
|
+
Typography as Typography14,
|
|
1917
2074
|
useTheme as useTheme2
|
|
1918
2075
|
} from "@mui/material";
|
|
1919
|
-
import { isDefined as
|
|
2076
|
+
import { isDefined as isDefined14 } from "@xylabs/sdk-js";
|
|
1920
2077
|
import { useMemo as useMemo8 } from "react";
|
|
1921
|
-
import { jsx as
|
|
2078
|
+
import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1922
2079
|
var isComponentType = (value) => typeof value === "function" || typeof value === "object" && value !== null && ("$$typeof" in value || "render" in value);
|
|
1923
2080
|
var DetailsStack = ({
|
|
1924
2081
|
IconComponent,
|
|
@@ -1928,9 +2085,9 @@ var DetailsStack = ({
|
|
|
1928
2085
|
...props
|
|
1929
2086
|
}) => {
|
|
1930
2087
|
const theme = useTheme2();
|
|
1931
|
-
const hasTooltip =
|
|
2088
|
+
const hasTooltip = isDefined14(tooltipTitle);
|
|
1932
2089
|
const resolvedIconComponent = useMemo8(() => {
|
|
1933
|
-
return isComponentType(IconComponent) ? /* @__PURE__ */
|
|
2090
|
+
return isComponentType(IconComponent) ? /* @__PURE__ */ jsx20(
|
|
1934
2091
|
IconComponent,
|
|
1935
2092
|
{
|
|
1936
2093
|
style: {
|
|
@@ -1942,8 +2099,8 @@ var DetailsStack = ({
|
|
|
1942
2099
|
}
|
|
1943
2100
|
) : IconComponent ?? null;
|
|
1944
2101
|
}, [IconComponent, theme]);
|
|
1945
|
-
return /* @__PURE__ */
|
|
1946
|
-
|
|
2102
|
+
return /* @__PURE__ */ jsxs18(
|
|
2103
|
+
Stack16,
|
|
1947
2104
|
{
|
|
1948
2105
|
direction: "column",
|
|
1949
2106
|
...props,
|
|
@@ -1954,8 +2111,8 @@ var DetailsStack = ({
|
|
|
1954
2111
|
...props.sx
|
|
1955
2112
|
},
|
|
1956
2113
|
children: [
|
|
1957
|
-
/* @__PURE__ */
|
|
1958
|
-
|
|
2114
|
+
/* @__PURE__ */ jsxs18(
|
|
2115
|
+
Typography14,
|
|
1959
2116
|
{
|
|
1960
2117
|
sx: {
|
|
1961
2118
|
display: "flex",
|
|
@@ -1965,7 +2122,7 @@ var DetailsStack = ({
|
|
|
1965
2122
|
},
|
|
1966
2123
|
children: [
|
|
1967
2124
|
heading,
|
|
1968
|
-
hasTooltip ? /* @__PURE__ */
|
|
2125
|
+
hasTooltip ? /* @__PURE__ */ jsx20(Tooltip2, { title: tooltipTitle, children: /* @__PURE__ */ jsx20("span", { children: resolvedIconComponent }) }) : resolvedIconComponent
|
|
1969
2126
|
]
|
|
1970
2127
|
}
|
|
1971
2128
|
),
|
|
@@ -1977,13 +2134,13 @@ var DetailsStack = ({
|
|
|
1977
2134
|
|
|
1978
2135
|
// src/shared/components/stack/LabelValueStack.tsx
|
|
1979
2136
|
import {
|
|
1980
|
-
Stack as
|
|
1981
|
-
Typography as
|
|
2137
|
+
Stack as Stack17,
|
|
2138
|
+
Typography as Typography15,
|
|
1982
2139
|
useTheme as useTheme3
|
|
1983
2140
|
} from "@mui/material";
|
|
1984
2141
|
import { ellipsize } from "@xylabs/sdk-js";
|
|
1985
2142
|
import { isXyoAddress } from "@xyo-network/address";
|
|
1986
|
-
import { jsx as
|
|
2143
|
+
import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1987
2144
|
var LabelValueStack = ({
|
|
1988
2145
|
labels,
|
|
1989
2146
|
values,
|
|
@@ -1996,8 +2153,8 @@ var LabelValueStack = ({
|
|
|
1996
2153
|
}
|
|
1997
2154
|
return value;
|
|
1998
2155
|
};
|
|
1999
|
-
return /* @__PURE__ */
|
|
2000
|
-
|
|
2156
|
+
return /* @__PURE__ */ jsxs19(
|
|
2157
|
+
Stack17,
|
|
2001
2158
|
{
|
|
2002
2159
|
...props,
|
|
2003
2160
|
sx: {
|
|
@@ -2006,8 +2163,8 @@ var LabelValueStack = ({
|
|
|
2006
2163
|
...props.sx
|
|
2007
2164
|
},
|
|
2008
2165
|
children: [
|
|
2009
|
-
/* @__PURE__ */
|
|
2010
|
-
|
|
2166
|
+
/* @__PURE__ */ jsx21(Stack17, { children: labels.map((label) => /* @__PURE__ */ jsxs19(
|
|
2167
|
+
Typography15,
|
|
2011
2168
|
{
|
|
2012
2169
|
variant: "body2",
|
|
2013
2170
|
sx: {
|
|
@@ -2022,15 +2179,15 @@ var LabelValueStack = ({
|
|
|
2022
2179
|
},
|
|
2023
2180
|
label
|
|
2024
2181
|
)) }),
|
|
2025
|
-
/* @__PURE__ */
|
|
2026
|
-
|
|
2182
|
+
/* @__PURE__ */ jsx21(
|
|
2183
|
+
Stack17,
|
|
2027
2184
|
{
|
|
2028
2185
|
sx: {
|
|
2029
2186
|
alignItems: "end",
|
|
2030
2187
|
flexGrow: 1
|
|
2031
2188
|
},
|
|
2032
|
-
children: values.map((value, index) => /* @__PURE__ */
|
|
2033
|
-
|
|
2189
|
+
children: values.map((value, index) => /* @__PURE__ */ jsx21(
|
|
2190
|
+
Typography15,
|
|
2034
2191
|
{
|
|
2035
2192
|
title: value,
|
|
2036
2193
|
variant: "body2",
|
|
@@ -2053,15 +2210,15 @@ var LabelValueStack = ({
|
|
|
2053
2210
|
};
|
|
2054
2211
|
|
|
2055
2212
|
// src/shared/decorators/IframeWalletWarningDecorator.tsx
|
|
2056
|
-
import { Alert as
|
|
2057
|
-
import { jsx as
|
|
2213
|
+
import { Alert as Alert12, Stack as Stack18 } from "@mui/material";
|
|
2214
|
+
import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2058
2215
|
var inIframe = globalThis.self !== window.top;
|
|
2059
2216
|
var IframeWalletWarningDecorator = (Story, args) => {
|
|
2060
2217
|
const hasXyoGlobal = isXyoGlobal(globalThis.xyo);
|
|
2061
|
-
return /* @__PURE__ */
|
|
2062
|
-
inIframe ? /* @__PURE__ */
|
|
2063
|
-
hasXyoGlobal ? null : /* @__PURE__ */
|
|
2064
|
-
/* @__PURE__ */
|
|
2218
|
+
return /* @__PURE__ */ jsxs20(Stack18, { sx: { gap: 2 }, children: [
|
|
2219
|
+
inIframe ? /* @__PURE__ */ jsx22(Alert12, { severity: "warning", children: "This story is running in an iframe. Please run it in a standalone browser window to test the wallet extension." }) : null,
|
|
2220
|
+
hasXyoGlobal ? null : /* @__PURE__ */ jsx22(Alert12, { severity: "warning", children: "No wallet extension found. Please install the Xyo Wallet Chrome Extension." }),
|
|
2221
|
+
/* @__PURE__ */ jsx22(Story, { ...args })
|
|
2065
2222
|
] });
|
|
2066
2223
|
};
|
|
2067
2224
|
export {
|
|
@@ -2087,6 +2244,7 @@ export {
|
|
|
2087
2244
|
LabelValueStack,
|
|
2088
2245
|
PermissionsReviewDialog,
|
|
2089
2246
|
RequestPermissionsButton,
|
|
2247
|
+
SignTransactionButton,
|
|
2090
2248
|
WalletGatewayProvider,
|
|
2091
2249
|
findCaveat,
|
|
2092
2250
|
getXyoClient,
|