@embarkai/ui-kit 0.4.62 → 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.
- package/dist/iframe/index.html +1 -1
- package/dist/iframe/main.js +1 -1
- package/dist/index.cjs +9 -9
- package/dist/index.d.cts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +9 -9
- 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.63</title>
|
|
19
19
|
|
|
20
20
|
<!-- Styles will be injected by build process -->
|
|
21
21
|
<style>
|
package/dist/iframe/main.js
CHANGED
|
@@ -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.
|
|
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
|
|
1027
|
-
if (!!fiatSymbol) setFiatSymbol(fiatSymbol
|
|
1026
|
+
if (!!cryptoSymbol) setCryptoSymbol(cryptoSymbol);
|
|
1027
|
+
if (!!fiatSymbol) setFiatSymbol(fiatSymbol);
|
|
1028
1028
|
setCryptoRate(cryptoFiatRate || 1);
|
|
1029
1029
|
setFiatBalance(fiatFormatted || 0);
|
|
1030
1030
|
setBalance({
|
|
@@ -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
|
|
18142
|
+
BALANCE_PREFIXES[showFiatBalance ? fiatSymbol : cryptoSymbol],
|
|
18143
18143
|
formatPrice(showFiatBalance ? fiatBalance : cryptoBalance)
|
|
18144
18144
|
] }),
|
|
18145
|
-
showFiatBalance
|
|
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
|
);
|
|
@@ -18282,6 +18281,7 @@ function PortfolioItem(props) {
|
|
|
18282
18281
|
const { address, asset, isProjectAsset } = props;
|
|
18283
18282
|
const providerConfig = useProviderConfig().config.current;
|
|
18284
18283
|
const customAssetRateQuery = providerConfig.portfolio?.assetRateQuery;
|
|
18284
|
+
const customAssetRateQueryKey = providerConfig.portfolio?.assetRateQueryKey;
|
|
18285
18285
|
const projectAssetQuery = isProjectAsset && isProjectAssetConfig(asset) ? {
|
|
18286
18286
|
queryKey: asset.balanceQueryKey,
|
|
18287
18287
|
queryFn: asset.balanceQuery
|
|
@@ -18300,7 +18300,7 @@ function PortfolioItem(props) {
|
|
|
18300
18300
|
enabled: !!address && !hasEmbeddedRate && !isProjectAsset && !isNft && !isSecurity && (!!customAssetRateQuery || !!isAssetRateAvailable(asset.symbol)),
|
|
18301
18301
|
retry: false,
|
|
18302
18302
|
staleTime: 4 * 60 * 1e3,
|
|
18303
|
-
queryKey: [ASSETS_RATES_QUERY_KEY, address, asset.address, asset.symbol],
|
|
18303
|
+
queryKey: customAssetRateQuery && customAssetRateQueryKey ? customAssetRateQueryKey : [ASSETS_RATES_QUERY_KEY, address, asset.address, asset.symbol],
|
|
18304
18304
|
// customAssetRateQueryKey
|
|
18305
18305
|
queryFn: async () => await resolveAssetRate(asset.symbol, asset.address, customAssetRateQuery)
|
|
18306
18306
|
});
|
|
@@ -18384,7 +18384,7 @@ var init_PortfolioItem = __esm({
|
|
|
18384
18384
|
init_truncateMiddle();
|
|
18385
18385
|
init_BalanceView2();
|
|
18386
18386
|
import_jsx_runtime82 = require("react/jsx-runtime");
|
|
18387
|
-
SKIP_SYMBOLS2 = ["TEST"];
|
|
18387
|
+
SKIP_SYMBOLS2 = ["TEST", "USDT", "P", "$P USDT"];
|
|
18388
18388
|
ASSETS_RATES_QUERY_KEY = "lumia-passport-assets-rates-query-key";
|
|
18389
18389
|
}
|
|
18390
18390
|
});
|
|
@@ -24599,7 +24599,7 @@ var init_package = __esm({
|
|
|
24599
24599
|
"package.json"() {
|
|
24600
24600
|
package_default = {
|
|
24601
24601
|
name: "@embarkai/ui-kit",
|
|
24602
|
-
version: "0.4.
|
|
24602
|
+
version: "0.4.63",
|
|
24603
24603
|
description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
|
|
24604
24604
|
type: "module",
|
|
24605
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
|
|
1020
|
-
if (!!fiatSymbol) setFiatSymbol(fiatSymbol
|
|
1019
|
+
if (!!cryptoSymbol) setCryptoSymbol(cryptoSymbol);
|
|
1020
|
+
if (!!fiatSymbol) setFiatSymbol(fiatSymbol);
|
|
1021
1021
|
setCryptoRate(cryptoFiatRate || 1);
|
|
1022
1022
|
setFiatBalance(fiatFormatted || 0);
|
|
1023
1023
|
setBalance({
|
|
@@ -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
|
|
18073
|
+
BALANCE_PREFIXES[showFiatBalance ? fiatSymbol : cryptoSymbol],
|
|
18074
18074
|
formatPrice(showFiatBalance ? fiatBalance : cryptoBalance)
|
|
18075
18075
|
] }),
|
|
18076
|
-
showFiatBalance
|
|
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
|
);
|
|
@@ -18215,6 +18214,7 @@ function PortfolioItem(props) {
|
|
|
18215
18214
|
const { address, asset, isProjectAsset } = props;
|
|
18216
18215
|
const providerConfig = useProviderConfig().config.current;
|
|
18217
18216
|
const customAssetRateQuery = providerConfig.portfolio?.assetRateQuery;
|
|
18217
|
+
const customAssetRateQueryKey = providerConfig.portfolio?.assetRateQueryKey;
|
|
18218
18218
|
const projectAssetQuery = isProjectAsset && isProjectAssetConfig(asset) ? {
|
|
18219
18219
|
queryKey: asset.balanceQueryKey,
|
|
18220
18220
|
queryFn: asset.balanceQuery
|
|
@@ -18233,7 +18233,7 @@ function PortfolioItem(props) {
|
|
|
18233
18233
|
enabled: !!address && !hasEmbeddedRate && !isProjectAsset && !isNft && !isSecurity && (!!customAssetRateQuery || !!isAssetRateAvailable(asset.symbol)),
|
|
18234
18234
|
retry: false,
|
|
18235
18235
|
staleTime: 4 * 60 * 1e3,
|
|
18236
|
-
queryKey: [ASSETS_RATES_QUERY_KEY, address, asset.address, asset.symbol],
|
|
18236
|
+
queryKey: customAssetRateQuery && customAssetRateQueryKey ? customAssetRateQueryKey : [ASSETS_RATES_QUERY_KEY, address, asset.address, asset.symbol],
|
|
18237
18237
|
// customAssetRateQueryKey
|
|
18238
18238
|
queryFn: async () => await resolveAssetRate(asset.symbol, asset.address, customAssetRateQuery)
|
|
18239
18239
|
});
|
|
@@ -18313,7 +18313,7 @@ var init_PortfolioItem = __esm({
|
|
|
18313
18313
|
init_utils2();
|
|
18314
18314
|
init_truncateMiddle();
|
|
18315
18315
|
init_BalanceView2();
|
|
18316
|
-
SKIP_SYMBOLS2 = ["TEST"];
|
|
18316
|
+
SKIP_SYMBOLS2 = ["TEST", "USDT", "P", "$P USDT"];
|
|
18317
18317
|
ASSETS_RATES_QUERY_KEY = "lumia-passport-assets-rates-query-key";
|
|
18318
18318
|
}
|
|
18319
18319
|
});
|
|
@@ -24505,7 +24505,7 @@ var init_package = __esm({
|
|
|
24505
24505
|
"package.json"() {
|
|
24506
24506
|
package_default = {
|
|
24507
24507
|
name: "@embarkai/ui-kit",
|
|
24508
|
-
version: "0.4.
|
|
24508
|
+
version: "0.4.63",
|
|
24509
24509
|
description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
|
|
24510
24510
|
type: "module",
|
|
24511
24511
|
main: "./dist/index.cjs",
|