@embarkai/ui-kit 0.4.61 → 0.4.63

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.61</title>
18
+ <title>EmbarkAI Secure Wallet - iframe version 0.4.63</title>
19
19
 
20
20
  <!-- Styles will be injected by build process -->
21
21
  <style>
@@ -6398,7 +6398,7 @@ var SigningManager = class extends TokenRefreshApiClient {
6398
6398
  };
6399
6399
 
6400
6400
  // src/iframe/main.ts
6401
- var IFRAME_VERSION = "0.4.61";
6401
+ var IFRAME_VERSION = "0.4.63";
6402
6402
  var IframeWallet = class {
6403
6403
  constructor() {
6404
6404
  console.log("=".repeat(60));
package/dist/index.cjs CHANGED
@@ -1023,8 +1023,8 @@ function BalanceFeedProvider() {
1023
1023
  if (!isProjectAssetBalanceEnabled || !projectAssetBalance) return;
1024
1024
  const { cryptoFiatRate, fiatFormatted, cryptoFormatted, cryptoSymbol, fiatSymbol } = projectAssetBalance;
1025
1025
  const { setCryptoRate, setFiatBalance, setBalance, setCryptoSymbol, setFiatSymbol } = useLayoutDataStore.getState();
1026
- if (!!cryptoSymbol) setCryptoSymbol(cryptoSymbol?.toUpperCase());
1027
- if (!!fiatSymbol) setFiatSymbol(fiatSymbol?.toUpperCase());
1026
+ if (!!cryptoSymbol) setCryptoSymbol(cryptoSymbol);
1027
+ if (!!fiatSymbol) setFiatSymbol(fiatSymbol);
1028
1028
  setCryptoRate(cryptoFiatRate || 1);
1029
1029
  setFiatBalance(fiatFormatted || 0);
1030
1030
  setBalance({
@@ -1097,7 +1097,7 @@ var init_BalanceFeedProvider = __esm({
1097
1097
  NATIVE_BALANCE_QUERY_KEY = "embarkai-native-balance-query-key";
1098
1098
  CUSTOM_BALANCE_QUERY_KEY = "embarkai-custom-balance-query-key";
1099
1099
  LUMIA_RATE_QUERY_KEY = "lembarkai-root-balance-rate-query-key";
1100
- SKIP_SYMBOLS = ["TEST", "USDT", "P"];
1100
+ SKIP_SYMBOLS = ["TEST", "USDT", "P", "$P USDT"];
1101
1101
  }
1102
1102
  });
1103
1103
 
@@ -18120,7 +18120,7 @@ var init_no_image = __esm({
18120
18120
  function BalanceView(props) {
18121
18121
  const { className } = props;
18122
18122
  const config = useProviderConfig().config;
18123
- const showFiatBalance = config.current?.features?.showActiveBalanceAsFiat;
18123
+ const showFiatBalance = !!config.current?.features?.showActiveBalanceAsFiat;
18124
18124
  const balance = useLayoutDataStore((st) => st.balance);
18125
18125
  const cryptoSymbol = useLayoutDataStore((st) => st.cryptoSymbol);
18126
18126
  const cryptoBalance = Number((0, import_viem9.formatUnits)(balance?.value || BigInt(0), balance?.decimals || 18));
@@ -18139,11 +18139,10 @@ function BalanceView(props) {
18139
18139
  children: [
18140
18140
  !!BalanceIcon && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(BalanceIcon, { className: "w-5 h-5" }),
18141
18141
  /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("span", { children: [
18142
- showFiatBalance && !!fiatBalance && BALANCE_PREFIXES[fiatSymbol],
18142
+ BALANCE_PREFIXES[showFiatBalance ? fiatSymbol : cryptoSymbol],
18143
18143
  formatPrice(showFiatBalance ? fiatBalance : cryptoBalance)
18144
18144
  ] }),
18145
- showFiatBalance && !!fiatBalance && !BALANCE_PREFIXES[fiatSymbol] && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { children: fiatSymbol }),
18146
- !showFiatBalance && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { children: cryptoSymbol })
18145
+ !BALANCE_PREFIXES[showFiatBalance ? fiatSymbol : cryptoSymbol] && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { children: showFiatBalance ? fiatSymbol : cryptoSymbol })
18147
18146
  ]
18148
18147
  }
18149
18148
  );
@@ -18159,11 +18158,15 @@ var init_BalanceView = __esm({
18159
18158
  import_viem9 = require("viem");
18160
18159
  import_jsx_runtime81 = require("react/jsx-runtime");
18161
18160
  BALANCE_PREFIXES = {
18162
- P: "$P\xA0",
18161
+ /** PARLAY */
18162
+ "$P USDT": "$P\xA0",
18163
18163
  // Special case for the P token, with a space
18164
- USD: "$",
18165
- EUR: "\u20AC",
18166
- GBP: "\xA3"
18164
+ "P": "$P\xA0",
18165
+ // Special case for the P token, with a space
18166
+ /** COMMON */
18167
+ "USD": "$",
18168
+ "EUR": "\u20AC",
18169
+ "GBP": "\xA3"
18167
18170
  };
18168
18171
  }
18169
18172
  });
@@ -18278,6 +18281,7 @@ function PortfolioItem(props) {
18278
18281
  const { address, asset, isProjectAsset } = props;
18279
18282
  const providerConfig = useProviderConfig().config.current;
18280
18283
  const customAssetRateQuery = providerConfig.portfolio?.assetRateQuery;
18284
+ const customAssetRateQueryKey = providerConfig.portfolio?.assetRateQueryKey;
18281
18285
  const projectAssetQuery = isProjectAsset && isProjectAssetConfig(asset) ? {
18282
18286
  queryKey: asset.balanceQueryKey,
18283
18287
  queryFn: asset.balanceQuery
@@ -18296,7 +18300,7 @@ function PortfolioItem(props) {
18296
18300
  enabled: !!address && !hasEmbeddedRate && !isProjectAsset && !isNft && !isSecurity && (!!customAssetRateQuery || !!isAssetRateAvailable(asset.symbol)),
18297
18301
  retry: false,
18298
18302
  staleTime: 4 * 60 * 1e3,
18299
- queryKey: [ASSETS_RATES_QUERY_KEY, address, asset.address, asset.symbol],
18303
+ queryKey: customAssetRateQuery && customAssetRateQueryKey ? customAssetRateQueryKey : [ASSETS_RATES_QUERY_KEY, address, asset.address, asset.symbol],
18300
18304
  // customAssetRateQueryKey
18301
18305
  queryFn: async () => await resolveAssetRate(asset.symbol, asset.address, customAssetRateQuery)
18302
18306
  });
@@ -18380,7 +18384,7 @@ var init_PortfolioItem = __esm({
18380
18384
  init_truncateMiddle();
18381
18385
  init_BalanceView2();
18382
18386
  import_jsx_runtime82 = require("react/jsx-runtime");
18383
- SKIP_SYMBOLS2 = ["TEST"];
18387
+ SKIP_SYMBOLS2 = ["TEST", "USDT", "P", "$P USDT"];
18384
18388
  ASSETS_RATES_QUERY_KEY = "lumia-passport-assets-rates-query-key";
18385
18389
  }
18386
18390
  });
@@ -24595,7 +24599,7 @@ var init_package = __esm({
24595
24599
  "package.json"() {
24596
24600
  package_default = {
24597
24601
  name: "@embarkai/ui-kit",
24598
- version: "0.4.61",
24602
+ version: "0.4.63",
24599
24603
  description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
24600
24604
  type: "module",
24601
24605
  main: "./dist/index.cjs",
package/dist/index.d.cts CHANGED
@@ -180,6 +180,14 @@ interface ProjectAsset extends Omit<Asset, 'type'> {
180
180
  balanceQuery: () => Promise<ProjectAssetBalance>;
181
181
  hideInPortfolio?: boolean;
182
182
  }
183
+ interface AssetRateQueryInput {
184
+ symbol: string;
185
+ address?: `0x${string}`;
186
+ }
187
+ interface AssetRateQueryResult {
188
+ symbol: string;
189
+ price: string;
190
+ }
183
191
  /**
184
192
  * Token configuration for custom token watching.
185
193
  * Used when chain doesn't have Blockscout API or for project-specific tokens.
@@ -238,6 +246,8 @@ interface ProviderConfig {
238
246
  portfolio?: {
239
247
  tokenBalancesQuery?: (address: `0x${string}`) => Promise<BlockscoutTokenBalance[]>;
240
248
  tokenBalancesQueryKey?: readonly unknown[];
249
+ assetRateQuery?: (input: AssetRateQueryInput) => Promise<AssetRateQueryResult | null>;
250
+ assetRateQueryKey?: readonly unknown[];
241
251
  };
242
252
  /**
243
253
  * Custom tokens to monitor per chain.
package/dist/index.d.ts CHANGED
@@ -180,6 +180,14 @@ interface ProjectAsset extends Omit<Asset, 'type'> {
180
180
  balanceQuery: () => Promise<ProjectAssetBalance>;
181
181
  hideInPortfolio?: boolean;
182
182
  }
183
+ interface AssetRateQueryInput {
184
+ symbol: string;
185
+ address?: `0x${string}`;
186
+ }
187
+ interface AssetRateQueryResult {
188
+ symbol: string;
189
+ price: string;
190
+ }
183
191
  /**
184
192
  * Token configuration for custom token watching.
185
193
  * Used when chain doesn't have Blockscout API or for project-specific tokens.
@@ -238,6 +246,8 @@ interface ProviderConfig {
238
246
  portfolio?: {
239
247
  tokenBalancesQuery?: (address: `0x${string}`) => Promise<BlockscoutTokenBalance[]>;
240
248
  tokenBalancesQueryKey?: readonly unknown[];
249
+ assetRateQuery?: (input: AssetRateQueryInput) => Promise<AssetRateQueryResult | null>;
250
+ assetRateQueryKey?: readonly unknown[];
241
251
  };
242
252
  /**
243
253
  * Custom tokens to monitor per chain.
package/dist/index.js CHANGED
@@ -1016,8 +1016,8 @@ function BalanceFeedProvider() {
1016
1016
  if (!isProjectAssetBalanceEnabled || !projectAssetBalance) return;
1017
1017
  const { cryptoFiatRate, fiatFormatted, cryptoFormatted, cryptoSymbol, fiatSymbol } = projectAssetBalance;
1018
1018
  const { setCryptoRate, setFiatBalance, setBalance, setCryptoSymbol, setFiatSymbol } = useLayoutDataStore.getState();
1019
- if (!!cryptoSymbol) setCryptoSymbol(cryptoSymbol?.toUpperCase());
1020
- if (!!fiatSymbol) setFiatSymbol(fiatSymbol?.toUpperCase());
1019
+ if (!!cryptoSymbol) setCryptoSymbol(cryptoSymbol);
1020
+ if (!!fiatSymbol) setFiatSymbol(fiatSymbol);
1021
1021
  setCryptoRate(cryptoFiatRate || 1);
1022
1022
  setFiatBalance(fiatFormatted || 0);
1023
1023
  setBalance({
@@ -1086,7 +1086,7 @@ var init_BalanceFeedProvider = __esm({
1086
1086
  NATIVE_BALANCE_QUERY_KEY = "embarkai-native-balance-query-key";
1087
1087
  CUSTOM_BALANCE_QUERY_KEY = "embarkai-custom-balance-query-key";
1088
1088
  LUMIA_RATE_QUERY_KEY = "lembarkai-root-balance-rate-query-key";
1089
- SKIP_SYMBOLS = ["TEST", "USDT", "P"];
1089
+ SKIP_SYMBOLS = ["TEST", "USDT", "P", "$P USDT"];
1090
1090
  }
1091
1091
  });
1092
1092
 
@@ -18051,7 +18051,7 @@ import { jsx as jsx81, jsxs as jsxs75 } from "react/jsx-runtime";
18051
18051
  function BalanceView(props) {
18052
18052
  const { className } = props;
18053
18053
  const config = useProviderConfig().config;
18054
- const showFiatBalance = config.current?.features?.showActiveBalanceAsFiat;
18054
+ const showFiatBalance = !!config.current?.features?.showActiveBalanceAsFiat;
18055
18055
  const balance = useLayoutDataStore((st) => st.balance);
18056
18056
  const cryptoSymbol = useLayoutDataStore((st) => st.cryptoSymbol);
18057
18057
  const cryptoBalance = Number(formatUnits5(balance?.value || BigInt(0), balance?.decimals || 18));
@@ -18070,11 +18070,10 @@ function BalanceView(props) {
18070
18070
  children: [
18071
18071
  !!BalanceIcon && /* @__PURE__ */ jsx81(BalanceIcon, { className: "w-5 h-5" }),
18072
18072
  /* @__PURE__ */ jsxs75("span", { children: [
18073
- showFiatBalance && !!fiatBalance && BALANCE_PREFIXES[fiatSymbol],
18073
+ BALANCE_PREFIXES[showFiatBalance ? fiatSymbol : cryptoSymbol],
18074
18074
  formatPrice(showFiatBalance ? fiatBalance : cryptoBalance)
18075
18075
  ] }),
18076
- showFiatBalance && !!fiatBalance && !BALANCE_PREFIXES[fiatSymbol] && /* @__PURE__ */ jsx81("span", { children: fiatSymbol }),
18077
- !showFiatBalance && /* @__PURE__ */ jsx81("span", { children: cryptoSymbol })
18076
+ !BALANCE_PREFIXES[showFiatBalance ? fiatSymbol : cryptoSymbol] && /* @__PURE__ */ jsx81("span", { children: showFiatBalance ? fiatSymbol : cryptoSymbol })
18078
18077
  ]
18079
18078
  }
18080
18079
  );
@@ -18088,11 +18087,15 @@ var init_BalanceView = __esm({
18088
18087
  init_utils2();
18089
18088
  init_ProviderContext();
18090
18089
  BALANCE_PREFIXES = {
18091
- P: "$P\xA0",
18090
+ /** PARLAY */
18091
+ "$P USDT": "$P\xA0",
18092
18092
  // Special case for the P token, with a space
18093
- USD: "$",
18094
- EUR: "\u20AC",
18095
- GBP: "\xA3"
18093
+ "P": "$P\xA0",
18094
+ // Special case for the P token, with a space
18095
+ /** COMMON */
18096
+ "USD": "$",
18097
+ "EUR": "\u20AC",
18098
+ "GBP": "\xA3"
18096
18099
  };
18097
18100
  }
18098
18101
  });
@@ -18211,6 +18214,7 @@ function PortfolioItem(props) {
18211
18214
  const { address, asset, isProjectAsset } = props;
18212
18215
  const providerConfig = useProviderConfig().config.current;
18213
18216
  const customAssetRateQuery = providerConfig.portfolio?.assetRateQuery;
18217
+ const customAssetRateQueryKey = providerConfig.portfolio?.assetRateQueryKey;
18214
18218
  const projectAssetQuery = isProjectAsset && isProjectAssetConfig(asset) ? {
18215
18219
  queryKey: asset.balanceQueryKey,
18216
18220
  queryFn: asset.balanceQuery
@@ -18229,7 +18233,7 @@ function PortfolioItem(props) {
18229
18233
  enabled: !!address && !hasEmbeddedRate && !isProjectAsset && !isNft && !isSecurity && (!!customAssetRateQuery || !!isAssetRateAvailable(asset.symbol)),
18230
18234
  retry: false,
18231
18235
  staleTime: 4 * 60 * 1e3,
18232
- queryKey: [ASSETS_RATES_QUERY_KEY, address, asset.address, asset.symbol],
18236
+ queryKey: customAssetRateQuery && customAssetRateQueryKey ? customAssetRateQueryKey : [ASSETS_RATES_QUERY_KEY, address, asset.address, asset.symbol],
18233
18237
  // customAssetRateQueryKey
18234
18238
  queryFn: async () => await resolveAssetRate(asset.symbol, asset.address, customAssetRateQuery)
18235
18239
  });
@@ -18309,7 +18313,7 @@ var init_PortfolioItem = __esm({
18309
18313
  init_utils2();
18310
18314
  init_truncateMiddle();
18311
18315
  init_BalanceView2();
18312
- SKIP_SYMBOLS2 = ["TEST"];
18316
+ SKIP_SYMBOLS2 = ["TEST", "USDT", "P", "$P USDT"];
18313
18317
  ASSETS_RATES_QUERY_KEY = "lumia-passport-assets-rates-query-key";
18314
18318
  }
18315
18319
  });
@@ -24501,7 +24505,7 @@ var init_package = __esm({
24501
24505
  "package.json"() {
24502
24506
  package_default = {
24503
24507
  name: "@embarkai/ui-kit",
24504
- version: "0.4.61",
24508
+ version: "0.4.63",
24505
24509
  description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
24506
24510
  type: "module",
24507
24511
  main: "./dist/index.cjs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@embarkai/ui-kit",
3
- "version": "0.4.61",
3
+ "version": "0.4.63",
4
4
  "description": "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",