@b3dotfun/sdk 0.1.2 → 0.1.5

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 (235) hide show
  1. package/dist/cjs/anyspend/react/components/AnySpend.d.ts +7 -1
  2. package/dist/cjs/anyspend/react/components/AnySpend.js +66 -15
  3. package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +6 -2
  4. package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.js +4 -4
  5. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +6 -0
  6. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +185 -50
  7. package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +6 -1
  8. package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +19 -4
  9. package/dist/cjs/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +2 -1
  10. package/dist/cjs/anyspend/react/components/AnySpendStakeUpsideExactIn.js +2 -2
  11. package/dist/cjs/anyspend/react/components/QRDeposit.d.ts +4 -1
  12. package/dist/cjs/anyspend/react/components/QRDeposit.js +12 -4
  13. package/dist/cjs/anyspend/react/components/common/CryptoPaySection.d.ts +3 -1
  14. package/dist/cjs/anyspend/react/components/common/CryptoPaySection.js +7 -5
  15. package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.d.ts +3 -1
  16. package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +4 -3
  17. package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
  18. package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.js +7 -6
  19. package/dist/cjs/anyspend/react/components/common/FeeDetailPanel.d.ts +3 -1
  20. package/dist/cjs/anyspend/react/components/common/FeeDetailPanel.js +15 -6
  21. package/dist/cjs/anyspend/react/components/common/FiatPaymentMethod.d.ts +3 -1
  22. package/dist/cjs/anyspend/react/components/common/FiatPaymentMethod.js +10 -6
  23. package/dist/cjs/anyspend/react/components/common/OrderDetails.d.ts +3 -0
  24. package/dist/cjs/anyspend/react/components/common/OrderDetails.js +11 -10
  25. package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
  26. package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.js +9 -9
  27. package/dist/cjs/anyspend/react/components/common/OrderHistory.js +2 -1
  28. package/dist/cjs/anyspend/react/components/common/PanelOnramp.d.ts +3 -1
  29. package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +2 -2
  30. package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.d.ts +2 -0
  31. package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.js +20 -7
  32. package/dist/cjs/anyspend/react/components/common/PointsDetailPanel.d.ts +3 -1
  33. package/dist/cjs/anyspend/react/components/common/PointsDetailPanel.js +3 -2
  34. package/dist/cjs/anyspend/react/components/common/RecipientSelection.d.ts +6 -1
  35. package/dist/cjs/anyspend/react/components/common/RecipientSelection.js +5 -2
  36. package/dist/cjs/anyspend/react/components/common/TabSection.d.ts +3 -1
  37. package/dist/cjs/anyspend/react/components/common/TabSection.js +16 -7
  38. package/dist/cjs/anyspend/react/components/common/TransferCryptoDetails.d.ts +2 -0
  39. package/dist/cjs/anyspend/react/components/common/TransferCryptoDetails.js +3 -2
  40. package/dist/cjs/anyspend/react/components/common/WarningText.d.ts +8 -7
  41. package/dist/cjs/anyspend/react/components/common/WarningText.js +5 -6
  42. package/dist/cjs/anyspend/react/components/index.d.ts +1 -0
  43. package/dist/cjs/anyspend/react/components/types/classes.d.ts +390 -0
  44. package/dist/cjs/anyspend/react/components/types/classes.js +6 -0
  45. package/dist/cjs/anyspend/react/hooks/index.d.ts +1 -0
  46. package/dist/cjs/anyspend/react/hooks/index.js +1 -0
  47. package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.d.ts +22 -2
  48. package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.js +119 -15
  49. package/dist/cjs/anyspend/react/hooks/useDirectTransfer.d.ts +17 -0
  50. package/dist/cjs/anyspend/react/hooks/useDirectTransfer.js +46 -0
  51. package/dist/cjs/anyspend/react/hooks/useRecipientAddressState.js +1 -1
  52. package/dist/cjs/anyspend/utils/format.js +12 -2
  53. package/dist/cjs/global-account/react/components/B3DynamicModal.js +1 -5
  54. package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +1 -3
  55. package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.js +1 -2
  56. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +1 -4
  57. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +2 -2
  58. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.d.ts +1 -1
  59. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.js +1 -1
  60. package/dist/cjs/global-account/react/components/B3Provider/LocalSDKProvider.d.ts +1 -4
  61. package/dist/cjs/global-account/react/components/B3Provider/LocalSDKProvider.js +1 -3
  62. package/dist/cjs/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +1 -3
  63. package/dist/cjs/global-account/react/components/ManageAccount/SettingsContent.js +17 -3
  64. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +19 -152
  65. package/dist/cjs/global-account/react/components/index.d.ts +0 -1
  66. package/dist/cjs/global-account/react/components/index.js +3 -6
  67. package/dist/cjs/global-account/react/hooks/index.d.ts +0 -1
  68. package/dist/cjs/global-account/react/hooks/index.js +2 -4
  69. package/dist/cjs/global-account/react/hooks/useAuth.d.ts +2 -3
  70. package/dist/cjs/global-account/react/hooks/useAuth.js +14 -31
  71. package/dist/cjs/global-account/react/hooks/useTWAuth.d.ts +1 -1
  72. package/dist/cjs/global-account/react/hooks/useTWAuth.js +3 -3
  73. package/dist/cjs/global-account/react/stores/useModalStore.d.ts +8 -19
  74. package/dist/esm/anyspend/react/components/AnySpend.d.ts +7 -1
  75. package/dist/esm/anyspend/react/components/AnySpend.js +68 -17
  76. package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +6 -2
  77. package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.js +4 -4
  78. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +6 -0
  79. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +189 -54
  80. package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +6 -1
  81. package/dist/esm/anyspend/react/components/AnySpendDeposit.js +19 -4
  82. package/dist/esm/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +2 -1
  83. package/dist/esm/anyspend/react/components/AnySpendStakeUpsideExactIn.js +2 -2
  84. package/dist/esm/anyspend/react/components/QRDeposit.d.ts +4 -1
  85. package/dist/esm/anyspend/react/components/QRDeposit.js +12 -4
  86. package/dist/esm/anyspend/react/components/common/CryptoPaySection.d.ts +3 -1
  87. package/dist/esm/anyspend/react/components/common/CryptoPaySection.js +7 -5
  88. package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.d.ts +3 -1
  89. package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +4 -3
  90. package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
  91. package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.js +7 -6
  92. package/dist/esm/anyspend/react/components/common/FeeDetailPanel.d.ts +3 -1
  93. package/dist/esm/anyspend/react/components/common/FeeDetailPanel.js +15 -6
  94. package/dist/esm/anyspend/react/components/common/FiatPaymentMethod.d.ts +3 -1
  95. package/dist/esm/anyspend/react/components/common/FiatPaymentMethod.js +10 -6
  96. package/dist/esm/anyspend/react/components/common/OrderDetails.d.ts +3 -0
  97. package/dist/esm/anyspend/react/components/common/OrderDetails.js +11 -10
  98. package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
  99. package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.js +9 -9
  100. package/dist/esm/anyspend/react/components/common/OrderHistory.js +2 -1
  101. package/dist/esm/anyspend/react/components/common/PanelOnramp.d.ts +3 -1
  102. package/dist/esm/anyspend/react/components/common/PanelOnramp.js +2 -2
  103. package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.d.ts +2 -0
  104. package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.js +20 -7
  105. package/dist/esm/anyspend/react/components/common/PointsDetailPanel.d.ts +3 -1
  106. package/dist/esm/anyspend/react/components/common/PointsDetailPanel.js +3 -2
  107. package/dist/esm/anyspend/react/components/common/RecipientSelection.d.ts +6 -1
  108. package/dist/esm/anyspend/react/components/common/RecipientSelection.js +5 -2
  109. package/dist/esm/anyspend/react/components/common/TabSection.d.ts +3 -1
  110. package/dist/esm/anyspend/react/components/common/TabSection.js +16 -7
  111. package/dist/esm/anyspend/react/components/common/TransferCryptoDetails.d.ts +2 -0
  112. package/dist/esm/anyspend/react/components/common/TransferCryptoDetails.js +3 -2
  113. package/dist/esm/anyspend/react/components/common/WarningText.d.ts +8 -7
  114. package/dist/esm/anyspend/react/components/common/WarningText.js +5 -6
  115. package/dist/esm/anyspend/react/components/index.d.ts +1 -0
  116. package/dist/esm/anyspend/react/components/types/classes.d.ts +390 -0
  117. package/dist/esm/anyspend/react/components/types/classes.js +5 -0
  118. package/dist/esm/anyspend/react/hooks/index.d.ts +1 -0
  119. package/dist/esm/anyspend/react/hooks/index.js +1 -0
  120. package/dist/esm/anyspend/react/hooks/useAnyspendFlow.d.ts +22 -2
  121. package/dist/esm/anyspend/react/hooks/useAnyspendFlow.js +119 -16
  122. package/dist/esm/anyspend/react/hooks/useDirectTransfer.d.ts +17 -0
  123. package/dist/esm/anyspend/react/hooks/useDirectTransfer.js +43 -0
  124. package/dist/esm/anyspend/react/hooks/useRecipientAddressState.js +1 -1
  125. package/dist/esm/anyspend/utils/format.js +12 -2
  126. package/dist/esm/global-account/react/components/B3DynamicModal.js +1 -5
  127. package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +1 -3
  128. package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.js +1 -2
  129. package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +1 -4
  130. package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +2 -2
  131. package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.d.ts +1 -1
  132. package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.js +1 -1
  133. package/dist/esm/global-account/react/components/B3Provider/LocalSDKProvider.d.ts +1 -4
  134. package/dist/esm/global-account/react/components/B3Provider/LocalSDKProvider.js +1 -3
  135. package/dist/esm/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +1 -3
  136. package/dist/esm/global-account/react/components/ManageAccount/SettingsContent.js +16 -2
  137. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +20 -153
  138. package/dist/esm/global-account/react/components/index.d.ts +0 -1
  139. package/dist/esm/global-account/react/components/index.js +0 -2
  140. package/dist/esm/global-account/react/hooks/index.d.ts +0 -1
  141. package/dist/esm/global-account/react/hooks/index.js +0 -1
  142. package/dist/esm/global-account/react/hooks/useAuth.d.ts +2 -3
  143. package/dist/esm/global-account/react/hooks/useAuth.js +14 -31
  144. package/dist/esm/global-account/react/hooks/useTWAuth.d.ts +1 -1
  145. package/dist/esm/global-account/react/hooks/useTWAuth.js +3 -3
  146. package/dist/esm/global-account/react/stores/useModalStore.d.ts +8 -19
  147. package/dist/styles/index.css +1 -1
  148. package/dist/types/anyspend/react/components/AnySpend.d.ts +7 -1
  149. package/dist/types/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +6 -2
  150. package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +6 -0
  151. package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +6 -1
  152. package/dist/types/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +2 -1
  153. package/dist/types/anyspend/react/components/QRDeposit.d.ts +4 -1
  154. package/dist/types/anyspend/react/components/common/CryptoPaySection.d.ts +3 -1
  155. package/dist/types/anyspend/react/components/common/CryptoPaymentMethod.d.ts +3 -1
  156. package/dist/types/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
  157. package/dist/types/anyspend/react/components/common/FeeDetailPanel.d.ts +3 -1
  158. package/dist/types/anyspend/react/components/common/FiatPaymentMethod.d.ts +3 -1
  159. package/dist/types/anyspend/react/components/common/OrderDetails.d.ts +3 -0
  160. package/dist/types/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
  161. package/dist/types/anyspend/react/components/common/PanelOnramp.d.ts +3 -1
  162. package/dist/types/anyspend/react/components/common/PanelOnrampPayment.d.ts +2 -0
  163. package/dist/types/anyspend/react/components/common/PointsDetailPanel.d.ts +3 -1
  164. package/dist/types/anyspend/react/components/common/RecipientSelection.d.ts +6 -1
  165. package/dist/types/anyspend/react/components/common/TabSection.d.ts +3 -1
  166. package/dist/types/anyspend/react/components/common/TransferCryptoDetails.d.ts +2 -0
  167. package/dist/types/anyspend/react/components/common/WarningText.d.ts +8 -7
  168. package/dist/types/anyspend/react/components/index.d.ts +1 -0
  169. package/dist/types/anyspend/react/components/types/classes.d.ts +390 -0
  170. package/dist/types/anyspend/react/hooks/index.d.ts +1 -0
  171. package/dist/types/anyspend/react/hooks/useAnyspendFlow.d.ts +22 -2
  172. package/dist/types/anyspend/react/hooks/useDirectTransfer.d.ts +17 -0
  173. package/dist/types/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +1 -3
  174. package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +1 -4
  175. package/dist/types/global-account/react/components/B3Provider/B3Provider.native.d.ts +1 -1
  176. package/dist/types/global-account/react/components/B3Provider/LocalSDKProvider.d.ts +1 -4
  177. package/dist/types/global-account/react/components/index.d.ts +0 -1
  178. package/dist/types/global-account/react/hooks/index.d.ts +0 -1
  179. package/dist/types/global-account/react/hooks/useAuth.d.ts +2 -3
  180. package/dist/types/global-account/react/hooks/useTWAuth.d.ts +1 -1
  181. package/dist/types/global-account/react/stores/useModalStore.d.ts +8 -19
  182. package/package.json +1 -1
  183. package/src/anyspend/react/components/AnySpend.tsx +164 -36
  184. package/src/anyspend/react/components/AnySpendCollectorClubPurchase.tsx +11 -6
  185. package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +278 -69
  186. package/src/anyspend/react/components/AnySpendDeposit.tsx +176 -52
  187. package/src/anyspend/react/components/AnySpendStakeUpsideExactIn.tsx +3 -0
  188. package/src/anyspend/react/components/QRDeposit.tsx +91 -35
  189. package/src/anyspend/react/components/common/CryptoPaySection.tsx +31 -19
  190. package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +14 -4
  191. package/src/anyspend/react/components/common/CryptoReceiveSection.tsx +43 -23
  192. package/src/anyspend/react/components/common/FeeDetailPanel.tsx +53 -32
  193. package/src/anyspend/react/components/common/FiatPaymentMethod.tsx +26 -13
  194. package/src/anyspend/react/components/common/OrderDetails.tsx +20 -9
  195. package/src/anyspend/react/components/common/OrderDetailsCollapsible.tsx +12 -7
  196. package/src/anyspend/react/components/common/OrderHistory.tsx +2 -1
  197. package/src/anyspend/react/components/common/PanelOnramp.tsx +4 -1
  198. package/src/anyspend/react/components/common/PanelOnrampPayment.tsx +118 -40
  199. package/src/anyspend/react/components/common/PointsDetailPanel.tsx +28 -14
  200. package/src/anyspend/react/components/common/RecipientSelection.tsx +20 -5
  201. package/src/anyspend/react/components/common/TabSection.tsx +21 -12
  202. package/src/anyspend/react/components/common/TransferCryptoDetails.tsx +12 -4
  203. package/src/anyspend/react/components/common/WarningText.tsx +10 -10
  204. package/src/anyspend/react/components/index.ts +16 -0
  205. package/src/anyspend/react/components/types/classes.ts +476 -0
  206. package/src/anyspend/react/hooks/index.ts +1 -0
  207. package/src/anyspend/react/hooks/useAnyspendFlow.ts +141 -17
  208. package/src/anyspend/react/hooks/useDirectTransfer.ts +67 -0
  209. package/src/anyspend/react/hooks/useRecipientAddressState.ts +1 -1
  210. package/src/anyspend/utils/format.ts +13 -2
  211. package/src/global-account/react/components/B3DynamicModal.tsx +0 -5
  212. package/src/global-account/react/components/B3Provider/B3ConfigProvider.tsx +0 -4
  213. package/src/global-account/react/components/B3Provider/B3Provider.native.tsx +1 -1
  214. package/src/global-account/react/components/B3Provider/B3Provider.tsx +1 -11
  215. package/src/global-account/react/components/B3Provider/LocalSDKProvider.tsx +0 -6
  216. package/src/global-account/react/components/B3Provider/RelayKitProviderWrapper.tsx +1 -4
  217. package/src/global-account/react/components/ManageAccount/SettingsContent.tsx +33 -1
  218. package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +27 -184
  219. package/src/global-account/react/components/index.ts +0 -3
  220. package/src/global-account/react/hooks/index.ts +0 -1
  221. package/src/global-account/react/hooks/useAuth.ts +14 -31
  222. package/src/global-account/react/hooks/useTWAuth.tsx +3 -5
  223. package/src/global-account/react/stores/useModalStore.ts +7 -20
  224. package/dist/cjs/global-account/react/components/TurnkeyAuthModal.d.ts +0 -8
  225. package/dist/cjs/global-account/react/components/TurnkeyAuthModal.js +0 -86
  226. package/dist/cjs/global-account/react/hooks/useTurnkeyAuth.d.ts +0 -20
  227. package/dist/cjs/global-account/react/hooks/useTurnkeyAuth.js +0 -142
  228. package/dist/esm/global-account/react/components/TurnkeyAuthModal.d.ts +0 -8
  229. package/dist/esm/global-account/react/components/TurnkeyAuthModal.js +0 -83
  230. package/dist/esm/global-account/react/hooks/useTurnkeyAuth.d.ts +0 -20
  231. package/dist/esm/global-account/react/hooks/useTurnkeyAuth.js +0 -136
  232. package/dist/types/global-account/react/components/TurnkeyAuthModal.d.ts +0 -8
  233. package/dist/types/global-account/react/hooks/useTurnkeyAuth.d.ts +0 -20
  234. package/src/global-account/react/components/TurnkeyAuthModal.tsx +0 -243
  235. package/src/global-account/react/hooks/useTurnkeyAuth.ts +0 -171
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.AnySpendCustomExactIn = AnySpendCustomExactIn;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const anyspend_1 = require("../../../anyspend");
8
9
  const react_1 = require("../../../anyspend/react");
