@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
@@ -1,4 +1,5 @@
1
1
  import { components } from "../../types/api";
2
+ import type { AnySpendClasses } from "./types/classes";
2
3
  export interface RecipientOption {
3
4
  address: string;
4
5
  icon?: string;
@@ -15,7 +16,8 @@ export declare enum PanelView {
15
16
  CRYPTO_PAYMENT_METHOD = 6,
16
17
  FIAT_PAYMENT_METHOD = 7,
17
18
  POINTS_DETAIL = 8,
18
- FEE_DETAIL = 9
19
+ FEE_DETAIL = 9,
20
+ DIRECT_TRANSFER_SUCCESS = 10
19
21
  }
20
22
  export declare function AnySpend(props: {
21
23
  mode?: "page" | "modal";
@@ -45,4 +47,8 @@ export declare function AnySpend(props: {
45
47
  customRecipientLabel?: string;
46
48
  /** Custom label for the return home button (overrides "Return to Home" / "Close") */
47
49
  returnHomeLabel?: string;
50
+ /** Custom class names for styling specific elements */
51
+ classes?: AnySpendClasses;
52
+ /** When true, allows direct transfer without swap if source and destination token/chain are the same */
53
+ allowDirectTransfer?: boolean;
48
54
  }): import("react/jsx-runtime").JSX.Element;
@@ -24,6 +24,7 @@ const chains_1 = require("viem/chains");
24
24
  const useAutoSelectCryptoPaymentMethod_1 = require("../hooks/useAutoSelectCryptoPaymentMethod");
25
25
  const useConnectedWalletDisplay_1 = require("../hooks/useConnectedWalletDisplay");
26
26
  const useCryptoPaymentMethodState_1 = require("../hooks/useCryptoPaymentMethodState");
27
+ const useDirectTransfer_1 = require("../hooks/useDirectTransfer");
27
28
  const useRecipientAddressState_1 = require("../hooks/useRecipientAddressState");
28
29
  const AnySpendFingerprintWrapper_1 = require("./AnySpendFingerprintWrapper");
29
30
  const CryptoPaymentMethod_1 = require("./common/CryptoPaymentMethod");
@@ -52,17 +53,20 @@ var PanelView;
52
53
  PanelView[PanelView["FIAT_PAYMENT_METHOD"] = 7] = "FIAT_PAYMENT_METHOD";
53
54
  PanelView[PanelView["POINTS_DETAIL"] = 8] = "POINTS_DETAIL";
54
55
  PanelView[PanelView["FEE_DETAIL"] = 9] = "FEE_DETAIL";
56
+ PanelView[PanelView["DIRECT_TRANSFER_SUCCESS"] = 10] = "DIRECT_TRANSFER_SUCCESS";
55
57
  })(PanelView || (exports.PanelView = PanelView = {}));
56
58
  const ANYSPEND_RECIPIENTS_KEY = "anyspend_recipients";
57
59
  function AnySpend(props) {
58
60
  const fingerprintConfig = (0, AnySpendFingerprintWrapper_1.getFingerprintConfig)();
61
+ console.log("[mitch] AnySpend rendered with fingerprintConfig:", props, fingerprintConfig);
59
62
  return ((0, jsx_runtime_1.jsx)(AnySpendFingerprintWrapper_1.AnySpendFingerprintWrapper, { fingerprint: fingerprintConfig, children: (0, jsx_runtime_1.jsx)(AnySpendInner, { ...props }) }));
60
63
  }
61
- function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationTokenChainId, mode = "modal", defaultActiveTab = "crypto", loadOrder, hideTransactionHistoryButton, recipientAddress: recipientAddressFromProps, onTokenSelect, onSuccess, customUsdInputValues, hideHeader, hideBottomNavigation = false, disableUrlParamManagement = false, returnToHomeUrl, customRecipientLabel, returnHomeLabel, }) {
64
+ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationTokenChainId, mode = "modal", defaultActiveTab = "crypto", loadOrder, hideTransactionHistoryButton, recipientAddress: recipientAddressFromProps, onTokenSelect, onSuccess, customUsdInputValues, hideHeader, hideBottomNavigation = false, disableUrlParamManagement = false, returnToHomeUrl, customRecipientLabel, returnHomeLabel, classes, allowDirectTransfer = false, }) {
62
65
  const searchParams = (0, react_2.useSearchParamsSSR)();
63
66
  const router = (0, react_2.useRouter)();
64
67
  const { partnerId } = (0, react_2.useB3Config)();
65
68
  const setB3ModalContentType = (0, react_2.useModalStore)(state => state.setB3ModalContentType);
69
+ const setB3ModalOpen = (0, react_2.useModalStore)(state => state.setB3ModalOpen);
66
70
  // Determine if we're in "buy mode" based on whether destination token props are provided
67
71
  const isBuyMode = !!(destinationTokenAddress && destinationTokenChainId);
68
72
  // Add refs to track URL state
@@ -76,6 +80,7 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
76
80
  const previousPanel = (0, react_4.useRef)(PanelView.MAIN);
77
81
  const [activeTab, setActiveTab] = (0, react_4.useState)(defaultActiveTab);
78
82
  const [orderId, setOrderId] = (0, react_4.useState)(loadOrder);
83
+ const [directTransferTxHash, setDirectTransferTxHash] = (0, react_4.useState)();
79
84
  const { orderAndTransactions: oat, getOrderAndTransactionsError } = (0, react_1.useAnyspendOrderAndTransactions)(orderId);
80
85
  !!getOrderAndTransactionsError && console.log("getOrderAndTransactionsError", getOrderAndTransactionsError);
81
86
  const [activePanel, setActivePanel] = (0, react_4.useState)(loadOrder ? PanelView.ORDER_DETAILS : PanelView.MAIN);
@@ -334,6 +339,7 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
334
339
  // [selectedDstChainId, newRecipientAddress, resolvedAddress]
335
340
  // );
336
341
  const { address: globalAddress, wallet: globalWallet, connectedEOAWallet } = (0, react_2.useAccountWallet)();
342
+ const { executeDirectTransfer, isTransferring: isSwitchingOrExecuting } = (0, useDirectTransfer_1.useDirectTransfer)();
337
343
  const globalWalletImage = (0, useAccountWallet_1.useAccountWalletImage)();
338
344
  // Get wallet address based on selected payment method
339
345
  const { walletAddress } = (0, useConnectedWalletDisplay_1.useConnectedWalletDisplay)(effectiveCryptoPaymentMethod);
@@ -533,19 +539,26 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
533
539
  selectedSrcChainId === selectedDstChainId &&
534
540
  selectedSrcToken.address.toLowerCase() === selectedDstToken.address.toLowerCase());
