@embarkai/ui-kit 0.4.35 → 0.4.36
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/iframe/index.html +1 -1
- package/dist/iframe/main.js +1 -1
- package/dist/index.cjs +165 -165
- package/dist/index.js +157 -157
- package/package.json +1 -1
package/dist/iframe/index.html
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<meta http-equiv="X-Content-Type-Options" content="nosniff" />
|
|
16
16
|
<meta http-equiv="Referrer-Policy" content="strict-origin-when-cross-origin" />
|
|
17
17
|
|
|
18
|
-
<title>EmbarkAI Secure Wallet - iframe version 0.4.
|
|
18
|
+
<title>EmbarkAI Secure Wallet - iframe version 0.4.36</title>
|
|
19
19
|
|
|
20
20
|
<!-- Styles will be injected by build process -->
|
|
21
21
|
<style>
|
package/dist/iframe/main.js
CHANGED
|
@@ -6391,7 +6391,7 @@ var SigningManager = class extends TokenRefreshApiClient {
|
|
|
6391
6391
|
};
|
|
6392
6392
|
|
|
6393
6393
|
// src/iframe/main.ts
|
|
6394
|
-
var IFRAME_VERSION = "0.4.
|
|
6394
|
+
var IFRAME_VERSION = "0.4.36";
|
|
6395
6395
|
var IframeWallet = class {
|
|
6396
6396
|
constructor() {
|
|
6397
6397
|
console.log("=".repeat(60));
|
package/dist/index.cjs
CHANGED
|
@@ -19228,7 +19228,8 @@ var init_useBridgeStore = __esm({
|
|
|
19228
19228
|
});
|
|
19229
19229
|
|
|
19230
19230
|
// src/internal/components/SendMenu/hyperbridge/components/SenderSelector.tsx
|
|
19231
|
-
function SenderSelector() {
|
|
19231
|
+
function SenderSelector(props) {
|
|
19232
|
+
const { profiles } = props;
|
|
19232
19233
|
const { t } = useT();
|
|
19233
19234
|
const config = useProviderConfig().config;
|
|
19234
19235
|
const { signMessageAsync } = (0, import_wagmi.useSignMessage)();
|
|
@@ -19236,7 +19237,6 @@ function SenderSelector() {
|
|
|
19236
19237
|
const directWalletAddress = useExternalWalletStore((st) => st.externalAddress);
|
|
19237
19238
|
const directWalletIsConnected = useExternalWalletStore((st) => st.isExternalConnected);
|
|
19238
19239
|
const pendingWalletRef = (0, import_react61.useRef)(null);
|
|
19239
|
-
const { profiles } = useLinkedProfiles();
|
|
19240
19240
|
const originChain = useBridgeStore((st) => st.originChain);
|
|
19241
19241
|
const bridgeSender = useBridgeStore((st) => st.bridgeSender);
|
|
19242
19242
|
const bridgeSenders = useBridgeStore((st) => st.bridgeSenders);
|
|
@@ -19380,7 +19380,6 @@ var init_SenderSelector = __esm({
|
|
|
19380
19380
|
"src/internal/components/SendMenu/hyperbridge/components/SenderSelector.tsx"() {
|
|
19381
19381
|
init_ProviderContext();
|
|
19382
19382
|
init_i18n();
|
|
19383
|
-
init_linkedProfiles();
|
|
19384
19383
|
import_rainbowkit = require("@rainbow-me/rainbowkit");
|
|
19385
19384
|
import_react_query42 = require("@tanstack/react-query");
|
|
19386
19385
|
import_react61 = require("react");
|
|
@@ -19397,6 +19396,151 @@ var init_SenderSelector = __esm({
|
|
|
19397
19396
|
}
|
|
19398
19397
|
});
|
|
19399
19398
|
|
|
19399
|
+
// src/internal/assets/wallets/MetaMaskIcon.tsx
|
|
19400
|
+
function MetaMaskIcon(props) {
|
|
19401
|
+
const { width = "24", height = "24", ...svgProps } = props;
|
|
19402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
19403
|
+
"svg",
|
|
19404
|
+
{
|
|
19405
|
+
...svgProps,
|
|
19406
|
+
width,
|
|
19407
|
+
height,
|
|
19408
|
+
version: "1.1",
|
|
19409
|
+
id: "Layer_1",
|
|
19410
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
19411
|
+
x: "0px",
|
|
19412
|
+
y: "0px",
|
|
19413
|
+
viewBox: "0 0 142 136.878",
|
|
19414
|
+
style: {
|
|
19415
|
+
// enableBackground: 'new 0 0 142 136.878',
|
|
19416
|
+
flexShrink: 0
|
|
19417
|
+
},
|
|
19418
|
+
xmlSpace: "preserve",
|
|
19419
|
+
children: [
|
|
19420
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
19421
|
+
"path",
|
|
19422
|
+
{
|
|
19423
|
+
fill: "#FF5C16",
|
|
19424
|
+
d: "M132.682,132.192l-30.583-9.106l-23.063,13.787l-16.092-0.007l-23.077-13.78l-30.569,9.106L0,100.801\n l9.299-34.839L0,36.507L9.299,0l47.766,28.538h27.85L132.682,0l9.299,36.507l-9.299,29.455l9.299,34.839L132.682,132.192\n L132.682,132.192z"
|
|
19425
|
+
}
|
|
19426
|
+
),
|
|
19427
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
19428
|
+
"path",
|
|
19429
|
+
{
|
|
19430
|
+
fill: "#FF5C16",
|
|
19431
|
+
d: "M9.305,0l47.767,28.558l-1.899,19.599L9.305,0z M39.875,100.814l21.017,16.01l-21.017,6.261\n C39.875,123.085,39.875,100.814,39.875,100.814z M59.212,74.345l-4.039-26.174L29.317,65.97l-0.014-0.007v0.013l0.08,18.321\n l10.485-9.951L59.212,74.345L59.212,74.345z M132.682,0L84.915,28.558l1.893,19.599L132.682,0z M102.113,100.814l-21.018,16.01\n l21.018,6.261V100.814z M112.678,65.975h0.007H112.678v-0.013l-0.006,0.007L86.815,48.171l-4.039,26.174h19.336l10.492,9.95\n C112.604,84.295,112.678,65.975,112.678,65.975z"
|
|
19432
|
+
}
|
|
19433
|
+
),
|
|
19434
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
19435
|
+
"path",
|
|
19436
|
+
{
|
|
19437
|
+
fill: "#E34807",
|
|
19438
|
+
d: "M39.868,123.085l-30.569,9.106L0,100.814h39.868C39.868,100.814,39.868,123.085,39.868,123.085z\n M59.205,74.338l5.839,37.84l-8.093-21.04L29.37,84.295l10.491-9.956h19.344L59.205,74.338z M102.112,123.085l30.57,9.106\n l9.299-31.378h-39.869C102.112,100.814,102.112,123.085,102.112,123.085z M82.776,74.338l-5.839,37.84l8.092-21.04l27.583-6.843\n l-10.498-9.956H82.776V74.338z"
|
|
19439
|
+
}
|
|
19440
|
+
),
|
|
19441
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
19442
|
+
"path",
|
|
19443
|
+
{
|
|
19444
|
+
fill: "#FF8D5D",
|
|
19445
|
+
d: "M0,100.801l9.299-34.839h19.997l0.073,18.327l27.584,6.843l8.092,21.039l-4.16,4.633l-21.017-16.01H0\n V100.801z M141.981,100.801l-9.299-34.839h-19.998l-0.073,18.327l-27.582,6.843l-8.093,21.039l4.159,4.633l21.018-16.01h39.868\n V100.801z M84.915,28.538h-27.85l-1.891,19.599l9.872,64.013h11.891l9.878-64.013L84.915,28.538z"
|
|
19446
|
+
}
|
|
19447
|
+
),
|
|
19448
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
19449
|
+
"path",
|
|
19450
|
+
{
|
|
19451
|
+
fill: "#661800",
|
|
19452
|
+
d: "M9.299,0L0,36.507l9.299,29.455h19.997l25.87-17.804L9.299,0z M53.426,81.938h-9.059l-4.932,4.835\n l17.524,4.344l-3.533-9.186V81.938z M132.682,0l9.299,36.507l-9.299,29.455h-19.998L86.815,48.158L132.682,0z M88.568,81.938h9.072\n l4.932,4.841l-17.544,4.353l3.54-9.201V81.938z M79.029,124.385l2.067-7.567l-4.16-4.633h-11.9l-4.159,4.633l2.066,7.567"
|
|
19453
|
+
}
|
|
19454
|
+
),
|
|
19455
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
19456
|
+
"path",
|
|
19457
|
+
{
|
|
19458
|
+
fill: "#C0C4CD",
|
|
19459
|
+
d: "M79.029,124.384v12.495H62.945v-12.495L79.029,124.384L79.029,124.384z"
|
|
19460
|
+
}
|
|
19461
|
+
),
|
|
19462
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
19463
|
+
"path",
|
|
19464
|
+
{
|
|
19465
|
+
fill: "#E7EBF6",
|
|
19466
|
+
d: "M39.875,123.072l23.083,13.8v-12.495l-2.067-7.566C60.891,116.811,39.875,123.072,39.875,123.072z\n M102.113,123.072l-23.084,13.8v-12.495l2.067-7.566C81.096,116.811,102.113,123.072,102.113,123.072z"
|
|
19467
|
+
}
|
|
19468
|
+
)
|
|
19469
|
+
]
|
|
19470
|
+
}
|
|
19471
|
+
);
|
|
19472
|
+
}
|
|
19473
|
+
var import_jsx_runtime90;
|
|
19474
|
+
var init_MetaMaskIcon = __esm({
|
|
19475
|
+
"src/internal/assets/wallets/MetaMaskIcon.tsx"() {
|
|
19476
|
+
import_jsx_runtime90 = require("react/jsx-runtime");
|
|
19477
|
+
}
|
|
19478
|
+
});
|
|
19479
|
+
|
|
19480
|
+
// src/internal/assets/wallets/index.tsx
|
|
19481
|
+
var import_lucide_react58, import_jsx_runtime91, WALLET_ICONS;
|
|
19482
|
+
var init_wallets = __esm({
|
|
19483
|
+
"src/internal/assets/wallets/index.tsx"() {
|
|
19484
|
+
import_lucide_react58 = require("lucide-react");
|
|
19485
|
+
init_MetaMaskIcon();
|
|
19486
|
+
import_jsx_runtime91 = require("react/jsx-runtime");
|
|
19487
|
+
WALLET_ICONS = {
|
|
19488
|
+
metamask: MetaMaskIcon,
|
|
19489
|
+
default: (props) => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_lucide_react58.Wallet2Icon, { ...props })
|
|
19490
|
+
};
|
|
19491
|
+
}
|
|
19492
|
+
});
|
|
19493
|
+
|
|
19494
|
+
// src/internal/components/SendMenu/hyperbridge/hooks/useAvailableSenders.ts
|
|
19495
|
+
function useAvailableSenders() {
|
|
19496
|
+
const address = useSession((st) => st.address);
|
|
19497
|
+
const activeChainId = useSession((st) => st.activeChainId);
|
|
19498
|
+
const { profiles } = useLinkedProfiles();
|
|
19499
|
+
const walletProfiles = profiles.filter((p) => p.provider === "wallet");
|
|
19500
|
+
const lastCalcedSenders = (0, import_react62.useRef)([]);
|
|
19501
|
+
(0, import_react62.useEffect)(() => {
|
|
19502
|
+
const sendersAccumulator = [
|
|
19503
|
+
{
|
|
19504
|
+
type: "embarkai-wallet",
|
|
19505
|
+
name: "embarkAI",
|
|
19506
|
+
chainId: activeChainId,
|
|
19507
|
+
address,
|
|
19508
|
+
Icon: TOKENS_ICONS["EMBARKAI"]
|
|
19509
|
+
}
|
|
19510
|
+
];
|
|
19511
|
+
if (!!walletProfiles.length) {
|
|
19512
|
+
walletProfiles.forEach((wProfile) => {
|
|
19513
|
+
sendersAccumulator.push({
|
|
19514
|
+
type: "direct-wallet",
|
|
19515
|
+
name: wProfile?.meta?.walletName || "External wallet",
|
|
19516
|
+
chainId: null,
|
|
19517
|
+
address: wProfile?.externalId,
|
|
19518
|
+
Icon: WALLET_ICONS[wProfile?.meta?.walletName?.toLowerCase()] || WALLET_ICONS["default"]
|
|
19519
|
+
});
|
|
19520
|
+
});
|
|
19521
|
+
}
|
|
19522
|
+
if (sendersAccumulator.map((s) => `${s.name}-${s.address}`).join(",") === lastCalcedSenders.current.join(",")) {
|
|
19523
|
+
return;
|
|
19524
|
+
}
|
|
19525
|
+
lastCalcedSenders.current = sendersAccumulator.map((s) => `${s.name}-${s.address}`);
|
|
19526
|
+
useBridgeStore.getState().setBridgeSenders(sendersAccumulator);
|
|
19527
|
+
useFlowSelectorStore.getState().setRenderKey(`sender-selected-${Date.now()}`);
|
|
19528
|
+
}, [address, walletProfiles, activeChainId]);
|
|
19529
|
+
return { profiles: walletProfiles };
|
|
19530
|
+
}
|
|
19531
|
+
var import_react62;
|
|
19532
|
+
var init_useAvailableSenders = __esm({
|
|
19533
|
+
"src/internal/components/SendMenu/hyperbridge/hooks/useAvailableSenders.ts"() {
|
|
19534
|
+
init_SessionContext();
|
|
19535
|
+
init_tokens();
|
|
19536
|
+
init_linkedProfiles();
|
|
19537
|
+
import_react62 = require("react");
|
|
19538
|
+
init_wallets();
|
|
19539
|
+
init_useFlowSelector();
|
|
19540
|
+
init_useBridgeStore();
|
|
19541
|
+
}
|
|
19542
|
+
});
|
|
19543
|
+
|
|
19400
19544
|
// src/internal/components/SendMenu/hyperbridge/api.ts
|
|
19401
19545
|
function iframe3() {
|
|
19402
19546
|
const accessToken = import_auth20.jwtTokenManager.getAccessToken();
|
|
@@ -19576,7 +19720,7 @@ function useBridge() {
|
|
|
19576
19720
|
const address = useSession((st) => st.address);
|
|
19577
19721
|
const { data: walletClient } = (0, import_wagmi2.useWalletClient)();
|
|
19578
19722
|
const { switchChainAsync } = (0, import_wagmi2.useSwitchChain)();
|
|
19579
|
-
const swapDirection = (0,
|
|
19723
|
+
const swapDirection = (0, import_react63.useCallback)(() => {
|
|
19580
19724
|
const {
|
|
19581
19725
|
bridgeStep,
|
|
19582
19726
|
originChain,
|
|
@@ -19629,7 +19773,7 @@ function useBridge() {
|
|
|
19629
19773
|
useFlowSelectorStore.getState().setError(error instanceof Error ? error.message : String(error));
|
|
19630
19774
|
}
|
|
19631
19775
|
});
|
|
19632
|
-
const handleQuoteEstimation = (0,
|
|
19776
|
+
const handleQuoteEstimation = (0, import_react63.useCallback)((amnt) => {
|
|
19633
19777
|
const { originChain, destinationChain, bridgeSender } = useBridgeStore.getState();
|
|
19634
19778
|
if (!amnt || !Number(amnt)) {
|
|
19635
19779
|
useBridgeStore.getState().setQuote(null);
|
|
@@ -19755,14 +19899,14 @@ function useBridge() {
|
|
|
19755
19899
|
isAssetBridging
|
|
19756
19900
|
};
|
|
19757
19901
|
}
|
|
19758
|
-
var import_react_query43,
|
|
19902
|
+
var import_react_query43, import_react63, import_wagmi2;
|
|
19759
19903
|
var init_useBridge = __esm({
|
|
19760
19904
|
"src/internal/components/SendMenu/hyperbridge/hooks/useBridge.ts"() {
|
|
19761
19905
|
init_SessionContext();
|
|
19762
19906
|
init_i18n();
|
|
19763
19907
|
init_useExternalWalletStore();
|
|
19764
19908
|
import_react_query43 = require("@tanstack/react-query");
|
|
19765
|
-
|
|
19909
|
+
import_react63 = require("react");
|
|
19766
19910
|
import_wagmi2 = require("wagmi");
|
|
19767
19911
|
init_useLayoutStore();
|
|
19768
19912
|
init_useFlowSelector();
|
|
@@ -19791,7 +19935,7 @@ function useHyperlaneRoutes() {
|
|
|
19791
19935
|
queryKey: [HYPERLANE_WARP_ROUTES_QUERY_KEY, address],
|
|
19792
19936
|
queryFn: async () => getHyperlaneWarpRoutes()
|
|
19793
19937
|
});
|
|
19794
|
-
(0,
|
|
19938
|
+
(0, import_react64.useEffect)(() => {
|
|
19795
19939
|
if (!errorWarpRoutes) return;
|
|
19796
19940
|
useFlowSelectorStore.getState().setError(errorWarpRoutes.message);
|
|
19797
19941
|
const { resetSelections, setRecipient, setOriginChain, setDestinationChain } = useBridgeStore.getState();
|
|
@@ -19800,7 +19944,7 @@ function useHyperlaneRoutes() {
|
|
|
19800
19944
|
setOriginChain(null);
|
|
19801
19945
|
setDestinationChain(null);
|
|
19802
19946
|
}, [errorWarpRoutes]);
|
|
19803
|
-
(0,
|
|
19947
|
+
(0, import_react64.useEffect)(() => {
|
|
19804
19948
|
if (!!hyperRoute || !hyperlaneWarpRoutes.length) return;
|
|
19805
19949
|
const warpRouteToAutoSelect = hyperlaneWarpRoutes.find((route) => route.routeId === hyperRoute);
|
|
19806
19950
|
if (!warpRouteToAutoSelect) return;
|
|
@@ -19819,12 +19963,12 @@ function useHyperlaneRoutes() {
|
|
|
19819
19963
|
}, [hyperRoute, hyperlaneWarpRoutes]);
|
|
19820
19964
|
return { hyperlaneWarpRoutes, isLoadingWarpRoutes };
|
|
19821
19965
|
}
|
|
19822
|
-
var import_react_query44,
|
|
19966
|
+
var import_react_query44, import_react64, HYPERLANE_WARP_ROUTES_QUERY_KEY;
|
|
19823
19967
|
var init_useHyperlaneRoutes = __esm({
|
|
19824
19968
|
"src/internal/components/SendMenu/hyperbridge/hooks/useHyperlaneRoutes.ts"() {
|
|
19825
19969
|
init_SessionContext();
|
|
19826
19970
|
import_react_query44 = require("@tanstack/react-query");
|
|
19827
|
-
|
|
19971
|
+
import_react64 = require("react");
|
|
19828
19972
|
init_useLayoutDataStore();
|
|
19829
19973
|
init_useFlowSelector();
|
|
19830
19974
|
init_api3();
|
|
@@ -19840,7 +19984,7 @@ function useMenuTitle(warpRoutes) {
|
|
|
19840
19984
|
const bridgeStep = useBridgeStore((st) => st.bridgeStep);
|
|
19841
19985
|
const hyperRoute = useBridgeStore((st) => st.hyperRoute);
|
|
19842
19986
|
const hyperRouteMeta = warpRoutes?.length ? warpRoutes.find((route) => route.routeId === hyperRoute) : null;
|
|
19843
|
-
(0,
|
|
19987
|
+
(0, import_react65.useEffect)(() => {
|
|
19844
19988
|
const updateMenuTitle = useFlowSelectorStore.getState().setMenuTitle;
|
|
19845
19989
|
switch (true) {
|
|
19846
19990
|
case bridgeStep === "sender-selector":
|
|
@@ -19868,11 +20012,11 @@ function useMenuTitle(warpRoutes) {
|
|
|
19868
20012
|
}
|
|
19869
20013
|
}, [bridgeStep, hyperRouteMeta, t]);
|
|
19870
20014
|
}
|
|
19871
|
-
var
|
|
20015
|
+
var import_react65;
|
|
19872
20016
|
var init_useMenuTitle = __esm({
|
|
19873
20017
|
"src/internal/components/SendMenu/hyperbridge/hooks/useMenuTitle.ts"() {
|
|
19874
20018
|
init_i18n();
|
|
19875
|
-
|
|
20019
|
+
import_react65 = require("react");
|
|
19876
20020
|
init_useFlowSelector();
|
|
19877
20021
|
init_useBridgeStore();
|
|
19878
20022
|
}
|
|
@@ -19881,158 +20025,14 @@ var init_useMenuTitle = __esm({
|
|
|
19881
20025
|
// src/internal/components/SendMenu/hyperbridge/components/ResolveChainIcon.tsx
|
|
19882
20026
|
function ResolveChainIcon(props) {
|
|
19883
20027
|
const Icon2 = CHAINS_UI_META[props.chainName]?.Icon || TOKENS_ICONS.EMBARKAI;
|
|
19884
|
-
return /* @__PURE__ */ (0,
|
|
20028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Icon2, { className: props.className || "w-4 h-4" });
|
|
19885
20029
|
}
|
|
19886
|
-
var
|
|
20030
|
+
var import_jsx_runtime92;
|
|
19887
20031
|
var init_ResolveChainIcon = __esm({
|
|
19888
20032
|
"src/internal/components/SendMenu/hyperbridge/components/ResolveChainIcon.tsx"() {
|
|
19889
20033
|
init_tokens();
|
|
19890
20034
|
init_chains();
|
|
19891
|
-
import_jsx_runtime90 = require("react/jsx-runtime");
|
|
19892
|
-
}
|
|
19893
|
-
});
|
|
19894
|
-
|
|
19895
|
-
// src/internal/assets/wallets/MetaMaskIcon.tsx
|
|
19896
|
-
function MetaMaskIcon(props) {
|
|
19897
|
-
const { width = "24", height = "24", ...svgProps } = props;
|
|
19898
|
-
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(
|
|
19899
|
-
"svg",
|
|
19900
|
-
{
|
|
19901
|
-
...svgProps,
|
|
19902
|
-
width,
|
|
19903
|
-
height,
|
|
19904
|
-
version: "1.1",
|
|
19905
|
-
id: "Layer_1",
|
|
19906
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
19907
|
-
x: "0px",
|
|
19908
|
-
y: "0px",
|
|
19909
|
-
viewBox: "0 0 142 136.878",
|
|
19910
|
-
style: {
|
|
19911
|
-
// enableBackground: 'new 0 0 142 136.878',
|
|
19912
|
-
flexShrink: 0
|
|
19913
|
-
},
|
|
19914
|
-
xmlSpace: "preserve",
|
|
19915
|
-
children: [
|
|
19916
|
-
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
19917
|
-
"path",
|
|
19918
|
-
{
|
|
19919
|
-
fill: "#FF5C16",
|
|
19920
|
-
d: "M132.682,132.192l-30.583-9.106l-23.063,13.787l-16.092-0.007l-23.077-13.78l-30.569,9.106L0,100.801\n l9.299-34.839L0,36.507L9.299,0l47.766,28.538h27.85L132.682,0l9.299,36.507l-9.299,29.455l9.299,34.839L132.682,132.192\n L132.682,132.192z"
|
|
19921
|
-
}
|
|
19922
|
-
),
|
|
19923
|
-
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
19924
|
-
"path",
|
|
19925
|
-
{
|
|
19926
|
-
fill: "#FF5C16",
|
|
19927
|
-
d: "M9.305,0l47.767,28.558l-1.899,19.599L9.305,0z M39.875,100.814l21.017,16.01l-21.017,6.261\n C39.875,123.085,39.875,100.814,39.875,100.814z M59.212,74.345l-4.039-26.174L29.317,65.97l-0.014-0.007v0.013l0.08,18.321\n l10.485-9.951L59.212,74.345L59.212,74.345z M132.682,0L84.915,28.558l1.893,19.599L132.682,0z M102.113,100.814l-21.018,16.01\n l21.018,6.261V100.814z M112.678,65.975h0.007H112.678v-0.013l-0.006,0.007L86.815,48.171l-4.039,26.174h19.336l10.492,9.95\n C112.604,84.295,112.678,65.975,112.678,65.975z"
|
|
19928
|
-
}
|
|
19929
|
-
),
|
|
19930
|
-
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
19931
|
-
"path",
|
|
19932
|
-
{
|
|
19933
|
-
fill: "#E34807",
|
|
19934
|
-
d: "M39.868,123.085l-30.569,9.106L0,100.814h39.868C39.868,100.814,39.868,123.085,39.868,123.085z\n M59.205,74.338l5.839,37.84l-8.093-21.04L29.37,84.295l10.491-9.956h19.344L59.205,74.338z M102.112,123.085l30.57,9.106\n l9.299-31.378h-39.869C102.112,100.814,102.112,123.085,102.112,123.085z M82.776,74.338l-5.839,37.84l8.092-21.04l27.583-6.843\n l-10.498-9.956H82.776V74.338z"
|
|
19935
|
-
}
|
|
19936
|
-
),
|
|
19937
|
-
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
19938
|
-
"path",
|
|
19939
|
-
{
|
|
19940
|
-
fill: "#FF8D5D",
|
|
19941
|
-
d: "M0,100.801l9.299-34.839h19.997l0.073,18.327l27.584,6.843l8.092,21.039l-4.16,4.633l-21.017-16.01H0\n V100.801z M141.981,100.801l-9.299-34.839h-19.998l-0.073,18.327l-27.582,6.843l-8.093,21.039l4.159,4.633l21.018-16.01h39.868\n V100.801z M84.915,28.538h-27.85l-1.891,19.599l9.872,64.013h11.891l9.878-64.013L84.915,28.538z"
|
|
19942
|
-
}
|
|
19943
|
-
),
|
|
19944
|
-
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
19945
|
-
"path",
|
|
19946
|
-
{
|
|
19947
|
-
fill: "#661800",
|
|
19948
|
-
d: "M9.299,0L0,36.507l9.299,29.455h19.997l25.87-17.804L9.299,0z M53.426,81.938h-9.059l-4.932,4.835\n l17.524,4.344l-3.533-9.186V81.938z M132.682,0l9.299,36.507l-9.299,29.455h-19.998L86.815,48.158L132.682,0z M88.568,81.938h9.072\n l4.932,4.841l-17.544,4.353l3.54-9.201V81.938z M79.029,124.385l2.067-7.567l-4.16-4.633h-11.9l-4.159,4.633l2.066,7.567"
|
|
19949
|
-
}
|
|
19950
|
-
),
|
|
19951
|
-
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
19952
|
-
"path",
|
|
19953
|
-
{
|
|
19954
|
-
fill: "#C0C4CD",
|
|
19955
|
-
d: "M79.029,124.384v12.495H62.945v-12.495L79.029,124.384L79.029,124.384z"
|
|
19956
|
-
}
|
|
19957
|
-
),
|
|
19958
|
-
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
19959
|
-
"path",
|
|
19960
|
-
{
|
|
19961
|
-
fill: "#E7EBF6",
|
|
19962
|
-
d: "M39.875,123.072l23.083,13.8v-12.495l-2.067-7.566C60.891,116.811,39.875,123.072,39.875,123.072z\n M102.113,123.072l-23.084,13.8v-12.495l2.067-7.566C81.096,116.811,102.113,123.072,102.113,123.072z"
|
|
19963
|
-
}
|
|
19964
|
-
)
|
|
19965
|
-
]
|
|
19966
|
-
}
|
|
19967
|
-
);
|
|
19968
|
-
}
|
|
19969
|
-
var import_jsx_runtime91;
|
|
19970
|
-
var init_MetaMaskIcon = __esm({
|
|
19971
|
-
"src/internal/assets/wallets/MetaMaskIcon.tsx"() {
|
|
19972
|
-
import_jsx_runtime91 = require("react/jsx-runtime");
|
|
19973
|
-
}
|
|
19974
|
-
});
|
|
19975
|
-
|
|
19976
|
-
// src/internal/assets/wallets/index.tsx
|
|
19977
|
-
var import_lucide_react58, import_jsx_runtime92, WALLET_ICONS;
|
|
19978
|
-
var init_wallets = __esm({
|
|
19979
|
-
"src/internal/assets/wallets/index.tsx"() {
|
|
19980
|
-
import_lucide_react58 = require("lucide-react");
|
|
19981
|
-
init_MetaMaskIcon();
|
|
19982
20035
|
import_jsx_runtime92 = require("react/jsx-runtime");
|
|
19983
|
-
WALLET_ICONS = {
|
|
19984
|
-
metamask: MetaMaskIcon,
|
|
19985
|
-
default: (props) => /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_lucide_react58.Wallet2Icon, { ...props })
|
|
19986
|
-
};
|
|
19987
|
-
}
|
|
19988
|
-
});
|
|
19989
|
-
|
|
19990
|
-
// src/internal/components/SendMenu/hyperbridge/hooks/useAvailableSenders.ts
|
|
19991
|
-
function useAvailableSenders() {
|
|
19992
|
-
const address = useSession((st) => st.address);
|
|
19993
|
-
const activeChainId = useSession((st) => st.activeChainId);
|
|
19994
|
-
const { profiles } = useLinkedProfiles();
|
|
19995
|
-
const walletProfiles = profiles.filter((p) => p.provider === "wallet");
|
|
19996
|
-
const lastCalcedSenders = (0, import_react65.useRef)([]);
|
|
19997
|
-
(0, import_react65.useEffect)(() => {
|
|
19998
|
-
const sendersAccumulator = [
|
|
19999
|
-
{
|
|
20000
|
-
type: "embarkai-wallet",
|
|
20001
|
-
name: "embarkAI",
|
|
20002
|
-
chainId: activeChainId,
|
|
20003
|
-
address,
|
|
20004
|
-
Icon: TOKENS_ICONS["EMBARKAI"]
|
|
20005
|
-
}
|
|
20006
|
-
];
|
|
20007
|
-
if (!!walletProfiles.length) {
|
|
20008
|
-
walletProfiles.forEach((wProfile) => {
|
|
20009
|
-
sendersAccumulator.push({
|
|
20010
|
-
type: "direct-wallet",
|
|
20011
|
-
name: wProfile?.meta?.walletName || "External wallet",
|
|
20012
|
-
chainId: null,
|
|
20013
|
-
address: wProfile?.externalId,
|
|
20014
|
-
Icon: WALLET_ICONS[wProfile?.meta?.walletName?.toLowerCase()] || WALLET_ICONS["default"]
|
|
20015
|
-
});
|
|
20016
|
-
});
|
|
20017
|
-
}
|
|
20018
|
-
if (sendersAccumulator.map((s) => `${s.name}-${s.address}`).join(",") === lastCalcedSenders.current.join(",")) {
|
|
20019
|
-
return;
|
|
20020
|
-
}
|
|
20021
|
-
lastCalcedSenders.current = sendersAccumulator.map((s) => `${s.name}-${s.address}`);
|
|
20022
|
-
useBridgeStore.getState().setBridgeSenders(sendersAccumulator);
|
|
20023
|
-
useFlowSelectorStore.getState().setRenderKey(`sender-selected-${Date.now()}`);
|
|
20024
|
-
}, [address, walletProfiles, activeChainId]);
|
|
20025
|
-
}
|
|
20026
|
-
var import_react65;
|
|
20027
|
-
var init_useAvailableSenders = __esm({
|
|
20028
|
-
"src/internal/components/SendMenu/hyperbridge/hooks/useAvailableSenders.ts"() {
|
|
20029
|
-
init_SessionContext();
|
|
20030
|
-
init_tokens();
|
|
20031
|
-
init_linkedProfiles();
|
|
20032
|
-
import_react65 = require("react");
|
|
20033
|
-
init_wallets();
|
|
20034
|
-
init_useFlowSelector();
|
|
20035
|
-
init_useBridgeStore();
|
|
20036
20036
|
}
|
|
20037
20037
|
});
|
|
20038
20038
|
|
|
@@ -20200,7 +20200,6 @@ function SelectStep(props) {
|
|
|
20200
20200
|
setAmount,
|
|
20201
20201
|
setRecipient
|
|
20202
20202
|
} = useBridgeStore();
|
|
20203
|
-
useAvailableSenders();
|
|
20204
20203
|
const selectedSender = useBridgeStore((st) => st.bridgeSenders.find((s) => s.type === st.bridgeSender));
|
|
20205
20204
|
const { routeTokenBalance, isRouteTokenBalanceLoading } = useBridgeBalance(hyperlaneWarpRoutes);
|
|
20206
20205
|
const selectedWarpRoute = hyperlaneWarpRoutes.find((route) => {
|
|
@@ -20440,7 +20439,6 @@ var init_SelectStep = __esm({
|
|
|
20440
20439
|
init_input();
|
|
20441
20440
|
init_useFlowSelector();
|
|
20442
20441
|
init_ResolveChainIcon();
|
|
20443
|
-
init_useAvailableSenders();
|
|
20444
20442
|
init_useBridgeBalance();
|
|
20445
20443
|
init_chains();
|
|
20446
20444
|
init_useBridgeStore();
|
|
@@ -20736,7 +20734,7 @@ var init_useHyperlaneHistory = __esm({
|
|
|
20736
20734
|
init_api3();
|
|
20737
20735
|
init_useBridgeStore();
|
|
20738
20736
|
HYPERLANE_HISTORY_QUERY_KEY = "hyperlane-tx-history-query-key";
|
|
20739
|
-
TX_HISTORY_PAGE_SIZE =
|
|
20737
|
+
TX_HISTORY_PAGE_SIZE = 6;
|
|
20740
20738
|
TX_HISTORY_POLLING_INTERVAL = 1e3 * 45;
|
|
20741
20739
|
}
|
|
20742
20740
|
});
|
|
@@ -21126,6 +21124,7 @@ function HyperlaneBridge() {
|
|
|
21126
21124
|
const bridgeStep = useBridgeStore((st) => st.bridgeStep);
|
|
21127
21125
|
const { swapDirection, handleQuoteEstimation, bridgeAsset, isAssetBridging } = useBridge();
|
|
21128
21126
|
const { hyperlaneWarpRoutes, isLoadingWarpRoutes } = useHyperlaneRoutes();
|
|
21127
|
+
const { profiles } = useAvailableSenders();
|
|
21129
21128
|
useMenuTitle(hyperlaneWarpRoutes);
|
|
21130
21129
|
(0, import_react71.useEffect)(
|
|
21131
21130
|
() => () => {
|
|
@@ -21134,7 +21133,7 @@ function HyperlaneBridge() {
|
|
|
21134
21133
|
[]
|
|
21135
21134
|
);
|
|
21136
21135
|
return /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(import_jsx_runtime99.Fragment, { children: [
|
|
21137
|
-
bridgeStep === "sender-selector" && /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(SenderSelector, {}),
|
|
21136
|
+
bridgeStep === "sender-selector" && /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(SenderSelector, { profiles }),
|
|
21138
21137
|
bridgeStep === "select" && /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
21139
21138
|
SelectStep,
|
|
21140
21139
|
{
|
|
@@ -21166,6 +21165,7 @@ var init_HyperlaneBridge = __esm({
|
|
|
21166
21165
|
"src/internal/components/SendMenu/hyperbridge/HyperlaneBridge.tsx"() {
|
|
21167
21166
|
import_react71 = require("react");
|
|
21168
21167
|
init_SenderSelector();
|
|
21168
|
+
init_useAvailableSenders();
|
|
21169
21169
|
init_useBridge();
|
|
21170
21170
|
init_useHyperlaneRoutes();
|
|
21171
21171
|
init_useMenuTitle();
|
|
@@ -24106,7 +24106,7 @@ var init_package = __esm({
|
|
|
24106
24106
|
"package.json"() {
|
|
24107
24107
|
package_default = {
|
|
24108
24108
|
name: "@embarkai/ui-kit",
|
|
24109
|
-
version: "0.4.
|
|
24109
|
+
version: "0.4.36",
|
|
24110
24110
|
description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
|
|
24111
24111
|
type: "module",
|
|
24112
24112
|
main: "./dist/index.cjs",
|
package/dist/index.js
CHANGED
|
@@ -19153,7 +19153,8 @@ import { useMutation as useMutation18 } from "@tanstack/react-query";
|
|
|
19153
19153
|
import { useEffect as useEffect33, useRef as useRef17, useState as useState24 } from "react";
|
|
19154
19154
|
import { useSignMessage } from "wagmi";
|
|
19155
19155
|
import { jsx as jsx89, jsxs as jsxs83 } from "react/jsx-runtime";
|
|
19156
|
-
function SenderSelector() {
|
|
19156
|
+
function SenderSelector(props) {
|
|
19157
|
+
const { profiles } = props;
|
|
19157
19158
|
const { t } = useT();
|
|
19158
19159
|
const config = useProviderConfig().config;
|
|
19159
19160
|
const { signMessageAsync } = useSignMessage();
|
|
@@ -19161,7 +19162,6 @@ function SenderSelector() {
|
|
|
19161
19162
|
const directWalletAddress = useExternalWalletStore((st) => st.externalAddress);
|
|
19162
19163
|
const directWalletIsConnected = useExternalWalletStore((st) => st.isExternalConnected);
|
|
19163
19164
|
const pendingWalletRef = useRef17(null);
|
|
19164
|
-
const { profiles } = useLinkedProfiles();
|
|
19165
19165
|
const originChain = useBridgeStore((st) => st.originChain);
|
|
19166
19166
|
const bridgeSender = useBridgeStore((st) => st.bridgeSender);
|
|
19167
19167
|
const bridgeSenders = useBridgeStore((st) => st.bridgeSenders);
|
|
@@ -19304,7 +19304,6 @@ var init_SenderSelector = __esm({
|
|
|
19304
19304
|
"src/internal/components/SendMenu/hyperbridge/components/SenderSelector.tsx"() {
|
|
19305
19305
|
init_ProviderContext();
|
|
19306
19306
|
init_i18n();
|
|
19307
|
-
init_linkedProfiles();
|
|
19308
19307
|
init_wallet();
|
|
19309
19308
|
init_useLayoutDataStore();
|
|
19310
19309
|
init_useExternalWalletStore();
|
|
@@ -19316,6 +19315,149 @@ var init_SenderSelector = __esm({
|
|
|
19316
19315
|
}
|
|
19317
19316
|
});
|
|
19318
19317
|
|
|
19318
|
+
// src/internal/assets/wallets/MetaMaskIcon.tsx
|
|
19319
|
+
import { jsx as jsx90, jsxs as jsxs84 } from "react/jsx-runtime";
|
|
19320
|
+
function MetaMaskIcon(props) {
|
|
19321
|
+
const { width = "24", height = "24", ...svgProps } = props;
|
|
19322
|
+
return /* @__PURE__ */ jsxs84(
|
|
19323
|
+
"svg",
|
|
19324
|
+
{
|
|
19325
|
+
...svgProps,
|
|
19326
|
+
width,
|
|
19327
|
+
height,
|
|
19328
|
+
version: "1.1",
|
|
19329
|
+
id: "Layer_1",
|
|
19330
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
19331
|
+
x: "0px",
|
|
19332
|
+
y: "0px",
|
|
19333
|
+
viewBox: "0 0 142 136.878",
|
|
19334
|
+
style: {
|
|
19335
|
+
// enableBackground: 'new 0 0 142 136.878',
|
|
19336
|
+
flexShrink: 0
|
|
19337
|
+
},
|
|
19338
|
+
xmlSpace: "preserve",
|
|
19339
|
+
children: [
|
|
19340
|
+
/* @__PURE__ */ jsx90(
|
|
19341
|
+
"path",
|
|
19342
|
+
{
|
|
19343
|
+
fill: "#FF5C16",
|
|
19344
|
+
d: "M132.682,132.192l-30.583-9.106l-23.063,13.787l-16.092-0.007l-23.077-13.78l-30.569,9.106L0,100.801\n l9.299-34.839L0,36.507L9.299,0l47.766,28.538h27.85L132.682,0l9.299,36.507l-9.299,29.455l9.299,34.839L132.682,132.192\n L132.682,132.192z"
|
|
19345
|
+
}
|
|
19346
|
+
),
|
|
19347
|
+
/* @__PURE__ */ jsx90(
|
|
19348
|
+
"path",
|
|
19349
|
+
{
|
|
19350
|
+
fill: "#FF5C16",
|
|
19351
|
+
d: "M9.305,0l47.767,28.558l-1.899,19.599L9.305,0z M39.875,100.814l21.017,16.01l-21.017,6.261\n C39.875,123.085,39.875,100.814,39.875,100.814z M59.212,74.345l-4.039-26.174L29.317,65.97l-0.014-0.007v0.013l0.08,18.321\n l10.485-9.951L59.212,74.345L59.212,74.345z M132.682,0L84.915,28.558l1.893,19.599L132.682,0z M102.113,100.814l-21.018,16.01\n l21.018,6.261V100.814z M112.678,65.975h0.007H112.678v-0.013l-0.006,0.007L86.815,48.171l-4.039,26.174h19.336l10.492,9.95\n C112.604,84.295,112.678,65.975,112.678,65.975z"
|
|
19352
|
+
}
|
|
19353
|
+
),
|
|
19354
|
+
/* @__PURE__ */ jsx90(
|
|
19355
|
+
"path",
|
|
19356
|
+
{
|
|
19357
|
+
fill: "#E34807",
|
|
19358
|
+
d: "M39.868,123.085l-30.569,9.106L0,100.814h39.868C39.868,100.814,39.868,123.085,39.868,123.085z\n M59.205,74.338l5.839,37.84l-8.093-21.04L29.37,84.295l10.491-9.956h19.344L59.205,74.338z M102.112,123.085l30.57,9.106\n l9.299-31.378h-39.869C102.112,100.814,102.112,123.085,102.112,123.085z M82.776,74.338l-5.839,37.84l8.092-21.04l27.583-6.843\n l-10.498-9.956H82.776V74.338z"
|
|
19359
|
+
}
|
|
19360
|
+
),
|
|
19361
|
+
/* @__PURE__ */ jsx90(
|
|
19362
|
+
"path",
|
|
19363
|
+
{
|
|
19364
|
+
fill: "#FF8D5D",
|
|
19365
|
+
d: "M0,100.801l9.299-34.839h19.997l0.073,18.327l27.584,6.843l8.092,21.039l-4.16,4.633l-21.017-16.01H0\n V100.801z M141.981,100.801l-9.299-34.839h-19.998l-0.073,18.327l-27.582,6.843l-8.093,21.039l4.159,4.633l21.018-16.01h39.868\n V100.801z M84.915,28.538h-27.85l-1.891,19.599l9.872,64.013h11.891l9.878-64.013L84.915,28.538z"
|
|
19366
|
+
}
|
|
19367
|
+
),
|
|
19368
|
+
/* @__PURE__ */ jsx90(
|
|
19369
|
+
"path",
|
|
19370
|
+
{
|
|
19371
|
+
fill: "#661800",
|
|
19372
|
+
d: "M9.299,0L0,36.507l9.299,29.455h19.997l25.87-17.804L9.299,0z M53.426,81.938h-9.059l-4.932,4.835\n l17.524,4.344l-3.533-9.186V81.938z M132.682,0l9.299,36.507l-9.299,29.455h-19.998L86.815,48.158L132.682,0z M88.568,81.938h9.072\n l4.932,4.841l-17.544,4.353l3.54-9.201V81.938z M79.029,124.385l2.067-7.567l-4.16-4.633h-11.9l-4.159,4.633l2.066,7.567"
|
|
19373
|
+
}
|
|
19374
|
+
),
|
|
19375
|
+
/* @__PURE__ */ jsx90(
|
|
19376
|
+
"path",
|
|
19377
|
+
{
|
|
19378
|
+
fill: "#C0C4CD",
|
|
19379
|
+
d: "M79.029,124.384v12.495H62.945v-12.495L79.029,124.384L79.029,124.384z"
|
|
19380
|
+
}
|
|
19381
|
+
),
|
|
19382
|
+
/* @__PURE__ */ jsx90(
|
|
19383
|
+
"path",
|
|
19384
|
+
{
|
|
19385
|
+
fill: "#E7EBF6",
|
|
19386
|
+
d: "M39.875,123.072l23.083,13.8v-12.495l-2.067-7.566C60.891,116.811,39.875,123.072,39.875,123.072z\n M102.113,123.072l-23.084,13.8v-12.495l2.067-7.566C81.096,116.811,102.113,123.072,102.113,123.072z"
|
|
19387
|
+
}
|
|
19388
|
+
)
|
|
19389
|
+
]
|
|
19390
|
+
}
|
|
19391
|
+
);
|
|
19392
|
+
}
|
|
19393
|
+
var init_MetaMaskIcon = __esm({
|
|
19394
|
+
"src/internal/assets/wallets/MetaMaskIcon.tsx"() {
|
|
19395
|
+
}
|
|
19396
|
+
});
|
|
19397
|
+
|
|
19398
|
+
// src/internal/assets/wallets/index.tsx
|
|
19399
|
+
import { Wallet2Icon } from "lucide-react";
|
|
19400
|
+
import { jsx as jsx91 } from "react/jsx-runtime";
|
|
19401
|
+
var WALLET_ICONS;
|
|
19402
|
+
var init_wallets = __esm({
|
|
19403
|
+
"src/internal/assets/wallets/index.tsx"() {
|
|
19404
|
+
init_MetaMaskIcon();
|
|
19405
|
+
WALLET_ICONS = {
|
|
19406
|
+
metamask: MetaMaskIcon,
|
|
19407
|
+
default: (props) => /* @__PURE__ */ jsx91(Wallet2Icon, { ...props })
|
|
19408
|
+
};
|
|
19409
|
+
}
|
|
19410
|
+
});
|
|
19411
|
+
|
|
19412
|
+
// src/internal/components/SendMenu/hyperbridge/hooks/useAvailableSenders.ts
|
|
19413
|
+
import { useEffect as useEffect34, useRef as useRef18 } from "react";
|
|
19414
|
+
function useAvailableSenders() {
|
|
19415
|
+
const address = useSession((st) => st.address);
|
|
19416
|
+
const activeChainId = useSession((st) => st.activeChainId);
|
|
19417
|
+
const { profiles } = useLinkedProfiles();
|
|
19418
|
+
const walletProfiles = profiles.filter((p) => p.provider === "wallet");
|
|
19419
|
+
const lastCalcedSenders = useRef18([]);
|
|
19420
|
+
useEffect34(() => {
|
|
19421
|
+
const sendersAccumulator = [
|
|
19422
|
+
{
|
|
19423
|
+
type: "embarkai-wallet",
|
|
19424
|
+
name: "embarkAI",
|
|
19425
|
+
chainId: activeChainId,
|
|
19426
|
+
address,
|
|
19427
|
+
Icon: TOKENS_ICONS["EMBARKAI"]
|
|
19428
|
+
}
|
|
19429
|
+
];
|
|
19430
|
+
if (!!walletProfiles.length) {
|
|
19431
|
+
walletProfiles.forEach((wProfile) => {
|
|
19432
|
+
sendersAccumulator.push({
|
|
19433
|
+
type: "direct-wallet",
|
|
19434
|
+
name: wProfile?.meta?.walletName || "External wallet",
|
|
19435
|
+
chainId: null,
|
|
19436
|
+
address: wProfile?.externalId,
|
|
19437
|
+
Icon: WALLET_ICONS[wProfile?.meta?.walletName?.toLowerCase()] || WALLET_ICONS["default"]
|
|
19438
|
+
});
|
|
19439
|
+
});
|
|
19440
|
+
}
|
|
19441
|
+
if (sendersAccumulator.map((s) => `${s.name}-${s.address}`).join(",") === lastCalcedSenders.current.join(",")) {
|
|
19442
|
+
return;
|
|
19443
|
+
}
|
|
19444
|
+
lastCalcedSenders.current = sendersAccumulator.map((s) => `${s.name}-${s.address}`);
|
|
19445
|
+
useBridgeStore.getState().setBridgeSenders(sendersAccumulator);
|
|
19446
|
+
useFlowSelectorStore.getState().setRenderKey(`sender-selected-${Date.now()}`);
|
|
19447
|
+
}, [address, walletProfiles, activeChainId]);
|
|
19448
|
+
return { profiles: walletProfiles };
|
|
19449
|
+
}
|
|
19450
|
+
var init_useAvailableSenders = __esm({
|
|
19451
|
+
"src/internal/components/SendMenu/hyperbridge/hooks/useAvailableSenders.ts"() {
|
|
19452
|
+
init_SessionContext();
|
|
19453
|
+
init_tokens();
|
|
19454
|
+
init_linkedProfiles();
|
|
19455
|
+
init_wallets();
|
|
19456
|
+
init_useFlowSelector();
|
|
19457
|
+
init_useBridgeStore();
|
|
19458
|
+
}
|
|
19459
|
+
});
|
|
19460
|
+
|
|
19319
19461
|
// src/internal/components/SendMenu/hyperbridge/api.ts
|
|
19320
19462
|
function iframe3() {
|
|
19321
19463
|
const accessToken = jwtTokenManager2.getAccessToken();
|
|
@@ -19693,7 +19835,7 @@ var init_useBridge = __esm({
|
|
|
19693
19835
|
|
|
19694
19836
|
// src/internal/components/SendMenu/hyperbridge/hooks/useHyperlaneRoutes.ts
|
|
19695
19837
|
import { useQuery as useQuery19 } from "@tanstack/react-query";
|
|
19696
|
-
import { useEffect as
|
|
19838
|
+
import { useEffect as useEffect35 } from "react";
|
|
19697
19839
|
function useHyperlaneRoutes() {
|
|
19698
19840
|
const address = useSession((st) => st.address);
|
|
19699
19841
|
const page = useLayoutDataStore((st) => st.page);
|
|
@@ -19709,7 +19851,7 @@ function useHyperlaneRoutes() {
|
|
|
19709
19851
|
queryKey: [HYPERLANE_WARP_ROUTES_QUERY_KEY, address],
|
|
19710
19852
|
queryFn: async () => getHyperlaneWarpRoutes()
|
|
19711
19853
|
});
|
|
19712
|
-
|
|
19854
|
+
useEffect35(() => {
|
|
19713
19855
|
if (!errorWarpRoutes) return;
|
|
19714
19856
|
useFlowSelectorStore.getState().setError(errorWarpRoutes.message);
|
|
19715
19857
|
const { resetSelections, setRecipient, setOriginChain, setDestinationChain } = useBridgeStore.getState();
|
|
@@ -19718,7 +19860,7 @@ function useHyperlaneRoutes() {
|
|
|
19718
19860
|
setOriginChain(null);
|
|
19719
19861
|
setDestinationChain(null);
|
|
19720
19862
|
}, [errorWarpRoutes]);
|
|
19721
|
-
|
|
19863
|
+
useEffect35(() => {
|
|
19722
19864
|
if (!!hyperRoute || !hyperlaneWarpRoutes.length) return;
|
|
19723
19865
|
const warpRouteToAutoSelect = hyperlaneWarpRoutes.find((route) => route.routeId === hyperRoute);
|
|
19724
19866
|
if (!warpRouteToAutoSelect) return;
|
|
@@ -19751,13 +19893,13 @@ var init_useHyperlaneRoutes = __esm({
|
|
|
19751
19893
|
});
|
|
19752
19894
|
|
|
19753
19895
|
// src/internal/components/SendMenu/hyperbridge/hooks/useMenuTitle.ts
|
|
19754
|
-
import { useEffect as
|
|
19896
|
+
import { useEffect as useEffect36 } from "react";
|
|
19755
19897
|
function useMenuTitle(warpRoutes) {
|
|
19756
19898
|
const { t } = useT();
|
|
19757
19899
|
const bridgeStep = useBridgeStore((st) => st.bridgeStep);
|
|
19758
19900
|
const hyperRoute = useBridgeStore((st) => st.hyperRoute);
|
|
19759
19901
|
const hyperRouteMeta = warpRoutes?.length ? warpRoutes.find((route) => route.routeId === hyperRoute) : null;
|
|
19760
|
-
|
|
19902
|
+
useEffect36(() => {
|
|
19761
19903
|
const updateMenuTitle = useFlowSelectorStore.getState().setMenuTitle;
|
|
19762
19904
|
switch (true) {
|
|
19763
19905
|
case bridgeStep === "sender-selector":
|
|
@@ -19794,10 +19936,10 @@ var init_useMenuTitle = __esm({
|
|
|
19794
19936
|
});
|
|
19795
19937
|
|
|
19796
19938
|
// src/internal/components/SendMenu/hyperbridge/components/ResolveChainIcon.tsx
|
|
19797
|
-
import { jsx as
|
|
19939
|
+
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
19798
19940
|
function ResolveChainIcon(props) {
|
|
19799
19941
|
const Icon2 = CHAINS_UI_META[props.chainName]?.Icon || TOKENS_ICONS.EMBARKAI;
|
|
19800
|
-
return /* @__PURE__ */
|
|
19942
|
+
return /* @__PURE__ */ jsx92(Icon2, { className: props.className || "w-4 h-4" });
|
|
19801
19943
|
}
|
|
19802
19944
|
var init_ResolveChainIcon = __esm({
|
|
19803
19945
|
"src/internal/components/SendMenu/hyperbridge/components/ResolveChainIcon.tsx"() {
|
|
@@ -19806,148 +19948,6 @@ var init_ResolveChainIcon = __esm({
|
|
|
19806
19948
|
}
|
|
19807
19949
|
});
|
|
19808
19950
|
|
|
19809
|
-
// src/internal/assets/wallets/MetaMaskIcon.tsx
|
|
19810
|
-
import { jsx as jsx91, jsxs as jsxs84 } from "react/jsx-runtime";
|
|
19811
|
-
function MetaMaskIcon(props) {
|
|
19812
|
-
const { width = "24", height = "24", ...svgProps } = props;
|
|
19813
|
-
return /* @__PURE__ */ jsxs84(
|
|
19814
|
-
"svg",
|
|
19815
|
-
{
|
|
19816
|
-
...svgProps,
|
|
19817
|
-
width,
|
|
19818
|
-
height,
|
|
19819
|
-
version: "1.1",
|
|
19820
|
-
id: "Layer_1",
|
|
19821
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
19822
|
-
x: "0px",
|
|
19823
|
-
y: "0px",
|
|
19824
|
-
viewBox: "0 0 142 136.878",
|
|
19825
|
-
style: {
|
|
19826
|
-
// enableBackground: 'new 0 0 142 136.878',
|
|
19827
|
-
flexShrink: 0
|
|
19828
|
-
},
|
|
19829
|
-
xmlSpace: "preserve",
|
|
19830
|
-
children: [
|
|
19831
|
-
/* @__PURE__ */ jsx91(
|
|
19832
|
-
"path",
|
|
19833
|
-
{
|
|
19834
|
-
fill: "#FF5C16",
|
|
19835
|
-
d: "M132.682,132.192l-30.583-9.106l-23.063,13.787l-16.092-0.007l-23.077-13.78l-30.569,9.106L0,100.801\n l9.299-34.839L0,36.507L9.299,0l47.766,28.538h27.85L132.682,0l9.299,36.507l-9.299,29.455l9.299,34.839L132.682,132.192\n L132.682,132.192z"
|
|
19836
|
-
}
|
|
19837
|
-
),
|
|
19838
|
-
/* @__PURE__ */ jsx91(
|
|
19839
|
-
"path",
|
|
19840
|
-
{
|
|
19841
|
-
fill: "#FF5C16",
|
|
19842
|
-
d: "M9.305,0l47.767,28.558l-1.899,19.599L9.305,0z M39.875,100.814l21.017,16.01l-21.017,6.261\n C39.875,123.085,39.875,100.814,39.875,100.814z M59.212,74.345l-4.039-26.174L29.317,65.97l-0.014-0.007v0.013l0.08,18.321\n l10.485-9.951L59.212,74.345L59.212,74.345z M132.682,0L84.915,28.558l1.893,19.599L132.682,0z M102.113,100.814l-21.018,16.01\n l21.018,6.261V100.814z M112.678,65.975h0.007H112.678v-0.013l-0.006,0.007L86.815,48.171l-4.039,26.174h19.336l10.492,9.95\n C112.604,84.295,112.678,65.975,112.678,65.975z"
|
|
19843
|
-
}
|
|
19844
|
-
),
|
|
19845
|
-
/* @__PURE__ */ jsx91(
|
|
19846
|
-
"path",
|
|
19847
|
-
{
|
|
19848
|
-
fill: "#E34807",
|
|
19849
|
-
d: "M39.868,123.085l-30.569,9.106L0,100.814h39.868C39.868,100.814,39.868,123.085,39.868,123.085z\n M59.205,74.338l5.839,37.84l-8.093-21.04L29.37,84.295l10.491-9.956h19.344L59.205,74.338z M102.112,123.085l30.57,9.106\n l9.299-31.378h-39.869C102.112,100.814,102.112,123.085,102.112,123.085z M82.776,74.338l-5.839,37.84l8.092-21.04l27.583-6.843\n l-10.498-9.956H82.776V74.338z"
|
|
19850
|
-
}
|
|
19851
|
-
),
|
|
19852
|
-
/* @__PURE__ */ jsx91(
|
|
19853
|
-
"path",
|
|
19854
|
-
{
|
|
19855
|
-
fill: "#FF8D5D",
|
|
19856
|
-
d: "M0,100.801l9.299-34.839h19.997l0.073,18.327l27.584,6.843l8.092,21.039l-4.16,4.633l-21.017-16.01H0\n V100.801z M141.981,100.801l-9.299-34.839h-19.998l-0.073,18.327l-27.582,6.843l-8.093,21.039l4.159,4.633l21.018-16.01h39.868\n V100.801z M84.915,28.538h-27.85l-1.891,19.599l9.872,64.013h11.891l9.878-64.013L84.915,28.538z"
|
|
19857
|
-
}
|
|
19858
|
-
),
|
|
19859
|
-
/* @__PURE__ */ jsx91(
|
|
19860
|
-
"path",
|
|
19861
|
-
{
|
|
19862
|
-
fill: "#661800",
|
|
19863
|
-
d: "M9.299,0L0,36.507l9.299,29.455h19.997l25.87-17.804L9.299,0z M53.426,81.938h-9.059l-4.932,4.835\n l17.524,4.344l-3.533-9.186V81.938z M132.682,0l9.299,36.507l-9.299,29.455h-19.998L86.815,48.158L132.682,0z M88.568,81.938h9.072\n l4.932,4.841l-17.544,4.353l3.54-9.201V81.938z M79.029,124.385l2.067-7.567l-4.16-4.633h-11.9l-4.159,4.633l2.066,7.567"
|
|
19864
|
-
}
|
|
19865
|
-
),
|
|
19866
|
-
/* @__PURE__ */ jsx91(
|
|
19867
|
-
"path",
|
|
19868
|
-
{
|
|
19869
|
-
fill: "#C0C4CD",
|
|
19870
|
-
d: "M79.029,124.384v12.495H62.945v-12.495L79.029,124.384L79.029,124.384z"
|
|
19871
|
-
}
|
|
19872
|
-
),
|
|
19873
|
-
/* @__PURE__ */ jsx91(
|
|
19874
|
-
"path",
|
|
19875
|
-
{
|
|
19876
|
-
fill: "#E7EBF6",
|
|
19877
|
-
d: "M39.875,123.072l23.083,13.8v-12.495l-2.067-7.566C60.891,116.811,39.875,123.072,39.875,123.072z\n M102.113,123.072l-23.084,13.8v-12.495l2.067-7.566C81.096,116.811,102.113,123.072,102.113,123.072z"
|
|
19878
|
-
}
|
|
19879
|
-
)
|
|
19880
|
-
]
|
|
19881
|
-
}
|
|
19882
|
-
);
|
|
19883
|
-
}
|
|
19884
|
-
var init_MetaMaskIcon = __esm({
|
|
19885
|
-
"src/internal/assets/wallets/MetaMaskIcon.tsx"() {
|
|
19886
|
-
}
|
|
19887
|
-
});
|
|
19888
|
-
|
|
19889
|
-
// src/internal/assets/wallets/index.tsx
|
|
19890
|
-
import { Wallet2Icon } from "lucide-react";
|
|
19891
|
-
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
19892
|
-
var WALLET_ICONS;
|
|
19893
|
-
var init_wallets = __esm({
|
|
19894
|
-
"src/internal/assets/wallets/index.tsx"() {
|
|
19895
|
-
init_MetaMaskIcon();
|
|
19896
|
-
WALLET_ICONS = {
|
|
19897
|
-
metamask: MetaMaskIcon,
|
|
19898
|
-
default: (props) => /* @__PURE__ */ jsx92(Wallet2Icon, { ...props })
|
|
19899
|
-
};
|
|
19900
|
-
}
|
|
19901
|
-
});
|
|
19902
|
-
|
|
19903
|
-
// src/internal/components/SendMenu/hyperbridge/hooks/useAvailableSenders.ts
|
|
19904
|
-
import { useEffect as useEffect36, useRef as useRef18 } from "react";
|
|
19905
|
-
function useAvailableSenders() {
|
|
19906
|
-
const address = useSession((st) => st.address);
|
|
19907
|
-
const activeChainId = useSession((st) => st.activeChainId);
|
|
19908
|
-
const { profiles } = useLinkedProfiles();
|
|
19909
|
-
const walletProfiles = profiles.filter((p) => p.provider === "wallet");
|
|
19910
|
-
const lastCalcedSenders = useRef18([]);
|
|
19911
|
-
useEffect36(() => {
|
|
19912
|
-
const sendersAccumulator = [
|
|
19913
|
-
{
|
|
19914
|
-
type: "embarkai-wallet",
|
|
19915
|
-
name: "embarkAI",
|
|
19916
|
-
chainId: activeChainId,
|
|
19917
|
-
address,
|
|
19918
|
-
Icon: TOKENS_ICONS["EMBARKAI"]
|
|
19919
|
-
}
|
|
19920
|
-
];
|
|
19921
|
-
if (!!walletProfiles.length) {
|
|
19922
|
-
walletProfiles.forEach((wProfile) => {
|
|
19923
|
-
sendersAccumulator.push({
|
|
19924
|
-
type: "direct-wallet",
|
|
19925
|
-
name: wProfile?.meta?.walletName || "External wallet",
|
|
19926
|
-
chainId: null,
|
|
19927
|
-
address: wProfile?.externalId,
|
|
19928
|
-
Icon: WALLET_ICONS[wProfile?.meta?.walletName?.toLowerCase()] || WALLET_ICONS["default"]
|
|
19929
|
-
});
|
|
19930
|
-
});
|
|
19931
|
-
}
|
|
19932
|
-
if (sendersAccumulator.map((s) => `${s.name}-${s.address}`).join(",") === lastCalcedSenders.current.join(",")) {
|
|
19933
|
-
return;
|
|
19934
|
-
}
|
|
19935
|
-
lastCalcedSenders.current = sendersAccumulator.map((s) => `${s.name}-${s.address}`);
|
|
19936
|
-
useBridgeStore.getState().setBridgeSenders(sendersAccumulator);
|
|
19937
|
-
useFlowSelectorStore.getState().setRenderKey(`sender-selected-${Date.now()}`);
|
|
19938
|
-
}, [address, walletProfiles, activeChainId]);
|
|
19939
|
-
}
|
|
19940
|
-
var init_useAvailableSenders = __esm({
|
|
19941
|
-
"src/internal/components/SendMenu/hyperbridge/hooks/useAvailableSenders.ts"() {
|
|
19942
|
-
init_SessionContext();
|
|
19943
|
-
init_tokens();
|
|
19944
|
-
init_linkedProfiles();
|
|
19945
|
-
init_wallets();
|
|
19946
|
-
init_useFlowSelector();
|
|
19947
|
-
init_useBridgeStore();
|
|
19948
|
-
}
|
|
19949
|
-
});
|
|
19950
|
-
|
|
19951
19951
|
// src/internal/components/SendMenu/hyperbridge/hooks/useBridgeBalance.ts
|
|
19952
19952
|
import { useQuery as useQuery20, useQueryClient as useQueryClient21 } from "@tanstack/react-query";
|
|
19953
19953
|
import { useCallback as useCallback23, useEffect as useEffect37 } from "react";
|
|
@@ -20115,7 +20115,6 @@ function SelectStep(props) {
|
|
|
20115
20115
|
setAmount,
|
|
20116
20116
|
setRecipient
|
|
20117
20117
|
} = useBridgeStore();
|
|
20118
|
-
useAvailableSenders();
|
|
20119
20118
|
const selectedSender = useBridgeStore((st) => st.bridgeSenders.find((s) => s.type === st.bridgeSender));
|
|
20120
20119
|
const { routeTokenBalance, isRouteTokenBalanceLoading } = useBridgeBalance(hyperlaneWarpRoutes);
|
|
20121
20120
|
const selectedWarpRoute = hyperlaneWarpRoutes.find((route) => {
|
|
@@ -20352,7 +20351,6 @@ var init_SelectStep = __esm({
|
|
|
20352
20351
|
init_input();
|
|
20353
20352
|
init_useFlowSelector();
|
|
20354
20353
|
init_ResolveChainIcon();
|
|
20355
|
-
init_useAvailableSenders();
|
|
20356
20354
|
init_useBridgeBalance();
|
|
20357
20355
|
init_chains();
|
|
20358
20356
|
init_useBridgeStore();
|
|
@@ -20646,7 +20644,7 @@ var init_useHyperlaneHistory = __esm({
|
|
|
20646
20644
|
init_api3();
|
|
20647
20645
|
init_useBridgeStore();
|
|
20648
20646
|
HYPERLANE_HISTORY_QUERY_KEY = "hyperlane-tx-history-query-key";
|
|
20649
|
-
TX_HISTORY_PAGE_SIZE =
|
|
20647
|
+
TX_HISTORY_PAGE_SIZE = 6;
|
|
20650
20648
|
TX_HISTORY_POLLING_INTERVAL = 1e3 * 45;
|
|
20651
20649
|
}
|
|
20652
20650
|
});
|
|
@@ -21037,6 +21035,7 @@ function HyperlaneBridge() {
|
|
|
21037
21035
|
const bridgeStep = useBridgeStore((st) => st.bridgeStep);
|
|
21038
21036
|
const { swapDirection, handleQuoteEstimation, bridgeAsset, isAssetBridging } = useBridge();
|
|
21039
21037
|
const { hyperlaneWarpRoutes, isLoadingWarpRoutes } = useHyperlaneRoutes();
|
|
21038
|
+
const { profiles } = useAvailableSenders();
|
|
21040
21039
|
useMenuTitle(hyperlaneWarpRoutes);
|
|
21041
21040
|
useEffect39(
|
|
21042
21041
|
() => () => {
|
|
@@ -21045,7 +21044,7 @@ function HyperlaneBridge() {
|
|
|
21045
21044
|
[]
|
|
21046
21045
|
);
|
|
21047
21046
|
return /* @__PURE__ */ jsxs90(Fragment38, { children: [
|
|
21048
|
-
bridgeStep === "sender-selector" && /* @__PURE__ */ jsx99(SenderSelector, {}),
|
|
21047
|
+
bridgeStep === "sender-selector" && /* @__PURE__ */ jsx99(SenderSelector, { profiles }),
|
|
21049
21048
|
bridgeStep === "select" && /* @__PURE__ */ jsx99(
|
|
21050
21049
|
SelectStep,
|
|
21051
21050
|
{
|
|
@@ -21075,6 +21074,7 @@ function HyperlaneBridge() {
|
|
|
21075
21074
|
var init_HyperlaneBridge = __esm({
|
|
21076
21075
|
"src/internal/components/SendMenu/hyperbridge/HyperlaneBridge.tsx"() {
|
|
21077
21076
|
init_SenderSelector();
|
|
21077
|
+
init_useAvailableSenders();
|
|
21078
21078
|
init_useBridge();
|
|
21079
21079
|
init_useHyperlaneRoutes();
|
|
21080
21080
|
init_useMenuTitle();
|
|
@@ -24006,7 +24006,7 @@ var init_package = __esm({
|
|
|
24006
24006
|
"package.json"() {
|
|
24007
24007
|
package_default = {
|
|
24008
24008
|
name: "@embarkai/ui-kit",
|
|
24009
|
-
version: "0.4.
|
|
24009
|
+
version: "0.4.36",
|
|
24010
24010
|
description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
|
|
24011
24011
|
type: "module",
|
|
24012
24012
|
main: "./dist/index.cjs",
|