@embarkai/ui-kit 0.4.56 → 0.4.57

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.56</title>
18
+ <title>EmbarkAI Secure Wallet - iframe version 0.4.57</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.56";
6394
+ var IFRAME_VERSION = "0.4.57";
6395
6395
  var IframeWallet = class {
6396
6396
  constructor() {
6397
6397
  console.log("=".repeat(60));
package/dist/index.cjs CHANGED
@@ -9460,11 +9460,11 @@ var init_api = __esm({
9460
9460
  });
9461
9461
 
9462
9462
  // src/internal/components/BuyMenu/binance/config.ts
9463
- var import_read9, CHAIN_ID_TO_BINANCE_NETWORK_NAMES;
9463
+ var import_read9, CHAIN_ID_TO_BINANCE_NETWORK_TICKER;
9464
9464
  var init_config = __esm({
9465
9465
  "src/internal/components/BuyMenu/binance/config.ts"() {
9466
9466
  import_read9 = require("@embarkai/core/read");
9467
- CHAIN_ID_TO_BINANCE_NETWORK_NAMES = {
9467
+ CHAIN_ID_TO_BINANCE_NETWORK_TICKER = {
9468
9468
  [import_read9.LUMIA_MAINNET_CHAIN_ID]: "LUMIA",
9469
9469
  [import_read9.BSC_MAINNET_CHAIN_ID]: "BSC"
9470
9470
  };
@@ -9490,7 +9490,7 @@ function BinanceSummary(props) {
9490
9490
  address: walletAddress,
9491
9491
  fiatCurrency: selectedFiat,
9492
9492
  cryptoCurrency: selectedCrypto,
9493
- network: CHAIN_ID_TO_BINANCE_NETWORK_NAMES[chainConfig.id],
9493
+ network: CHAIN_ID_TO_BINANCE_NETWORK_TICKER[chainConfig.id],
9494
9494
  payMethodCode: payment?.payMethodCode || void 0,
9495
9495
  payMethodSubCode: payment?.payMethodSubCode || void 0,
9496
9496
  // TODO: pass quote response to backend to create order with exact quote details (amount, fees, etc.)
@@ -10022,7 +10022,7 @@ function Binance() {
10022
10022
  const { t } = useT();
10023
10023
  const chainConfig = useSession((st) => st.chainConfig);
10024
10024
  const walletAddress = useSession((st) => st.address);
10025
- const chainTicker = CHAIN_ID_TO_BINANCE_NETWORK_NAMES[chainConfig.id] || null;
10025
+ const chainTicker = CHAIN_ID_TO_BINANCE_NETWORK_TICKER[chainConfig.id] || null;
10026
10026
  const {
10027
10027
  error,
10028
10028
  srcQueryAmount,
@@ -10055,7 +10055,7 @@ function Binance() {
10055
10055
  queryFn: async () => await getSupportedNetworksQuery()
10056
10056
  });
10057
10057
  const networkAvailableCryptoList = networksData?.data?.filter(
10058
- (ntw) => ntw.networks.map((n) => n.network).includes(CHAIN_ID_TO_BINANCE_NETWORK_NAMES[chainConfig.id] || "UNSUPPORTED")
10058
+ (ntw) => ntw.networks.map((n) => n.network).includes(CHAIN_ID_TO_BINANCE_NETWORK_TICKER[chainConfig.id] || "UNSUPPORTED")
10059
10059
  ) || [];
10060
10060
  const { data: paymentModesData = null, isFetching: isPaymentModesLoading } = (0, import_react_query10.useQuery)({
10061
10061
  retry: false,
@@ -10615,15 +10615,13 @@ var init_FinchPayTxHistory = __esm({
10615
10615
  });
10616
10616
 
10617
10617
  // src/internal/components/BuyMenu/finchpay/networks.ts
10618
- var import_read10, CHAIN_ID_TO_FINCHPAY_NAME;
10618
+ var import_read10, CHAIN_ID_TO_FINCHPAY_NETWORK_TICKER;
10619
10619
  var init_networks = __esm({
10620
10620
  "src/internal/components/BuyMenu/finchpay/networks.ts"() {
10621
10621
  import_read10 = require("@embarkai/core/read");
10622
- CHAIN_ID_TO_FINCHPAY_NAME = {
10622
+ CHAIN_ID_TO_FINCHPAY_NETWORK_TICKER = {
10623
10623
  [import_read10.LUMIA_MAINNET_CHAIN_ID]: "LUM20",
10624
- [import_read10.LUMIA_TESTNET_CHAIN_ID]: "LUM20",
10625
- [import_read10.BSC_TESTNET_CHAIN_ID]: "BSC"
10626
- // TODO: change to BSC mainnet when supported by EmbarkAI
10624
+ [import_read10.BSC_MAINNET_CHAIN_ID]: "BSC"
10627
10625
  };
10628
10626
  }
10629
10627
  });
@@ -10719,7 +10717,7 @@ function FinchPay() {
10719
10717
  const currentNetworkCoins = [];
10720
10718
  data.forEach((currency) => {
10721
10719
  networks.push(currency.network);
10722
- const isCurrentNetworkCoin = currency.network?.toUpperCase() === CHAIN_ID_TO_FINCHPAY_NAME[chainConfig.id]?.toUpperCase();
10720
+ const isCurrentNetworkCoin = currency.network?.toUpperCase() === CHAIN_ID_TO_FINCHPAY_NETWORK_TICKER[chainConfig.id]?.toUpperCase();
10723
10721
  if (currency.is_fiat) {
10724
10722
  fiats.push(currency);
10725
10723
  } else {
@@ -11125,7 +11123,7 @@ var init_useHandleInputAmount = __esm({
11125
11123
  }
11126
11124
  });
11127
11125
 
11128
- // src/internal/components/BuyMenu/ByuMenu.tsx
11126
+ // src/internal/components/BuyMenu/BuyMenu.tsx
11129
11127
  function BuyMenu() {
11130
11128
  const { t } = useT();
11131
11129
  const walletAddress = useSession((st) => st.address);
@@ -11243,8 +11241,8 @@ function BuyMenu() {
11243
11241
  );
11244
11242
  }
11245
11243
  var import_lucide_react18, import_jsx_runtime44;
11246
- var init_ByuMenu = __esm({
11247
- "src/internal/components/BuyMenu/ByuMenu.tsx"() {
11244
+ var init_BuyMenu = __esm({
11245
+ "src/internal/components/BuyMenu/BuyMenu.tsx"() {
11248
11246
  init_utils2();
11249
11247
  init_SessionContext();
11250
11248
  init_i18n();
@@ -11263,10 +11261,40 @@ var init_ByuMenu = __esm({
11263
11261
  }
11264
11262
  });
11265
11263
 
11264
+ // src/internal/components/BuyMenu/external.usage.ts
11265
+ async function getInProgressOnrampTransactionsList(params) {
11266
+ const { walletAddress, chainId } = params;
11267
+ const [binanceResponse, finchpayResponse] = await Promise.all([
11268
+ getTransactionList({ walletAddress, txStatuses: ["1"], page: 1, pageSize: 5 }),
11269
+ // status 1 = ON_RAMP_PROCESSING
11270
+ getTransactionList2({ walletAddress, txStatuses: ["PROCESSING"], page: 1, pageSize: 5 })
11271
+ ]);
11272
+ const binanceProgressTXs = binanceResponse.data.filter(
11273
+ (tx) => tx.embarkChainId === CHAIN_ID_TO_BINANCE_NETWORK_TICKER[chainId]
11274
+ );
11275
+ const finchpayProgressTXs = finchpayResponse.data.filter(
11276
+ (tx) => tx.embarkChainId === CHAIN_ID_TO_FINCHPAY_NETWORK_TICKER[chainId]
11277
+ );
11278
+ return {
11279
+ hasInProgressTXs: !!binanceProgressTXs.length || !!finchpayProgressTXs.length,
11280
+ // HINT: update on provider added
11281
+ inProgressTXs: [...binanceProgressTXs, ...finchpayProgressTXs]
11282
+ };
11283
+ }
11284
+ var init_external_usage = __esm({
11285
+ "src/internal/components/BuyMenu/external.usage.ts"() {
11286
+ init_api();
11287
+ init_config();
11288
+ init_api2();
11289
+ init_networks();
11290
+ }
11291
+ });
11292
+
11266
11293
  // src/internal/components/BuyMenu/index.ts
11267
- var init_BuyMenu = __esm({
11294
+ var init_BuyMenu2 = __esm({
11268
11295
  "src/internal/components/BuyMenu/index.ts"() {
11269
- init_ByuMenu();
11296
+ init_BuyMenu();
11297
+ init_external_usage();
11270
11298
  }
11271
11299
  });
11272
11300
 
@@ -24027,7 +24055,7 @@ var PAGE_MAP;
24027
24055
  var init_PageMap = __esm({
24028
24056
  "src/internal/components/PageMap.tsx"() {
24029
24057
  init_AuthMenu2();
24030
- init_BuyMenu();
24058
+ init_BuyMenu2();
24031
24059
  init_ChainsMenu2();
24032
24060
  init_DeviceLinkScreen();
24033
24061
  init_DeviceManageScreen();
@@ -24299,7 +24327,7 @@ var init_package = __esm({
24299
24327
  "package.json"() {
24300
24328
  package_default = {
24301
24329
  name: "@embarkai/ui-kit",
24302
- version: "0.4.56",
24330
+ version: "0.4.57",
24303
24331
  description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
24304
24332
  type: "module",
24305
24333
  main: "./dist/index.cjs",
@@ -28290,6 +28318,7 @@ __export(index_exports, {
28290
28318
  getAvailableLanguages: () => getAvailableLanguages,
28291
28319
  getExplorerUrl: () => getExplorerUrl,
28292
28320
  getIframeManager: () => getIframeManager,
28321
+ getInProgressOnrampTransactionsList: () => getInProgressOnrampTransactionsList,
28293
28322
  getLanguageIcon: () => getLanguageIcon,
28294
28323
  getShareRecoveryStats: () => getShareRecoveryStats,
28295
28324
  getSmartAccountForChain: () => getSmartAccountForChain,
@@ -29910,6 +29939,7 @@ function useSmartAccountTransactions() {
29910
29939
 
29911
29940
  // src/index.ts
29912
29941
  init_iframe_manager();
29942
+ init_BuyMenu2();
29913
29943
 
29914
29944
  // src/internal/assets/index.ts
29915
29945
  init_networks2();
@@ -29971,6 +30001,7 @@ autorun();
29971
30001
  getAvailableLanguages,
29972
30002
  getExplorerUrl,
29973
30003
  getIframeManager,
30004
+ getInProgressOnrampTransactionsList,
29974
30005
  getLanguageIcon,
29975
30006
  getShareRecoveryStats,
29976
30007
  getSmartAccountForChain,
package/dist/index.d.cts CHANGED
@@ -2231,6 +2231,101 @@ declare function useSmartAccountTransactions(): {
2231
2231
  }>;
2232
2232
  };
2233
2233
 
2234
+ type FinchpayTransactionStatus = 'CREATED' | 'PROCESSING' | 'REFUNDED' | 'SENDING' | 'HOLD' | 'COMPLETE' | 'ERROR' | 'EXPIRED' | 'REJECTED_BY_ANTI_FRAUD';
2235
+ interface FinchpayTxPayload {
2236
+ id: string;
2237
+ status: string;
2238
+ external_id: string | null;
2239
+ partner_key?: string;
2240
+ amount_from?: string;
2241
+ asset_from?: string;
2242
+ asset_from_extra?: string | null;
2243
+ amount_to?: string;
2244
+ asset_to?: string;
2245
+ asset_network_to: string;
2246
+ asset_to_extra?: string | null;
2247
+ partner_profit_amount?: string;
2248
+ partner_profit_currency?: string;
2249
+ event_time?: string;
2250
+ transaction_hash?: string;
2251
+ payment_method?: string;
2252
+ side?: string;
2253
+ }
2254
+ interface FinchpayTransaction {
2255
+ id: string;
2256
+ embarkUserId: string;
2257
+ embarkWalletAddress: string;
2258
+ /**
2259
+ * Finchpay network ticker, i.e. LUM20 etc,
2260
+ */
2261
+ embarkChainId: string;
2262
+ txStatus: FinchpayTransactionStatus;
2263
+ txPayload?: FinchpayTxPayload | null;
2264
+ initPayload?: FinchpayTxPayload | null;
2265
+ createdAt: string;
2266
+ updatedAt: string;
2267
+ }
2268
+
2269
+ interface BinanceTxPayload {
2270
+ webhookEventType?: string;
2271
+ type: number;
2272
+ status: number;
2273
+ businessType?: number;
2274
+ externalOrderId?: string;
2275
+ payMethodCode?: string | null;
2276
+ payMethodSubCode?: string | null;
2277
+ fiatCurrency?: string | null;
2278
+ cryptoCurrency?: string | null;
2279
+ openUserId?: string | null;
2280
+ fiatAmount?: string | null;
2281
+ cryptoAmount?: string | null;
2282
+ feeAmount?: string | null;
2283
+ feeCurrency?: string | null;
2284
+ revenueAmount?: string | null;
2285
+ revenueCurrency?: string | null;
2286
+ networkFee?: string | null;
2287
+ withdrawWalletAddress?: string | null;
2288
+ withdrawNetwork?: string | null;
2289
+ withdrawMemo?: string | null;
2290
+ withdrawTxHash?: string | null;
2291
+ orderDetailLink?: string | null;
2292
+ orderTime?: number | null;
2293
+ completionTime?: number | null;
2294
+ updateTime?: number | null;
2295
+ convertInfo?: Record<string, unknown> | null;
2296
+ swapDetailInfoVo?: Record<string, unknown> | null;
2297
+ userData?: string | null;
2298
+ }
2299
+ interface BinanceTransaction {
2300
+ id: string;
2301
+ embarkUserId: string;
2302
+ embarkWalletAddress: string;
2303
+ /**
2304
+ * network ticker, i.e. BSC, LUMIA etc,
2305
+ * - Binance networks+tickers: https://developers.binance.com/en/docs/products/connect-2.0/on-ramp-buy-apis/2.get-crypto-networks
2306
+ */
2307
+ embarkChainId: string;
2308
+ txStatus: string;
2309
+ txPayload?: BinanceTxPayload | null;
2310
+ initPayload?: BinanceTxPayload | null;
2311
+ createdAt: string;
2312
+ updatedAt: string;
2313
+ }
2314
+
2315
+ interface GetTransactionsListParams {
2316
+ walletAddress: string;
2317
+ chainId: number;
2318
+ }
2319
+ /**
2320
+ * Processing on-ramp transactions getter for in-dApp usage
2321
+ * @param walletAddress - user's embark wallet address
2322
+ * @param chainId - target chainId
2323
+ */
2324
+ declare function getInProgressOnrampTransactionsList(params: GetTransactionsListParams): Promise<{
2325
+ hasInProgressTXs: boolean;
2326
+ inProgressTXs: (BinanceTransaction | FinchpayTransaction)[];
2327
+ }>;
2328
+
2234
2329
  declare const NETWORKS_ICONS: Record<number, FC<SVGProps<SVGSVGElement>>>;
2235
2330
 
2236
2331
  declare const TOKENS_ICONS: Record<string, FC<SVGProps<SVGSVGElement>>>;
@@ -3283,4 +3378,4 @@ declare function getLanguageIcon(languageKey: string): string | null;
3283
3378
 
3284
3379
  declare const USER_PROFILE_QUERY_KEY: string;
3285
3380
 
3286
- export { AccountAbstractionError, type AccountSession, Address, type AddressProps, type Asset, type BatchOperation, type CallbacksConfig, ConnectWalletButton, type ConnectWalletButtonProps, type DirectTransactionParams, ErrorCodes, type FingerprintVerificationResult, Hash, type HashProps, KeyshareBackupMenu as KeyshareBackup, LOCAL_STORAGE_I18N_KEY, LangToggle, NETWORKS_ICONS, type NicknameAvailability, type NicknameAvatar, type NicknameChangeResult, type NicknameInfo, type NicknameResolution, type NicknameResolveRequest, type NicknameResolvedTarget, type NicknameValidationResult, PASSPORT_TRANSLATIONS, PageKey, type PageOpenParams, type PrepareBatchUserOperationParams, Provider, type ProviderConfig, type ProviderDetail, type ProviderProps, type RegisterSmartAccountResult, type SendBatchUserOperationParams, type SendTransactionParams, type SendTransactionResult, type SignTypedDataParams, type SmartAccountEntry, TOKENS_ICONS, ThemeToggle, type TokenBalance, type Transaction, TransactionsList, type TransferToLinkedParams, type TypedDataDomain, type TypedDataField, USER_PROFILE_QUERY_KEY, type UpdateProfileRequest, type UseDirectWalletReturn, type UseErc3643ComplianceOptions, type UseErc3643ComplianceResult, type UseLogoutReturn, type UseNicknameResolveOptions, type UseNicknameResolveResult, type UseSendDirectTransactionReturn, type UseSendTransactionReturn, type UseTransferToLinkedReturn, type UseUserOpStatusOptions, type UseUserOpStatusReturn, type UseWalletModeReturn, type UserOpMempool, type SendTransactionParams$1 as UserOpSendTransactionParams, type UserOpState, UserOpStatus, type UserOpStatusProps, type UserOperation, type UserOperationByHash, type UserOperationReceipt, UserOperationTimeoutError, type UserProfile, UserRejectedError, WALLET_ICONS, WRAPPED_TOKENS, type WaitForReceiptOptions, type WalletMode, type WalletReadyStatus, type WatchToken, combineI18NResources, createAccountAbstractionError, deployAccount, destroyIframeManager, generateFingerprint, getAllSmartAccounts, getAvailableLanguages, getExplorerUrl, getIframeManager, getLanguageIcon, getShareRecoveryStats, getSmartAccountForChain, getUserOperationByHash, getUserOperationReceipt, getUserProfile, looksLikeNickname, prepareBatchUserOperation, prepareUserOperation, requireActiveChainId, sendBatchUserOperation, sendUserOperation, signTypedData, updateUserProfile, useAccountSession, useActiveChainId, useAddress, useAssets, useBalance, useBlockscoutAssets, useColorMode, useConnectedApps, useDirectWallet, useErc3643Compliance, useError, useHasServerVault, useHydrated, useIFrameReady, useIsMobileView, useKeyshareRecoveryStats, useLinkedProfiles, useLoadingStatus, useLogout, useNativeWalletSignature, useNicknameResolve, useOpenPage, useProviderConfig, useRecoveryUserId, useSendDirectTransaction, useSendTransaction, useSession, useSmartAccountTransactions, useTokenBalance, useTokenInfo, useTransactions, useTransferToLinkedWallet, useUserOpStatus, useWalletMode, verifyFingerprint, verifyFingerprintDetailed, waitForStoreHydration, waitForUserOperationReceipt };
3381
+ export { AccountAbstractionError, type AccountSession, Address, type AddressProps, type Asset, type BatchOperation, type CallbacksConfig, ConnectWalletButton, type ConnectWalletButtonProps, type DirectTransactionParams, ErrorCodes, type FingerprintVerificationResult, Hash, type HashProps, KeyshareBackupMenu as KeyshareBackup, LOCAL_STORAGE_I18N_KEY, LangToggle, NETWORKS_ICONS, type NicknameAvailability, type NicknameAvatar, type NicknameChangeResult, type NicknameInfo, type NicknameResolution, type NicknameResolveRequest, type NicknameResolvedTarget, type NicknameValidationResult, PASSPORT_TRANSLATIONS, PageKey, type PageOpenParams, type PrepareBatchUserOperationParams, Provider, type ProviderConfig, type ProviderDetail, type ProviderProps, type RegisterSmartAccountResult, type SendBatchUserOperationParams, type SendTransactionParams, type SendTransactionResult, type SignTypedDataParams, type SmartAccountEntry, TOKENS_ICONS, ThemeToggle, type TokenBalance, type Transaction, TransactionsList, type TransferToLinkedParams, type TypedDataDomain, type TypedDataField, USER_PROFILE_QUERY_KEY, type UpdateProfileRequest, type UseDirectWalletReturn, type UseErc3643ComplianceOptions, type UseErc3643ComplianceResult, type UseLogoutReturn, type UseNicknameResolveOptions, type UseNicknameResolveResult, type UseSendDirectTransactionReturn, type UseSendTransactionReturn, type UseTransferToLinkedReturn, type UseUserOpStatusOptions, type UseUserOpStatusReturn, type UseWalletModeReturn, type UserOpMempool, type SendTransactionParams$1 as UserOpSendTransactionParams, type UserOpState, UserOpStatus, type UserOpStatusProps, type UserOperation, type UserOperationByHash, type UserOperationReceipt, UserOperationTimeoutError, type UserProfile, UserRejectedError, WALLET_ICONS, WRAPPED_TOKENS, type WaitForReceiptOptions, type WalletMode, type WalletReadyStatus, type WatchToken, combineI18NResources, createAccountAbstractionError, deployAccount, destroyIframeManager, generateFingerprint, getAllSmartAccounts, getAvailableLanguages, getExplorerUrl, getIframeManager, getInProgressOnrampTransactionsList, getLanguageIcon, getShareRecoveryStats, getSmartAccountForChain, getUserOperationByHash, getUserOperationReceipt, getUserProfile, looksLikeNickname, prepareBatchUserOperation, prepareUserOperation, requireActiveChainId, sendBatchUserOperation, sendUserOperation, signTypedData, updateUserProfile, useAccountSession, useActiveChainId, useAddress, useAssets, useBalance, useBlockscoutAssets, useColorMode, useConnectedApps, useDirectWallet, useErc3643Compliance, useError, useHasServerVault, useHydrated, useIFrameReady, useIsMobileView, useKeyshareRecoveryStats, useLinkedProfiles, useLoadingStatus, useLogout, useNativeWalletSignature, useNicknameResolve, useOpenPage, useProviderConfig, useRecoveryUserId, useSendDirectTransaction, useSendTransaction, useSession, useSmartAccountTransactions, useTokenBalance, useTokenInfo, useTransactions, useTransferToLinkedWallet, useUserOpStatus, useWalletMode, verifyFingerprint, verifyFingerprintDetailed, waitForStoreHydration, waitForUserOperationReceipt };
package/dist/index.d.ts CHANGED
@@ -2231,6 +2231,101 @@ declare function useSmartAccountTransactions(): {
2231
2231
  }>;
2232
2232
  };
2233
2233
 
2234
+ type FinchpayTransactionStatus = 'CREATED' | 'PROCESSING' | 'REFUNDED' | 'SENDING' | 'HOLD' | 'COMPLETE' | 'ERROR' | 'EXPIRED' | 'REJECTED_BY_ANTI_FRAUD';
2235
+ interface FinchpayTxPayload {
2236
+ id: string;
2237
+ status: string;
2238
+ external_id: string | null;
2239
+ partner_key?: string;
2240
+ amount_from?: string;
2241
+ asset_from?: string;
2242
+ asset_from_extra?: string | null;
2243
+ amount_to?: string;
2244
+ asset_to?: string;
2245
+ asset_network_to: string;
2246
+ asset_to_extra?: string | null;
2247
+ partner_profit_amount?: string;
2248
+ partner_profit_currency?: string;
2249
+ event_time?: string;
2250
+ transaction_hash?: string;
2251
+ payment_method?: string;
2252
+ side?: string;
2253
+ }
2254
+ interface FinchpayTransaction {
2255
+ id: string;
2256
+ embarkUserId: string;
2257
+ embarkWalletAddress: string;
2258
+ /**
2259
+ * Finchpay network ticker, i.e. LUM20 etc,
2260
+ */
2261
+ embarkChainId: string;
2262
+ txStatus: FinchpayTransactionStatus;
2263
+ txPayload?: FinchpayTxPayload | null;
2264
+ initPayload?: FinchpayTxPayload | null;
2265
+ createdAt: string;
2266
+ updatedAt: string;
2267
+ }
2268
+
2269
+ interface BinanceTxPayload {
2270
+ webhookEventType?: string;
2271
+ type: number;
2272
+ status: number;
2273
+ businessType?: number;
2274
+ externalOrderId?: string;
2275
+ payMethodCode?: string | null;
2276
+ payMethodSubCode?: string | null;
2277
+ fiatCurrency?: string | null;
2278
+ cryptoCurrency?: string | null;
2279
+ openUserId?: string | null;
2280
+ fiatAmount?: string | null;
2281
+ cryptoAmount?: string | null;
2282
+ feeAmount?: string | null;
2283
+ feeCurrency?: string | null;
2284
+ revenueAmount?: string | null;
2285
+ revenueCurrency?: string | null;
2286
+ networkFee?: string | null;
2287
+ withdrawWalletAddress?: string | null;
2288
+ withdrawNetwork?: string | null;
2289
+ withdrawMemo?: string | null;
2290
+ withdrawTxHash?: string | null;
2291
+ orderDetailLink?: string | null;
2292
+ orderTime?: number | null;
2293
+ completionTime?: number | null;
2294
+ updateTime?: number | null;
2295
+ convertInfo?: Record<string, unknown> | null;
2296
+ swapDetailInfoVo?: Record<string, unknown> | null;
2297
+ userData?: string | null;
2298
+ }
2299
+ interface BinanceTransaction {
2300
+ id: string;
2301
+ embarkUserId: string;
2302
+ embarkWalletAddress: string;
2303
+ /**
2304
+ * network ticker, i.e. BSC, LUMIA etc,
2305
+ * - Binance networks+tickers: https://developers.binance.com/en/docs/products/connect-2.0/on-ramp-buy-apis/2.get-crypto-networks
2306
+ */
2307
+ embarkChainId: string;
2308
+ txStatus: string;
2309
+ txPayload?: BinanceTxPayload | null;
2310
+ initPayload?: BinanceTxPayload | null;
2311
+ createdAt: string;
2312
+ updatedAt: string;
2313
+ }
2314
+
2315
+ interface GetTransactionsListParams {
2316
+ walletAddress: string;
2317
+ chainId: number;
2318
+ }
2319
+ /**
2320
+ * Processing on-ramp transactions getter for in-dApp usage
2321
+ * @param walletAddress - user's embark wallet address
2322
+ * @param chainId - target chainId
2323
+ */
2324
+ declare function getInProgressOnrampTransactionsList(params: GetTransactionsListParams): Promise<{
2325
+ hasInProgressTXs: boolean;
2326
+ inProgressTXs: (BinanceTransaction | FinchpayTransaction)[];
2327
+ }>;
2328
+
2234
2329
  declare const NETWORKS_ICONS: Record<number, FC<SVGProps<SVGSVGElement>>>;
2235
2330
 
2236
2331
  declare const TOKENS_ICONS: Record<string, FC<SVGProps<SVGSVGElement>>>;
@@ -3283,4 +3378,4 @@ declare function getLanguageIcon(languageKey: string): string | null;
3283
3378
 
3284
3379
  declare const USER_PROFILE_QUERY_KEY: string;
3285
3380
 
3286
- export { AccountAbstractionError, type AccountSession, Address, type AddressProps, type Asset, type BatchOperation, type CallbacksConfig, ConnectWalletButton, type ConnectWalletButtonProps, type DirectTransactionParams, ErrorCodes, type FingerprintVerificationResult, Hash, type HashProps, KeyshareBackupMenu as KeyshareBackup, LOCAL_STORAGE_I18N_KEY, LangToggle, NETWORKS_ICONS, type NicknameAvailability, type NicknameAvatar, type NicknameChangeResult, type NicknameInfo, type NicknameResolution, type NicknameResolveRequest, type NicknameResolvedTarget, type NicknameValidationResult, PASSPORT_TRANSLATIONS, PageKey, type PageOpenParams, type PrepareBatchUserOperationParams, Provider, type ProviderConfig, type ProviderDetail, type ProviderProps, type RegisterSmartAccountResult, type SendBatchUserOperationParams, type SendTransactionParams, type SendTransactionResult, type SignTypedDataParams, type SmartAccountEntry, TOKENS_ICONS, ThemeToggle, type TokenBalance, type Transaction, TransactionsList, type TransferToLinkedParams, type TypedDataDomain, type TypedDataField, USER_PROFILE_QUERY_KEY, type UpdateProfileRequest, type UseDirectWalletReturn, type UseErc3643ComplianceOptions, type UseErc3643ComplianceResult, type UseLogoutReturn, type UseNicknameResolveOptions, type UseNicknameResolveResult, type UseSendDirectTransactionReturn, type UseSendTransactionReturn, type UseTransferToLinkedReturn, type UseUserOpStatusOptions, type UseUserOpStatusReturn, type UseWalletModeReturn, type UserOpMempool, type SendTransactionParams$1 as UserOpSendTransactionParams, type UserOpState, UserOpStatus, type UserOpStatusProps, type UserOperation, type UserOperationByHash, type UserOperationReceipt, UserOperationTimeoutError, type UserProfile, UserRejectedError, WALLET_ICONS, WRAPPED_TOKENS, type WaitForReceiptOptions, type WalletMode, type WalletReadyStatus, type WatchToken, combineI18NResources, createAccountAbstractionError, deployAccount, destroyIframeManager, generateFingerprint, getAllSmartAccounts, getAvailableLanguages, getExplorerUrl, getIframeManager, getLanguageIcon, getShareRecoveryStats, getSmartAccountForChain, getUserOperationByHash, getUserOperationReceipt, getUserProfile, looksLikeNickname, prepareBatchUserOperation, prepareUserOperation, requireActiveChainId, sendBatchUserOperation, sendUserOperation, signTypedData, updateUserProfile, useAccountSession, useActiveChainId, useAddress, useAssets, useBalance, useBlockscoutAssets, useColorMode, useConnectedApps, useDirectWallet, useErc3643Compliance, useError, useHasServerVault, useHydrated, useIFrameReady, useIsMobileView, useKeyshareRecoveryStats, useLinkedProfiles, useLoadingStatus, useLogout, useNativeWalletSignature, useNicknameResolve, useOpenPage, useProviderConfig, useRecoveryUserId, useSendDirectTransaction, useSendTransaction, useSession, useSmartAccountTransactions, useTokenBalance, useTokenInfo, useTransactions, useTransferToLinkedWallet, useUserOpStatus, useWalletMode, verifyFingerprint, verifyFingerprintDetailed, waitForStoreHydration, waitForUserOperationReceipt };
3381
+ export { AccountAbstractionError, type AccountSession, Address, type AddressProps, type Asset, type BatchOperation, type CallbacksConfig, ConnectWalletButton, type ConnectWalletButtonProps, type DirectTransactionParams, ErrorCodes, type FingerprintVerificationResult, Hash, type HashProps, KeyshareBackupMenu as KeyshareBackup, LOCAL_STORAGE_I18N_KEY, LangToggle, NETWORKS_ICONS, type NicknameAvailability, type NicknameAvatar, type NicknameChangeResult, type NicknameInfo, type NicknameResolution, type NicknameResolveRequest, type NicknameResolvedTarget, type NicknameValidationResult, PASSPORT_TRANSLATIONS, PageKey, type PageOpenParams, type PrepareBatchUserOperationParams, Provider, type ProviderConfig, type ProviderDetail, type ProviderProps, type RegisterSmartAccountResult, type SendBatchUserOperationParams, type SendTransactionParams, type SendTransactionResult, type SignTypedDataParams, type SmartAccountEntry, TOKENS_ICONS, ThemeToggle, type TokenBalance, type Transaction, TransactionsList, type TransferToLinkedParams, type TypedDataDomain, type TypedDataField, USER_PROFILE_QUERY_KEY, type UpdateProfileRequest, type UseDirectWalletReturn, type UseErc3643ComplianceOptions, type UseErc3643ComplianceResult, type UseLogoutReturn, type UseNicknameResolveOptions, type UseNicknameResolveResult, type UseSendDirectTransactionReturn, type UseSendTransactionReturn, type UseTransferToLinkedReturn, type UseUserOpStatusOptions, type UseUserOpStatusReturn, type UseWalletModeReturn, type UserOpMempool, type SendTransactionParams$1 as UserOpSendTransactionParams, type UserOpState, UserOpStatus, type UserOpStatusProps, type UserOperation, type UserOperationByHash, type UserOperationReceipt, UserOperationTimeoutError, type UserProfile, UserRejectedError, WALLET_ICONS, WRAPPED_TOKENS, type WaitForReceiptOptions, type WalletMode, type WalletReadyStatus, type WatchToken, combineI18NResources, createAccountAbstractionError, deployAccount, destroyIframeManager, generateFingerprint, getAllSmartAccounts, getAvailableLanguages, getExplorerUrl, getIframeManager, getInProgressOnrampTransactionsList, getLanguageIcon, getShareRecoveryStats, getSmartAccountForChain, getUserOperationByHash, getUserOperationReceipt, getUserProfile, looksLikeNickname, prepareBatchUserOperation, prepareUserOperation, requireActiveChainId, sendBatchUserOperation, sendUserOperation, signTypedData, updateUserProfile, useAccountSession, useActiveChainId, useAddress, useAssets, useBalance, useBlockscoutAssets, useColorMode, useConnectedApps, useDirectWallet, useErc3643Compliance, useError, useHasServerVault, useHydrated, useIFrameReady, useIsMobileView, useKeyshareRecoveryStats, useLinkedProfiles, useLoadingStatus, useLogout, useNativeWalletSignature, useNicknameResolve, useOpenPage, useProviderConfig, useRecoveryUserId, useSendDirectTransaction, useSendTransaction, useSession, useSmartAccountTransactions, useTokenBalance, useTokenInfo, useTransactions, useTransferToLinkedWallet, useUserOpStatus, useWalletMode, verifyFingerprint, verifyFingerprintDetailed, waitForStoreHydration, waitForUserOperationReceipt };
package/dist/index.js CHANGED
@@ -9426,10 +9426,10 @@ var init_api = __esm({
9426
9426
 
9427
9427
  // src/internal/components/BuyMenu/binance/config.ts
9428
9428
  import { BSC_MAINNET_CHAIN_ID, LUMIA_MAINNET_CHAIN_ID } from "@embarkai/core/read";
9429
- var CHAIN_ID_TO_BINANCE_NETWORK_NAMES;
9429
+ var CHAIN_ID_TO_BINANCE_NETWORK_TICKER;
9430
9430
  var init_config = __esm({
9431
9431
  "src/internal/components/BuyMenu/binance/config.ts"() {
9432
- CHAIN_ID_TO_BINANCE_NETWORK_NAMES = {
9432
+ CHAIN_ID_TO_BINANCE_NETWORK_TICKER = {
9433
9433
  [LUMIA_MAINNET_CHAIN_ID]: "LUMIA",
9434
9434
  [BSC_MAINNET_CHAIN_ID]: "BSC"
9435
9435
  };
@@ -9458,7 +9458,7 @@ function BinanceSummary(props) {
9458
9458
  address: walletAddress,
9459
9459
  fiatCurrency: selectedFiat,
9460
9460
  cryptoCurrency: selectedCrypto,
9461
- network: CHAIN_ID_TO_BINANCE_NETWORK_NAMES[chainConfig.id],
9461
+ network: CHAIN_ID_TO_BINANCE_NETWORK_TICKER[chainConfig.id],
9462
9462
  payMethodCode: payment?.payMethodCode || void 0,
9463
9463
  payMethodSubCode: payment?.payMethodSubCode || void 0,
9464
9464
  // TODO: pass quote response to backend to create order with exact quote details (amount, fees, etc.)
@@ -9988,7 +9988,7 @@ function Binance() {
9988
9988
  const { t } = useT();
9989
9989
  const chainConfig = useSession((st) => st.chainConfig);
9990
9990
  const walletAddress = useSession((st) => st.address);
9991
- const chainTicker = CHAIN_ID_TO_BINANCE_NETWORK_NAMES[chainConfig.id] || null;
9991
+ const chainTicker = CHAIN_ID_TO_BINANCE_NETWORK_TICKER[chainConfig.id] || null;
9992
9992
  const {
9993
9993
  error,
9994
9994
  srcQueryAmount,
@@ -10021,7 +10021,7 @@ function Binance() {
10021
10021
  queryFn: async () => await getSupportedNetworksQuery()
10022
10022
  });
10023
10023
  const networkAvailableCryptoList = networksData?.data?.filter(
10024
- (ntw) => ntw.networks.map((n) => n.network).includes(CHAIN_ID_TO_BINANCE_NETWORK_NAMES[chainConfig.id] || "UNSUPPORTED")
10024
+ (ntw) => ntw.networks.map((n) => n.network).includes(CHAIN_ID_TO_BINANCE_NETWORK_TICKER[chainConfig.id] || "UNSUPPORTED")
10025
10025
  ) || [];
10026
10026
  const { data: paymentModesData = null, isFetching: isPaymentModesLoading } = useQuery2({
10027
10027
  retry: false,
@@ -10576,19 +10576,13 @@ var init_FinchPayTxHistory = __esm({
10576
10576
  });
10577
10577
 
10578
10578
  // src/internal/components/BuyMenu/finchpay/networks.ts
10579
- import {
10580
- BSC_TESTNET_CHAIN_ID,
10581
- LUMIA_MAINNET_CHAIN_ID as LUMIA_MAINNET_CHAIN_ID2,
10582
- LUMIA_TESTNET_CHAIN_ID
10583
- } from "@embarkai/core/read";
10584
- var CHAIN_ID_TO_FINCHPAY_NAME;
10579
+ import { BSC_MAINNET_CHAIN_ID as BSC_MAINNET_CHAIN_ID2, LUMIA_MAINNET_CHAIN_ID as LUMIA_MAINNET_CHAIN_ID2 } from "@embarkai/core/read";
10580
+ var CHAIN_ID_TO_FINCHPAY_NETWORK_TICKER;
10585
10581
  var init_networks = __esm({
10586
10582
  "src/internal/components/BuyMenu/finchpay/networks.ts"() {
10587
- CHAIN_ID_TO_FINCHPAY_NAME = {
10583
+ CHAIN_ID_TO_FINCHPAY_NETWORK_TICKER = {
10588
10584
  [LUMIA_MAINNET_CHAIN_ID2]: "LUM20",
10589
- [LUMIA_TESTNET_CHAIN_ID]: "LUM20",
10590
- [BSC_TESTNET_CHAIN_ID]: "BSC"
10591
- // TODO: change to BSC mainnet when supported by EmbarkAI
10585
+ [BSC_MAINNET_CHAIN_ID2]: "BSC"
10592
10586
  };
10593
10587
  }
10594
10588
  });
@@ -10687,7 +10681,7 @@ function FinchPay() {
10687
10681
  const currentNetworkCoins = [];
10688
10682
  data.forEach((currency) => {
10689
10683
  networks.push(currency.network);
10690
- const isCurrentNetworkCoin = currency.network?.toUpperCase() === CHAIN_ID_TO_FINCHPAY_NAME[chainConfig.id]?.toUpperCase();
10684
+ const isCurrentNetworkCoin = currency.network?.toUpperCase() === CHAIN_ID_TO_FINCHPAY_NETWORK_TICKER[chainConfig.id]?.toUpperCase();
10691
10685
  if (currency.is_fiat) {
10692
10686
  fiats.push(currency);
10693
10687
  } else {
@@ -11087,7 +11081,7 @@ var init_useHandleInputAmount = __esm({
11087
11081
  }
11088
11082
  });
11089
11083
 
11090
- // src/internal/components/BuyMenu/ByuMenu.tsx
11084
+ // src/internal/components/BuyMenu/BuyMenu.tsx
11091
11085
  import { ArrowLeft as ArrowLeft3 } from "lucide-react";
11092
11086
  import { Fragment as Fragment14, jsx as jsx44, jsxs as jsxs38 } from "react/jsx-runtime";
11093
11087
  function BuyMenu() {
@@ -11206,8 +11200,8 @@ function BuyMenu() {
11206
11200
  }
11207
11201
  );
11208
11202
  }
11209
- var init_ByuMenu = __esm({
11210
- "src/internal/components/BuyMenu/ByuMenu.tsx"() {
11203
+ var init_BuyMenu = __esm({
11204
+ "src/internal/components/BuyMenu/BuyMenu.tsx"() {
11211
11205
  init_utils2();
11212
11206
  init_SessionContext();
11213
11207
  init_i18n();
@@ -11224,10 +11218,40 @@ var init_ByuMenu = __esm({
11224
11218
  }
11225
11219
  });
11226
11220
 
11221
+ // src/internal/components/BuyMenu/external.usage.ts
11222
+ async function getInProgressOnrampTransactionsList(params) {
11223
+ const { walletAddress, chainId } = params;
11224
+ const [binanceResponse, finchpayResponse] = await Promise.all([
11225
+ getTransactionList({ walletAddress, txStatuses: ["1"], page: 1, pageSize: 5 }),
11226
+ // status 1 = ON_RAMP_PROCESSING
11227
+ getTransactionList2({ walletAddress, txStatuses: ["PROCESSING"], page: 1, pageSize: 5 })
11228
+ ]);
11229
+ const binanceProgressTXs = binanceResponse.data.filter(
11230
+ (tx) => tx.embarkChainId === CHAIN_ID_TO_BINANCE_NETWORK_TICKER[chainId]
11231
+ );
11232
+ const finchpayProgressTXs = finchpayResponse.data.filter(
11233
+ (tx) => tx.embarkChainId === CHAIN_ID_TO_FINCHPAY_NETWORK_TICKER[chainId]
11234
+ );
11235
+ return {
11236
+ hasInProgressTXs: !!binanceProgressTXs.length || !!finchpayProgressTXs.length,
11237
+ // HINT: update on provider added
11238
+ inProgressTXs: [...binanceProgressTXs, ...finchpayProgressTXs]
11239
+ };
11240
+ }
11241
+ var init_external_usage = __esm({
11242
+ "src/internal/components/BuyMenu/external.usage.ts"() {
11243
+ init_api();
11244
+ init_config();
11245
+ init_api2();
11246
+ init_networks();
11247
+ }
11248
+ });
11249
+
11227
11250
  // src/internal/components/BuyMenu/index.ts
11228
- var init_BuyMenu = __esm({
11251
+ var init_BuyMenu2 = __esm({
11229
11252
  "src/internal/components/BuyMenu/index.ts"() {
11230
- init_ByuMenu();
11253
+ init_BuyMenu();
11254
+ init_external_usage();
11231
11255
  }
11232
11256
  });
11233
11257
 
@@ -11347,11 +11371,11 @@ var init_sepolia = __esm({
11347
11371
  import {
11348
11372
  ARBITRUM_SEPOLIA_CHAIN_ID,
11349
11373
  BASE_SEPOLIA_CHAIN_ID,
11350
- BSC_MAINNET_CHAIN_ID as BSC_MAINNET_CHAIN_ID2,
11351
- BSC_TESTNET_CHAIN_ID as BSC_TESTNET_CHAIN_ID2,
11374
+ BSC_MAINNET_CHAIN_ID as BSC_MAINNET_CHAIN_ID3,
11375
+ BSC_TESTNET_CHAIN_ID,
11352
11376
  LUMIA_MAINNET_CHAIN_ID as LUMIA_MAINNET_CHAIN_ID3,
11353
11377
  LUMIA_PULSAR_TESTNET_CHAIN_ID,
11354
- LUMIA_TESTNET_CHAIN_ID as LUMIA_TESTNET_CHAIN_ID2,
11378
+ LUMIA_TESTNET_CHAIN_ID,
11355
11379
  SEPOLIA_CHAIN_ID
11356
11380
  } from "@embarkai/core/read";
11357
11381
  var NETWORKS_ICONS;
@@ -11366,10 +11390,10 @@ var init_networks2 = __esm({
11366
11390
  NETWORKS_ICONS = {
11367
11391
  1: ethereum_default,
11368
11392
  [LUMIA_MAINNET_CHAIN_ID3]: lumia_default2,
11369
- [LUMIA_TESTNET_CHAIN_ID2]: lumia_default2,
11393
+ [LUMIA_TESTNET_CHAIN_ID]: lumia_default2,
11370
11394
  [LUMIA_PULSAR_TESTNET_CHAIN_ID]: lumia_default2,
11371
- [BSC_MAINNET_CHAIN_ID2]: bsc_default,
11372
- [BSC_TESTNET_CHAIN_ID2]: bsc_default,
11395
+ [BSC_MAINNET_CHAIN_ID3]: bsc_default,
11396
+ [BSC_TESTNET_CHAIN_ID]: bsc_default,
11373
11397
  [BASE_SEPOLIA_CHAIN_ID]: base_default,
11374
11398
  [SEPOLIA_CHAIN_ID]: sepolia_default,
11375
11399
  [ARBITRUM_SEPOLIA_CHAIN_ID]: arbitrum_default
@@ -23033,9 +23057,9 @@ var init_TermsOfService = __esm({
23033
23057
  import {
23034
23058
  ARBITRUM_SEPOLIA_CHAIN_ID as ARBITRUM_SEPOLIA_CHAIN_ID2,
23035
23059
  BASE_SEPOLIA_CHAIN_ID as BASE_SEPOLIA_CHAIN_ID2,
23036
- BSC_TESTNET_CHAIN_ID as BSC_TESTNET_CHAIN_ID3,
23060
+ BSC_TESTNET_CHAIN_ID as BSC_TESTNET_CHAIN_ID2,
23037
23061
  LUMIA_MAINNET_CHAIN_ID as LUMIA_MAINNET_CHAIN_ID4,
23038
- LUMIA_TESTNET_CHAIN_ID as LUMIA_TESTNET_CHAIN_ID3,
23062
+ LUMIA_TESTNET_CHAIN_ID as LUMIA_TESTNET_CHAIN_ID2,
23039
23063
  SEPOLIA_CHAIN_ID as SEPOLIA_CHAIN_ID2
23040
23064
  } from "@embarkai/core/read";
23041
23065
  function isTransactionHistorySupported(chainId) {
@@ -23111,10 +23135,10 @@ var init_txUrls = __esm({
23111
23135
  BASE_SEPOLIA_CHAIN_ID2
23112
23136
  ]);
23113
23137
  UNSUPPORTED_HISTORY_CHAINS = /* @__PURE__ */ new Set([
23114
- BSC_TESTNET_CHAIN_ID3
23138
+ BSC_TESTNET_CHAIN_ID2
23115
23139
  ]);
23116
23140
  TX_HISTORY_URLS = {
23117
- [LUMIA_TESTNET_CHAIN_ID3]: (p) => {
23141
+ [LUMIA_TESTNET_CHAIN_ID2]: (p) => {
23118
23142
  const result = getBlockscoutHistoryUrls(p);
23119
23143
  return {
23120
23144
  transactionsUrl: result.transactionsUrl,
@@ -23943,7 +23967,7 @@ var PAGE_MAP;
23943
23967
  var init_PageMap = __esm({
23944
23968
  "src/internal/components/PageMap.tsx"() {
23945
23969
  init_AuthMenu2();
23946
- init_BuyMenu();
23970
+ init_BuyMenu2();
23947
23971
  init_ChainsMenu2();
23948
23972
  init_DeviceLinkScreen();
23949
23973
  init_DeviceManageScreen();
@@ -24215,7 +24239,7 @@ var init_package = __esm({
24215
24239
  "package.json"() {
24216
24240
  package_default = {
24217
24241
  name: "@embarkai/ui-kit",
24218
- version: "0.4.56",
24242
+ version: "0.4.57",
24219
24243
  description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
24220
24244
  type: "module",
24221
24245
  main: "./dist/index.cjs",
@@ -29761,6 +29785,7 @@ function useSmartAccountTransactions() {
29761
29785
 
29762
29786
  // src/index.ts
29763
29787
  init_iframe_manager();
29788
+ init_BuyMenu2();
29764
29789
 
29765
29790
  // src/internal/assets/index.ts
29766
29791
  init_networks2();
@@ -29821,6 +29846,7 @@ export {
29821
29846
  getAvailableLanguages,
29822
29847
  getExplorerUrl,
29823
29848
  getIframeManager,
29849
+ getInProgressOnrampTransactionsList,
29824
29850
  getLanguageIcon,
29825
29851
  getShareRecoveryStats,
29826
29852
  getSmartAccountForChain,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@embarkai/ui-kit",
3
- "version": "0.4.56",
3
+ "version": "0.4.57",
4
4
  "description": "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",