535
541
  }, [activeTab, selectedSrcChainId, selectedDstChainId, selectedSrcToken.address, selectedDstToken.address]);
542
+ // Check if this is a direct transfer (same chain/token with allowDirectTransfer enabled)
543
+ const isDirectTransfer = isSameChainSameToken && allowDirectTransfer;
536
544
  // Determine button state and text
537
545
  const btnInfo = (0, react_4.useMemo)(() => {
538
546
  // For fiat tab, check srcAmountOnRamp; for crypto tab, check activeInputAmountInWei
539
547
  const hasAmount = activeTab === "fiat" ? srcAmountOnRamp && parseFloat(srcAmountOnRamp) > 0 : activeInputAmountInWei !== "0";
540
548
  if (!hasAmount)
541
549
  return { text: "Enter an amount", disable: true, error: false, loading: false };
542
- if (isSameChainSameToken)
550
+ if (isSameChainSameToken && !allowDirectTransfer)
543
551
  return { text: "Select a different token or chain", disable: true, error: false, loading: false };
544
- if (isLoadingAnyspendQuote)
552
+ if (isLoadingAnyspendQuote && !isSameChainSameToken)
545
553
  return { text: "Loading quote...", disable: true, error: false, loading: true };
546
- if (isCreatingOrder || isCreatingOnrampOrder)
547
- return { text: "Creating order...", disable: true, error: false, loading: true };
548
- if (!anyspendQuote || !anyspendQuote.success)
554
+ if (isCreatingOrder || isCreatingOnrampOrder || isSwitchingOrExecuting)
555
+ return {
556
+ text: isSwitchingOrExecuting ? "Transferring..." : "Creating order...",
557
+ disable: true,
558
+ error: false,
559
+ loading: true,
560
+ };
561
+ if ((!anyspendQuote || !anyspendQuote.success) && !(isSameChainSameToken && allowDirectTransfer))
549
562
  return { text: "No quote found", disable: true, error: false, loading: false };
550
563
  if (activeTab === "fiat") {
551
564
  // For fiat: check recipient first, then payment method
@@ -570,7 +583,8 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
570
583
  // If payment method selected, show appropriate action
571
584
  if (effectiveCryptoPaymentMethod === CryptoPaymentMethod_1.CryptoPaymentMethodType.CONNECT_WALLET ||
572
585
  effectiveCryptoPaymentMethod === CryptoPaymentMethod_1.CryptoPaymentMethodType.GLOBAL_WALLET) {
573
- return { text: "Swap", disable: false, error: false, loading: false };
586
+ const buttonText = isSameChainSameToken && allowDirectTransfer ? "Transfer" : "Swap";
587
+ return { text: buttonText, disable: false, error: false, loading: false };
574
588
  }
575
589
  if (effectiveCryptoPaymentMethod === CryptoPaymentMethod_1.CryptoPaymentMethodType.TRANSFER_CRYPTO) {
576
590
  return { text: "Continue to payment", disable: false, error: false, loading: false };
@@ -584,18 +598,24 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
584
598
  effectiveRecipientAddress,
585
599
  isCreatingOrder,
586
600
  isCreatingOnrampOrder,
601
+ isSwitchingOrExecuting,
587
602
  anyspendQuote,
588
603
  activeTab,
589
604
  effectiveCryptoPaymentMethod,
590
605
  selectedFiatPaymentMethod,
591
606
  srcAmountOnRamp,
607
+ allowDirectTransfer,
592
608
  ]);
593
609
  // Handle main button click
594
610
  const onMainButtonClick = async () => {
595
611
  if (btnInfo.disable)
596
612
  return;
613
+ const isDirectTransfer = isSameChainSameToken && allowDirectTransfer;
597
614
  try {
598
- (0, invariant_1.default)(anyspendQuote, "Relay price is not found");
615
+ // Only require quote for non-direct transfers
616
+ if (!isDirectTransfer) {
617
+ (0, invariant_1.default)(anyspendQuote, "Relay price is not found");
618
+ }
599
619
  if (activeTab === "fiat") {
600
620
  // For fiat: check recipient first
601
621
  if (!effectiveRecipientAddress) {
@@ -659,12 +679,29 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
659
679
  // Handle crypto swap creation
660
680
  const handleCryptoSwap = async (method) => {
661
681
  try {
662
- (0, invariant_1.default)(anyspendQuote, "Relay price is not found");
682
+ const isDirectTransfer = isSameChainSameToken && allowDirectTransfer;
663
683
  (0, invariant_1.default)(effectiveRecipientAddress, "Recipient address is not found");
684
+ const srcAmountBigInt = (0, viem_1.parseUnits)(srcAmount.replace(/,/g, ""), selectedSrcToken.decimals);
685
+ // Handle direct transfer (same chain/token) - bypass backend, transfer directly
686
+ if (isDirectTransfer) {
687
+ const txHash = await executeDirectTransfer({
688
+ chainId: selectedSrcChainId,
689
+ tokenAddress: selectedSrcToken.address,
690
+ recipientAddress: effectiveRecipientAddress,
691
+ amount: srcAmountBigInt,
692
+ method,
693
+ });
694
+ if (txHash) {
695
+ setDirectTransferTxHash(txHash);
696
+ navigateToPanel(PanelView.DIRECT_TRANSFER_SUCCESS, "forward");
697
+ }
698
+ return;
699
+ }
700
+ // Regular swap flow - use backend
701
+ (0, invariant_1.default)(anyspendQuote, "Relay price is not found");
664
702
  // Debug: Check payment method values
665
703
  console.log("handleCryptoSwap - method parameter:", method);
666
704
  console.log("handleCryptoSwap - selectedCryptoPaymentMethod state:", selectedCryptoPaymentMethod);
667
- const srcAmountBigInt = (0, viem_1.parseUnits)(srcAmount.replace(/,/g, ""), selectedSrcToken.decimals);
668
705
  createOrder({
669
706
  recipientAddress: effectiveRecipientAddress,
670
707
  orderType: "swap",
@@ -832,7 +869,7 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
832
869
  // Reset payment methods when going back
833
870
  resetPaymentMethods();
834
871
  }, returnToHomeUrl: returnToHomeUrl, returnHomeLabel: returnHomeLabel, disableUrlParamManagement: disableUrlParamManagement })) }) }));
835
- const mainView = ((0, jsx_runtime_1.jsxs)("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-2 pt-5", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex w-full max-w-full flex-col items-center gap-2 px-5", children: [isBuyMode && !hideHeader && ((0, jsx_runtime_1.jsxs)("div", { className: "mb-4 flex flex-col items-center gap-3 text-center", children: [selectedDstToken.metadata?.logoURI && ((0, jsx_runtime_1.jsx)("div", { className: "relative", children: (0, jsx_runtime_1.jsx)("img", { src: selectedDstToken.metadata.logoURI, alt: selectedDstToken.symbol, className: "border-as-stroke h-12 w-12 rounded-full border-2 shadow-md" }) })), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("h1", { className: "text-as-primary text-xl font-bold", children: ["Buy ", selectedDstToken.symbol] }) })] })), (0, jsx_runtime_1.jsx)(TabSection_1.TabSection, { activeTab: activeTab, setActiveTab: tab => {
872
+ const mainView = ((0, jsx_runtime_1.jsxs)("div", { className: classes?.mainContent || "mx-auto flex w-[460px] max-w-full flex-col items-center gap-2 pt-5", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex w-full max-w-full flex-col items-center gap-2 px-5", children: [isBuyMode && !hideHeader && ((0, jsx_runtime_1.jsxs)("div", { className: classes?.header || "mb-4 flex flex-col items-center gap-3 text-center", children: [selectedDstToken.metadata?.logoURI && ((0, jsx_runtime_1.jsx)("div", { className: "relative", children: (0, jsx_runtime_1.jsx)("img", { src: selectedDstToken.metadata.logoURI, alt: selectedDstToken.symbol, className: classes?.headerLogo || "border-as-stroke h-12 w-12 rounded-full border-2 shadow-md" }) })), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("h1", { className: classes?.headerTitle || "text-as-primary text-xl font-bold", children: ["Buy ", selectedDstToken.symbol] }) })] })), (0, jsx_runtime_1.jsx)(TabSection_1.TabSection, { activeTab: activeTab, setActiveTab: tab => {
836
873
  setActiveTab(tab);
837
874
  // Reset payment methods when switching tabs
838
875
  resetPaymentMethods();
@@ -846,7 +883,8 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
846
883
  else {
847
884
  setActivePanel(panelIndex);
848
885
  }
849
- }, _recipientAddress: effectiveRecipientAddress, destinationToken: selectedDstToken, destinationChainId: selectedDstChainId, destinationAmount: dstAmount, onDestinationTokenChange: setSelectedDstToken, onDestinationChainChange: setSelectedDstChainId, fiatPaymentMethodIndex: PanelView.FIAT_PAYMENT_METHOD, recipientSelectionPanelIndex: PanelView.RECIPIENT_SELECTION, hideDstToken: isBuyMode, anyspendQuote: anyspendQuote, onShowPointsDetail: () => navigateToPanel(PanelView.POINTS_DETAIL, "forward"), onShowFeeDetail: () => navigateToPanel(PanelView.FEE_DETAIL, "forward"), customUsdInputValues: customUsdInputValues, customRecipientLabel: customRecipientLabel }) })), activeTab === "crypto" && ((0, jsx_runtime_1.jsx)("div", { className: "z-10 -my-6 flex justify-center", children: (0, jsx_runtime_1.jsx)(react_2.Button, { variant: "ghost", className: (0, cn_1.cn)("border-as-stroke bg-as-surface-primary h-10 w-10 rounded-xl border-2 sm:h-8 sm:w-8 sm:rounded-xl", isBuyMode && "cursor-default", selectedDstChainId === anyspend_1.HYPERLIQUID_CHAIN_ID && "cursor-not-allowed opacity-50"), onClick: () => {
886
+ }, _recipientAddress: effectiveRecipientAddress, destinationToken: selectedDstToken, destinationChainId: selectedDstChainId, destinationAmount: dstAmount, onDestinationTokenChange: setSelectedDstToken, onDestinationChainChange: setSelectedDstChainId, fiatPaymentMethodIndex: PanelView.FIAT_PAYMENT_METHOD, recipientSelectionPanelIndex: PanelView.RECIPIENT_SELECTION, hideDstToken: isBuyMode, anyspendQuote: anyspendQuote, onShowPointsDetail: () => navigateToPanel(PanelView.POINTS_DETAIL, "forward"), onShowFeeDetail: () => navigateToPanel(PanelView.FEE_DETAIL, "forward"), customUsdInputValues: customUsdInputValues, customRecipientLabel: customRecipientLabel }) })), activeTab === "crypto" && ((0, jsx_runtime_1.jsx)("div", { className: "z-10 -my-6 flex justify-center", children: (0, jsx_runtime_1.jsx)(react_2.Button, { variant: "ghost", className: classes?.swapDirectionButton ||
887
+ (0, cn_1.cn)("border-as-stroke bg-as-surface-primary h-10 w-10 rounded-xl border-2 sm:h-8 sm:w-8 sm:rounded-xl", isBuyMode && "cursor-default", selectedDstChainId === anyspend_1.HYPERLIQUID_CHAIN_ID && "cursor-not-allowed opacity-50"), onClick: () => {
850
888
  if (isBuyMode) {
851
889
  return;
852
890
  }
@@ -866,7 +904,11 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
866
904
  }, 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" }) }) }) })), activeTab === "crypto" && ((0, jsx_runtime_1.jsx)(CryptoReceiveSection_1.CryptoReceiveSection, { isDepositMode: false, isBuyMode: isBuyMode, effectiveRecipientAddress: effectiveRecipientAddress, recipientName: recipientName || undefined, customRecipientLabel: customRecipientLabel, onSelectRecipient: () => navigateToPanel(PanelView.RECIPIENT_SELECTION, "forward"), dstAmount: dstAmount, dstToken: selectedDstToken, selectedDstChainId: selectedDstChainId, setSelectedDstChainId: setSelectedDstChainId, setSelectedDstToken: setSelectedDstToken, isSrcInputDirty: isSrcInputDirty, onChangeDstAmount: value => {
867
905
  setIsSrcInputDirty(false);
868
906
  setDstAmount(value);
869
- }, anyspendQuote: anyspendQuote, onShowPointsDetail: () => navigateToPanel(PanelView.POINTS_DETAIL, "forward"), onShowFeeDetail: () => navigateToPanel(PanelView.FEE_DETAIL, "forward") }))] }), gasPriceData && !isLoadingGas && activeTab === "crypto" && ((0, jsx_runtime_1.jsx)(GasIndicator_1.GasIndicator, { gasPrice: gasPriceData, className: "mt-2 w-full" })), (0, jsx_runtime_1.jsxs)(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] }) }), !hideTransactionHistoryButton && (globalAddress || effectiveRecipientAddress) ? ((0, jsx_runtime_1.jsxs)(react_2.Button, { variant: "link", onClick: onClickHistory, className: "text-as-primary/50 hover:text-as-primary flex items-center gap-1 transition-colors", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.HistoryIcon, { className: "h-4 w-4" }), " ", (0, jsx_runtime_1.jsx)("span", { className: "pr-4", children: "Transaction History" })] })) : null] })] }), (0, jsx_runtime_1.jsx)("div", { className: "w-full", children: (0, jsx_runtime_1.jsx)(react_2.TabsPrimitive, { defaultValue: "swap", onValueChange: value => {
907
+ }, anyspendQuote: isDirectTransfer ? undefined : anyspendQuote, onShowPointsDetail: isDirectTransfer ? undefined : () => navigateToPanel(PanelView.POINTS_DETAIL, "forward"), onShowFeeDetail: isDirectTransfer ? undefined : () => navigateToPanel(PanelView.FEE_DETAIL, "forward") }))] }), gasPriceData && !isLoadingGas && activeTab === "crypto" && !isDirectTransfer && ((0, jsx_runtime_1.jsx)(GasIndicator_1.GasIndicator, { gasPrice: gasPriceData, className: classes?.gasIndicator || "mt-2 w-full" })), (0, jsx_runtime_1.jsxs)(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) ||
908
+ (btnInfo.disable && classes?.mainButtonDisabled) ||
909
+ classes?.mainButton ||
910
+ (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] }) }), !hideTransactionHistoryButton && (globalAddress || effectiveRecipientAddress) ? ((0, jsx_runtime_1.jsxs)(react_2.Button, { variant: "link", onClick: onClickHistory, className: classes?.historyButton ||
911
+ "text-as-primary/50 hover:text-as-primary flex items-center gap-1 transition-colors", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.HistoryIcon, { className: "h-4 w-4" }), " ", (0, jsx_runtime_1.jsx)("span", { className: "pr-4", children: "Transaction History" })] })) : null] })] }), (0, jsx_runtime_1.jsx)("div", { className: "w-full", children: (0, jsx_runtime_1.jsx)(react_2.TabsPrimitive, { defaultValue: "swap", onValueChange: value => {
870
912
  if (value === "settings" || value === "home") {
871
913
  setB3ModalContentType({
872
914
  type: "manageAccount",
@@ -918,9 +960,17 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
918
960
  }, srcAmountOnRamp: srcAmountOnRamp }));
919
961
  const pointsDetailView = ((0, jsx_runtime_1.jsx)(PointsDetailPanel_1.PointsDetailPanel, { pointsAmount: anyspendQuote?.data?.pointsAmount || 0, onBack: navigateBack }));
920
962
  const feeDetailView = anyspendQuote?.data?.fee ? ((0, jsx_runtime_1.jsx)(FeeDetailPanel_1.FeeDetailPanel, { fee: anyspendQuote.data.fee, transactionAmountUsd: activeTab === "crypto" ? Number(anyspendQuote.data.currencyIn?.amountUsd) : parseFloat(srcAmountOnRamp), onBack: navigateBack })) : null;
963
+ const directTransferSuccessView = ((0, jsx_runtime_1.jsxs)("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-6 p-5", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-as-brand/10 flex h-16 w-16 items-center justify-center rounded-full", children: (0, jsx_runtime_1.jsx)(lucide_react_1.CheckCircle, { className: "text-as-brand h-8 w-8" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("h2", { className: "text-as-primary text-xl font-bold", children: "Transfer Complete" }), (0, jsx_runtime_1.jsxs)("p", { className: "text-as-secondary mt-1 text-sm", children: ["Your ", selectedSrcToken.symbol, " has been sent to ", effectiveRecipientAddress?.slice(0, 6), "...", effectiveRecipientAddress?.slice(-4), " on ", (0, anyspend_1.getChainName)(selectedSrcChainId)] })] })] }), directTransferTxHash && ((0, jsx_runtime_1.jsx)("a", { href: (0, anyspend_1.getExplorerTxUrl)(selectedSrcChainId, directTransferTxHash), target: "_blank", rel: "noopener noreferrer", className: "text-as-brand hover:text-as-brand/80 text-sm underline", children: "View transaction" })), (0, jsx_runtime_1.jsx)("div", { className: "flex w-full flex-col gap-2", children: returnToHomeUrl ? ((0, jsx_runtime_1.jsx)(react_2.Button, { onClick: () => {
964
+ window.location.href = returnToHomeUrl;
965
+ }, className: "bg-as-brand hover:bg-as-brand/90 w-full text-white", children: returnHomeLabel || "Return to Home" })) : ((0, jsx_runtime_1.jsx)(react_2.Button, { onClick: () => {
966
+ onSuccess?.(directTransferTxHash);
967
+ setDirectTransferTxHash(undefined);
968
+ setB3ModalOpen(false);
969
+ }, className: "bg-as-brand hover:bg-as-brand/90 w-full text-white", children: returnHomeLabel || "Done" })) })] }));
921
970
  // Add tabs to the main component when no order is loaded
