@embarkai/ui-kit 0.4.34 → 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.
@@ -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.34</title>
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>
@@ -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.34";
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, import_react62.useCallback)(() => {
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, import_react62.useCallback)((amnt) => {
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, import_react62, import_wagmi2;
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
- import_react62 = require("react");
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, import_react63.useEffect)(() => {
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,15 +19944,14 @@ function useHyperlaneRoutes() {
19800
19944
  setOriginChain(null);
19801
19945
  setDestinationChain(null);
19802
19946
  }, [errorWarpRoutes]);
19803
- (0, import_react63.useEffect)(() => {
19947
+ (0, import_react64.useEffect)(() => {
19804
19948
  if (!!hyperRoute || !hyperlaneWarpRoutes.length) return;
19805
19949
  const warpRouteToAutoSelect = hyperlaneWarpRoutes.find((route) => route.routeId === hyperRoute);
19950
+ if (!warpRouteToAutoSelect) return;
19806
19951
  let originChainIndex = 0;
19807
19952
  let destinationChainIndex = 1;
19808
19953
  if (useBridgeStore.getState().bridgeSender === "embarkai-wallet") {
19809
- const foundIdx = warpRouteToAutoSelect.chainPair.findIndex(
19810
- (chain) => isOririnChainEmbarkSupported(chain.chainName)
19811
- );
19954
+ const foundIdx = warpRouteToAutoSelect.chainPair?.findIndex((chain) => isOririnChainEmbarkSupported(chain.chainName)) || -1;
19812
19955
  if (foundIdx !== -1) {
19813
19956
  originChainIndex = foundIdx;
19814
19957
  destinationChainIndex = foundIdx === 0 ? 1 : 0;
@@ -19820,12 +19963,12 @@ function useHyperlaneRoutes() {
19820
19963
  }, [hyperRoute, hyperlaneWarpRoutes]);
19821
19964
  return { hyperlaneWarpRoutes, isLoadingWarpRoutes };
19822
19965
  }
19823
- var import_react_query44, import_react63, HYPERLANE_WARP_ROUTES_QUERY_KEY;
19966
+ var import_react_query44, import_react64, HYPERLANE_WARP_ROUTES_QUERY_KEY;
19824
19967
  var init_useHyperlaneRoutes = __esm({
19825
19968
  "src/internal/components/SendMenu/hyperbridge/hooks/useHyperlaneRoutes.ts"() {
19826
19969
  init_SessionContext();
19827
19970
  import_react_query44 = require("@tanstack/react-query");
19828
- import_react63 = require("react");
19971
+ import_react64 = require("react");
19829
19972
  init_useLayoutDataStore();
19830
19973
  init_useFlowSelector();
19831
19974
  init_api3();
@@ -19841,7 +19984,7 @@ function useMenuTitle(warpRoutes) {
19841
19984
  const bridgeStep = useBridgeStore((st) => st.bridgeStep);
19842
19985
  const hyperRoute = useBridgeStore((st) => st.hyperRoute);
19843
19986
  const hyperRouteMeta = warpRoutes?.length ? warpRoutes.find((route) => route.routeId === hyperRoute) : null;
19844
- (0, import_react64.useEffect)(() => {
19987
+ (0, import_react65.useEffect)(() => {
19845
19988
  const updateMenuTitle = useFlowSelectorStore.getState().setMenuTitle;
19846
19989
  switch (true) {
19847
19990
  case bridgeStep === "sender-selector":
@@ -19869,11 +20012,11 @@ function useMenuTitle(warpRoutes) {
19869
20012
  }
19870
20013
  }, [bridgeStep, hyperRouteMeta, t]);
19871
20014
  }
19872
- var import_react64;
20015
+ var import_react65;
19873
20016
  var init_useMenuTitle = __esm({
19874
20017
  "src/internal/components/SendMenu/hyperbridge/hooks/useMenuTitle.ts"() {
19875
20018
  init_i18n();
19876
- import_react64 = require("react");
20019
+ import_react65 = require("react");
19877
20020
  init_useFlowSelector();
19878
20021
  init_useBridgeStore();
19879
20022
  }
@@ -19882,158 +20025,14 @@ var init_useMenuTitle = __esm({
19882
20025
  // src/internal/components/SendMenu/hyperbridge/components/ResolveChainIcon.tsx
19883
20026
  function ResolveChainIcon(props) {
19884
20027
  const Icon2 = CHAINS_UI_META[props.chainName]?.Icon || TOKENS_ICONS.EMBARKAI;
19885
- return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Icon2, { className: props.className || "w-4 h-4" });
20028
+ return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Icon2, { className: props.className || "w-4 h-4" });
19886
20029
  }
19887
- var import_jsx_runtime90;
20030
+ var import_jsx_runtime92;
19888
20031
  var init_ResolveChainIcon = __esm({
19889
20032
  "src/internal/components/SendMenu/hyperbridge/components/ResolveChainIcon.tsx"() {
19890
20033
  init_tokens();
19891
20034
  init_chains();
19892
- import_jsx_runtime90 = require("react/jsx-runtime");
19893
- }
19894
- });
19895
-
19896
- // src/internal/assets/wallets/MetaMaskIcon.tsx
19897
- function MetaMaskIcon(props) {
19898
- const { width = "24", height = "24", ...svgProps } = props;
19899
- return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(
19900
- "svg",
19901
- {
19902
- ...svgProps,
19903
- width,
19904
- height,
19905
- version: "1.1",
19906
- id: "Layer_1",
19907
- xmlns: "http://www.w3.org/2000/svg",
19908
- x: "0px",
19909
- y: "0px",
19910
- viewBox: "0 0 142 136.878",
19911
- style: {
19912
- // enableBackground: 'new 0 0 142 136.878',
19913
- flexShrink: 0
19914
- },
19915
- xmlSpace: "preserve",
19916
- children: [
19917
- /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
19918
- "path",
19919
- {
19920
- fill: "#FF5C16",
19921
- 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"
19922
- }
19923
- ),
19924
- /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
19925
- "path",
19926
- {
19927
- fill: "#FF5C16",
19928
- 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"
19929
- }
19930
- ),
19931
- /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
19932
- "path",
19933
- {
19934
- fill: "#E34807",
19935
- 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"
19936
- }
19937
- ),
19938
- /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
19939
- "path",
19940
- {
19941
- fill: "#FF8D5D",
19942
- 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"
19943
- }
19944
- ),
19945
- /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
19946
- "path",
19947
- {
19948
- fill: "#661800",
19949
- 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"
19950
- }
19951
- ),
19952
- /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
19953
- "path",
19954
- {
19955
- fill: "#C0C4CD",
19956
- d: "M79.029,124.384v12.495H62.945v-12.495L79.029,124.384L79.029,124.384z"
19957
- }
19958
- ),
19959
- /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
19960
- "path",
19961
- {
19962
- fill: "#E7EBF6",
19963
- 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"
19964
- }
19965
- )
19966
- ]
19967
- }
19968
- );
19969
- }
19970
- var import_jsx_runtime91;
19971
- var init_MetaMaskIcon = __esm({
19972
- "src/internal/assets/wallets/MetaMaskIcon.tsx"() {
19973
- import_jsx_runtime91 = require("react/jsx-runtime");
19974
- }
19975
- });
19976
-
19977
- // src/internal/assets/wallets/index.tsx
19978
- var import_lucide_react58, import_jsx_runtime92, WALLET_ICONS;
19979
- var init_wallets = __esm({
19980
- "src/internal/assets/wallets/index.tsx"() {
19981
- import_lucide_react58 = require("lucide-react");
19982
- init_MetaMaskIcon();
19983
20035
  import_jsx_runtime92 = require("react/jsx-runtime");
19984
- WALLET_ICONS = {
19985
- metamask: MetaMaskIcon,
19986
- default: (props) => /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_lucide_react58.Wallet2Icon, { ...props })
19987
- };
19988
- }
19989
- });
19990
-
19991
- // src/internal/components/SendMenu/hyperbridge/hooks/useAvailableSenders.ts
19992
- function useAvailableSenders() {
19993
- const address = useSession((st) => st.address);
19994
- const activeChainId = useSession((st) => st.activeChainId);
19995
- const { profiles } = useLinkedProfiles();
19996
- const walletProfiles = profiles.filter((p) => p.provider === "wallet");
19997
- const lastCalcedSenders = (0, import_react65.useRef)([]);
19998
- (0, import_react65.useEffect)(() => {
19999
- const sendersAccumulator = [
20000
- {
20001
- type: "embarkai-wallet",
20002
- name: "embarkAI",
20003
- chainId: activeChainId,
20004
- address,
20005
- Icon: TOKENS_ICONS["EMBARKAI"]
20006
- }
20007
- ];
20008
- if (!!walletProfiles.length) {
20009
- walletProfiles.forEach((wProfile) => {
20010
- sendersAccumulator.push({
20011
- type: "direct-wallet",
20012
- name: wProfile?.meta?.walletName || "External wallet",
20013
- chainId: null,
20014
- address: wProfile?.externalId,
20015
- Icon: WALLET_ICONS[wProfile?.meta?.walletName?.toLowerCase()] || WALLET_ICONS["default"]
20016
- });
20017
- });
20018
- }
20019
- if (sendersAccumulator.map((s) => `${s.name}-${s.address}`).join(",") === lastCalcedSenders.current.join(",")) {
20020
- return;
20021
- }
20022
- lastCalcedSenders.current = sendersAccumulator.map((s) => `${s.name}-${s.address}`);
20023
- useBridgeStore.getState().setBridgeSenders(sendersAccumulator);
20024
- useFlowSelectorStore.getState().setRenderKey(`sender-selected-${Date.now()}`);
20025
- }, [address, walletProfiles, activeChainId]);
20026
- }
20027
- var import_react65;
20028
- var init_useAvailableSenders = __esm({
20029
- "src/internal/components/SendMenu/hyperbridge/hooks/useAvailableSenders.ts"() {
20030
- init_SessionContext();
20031
- init_tokens();
20032
- init_linkedProfiles();
20033
- import_react65 = require("react");
20034
- init_wallets();
20035
- init_useFlowSelector();
20036
- init_useBridgeStore();
20037
20036
  }
20038
20037
  });
20039
20038
 
@@ -20201,7 +20200,6 @@ function SelectStep(props) {
20201
20200
  setAmount,
20202
20201
  setRecipient
20203
20202
  } = useBridgeStore();
20204
- useAvailableSenders();
20205
20203
  const selectedSender = useBridgeStore((st) => st.bridgeSenders.find((s) => s.type === st.bridgeSender));
20206
20204
  const { routeTokenBalance, isRouteTokenBalanceLoading } = useBridgeBalance(hyperlaneWarpRoutes);
20207
20205
  const selectedWarpRoute = hyperlaneWarpRoutes.find((route) => {
@@ -20441,7 +20439,6 @@ var init_SelectStep = __esm({
20441
20439
  init_input();
20442
20440
  init_useFlowSelector();
20443
20441
  init_ResolveChainIcon();
20444
- init_useAvailableSenders();
20445
20442
  init_useBridgeBalance();
20446
20443
  init_chains();
20447
20444
  init_useBridgeStore();
@@ -20737,7 +20734,7 @@ var init_useHyperlaneHistory = __esm({
20737
20734
  init_api3();
20738
20735
  init_useBridgeStore();
20739
20736
  HYPERLANE_HISTORY_QUERY_KEY = "hyperlane-tx-history-query-key";
20740
- TX_HISTORY_PAGE_SIZE = 3;
20737
+ TX_HISTORY_PAGE_SIZE = 6;
20741
20738
  TX_HISTORY_POLLING_INTERVAL = 1e3 * 45;
20742
20739
  }
20743
20740
  });
@@ -21127,6 +21124,7 @@ function HyperlaneBridge() {
21127
21124
  const bridgeStep = useBridgeStore((st) => st.bridgeStep);
21128
21125
  const { swapDirection, handleQuoteEstimation, bridgeAsset, isAssetBridging } = useBridge();
21129
21126
  const { hyperlaneWarpRoutes, isLoadingWarpRoutes } = useHyperlaneRoutes();
21127
+ const { profiles } = useAvailableSenders();
21130
21128
  useMenuTitle(hyperlaneWarpRoutes);
21131
21129
  (0, import_react71.useEffect)(
21132
21130
  () => () => {
@@ -21135,7 +21133,7 @@ function HyperlaneBridge() {
21135
21133
  []
21136
21134
  );
21137
21135
  return /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(import_jsx_runtime99.Fragment, { children: [
21138
- bridgeStep === "sender-selector" && /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(SenderSelector, {}),
21136
+ bridgeStep === "sender-selector" && /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(SenderSelector, { profiles }),
21139
21137
  bridgeStep === "select" && /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
21140
21138
  SelectStep,
21141
21139
  {
@@ -21167,6 +21165,7 @@ var init_HyperlaneBridge = __esm({
21167
21165
  "src/internal/components/SendMenu/hyperbridge/HyperlaneBridge.tsx"() {
21168
21166
  import_react71 = require("react");
21169
21167
  init_SenderSelector();
21168
+ init_useAvailableSenders();
21170
21169
  init_useBridge();
21171
21170
  init_useHyperlaneRoutes();
21172
21171
  init_useMenuTitle();
@@ -24107,7 +24106,7 @@ var init_package = __esm({
24107
24106
  "package.json"() {
24108
24107
  package_default = {
24109
24108
  name: "@embarkai/ui-kit",
24110
- version: "0.4.34",
24109
+ version: "0.4.36",
24111
24110
  description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
24112
24111
  type: "module",
24113
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 useEffect34 } from "react";
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
- useEffect34(() => {
19854
+ useEffect35(() => {
19713
19855
  if (!errorWarpRoutes) return;
19714
19856
  useFlowSelectorStore.getState().setError(errorWarpRoutes.message);
19715
19857
  const { resetSelections, setRecipient, setOriginChain, setDestinationChain } = useBridgeStore.getState();
@@ -19718,15 +19860,14 @@ function useHyperlaneRoutes() {
19718
19860
  setOriginChain(null);
19719
19861
  setDestinationChain(null);
19720
19862
  }, [errorWarpRoutes]);
19721
- useEffect34(() => {
19863
+ useEffect35(() => {
19722
19864
  if (!!hyperRoute || !hyperlaneWarpRoutes.length) return;
19723
19865
  const warpRouteToAutoSelect = hyperlaneWarpRoutes.find((route) => route.routeId === hyperRoute);
19866
+ if (!warpRouteToAutoSelect) return;
19724
19867
  let originChainIndex = 0;
19725
19868
  let destinationChainIndex = 1;
19726
19869
  if (useBridgeStore.getState().bridgeSender === "embarkai-wallet") {
19727
- const foundIdx = warpRouteToAutoSelect.chainPair.findIndex(
19728
- (chain) => isOririnChainEmbarkSupported(chain.chainName)
19729
- );
19870
+ const foundIdx = warpRouteToAutoSelect.chainPair?.findIndex((chain) => isOririnChainEmbarkSupported(chain.chainName)) || -1;
19730
19871
  if (foundIdx !== -1) {
19731
19872
  originChainIndex = foundIdx;
19732
19873
  destinationChainIndex = foundIdx === 0 ? 1 : 0;
@@ -19752,13 +19893,13 @@ var init_useHyperlaneRoutes = __esm({
19752
19893
  });
19753
19894
 
19754
19895
  // src/internal/components/SendMenu/hyperbridge/hooks/useMenuTitle.ts
19755
- import { useEffect as useEffect35 } from "react";
19896
+ import { useEffect as useEffect36 } from "react";
19756
19897
  function useMenuTitle(warpRoutes) {
19757
19898
  const { t } = useT();
19758
19899
  const bridgeStep = useBridgeStore((st) => st.bridgeStep);
19759
19900
  const hyperRoute = useBridgeStore((st) => st.hyperRoute);
19760
19901
  const hyperRouteMeta = warpRoutes?.length ? warpRoutes.find((route) => route.routeId === hyperRoute) : null;
19761
- useEffect35(() => {
19902
+ useEffect36(() => {
19762
19903
  const updateMenuTitle = useFlowSelectorStore.getState().setMenuTitle;
19763
19904
  switch (true) {
19764
19905
  case bridgeStep === "sender-selector":
@@ -19795,10 +19936,10 @@ var init_useMenuTitle = __esm({
19795
19936
  });
19796
19937
 
19797
19938
  // src/internal/components/SendMenu/hyperbridge/components/ResolveChainIcon.tsx
19798
- import { jsx as jsx90 } from "react/jsx-runtime";
19939
+ import { jsx as jsx92 } from "react/jsx-runtime";
19799
19940
  function ResolveChainIcon(props) {
19800
19941
  const Icon2 = CHAINS_UI_META[props.chainName]?.Icon || TOKENS_ICONS.EMBARKAI;
19801
- return /* @__PURE__ */ jsx90(Icon2, { className: props.className || "w-4 h-4" });
19942
+ return /* @__PURE__ */ jsx92(Icon2, { className: props.className || "w-4 h-4" });
19802
19943
  }
19803
19944
  var init_ResolveChainIcon = __esm({
19804
19945
  "src/internal/components/SendMenu/hyperbridge/components/ResolveChainIcon.tsx"() {
@@ -19807,148 +19948,6 @@ var init_ResolveChainIcon = __esm({
19807
19948
  }
19808
19949
  });
19809
19950
 
19810
- // src/internal/assets/wallets/MetaMaskIcon.tsx
19811
- import { jsx as jsx91, jsxs as jsxs84 } from "react/jsx-runtime";
19812
- function MetaMaskIcon(props) {
19813
- const { width = "24", height = "24", ...svgProps } = props;
19814
- return /* @__PURE__ */ jsxs84(
19815
- "svg",
19816
- {
19817
- ...svgProps,
19818
- width,
19819
- height,
19820
- version: "1.1",
19821
- id: "Layer_1",
19822
- xmlns: "http://www.w3.org/2000/svg",
19823
- x: "0px",
19824
- y: "0px",
19825
- viewBox: "0 0 142 136.878",
19826
- style: {
19827
- // enableBackground: 'new 0 0 142 136.878',
19828
- flexShrink: 0
19829
- },
19830
- xmlSpace: "preserve",
19831
- children: [
19832
- /* @__PURE__ */ jsx91(
19833
- "path",
19834
- {
19835
- fill: "#FF5C16",
19836
- 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"
19837
- }
19838
- ),
19839
- /* @__PURE__ */ jsx91(
19840
- "path",
19841
- {
19842
- fill: "#FF5C16",
19843
- 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"
19844
- }
19845
- ),
19846
- /* @__PURE__ */ jsx91(
19847
- "path",
19848
- {
19849
- fill: "#E34807",
19850
- 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"
19851
- }
19852
- ),
19853
- /* @__PURE__ */ jsx91(
19854
- "path",
19855
- {
19856
- fill: "#FF8D5D",
19857
- 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"
19858
- }
19859
- ),
19860
- /* @__PURE__ */ jsx91(
19861
- "path",
19862
- {
19863
- fill: "#661800",
19864
- 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"
19865
- }
19866
- ),
19867
- /* @__PURE__ */ jsx91(
19868
- "path",
19869
- {
19870
- fill: "#C0C4CD",
19871
- d: "M79.029,124.384v12.495H62.945v-12.495L79.029,124.384L79.029,124.384z"
19872
- }
19873
- ),
19874
- /* @__PURE__ */ jsx91(
19875
- "path",
19876
- {
19877
- fill: "#E7EBF6",
19878
- 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"
19879
- }
19880
- )
19881
- ]
19882
- }
19883
- );
19884
- }
19885
- var init_MetaMaskIcon = __esm({
19886
- "src/internal/assets/wallets/MetaMaskIcon.tsx"() {
19887
- }
19888
- });
19889
-
19890
- // src/internal/assets/wallets/index.tsx
19891
- import { Wallet2Icon } from "lucide-react";
19892
- import { jsx as jsx92 } from "react/jsx-runtime";
19893
- var WALLET_ICONS;
19894
- var init_wallets = __esm({
19895
- "src/internal/assets/wallets/index.tsx"() {
19896
- init_MetaMaskIcon();
19897
- WALLET_ICONS = {
19898
- metamask: MetaMaskIcon,
19899
- default: (props) => /* @__PURE__ */ jsx92(Wallet2Icon, { ...props })
19900
- };
19901
- }
19902
- });
19903
-
19904
- // src/internal/components/SendMenu/hyperbridge/hooks/useAvailableSenders.ts
19905
- import { useEffect as useEffect36, useRef as useRef18 } from "react";
19906
- function useAvailableSenders() {
19907
- const address = useSession((st) => st.address);
19908
- const activeChainId = useSession((st) => st.activeChainId);
19909
- const { profiles } = useLinkedProfiles();
19910
- const walletProfiles = profiles.filter((p) => p.provider === "wallet");
19911
- const lastCalcedSenders = useRef18([]);
19912
- useEffect36(() => {
19913
- const sendersAccumulator = [
19914
- {
19915
- type: "embarkai-wallet",
19916
- name: "embarkAI",
19917
- chainId: activeChainId,
19918
- address,
19919
- Icon: TOKENS_ICONS["EMBARKAI"]
19920
- }
19921
- ];
19922
- if (!!walletProfiles.length) {
19923
- walletProfiles.forEach((wProfile) => {
19924
- sendersAccumulator.push({
19925
- type: "direct-wallet",
19926
- name: wProfile?.meta?.walletName || "External wallet",
19927
- chainId: null,
19928
- address: wProfile?.externalId,
19929
- Icon: WALLET_ICONS[wProfile?.meta?.walletName?.toLowerCase()] || WALLET_ICONS["default"]
19930
- });
19931
- });
19932
- }
19933
- if (sendersAccumulator.map((s) => `${s.name}-${s.address}`).join(",") === lastCalcedSenders.current.join(",")) {
19934
- return;
19935
- }
19936
- lastCalcedSenders.current = sendersAccumulator.map((s) => `${s.name}-${s.address}`);
19937
- useBridgeStore.getState().setBridgeSenders(sendersAccumulator);
19938
- useFlowSelectorStore.getState().setRenderKey(`sender-selected-${Date.now()}`);
19939
- }, [address, walletProfiles, activeChainId]);
19940
- }
19941
- var init_useAvailableSenders = __esm({
19942
- "src/internal/components/SendMenu/hyperbridge/hooks/useAvailableSenders.ts"() {
19943
- init_SessionContext();
19944
- init_tokens();
19945
- init_linkedProfiles();
19946
- init_wallets();
19947
- init_useFlowSelector();
19948
- init_useBridgeStore();
19949
- }
19950
- });
19951
-
19952
19951
  // src/internal/components/SendMenu/hyperbridge/hooks/useBridgeBalance.ts
19953
19952
  import { useQuery as useQuery20, useQueryClient as useQueryClient21 } from "@tanstack/react-query";
19954
19953
  import { useCallback as useCallback23, useEffect as useEffect37 } from "react";
@@ -20116,7 +20115,6 @@ function SelectStep(props) {
20116
20115
  setAmount,
20117
20116
  setRecipient
20118
20117
  } = useBridgeStore();
20119
- useAvailableSenders();
20120
20118
  const selectedSender = useBridgeStore((st) => st.bridgeSenders.find((s) => s.type === st.bridgeSender));
20121
20119
  const { routeTokenBalance, isRouteTokenBalanceLoading } = useBridgeBalance(hyperlaneWarpRoutes);
20122
20120
  const selectedWarpRoute = hyperlaneWarpRoutes.find((route) => {
@@ -20353,7 +20351,6 @@ var init_SelectStep = __esm({
20353
20351
  init_input();
20354
20352
  init_useFlowSelector();
20355
20353
  init_ResolveChainIcon();
20356
- init_useAvailableSenders();
20357
20354
  init_useBridgeBalance();
20358
20355
  init_chains();
20359
20356
  init_useBridgeStore();
@@ -20647,7 +20644,7 @@ var init_useHyperlaneHistory = __esm({
20647
20644
  init_api3();
20648
20645
  init_useBridgeStore();
20649
20646
  HYPERLANE_HISTORY_QUERY_KEY = "hyperlane-tx-history-query-key";
20650
- TX_HISTORY_PAGE_SIZE = 3;
20647
+ TX_HISTORY_PAGE_SIZE = 6;
20651
20648
  TX_HISTORY_POLLING_INTERVAL = 1e3 * 45;
20652
20649
  }
20653
20650
  });
@@ -21038,6 +21035,7 @@ function HyperlaneBridge() {
21038
21035
  const bridgeStep = useBridgeStore((st) => st.bridgeStep);
21039
21036
  const { swapDirection, handleQuoteEstimation, bridgeAsset, isAssetBridging } = useBridge();
21040
21037
  const { hyperlaneWarpRoutes, isLoadingWarpRoutes } = useHyperlaneRoutes();
21038
+ const { profiles } = useAvailableSenders();
21041
21039
  useMenuTitle(hyperlaneWarpRoutes);
21042
21040
  useEffect39(
21043
21041
  () => () => {
@@ -21046,7 +21044,7 @@ function HyperlaneBridge() {
21046
21044
  []
21047
21045
  );
21048
21046
  return /* @__PURE__ */ jsxs90(Fragment38, { children: [
21049
- bridgeStep === "sender-selector" && /* @__PURE__ */ jsx99(SenderSelector, {}),
21047
+ bridgeStep === "sender-selector" && /* @__PURE__ */ jsx99(SenderSelector, { profiles }),
21050
21048
  bridgeStep === "select" && /* @__PURE__ */ jsx99(
21051
21049
  SelectStep,
21052
21050
  {
@@ -21076,6 +21074,7 @@ function HyperlaneBridge() {
21076
21074
  var init_HyperlaneBridge = __esm({
21077
21075
  "src/internal/components/SendMenu/hyperbridge/HyperlaneBridge.tsx"() {
21078
21076
  init_SenderSelector();
21077
+ init_useAvailableSenders();
21079
21078
  init_useBridge();
21080
21079
  init_useHyperlaneRoutes();
21081
21080
  init_useMenuTitle();
@@ -24007,7 +24006,7 @@ var init_package = __esm({
24007
24006
  "package.json"() {
24008
24007
  package_default = {
24009
24008
  name: "@embarkai/ui-kit",
24010
- version: "0.4.34",
24009
+ version: "0.4.36",
24011
24010
  description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
24012
24011
  type: "module",
24013
24012
  main: "./dist/index.cjs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@embarkai/ui-kit",
3
- "version": "0.4.34",
3
+ "version": "0.4.36",
4
4
  "description": "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",