@xswap-link/sdk 0.14.0 → 0.15.0

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.
Files changed (78) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/index.d.mts +4 -0
  3. package/dist/index.d.ts +4 -0
  4. package/dist/index.global.js +92 -92
  5. package/dist/index.js +3208 -2862
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +3083 -2740
  8. package/dist/index.mjs.map +1 -1
  9. package/localTheme.ts +6 -4
  10. package/package.json +1 -1
  11. package/src/assets/icons/AdjustmentsIcon.tsx +5 -7
  12. package/src/assets/icons/ChainlinkMarkIcon.tsx +4 -5
  13. package/src/assets/icons/CheckCircleThinIcon.tsx +22 -0
  14. package/src/assets/icons/ChevronDownThinIcon.tsx +39 -0
  15. package/src/assets/icons/ChevronDownWideThinIcon.tsx +18 -0
  16. package/src/assets/icons/ChevronsUpDownThinIcon.tsx +21 -0
  17. package/src/assets/icons/ClockIcon.tsx +3 -7
  18. package/src/assets/icons/CloseIcon.tsx +9 -4
  19. package/src/assets/icons/ErrorCircleThinIcon.tsx +22 -0
  20. package/src/assets/icons/LinkExternalThinIcon.tsx +19 -0
  21. package/src/assets/icons/LoadingRingIcon.tsx +22 -0
  22. package/src/assets/icons/ProgressRingThinIcon.tsx +29 -0
  23. package/src/assets/icons/SearchThinIcon.tsx +15 -0
  24. package/src/assets/icons/SignThinIcon.tsx +15 -0
  25. package/src/assets/icons/WalletCheckThinIcon.tsx +24 -0
  26. package/src/assets/icons/WarningIcon.tsx +8 -5
  27. package/src/assets/icons/index.ts +11 -0
  28. package/src/components/Modal/index.tsx +14 -9
  29. package/src/components/PoweredBy/index.tsx +6 -8
  30. package/src/components/Swap/Header/index.tsx +2 -4
  31. package/src/components/Swap/HistoryView/ActivityCard/index.tsx +110 -115
  32. package/src/components/Swap/HistoryView/index.tsx +10 -7
  33. package/src/components/Swap/PickerView/index.tsx +151 -0
  34. package/src/components/Swap/ReorderButton/ReorderButton.tsx +4 -4
  35. package/src/components/Swap/SettingsView/Delivery/index.tsx +19 -17
  36. package/src/components/Swap/SettingsView/InfiniteApproval/index.tsx +19 -17
  37. package/src/components/Swap/SettingsView/Slippage/index.tsx +55 -49
  38. package/src/components/Swap/SwapView/ConfirmationView/TokenTiles/index.tsx +69 -0
  39. package/src/components/Swap/SwapView/ConfirmationView/TxOverview/Header/index.tsx +13 -25
  40. package/src/components/Swap/SwapView/ConfirmationView/TxOverview/Steps/index.tsx +65 -113
  41. package/src/components/Swap/SwapView/ConfirmationView/TxOverview/index.tsx +68 -26
  42. package/src/components/Swap/SwapView/ConfirmationView/TxResult/index.tsx +51 -74
  43. package/src/components/Swap/SwapView/FeesPanel/DeliveryInfo/index.tsx +1 -1
  44. package/src/components/Swap/SwapView/FeesPanel/index.tsx +5 -5
  45. package/src/components/Swap/SwapView/SwapButton/index.tsx +2 -31
  46. package/src/components/Swap/SwapView/SwapPanel/AmountPanel/Balance/index.tsx +2 -2
  47. package/src/components/Swap/SwapView/SwapPanel/AmountPanel/index.tsx +2 -2
  48. package/src/components/Swap/SwapView/SwapPanel/TokenPanel/ChainPicker/index.tsx +143 -0
  49. package/src/components/Swap/SwapView/SwapPanel/TokenPanel/TokenPicker/NetworkFilter/index.tsx +19 -16
  50. package/src/components/Swap/SwapView/SwapPanel/TokenPanel/TokenPicker/TokenItem/index.tsx +11 -4
  51. package/src/components/Swap/SwapView/SwapPanel/TokenPanel/TokenPicker/index.tsx +185 -105
  52. package/src/components/Swap/SwapView/SwapPanel/TokenPanel/index.tsx +54 -120
  53. package/src/components/Swap/SwapView/SwapPanel/UsdValue/index.tsx +2 -2
  54. package/src/components/Swap/SwapView/SwapPanel/WalletPanel/index.tsx +10 -16
  55. package/src/components/Swap/SwapView/SwapPanel/index.tsx +4 -4
  56. package/src/components/Swap/SwapView/WalletPicker/index.tsx +131 -139
  57. package/src/components/Swap/SwapView/index.tsx +11 -7
  58. package/src/components/Swap/WalletPickerView/index.tsx +65 -0
  59. package/src/components/Swap/index.tsx +39 -8
  60. package/src/components/ToggleButton/index.tsx +5 -7
  61. package/src/components/TokenLogo/index.tsx +1 -1
  62. package/src/components/TxConfigForm/index.tsx +2 -2
  63. package/src/components/TxModal/index.tsx +14 -4
  64. package/src/components/global.css +18 -1
  65. package/src/constants/index.ts +4 -0
  66. package/src/context/HistoryProvider.tsx +1 -1
  67. package/src/context/SwapProvider.tsx +193 -81
  68. package/src/context/TxUIWrapper.tsx +3 -3
  69. package/src/hooks/useEvmContractApi.ts +28 -4
  70. package/src/models/payloads/GetBalancesPayload.ts +1 -0
  71. package/src/services/api.ts +37 -0
  72. package/src/utils/index.ts +27 -1
  73. package/src/utils/tokens.ts +20 -1
  74. package/src/utils/validation.ts +9 -4
  75. package/tailwind.config.js +4 -1
  76. package/src/components/Swap/SwapView/ConfirmationView/TxOverview/ArrowIcon.tsx +0 -13
  77. package/src/components/Swap/SwapView/ConfirmationView/TxOverview/SwapPanel/index.tsx +0 -72
  78. package/src/components/Swap/SwapView/ConfirmationView/TxResult/TokenItem/index.tsx +0 -25
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @xswap-link/xswap-sdk
2
2
 
