@embarkai/ui-kit 0.4.37 → 0.4.38

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.37</title>
18
+ <title>EmbarkAI Secure Wallet - iframe version 0.4.38</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.37";
6394
+ var IFRAME_VERSION = "0.4.38";
6395
6395
  var IframeWallet = class {
6396
6396
  constructor() {
6397
6397
  console.log("=".repeat(60));
package/dist/index.cjs CHANGED
@@ -19173,7 +19173,6 @@ var init_useBridgeStore = __esm({
19173
19173
  bridgeStep: "select",
19174
19174
  bridgeType: "hyper",
19175
19175
  bridgeSender: "embarkai-wallet",
19176
- bridgeSenders: [],
19177
19176
  amount: "",
19178
19177
  quote: null,
19179
19178
  isQuoteEstimating: false,
@@ -19182,6 +19181,7 @@ var init_useBridgeStore = __esm({
19182
19181
  useBridgeStore = (0, import_zustand10.create)()(
19183
19182
  (0, import_middleware3.persist)(
19184
19183
  (set, get) => ({
19184
+ bridgeSenders: [],
19185
19185
  hyperRoute: null,
19186
19186
  recipient: null,
19187
19187
  originChain: null,
@@ -19497,7 +19497,6 @@ var init_wallets = __esm({
19497
19497
  // src/internal/components/SendMenu/hyperbridge/hooks/useAvailableSenders.ts
19498
19498
  function useAvailableSenders() {
19499
19499
  const address = useSession((st) => st.address);
19500
- const activeChainId = useSession((st) => st.activeChainId);
19501
19500
  const { profiles } = useLinkedProfiles();
19502
19501
  const lastCalcedSenders = (0, import_react62.useRef)([]);
19503
19502
  (0, import_react62.useEffect)(() => {
@@ -19505,7 +19504,7 @@ function useAvailableSenders() {
19505
19504
  {
19506
19505
  type: "embarkai-wallet",
19507
19506
  name: "embarkAI",
19508
- chainId: activeChainId,
19507
+ chainId: null,
19509
19508
  address,
19510
19509
  Icon: TOKENS_ICONS["EMBARKAI"]
19511
19510
  }
@@ -19524,9 +19523,10 @@ function useAvailableSenders() {
19524
19523
  return;
19525
19524
  }
19526
19525
  lastCalcedSenders.current = sendersAccumulator.map((s) => `${s.name}-${s.address}`);
19526
+ console.info("[SENDER SELECTOR] setting bridge senders", sendersAccumulator);
19527
19527
  useBridgeStore.getState().setBridgeSenders(sendersAccumulator);
19528
19528
  useFlowSelectorStore.getState().setRenderKey(`sender-selected-${Date.now()}`);
19529
- }, [address, profiles, activeChainId]);
19529
+ }, [address, profiles]);
19530
19530
  return {
19531
19531
  directWalletProfile: profiles.filter((p) => p.provider === "wallet")[0] || null
19532
19532
  };
@@ -20192,17 +20192,16 @@ function SelectStep(props) {
20192
20192
  const { swapChains, hyperlaneWarpRoutes, isLoadingWarpRoutes, handleQuoteEstimation } = props;
20193
20193
  const { t } = useT();
20194
20194
  const {
20195
+ bridgeSenders,
20196
+ bridgeSender,
20195
20197
  originChain,
20196
20198
  destinationChain,
20197
20199
  hyperRoute,
20198
20200
  amount,
20199
20201
  isQuoteEstimating,
20200
- recipient,
20201
- setBridgeStep,
20202
- setAmount,
20203
- setRecipient
20202
+ recipient
20204
20203
  } = useBridgeStore();
20205
- const selectedSender = useBridgeStore((st) => st.bridgeSenders?.find((s) => s.type === st.bridgeSender)) || null;
20204
+ const selectedSender = bridgeSenders?.find((s) => s.type === bridgeSender) || null;
20206
20205
  const { routeTokenBalance, isRouteTokenBalanceLoading } = useBridgeBalance(hyperlaneWarpRoutes);
20207
20206
  const selectedWarpRoute = hyperlaneWarpRoutes.find((route) => {
20208
20207
  const { routeId, chainPair } = route;
@@ -20234,7 +20233,7 @@ function SelectStep(props) {
20234
20233
  className: "w-full justify-between",
20235
20234
  onClick: () => {
20236
20235
  useFlowSelectorStore.getState().setError(null);
20237
- setBridgeStep("sender-selector");
20236
+ useBridgeStore.getState().setBridgeStep("sender-selector");
20238
20237
  },
20239
20238
  children: [
20240
20239
  /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
@@ -20273,7 +20272,7 @@ function SelectStep(props) {
20273
20272
  className: "w-full justify-between",
20274
20273
  onClick: () => {
20275
20274
  useFlowSelectorStore.getState().setError(null);
20276
- setBridgeStep("select-token");
20275
+ useBridgeStore.getState().setBridgeStep("select-token");
20277
20276
  },
20278
20277
  children: [
20279
20278
  selectedWarpRoute ? /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
@@ -20357,9 +20356,9 @@ function SelectStep(props) {
20357
20356
  }
20358
20357
  if (regex.test(value) || value === "") {
20359
20358
  if (value === "") {
20360
- setAmount("0");
20359
+ useBridgeStore.getState().setAmount("0");
20361
20360
  } else {
20362
- setAmount(value);
20361
+ useBridgeStore.getState().setAmount(value);
20363
20362
  }
20364
20363
  }
20365
20364
  },
@@ -20390,7 +20389,7 @@ function SelectStep(props) {
20390
20389
  Icon: import_lucide_react59.Wallet2Icon,
20391
20390
  onChange: (e) => {
20392
20391
  useFlowSelectorStore.getState().setError(null);
20393
- setRecipient(e.target.value);
20392
+ useBridgeStore.getState().setRecipient(e.target.value);
20394
20393
  },
20395
20394
  element: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
20396
20395
  Button,
@@ -20400,7 +20399,7 @@ function SelectStep(props) {
20400
20399
  variant: "ghost",
20401
20400
  onClick: (e) => {
20402
20401
  e.stopPropagation();
20403
- setRecipient(null);
20402
+ useBridgeStore.getState().setRecipient(null);
20404
20403
  },
20405
20404
  children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_lucide_react59.XIcon, { className: "w-4 h-4" })
20406
20405
  }
@@ -24115,7 +24114,7 @@ var init_package = __esm({
24115
24114
  "package.json"() {
24116
24115
  package_default = {
24117
24116
  name: "@embarkai/ui-kit",
24118
- version: "0.4.37",
24117
+ version: "0.4.38",
24119
24118
  description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
24120
24119
  type: "module",
24121
24120
  main: "./dist/index.cjs",
package/dist/index.js CHANGED
@@ -19093,7 +19093,6 @@ var init_useBridgeStore = __esm({
19093
19093
  bridgeStep: "select",
19094
19094
  bridgeType: "hyper",
19095
19095
  bridgeSender: "embarkai-wallet",
19096
- bridgeSenders: [],
19097
19096
  amount: "",
19098
19097
  quote: null,
19099
19098
  isQuoteEstimating: false,
@@ -19102,6 +19101,7 @@ var init_useBridgeStore = __esm({
19102
19101
  useBridgeStore = create10()(
19103
19102
  persist3(
19104
19103
  (set, get) => ({
19104
+ bridgeSenders: [],
19105
19105
  hyperRoute: null,
19106
19106
  recipient: null,
19107
19107
  originChain: null,
@@ -19416,7 +19416,6 @@ var init_wallets = __esm({
19416
19416
  import { useEffect as useEffect34, useRef as useRef18 } from "react";
19417
19417
  function useAvailableSenders() {
19418
19418
  const address = useSession((st) => st.address);
19419
- const activeChainId = useSession((st) => st.activeChainId);
19420
19419
  const { profiles } = useLinkedProfiles();
19421
19420
  const lastCalcedSenders = useRef18([]);
19422
19421
  useEffect34(() => {
@@ -19424,7 +19423,7 @@ function useAvailableSenders() {
19424
19423
  {
19425
19424
  type: "embarkai-wallet",
19426
19425
  name: "embarkAI",
19427
- chainId: activeChainId,
19426
+ chainId: null,
19428
19427
  address,
19429
19428
  Icon: TOKENS_ICONS["EMBARKAI"]
19430
19429
  }
@@ -19443,9 +19442,10 @@ function useAvailableSenders() {
19443
19442
  return;
19444
19443
  }
19445
19444
  lastCalcedSenders.current = sendersAccumulator.map((s) => `${s.name}-${s.address}`);
19445
+ console.info("[SENDER SELECTOR] setting bridge senders", sendersAccumulator);
19446
19446
  useBridgeStore.getState().setBridgeSenders(sendersAccumulator);
19447
19447
  useFlowSelectorStore.getState().setRenderKey(`sender-selected-${Date.now()}`);
19448
- }, [address, profiles, activeChainId]);
19448
+ }, [address, profiles]);
19449
19449
  return {
19450
19450
  directWalletProfile: profiles.filter((p) => p.provider === "wallet")[0] || null
19451
19451
  };
@@ -20107,17 +20107,16 @@ function SelectStep(props) {
20107
20107
  const { swapChains, hyperlaneWarpRoutes, isLoadingWarpRoutes, handleQuoteEstimation } = props;
20108
20108
  const { t } = useT();
20109
20109
  const {
20110
+ bridgeSenders,
20111
+ bridgeSender,
20110
20112
  originChain,
20111
20113
  destinationChain,
20112
20114
  hyperRoute,
20113
20115
  amount,
20114
20116
  isQuoteEstimating,
20115
- recipient,
20116
- setBridgeStep,
20117
- setAmount,
20118
- setRecipient
20117
+ recipient
20119
20118
  } = useBridgeStore();
20120
- const selectedSender = useBridgeStore((st) => st.bridgeSenders?.find((s) => s.type === st.bridgeSender)) || null;
20119
+ const selectedSender = bridgeSenders?.find((s) => s.type === bridgeSender) || null;
20121
20120
  const { routeTokenBalance, isRouteTokenBalanceLoading } = useBridgeBalance(hyperlaneWarpRoutes);
20122
20121
  const selectedWarpRoute = hyperlaneWarpRoutes.find((route) => {
20123
20122
  const { routeId, chainPair } = route;
@@ -20149,7 +20148,7 @@ function SelectStep(props) {
20149
20148
  className: "w-full justify-between",
20150
20149
  onClick: () => {
20151
20150
  useFlowSelectorStore.getState().setError(null);
20152
- setBridgeStep("sender-selector");
20151
+ useBridgeStore.getState().setBridgeStep("sender-selector");
20153
20152
  },
20154
20153
  children: [
20155
20154
  /* @__PURE__ */ jsxs85("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
@@ -20188,7 +20187,7 @@ function SelectStep(props) {
20188
20187
  className: "w-full justify-between",
20189
20188
  onClick: () => {
20190
20189
  useFlowSelectorStore.getState().setError(null);
20191
- setBridgeStep("select-token");
20190
+ useBridgeStore.getState().setBridgeStep("select-token");
20192
20191
  },
20193
20192
  children: [
20194
20193
  selectedWarpRoute ? /* @__PURE__ */ jsxs85("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
@@ -20272,9 +20271,9 @@ function SelectStep(props) {
20272
20271
  }
20273
20272
  if (regex.test(value) || value === "") {
20274
20273
  if (value === "") {
20275
- setAmount("0");
20274
+ useBridgeStore.getState().setAmount("0");
20276
20275
  } else {
20277
- setAmount(value);
20276
+ useBridgeStore.getState().setAmount(value);
20278
20277
  }
20279
20278
  }
20280
20279
  },
@@ -20305,7 +20304,7 @@ function SelectStep(props) {
20305
20304
  Icon: Wallet2Icon2,
20306
20305
  onChange: (e) => {
20307
20306
  useFlowSelectorStore.getState().setError(null);
20308
- setRecipient(e.target.value);
20307
+ useBridgeStore.getState().setRecipient(e.target.value);
20309
20308
  },
20310
20309
  element: /* @__PURE__ */ jsx93(
20311
20310
  Button,
@@ -20315,7 +20314,7 @@ function SelectStep(props) {
20315
20314
  variant: "ghost",
20316
20315
  onClick: (e) => {
20317
20316
  e.stopPropagation();
20318
- setRecipient(null);
20317
+ useBridgeStore.getState().setRecipient(null);
20319
20318
  },
20320
20319
  children: /* @__PURE__ */ jsx93(XIcon, { className: "w-4 h-4" })
20321
20320
  }
@@ -24015,7 +24014,7 @@ var init_package = __esm({
24015
24014
  "package.json"() {
24016
24015
  package_default = {
24017
24016
  name: "@embarkai/ui-kit",
24018
- version: "0.4.37",
24017
+ version: "0.4.38",
24019
24018
  description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
24020
24019
  type: "module",
24021
24020
  main: "./dist/index.cjs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@embarkai/ui-kit",
3
- "version": "0.4.37",
3
+ "version": "0.4.38",
4
4
  "description": "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",