9
10
  const utils_1 = require("../../../anyspend/utils");
10
11
  const react_2 = require("../../../global-account/react");
@@ -16,6 +17,7 @@ const react_3 = require("motion/react");
16
17
  const react_4 = require("react");
17
18
  const react_5 = require("thirdweb/react");
18
19
  const constants_1 = require("../../constants");
20
+ const useDirectTransfer_1 = require("../hooks/useDirectTransfer");
19
21
  const useAnyspendFlow_1 = require("../hooks/useAnyspendFlow");
20
22
  const AnySpendFingerprintWrapper_1 = require("./AnySpendFingerprintWrapper");
21
23
  const CryptoPaySection_1 = require("./common/CryptoPaySection");
@@ -33,13 +35,14 @@ function AnySpendCustomExactIn(props) {
33
35
  const fingerprintConfig = (0, AnySpendFingerprintWrapper_1.getFingerprintConfig)();
34
36
  return ((0, jsx_runtime_1.jsx)(AnySpendFingerprintWrapper_1.AnySpendFingerprintWrapper, { fingerprint: fingerprintConfig, children: (0, jsx_runtime_1.jsx)(AnySpendCustomExactInInner, { ...props }) }));
35
37
  }
36
- function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddress, paymentType = "crypto", sourceTokenAddress, sourceTokenChainId, destinationToken, destinationChainId, onSuccess, onOpenCustomModal, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, customExactInConfig, orderType = "custom_exact_in", minDestinationAmount, header, returnToHomeUrl, customRecipientLabel, returnHomeLabel, }) {
38
+ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddress, paymentType = "crypto", sourceTokenAddress, sourceTokenChainId, destinationToken, destinationChainId, onSuccess, onOpenCustomModal, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, customExactInConfig, destinationTokenAmount, orderType = "custom_exact_in", minDestinationAmount, header, returnToHomeUrl, customRecipientLabel, returnHomeLabel, classes, allowDirectTransfer = false, }) {
37
39
  const actionLabel = customExactInConfig?.action ?? "Custom Execution";
40
+ const setB3ModalOpen = (0, react_2.useModalStore)(state => state.setB3ModalOpen);
38
41
  const DESTINATION_TOKEN_DETAILS = {
39
42
  SYMBOL: destinationToken.symbol ?? "TOKEN",
40
43
  LOGO_URI: destinationToken.metadata?.logoURI ?? "",
41
44
  };
42
- const { activePanel, setActivePanel, orderId, setOrderId, oat, selectedSrcChainId, setSelectedSrcChainId, selectedSrcToken, setSelectedSrcToken, selectedDstToken, selectedDstChainId, srcAmount, setSrcAmount, dstAmount, isSrcInputDirty, setIsSrcInputDirty, selectedCryptoPaymentMethod, effectiveCryptoPaymentMethod, setSelectedCryptoPaymentMethod, selectedFiatPaymentMethod, setSelectedFiatPaymentMethod, selectedRecipientAddress, setSelectedRecipientAddress, recipientName, globalAddress, hasEnoughBalance, isBalanceLoading, anyspendQuote, isLoadingAnyspendQuote, activeInputAmountInWei, geoData, coinbaseAvailablePaymentMethods, stripeWeb2Support, createOrder, isCreatingOrder, createOnrampOrder, isCreatingOnrampOrder, } = (0, useAnyspendFlow_1.useAnyspendFlow)({
45
+ const { activePanel, setActivePanel, orderId, setOrderId, oat, selectedSrcChainId, setSelectedSrcChainId, selectedSrcToken, setSelectedSrcToken, selectedDstToken, selectedDstChainId, srcAmount, setSrcAmount, dstAmount, dstAmountInput, setDstAmountInput, isSrcInputDirty, setIsSrcInputDirty, tradeType, selectedCryptoPaymentMethod, effectiveCryptoPaymentMethod, setSelectedCryptoPaymentMethod, selectedFiatPaymentMethod, setSelectedFiatPaymentMethod, selectedRecipientAddress, setSelectedRecipientAddress, recipientName, globalAddress, hasEnoughBalance, isBalanceLoading, anyspendQuote, isLoadingAnyspendQuote, isQuoteLoading, activeInputAmountInWei, activeOutputAmountInWei, geoData, coinbaseAvailablePaymentMethods, stripeWeb2Support, createOrder, isCreatingOrder, createOnrampOrder, isCreatingOnrampOrder, } = (0, useAnyspendFlow_1.useAnyspendFlow)({
43
46
  paymentType,
44
47
  recipientAddress,
45
48
  loadOrder,
@@ -51,9 +54,21 @@ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddres
51
54
  slippage: SLIPPAGE_PERCENT,
52
55
  disableUrlParamManagement: true,
53
56
  orderType,
57
+ customExactInConfig,
54
58
  });
55
59
  const { connectedEOAWallet } = (0, react_2.useAccountWallet)();
56
60
  const setActiveWallet = (0, react_5.useSetActiveWallet)();
61
+ const { executeDirectTransfer, isTransferring: isSwitchingOrExecuting } = (0, useDirectTransfer_1.useDirectTransfer)();
62
+ // Check if source and destination are the same token on the same chain
63
+ const isSameChainSameToken = (0, react_4.useMemo)(() => {
64
+ return (paymentType === "crypto" &&
65
+ selectedSrcChainId === selectedDstChainId &&
66
+ selectedSrcToken?.address?.toLowerCase() === selectedDstToken?.address?.toLowerCase());
67
+ }, [paymentType, selectedSrcChainId, selectedDstChainId, selectedSrcToken?.address, selectedDstToken?.address]);
68
+ // Check if this is a direct transfer
69
+ const isDirectTransfer = isSameChainSameToken && allowDirectTransfer;
70
+ // State for direct transfer success
71
+ const [directTransferTxHash, setDirectTransferTxHash] = (0, react_4.useState)();
57
72
  // Get gas price for source chain (where the user pays from)
58
73
  const { gasPrice: gasPriceData, isLoading: isLoadingGas } = (0, react_1.useGasPrice)(selectedSrcChainId);
59
74
  const appliedPreferEoa = (0, react_4.useRef)(false);
@@ -65,6 +80,17 @@ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddres
65
80
  }
66
81
  }
67
82
  }, [preferEoa, connectedEOAWallet, setActiveWallet]);
83
+ // Prefill destination amount if provided (for EXACT_OUTPUT mode)
84
+ const appliedDestinationAmount = (0, react_4.useRef)(false);
85
+ (0, react_4.useEffect)(() => {
86
+ if (destinationTokenAmount && !appliedDestinationAmount.current) {
87
+ appliedDestinationAmount.current = true;
88
+ // Convert wei to human-readable format
89
+ const formattedAmount = (0, number_1.formatUnits)(destinationTokenAmount, destinationToken.decimals);
90
+ setDstAmountInput(formattedAmount);
91
+ setIsSrcInputDirty(false); // Switch to EXACT_OUTPUT mode
92
+ }
93
+ }, [destinationTokenAmount, destinationToken.decimals, setDstAmountInput, setIsSrcInputDirty]);
68
94
  const selectedRecipientOrDefault = selectedRecipientAddress ?? recipientAddress;