3
+ ## 0.15.0
4
+
5
+ ### Minor Changes
6
+
7
+ - c4495ea: Confirmation flow redesign and route defaults: new TxOverview/TxResult layout with token tiles and step indicators, new wallet picker view, thin icon set, fixed default bridge route (Ethereum -> Base), source chain follows real in-session wallet network switches only, widget state fully re-initializes when bridgeUI changes at runtime, and stale token balances are cleared so MAX never uses an outdated value.
8
+
9
+ ## 0.14.1
10
+
11
+ ### Patch Changes
12
+
13
+ - 086dc6f: restored destination chain selection in bridge mode via a network picker on the destination panel
14
+ - 086dc6f: custom token import now resolves the pasted address on the network selected in the token picker filter instead of the swap panel chain
15
+ - 086dc6f: already imported tokens are recognized in the token picker right after import — searching their address shows them on the list instead of the import flow again, and they are searchable by name/symbol
16
+ - 086dc6f: balances fetch passes user-imported tokens from localStorage so the backend resolves their balances too; importing a token triggers a balances refetch
17
+ - 086dc6f: after an approval, poll the token allowance until the RPC sees the approved amount (up to ~5s) before sending the swap, and retry the swap's gas estimation with backoff (0.5s/1s/2s) as a fallback — fixes swaps failing right after approval on lagging RPC nodes
18
+ - 086dc6f: widget scales down on mobile again — fixed width is applied only when the integrator sets --modal-width, otherwise the widget fills its container up to the 620px cap
19
+ - 086dc6f: selected token balance refresh uses the backend tokenBalance endpoint instead of public RPCs
20
+ - 086dc6f: aligned the widget with the swap-v2 design: glass container (rounded-32, blur-48), lavender primary button with dark text, "POWERED BY CCIP." footer, fee row "/ Est. Time" format, stronger source panel border, "Balance." label, in-place picker views on desktop with bottom sheets on mobile, stacked network filter logos
21
+ - 086dc6f: replaced header (adjustments, clock) and close icons with the swap-v2 design versions
22
+ - 086dc6f: custom token import fetches metadata (name, symbol, decimals) from the backend tokenMetadata endpoint instead of querying public RPCs directly
23
+
3
24
  ## 0.14.0
4
25
 
5
26
  ### Minor Changes
package/dist/index.d.mts CHANGED
@@ -93,6 +93,10 @@ type GenerateStakingCallsParams = {
93
93
  type GetTokenBalancesPayload = {
94
94
  walletAddress?: string;
95
95
  solanaWalletAddress?: string;
96
+ customTokens?: {
97
+ chainId: string;
98
+ tokenAddress: string;
99
+ }[];
96
100
  };
97
101
 
98
102
  type GetLeaderboardChangePayload = {
package/dist/index.d.ts CHANGED
@@ -93,6 +93,10 @@ type GenerateStakingCallsParams = {
93
93
  type GetTokenBalancesPayload = {
94
94
  walletAddress?: string;
95
95
  solanaWalletAddress?: string;
96
+ customTokens?: {
97
+ chainId: string;
98
+ tokenAddress: string;
99
+ }[];
96
100
  };
97
101
 
98
102
  type GetLeaderboardChangePayload = {