922
- 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 mx-auto w-full max-w-[460px]", mode === "page" &&
923
- "bg-as-surface-primary border-as-border-secondary overflow-hidden rounded-2xl border shadow-xl"), children: (0, jsx_runtime_1.jsx)(react_2.TransitionPanel, { activeIndex: orderId
971
+ return ((0, jsx_runtime_1.jsx)(react_2.StyleRoot, { children: (0, jsx_runtime_1.jsx)("div", { className: classes?.container ||
972
+ (0, cn_1.cn)("anyspend-container font-inter mx-auto w-full max-w-[460px]", mode === "page" &&
973
+ "bg-as-surface-primary border-as-border-secondary overflow-hidden rounded-2xl border shadow-xl"), children: (0, jsx_runtime_1.jsx)(react_2.TransitionPanel, { activeIndex: orderId
924
974
  ? oat
925
975
  ? PanelView.ORDER_DETAILS
926
976
  : PanelView.LOADING
@@ -949,5 +999,6 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
949
999
  (0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)(mode === "page" && "p-6"), children: fiatPaymentMethodView }, "fiat-payment-method-view"),
950
1000
  (0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)(mode === "page" && "p-6"), children: pointsDetailView }, "points-detail-view"),
951
1001
  (0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)(mode === "page" && "p-6"), children: feeDetailView }, "fee-detail-view"),
1002
+ (0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)(mode === "page" && "p-6"), children: directTransferSuccessView }, "direct-transfer-success-view"),
952
1003
  ] }) }) }));
