@unifold/ui-react 0.1.71-beta.2 → 0.1.71

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/index.js CHANGED
@@ -1004,7 +1004,7 @@ function DepositHeader({
1004
1004
  setShowBalanceSkeleton(false);
1005
1005
  return;
1006
1006
  }
1007
- const supportedChainTypes = ["ethereum", "solana", "bitcoin", "n1"];
1007
+ const supportedChainTypes = ["ethereum", "solana", "bitcoin", "n1", "tron"];
1008
1008
  if (!supportedChainTypes.includes(balanceChainType)) {
1009
1009
  setBalance(null);
1010
1010
  setIsLoadingBalance(false);
@@ -15991,7 +15991,7 @@ function CoinbaseConnect({
15991
15991
  onClose,
15992
15992
  showBalance: true,
15993
15993
  balanceAddress: recipientAddress,
15994
- balanceChainType: destinationChainType === "ethereum" || destinationChainType === "solana" || destinationChainType === "bitcoin" ? destinationChainType : void 0,
15994
+ balanceChainType: destinationChainType === "ethereum" || destinationChainType === "solana" || destinationChainType === "bitcoin" || destinationChainType === "tron" ? destinationChainType : void 0,
15995
15995
  balanceChainId: destinationChainId,
15996
15996
  balanceTokenAddress: destinationTokenAddress,
15997
15997
  projectName: projectConfig?.project_name,
@@ -17989,9 +17989,10 @@ function useDefaultToken({
17989
17989
  }
17990
17990
 
17991
17991
  // src/hooks/use-default-source-token.ts
17992
- var STORAGE_KEY2 = "unifold_last_deposit_from_token";
17992
+ var STORAGE_KEY_BASE = "unifold_last_deposit_from_token";
17993
17993
  function useDefaultSourceToken({
17994
17994
  supportedTokens,
17995
+ externalUserId,
17995
17996
  defaultSourceChainType,
17996
17997
  defaultSourceChainId,
17997
17998
  defaultSourceTokenAddress,
@@ -18003,7 +18004,7 @@ function useDefaultSourceToken({
18003
18004
  defaultChainId: defaultSourceChainId,
18004
18005
  defaultTokenAddress: defaultSourceTokenAddress,
18005
18006
  defaultSymbol: defaultSourceSymbol,
18006
- storageKey: STORAGE_KEY2
18007
+ storageKey: `${STORAGE_KEY_BASE}:${encodeURIComponent(externalUserId)}`
18007
18008
  });
18008
18009
  }
18009
18010
 
@@ -18482,6 +18483,7 @@ function TransferCryptoSingleInput({
18482
18483
  const supportedTokens = tokensResponse?.data ?? [];
18483
18484
  const { token, chain, setToken, setChain, initialSelectionDone } = useDefaultSourceToken({
18484
18485
  supportedTokens,
18486
+ externalUserId: userId,
18485
18487
  defaultSourceChainType,
18486
18488
  defaultSourceChainId,
18487
18489
  defaultSourceTokenAddress,
@@ -19297,6 +19299,7 @@ function TransferCryptoDoubleInput({
19297
19299
  const supportedTokens = tokensResponse?.data ?? [];
19298
19300
  const { token, chain, setToken, setChain, initialSelectionDone } = useDefaultSourceToken({
19299
19301
  supportedTokens,
19302
+ externalUserId: userId,
19300
19303
  defaultSourceChainType,
19301
19304
  defaultSourceChainId,
19302
19305
  defaultSourceTokenAddress,
@@ -23506,7 +23509,7 @@ function DepositModal({
23506
23509
  incident: activeIncident,
23507
23510
  showBalance: showBalanceHeader,
23508
23511
  balanceAddress: recipientAddress,
23509
- balanceChainType: destinationChainType === "ethereum" || destinationChainType === "solana" || destinationChainType === "bitcoin" || destinationChainType === "n1" ? destinationChainType : void 0,
23512
+ balanceChainType: destinationChainType === "ethereum" || destinationChainType === "solana" || destinationChainType === "bitcoin" || destinationChainType === "n1" || destinationChainType === "tron" ? destinationChainType : void 0,
23510
23513
  balanceChainId: destinationChainId,
23511
23514
  balanceTokenAddress: destinationTokenAddress,
23512
23515
  projectName: projectConfig?.project_name,
@@ -23526,7 +23529,7 @@ function DepositModal({
23526
23529
  incident: activeIncident,
23527
23530
  showBalance: showBalanceHeader,
23528
23531
  balanceAddress: recipientAddress,
23529
- balanceChainType: destinationChainType === "ethereum" || destinationChainType === "solana" || destinationChainType === "bitcoin" || destinationChainType === "n1" ? destinationChainType : void 0,
23532
+ balanceChainType: destinationChainType === "ethereum" || destinationChainType === "solana" || destinationChainType === "bitcoin" || destinationChainType === "n1" || destinationChainType === "tron" ? destinationChainType : void 0,
23530
23533
  balanceChainId: destinationChainId,
23531
23534
  balanceTokenAddress: destinationTokenAddress,
23532
23535
  projectName: projectConfig?.project_name,
@@ -23621,7 +23624,7 @@ function DepositModal({
23621
23624
  badge: cardView === "quotes" ? { count: quotesCount } : void 0,
23622
23625
  showBalance: showBalanceHeader,
23623
23626
  balanceAddress: recipientAddress,
23624
- balanceChainType: destinationChainType === "ethereum" || destinationChainType === "solana" || destinationChainType === "bitcoin" || destinationChainType === "n1" ? destinationChainType : void 0,
23627
+ balanceChainType: destinationChainType === "ethereum" || destinationChainType === "solana" || destinationChainType === "bitcoin" || destinationChainType === "n1" || destinationChainType === "tron" ? destinationChainType : void 0,
23625
23628
  balanceChainId: destinationChainId,
23626
23629
  balanceTokenAddress: destinationTokenAddress,
23627
23630
  projectName: projectConfig?.project_name,
@@ -24702,9 +24705,10 @@ function useSupportedDestinationTokens(publishableKey, enabled = true) {
24702
24705
  }
24703
24706
 
24704
24707
  // src/hooks/use-default-destination-token.ts
24705
- var STORAGE_KEY3 = "unifold_last_withdraw_to_token";
24708
+ var STORAGE_KEY_BASE2 = "unifold_last_withdraw_to_token";
24706
24709
  function useDefaultDestinationToken({
24707
24710
  destinationTokens,
24711
+ externalUserId,
24708
24712
  defaultDestinationChainType,
24709
24713
  defaultDestinationChainId,
24710
24714
  defaultDestinationTokenAddress,
@@ -24716,7 +24720,7 @@ function useDefaultDestinationToken({
24716
24720
  defaultChainId: defaultDestinationChainId,
24717
24721
  defaultTokenAddress: defaultDestinationTokenAddress,
24718
24722
  defaultSymbol: defaultDestinationSymbol,
24719
- storageKey: STORAGE_KEY3
24723
+ storageKey: `${STORAGE_KEY_BASE2}:${encodeURIComponent(externalUserId)}`
24720
24724
  });
24721
24725
  }
24722
24726
 
@@ -26630,6 +26634,7 @@ function WithdrawModal({
26630
26634
  initialSelectionDone
26631
26635
  } = useDefaultDestinationToken({
26632
26636
  destinationTokens,
26637
+ externalUserId,
26633
26638
  defaultDestinationChainType,
26634
26639
  defaultDestinationChainId,
26635
26640
  defaultDestinationTokenAddress,
package/dist/index.mjs CHANGED
@@ -902,7 +902,7 @@ function DepositHeader({
902
902
  setShowBalanceSkeleton(false);
903
903
  return;
904
904
  }
905
- const supportedChainTypes = ["ethereum", "solana", "bitcoin", "n1"];
905
+ const supportedChainTypes = ["ethereum", "solana", "bitcoin", "n1", "tron"];
906
906
  if (!supportedChainTypes.includes(balanceChainType)) {
907
907
  setBalance(null);
908
908
  setIsLoadingBalance(false);
@@ -15974,7 +15974,7 @@ function CoinbaseConnect({
15974
15974
  onClose,
15975
15975
  showBalance: true,
15976
15976
  balanceAddress: recipientAddress,
15977
- balanceChainType: destinationChainType === "ethereum" || destinationChainType === "solana" || destinationChainType === "bitcoin" ? destinationChainType : void 0,
15977
+ balanceChainType: destinationChainType === "ethereum" || destinationChainType === "solana" || destinationChainType === "bitcoin" || destinationChainType === "tron" ? destinationChainType : void 0,
15978
15978
  balanceChainId: destinationChainId,
15979
15979
  balanceTokenAddress: destinationTokenAddress,
15980
15980
  projectName: projectConfig?.project_name,
@@ -17994,9 +17994,10 @@ function useDefaultToken({
17994
17994
  }
17995
17995
 
17996
17996
  // src/hooks/use-default-source-token.ts
17997
- var STORAGE_KEY2 = "unifold_last_deposit_from_token";
17997
+ var STORAGE_KEY_BASE = "unifold_last_deposit_from_token";
17998
17998
  function useDefaultSourceToken({
17999
17999
  supportedTokens,
18000
+ externalUserId,
18000
18001
  defaultSourceChainType,
18001
18002
  defaultSourceChainId,
18002
18003
  defaultSourceTokenAddress,
@@ -18008,7 +18009,7 @@ function useDefaultSourceToken({
18008
18009
  defaultChainId: defaultSourceChainId,
18009
18010
  defaultTokenAddress: defaultSourceTokenAddress,
18010
18011
  defaultSymbol: defaultSourceSymbol,
18011
- storageKey: STORAGE_KEY2
18012
+ storageKey: `${STORAGE_KEY_BASE}:${encodeURIComponent(externalUserId)}`
18012
18013
  });
18013
18014
  }
18014
18015
 
@@ -18490,6 +18491,7 @@ function TransferCryptoSingleInput({
18490
18491
  const supportedTokens = tokensResponse?.data ?? [];
18491
18492
  const { token, chain, setToken, setChain, initialSelectionDone } = useDefaultSourceToken({
18492
18493
  supportedTokens,
18494
+ externalUserId: userId,
18493
18495
  defaultSourceChainType,
18494
18496
  defaultSourceChainId,
18495
18497
  defaultSourceTokenAddress,
@@ -19318,6 +19320,7 @@ function TransferCryptoDoubleInput({
19318
19320
  const supportedTokens = tokensResponse?.data ?? [];
19319
19321
  const { token, chain, setToken, setChain, initialSelectionDone } = useDefaultSourceToken({
19320
19322
  supportedTokens,
19323
+ externalUserId: userId,
19321
19324
  defaultSourceChainType,
19322
19325
  defaultSourceChainId,
19323
19326
  defaultSourceTokenAddress,
@@ -23538,7 +23541,7 @@ function DepositModal({
23538
23541
  incident: activeIncident,
23539
23542
  showBalance: showBalanceHeader,
23540
23543
  balanceAddress: recipientAddress,
23541
- balanceChainType: destinationChainType === "ethereum" || destinationChainType === "solana" || destinationChainType === "bitcoin" || destinationChainType === "n1" ? destinationChainType : void 0,
23544
+ balanceChainType: destinationChainType === "ethereum" || destinationChainType === "solana" || destinationChainType === "bitcoin" || destinationChainType === "n1" || destinationChainType === "tron" ? destinationChainType : void 0,
23542
23545
  balanceChainId: destinationChainId,
23543
23546
  balanceTokenAddress: destinationTokenAddress,
23544
23547
  projectName: projectConfig?.project_name,
@@ -23558,7 +23561,7 @@ function DepositModal({
23558
23561
  incident: activeIncident,
23559
23562
  showBalance: showBalanceHeader,
23560
23563
  balanceAddress: recipientAddress,
23561
- balanceChainType: destinationChainType === "ethereum" || destinationChainType === "solana" || destinationChainType === "bitcoin" || destinationChainType === "n1" ? destinationChainType : void 0,
23564
+ balanceChainType: destinationChainType === "ethereum" || destinationChainType === "solana" || destinationChainType === "bitcoin" || destinationChainType === "n1" || destinationChainType === "tron" ? destinationChainType : void 0,
23562
23565
  balanceChainId: destinationChainId,
23563
23566
  balanceTokenAddress: destinationTokenAddress,
23564
23567
  projectName: projectConfig?.project_name,
@@ -23653,7 +23656,7 @@ function DepositModal({
23653
23656
  badge: cardView === "quotes" ? { count: quotesCount } : void 0,
23654
23657
  showBalance: showBalanceHeader,
23655
23658
  balanceAddress: recipientAddress,
23656
- balanceChainType: destinationChainType === "ethereum" || destinationChainType === "solana" || destinationChainType === "bitcoin" || destinationChainType === "n1" ? destinationChainType : void 0,
23659
+ balanceChainType: destinationChainType === "ethereum" || destinationChainType === "solana" || destinationChainType === "bitcoin" || destinationChainType === "n1" || destinationChainType === "tron" ? destinationChainType : void 0,
23657
23660
  balanceChainId: destinationChainId,
23658
23661
  balanceTokenAddress: destinationTokenAddress,
23659
23662
  projectName: projectConfig?.project_name,
@@ -24739,9 +24742,10 @@ function useSupportedDestinationTokens(publishableKey, enabled = true) {
24739
24742
  }
24740
24743
 
24741
24744
  // src/hooks/use-default-destination-token.ts
24742
- var STORAGE_KEY3 = "unifold_last_withdraw_to_token";
24745
+ var STORAGE_KEY_BASE2 = "unifold_last_withdraw_to_token";
24743
24746
  function useDefaultDestinationToken({
24744
24747
  destinationTokens,
24748
+ externalUserId,
24745
24749
  defaultDestinationChainType,
24746
24750
  defaultDestinationChainId,
24747
24751
  defaultDestinationTokenAddress,
@@ -24753,7 +24757,7 @@ function useDefaultDestinationToken({
24753
24757
  defaultChainId: defaultDestinationChainId,
24754
24758
  defaultTokenAddress: defaultDestinationTokenAddress,
24755
24759
  defaultSymbol: defaultDestinationSymbol,
24756
- storageKey: STORAGE_KEY3
24760
+ storageKey: `${STORAGE_KEY_BASE2}:${encodeURIComponent(externalUserId)}`
24757
24761
  });
24758
24762
  }
24759
24763
 
@@ -26690,6 +26694,7 @@ function WithdrawModal({
26690
26694
  initialSelectionDone
26691
26695
  } = useDefaultDestinationToken({
26692
26696
  destinationTokens,
26697
+ externalUserId,
26693
26698
  defaultDestinationChainType,
26694
26699
  defaultDestinationChainId,
26695
26700
  defaultDestinationTokenAddress,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unifold/ui-react",
3
- "version": "0.1.71-beta.2",
3
+ "version": "0.1.71",
4
4
  "description": "Unifold UI React - Deposit and onramp components for React applications",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -42,7 +42,7 @@
42
42
  "mipd": "^0.0.7",
43
43
  "qr-code-styling": "^1.6.0-rc.1",
44
44
  "tailwind-merge": "^2.0.0",
45
- "@unifold/core": "0.1.71-beta.2"
45
+ "@unifold/core": "0.1.71"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@solana/web3.js": "^1.87.0",