69
95
  const expectedDstAmountRaw = anyspendQuote?.data?.currencyOut?.amount ?? "0";
70
96
  const buildCustomPayload = (_recipient) => {
@@ -89,23 +115,31 @@ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddres
89
115
  };
90
116
  };
91
117
  const btnInfo = (0, react_4.useMemo)(() => {
92
- if (activeInputAmountInWei === "0")
118
+ // Check for empty amount based on trade type
119
+ const isAmountEmpty = tradeType === "EXACT_OUTPUT" ? !dstAmountInput || dstAmountInput === "0" : activeInputAmountInWei === "0";
120
+ const isDirectTransfer = isSameChainSameToken && allowDirectTransfer;
121
+ if (isAmountEmpty)
93
122
  return { text: "Enter an amount", disable: true, error: false, loading: false };
94
123
  if (orderType === "hype_duel" && selectedSrcToken?.address?.toLowerCase() === constants_1.B3_TOKEN.address.toLowerCase()) {
95
124
  return { text: "Convert to HYPE using B3", disable: false, error: false, loading: false };
96
125
  }
97
- if (isLoadingAnyspendQuote)
126
+ if (isQuoteLoading && !isDirectTransfer)
98
127
  return { text: "Loading quote...", disable: true, error: false, loading: true };
99
- if (isCreatingOrder || isCreatingOnrampOrder)
100
- return { text: "Creating order...", disable: true, error: false, loading: true };
128
+ if (isCreatingOrder || isCreatingOnrampOrder || isSwitchingOrExecuting)
129
+ return {
130
+ text: isSwitchingOrExecuting ? "Transferring..." : "Creating order...",
131
+ disable: true,
132
+ error: false,
133
+ loading: true,
134
+ };
101
135
  if (!selectedRecipientOrDefault)
102
136
  return { text: "Select recipient", disable: false, error: false, loading: false };
103
- if (!anyspendQuote || !anyspendQuote.success)
137
+ if ((!anyspendQuote || !anyspendQuote.success) && !isDirectTransfer)
104
138
  return { text: "Get quote error", disable: true, error: true, loading: false };
105
- // Check minimum destination amount if specified
106
- // Check minimum destination amount if specified
107
- if (minDestinationAmount &&
108
- anyspendQuote.data?.currencyOut?.amount &&
139
+ // Check minimum destination amount if specified (skip for direct transfers)
140
+ if (!isDirectTransfer &&
141
+ minDestinationAmount &&
142
+ anyspendQuote?.data?.currencyOut?.amount &&
109
143
  anyspendQuote.data.currencyOut.currency &&
110
144
  anyspendQuote.data.currencyOut.currency.decimals != null) {
111
145
  const rawAmountInWei = BigInt(anyspendQuote.data.currencyOut.amount);
@@ -129,8 +163,12 @@ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddres
129
163
  effectiveCryptoPaymentMethod === CryptoPaymentMethod_1.CryptoPaymentMethodType.CONNECT_WALLET) {
130
164
  return { text: "Insufficient balance", disable: true, error: true, loading: false };
131
165
  }
132
- // Use different text based on order type
133
- const buttonText = orderType === "hype_duel" ? "Continue to deposit" : `Execute ${actionLabel}`;
166
+ // Use different text based on order type and whether it's a direct transfer
167
+ const buttonText = isDirectTransfer
168
+ ? "Transfer"
169
+ : orderType === "hype_duel"
170
+ ? "Continue to deposit"
171
+ : `Execute ${actionLabel}`;
134
172
  return { text: buttonText, disable: false, error: false, loading: false };
135
173
  }
136
174
  if (paymentType === "fiat") {
@@ -142,9 +180,10 @@ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddres
142
180
  return { text: "Continue", disable: false, error: false, loading: false };
143
181
  }, [
144
182
  activeInputAmountInWei,
145
- isLoadingAnyspendQuote,
183
+ isQuoteLoading,
146
184
  isCreatingOrder,
147
185
  isCreatingOnrampOrder,
186
+ isSwitchingOrExecuting,
148
187
  selectedRecipientOrDefault,
149
188
  anyspendQuote,
150
189
  paymentType,
@@ -157,6 +196,10 @@ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddres
157
196
  DESTINATION_TOKEN_DETAILS.SYMBOL,
158
197
  orderType,
159
198
  selectedSrcToken,
199
+ tradeType,
200
+ dstAmountInput,
201
+ isSameChainSameToken,
202
+ allowDirectTransfer,
160
203
  ]);
161
204
  const onMainButtonClick = async () => {
162
205
  if (orderType === "hype_duel" && selectedSrcToken?.address?.toLowerCase() === constants_1.B3_TOKEN.address.toLowerCase()) {
@@ -185,28 +228,82 @@ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddres
185
228
  }
186
229
  };
187
230
  const headerContent = header ? (header({ anyspendPrice: anyspendQuote, isLoadingAnyspendPrice: isLoadingAnyspendQuote })) : ((0, jsx_runtime_1.jsx)("div", { className: "mb-4 flex flex-col items-center gap-3 text-center", children: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-as-primary text-xl font-bold", children: actionLabel }), (0, jsx_runtime_1.jsx)("p", { className: "text-as-secondary text-sm", children: "Pay from any token to execute a custom exact-in transaction." })] }) }));
188
- const mainView = ((0, jsx_runtime_1.jsxs)("div", { className: "anyspend-custom-exact-in-container mx-auto flex w-[460px] max-w-full flex-col items-center gap-2", children: [headerContent, (0, jsx_runtime_1.jsx)("div", { className: "relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2", children: [paymentType === "crypto" ? ((0, jsx_runtime_1.jsx)(CryptoPaySection_1.CryptoPaySection, { selectedSrcChainId: selectedSrcChainId, setSelectedSrcChainId: setSelectedSrcChainId, selectedSrcToken: selectedSrcToken, setSelectedSrcToken: setSelectedSrcToken, srcAmount: srcAmount, setSrcAmount: setSrcAmount, isSrcInputDirty: isSrcInputDirty, setIsSrcInputDirty: setIsSrcInputDirty, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod, onSelectCryptoPaymentMethod: () => setActivePanel(useAnyspendFlow_1.PanelView.CRYPTO_PAYMENT_METHOD), anyspendQuote: anyspendQuote, onTokenSelect: onTokenSelect })) : ((0, jsx_runtime_1.jsx)(react_3.motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0, ease: "easeInOut" }, children: (0, jsx_runtime_1.jsx)(PanelOnramp_1.PanelOnramp, { srcAmountOnRamp: srcAmount, setSrcAmountOnRamp: setSrcAmount, selectedPaymentMethod: selectedFiatPaymentMethod, setActivePanel: setActivePanel, _recipientAddress: selectedRecipientOrDefault, destinationToken: selectedDstToken, destinationChainId: selectedDstChainId, dstTokenSymbol: DESTINATION_TOKEN_DETAILS.SYMBOL, hideDstToken: true, destinationAmount: dstAmount, onDestinationTokenChange: () => { }, onDestinationChainChange: () => { }, fiatPaymentMethodIndex: useAnyspendFlow_1.PanelView.FIAT_PAYMENT_METHOD, recipientSelectionPanelIndex: useAnyspendFlow_1.PanelView.RECIPIENT_SELECTION, anyspendQuote: anyspendQuote, onShowPointsDetail: () => setActivePanel(useAnyspendFlow_1.PanelView.POINTS_DETAIL), onShowFeeDetail: () => setActivePanel(useAnyspendFlow_1.PanelView.FEE_DETAIL), customUsdInputValues: customUsdInputValues, customRecipientLabel: customRecipientLabel }) })), (0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)("relative -my-1 flex h-0 items-center justify-center", paymentType === "fiat" && "hidden"), children: (0, jsx_runtime_1.jsx)(react_2.Button, { variant: "ghost", className: (0, cn_1.cn)("swap-direction-button border-as-stroke bg-as-surface-primary z-10 h-10 w-10 cursor-default rounded-xl border-2 sm:h-8 sm:w-8 sm:rounded-xl"), children: (0, jsx_runtime_1.jsx)("div", { className: "relative flex items-center justify-center transition-opacity", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ArrowDown, { className: "text-as-primary/50 h-5 w-5" }) }) }) }), paymentType === "crypto" && ((0, jsx_runtime_1.jsx)(CryptoReceiveSection_1.CryptoReceiveSection, { isDepositMode: false, isBuyMode: true, effectiveRecipientAddress: selectedRecipientOrDefault, recipientName: recipientName || undefined, customRecipientLabel: customRecipientLabel, onSelectRecipient: () => setActivePanel(useAnyspendFlow_1.PanelView.RECIPIENT_SELECTION), dstAmount: dstAmount, dstToken: selectedDstToken, dstTokenSymbol: DESTINATION_TOKEN_DETAILS.SYMBOL, dstTokenLogoURI: DESTINATION_TOKEN_DETAILS.LOGO_URI, selectedDstChainId: selectedDstChainId, setSelectedDstChainId: () => { }, setSelectedDstToken: () => { }, isSrcInputDirty: isSrcInputDirty, onChangeDstAmount: value => {
231
+ const mainView = ((0, jsx_runtime_1.jsxs)("div", { className: classes?.container ||
232
+ "anyspend-custom-exact-in-container mx-auto flex w-[460px] max-w-full flex-col items-center gap-2", children: [headerContent, (0, jsx_runtime_1.jsx)("div", { className: "relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2", children: [paymentType === "crypto" ? ((0, jsx_runtime_1.jsx)(CryptoPaySection_1.CryptoPaySection, { selectedSrcChainId: selectedSrcChainId, setSelectedSrcChainId: setSelectedSrcChainId, selectedSrcToken: selectedSrcToken, setSelectedSrcToken: setSelectedSrcToken, srcAmount: srcAmount, setSrcAmount: setSrcAmount, isSrcInputDirty: isSrcInputDirty, setIsSrcInputDirty: setIsSrcInputDirty, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod, onSelectCryptoPaymentMethod: () => setActivePanel(useAnyspendFlow_1.PanelView.CRYPTO_PAYMENT_METHOD), anyspendQuote: anyspendQuote, onTokenSelect: onTokenSelect })) : ((0, jsx_runtime_1.jsx)(react_3.motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0, ease: "easeInOut" }, children: (0, jsx_runtime_1.jsx)(PanelOnramp_1.PanelOnramp, { srcAmountOnRamp: srcAmount, setSrcAmountOnRamp: setSrcAmount, selectedPaymentMethod: selectedFiatPaymentMethod, setActivePanel: setActivePanel, _recipientAddress: selectedRecipientOrDefault, destinationToken: selectedDstToken, destinationChainId: selectedDstChainId, dstTokenSymbol: DESTINATION_TOKEN_DETAILS.SYMBOL, hideDstToken: true, destinationAmount: dstAmount, onDestinationTokenChange: () => { }, onDestinationChainChange: () => { }, fiatPaymentMethodIndex: useAnyspendFlow_1.PanelView.FIAT_PAYMENT_METHOD, recipientSelectionPanelIndex: useAnyspendFlow_1.PanelView.RECIPIENT_SELECTION, anyspendQuote: anyspendQuote, onShowPointsDetail: () => setActivePanel(useAnyspendFlow_1.PanelView.POINTS_DETAIL), onShowFeeDetail: () => setActivePanel(useAnyspendFlow_1.PanelView.FEE_DETAIL), customUsdInputValues: customUsdInputValues, customRecipientLabel: customRecipientLabel }) })), (0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)("relative -my-1 flex h-0 items-center justify-center", paymentType === "fiat" && "hidden"), children: (0, jsx_runtime_1.jsx)(react_2.Button, { variant: "ghost", className: classes?.swapDirectionButton ||
233
+ "swap-direction-button border-as-stroke bg-as-surface-primary z-10 h-10 w-10 cursor-default rounded-xl border-2 sm:h-8 sm:w-8 sm:rounded-xl", children: (0, jsx_runtime_1.jsx)("div", { className: "relative flex items-center justify-center transition-opacity", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ArrowDown, { className: "text-as-primary/50 h-5 w-5" }) }) }) }), paymentType === "crypto" && ((0, jsx_runtime_1.jsx)(CryptoReceiveSection_1.CryptoReceiveSection, { isDepositMode: false, isBuyMode: false, effectiveRecipientAddress: selectedRecipientOrDefault, recipientName: recipientName || undefined, customRecipientLabel: customRecipientLabel, onSelectRecipient: () => setActivePanel(useAnyspendFlow_1.PanelView.RECIPIENT_SELECTION), dstAmount: isSrcInputDirty ? dstAmount : dstAmountInput, dstToken: selectedDstToken, dstTokenSymbol: DESTINATION_TOKEN_DETAILS.SYMBOL, dstTokenLogoURI: DESTINATION_TOKEN_DETAILS.LOGO_URI, selectedDstChainId: selectedDstChainId, setSelectedDstChainId: () => { }, setSelectedDstToken: () => { }, isSrcInputDirty: isSrcInputDirty, onChangeDstAmount: value => {
189
234
  setIsSrcInputDirty(false);
190
- setSrcAmount(value);
191
- }, anyspendQuote: anyspendQuote, onShowPointsDetail: () => setActivePanel(useAnyspendFlow_1.PanelView.POINTS_DETAIL), onShowFeeDetail: () => setActivePanel(useAnyspendFlow_1.PanelView.FEE_DETAIL) }))] }) }), (0, jsx_runtime_1.jsx)(react_3.motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: (0, cn_1.cn)("mt-4 flex w-full max-w-[460px] flex-col gap-2"), children: (0, jsx_runtime_1.jsx)(react_2.ShinyButton, { accentColor: "hsl(var(--as-brand))", disabled: btnInfo.disable, onClick: onMainButtonClick, className: (0, cn_1.cn)("as-main-button relative w-full", btnInfo.error ? "!bg-as-red" : btnInfo.disable ? "!bg-as-on-surface-2" : "!bg-as-brand"), textClassName: (0, cn_1.cn)(btnInfo.error ? "text-white" : btnInfo.disable ? "text-as-secondary" : "text-white"), children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center gap-2", children: [btnInfo.loading && (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "h-4 w-4 animate-spin" }), btnInfo.text] }) }) }), gasPriceData && !isLoadingGas && paymentType === "crypto" && ((0, jsx_runtime_1.jsx)(GasIndicator_1.GasIndicator, { gasPrice: gasPriceData, className: "mt-2 w-full" })), mainFooter ? mainFooter : null] }));
235
+ setDstAmountInput(value);
236
+ }, anyspendQuote: isDirectTransfer ? undefined : anyspendQuote, onShowPointsDetail: isDirectTransfer ? undefined : () => setActivePanel(useAnyspendFlow_1.PanelView.POINTS_DETAIL), onShowFeeDetail: isDirectTransfer ? undefined : () => setActivePanel(useAnyspendFlow_1.PanelView.FEE_DETAIL) }))] }) }), (0, jsx_runtime_1.jsx)(react_3.motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: (0, cn_1.cn)("mt-4 flex w-full max-w-[460px] flex-col gap-2"), children: (0, jsx_runtime_1.jsx)(react_2.ShinyButton, { accentColor: "hsl(var(--as-brand))", disabled: btnInfo.disable, onClick: onMainButtonClick, className: (btnInfo.error && classes?.mainButtonError) ||
237
+ (btnInfo.disable && classes?.mainButtonDisabled) ||
238
+ classes?.mainButton ||
239
+ (0, cn_1.cn)("as-main-button relative w-full", btnInfo.error ? "!bg-as-red" : btnInfo.disable ? "!bg-as-on-surface-2" : "!bg-as-brand"), textClassName: (0, cn_1.cn)(btnInfo.error ? "text-white" : btnInfo.disable ? "text-as-secondary" : "text-white"), children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center gap-2", children: [btnInfo.loading && (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "h-4 w-4 animate-spin" }), btnInfo.text] }) }) }), gasPriceData && !isLoadingGas && paymentType === "crypto" && !isDirectTransfer && ((0, jsx_runtime_1.jsx)(GasIndicator_1.GasIndicator, { gasPrice: gasPriceData, className: classes?.gasIndicator || "mt-2 w-full" })), mainFooter ? mainFooter : null] }));
192
240
  const handleCryptoOrder = async () => {
193
241
  try {
194
- (0, invariant_1.default)(anyspendQuote, "Relay price is not found");
242
+ const isDirectTransfer = isSameChainSameToken && allowDirectTransfer;
243
+ if (!isDirectTransfer) {
244
+ (0, invariant_1.default)(anyspendQuote, "Relay price is not found");
245
+ }
195
246
  (0, invariant_1.default)(selectedRecipientOrDefault, "Recipient address is not found");
196
- const srcAmountBigInt = BigInt(activeInputAmountInWei);
197
- const payload = buildCustomPayload(selectedRecipientOrDefault);
198
- createOrder({
199
- recipientAddress: selectedRecipientOrDefault,
200
- orderType,
201
- srcChain: selectedSrcChainId,
202
- dstChain: selectedDstChainId,
203
- srcToken: selectedSrcToken,
204
- dstToken: selectedDstToken,
205
- srcAmount: srcAmountBigInt.toString(),
206
- expectedDstAmount: expectedDstAmountRaw,
207
- creatorAddress: globalAddress,
208
- payload,
209
- });
247
+ // Handle direct transfer case (same token/chain) - bypass backend, transfer directly
248
+ if (isDirectTransfer) {
249
+ const srcAmountBigInt = BigInt(activeInputAmountInWei);
250
+ const txHash = await executeDirectTransfer({
251
+ chainId: selectedSrcChainId,
252
+ tokenAddress: selectedSrcToken.address,
253
+ recipientAddress: selectedRecipientOrDefault,
254
+ amount: srcAmountBigInt,
255
+ method: effectiveCryptoPaymentMethod,
256
+ });
257
+ if (txHash) {
258
+ setDirectTransferTxHash(txHash);
259
+ setActivePanel(useAnyspendFlow_1.PanelView.DIRECT_TRANSFER_SUCCESS);
260
+ }
261
+ return;
262
+ }
263
+ // At this point, anyspendQuote is guaranteed to be defined (invariant above ensures this)
264
+ if (tradeType === "EXACT_OUTPUT") {
265
+ // EXACT_OUTPUT mode: create a custom order (like AnySpendStakeUpside)
266
+ const srcAmountFromQuote = anyspendQuote?.data?.currencyIn?.amount;
267
+ (0, invariant_1.default)(srcAmountFromQuote, "Source amount from quote is not found");
268
+ const expectedDstAmount = anyspendQuote?.data?.currencyOut?.amount ?? "0";
269
+ const encodedData = (0, useAnyspendFlow_1.generateEncodedData)(customExactInConfig, activeOutputAmountInWei);
270
+ createOrder({
271
+ recipientAddress: selectedRecipientOrDefault,
272
+ orderType: "custom",
273
+ srcChain: selectedSrcChainId,
274
+ dstChain: selectedDstChainId,
275
+ srcToken: selectedSrcToken,
276
+ dstToken: selectedDstToken,
277
+ srcAmount: srcAmountFromQuote,
278
+ expectedDstAmount,
279
+ creatorAddress: globalAddress,
280
+ payload: {
281
+ amount: activeOutputAmountInWei,
282
+ data: encodedData,
283
+ to: customExactInConfig ? (0, utils_1.normalizeAddress)(customExactInConfig.to) : undefined,
284
+ spenderAddress: customExactInConfig?.spenderAddress
285
+ ? (0, utils_1.normalizeAddress)(customExactInConfig.spenderAddress)
286
+ : undefined,
287
+ },
288
+ });
289
+ }
290
+ else {
291
+ // EXACT_INPUT mode: create custom_exact_in order (original behavior)
292
+ const srcAmountBigInt = BigInt(activeInputAmountInWei);
293
+ const payload = buildCustomPayload(selectedRecipientOrDefault);
294
+ createOrder({
295
+ recipientAddress: selectedRecipientOrDefault,
296
+ orderType,
297
+ srcChain: selectedSrcChainId,
298
+ dstChain: selectedDstChainId,
299
+ srcToken: selectedSrcToken,
300
+ dstToken: selectedDstToken,
301
+ srcAmount: srcAmountBigInt.toString(),
302
+ expectedDstAmount: expectedDstAmountRaw,
303
+ creatorAddress: globalAddress,
304
+ payload,
305
+ });
306
+ }
210
307
  }
211
308
  catch (err) {
212
309
  console.error(err);
@@ -242,23 +339,50 @@ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddres
242
339
  react_2.toast.error("Please select a payment method");
243
340
  return;
244
341
  }
245
- const payload = buildCustomPayload(selectedRecipientOrDefault);
246
- createOnrampOrder({
247
- recipientAddress: selectedRecipientOrDefault,
248
- orderType,
249
- dstChain: selectedDstChainId,
250
- dstToken: selectedDstToken,
251
- srcFiatAmount: srcAmount,
252
- onramp: {
253
- vendor,
254
- paymentMethod: paymentMethodString,
255
- country: geoData?.country || "US",
256
- redirectUrl: window.location.origin,
257
- },
258
- expectedDstAmount: expectedDstAmountRaw,
259
- creatorAddress: globalAddress,
260
- payload,
261
- });
342
+ const onrampOptions = {
343
+ vendor,
344
+ paymentMethod: paymentMethodString,
345
+ country: geoData?.country || "US",
346
+ redirectUrl: window.location.origin,
347
+ };
348
+ if (tradeType === "EXACT_OUTPUT") {
349
+ // EXACT_OUTPUT mode: create a custom order (like AnySpendStakeUpside)
350
+ const expectedDstAmount = anyspendQuote.data?.currencyOut?.amount ?? "0";
351
+ const encodedData = (0, useAnyspendFlow_1.generateEncodedData)(customExactInConfig, activeOutputAmountInWei);
352
+ createOnrampOrder({
353
+ recipientAddress: selectedRecipientOrDefault,
354
+ orderType: "custom",
355
+ dstChain: selectedDstChainId,
356
+ dstToken: selectedDstToken,
357
+ srcFiatAmount: srcAmount,
358
+ onramp: onrampOptions,
359
+ expectedDstAmount,
360
+ creatorAddress: globalAddress,
361
+ payload: {
362
+ amount: activeOutputAmountInWei,
363
+ data: encodedData,
364
+ to: customExactInConfig ? (0, utils_1.normalizeAddress)(customExactInConfig.to) : undefined,
365
+ spenderAddress: customExactInConfig?.spenderAddress
366
+ ? (0, utils_1.normalizeAddress)(customExactInConfig.spenderAddress)
367
+ : undefined,
368
+ },
369
+ });
370
+ }
371
+ else {
372
+ // EXACT_INPUT mode: create custom_exact_in order (original behavior)
373
+ const payload = buildCustomPayload(selectedRecipientOrDefault);
374
+ createOnrampOrder({
375
+ recipientAddress: selectedRecipientOrDefault,
376
+ orderType,
377
+ dstChain: selectedDstChainId,
378
+ dstToken: selectedDstToken,
379
+ srcFiatAmount: srcAmount,
380
+ onramp: onrampOptions,
381
+ expectedDstAmount: expectedDstAmountRaw,
382
+ creatorAddress: globalAddress,
383
+ payload,
384
+ });
385
+ }
262
386
  }
263
387
  catch (err) {
264
388
  console.error(err);
@@ -288,7 +412,17 @@ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddres
288
412
  : anyspendQuote.data.currencyIn?.amountUsd
289
413
  ? Number(anyspendQuote.data.currencyIn.amountUsd)
290
414
  : undefined, onBack: () => setActivePanel(useAnyspendFlow_1.PanelView.MAIN) })) : null;
291
- return ((0, jsx_runtime_1.jsx)(react_2.StyleRoot, { children: (0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)("anyspend-container font-inter bg-as-surface-primary mx-auto w-full max-w-[460px] p-6", mode === "page" && "border-as-border-secondary overflow-hidden rounded-2xl border shadow-xl"), children: (0, jsx_runtime_1.jsx)(react_2.TransitionPanel, { activeIndex: orderId
415
+ const directTransferSuccessView = ((0, jsx_runtime_1.jsxs)(react_3.motion.div, { initial: { opacity: 0, scale: 0.95 }, animate: { opacity: 1, scale: 1 }, className: "flex flex-col items-center justify-center gap-6 py-8", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex h-16 w-16 items-center justify-center rounded-full bg-green-500/20", children: (0, jsx_runtime_1.jsx)(lucide_react_1.CheckCircle, { className: "h-10 w-10 text-green-500" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("h2", { className: "text-as-primary mb-2 text-xl font-bold", children: "Transfer Complete!" }), (0, jsx_runtime_1.jsxs)("p", { className: "text-as-primary/60 text-sm", children: [srcAmount, " ", selectedSrcToken.symbol, " sent on ", (0, anyspend_1.getChainName)(selectedSrcChainId)] }), (0, jsx_runtime_1.jsxs)("p", { className: "text-as-primary/60 mt-1 text-sm", children: ["to ", selectedRecipientOrDefault?.slice(0, 6), "...", selectedRecipientOrDefault?.slice(-4)] })] }), directTransferTxHash && ((0, jsx_runtime_1.jsx)("a", { href: (0, anyspend_1.getExplorerTxUrl)(selectedSrcChainId, directTransferTxHash || ""), target: "_blank", rel: "noopener noreferrer", className: "text-as-brand text-sm underline", children: "View Transaction" })), (0, jsx_runtime_1.jsx)(react_2.Button, { className: "bg-as-brand hover:bg-as-brand/90 mt-4 w-full rounded-xl py-3 font-semibold text-white", onClick: () => {
416
+ onSuccess?.(srcAmount);
417
+ if (returnToHomeUrl) {
418
+ window.location.href = returnToHomeUrl;
419
+ }
420
+ else {
421
+ setB3ModalOpen(false);
422
+ }
423
+ }, children: returnHomeLabel || (returnToHomeUrl ? "Return to Home" : "Done") })] }));
424
+ return ((0, jsx_runtime_1.jsx)(react_2.StyleRoot, { children: (0, jsx_runtime_1.jsx)("div", { className: classes?.root ||
425
+ (0, cn_1.cn)("anyspend-container font-inter bg-as-surface-primary mx-auto w-full max-w-[460px] p-6", mode === "page" && "border-as-border-secondary overflow-hidden rounded-2xl border shadow-xl"), children: (0, jsx_runtime_1.jsx)(react_2.TransitionPanel, { activeIndex: orderId
292
426
  ? oat
293
427
  ? useAnyspendFlow_1.PanelView.ORDER_DETAILS
294
428
  : useAnyspendFlow_1.PanelView.LOADING
@@ -309,5 +443,6 @@ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddres
309
443
  (0, jsx_runtime_1.jsx)("div", { children: loadingView }, "loading-view"),
310
444
  (0, jsx_runtime_1.jsx)("div", { children: pointsDetailView }, "points-detail-view"),
311
445
  (0, jsx_runtime_1.jsx)("div", { children: feeDetailView }, "fee-detail-view"),
446
+ (0, jsx_runtime_1.jsx)("div", { children: directTransferSuccessView }, "direct-transfer-success-view"),
312
447
  ] }) }) }));
313
448
  }
@@ -1,5 +1,6 @@
1
1
  import { components } from "../../../anyspend/types/api";
2
2
  import { GetQuoteResponse } from "../../../anyspend/types/api_req_res";
3
+ import type { AnySpendAllClasses } from "./types/classes";
3
4
  export interface DepositContractConfig {
4
5
  /** Custom function ABI JSON string */
5
6
  functionAbi: string;
@@ -94,6 +95,10 @@ export interface AnySpendDepositProps {
94
95
  * Defaults to false.
95
96
  */
96
97
  isCustomDeposit?: boolean;
98
+ /** Custom class names for styling specific elements */
99
+ classes?: AnySpendAllClasses;
100
+ /** When true, allows direct transfer without swap if source and destination token/chain are the same */
101
+ allowDirectTransfer?: boolean;
97
102
  }
98
103
  /**
99
104
  * A flexible deposit component that wraps AnySpendCustomExactIn with optional chain selection.
@@ -130,4 +135,4 @@ export interface AnySpendDepositProps {
130
135
  * onSuccess={(amount) => console.log(`Deposited ${amount}`)}
131
136
  * />
132
137
  */
133
- export declare function AnySpendDeposit({ loadOrder, mode, recipientAddress, paymentType: initialPaymentType, sourceTokenAddress, sourceTokenChainId: initialSourceChainId, destinationTokenAddress, destinationTokenChainId, onSuccess, onOpenCustomModal, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, minDestinationAmount, header, orderType, depositContractConfig, showChainSelection, supportedChains, minPoolSize, topChainsCount, onClose, returnToHomeUrl, customRecipientLabel, returnHomeLabel, isCustomDeposit, }: AnySpendDepositProps): import("react/jsx-runtime").JSX.Element | null;
138
+ export declare function AnySpendDeposit({ loadOrder, mode, recipientAddress, paymentType: initialPaymentType, sourceTokenAddress, sourceTokenChainId: initialSourceChainId, destinationTokenAddress, destinationTokenChainId, onSuccess, onOpenCustomModal, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, minDestinationAmount, header, orderType, depositContractConfig, showChainSelection, supportedChains, minPoolSize, topChainsCount, onClose, returnToHomeUrl, customRecipientLabel, returnHomeLabel, isCustomDeposit, classes, allowDirectTransfer, }: AnySpendDepositProps): import("react/jsx-runtime").JSX.Element | null;
@@ -97,7 +97,9 @@ function ChainIcon({ chainId, className }) {
97
97
  * onSuccess={(amount) => console.log(`Deposited ${amount}`)}
98
98
  * />
99
99
  */
100
- function AnySpendDeposit({ loadOrder, mode = "modal", recipientAddress, paymentType: initialPaymentType, sourceTokenAddress, sourceTokenChainId: initialSourceChainId, destinationTokenAddress, destinationTokenChainId, onSuccess, onOpenCustomModal, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, minDestinationAmount, header, orderType, depositContractConfig, showChainSelection, supportedChains = DEFAULT_SUPPORTED_CHAINS, minPoolSize = DEFAULT_MIN_POOL_SIZE, topChainsCount = 3, onClose, returnToHomeUrl, customRecipientLabel, returnHomeLabel, isCustomDeposit = false, }) {
100
+ function AnySpendDeposit({ loadOrder, mode = "modal", recipientAddress, paymentType: initialPaymentType, sourceTokenAddress, sourceTokenChainId: initialSourceChainId, destinationTokenAddress, destinationTokenChainId, onSuccess, onOpenCustomModal, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, minDestinationAmount, header, orderType, depositContractConfig, showChainSelection, supportedChains = DEFAULT_SUPPORTED_CHAINS, minPoolSize = DEFAULT_MIN_POOL_SIZE, topChainsCount = 3, onClose, returnToHomeUrl, customRecipientLabel, returnHomeLabel, isCustomDeposit = false, classes, allowDirectTransfer = false, }) {
101
+ // Extract deposit-specific classes for convenience
102
+ const depositClasses = classes?.deposit;
101
103
  const { connectedEOAWallet } = (0, react_1.useAccountWallet)();
102
104
  const eoaAddress = connectedEOAWallet?.getAccount()?.address;
103
105
  // Determine if we should show chain selection
@@ -187,12 +189,25 @@ function AnySpendDeposit({ loadOrder, mode = "modal", recipientAddress, paymentT
187
189
  };
188
190
  // Chain selection view
189
191
  if (step === "select-chain") {
190
- return ((0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("anyspend-deposit anyspend-deposit-chain-selection font-inter bg-as-surface-primary relative mx-auto w-full max-w-[460px]", mode === "page" && "border-as-border-secondary overflow-hidden rounded-2xl border shadow-xl"), children: [onClose && ((0, jsx_runtime_1.jsx)("button", { onClick: onClose, className: "anyspend-deposit-close-button text-as-secondary hover:text-as-primary absolute right-4 top-4 z-10", children: (0, jsx_runtime_1.jsx)("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })), !isBalanceLoading && totalBalance > 0 && ((0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit-balance border-theme-border-secondary border-b p-5", children: [(0, jsx_runtime_1.jsx)("p", { className: "anyspend-deposit-balance-label text-as-secondary text-sm", children: "Your Balance" }), (0, jsx_runtime_1.jsxs)("p", { className: "anyspend-deposit-balance-value text-as-primary text-3xl font-semibold", children: [formatDecimal(totalBalance), " ", (0, jsx_runtime_1.jsx)("span", { className: "text-sm", children: "USD" })] })] })), (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit-options flex flex-col gap-2 p-6", children: [isBalanceLoading && ((0, jsx_runtime_1.jsx)("div", { className: "anyspend-deposit-chains-skeleton flex flex-col gap-2", children: [1, 2].map((_, i) => ((0, jsx_runtime_1.jsxs)("div", { className: "border-border-primary flex items-center justify-between rounded-xl border p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)(react_1.Skeleton, { className: "h-6 w-6 rounded-full" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-1", children: [(0, jsx_runtime_1.jsx)(react_1.Skeleton, { className: "h-4 w-32" }), (0, jsx_runtime_1.jsx)(react_1.Skeleton, { className: "h-3 w-20" })] })] }), (0, jsx_runtime_1.jsx)(react_1.Skeleton, { className: "h-5 w-5" })] }, i))) })), topChainsWithBalance.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "anyspend-deposit-chains flex flex-col gap-2", children: topChainsWithBalance.map(chain => ((0, jsx_runtime_1.jsxs)("button", { onClick: () => handleSelectChain(chain.id), className: "anyspend-deposit-chain-button border-border-primary hover:border-as-brand hover:bg-as-surface-secondary flex w-full items-center justify-between rounded-xl border p-4 text-left shadow-sm transition-all", children: [(0, jsx_runtime_1.jsx)("div", { className: "anyspend-deposit-chain-content", children: (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit-chain-info", children: [(0, jsx_runtime_1.jsxs)("span", { className: "anyspend-deposit-chain-name text-as-primary flex items-center gap-1.5 font-medium", children: ["Deposit from ", chain.name, (0, jsx_runtime_1.jsx)(ChainIcon, { chainId: chain.id, className: "h-5 w-5" })] }), (0, jsx_runtime_1.jsxs)("p", { className: "anyspend-deposit-chain-balance text-as-secondary text-xs", children: [formatUsd(chain.balance), " available"] })] }) }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "anyspend-deposit-chain-chevron text-as-secondary h-5 w-5" })] }, chain.id))) })), (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit-general-options flex flex-col gap-2", children: [(0, jsx_runtime_1.jsxs)("button", { onClick: handleSelectCrypto, className: "anyspend-deposit-option-button anyspend-deposit-crypto-button border-border-primary hover:border-as-brand hover:bg-as-surface-secondary flex w-full items-center justify-between rounded-xl border p-4 text-left shadow-sm transition-all", children: [(0, jsx_runtime_1.jsx)("div", { className: "anyspend-deposit-option-content", children: (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit-option-info", children: [(0, jsx_runtime_1.jsx)("span", { className: "anyspend-deposit-option-title text-as-primary font-medium", children: "Deposit Crypto" }), (0, jsx_runtime_1.jsx)("p", { className: "anyspend-deposit-option-description text-as-secondary text-xs", children: "Swap from any token on any chain" })] }) }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "anyspend-deposit-option-chevron text-as-secondary h-5 w-5" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit-divider flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-as-stroke h-px flex-1" }), (0, jsx_runtime_1.jsx)("span", { className: "anyspend-deposit-divider-text text-as-secondary text-sm", children: "More options" }), (0, jsx_runtime_1.jsx)("div", { className: "bg-as-stroke h-px flex-1" })] }), (0, jsx_runtime_1.jsxs)("button", { onClick: handleSelectQrDeposit, className: "anyspend-deposit-option-button anyspend-deposit-qr-button border-border-primary hover:border-as-brand hover:bg-as-surface-secondary flex w-full items-center justify-between rounded-xl border p-4 text-left shadow-sm transition-all", children: [(0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit-option-content flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)(QrCodeIcon_1.QrCodeIcon, { className: "anyspend-deposit-option-icon h-10 w-10" }), (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit-option-info", children: [(0, jsx_runtime_1.jsx)("span", { className: "anyspend-deposit-option-title text-as-primary font-medium", children: "Deposit with QR Code" }), (0, jsx_runtime_1.jsx)("p", { className: "anyspend-deposit-option-description text-as-secondary text-xs", children: "Send tokens directly to deposit address" })] })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "anyspend-deposit-option-chevron text-as-secondary h-5 w-5" })] }), (0, jsx_runtime_1.jsxs)("button", { onClick: handleSelectFiat, className: "anyspend-deposit-option-button anyspend-deposit-fiat-button border-border-primary hover:border-as-brand hover:bg-as-surface-secondary flex w-full items-center justify-between rounded-xl border p-4 text-left transition-all", children: [(0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit-option-content flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)(CreditCardIcon_1.CreditCardIcon, { className: "anyspend-deposit-option-icon h-10 w-10" }), (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit-option-info", children: [(0, jsx_runtime_1.jsx)("span", { className: "anyspend-deposit-option-title text-as-primary font-medium", children: "Fund with Fiat" }), (0, jsx_runtime_1.jsx)("p", { className: "anyspend-deposit-option-description text-as-secondary text-xs", children: "Pay with card or bank transfer" })] })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "anyspend-deposit-option-chevron text-as-secondary h-5 w-5" })] })] }), (0, jsx_runtime_1.jsx)(WarningText_1.ChainWarningText, { chainId: destinationTokenChainId, className: "mt-2" })] })] }));
192
+ return ((0, jsx_runtime_1.jsxs)("div", { className: depositClasses?.chainSelection ||
193
+ (0, cn_1.cn)("anyspend-deposit anyspend-deposit-chain-selection font-inter bg-as-surface-primary relative mx-auto w-full max-w-[460px]", mode === "page" && "border-as-border-secondary overflow-hidden rounded-2xl border shadow-xl"), children: [onClose && ((0, jsx_runtime_1.jsx)("button", { onClick: onClose, className: depositClasses?.closeButton ||
194
+ "anyspend-deposit-close-button text-as-secondary hover:text-as-primary absolute right-4 top-4 z-10", children: (0, jsx_runtime_1.jsx)("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })), !isBalanceLoading && totalBalance > 0 && ((0, jsx_runtime_1.jsxs)("div", { className: depositClasses?.balanceContainer || "anyspend-deposit-balance border-theme-border-secondary border-b p-5", children: [(0, jsx_runtime_1.jsx)("p", { className: depositClasses?.balanceLabel || "anyspend-deposit-balance-label text-as-secondary text-sm", children: "Your Balance" }), (0, jsx_runtime_1.jsxs)("p", { className: depositClasses?.balanceValue || "anyspend-deposit-balance-value text-as-primary text-3xl font-semibold", children: [formatDecimal(totalBalance), " ", (0, jsx_runtime_1.jsx)("span", { className: "text-sm", children: "USD" })] })] })), (0, jsx_runtime_1.jsxs)("div", { className: depositClasses?.optionsContainer || "anyspend-deposit-options flex flex-col gap-2 p-6", children: [isBalanceLoading && ((0, jsx_runtime_1.jsx)("div", { className: depositClasses?.chainsSkeleton || "anyspend-deposit-chains-skeleton flex flex-col gap-2", children: [1, 2].map((_, i) => ((0, jsx_runtime_1.jsxs)("div", { className: depositClasses?.skeletonItem ||
195
+ "border-border-primary flex items-center justify-between rounded-xl border p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)(react_1.Skeleton, { className: "h-6 w-6 rounded-full" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-1", children: [(0, jsx_runtime_1.jsx)(react_1.Skeleton, { className: "h-4 w-32" }), (0, jsx_runtime_1.jsx)(react_1.Skeleton, { className: "h-3 w-20" })] })] }), (0, jsx_runtime_1.jsx)(react_1.Skeleton, { className: "h-5 w-5" })] }, i))) })), topChainsWithBalance.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: depositClasses?.chainsContainer || "anyspend-deposit-chains flex flex-col gap-2", children: topChainsWithBalance.map(chain => ((0, jsx_runtime_1.jsxs)("button", { onClick: () => handleSelectChain(chain.id), className: depositClasses?.chainButton ||
196
+ "anyspend-deposit-chain-button border-border-primary hover:border-as-brand hover:bg-as-surface-secondary flex w-full items-center justify-between rounded-xl border p-4 text-left shadow-sm transition-all", children: [(0, jsx_runtime_1.jsx)("div", { className: depositClasses?.chainContent || "anyspend-deposit-chain-content", children: (0, jsx_runtime_1.jsxs)("div", { className: depositClasses?.chainInfo || "anyspend-deposit-chain-info", children: [(0, jsx_runtime_1.jsxs)("span", { className: depositClasses?.chainName ||
197
+ "anyspend-deposit-chain-name text-as-primary flex items-center gap-1.5 font-medium", children: ["Deposit from ", chain.name, (0, jsx_runtime_1.jsx)(ChainIcon, { chainId: chain.id, className: depositClasses?.chainIcon || "h-5 w-5" })] }), (0, jsx_runtime_1.jsxs)("p", { className: depositClasses?.chainBalance || "anyspend-deposit-chain-balance text-as-secondary text-xs", children: [formatUsd(chain.balance), " available"] })] }) }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: depositClasses?.chainChevron || "anyspend-deposit-chain-chevron text-as-secondary h-5 w-5" })] }, chain.id))) })), (0, jsx_runtime_1.jsxs)("div", { className: depositClasses?.generalOptions || "anyspend-deposit-general-options flex flex-col gap-2", children: [(0, jsx_runtime_1.jsxs)("button", { onClick: handleSelectCrypto, className: depositClasses?.cryptoButton ||
198
+ "anyspend-deposit-option-button anyspend-deposit-crypto-button border-border-primary hover:border-as-brand hover:bg-as-surface-secondary flex w-full items-center justify-between rounded-xl border p-4 text-left shadow-sm transition-all", children: [(0, jsx_runtime_1.jsx)("div", { className: depositClasses?.optionContent || "anyspend-deposit-option-content", children: (0, jsx_runtime_1.jsxs)("div", { className: depositClasses?.optionInfo || "anyspend-deposit-option-info", children: [(0, jsx_runtime_1.jsx)("span", { className: depositClasses?.optionTitle || "anyspend-deposit-option-title text-as-primary font-medium", children: "Deposit Crypto" }), (0, jsx_runtime_1.jsx)("p", { className: depositClasses?.optionDescription ||
199
+ "anyspend-deposit-option-description text-as-secondary text-xs", children: "Swap from any token on any chain" })] }) }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: depositClasses?.optionChevron || "anyspend-deposit-option-chevron text-as-secondary h-5 w-5" })] }), (0, jsx_runtime_1.jsxs)("div", { className: depositClasses?.divider || "anyspend-deposit-divider flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: depositClasses?.dividerLine || "bg-as-stroke h-px flex-1" }), (0, jsx_runtime_1.jsx)("span", { className: depositClasses?.dividerText || "anyspend-deposit-divider-text text-as-secondary text-sm", children: "More options" }), (0, jsx_runtime_1.jsx)("div", { className: depositClasses?.dividerLine || "bg-as-stroke h-px flex-1" })] }), (0, jsx_runtime_1.jsxs)("button", { onClick: handleSelectQrDeposit, className: depositClasses?.qrButton ||
200
+ "anyspend-deposit-option-button anyspend-deposit-qr-button border-border-primary hover:border-as-brand hover:bg-as-surface-secondary flex w-full items-center justify-between rounded-xl border p-4 text-left shadow-sm transition-all", children: [(0, jsx_runtime_1.jsxs)("div", { className: depositClasses?.optionContent || "anyspend-deposit-option-content flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)(QrCodeIcon_1.QrCodeIcon, { className: depositClasses?.optionIcon || "anyspend-deposit-option-icon h-10 w-10" }), (0, jsx_runtime_1.jsxs)("div", { className: depositClasses?.optionInfo || "anyspend-deposit-option-info", children: [(0, jsx_runtime_1.jsx)("span", { className: depositClasses?.optionTitle || "anyspend-deposit-option-title text-as-primary font-medium", children: "Deposit with QR Code" }), (0, jsx_runtime_1.jsx)("p", { className: depositClasses?.optionDescription ||
201
+ "anyspend-deposit-option-description text-as-secondary text-xs", children: "Send tokens directly to deposit address" })] })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: depositClasses?.optionChevron || "anyspend-deposit-option-chevron text-as-secondary h-5 w-5" })] }), (0, jsx_runtime_1.jsxs)("button", { onClick: handleSelectFiat, className: depositClasses?.fiatButton ||
202
+ "anyspend-deposit-option-button anyspend-deposit-fiat-button border-border-primary hover:border-as-brand hover:bg-as-surface-secondary flex w-full items-center justify-between rounded-xl border p-4 text-left transition-all", children: [(0, jsx_runtime_1.jsxs)("div", { className: depositClasses?.optionContent || "anyspend-deposit-option-content flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)(CreditCardIcon_1.CreditCardIcon, { className: depositClasses?.optionIcon || "anyspend-deposit-option-icon h-10 w-10" }), (0, jsx_runtime_1.jsxs)("div", { className: depositClasses?.optionInfo || "anyspend-deposit-option-info", children: [(0, jsx_runtime_1.jsx)("span", { className: depositClasses?.optionTitle || "anyspend-deposit-option-title text-as-primary font-medium", children: "Fund with Fiat" }), (0, jsx_runtime_1.jsx)("p", { className: depositClasses?.optionDescription ||
203
+ "anyspend-deposit-option-description text-as-secondary text-xs", children: "Pay with card or bank transfer" })] })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: depositClasses?.optionChevron || "anyspend-deposit-option-chevron text-as-secondary h-5 w-5" })] })] }), (0, jsx_runtime_1.jsx)(WarningText_1.ChainWarningText, { chainId: destinationTokenChainId, classes: classes?.chainWarningText || { root: "mt-2" } })] })] }));
191
204
  }