953
1004
  }
@@ -35,9 +35,13 @@ export interface AnySpendCollectorClubPurchaseProps {
35
35
  */
36
36
  recipientAddress: string;
37
37
  /**
38
- * Optional spender address (defaults to contract address)
38
+ * Optional spender address (defaults to shop address)
39
39
  */
40
40
  spenderAddress?: string;
41
+ /**
42
+ * Collector Club Shop contract address (defaults to Base mainnet shop)
43
+ */
44
+ ccShopAddress?: string;
41
45
  /**
42
46
  * Success callback
43
47
  */
@@ -66,4 +70,4 @@ export interface AnySpendCollectorClubPurchaseProps {
66
70
  */
67
71
  forceFiatPayment?: boolean;
68
72
  }
69
- export declare function AnySpendCollectorClubPurchase({ loadOrder, mode, activeTab, packId, packAmount, pricePerPack, paymentToken, recipientAddress, spenderAddress, onSuccess, header, showRecipient, vendingMachineId, packType, forceFiatPayment, }: AnySpendCollectorClubPurchaseProps): import("react/jsx-runtime").JSX.Element;
73
+ export declare function AnySpendCollectorClubPurchase({ loadOrder, mode, activeTab, packId, packAmount, pricePerPack, paymentToken, recipientAddress, ccShopAddress, spenderAddress, onSuccess, header, showRecipient, vendingMachineId, packType, forceFiatPayment, }: AnySpendCollectorClubPurchaseProps): import("react/jsx-runtime").JSX.Element;
@@ -33,8 +33,8 @@ const number_1 = require("../../../shared/utils/number");
33
33
  const react_1 = require("react");
34
34
  const viem_1 = require("viem");
35
35
  const AnySpendCustom_1 = require("./AnySpendCustom");
36
- // Collector Club Shop contract on Base
37
- const CC_SHOP_ADDRESS = "0x47366E64E4917dd4DdC04Fb9DC507c1dD2b87294";
36
+ // Default Collector Club Shop contract on Base
37
+ const DEFAULT_CC_SHOP_ADDRESS = "0x47366E64E4917dd4DdC04Fb9DC507c1dD2b87294";
38
38
  const BASE_CHAIN_ID = 8453;
39
39
  // ABI for buyPacksFor function only
40
40
  const BUY_PACKS_FOR_ABI = {
@@ -48,7 +48,7 @@ const BUY_PACKS_FOR_ABI = {
48
48
  stateMutability: "nonpayable",
49
49
  type: "function",
50
50
  };
51
- function AnySpendCollectorClubPurchase({ loadOrder, mode = "modal", activeTab = "crypto", packId, packAmount, pricePerPack, paymentToken = constants_1.USDC_BASE, recipientAddress, spenderAddress = CC_SHOP_ADDRESS, onSuccess, header, showRecipient = true, vendingMachineId, packType, forceFiatPayment, }) {
51
+ function AnySpendCollectorClubPurchase({ loadOrder, mode = "modal", activeTab = "crypto", packId, packAmount, pricePerPack, paymentToken = constants_1.USDC_BASE, recipientAddress, ccShopAddress = DEFAULT_CC_SHOP_ADDRESS, spenderAddress, onSuccess, header, showRecipient = true, vendingMachineId, packType, forceFiatPayment, }) {
52
52
  // Calculate total amount needed (pricePerPack * packAmount)
53
53
  const totalAmount = (0, react_1.useMemo)(() => {
54
54
  try {
@@ -81,7 +81,7 @@ function AnySpendCollectorClubPurchase({ loadOrder, mode = "modal", activeTab =
81
81
  }, [recipientAddress, packId, packAmount]);
82
82
  // Default header if not provided
83
83
  const defaultHeader = () => ((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: "Buy Collector Club Packs" }), (0, jsx_runtime_1.jsxs)("p", { className: "text-as-secondary text-sm", children: ["Purchase ", packAmount, " pack", packAmount !== 1 ? "s" : "", " using any token"] })] }) }));
84
- return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.AnySpendCustom, { loadOrder: loadOrder, mode: mode, activeTab: activeTab, recipientAddress: recipientAddress, spenderAddress: spenderAddress, orderType: "custom", dstChainId: BASE_CHAIN_ID, dstToken: paymentToken, dstAmount: totalAmount, contractAddress: CC_SHOP_ADDRESS, encodedData: encodedData, metadata: {
84
+ return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.AnySpendCustom, { loadOrder: loadOrder, mode: mode, activeTab: activeTab, recipientAddress: recipientAddress, spenderAddress: spenderAddress ?? ccShopAddress, orderType: "custom", dstChainId: BASE_CHAIN_ID, dstToken: paymentToken, dstAmount: totalAmount, contractAddress: ccShopAddress, encodedData: encodedData, metadata: {
85
85
  packId,
86
86
  packAmount,
87
87
  pricePerPack,
@@ -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 { AnySpendCustomExactInClasses } from "./types/classes";
3
4
  type CustomExactInConfig = {
4
5
  functionAbi: string;
5
6
  functionName: string;
@@ -17,6 +18,7 @@ export interface AnySpendCustomExactInProps {
17
18
  sourceTokenChainId?: number;
18
19
  destinationToken: components["schemas"]["Token"];
19
20
  destinationChainId: number;
21
+ destinationTokenAmount?: string;
20
22
  onSuccess?: (amount: string) => void;
21
23
  onOpenCustomModal?: () => void;
22
24
  mainFooter?: React.ReactNode;
@@ -38,6 +40,10 @@ export interface AnySpendCustomExactInProps {
38
40
  customRecipientLabel?: string;
39
41
  /** Custom label for the return home button (overrides "Return to Home" / "Close") */
40
42
  returnHomeLabel?: string;
43
+ /** Custom class names for styling specific elements */
44
+ classes?: AnySpendCustomExactInClasses;
45
+ /** When true, allows direct transfer without swap if source and destination token/chain are the same */
46
+ allowDirectTransfer?: boolean;
41
47
  }
42
48
  export declare function AnySpendCustomExactIn(props: AnySpendCustomExactInProps): import("react/jsx-runtime").JSX.Element;
43
49
  export {};