192
205
  // QR Deposit view
193
206
  if (step === "qr-deposit") {
194
- return ((0, jsx_runtime_1.jsx)(QRDeposit_1.QRDeposit, { mode: mode, recipientAddress: recipientAddress, destinationToken: destinationToken, destinationChainId: destinationTokenChainId, depositContractConfig: depositContractConfig, onBack: handleBack, onClose: onClose ?? handleBack }));
207
+ return ((0, jsx_runtime_1.jsx)(QRDeposit_1.QRDeposit, { mode: mode, recipientAddress: recipientAddress, destinationToken: destinationToken, destinationChainId: destinationTokenChainId, depositContractConfig: depositContractConfig, onBack: handleBack, onClose: onClose ?? handleBack, classes: classes?.qrDeposit }));
195
208
  }
196
209
  // Deposit view
197
- return ((0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit anyspend-deposit-form relative", children: [shouldShowChainSelection && ((0, jsx_runtime_1.jsxs)("button", { onClick: handleBack, className: "anyspend-deposit-back-button text-as-secondary hover:text-as-primary absolute left-4 top-4 z-10 flex items-center gap-1", children: [(0, jsx_runtime_1.jsx)("svg", { className: "anyspend-deposit-back-icon h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) }), (0, jsx_runtime_1.jsx)("span", { className: "anyspend-deposit-back-text text-sm", children: "Back" })] })), onClose && ((0, jsx_runtime_1.jsx)("button", { onClick: onClose, className: "anyspend-deposit-close-button text-as-secondary hover:text-as-primary absolute right-4 top-4 z-10", children: (0, jsx_runtime_1.jsx)("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })), (0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)("anyspend-deposit-form-content", shouldShowChainSelection && "pt-8"), children: isCustomDeposit ? ((0, jsx_runtime_1.jsx)(AnySpendCustomExactIn_1.AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, paymentType: paymentType, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: selectedChainId, destinationToken: destinationToken, destinationChainId: destinationTokenChainId, orderType: effectiveOrderType, minDestinationAmount: minDestinationAmount, header: header ?? defaultHeader, onSuccess: onSuccess, onOpenCustomModal: onOpenCustomModal, mainFooter: mainFooter, onTokenSelect: onTokenSelect, customUsdInputValues: customUsdInputValues, preferEoa: preferEoa, customExactInConfig: depositContractConfig, returnToHomeUrl: returnToHomeUrl, customRecipientLabel: customRecipientLabel, returnHomeLabel: returnHomeLabel }, selectedChainId)) : ((0, jsx_runtime_1.jsx)(AnySpend_1.AnySpend, { loadOrder: loadOrder, mode: mode, defaultActiveTab: paymentType, recipientAddress: recipientAddress, sourceChainId: selectedChainId, destinationTokenAddress: destinationTokenAddress, destinationTokenChainId: destinationTokenChainId, onSuccess: txHash => onSuccess?.(txHash ?? ""), onTokenSelect: onTokenSelect, customUsdInputValues: customUsdInputValues, hideHeader: true, hideBottomNavigation: true, disableUrlParamManagement: true, returnToHomeUrl: returnToHomeUrl, customRecipientLabel: customRecipientLabel, returnHomeLabel: returnHomeLabel }, selectedChainId)) }), (0, jsx_runtime_1.jsx)(WarningText_1.ChainWarningText, { chainId: destinationTokenChainId, className: "px-4 pb-4" })] }));
210
+ return ((0, jsx_runtime_1.jsxs)("div", { className: depositClasses?.form || "anyspend-deposit anyspend-deposit-form relative", children: [shouldShowChainSelection && ((0, jsx_runtime_1.jsxs)("button", { onClick: handleBack, className: depositClasses?.backButton ||
211
+ "anyspend-deposit-back-button text-as-secondary hover:text-as-primary absolute left-4 top-4 z-10 flex items-center gap-1", children: [(0, jsx_runtime_1.jsx)("svg", { className: depositClasses?.backIcon || "anyspend-deposit-back-icon h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) }), (0, jsx_runtime_1.jsx)("span", { className: depositClasses?.backText || "anyspend-deposit-back-text text-sm", children: "Back" })] })), onClose && ((0, jsx_runtime_1.jsx)("button", { onClick: onClose, className: depositClasses?.closeButton ||
212
+ "anyspend-deposit-close-button text-as-secondary hover:text-as-primary absolute right-4 top-4 z-10", children: (0, jsx_runtime_1.jsx)("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })), (0, jsx_runtime_1.jsx)("div", { className: depositClasses?.formContent || (0, cn_1.cn)("anyspend-deposit-form-content", shouldShowChainSelection && "pt-8"), children: isCustomDeposit ? ((0, jsx_runtime_1.jsx)(AnySpendCustomExactIn_1.AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, paymentType: paymentType, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: selectedChainId, destinationToken: destinationToken, destinationChainId: destinationTokenChainId, orderType: effectiveOrderType, minDestinationAmount: minDestinationAmount, header: header ?? defaultHeader, onSuccess: onSuccess, onOpenCustomModal: onOpenCustomModal, mainFooter: mainFooter, onTokenSelect: onTokenSelect, customUsdInputValues: customUsdInputValues, preferEoa: preferEoa, customExactInConfig: depositContractConfig, returnToHomeUrl: returnToHomeUrl, customRecipientLabel: customRecipientLabel, returnHomeLabel: returnHomeLabel, classes: classes?.customExactIn, allowDirectTransfer: allowDirectTransfer }, selectedChainId)) : ((0, jsx_runtime_1.jsx)(AnySpend_1.AnySpend, { loadOrder: loadOrder, mode: mode, defaultActiveTab: paymentType, recipientAddress: recipientAddress, sourceChainId: selectedChainId, destinationTokenAddress: destinationTokenAddress, destinationTokenChainId: destinationTokenChainId, onSuccess: txHash => onSuccess?.(txHash ?? ""), onTokenSelect: onTokenSelect, customUsdInputValues: customUsdInputValues, hideHeader: true, hideBottomNavigation: true, disableUrlParamManagement: true, returnToHomeUrl: returnToHomeUrl, customRecipientLabel: customRecipientLabel, returnHomeLabel: returnHomeLabel, classes: classes?.anySpend, allowDirectTransfer: allowDirectTransfer }, selectedChainId)) }), (0, jsx_runtime_1.jsx)(WarningText_1.ChainWarningText, { chainId: destinationTokenChainId, classes: classes?.chainWarningText || { root: "px-4 pb-4" } })] }));
198
213
  }
@@ -1,5 +1,5 @@
1
1
  import { components } from "../../../anyspend/types/api";
2
- export declare function AnySpendStakeUpsideExactIn({ loadOrder, mode, recipientAddress, sourceTokenAddress, sourceTokenChainId, stakingContractAddress, token, onSuccess, }: {
2
+ export declare function AnySpendStakeUpsideExactIn({ loadOrder, mode, recipientAddress, sourceTokenAddress, sourceTokenChainId, destinationTokenAmount, stakingContractAddress, token, onSuccess, }: {
3
3
  loadOrder?: string;
4
4
  mode?: "modal" | "page";
5
5
  recipientAddress: string;
@@ -7,5 +7,6 @@ export declare function AnySpendStakeUpsideExactIn({ loadOrder, mode, recipientA
7
7
  sourceTokenChainId?: number;
8
8
  stakingContractAddress: string;
9
9
  token: components["schemas"]["Token"];
10
+ destinationTokenAmount?: string;
10
11
  onSuccess?: (amount: string) => void;
11
12
  }): import("react/jsx-runtime").JSX.Element | null;
@@ -17,7 +17,7 @@ const STAKE_FOR_FUNCTION_ABI = JSON.stringify([
17
17
  outputs: [],
18
18
  },
19
19
  ]);
20
- function AnySpendStakeUpsideExactIn({ loadOrder, mode = "modal", recipientAddress, sourceTokenAddress, sourceTokenChainId, stakingContractAddress, token, onSuccess, }) {
20
+ function AnySpendStakeUpsideExactIn({ loadOrder, mode = "modal", recipientAddress, sourceTokenAddress, sourceTokenChainId, destinationTokenAmount, stakingContractAddress, token, onSuccess, }) {
21
21
  if (!recipientAddress)
22
22
  return null;
23
23
  const header = () => ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("div", { className: "from-b3-react-background to-as-on-surface-1 w-full rounded-t-lg bg-gradient-to-t", children: (0, jsx_runtime_1.jsx)("div", { className: "mb-1 flex w-full flex-col items-center gap-2", children: (0, jsx_runtime_1.jsxs)("span", { className: "font-sf-rounded text-2xl font-semibold", children: ["Swap & Stake ", token.symbol, " (Exact In)"] }) }) }) }));
@@ -29,5 +29,5 @@ function AnySpendStakeUpsideExactIn({ loadOrder, mode = "modal", recipientAddres
29
29
  spenderAddress: stakingContractAddress,
30
30
  action: `stake ${token.symbol}`,
31
31
  };
32
- return ((0, jsx_runtime_1.jsx)(AnySpendCustomExactIn_1.AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: token, destinationChainId: chains_1.base.id, customExactInConfig: customExactInConfig, header: header, onSuccess: onSuccess }));
32
+ return ((0, jsx_runtime_1.jsx)(AnySpendCustomExactIn_1.AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: token, destinationChainId: chains_1.base.id, destinationTokenAmount: destinationTokenAmount, customExactInConfig: customExactInConfig, header: header, onSuccess: onSuccess }));
33
33
  }
@@ -1,5 +1,6 @@
1
1
  import { components } from "../../../anyspend/types/api";
2
2
  import { DepositContractConfig } from "./AnySpendDeposit";
3
+ import type { QRDepositClasses } from "./types/classes";
3
4
  export interface QRDepositProps {
4
5
  /** Display mode */
5
6
  mode?: "modal" | "page";
@@ -25,6 +26,8 @@ export interface QRDepositProps {
25
26
  onOrderCreated?: (orderId: string) => void;
26
27
  /** Callback when deposit is completed */
27
28
  onSuccess?: (txHash?: string) => void;
29
+ /** Custom classes for styling */
30
+ classes?: QRDepositClasses;
28
31
  }
29
32
  /**
30
33
  * A component for displaying QR code deposit functionality.
@@ -40,4 +43,4 @@ export interface QRDepositProps {
40
43
  * onSuccess={(txHash) => console.log("Deposit complete:", txHash)}
41
44
  * />
42
45
  */
43
- export declare function QRDeposit({ mode, recipientAddress, sourceToken: sourceTokenProp, sourceChainId: sourceChainIdProp, destinationToken, destinationChainId, creatorAddress, depositContractConfig, onBack, onClose, onOrderCreated, onSuccess, }: QRDepositProps): import("react/jsx-runtime").JSX.Element;
46
+ export declare function QRDeposit({ mode, recipientAddress, sourceToken: sourceTokenProp, sourceChainId: sourceChainIdProp, destinationToken, destinationChainId, creatorAddress, depositContractConfig, onBack, onClose, onOrderCreated, onSuccess, classes, }: QRDepositProps): import("react/jsx-runtime").JSX.Element;
@@ -41,7 +41,7 @@ const DEFAULT_ETH_ON_BASE = {
41
41
  * onSuccess={(txHash) => console.log("Deposit complete:", txHash)}
42
42
  * />
43
43
  */
44
- function QRDeposit({ mode = "modal", recipientAddress, sourceToken: sourceTokenProp, sourceChainId: sourceChainIdProp, destinationToken, destinationChainId, creatorAddress, depositContractConfig, onBack, onClose, onOrderCreated, onSuccess, }) {
44
+ function QRDeposit({ mode = "modal", recipientAddress, sourceToken: sourceTokenProp, sourceChainId: sourceChainIdProp, destinationToken, destinationChainId, creatorAddress, depositContractConfig, onBack, onClose, onOrderCreated, onSuccess, classes, }) {
45
45
  const [copied, setCopied] = (0, react_2.useState)(false);
46
46
  const [orderId, setOrderId] = (0, react_2.useState)();
47
47
  const [globalAddress, setGlobalAddress] = (0, react_2.useState)();
@@ -162,11 +162,19 @@ function QRDeposit({ mode = "modal", recipientAddress, sourceToken: sourceTokenP
162
162
  }
163
163
  // Show order details if order has deposits or is being processed
164
164
  if (oat?.data && oat.data.depositTxs && oat.data.depositTxs.length > 0) {
165
- return ((0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)("anyspend-container anyspend-qr-order-details font-inter bg-as-surface-primary mx-auto w-full max-w-[460px] p-6", mode === "page" && "border-as-border-secondary overflow-hidden rounded-2xl border shadow-xl"), children: (0, jsx_runtime_1.jsx)("div", { className: "anyspend-qr-order-details-content relative flex flex-col gap-4", children: (0, jsx_runtime_1.jsx)(OrderDetails_1.OrderDetails, { mode: mode, order: oat.data.order, depositTxs: oat.data.depositTxs, relayTxs: oat.data.relayTxs, executeTx: oat.data.executeTx, refundTxs: oat.data.refundTxs, onBack: handleBack }) }) }));
165
+ return ((0, jsx_runtime_1.jsx)("div", { className: classes?.orderDetailsContainer ||
166
+ (0, cn_1.cn)("anyspend-container anyspend-qr-order-details font-inter bg-as-surface-primary mx-auto w-full max-w-[460px] p-6", mode === "page" && "border-as-border-secondary overflow-hidden rounded-2xl border shadow-xl"), children: (0, jsx_runtime_1.jsx)("div", { className: classes?.orderDetailsContent || "anyspend-qr-order-details-content relative flex flex-col gap-4", children: (0, jsx_runtime_1.jsx)(OrderDetails_1.OrderDetails, { mode: mode, order: oat.data.order, depositTxs: oat.data.depositTxs, relayTxs: oat.data.relayTxs, executeTx: oat.data.executeTx, refundTxs: oat.data.refundTxs, onBack: handleBack }) }) }));
166
167
  }
167
168
  // Show loading state while creating order (but not if we already have an orderId or for pure transfers)
168
169
  if (isCreatingOrder && !orderId && !isPureTransfer) {
169
- return ((0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)("anyspend-container anyspend-qr-loading font-inter bg-as-surface-primary mx-auto w-full max-w-[460px] p-6", mode === "page" && "border-as-border-secondary overflow-hidden rounded-2xl border shadow-xl"), children: (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-qr-loading-content flex flex-col items-center justify-center gap-4 py-12", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "anyspend-qr-loading-spinner text-as-brand h-8 w-8 animate-spin" }), (0, jsx_runtime_1.jsx)("p", { className: "anyspend-qr-loading-text text-as-secondary text-sm", children: "Creating deposit order..." })] }) }));
170
+ return ((0, jsx_runtime_1.jsx)("div", { className: classes?.loadingContainer ||
171
+ (0, cn_1.cn)("anyspend-container anyspend-qr-loading font-inter bg-as-surface-primary mx-auto w-full max-w-[460px] p-6", mode === "page" && "border-as-border-secondary overflow-hidden rounded-2xl border shadow-xl"), children: (0, jsx_runtime_1.jsxs)("div", { className: classes?.loadingContent ||
172
+ "anyspend-qr-loading-content flex flex-col items-center justify-center gap-4 py-12", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: classes?.loadingSpinner || "anyspend-qr-loading-spinner text-as-brand h-8 w-8 animate-spin" }), (0, jsx_runtime_1.jsx)("p", { className: classes?.loadingText || "anyspend-qr-loading-text text-as-secondary text-sm", children: "Creating deposit order..." })] }) }));
170
173
  }
171
- return ((0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)("anyspend-container anyspend-qr-deposit font-inter bg-as-surface-primary mx-auto w-full max-w-[460px] p-6", mode === "page" && "border-as-border-secondary overflow-hidden rounded-2xl border shadow-xl"), children: (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-qr-deposit-content flex flex-col gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "anyspend-qr-header flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("button", { onClick: handleBack, className: "anyspend-qr-back-button text-as-secondary hover:text-as-primary", children: (0, jsx_runtime_1.jsx)("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) }) }), (0, jsx_runtime_1.jsx)("h2", { className: "anyspend-qr-title text-as-primary text-base font-semibold", children: "Deposit" }), onClose ? ((0, jsx_runtime_1.jsx)("button", { onClick: handleClose, className: "anyspend-qr-close-button text-as-secondary hover:text-as-primary", children: (0, jsx_runtime_1.jsx)("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })) : ((0, jsx_runtime_1.jsx)("div", { className: "w-5" }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-qr-token-selector flex flex-col gap-1.5", children: [(0, jsx_runtime_1.jsx)("label", { className: "anyspend-qr-token-label text-as-secondary text-sm", children: "Send" }), (0, jsx_runtime_1.jsx)(relay_kit_ui_1.TokenSelector, { chainIdsFilter: (0, anyspend_1.getAvailableChainIds)("from"), context: "from", fromChainWalletVMSupported: true, isValidAddress: true, lockedChainIds: (0, anyspend_1.getAvailableChainIds)("from"), multiWalletSupportEnabled: true, onAnalyticEvent: undefined, setToken: handleTokenSelect, supportedWalletVMs: ["evm"], token: undefined, trigger: (0, jsx_runtime_1.jsxs)(react_1.Button, { variant: "outline", role: "combobox", className: "anyspend-qr-token-trigger border-as-stroke bg-as-surface-secondary flex h-auto w-full items-center justify-between gap-2 rounded-xl border px-3 py-2.5", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [sourceToken.metadata?.logoURI ? ((0, jsx_runtime_1.jsx)(ChainTokenIcon_1.ChainTokenIcon, { chainUrl: anyspend_1.ALL_CHAINS[sourceChainId]?.logoUrl, tokenUrl: sourceToken.metadata.logoURI, className: "h-8 min-h-8 w-8 min-w-8" })) : ((0, jsx_runtime_1.jsx)("div", { className: "h-8 w-8 rounded-full bg-gray-700" })), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-start gap-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-as-primary font-semibold", children: sourceToken.symbol }), (0, jsx_runtime_1.jsx)("div", { className: "text-as-primary/70 text-xs", children: anyspend_1.ALL_CHAINS[sourceChainId]?.name ?? "Unknown" })] })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronsUpDown, { className: "h-4 w-4 shrink-0 opacity-70" })] }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-qr-content border-as-stroke flex items-start gap-4 rounded-xl border p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "anyspend-qr-code-container flex flex-col items-center gap-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "anyspend-qr-code rounded-lg bg-white p-2", children: (0, jsx_runtime_1.jsx)(qrcode_react_1.QRCodeSVG, { value: displayAddress, size: 120, level: "M", marginSize: 0 }) }), (0, jsx_runtime_1.jsxs)("span", { className: "anyspend-qr-scan-hint text-as-secondary text-xs", children: ["SCAN WITH ", (0, jsx_runtime_1.jsx)("span", { className: "inline-block", children: "\uD83E\uDD8A" })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-qr-address-container flex flex-1 flex-col gap-1", children: [(0, jsx_runtime_1.jsx)("span", { className: "anyspend-qr-address-label text-as-secondary text-sm", children: "Deposit address:" }), (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-qr-address-row flex items-start gap-1", children: [(0, jsx_runtime_1.jsx)("span", { className: "anyspend-qr-address text-as-primary break-all font-mono text-sm leading-relaxed", children: displayAddress }), (0, jsx_runtime_1.jsx)("button", { onClick: handleCopyAddress, className: "anyspend-qr-copy-icon text-as-secondary hover:text-as-primary mt-0.5 shrink-0", children: copied ? (0, jsx_runtime_1.jsx)(lucide_react_1.Check, { className: "h-4 w-4" }) : (0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { className: "h-4 w-4" }) })] })] })] }), (0, jsx_runtime_1.jsx)(WarningText_1.ChainWarningText, { chainId: destinationChainId }), (0, jsx_runtime_1.jsxs)(WarningText_1.WarningText, { children: ["Only send ", sourceToken.symbol, " on ", anyspend_1.ALL_CHAINS[sourceChainId]?.name ?? "the specified chain", ". Other tokens will not be converted."] }), isPureTransfer && isWatchingTransfer && ((0, jsx_runtime_1.jsxs)("div", { className: "anyspend-qr-watching flex items-center justify-center gap-2 rounded-lg bg-blue-500/10 p-3", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "h-4 w-4 animate-spin text-blue-500" }), (0, jsx_runtime_1.jsx)("span", { className: "text-sm text-blue-500", children: "Watching for incoming transfer..." })] })), (0, jsx_runtime_1.jsx)("button", { onClick: handleCopyAddress, className: "anyspend-qr-copy-button flex w-full items-center justify-center gap-2 rounded-xl bg-blue-500 py-3.5 font-medium text-white transition-all hover:bg-blue-600", children: "Copy deposit address" })] }) }));
174
+ return ((0, jsx_runtime_1.jsx)("div", { className: classes?.container ||
175
+ (0, cn_1.cn)("anyspend-container anyspend-qr-deposit font-inter bg-as-surface-primary mx-auto w-full max-w-[460px] p-6", mode === "page" && "border-as-border-secondary overflow-hidden rounded-2xl border shadow-xl"), children: (0, jsx_runtime_1.jsxs)("div", { className: classes?.content || "anyspend-qr-deposit-content flex flex-col gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: classes?.header || "anyspend-qr-header flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("button", { onClick: handleBack, className: classes?.backButton || "anyspend-qr-back-button text-as-secondary hover:text-as-primary", children: (0, jsx_runtime_1.jsx)("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) }) }), (0, jsx_runtime_1.jsx)("h2", { className: classes?.title || "anyspend-qr-title text-as-primary text-base font-semibold", children: "Deposit" }), onClose ? ((0, jsx_runtime_1.jsx)("button", { onClick: handleClose, className: classes?.closeButton || "anyspend-qr-close-button text-as-secondary hover:text-as-primary", children: (0, jsx_runtime_1.jsx)("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })) : ((0, jsx_runtime_1.jsx)("div", { className: "w-5" }))] }), (0, jsx_runtime_1.jsxs)("div", { className: classes?.tokenSelectorContainer || "anyspend-qr-token-selector flex flex-col gap-1.5", children: [(0, jsx_runtime_1.jsx)("label", { className: classes?.tokenSelectorLabel || "anyspend-qr-token-label text-as-secondary text-sm", children: "Send" }), (0, jsx_runtime_1.jsx)(relay_kit_ui_1.TokenSelector, { chainIdsFilter: (0, anyspend_1.getAvailableChainIds)("from"), context: "from", fromChainWalletVMSupported: true, isValidAddress: true, lockedChainIds: (0, anyspend_1.getAvailableChainIds)("from"), multiWalletSupportEnabled: true, onAnalyticEvent: undefined, setToken: handleTokenSelect, supportedWalletVMs: ["evm"], token: undefined, trigger: (0, jsx_runtime_1.jsxs)(react_1.Button, { variant: "outline", role: "combobox", className: classes?.tokenSelectorTrigger ||
176
+ "anyspend-qr-token-trigger border-as-stroke bg-as-surface-secondary flex h-auto w-full items-center justify-between gap-2 rounded-xl border px-3 py-2.5", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [sourceToken.metadata?.logoURI ? ((0, jsx_runtime_1.jsx)(ChainTokenIcon_1.ChainTokenIcon, { chainUrl: anyspend_1.ALL_CHAINS[sourceChainId]?.logoUrl, tokenUrl: sourceToken.metadata.logoURI, className: "h-8 min-h-8 w-8 min-w-8" })) : ((0, jsx_runtime_1.jsx)("div", { className: "h-8 w-8 rounded-full bg-gray-700" })), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-start gap-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-as-primary font-semibold", children: sourceToken.symbol }), (0, jsx_runtime_1.jsx)("div", { className: "text-as-primary/70 text-xs", children: anyspend_1.ALL_CHAINS[sourceChainId]?.name ?? "Unknown" })] })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronsUpDown, { className: "h-4 w-4 shrink-0 opacity-70" })] }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: classes?.qrContent || "anyspend-qr-content border-as-stroke flex items-start gap-4 rounded-xl border p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: classes?.qrCodeContainer || "anyspend-qr-code-container flex flex-col items-center gap-2", children: [(0, jsx_runtime_1.jsx)("div", { className: classes?.qrCode || "anyspend-qr-code rounded-lg bg-white p-2", children: (0, jsx_runtime_1.jsx)(qrcode_react_1.QRCodeSVG, { value: displayAddress, size: 120, level: "M", marginSize: 0 }) }), (0, jsx_runtime_1.jsxs)("span", { className: classes?.qrScanHint || "anyspend-qr-scan-hint text-as-secondary text-xs", children: ["SCAN WITH ", (0, jsx_runtime_1.jsx)("span", { className: "inline-block", children: "\uD83E\uDD8A" })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: classes?.addressContainer || "anyspend-qr-address-container flex flex-1 flex-col gap-1", children: [(0, jsx_runtime_1.jsx)("span", { className: classes?.addressLabel || "anyspend-qr-address-label text-as-secondary text-sm", children: "Deposit address:" }), (0, jsx_runtime_1.jsxs)("div", { className: classes?.addressRow || "anyspend-qr-address-row flex items-start gap-1", children: [(0, jsx_runtime_1.jsx)("span", { className: classes?.address || "anyspend-qr-address text-as-primary break-all font-mono text-sm leading-relaxed", children: displayAddress }), (0, jsx_runtime_1.jsx)("button", { onClick: handleCopyAddress, className: classes?.addressCopyIcon ||
177
+ "anyspend-qr-copy-icon text-as-secondary hover:text-as-primary mt-0.5 shrink-0", children: copied ? (0, jsx_runtime_1.jsx)(lucide_react_1.Check, { className: "h-4 w-4" }) : (0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { className: "h-4 w-4" }) })] })] })] }), (0, jsx_runtime_1.jsx)(WarningText_1.ChainWarningText, { chainId: destinationChainId }), (0, jsx_runtime_1.jsxs)(WarningText_1.WarningText, { children: ["Only send ", sourceToken.symbol, " on ", anyspend_1.ALL_CHAINS[sourceChainId]?.name ?? "the specified chain", ". Other tokens will not be converted."] }), isPureTransfer && isWatchingTransfer && ((0, jsx_runtime_1.jsxs)("div", { className: classes?.watchingIndicator ||
178
+ "anyspend-qr-watching flex items-center justify-center gap-2 rounded-lg bg-blue-500/10 p-3", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "h-4 w-4 animate-spin text-blue-500" }), (0, jsx_runtime_1.jsx)("span", { className: "text-sm text-blue-500", children: "Watching for incoming transfer..." })] })), (0, jsx_runtime_1.jsx)("button", { onClick: handleCopyAddress, className: classes?.copyButton ||
179
+ "anyspend-qr-copy-button flex w-full items-center justify-center gap-2 rounded-xl bg-blue-500 py-3.5 font-medium text-white transition-all hover:bg-blue-600", children: "Copy deposit address" })] }) }));
172
180
  }