@b3dotfun/sdk 0.0.40 → 0.0.41-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. package/dist/cjs/anyspend/react/components/AnySpend.d.ts +11 -1
  2. package/dist/cjs/anyspend/react/components/AnySpend.js +17 -4
  3. package/dist/cjs/anyspend/react/components/AnySpendBondKit.js +0 -1
  4. package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +0 -1
  5. package/dist/cjs/anyspend/react/components/AnySpendCustom.d.ts +1 -0
  6. package/dist/cjs/anyspend/react/components/AnySpendCustom.js +33 -11
  7. package/dist/cjs/anyspend/react/components/AnySpendNFT.d.ts +2 -1
  8. package/dist/cjs/anyspend/react/components/AnySpendNFT.js +2 -2
  9. package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +0 -1
  10. package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +8 -0
  11. package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +6 -3
  12. package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.js +1 -2
  13. package/dist/cjs/anyspend/react/components/common/ConnectWalletPayment.js +5 -3
  14. package/dist/cjs/anyspend/react/components/common/CryptoPaySection.d.ts +4 -1
  15. package/dist/cjs/anyspend/react/components/common/CryptoPaySection.js +9 -9
  16. package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +80 -10
  17. package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.d.ts +2 -1
  18. package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.js +40 -37
  19. package/dist/cjs/anyspend/react/components/common/OrderDetails.js +8 -11
  20. package/dist/cjs/anyspend/react/components/common/OrderTokenAmount.d.ts +4 -1
  21. package/dist/cjs/anyspend/react/components/common/OrderTokenAmount.js +23 -9
  22. package/dist/cjs/anyspend/react/components/common/PanelOnramp.d.ts +4 -1
  23. package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +10 -6
  24. package/dist/cjs/anyspend/react/components/common/PointsBadge.d.ts +7 -0
  25. package/dist/cjs/anyspend/react/components/common/PointsBadge.js +7 -0
  26. package/dist/cjs/anyspend/react/components/common/PointsDetailPanel.d.ts +6 -0
  27. package/dist/cjs/anyspend/react/components/common/PointsDetailPanel.js +14 -0
  28. package/dist/cjs/anyspend/react/contexts/FeatureFlagsContext.d.ts +11 -0
  29. package/dist/cjs/anyspend/react/contexts/FeatureFlagsContext.js +21 -0
  30. package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.d.ts +4 -1
  31. package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.js +18 -8
  32. package/dist/cjs/anyspend/react/providers/AnyspendProvider.d.ts +5 -2
  33. package/dist/cjs/anyspend/react/providers/AnyspendProvider.js +5 -3
  34. package/dist/cjs/anyspend/react/providers/index.d.ts +1 -0
  35. package/dist/cjs/anyspend/react/providers/index.js +3 -0
  36. package/dist/cjs/anyspend/services/anyspend.d.ts +1 -1
  37. package/dist/cjs/anyspend/services/anyspend.js +2 -0
  38. package/dist/cjs/anyspend/types/api.d.ts +51 -1
  39. package/dist/cjs/anyspend/utils/chain.js +1 -1
  40. package/dist/cjs/anyspend/utils/orderPayload.js +3 -0
  41. package/dist/cjs/bondkit/bondkitToken.d.ts +37 -2
  42. package/dist/cjs/bondkit/bondkitToken.js +268 -2
  43. package/dist/cjs/bondkit/bondkitTokenFactory.d.ts +1 -1
  44. package/dist/cjs/bondkit/bondkitTokenFactory.js +2 -2
  45. package/dist/cjs/bondkit/components/TradingView.js +3 -4
  46. package/dist/cjs/bondkit/config.d.ts +1 -1
  47. package/dist/cjs/bondkit/config.js +5 -2
  48. package/dist/cjs/bondkit/constants.d.ts +4 -0
  49. package/dist/cjs/bondkit/constants.js +6 -1
  50. package/dist/cjs/bondkit/index.d.ts +1 -0
  51. package/dist/cjs/bondkit/index.js +4 -1
  52. package/dist/cjs/bondkit/swapService.d.ts +43 -0
  53. package/dist/cjs/bondkit/swapService.js +376 -0
  54. package/dist/cjs/bondkit/types.d.ts +10 -4
  55. package/dist/cjs/bondkit/types.js +4 -5
  56. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +4 -3
  57. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +41 -9
  58. package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.js +63 -3
  59. package/dist/cjs/global-account/react/components/ManageAccount/ManageAccount.js +35 -2
  60. package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +4 -3
  61. package/dist/cjs/global-account/react/hooks/index.d.ts +1 -0
  62. package/dist/cjs/global-account/react/hooks/index.js +3 -1
  63. package/dist/cjs/global-account/react/hooks/useAccountAssets.js +5 -2
  64. package/dist/cjs/global-account/react/hooks/useAuthentication.js +2 -3
  65. package/dist/cjs/global-account/react/hooks/useGlobalAccount.d.ts +6 -0
  66. package/dist/cjs/global-account/react/hooks/useGlobalAccount.js +32 -0
  67. package/dist/cjs/global-account/react/hooks/useQueryB3.js +5 -2
  68. package/dist/cjs/global-account/react/hooks/useQueryBSMNT.js +5 -2
  69. package/dist/cjs/global-account/react/hooks/useSimBalance.js +2 -2
  70. package/dist/cjs/global-account/react/hooks/useTokenBalancesByChain.js +7 -1
  71. package/dist/cjs/global-account/react/hooks/useTokenFromUrl.js +2 -2
  72. package/dist/cjs/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +28 -24
  73. package/dist/cjs/shared/utils/fetchBalances.d.ts +1 -1
  74. package/dist/esm/anyspend/react/components/AnySpend.d.ts +11 -1
  75. package/dist/esm/anyspend/react/components/AnySpend.js +17 -4
  76. package/dist/esm/anyspend/react/components/AnySpendBondKit.js +0 -1
  77. package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +0 -1
  78. package/dist/esm/anyspend/react/components/AnySpendCustom.d.ts +1 -0
  79. package/dist/esm/anyspend/react/components/AnySpendCustom.js +33 -11
  80. package/dist/esm/anyspend/react/components/AnySpendNFT.d.ts +2 -1
  81. package/dist/esm/anyspend/react/components/AnySpendNFT.js +2 -2
  82. package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +0 -1
  83. package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +8 -0
  84. package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +6 -3
  85. package/dist/esm/anyspend/react/components/AnyspendSignatureMint.js +1 -2
  86. package/dist/esm/anyspend/react/components/common/ConnectWalletPayment.js +6 -4
  87. package/dist/esm/anyspend/react/components/common/CryptoPaySection.d.ts +4 -1
  88. package/dist/esm/anyspend/react/components/common/CryptoPaySection.js +9 -9
  89. package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +80 -10
  90. package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.d.ts +2 -1
  91. package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.js +40 -37
  92. package/dist/esm/anyspend/react/components/common/OrderDetails.js +8 -11
  93. package/dist/esm/anyspend/react/components/common/OrderTokenAmount.d.ts +4 -1
  94. package/dist/esm/anyspend/react/components/common/OrderTokenAmount.js +23 -9
  95. package/dist/esm/anyspend/react/components/common/PanelOnramp.d.ts +4 -1
  96. package/dist/esm/anyspend/react/components/common/PanelOnramp.js +10 -6
  97. package/dist/esm/anyspend/react/components/common/PointsBadge.d.ts +7 -0
  98. package/dist/esm/anyspend/react/components/common/PointsBadge.js +4 -0
  99. package/dist/esm/anyspend/react/components/common/PointsDetailPanel.d.ts +6 -0
  100. package/dist/esm/anyspend/react/components/common/PointsDetailPanel.js +8 -0
  101. package/dist/esm/anyspend/react/contexts/FeatureFlagsContext.d.ts +11 -0
  102. package/dist/esm/anyspend/react/contexts/FeatureFlagsContext.js +17 -0
  103. package/dist/esm/anyspend/react/hooks/useAnyspendFlow.d.ts +4 -1
  104. package/dist/esm/anyspend/react/hooks/useAnyspendFlow.js +18 -8
  105. package/dist/esm/anyspend/react/providers/AnyspendProvider.d.ts +5 -2
  106. package/dist/esm/anyspend/react/providers/AnyspendProvider.js +5 -3
  107. package/dist/esm/anyspend/react/providers/index.d.ts +1 -0
  108. package/dist/esm/anyspend/react/providers/index.js +1 -0
  109. package/dist/esm/anyspend/services/anyspend.d.ts +1 -1
  110. package/dist/esm/anyspend/services/anyspend.js +2 -0
  111. package/dist/esm/anyspend/types/api.d.ts +51 -1
  112. package/dist/esm/anyspend/utils/chain.js +1 -1
  113. package/dist/esm/anyspend/utils/orderPayload.js +3 -0
  114. package/dist/esm/bondkit/bondkitToken.d.ts +37 -2
  115. package/dist/esm/bondkit/bondkitToken.js +268 -2
  116. package/dist/esm/bondkit/bondkitTokenFactory.d.ts +1 -1
  117. package/dist/esm/bondkit/bondkitTokenFactory.js +2 -2
  118. package/dist/esm/bondkit/components/TradingView.js +3 -4
  119. package/dist/esm/bondkit/config.d.ts +1 -1
  120. package/dist/esm/bondkit/config.js +5 -2
  121. package/dist/esm/bondkit/constants.d.ts +4 -0
  122. package/dist/esm/bondkit/constants.js +5 -0
  123. package/dist/esm/bondkit/index.d.ts +1 -0
  124. package/dist/esm/bondkit/index.js +2 -0
  125. package/dist/esm/bondkit/swapService.d.ts +43 -0
  126. package/dist/esm/bondkit/swapService.js +372 -0
  127. package/dist/esm/bondkit/types.d.ts +10 -4
  128. package/dist/esm/bondkit/types.js +4 -5
  129. package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +4 -3
  130. package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +42 -9
  131. package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.js +65 -5
  132. package/dist/esm/global-account/react/components/ManageAccount/ManageAccount.js +35 -2
  133. package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +3 -2
  134. package/dist/esm/global-account/react/hooks/index.d.ts +1 -0
  135. package/dist/esm/global-account/react/hooks/index.js +1 -0
  136. package/dist/esm/global-account/react/hooks/useAccountAssets.js +2 -2
  137. package/dist/esm/global-account/react/hooks/useAuthentication.js +2 -3
  138. package/dist/esm/global-account/react/hooks/useGlobalAccount.d.ts +6 -0
  139. package/dist/esm/global-account/react/hooks/useGlobalAccount.js +29 -0
  140. package/dist/esm/global-account/react/hooks/useQueryB3.js +5 -2
  141. package/dist/esm/global-account/react/hooks/useQueryBSMNT.js +5 -2
  142. package/dist/esm/global-account/react/hooks/useSimBalance.js +2 -2
  143. package/dist/esm/global-account/react/hooks/useTokenBalancesByChain.js +4 -1
  144. package/dist/esm/global-account/react/hooks/useTokenFromUrl.js +2 -2
  145. package/dist/esm/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +29 -25
  146. package/dist/esm/shared/utils/fetchBalances.d.ts +1 -1
  147. package/dist/styles/index.css +1 -1
  148. package/dist/types/anyspend/react/components/AnySpend.d.ts +11 -1
  149. package/dist/types/anyspend/react/components/AnySpendCustom.d.ts +1 -0
  150. package/dist/types/anyspend/react/components/AnySpendNFT.d.ts +2 -1
  151. package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +8 -0
  152. package/dist/types/anyspend/react/components/common/CryptoPaySection.d.ts +4 -1
  153. package/dist/types/anyspend/react/components/common/CryptoReceiveSection.d.ts +2 -1
  154. package/dist/types/anyspend/react/components/common/OrderTokenAmount.d.ts +4 -1
  155. package/dist/types/anyspend/react/components/common/PanelOnramp.d.ts +4 -1
  156. package/dist/types/anyspend/react/components/common/PointsBadge.d.ts +7 -0
  157. package/dist/types/anyspend/react/components/common/PointsDetailPanel.d.ts +6 -0
  158. package/dist/types/anyspend/react/contexts/FeatureFlagsContext.d.ts +11 -0
  159. package/dist/types/anyspend/react/hooks/useAnyspendFlow.d.ts +4 -1
  160. package/dist/types/anyspend/react/providers/AnyspendProvider.d.ts +5 -2
  161. package/dist/types/anyspend/react/providers/index.d.ts +1 -0
  162. package/dist/types/anyspend/services/anyspend.d.ts +1 -1
  163. package/dist/types/anyspend/types/api.d.ts +51 -1
  164. package/dist/types/bondkit/bondkitToken.d.ts +37 -2
  165. package/dist/types/bondkit/bondkitTokenFactory.d.ts +1 -1
  166. package/dist/types/bondkit/config.d.ts +1 -1
  167. package/dist/types/bondkit/constants.d.ts +4 -0
  168. package/dist/types/bondkit/index.d.ts +1 -0
  169. package/dist/types/bondkit/swapService.d.ts +43 -0
  170. package/dist/types/bondkit/types.d.ts +10 -4
  171. package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +4 -3
  172. package/dist/types/global-account/react/hooks/index.d.ts +1 -0
  173. package/dist/types/global-account/react/hooks/useGlobalAccount.d.ts +6 -0
  174. package/dist/types/shared/utils/fetchBalances.d.ts +1 -1
  175. package/package.json +6 -5
  176. package/src/anyspend/react/components/AnySpend.tsx +37 -1
  177. package/src/anyspend/react/components/AnySpendBondKit.tsx +0 -1
  178. package/src/anyspend/react/components/AnySpendBuySpin.tsx +0 -1
  179. package/src/anyspend/react/components/AnySpendCustom.tsx +63 -13
  180. package/src/anyspend/react/components/AnySpendNFT.tsx +3 -0
  181. package/src/anyspend/react/components/AnySpendStakeB3.tsx +0 -1
  182. package/src/anyspend/react/components/AnyspendDepositHype.tsx +22 -0
  183. package/src/anyspend/react/components/AnyspendSignatureMint.tsx +1 -2
  184. package/src/anyspend/react/components/common/ConnectWalletPayment.tsx +7 -4
  185. package/src/anyspend/react/components/common/CryptoPaySection.tsx +13 -8
  186. package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +170 -44
  187. package/src/anyspend/react/components/common/CryptoReceiveSection.tsx +61 -45
  188. package/src/anyspend/react/components/common/OrderDetails.tsx +10 -14
  189. package/src/anyspend/react/components/common/OrderTokenAmount.tsx +28 -8
  190. package/src/anyspend/react/components/common/PanelOnramp.tsx +28 -15
  191. package/src/anyspend/react/components/common/PointsBadge.tsx +20 -0
  192. package/src/anyspend/react/components/common/PointsDetailPanel.tsx +55 -0
  193. package/src/anyspend/react/contexts/FeatureFlagsContext.tsx +34 -0
  194. package/src/anyspend/react/hooks/useAnyspendFlow.ts +18 -8
  195. package/src/anyspend/react/hooks/useAnyspendOrderAndTransactions.ts +1 -1
  196. package/src/anyspend/react/hooks/useCoinbaseOnrampOptions.ts +1 -1
  197. package/src/anyspend/react/providers/AnyspendProvider.tsx +11 -6
  198. package/src/anyspend/react/providers/index.ts +1 -0
  199. package/src/anyspend/services/anyspend.ts +3 -1
  200. package/src/anyspend/types/api.ts +51 -1
  201. package/src/anyspend/types/api_req_res.ts +6 -10
  202. package/src/anyspend/utils/chain.ts +1 -1
  203. package/src/anyspend/utils/orderPayload.ts +3 -0
  204. package/src/bondkit/bondkitToken.ts +323 -3
  205. package/src/bondkit/bondkitTokenFactory.ts +2 -2
  206. package/src/bondkit/components/TradingView.tsx +3 -5
  207. package/src/bondkit/config.ts +5 -2
  208. package/src/bondkit/constants.ts +7 -0
  209. package/src/bondkit/index.ts +3 -0
  210. package/src/bondkit/swapService.ts +464 -0
  211. package/src/bondkit/types.ts +12 -5
  212. package/src/global-account/react/components/B3Provider/B3Provider.tsx +55 -15
  213. package/src/global-account/react/components/LinkAccount/LinkAccount.tsx +106 -32
  214. package/src/global-account/react/components/ManageAccount/ManageAccount.tsx +60 -5
  215. package/src/global-account/react/components/SignInWithB3/steps/LoginStepCustom.tsx +4 -2
  216. package/src/global-account/react/hooks/index.ts +1 -0
  217. package/src/global-account/react/hooks/useAccountAssets.ts +4 -3
  218. package/src/global-account/react/hooks/useAuthentication.ts +2 -3
  219. package/src/global-account/react/hooks/useGlobalAccount.tsx +36 -0
  220. package/src/global-account/react/hooks/useOneBalance.tsx +1 -1
  221. package/src/global-account/react/hooks/useQueryB3.ts +22 -15
  222. package/src/global-account/react/hooks/useQueryBSMNT.ts +22 -15
  223. package/src/global-account/react/hooks/useSimBalance.ts +2 -2
  224. package/src/global-account/react/hooks/useTokenBalancesByChain.tsx +4 -1
  225. package/src/global-account/react/hooks/useTokenFromUrl.tsx +2 -2
  226. package/src/global-account/react/hooks/useUnifiedChainSwitchAndExecute.ts +30 -26
  227. package/src/shared/utils/fetchBalances.ts +1 -1
@@ -1,3 +1,4 @@
1
+ import { components } from "../../types/api";
1
2
  export interface RecipientOption {
2
3
  address: string;
3
4
  icon?: string;
@@ -12,7 +13,8 @@ export declare enum PanelView {
12
13
  FIAT_PAYMENT = 4,
13
14
  RECIPIENT_SELECTION = 5,
14
15
  CRYPTO_PAYMENT_METHOD = 6,
15
- FIAT_PAYMENT_METHOD = 7
16
+ FIAT_PAYMENT_METHOD = 7,
17
+ POINTS_DETAIL = 8
16
18
  }
17
19
  export declare function AnySpend(props: {
18
20
  mode?: "page" | "modal";
@@ -22,4 +24,12 @@ export declare function AnySpend(props: {
22
24
  recipientAddress?: string;
23
25
  loadOrder?: string;
24
26
  hideTransactionHistoryButton?: boolean;
27
+ /**
28
+ * Called when a token is selected. Call event.preventDefault() to prevent default token selection behavior.
29
+ * Useful for handling special cases like B3 token selection.
30
+ */
31
+ onTokenSelect?: (token: components["schemas"]["Token"], event: {
32
+ preventDefault: () => void;
33
+ }) => void;
34
+ onSuccess?: (txHash?: string) => void;
25
35
  }): import("react/jsx-runtime").JSX.Element;
@@ -29,6 +29,7 @@ const OrderDetails_1 = require("./common/OrderDetails");
29
29
  const OrderHistory_1 = require("./common/OrderHistory");
30
30
  const PanelOnramp_1 = require("./common/PanelOnramp");
31
31
  const PanelOnrampPayment_1 = require("./common/PanelOnrampPayment");
32
+ const PointsDetailPanel_1 = require("./common/PointsDetailPanel");
32
33
  const RecipientSelection_1 = require("./common/RecipientSelection");
33
34
  const TabSection_1 = require("./common/TabSection");
34
35
  var PanelView;
@@ -41,13 +42,14 @@ var PanelView;
41
42
  PanelView[PanelView["RECIPIENT_SELECTION"] = 5] = "RECIPIENT_SELECTION";
42
43
  PanelView[PanelView["CRYPTO_PAYMENT_METHOD"] = 6] = "CRYPTO_PAYMENT_METHOD";
43
44
  PanelView[PanelView["FIAT_PAYMENT_METHOD"] = 7] = "FIAT_PAYMENT_METHOD";
45
+ PanelView[PanelView["POINTS_DETAIL"] = 8] = "POINTS_DETAIL";
44
46
  })(PanelView || (exports.PanelView = PanelView = {}));
45
47
  const ANYSPEND_RECIPIENTS_KEY = "anyspend_recipients";
46
48
  function AnySpend(props) {
47
49
  const fingerprintConfig = (0, AnySpendFingerprintWrapper_1.getFingerprintConfig)();
48
50
  return ((0, jsx_runtime_1.jsx)(AnySpendFingerprintWrapper_1.AnySpendFingerprintWrapper, { fingerprint: fingerprintConfig, children: (0, jsx_runtime_1.jsx)(AnySpendInner, { ...props }) }));
49
51
  }
50
- function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode = "modal", defaultActiveTab = "crypto", loadOrder, hideTransactionHistoryButton, recipientAddress: recipientAddressFromProps, }) {
52
+ function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode = "modal", defaultActiveTab = "crypto", loadOrder, hideTransactionHistoryButton, recipientAddress: recipientAddressFromProps, onTokenSelect, onSuccess, }) {
51
53
  const searchParams = (0, react_2.useSearchParamsSSR)();
52
54
  const router = (0, react_2.useRouter)();
53
55
  // Determine if we're in "buy mode" based on whether destination token props are provided
@@ -326,8 +328,9 @@ function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode
326
328
  srcTokenAddress: selectedSrcToken.address,
327
329
  dstTokenAddress: isBuyMode ? destinationTokenAddress : selectedDstToken.address,
328
330
  type: "swap",
329
- tradeType: isSrcInputDirty ? "EXACT_INPUT" : "EXPECTED_OUTPUT",
331
+ tradeType: isSrcInputDirty ? "EXACT_INPUT" : "EXACT_OUTPUT",
330
332
  amount: activeInputAmountInWei,
333
+ recipientAddress,
331
334
  }
332
335
  : {
333
336
  srcChain: chains_1.base.id,
@@ -337,6 +340,7 @@ function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode
337
340
  type: "swap",
338
341
  tradeType: "EXACT_INPUT",
339
342
  amount: srcAmountOnrampInWei,
343
+ recipientAddress,
340
344
  onrampVendor: getOnrampVendor(selectedFiatPaymentMethod),
341
345
  });
342
346
  // Load custom recipients from local storage on mount
@@ -389,6 +393,13 @@ function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode
389
393
  }
390
394
  }
391
395
  }, [anyspendQuote, isSrcInputDirty]);
396
+ (0, react_4.useEffect)(() => {
397
+ if (oat?.data?.order.status === "executed") {
398
+ console.log("Calling onSuccess");
399
+ const txHash = oat?.data?.executeTx?.txHash;
400
+ onSuccess?.(txHash);
401
+ }
402
+ }, [oat?.data?.executeTx?.txHash, oat?.data?.order.status, onSuccess]);
392
403
  const { createOrder, isCreatingOrder } = (0, react_1.useAnyspendCreateOrder)({
393
404
  onSuccess: data => {
394
405
  const orderId = data.data.id;
@@ -663,7 +674,7 @@ function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode
663
674
  setActivePanel(PanelView.MAIN);
664
675
  setSelectedCryptoPaymentMethod(CryptoPaymentMethod_1.CryptoPaymentMethodType.NONE); // Reset payment method when going back
665
676
  } })) }) }));
666
- const mainView = ((0, jsx_runtime_1.jsxs)("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-2", children: [isBuyMode && ((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: setActiveTab, setSelectedCryptoPaymentMethod: setSelectedCryptoPaymentMethod, setSelectedFiatPaymentMethod: setSelectedFiatPaymentMethod }), (0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2", children: [activeTab === "crypto" ? ((0, jsx_runtime_1.jsx)(CryptoPaySection_1.CryptoPaySection, { selectedSrcChainId: selectedSrcChainId, setSelectedSrcChainId: setSelectedSrcChainId, selectedSrcToken: selectedSrcToken, setSelectedSrcToken: setSelectedSrcToken, srcAmount: srcAmount, setSrcAmount: setSrcAmount, setIsSrcInputDirty: setIsSrcInputDirty, selectedCryptoPaymentMethod: selectedCryptoPaymentMethod, onSelectCryptoPaymentMethod: () => setActivePanel(PanelView.CRYPTO_PAYMENT_METHOD), anyspendQuote: anyspendQuote })) : ((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: srcAmountOnRamp, setSrcAmountOnRamp: setSrcAmountOnRamp, selectedPaymentMethod: selectedFiatPaymentMethod, setActivePanel: setActivePanel, _recipientAddress: recipientAddress, destinationToken: selectedDstToken, destinationChainId: selectedDstChainId, destinationAmount: dstAmount, onDestinationTokenChange: setSelectedDstToken, onDestinationChainChange: setSelectedDstChainId, fiatPaymentMethodIndex: PanelView.FIAT_PAYMENT_METHOD, recipientSelectionPanelIndex: PanelView.RECIPIENT_SELECTION, hideDstToken: isBuyMode }) })), (0, jsx_runtime_1.jsx)(react_2.Button, { variant: "ghost", className: (0, cn_1.cn)("border-as-stroke bg-as-surface-primary absolute left-1/2 top-1/2 z-10 h-10 w-10 -translate-x-1/2 -translate-y-1/2 rounded-xl border-2 sm:h-8 sm:w-8 sm:rounded-xl", isBuyMode && "top-[calc(50%+56px)] cursor-default", activeTab === "fiat" && "hidden"), onClick: () => {
677
+ const mainView = ((0, jsx_runtime_1.jsxs)("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-2", children: [isBuyMode && ((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: setActiveTab, setSelectedCryptoPaymentMethod: setSelectedCryptoPaymentMethod, setSelectedFiatPaymentMethod: setSelectedFiatPaymentMethod }), (0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2", children: [activeTab === "crypto" ? ((0, jsx_runtime_1.jsx)(CryptoPaySection_1.CryptoPaySection, { selectedSrcChainId: selectedSrcChainId, setSelectedSrcChainId: setSelectedSrcChainId, selectedSrcToken: selectedSrcToken, setSelectedSrcToken: setSelectedSrcToken, srcAmount: srcAmount, setSrcAmount: setSrcAmount, setIsSrcInputDirty: setIsSrcInputDirty, selectedCryptoPaymentMethod: selectedCryptoPaymentMethod, onSelectCryptoPaymentMethod: () => setActivePanel(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: srcAmountOnRamp, setSrcAmountOnRamp: setSrcAmountOnRamp, selectedPaymentMethod: selectedFiatPaymentMethod, setActivePanel: setActivePanel, _recipientAddress: recipientAddress, destinationToken: selectedDstToken, destinationChainId: selectedDstChainId, destinationAmount: dstAmount, onDestinationTokenChange: setSelectedDstToken, onDestinationChainChange: setSelectedDstChainId, fiatPaymentMethodIndex: PanelView.FIAT_PAYMENT_METHOD, recipientSelectionPanelIndex: PanelView.RECIPIENT_SELECTION, hideDstToken: isBuyMode, anyspendQuote: anyspendQuote, onShowPointsDetail: () => setActivePanel(PanelView.POINTS_DETAIL) }) })), (0, jsx_runtime_1.jsx)(react_2.Button, { variant: "ghost", className: (0, cn_1.cn)("border-as-stroke bg-as-surface-primary absolute left-1/2 top-1/2 z-10 h-10 w-10 -translate-x-1/2 -translate-y-1/2 rounded-xl border-2 sm:h-8 sm:w-8 sm:rounded-xl", isBuyMode && "top-[calc(50%+56px)] cursor-default", activeTab === "fiat" && "hidden"), onClick: () => {
667
678
  if (activeTab === "fiat" || isBuyMode) {
668
679
  return;
669
680
  }
@@ -685,7 +696,7 @@ function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode
685
696
  }, 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, selectedRecipientAddress: recipientAddress, recipientName: recipientName || undefined, onSelectRecipient: () => setActivePanel(PanelView.RECIPIENT_SELECTION), dstAmount: dstAmount, dstToken: selectedDstToken, selectedDstChainId: selectedDstChainId, setSelectedDstChainId: setSelectedDstChainId, setSelectedDstToken: setSelectedDstToken, onChangeDstAmount: value => {
686
697
  setIsSrcInputDirty(false);
687
698
  setDstAmount(value);
688
- }, anyspendQuote: anyspendQuote }))] }), (0, jsx_runtime_1.jsx)(ErrorSection_1.ErrorSection, { error: getAnyspendQuoteError }), (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", getAnyspendQuoteError && "mt-0"), 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: btnInfo.text }), !hideTransactionHistoryButton && (globalAddress || recipientAddress) ? ((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] })] }));
699
+ }, anyspendQuote: anyspendQuote, onShowPointsDetail: () => setActivePanel(PanelView.POINTS_DETAIL) }))] }), (0, jsx_runtime_1.jsx)(ErrorSection_1.ErrorSection, { error: getAnyspendQuoteError }), (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", getAnyspendQuoteError && "mt-0"), 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: btnInfo.text }), !hideTransactionHistoryButton && (globalAddress || recipientAddress) ? ((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] })] }));
689
700
  const onrampPaymentView = ((0, jsx_runtime_1.jsx)(PanelOnrampPayment_1.PanelOnrampPayment, { srcAmountOnRamp: srcAmountOnRamp, recipientName: recipientName || undefined, recipientAddress: recipientAddress, isBuyMode: isBuyMode, destinationTokenChainId: destinationTokenChainId, destinationTokenAddress: destinationTokenAddress, selectedDstChainId: selectedDstChainId, selectedDstToken: selectedDstToken, orderType: "swap", anyspendQuote: anyspendQuote, globalAddress: globalAddress, onOrderCreated: orderId => {
690
701
  setOrderId(orderId);
691
702
  setActivePanel(PanelView.ORDER_DETAILS);
@@ -713,6 +724,7 @@ function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode
713
724
  setSelectedFiatPaymentMethod(method);
714
725
  setActivePanel(PanelView.MAIN); // Go back to main panel to show updated pricing
715
726
  }, srcAmountOnRamp: srcAmountOnRamp }));
727
+ const pointsDetailView = ((0, jsx_runtime_1.jsx)(PointsDetailPanel_1.PointsDetailPanel, { pointsAmount: anyspendQuote?.data?.pointsAmount || 0, onBack: () => setActivePanel(PanelView.MAIN) }));
716
728
  // Add tabs to the main component when no order is loaded
717
729
  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" &&
718
730
  "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
@@ -736,5 +748,6 @@ function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode
736
748
  (0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)(mode === "page" && "p-6"), children: recipientSelectionView }, "recipient-selection-view"),
737
749
  (0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)(mode === "page" && "p-6"), children: cryptoPaymentMethodView }, "crypto-payment-method-view"),
738
750
  (0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)(mode === "page" && "p-6"), children: fiatPaymentMethodView }, "fiat-payment-method-view"),
751
+ (0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)(mode === "page" && "p-6"), children: pointsDetailView }, "points-detail-view"),
739
752
  ] }) }) }));
740
753
  }
@@ -202,7 +202,6 @@ function AnySpendBondKit({ mode = "modal", recipientAddress, contractAddress, mi
202
202
  args: [recipientAddress, (0, viem_1.parseEther)(b3Amount), BigInt(minTokensOut)],
203
203
  });
204
204
  return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.AnySpendCustom, { mode: mode, recipientAddress: recipientAddress, orderType: "custom", dstChainId: supported_1.baseMainnet.id, dstToken: dstToken, dstAmount: (0, viem_1.parseEther)(b3Amount).toString(), contractAddress: contractAddress, encodedData: encodedData, metadata: {
205
- type: "custom",
206
205
  action: "BondKit Buy",
207
206
  }, header: header, onSuccess: onSuccess, showRecipient: true }));
208
207
  }
@@ -396,7 +396,6 @@ function AnySpendBuySpin({ loadOrder, mode = "modal", spinwheelContractAddress,
396
396
  // AnySpend flow for when user needs to swap to B3
397
397
  const encodedData = generateEncodedDataForBuyEntriesAndSpin(address || "", userSpinQuantity);
398
398
  return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.AnySpendCustom, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, orderType: "custom", dstChainId: chainId, dstToken: anyspend_1.B3_TOKEN, dstAmount: totalCost.toString(), contractAddress: spinwheelContractAddress, spenderAddress: paymentConfig.entryModule, encodedData: encodedData, metadata: {
399
- type: "custom",
400
399
  action: `buy ${userSpinQuantity} spin${userSpinQuantity !== "1" ? "s" : ""}`,
401
400
  }, header: header, onSuccess: txHash => onSuccess?.(txHash), showRecipient: false }));
402
401
  }
@@ -20,4 +20,5 @@ export declare function AnySpendCustom(props: {
20
20
  }) => React.JSX.Element;
21
21
  onSuccess?: (txHash?: string) => void;
22
22
  showRecipient?: boolean;
23
+ onShowPointsDetail?: () => void;
23
24
  }): import("react/jsx-runtime").JSX.Element;
@@ -19,12 +19,15 @@ const react_3 = require("motion/react");
19
19
  const react_4 = require("react");
20
20
  const sonner_1 = require("sonner");
21
21
  const chains_1 = require("viem/chains");
22
+ const FeatureFlagsContext_1 = require("../contexts/FeatureFlagsContext");
22
23
  const AnySpendFingerprintWrapper_1 = require("./AnySpendFingerprintWrapper");
23
24
  const CryptoPaymentMethod_1 = require("./common/CryptoPaymentMethod");
24
25
  const FiatPaymentMethod_1 = require("./common/FiatPaymentMethod");
25
26
  const OrderDetails_1 = require("./common/OrderDetails");
26
27
  const OrderHistory_1 = require("./common/OrderHistory");
27
28
  const OrderToken_1 = require("./common/OrderToken");
29
+ const PointsBadge_1 = require("./common/PointsBadge");
30
+ const PointsDetailPanel_1 = require("./common/PointsDetailPanel");
28
31
  const RecipientSelection_1 = require("./common/RecipientSelection");
29
32
  var PanelView;
30
33
  (function (PanelView) {
@@ -35,8 +38,9 @@ var PanelView;
35
38
  PanelView[PanelView["RECIPIENT_SELECTION"] = 4] = "RECIPIENT_SELECTION";
36
39
  PanelView[PanelView["CRYPTO_PAYMENT_METHOD"] = 5] = "CRYPTO_PAYMENT_METHOD";
37
40
  PanelView[PanelView["FIAT_PAYMENT_METHOD"] = 6] = "FIAT_PAYMENT_METHOD";
41
+ PanelView[PanelView["POINTS_DETAIL"] = 7] = "POINTS_DETAIL";
38
42
  })(PanelView || (PanelView = {}));
39
- function generateGetRelayQuoteRequest({ orderType, srcChainId, srcToken, dstChainId, dstToken, dstAmount, contractAddress, tokenId, contractType, encodedData, spenderAddress, }) {
43
+ function generateGetRelayQuoteRequest({ orderType, srcChainId, srcToken, dstChainId, dstToken, recipientAddress, dstAmount, contractAddress, tokenId, contractType, encodedData, spenderAddress, }) {
40
44
  switch (orderType) {
41
45
  case "mint_nft": {
42
46
  (0, invariant_1.default)(contractType, "Contract type is required");
@@ -46,6 +50,7 @@ function generateGetRelayQuoteRequest({ orderType, srcChainId, srcToken, dstChai
46
50
  srcTokenAddress: srcToken.address,
47
51
  dstChain: dstChainId,
48
52
  dstTokenAddress: dstToken.address,
53
+ recipientAddress,
49
54
  price: dstAmount,
50
55
  contractAddress: contractAddress,
51
56
  tokenId: tokenId,
@@ -59,6 +64,7 @@ function generateGetRelayQuoteRequest({ orderType, srcChainId, srcToken, dstChai
59
64
  srcTokenAddress: srcToken.address,
60
65
  dstChain: dstChainId,
61
66
  dstTokenAddress: dstToken.address,
67
+ recipientAddress,
62
68
  price: dstAmount,
63
69
  contractAddress: contractAddress,
64
70
  };
@@ -70,6 +76,7 @@ function generateGetRelayQuoteRequest({ orderType, srcChainId, srcToken, dstChai
70
76
  srcTokenAddress: srcToken.address,
71
77
  dstChain: dstChainId,
72
78
  dstTokenAddress: dstToken.address,
79
+ recipientAddress,
73
80
  fundAmount: dstAmount,
74
81
  contractAddress: contractAddress,
75
82
  };
@@ -81,6 +88,7 @@ function generateGetRelayQuoteRequest({ orderType, srcChainId, srcToken, dstChai
81
88
  srcTokenAddress: srcToken.address,
82
89
  dstChain: dstChainId,
83
90
  dstTokenAddress: dstToken.address,
91
+ recipientAddress,
84
92
  payload: {
85
93
  amount: dstAmount,
86
94
  data: encodedData,
@@ -98,8 +106,9 @@ function AnySpendCustom(props) {
98
106
  const fingerprintConfig = (0, AnySpendFingerprintWrapper_1.getFingerprintConfig)();
99
107
  return ((0, jsx_runtime_1.jsx)(AnySpendFingerprintWrapper_1.AnySpendFingerprintWrapper, { fingerprint: fingerprintConfig, children: (0, jsx_runtime_1.jsx)(AnySpendCustomInner, { ...props }) }));
100
108
  }
101
- function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabProps = "crypto", recipientAddress: recipientAddressProps, spenderAddress, orderType, dstChainId, dstToken, dstAmount, contractAddress, encodedData, metadata, header, onSuccess, showRecipient = true, }) {
109
+ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabProps = "crypto", recipientAddress: recipientAddressProps, spenderAddress, orderType, dstChainId, dstToken, dstAmount, contractAddress, encodedData, metadata, header, onSuccess, showRecipient = true, onShowPointsDetail, }) {
102
110
  const hasMounted = (0, react_2.useHasMounted)();
111
+ const featureFlags = (0, FeatureFlagsContext_1.useFeatureFlags)();
103
112
  const searchParams = (0, react_2.useSearchParamsSSR)();
104
113
  const router = (0, react_2.useRouter)();
105
114
  const [activePanel, setActivePanel] = (0, react_4.useState)(loadOrder ? PanelView.ORDER_DETAILS : PanelView.CONFIRM_ORDER);
@@ -174,10 +183,11 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
174
183
  srcToken: activeTab === "fiat" ? constants_1.USDC_BASE : srcToken,
175
184
  dstChainId: dstChainId,
176
185
  dstToken: dstToken,
186
+ recipientAddress,
177
187
  dstAmount: dstAmount,
178
188
  contractAddress: contractAddress,
179
- tokenId: metadata.type === "mint_nft" ? metadata.nftContract.tokenId : undefined,
180
- contractType: metadata.type === "mint_nft" ? metadata.nftContract.type : undefined,
189
+ tokenId: orderType === "mint_nft" ? metadata?.nftContract?.tokenId : undefined,
190
+ contractType: orderType === "mint_nft" ? metadata?.nftContract?.type : undefined,
181
191
  encodedData: encodedData,
182
192
  spenderAddress: spenderAddress,
183
193
  });
@@ -190,8 +200,8 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
190
200
  encodedData,
191
201
  metadata?.nftContract?.tokenId,
192
202
  metadata?.nftContract?.type,
193
- metadata?.type,
194
203
  orderType,
204
+ recipientAddress,
195
205
  spenderAddress,
196
206
  srcChainId,
197
207
  srcToken,
@@ -267,7 +277,7 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
267
277
  srcAmount: srcAmount.toString(),
268
278
  recipientAddress,
269
279
  creatorAddress: currentWallet?.wallet?.address,
270
- nft: metadata.type === "mint_nft"
280
+ nft: orderType === "mint_nft"
271
281
  ? metadata.nftContract.type === "erc1155"
272
282
  ? {
273
283
  type: "erc1155",
@@ -288,7 +298,7 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
288
298
  imageUrl: metadata.nftContract.imageUrl,
289
299
  }
290
300
  : undefined,
291
- tournament: metadata.type === "join_tournament" || metadata.type === "fund_tournament"
301
+ tournament: orderType === "join_tournament" || orderType === "fund_tournament"
292
302
  ? {
293
303
  ...metadata.tournament,
294
304
  contractAddress: contractAddress,
@@ -296,13 +306,12 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
296
306
  }
297
307
  : undefined,
298
308
  // only populate payload for custom tx
299
- payload: metadata.type === "custom"
309
+ payload: orderType === "custom"
300
310
  ? {
301
311
  amount: dstAmount,
302
312
  data: encodedData,
303
313
  spenderAddress: spenderAddress,
304
314
  to: contractAddress,
305
- action: metadata.action,
306
315
  }
307
316
  : undefined,
308
317
  };
@@ -427,6 +436,16 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
427
436
  router.push(`${window.location.pathname}?${params.toString()}`);
428
437
  } })), mode === "page" && (0, jsx_runtime_1.jsx)("div", { className: "h-12" })] }));
429
438
  const loadingView = ((0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.cn)("mx-auto flex w-full flex-col items-center gap-4 p-5", mode === "modal" && "bg-b3-react-background"), children: [(0, jsx_runtime_1.jsxs)(react_2.Badge, { variant: "default", className: "bg-b3-react-muted/30 border-b3-react-border hover:bg-b3-react-muted/50 flex items-center gap-3 px-4 py-1 text-base transition-all", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "text-b3-react-foreground size-4 animate-spin" }), (0, jsx_runtime_1.jsx)(react_2.TextShimmer, { duration: 1, className: "font-sf-rounded text-base font-semibold", children: "Loading..." })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex w-full flex-1 flex-col", children: [(0, jsx_runtime_1.jsxs)("div", { className: "mb-4 flex flex-col gap-1", children: [(0, jsx_runtime_1.jsx)(react_2.Skeleton, { className: "h-4 w-24" }), (0, jsx_runtime_1.jsxs)("div", { className: "mt-2 flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)(react_2.Skeleton, { className: "h-8 w-48" }), (0, jsx_runtime_1.jsx)(react_2.Skeleton, { className: "ml-4 h-8 w-32" })] }), (0, jsx_runtime_1.jsx)(react_2.Skeleton, { className: "mt-4 h-8 w-24" })] }), (0, jsx_runtime_1.jsx)(react_2.Skeleton, { className: "mb-4 h-12 w-full" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex w-full items-center justify-between gap-4", children: [(0, jsx_runtime_1.jsxs)(react_2.Skeleton, { className: "rounded-lg bg-white/5 p-6 pb-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "size-[200px]" }), (0, jsx_runtime_1.jsx)("div", { className: "mt-3 flex items-center justify-center gap-2", children: (0, jsx_runtime_1.jsx)("div", { className: "size-5 rounded-full" }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex flex-1 flex-col gap-2", children: [1, 2, 3].map(i => ((0, jsx_runtime_1.jsx)(react_2.Skeleton, { className: "h-10 w-full" }, i))) })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-b3-react-muted/30 mt-8 w-full rounded-lg p-4", children: [(0, jsx_runtime_1.jsx)(react_2.Skeleton, { className: "mb-3 h-4 w-48" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)(react_2.Skeleton, { className: "h-10 flex-1" }), (0, jsx_runtime_1.jsx)(react_2.Skeleton, { className: "h-10 flex-1" })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex w-full flex-col gap-3", children: [1, 2, 3, 4, 5].map(i => ((0, jsx_runtime_1.jsxs)("div", { className: "flex w-full justify-between", children: [(0, jsx_runtime_1.jsx)(react_2.Skeleton, { className: "h-4 w-24" }), (0, jsx_runtime_1.jsx)(react_2.Skeleton, { className: "h-4 w-32" })] }, i))) }), (0, jsx_runtime_1.jsx)(react_2.Skeleton, { className: "h-10 w-full" }), mode === "page" && (0, jsx_runtime_1.jsx)("div", { className: "h-12" })] }));
439
+ // Render points badge if conditions are met
440
+ const renderPointsBadge = () => {
441
+ if (featureFlags.showPoints && anyspendQuote?.data?.pointsAmount && anyspendQuote.data.pointsAmount > 0) {
442
+ return ((0, jsx_runtime_1.jsx)(PointsBadge_1.PointsBadge, { pointsAmount: anyspendQuote.data.pointsAmount, pointsMultiplier: anyspendQuote.data.pointsMultiplier, onClick: () => {
443
+ onShowPointsDetail?.();
444
+ setActivePanel(PanelView.POINTS_DETAIL);
445
+ } }));
446
+ }
447
+ return null;
448
+ };
430
449
  // Confirm order view.
431
450
  const confirmOrderView = ((0, jsx_runtime_1.jsxs)("div", { className: "relative mx-auto flex w-full flex-col items-center", children: [header({ anyspendPrice: anyspendQuote, isLoadingAnyspendPrice: isLoadingAnyspendQuote }), (0, jsx_runtime_1.jsxs)(react_2.Tabs, { value: activeTab, onValueChange: value => setActiveTab(value), className: "bg-b3-react-background max-h-[60dvh] w-full overflow-y-auto p-5", children: [(0, jsx_runtime_1.jsx)("div", { className: "w-full", children: (0, jsx_runtime_1.jsxs)("div", { className: "bg-as-surface-secondary relative mb-4 grid h-10 grid-cols-2 rounded-xl", children: [(0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("bg-as-brand absolute bottom-0 left-0 top-0 z-0 rounded-xl transition-transform duration-100", "h-full w-1/2", activeTab === "fiat" ? "translate-x-full" : "translate-x-0"), style: { willChange: "transform" } }), (0, jsx_runtime_1.jsx)("button", { className: (0, utils_1.cn)("relative z-10 h-full w-full rounded-xl px-3 text-sm font-medium transition-colors duration-100", activeTab === "crypto" ? "text-white" : "text-as-primary/70 hover:bg-as-on-surface-2 bg-transparent"), onClick: () => {
432
451
  setActiveTab("crypto");
@@ -451,7 +470,7 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
451
470
  opacity: hasMounted ? 1 : 0,
452
471
  y: hasMounted ? 0 : 20,
453
472
  filter: hasMounted ? "blur(0px)" : "blur(10px)",
454
- }, transition: { duration: 0.3, delay: 0.1, ease: "easeInOut" }, className: "relative flex w-full items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-as-tertiarry text-sm", children: ["Total ", (0, jsx_runtime_1.jsx)("span", { className: "text-as-tertiarry", children: "(with fee)" })] }), (0, jsx_runtime_1.jsxs)("span", { className: "text-as-primary font-semibold", children: [formattedSrcAmount || "--", " ", srcToken.symbol] })] })] })] }), (0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("flex w-full flex-col items-center justify-between gap-2"), children: (0, jsx_runtime_1.jsx)(react_3.motion.div, { initial: false, animate: {
473
+ }, transition: { duration: 0.3, delay: 0.1, ease: "easeInOut" }, className: "relative flex w-full items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-as-tertiarry text-sm", children: ["Total ", (0, jsx_runtime_1.jsx)("span", { className: "text-as-tertiarry", children: "(with fee)" })] }), renderPointsBadge()] }), (0, jsx_runtime_1.jsxs)("span", { className: "text-as-primary font-semibold", children: [formattedSrcAmount || "--", " ", srcToken.symbol] })] })] })] }), (0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("flex w-full flex-col items-center justify-between gap-2"), children: (0, jsx_runtime_1.jsx)(react_3.motion.div, { initial: false, animate: {
455
474
  opacity: hasMounted ? 1 : 0,
456
475
  y: hasMounted ? 0 : 20,
457
476
  filter: hasMounted ? "blur(0px)" : "blur(10px)",
@@ -463,7 +482,7 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
463
482
  opacity: hasMounted ? 1 : 0,
464
483
  y: hasMounted ? 0 : 20,
465
484
  filter: hasMounted ? "blur(0px)" : "blur(10px)",
466
- }, transition: { duration: 0.3, delay: 0.1, ease: "easeInOut" }, className: "relative flex w-full items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-as-tertiarry text-sm", children: ["Total ", (0, jsx_runtime_1.jsx)("span", { className: "text-as-tertiarry", children: "(USD)" })] }), (0, jsx_runtime_1.jsxs)("span", { className: "text-as-primary text-xl font-semibold", children: ["$", srcFiatAmount || "0.00"] })] })] }), (0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("flex w-full flex-col items-center justify-between gap-2"), children: (0, jsx_runtime_1.jsx)(react_3.motion.div, { initial: false, animate: {
485
+ }, transition: { duration: 0.3, delay: 0.1, ease: "easeInOut" }, className: "relative flex w-full items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-as-tertiarry text-sm", children: ["Total ", (0, jsx_runtime_1.jsx)("span", { className: "text-as-tertiarry", children: "(USD)" })] }), renderPointsBadge()] }), (0, jsx_runtime_1.jsxs)("span", { className: "text-as-primary text-xl font-semibold", children: ["$", srcFiatAmount || "0.00"] })] })] }), (0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("flex w-full flex-col items-center justify-between gap-2"), children: (0, jsx_runtime_1.jsx)(react_3.motion.div, { initial: false, animate: {
467
486
  opacity: hasMounted ? 1 : 0,
468
487
  y: hasMounted ? 0 : 20,
469
488
  filter: hasMounted ? "blur(0px)" : "blur(10px)",
@@ -490,6 +509,8 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
490
509
  setSelectedFiatPaymentMethod(method);
491
510
  setActivePanel(PanelView.CONFIRM_ORDER);
492
511
  }, srcAmountOnRamp: srcFiatAmount }) }));
512
+ // Points detail view
513
+ const pointsDetailView = ((0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("bg-as-surface-primary mx-auto w-[460px] max-w-full rounded-xl p-4"), children: (0, jsx_runtime_1.jsx)(PointsDetailPanel_1.PointsDetailPanel, { pointsAmount: anyspendQuote?.data?.pointsAmount || 0, onBack: () => setActivePanel(PanelView.CONFIRM_ORDER) }) }));
493
514
  // Return the TransitionPanel with all views
494
515
  return ((0, jsx_runtime_1.jsx)(react_2.StyleRoot, { children: (0, jsx_runtime_1.jsx)(react_2.TransitionPanel, { activeIndex: orderId
495
516
  ? oat
@@ -509,5 +530,6 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
509
530
  (0, jsx_runtime_1.jsx)("div", { className: "w-full", children: recipientSelectionView }, "recipient-selection-view"),
510
531
  (0, jsx_runtime_1.jsx)("div", { className: "w-full", children: cryptoPaymentMethodView }, "crypto-payment-method-view"),
511
532
  (0, jsx_runtime_1.jsx)("div", { className: "w-full", children: fiatPaymentMethodView }, "fiat-payment-method-view"),
533
+ (0, jsx_runtime_1.jsx)("div", { className: "w-full", children: pointsDetailView }, "points-detail-view"),
512
534
  ] }) }));
513
535
  }
@@ -1,8 +1,9 @@
1
1
  import { components } from "../../../anyspend/types/api";
2
- export declare function AnySpendNFT({ loadOrder, mode, recipientAddress, nftContract, onSuccess, }: {
2
+ export declare function AnySpendNFT({ loadOrder, mode, recipientAddress, nftContract, onSuccess, onShowPointsDetail, }: {
3
3
  loadOrder?: string;
4
4
  mode?: "modal" | "page";
5
5
  recipientAddress?: string;
6
6
  nftContract: components["schemas"]["NftContract"];
7
7
  onSuccess?: (txHash?: string) => void;
8
+ onShowPointsDetail?: () => void;
8
9
  }): import("react/jsx-runtime").JSX.Element;
@@ -29,7 +29,7 @@ const CONTRACT_URI_ABI = [
29
29
  type: "function",
30
30
  },
31
31
  ];
32
- function AnySpendNFT({ loadOrder, mode = "modal", recipientAddress, nftContract, onSuccess, }) {
32
+ function AnySpendNFT({ loadOrder, mode = "modal", recipientAddress, nftContract, onSuccess, onShowPointsDetail, }) {
33
33
  const [imageUrlWithFallback, setFallbackImageUrl] = (0, react_3.useState)(nftContract.imageUrl);
34
34
  const [isLoadingFallback, setIsLoadingFallback] = (0, react_3.useState)(false);
35
35
  // Fetch contract metadata when imageUrl is empty
@@ -89,7 +89,7 @@ function AnySpendNFT({ loadOrder, mode = "modal", recipientAddress, nftContract,
89
89
  return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.AnySpendCustom, { loadOrder: loadOrder, mode: mode, activeTab: "fiat", recipientAddress: recipientAddress, orderType: "mint_nft", dstChainId: nftContract.chainId, dstToken: nftContract.currency, dstAmount: nftContract.price, contractAddress: nftContract.contractAddress, encodedData: "0x", metadata: {
90
90
  type: "mint_nft",
91
91
  nftContract: nftContract,
92
- }, header: header, onSuccess: onSuccess }));
92
+ }, header: header, onSuccess: onSuccess, onShowPointsDetail: onShowPointsDetail }));
93
93
  }
94
94
  function DropdownMenu({ nftContract }) {
95
95
  const [open, setOpen] = (0, react_3.useState)(false);
@@ -264,7 +264,6 @@ function AnySpendStakeB3({ loadOrder, mode = "modal", recipientAddress, stakeAmo
264
264
  }
265
265
  const encodedData = generateEncodedDataForStakingB3(userStakeAmount, recipientAddress);
266
266
  return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.AnySpendCustom, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, orderType: "custom", dstChainId: chains_1.base.id, dstToken: anyspend_1.B3_TOKEN, dstAmount: userStakeAmount, contractAddress: ERC20Staking, encodedData: encodedData, metadata: {
267
- type: "custom",
268
267
  action: "stake B3",
269
268
  }, header: header, onSuccess: onSuccess, showRecipient: true }));
270
269
  }
@@ -1,3 +1,4 @@
1
+ import { components } from "../../../anyspend/types/api";
1
2
  export declare const HYPE_TOKEN_DETAILS: {
2
3
  SYMBOL: string;
3
4
  LOGO_URI: string;
@@ -11,5 +12,12 @@ export interface AnySpendDepositHypeProps {
11
12
  sourceTokenChainId?: number;
12
13
  onSuccess?: () => void;
13
14
  mainFooter?: React.ReactNode;
15
+ /**
16
+ * Called when a token is selected. Call event.preventDefault() to prevent default token selection behavior.
17
+ * Useful for handling special cases like B3 token selection.
18
+ */
19
+ onTokenSelect?: (token: components["schemas"]["Token"], event: {
20
+ preventDefault: () => void;
21
+ }) => void;
14
22
  }
15
23
  export declare function AnySpendDepositHype(props: AnySpendDepositHypeProps): import("react/jsx-runtime").JSX.Element;
@@ -22,6 +22,7 @@ const CryptoReceiveSection_1 = require("./common/CryptoReceiveSection");
22
22
  const ErrorSection_1 = require("./common/ErrorSection");
23
23
  const FiatPaymentMethod_1 = require("./common/FiatPaymentMethod");
24
24
  const OrderDetails_1 = require("./common/OrderDetails");
25
+ const PointsDetailPanel_1 = require("./common/PointsDetailPanel");
25
26
  const RecipientSelection_1 = require("./common/RecipientSelection");
26
27
  const lucide_react_1 = require("lucide-react");
27
28
  const PanelOnramp_1 = require("./common/PanelOnramp");
@@ -34,7 +35,7 @@ function AnySpendDepositHype(props) {
34
35
  const fingerprintConfig = (0, AnySpendFingerprintWrapper_1.getFingerprintConfig)();
35
36
  return ((0, jsx_runtime_1.jsx)(AnySpendFingerprintWrapper_1.AnySpendFingerprintWrapper, { fingerprint: fingerprintConfig, children: (0, jsx_runtime_1.jsx)(AnySpendDepositHypeInner, { ...props }) }));
36
37
  }
37
- function AnySpendDepositHypeInner({ loadOrder, mode = "modal", recipientAddress, paymentType = "crypto", sourceTokenAddress, sourceTokenChainId, onSuccess, mainFooter, }) {
38
+ function AnySpendDepositHypeInner({ loadOrder, mode = "modal", recipientAddress, paymentType = "crypto", sourceTokenAddress, sourceTokenChainId, onSuccess, mainFooter, onTokenSelect, }) {
38
39
  // Use shared flow hook
39
40
  const { activePanel, setActivePanel, orderId, setOrderId, oat, selectedSrcChainId, setSelectedSrcChainId, selectedSrcToken, setSelectedSrcToken, srcAmount, setSrcAmount, dstAmount, setIsSrcInputDirty, selectedCryptoPaymentMethod, setSelectedCryptoPaymentMethod, selectedFiatPaymentMethod, setSelectedFiatPaymentMethod, selectedRecipientAddress, setSelectedRecipientAddress, recipientName, globalAddress, anyspendQuote, isLoadingAnyspendQuote, getAnyspendQuoteError, activeInputAmountInWei, geoData, coinbaseAvailablePaymentMethods, stripeWeb2Support, createOrder, isCreatingOrder, createOnrampOrder, isCreatingOnrampOrder, } = (0, useAnyspendFlow_1.useAnyspendFlow)({
40
41
  paymentType,
@@ -118,10 +119,10 @@ function AnySpendDepositHypeInner({ loadOrder, mode = "modal", recipientAddress,
118
119
  await handleFiatOrder();
119
120
  }
120
121
  };
121
- const mainView = ((0, jsx_runtime_1.jsxs)("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "mb-4 flex flex-col items-center gap-3 text-center", children: (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("h1", { className: "text-as-primary text-xl font-bold", children: paymentType === "crypto" ? "Deposit Crypto" : "Fund with Fiat" }) }) }), (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, setIsSrcInputDirty: setIsSrcInputDirty, selectedCryptoPaymentMethod: selectedCryptoPaymentMethod, onSelectCryptoPaymentMethod: () => setActivePanel(useAnyspendFlow_1.PanelView.CRYPTO_PAYMENT_METHOD), anyspendQuote: anyspendQuote })) : ((0, jsx_runtime_1.jsx)(react_2.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: recipientAddress, destinationToken: anyspend_1.B3_TOKEN, destinationChainId: chains_1.base.id, dstTokenSymbol: exports.HYPE_TOKEN_DETAILS.SYMBOL, hideDstToken: true, destinationAmount: dstAmount, onDestinationTokenChange: () => { }, onDestinationChainChange: () => { }, fiatPaymentMethodIndex: useAnyspendFlow_1.PanelView.FIAT_PAYMENT_METHOD, recipientSelectionPanelIndex: useAnyspendFlow_1.PanelView.RECIPIENT_SELECTION }) })), (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_1.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, selectedRecipientAddress: recipientAddress, recipientName: recipientName || undefined, onSelectRecipient: () => setActivePanel(useAnyspendFlow_1.PanelView.RECIPIENT_SELECTION), dstAmount: dstAmount, dstToken: anyspend_1.B3_TOKEN, dstTokenSymbol: exports.HYPE_TOKEN_DETAILS.SYMBOL, dstTokenLogoURI: exports.HYPE_TOKEN_DETAILS.LOGO_URI, selectedDstChainId: chains_1.base.id, setSelectedDstChainId: () => { }, setSelectedDstToken: () => { }, onChangeDstAmount: value => {
122
+ const mainView = ((0, jsx_runtime_1.jsxs)("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "mb-4 flex flex-col items-center gap-3 text-center", children: (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("h1", { className: "text-as-primary text-xl font-bold", children: paymentType === "crypto" ? "Deposit Crypto" : "Fund with Fiat" }) }) }), (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, setIsSrcInputDirty: setIsSrcInputDirty, selectedCryptoPaymentMethod: selectedCryptoPaymentMethod, onSelectCryptoPaymentMethod: () => setActivePanel(useAnyspendFlow_1.PanelView.CRYPTO_PAYMENT_METHOD), anyspendQuote: anyspendQuote, onTokenSelect: onTokenSelect })) : ((0, jsx_runtime_1.jsx)(react_2.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: recipientAddress, destinationToken: anyspend_1.B3_TOKEN, destinationChainId: chains_1.base.id, dstTokenSymbol: exports.HYPE_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) }) })), (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_1.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, selectedRecipientAddress: recipientAddress, recipientName: recipientName || undefined, onSelectRecipient: () => setActivePanel(useAnyspendFlow_1.PanelView.RECIPIENT_SELECTION), dstAmount: dstAmount, dstToken: anyspend_1.B3_TOKEN, dstTokenSymbol: exports.HYPE_TOKEN_DETAILS.SYMBOL, dstTokenLogoURI: exports.HYPE_TOKEN_DETAILS.LOGO_URI, selectedDstChainId: chains_1.base.id, setSelectedDstChainId: () => { }, setSelectedDstToken: () => { }, onChangeDstAmount: value => {
122
123
  setIsSrcInputDirty(false);
123
124
  setSrcAmount(value);
124
- }, anyspendQuote: anyspendQuote }))] }) }), (0, jsx_runtime_1.jsx)(ErrorSection_1.ErrorSection, { error: getAnyspendQuoteError }), (0, jsx_runtime_1.jsx)(react_2.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", getAnyspendQuoteError && "mt-0"), children: (0, jsx_runtime_1.jsx)(react_1.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: btnInfo.text }) }), mainFooter ? mainFooter : null] }));
125
+ }, anyspendQuote: anyspendQuote, onShowPointsDetail: () => setActivePanel(useAnyspendFlow_1.PanelView.POINTS_DETAIL) }))] }) }), (0, jsx_runtime_1.jsx)(ErrorSection_1.ErrorSection, { error: getAnyspendQuoteError }), (0, jsx_runtime_1.jsx)(react_2.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", getAnyspendQuoteError && "mt-0"), children: (0, jsx_runtime_1.jsx)(react_1.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: btnInfo.text }) }), mainFooter ? mainFooter : null] }));
125
126
  // Handle crypto order creation
126
127
  const handleCryptoOrder = async () => {
127
128
  try {
@@ -218,6 +219,7 @@ function AnySpendDepositHypeInner({ loadOrder, mode = "modal", recipientAddress,
218
219
  setSelectedFiatPaymentMethod(method);
219
220
  setActivePanel(useAnyspendFlow_1.PanelView.MAIN);
220
221
  }, srcAmountOnRamp: srcAmount }));
222
+ const pointsDetailView = ((0, jsx_runtime_1.jsx)(PointsDetailPanel_1.PointsDetailPanel, { pointsAmount: anyspendQuote?.data?.pointsAmount || 0, onBack: () => setActivePanel(useAnyspendFlow_1.PanelView.MAIN) }));
221
223
  // If showing token selection, render with panel transitions
222
224
  return ((0, jsx_runtime_1.jsx)(react_1.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" &&
223
225
  "bg-as-surface-primary border-as-border-secondary overflow-hidden rounded-2xl border shadow-xl"), children: (0, jsx_runtime_1.jsx)(react_1.TransitionPanel, { activeIndex: orderId
@@ -239,5 +241,6 @@ function AnySpendDepositHypeInner({ loadOrder, mode = "modal", recipientAddress,
239
241
  (0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)(mode === "page" && "p-6"), children: recipientSelectionView }, "recipient-selection-view"),
240
242
  (0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)(mode === "page" && "p-6"), children: orderDetailsView }, "order-details-view"),
241
243
  (0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)(mode === "page" && "p-6"), children: loadingView }, "loading-view"),
244
+ (0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)(mode === "page" && "p-6"), children: pointsDetailView }, "points-detail-view"),
242
245
  ] }) }) }));
243
246
  }
@@ -72,8 +72,7 @@ function AnyspendSignatureMint({ loadOrder, mode = "modal", signatureData, image
72
72
  }
73
73
  const encodedData = generateEncodedDataForSignatureMint(signatureData);
74
74
  const price = (0, viem_1.parseEther)(signatureData.payload.price?.toString() || "0");
75
- return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.AnySpendCustom, { loadOrder: loadOrder, mode: mode, recipientAddress: signatureData.payload.to, orderType: "custom", dstChainId: signatureData.collection.chainId, dstToken: dstToken, dstAmount: price.toString(), contractAddress: signatureData.collection.address, encodedData: encodedData, metadata: {
76
- type: "custom",
75
+ return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.AnySpendCustom, { loadOrder: loadOrder, mode: mode, recipientAddress: signatureData.payload.to, orderType: "custom", dstChainId: signatureData.collection.chainId, dstToken: dstToken, dstAmount: price.toString(), contractAddress: signatureData.collection.address || "", encodedData: encodedData, metadata: {
77
76
  action: "Signature Mint",
78
77
  }, header: header, onSuccess: onSuccess, showRecipient: true }));
79
78
  }
@@ -12,14 +12,16 @@ const centerTruncate_1 = __importDefault(require("../../../../shared/utils/cente
12
12
  const number_1 = require("../../../../shared/utils/number");
13
13
  const framer_motion_1 = require("framer-motion");
14
14
  const lucide_react_1 = require("lucide-react");
15
- const wagmi_1 = require("wagmi");
16
15
  const CryptoPaymentMethod_1 = require("./CryptoPaymentMethod");
17
16
  const OrderDetailsCollapsible_1 = require("./OrderDetailsCollapsible");
18
17
  const PaymentMethodSwitch_1 = require("./PaymentMethodSwitch");
19
18
  function ConnectWalletPayment({ order, onPayment, txLoading, isSwitchingOrExecuting, phantomWalletAddress, tournament, nft, cryptoPaymentMethod, onPaymentMethodChange, }) {
20
19
  const profile = (0, react_1.useProfile)({ address: order.recipientAddress });
21
20
  const recipientName = profile.data?.name?.replace(/\.b3\.fun/g, "");
22
- const { address: connectedAddress } = (0, wagmi_1.useAccount)();
21
+ const { connectedEOAWallet, connectedSmartWallet } = (0, react_1.useAccountWallet)();
22
+ const connectedEvmAddress = cryptoPaymentMethod === CryptoPaymentMethod_1.CryptoPaymentMethodType.GLOBAL_WALLET
23
+ ? connectedSmartWallet?.getAccount()?.address
24
+ : connectedEOAWallet?.getAccount()?.address;
23
25
  const srcToken = order.metadata.srcToken;
24
26
  const dstToken = order.metadata.dstToken;
25
27
  const expectedDstAmount = order.type === "mint_nft" ||
@@ -38,5 +40,5 @@ function ConnectWalletPayment({ order, onPayment, txLoading, isSwitchingOrExecut
38
40
  ? "Pay from Global Account"
39
41
  : "Pay from Connected Wallet" }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] })) }), (0, jsx_runtime_1.jsxs)("span", { className: "label-style text-as-primary/50 text-xs", children: ["Connected to:", " ", order.srcChain === anyspend_1.RELAY_SOLANA_MAINNET_CHAIN_ID && phantomWalletAddress
40
42
  ? (0, centerTruncate_1.default)(phantomWalletAddress, 6)
41
- : (0, centerTruncate_1.default)(connectedAddress || "")] }), (0, jsx_runtime_1.jsx)(PaymentMethodSwitch_1.PaymentMethodSwitch, { currentMethod: cryptoPaymentMethod, onMethodChange: onPaymentMethodChange }), (0, jsx_runtime_1.jsx)("div", { className: "mt-4", children: (0, jsx_runtime_1.jsx)(OrderDetailsCollapsible_1.OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount }) })] }) }));
43
+ : (0, centerTruncate_1.default)(connectedEvmAddress || "")] }), (0, jsx_runtime_1.jsx)(PaymentMethodSwitch_1.PaymentMethodSwitch, { currentMethod: cryptoPaymentMethod, onMethodChange: onPaymentMethodChange }), (0, jsx_runtime_1.jsx)("div", { className: "mt-4", children: (0, jsx_runtime_1.jsx)(OrderDetailsCollapsible_1.OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount }) })] }) }));
42
44
  }
@@ -11,6 +11,9 @@ interface CryptoPaySectionProps {
11
11
  selectedCryptoPaymentMethod: CryptoPaymentMethodType;
12
12
  onSelectCryptoPaymentMethod: () => void;
13
13
  anyspendQuote?: any;
14
+ onTokenSelect?: (token: components["schemas"]["Token"], event: {
15
+ preventDefault: () => void;
16
+ }) => void;
14
17
  }
15
- export declare function CryptoPaySection({ selectedSrcChainId, setSelectedSrcChainId, selectedSrcToken, setSelectedSrcToken, srcAmount, setSrcAmount, setIsSrcInputDirty, selectedCryptoPaymentMethod, onSelectCryptoPaymentMethod, anyspendQuote, }: CryptoPaySectionProps): import("react/jsx-runtime").JSX.Element;
18
+ export declare function CryptoPaySection({ selectedSrcChainId, setSelectedSrcChainId, selectedSrcToken, setSelectedSrcToken, srcAmount, setSrcAmount, setIsSrcInputDirty, selectedCryptoPaymentMethod, onSelectCryptoPaymentMethod, anyspendQuote, onTokenSelect, }: CryptoPaySectionProps): import("react/jsx-runtime").JSX.Element;
16
19
  export {};
@@ -9,18 +9,18 @@ const number_1 = require("../../../../shared/utils/number");
9
9
  const lucide_react_1 = require("lucide-react");
10
10
  const react_2 = require("motion/react");
11
11
  const react_3 = require("react");
12
- const wagmi_1 = require("wagmi");
13
12
  const CryptoPaymentMethod_1 = require("./CryptoPaymentMethod");
14
13
  const OrderTokenAmount_1 = require("./OrderTokenAmount");
15
14
  const TokenBalance_1 = require("./TokenBalance");
16
- function CryptoPaySection({ selectedSrcChainId, setSelectedSrcChainId, selectedSrcToken, setSelectedSrcToken, srcAmount, setSrcAmount, setIsSrcInputDirty, selectedCryptoPaymentMethod, onSelectCryptoPaymentMethod, anyspendQuote, }) {
17
- const { address: connectedAddress, isConnected } = (0, wagmi_1.useAccount)();
18
- const { data: profileData } = (0, react_1.useProfile)({ address: connectedAddress });
19
- const connectedName = profileData?.displayName;
20
- const { address: globalAddress } = (0, react_1.useAccountWallet)();
15
+ function CryptoPaySection({ selectedSrcChainId, setSelectedSrcChainId, selectedSrcToken, setSelectedSrcToken, srcAmount, setSrcAmount, setIsSrcInputDirty, selectedCryptoPaymentMethod, onSelectCryptoPaymentMethod, anyspendQuote, onTokenSelect, }) {
16
+ const { connectedSmartWallet, connectedEOAWallet } = (0, react_1.useAccountWallet)();
21
17
  const { data: srcTokenMetadata } = (0, react_1.useTokenData)(selectedSrcToken?.chainId, selectedSrcToken?.address);
22
18
  // Determine which address to use based on payment method
23
- const walletAddress = selectedCryptoPaymentMethod === CryptoPaymentMethod_1.CryptoPaymentMethodType.GLOBAL_WALLET ? globalAddress : connectedAddress;
19
+ const walletAddress = selectedCryptoPaymentMethod === CryptoPaymentMethod_1.CryptoPaymentMethodType.GLOBAL_WALLET
20
+ ? connectedSmartWallet?.getAccount()?.address
21
+ : connectedEOAWallet?.getAccount()?.address;
22
+ const { data: profileData } = (0, react_1.useProfile)({ address: walletAddress });
23
+ const connectedName = profileData?.displayName;
24
24
  // Add ref to track if we've applied metadata
25
25
  const appliedSrcMetadataRef = (0, react_3.useRef)(false);
26
26
  // Update source token with metadata
@@ -45,10 +45,10 @@ function CryptoPaySection({ selectedSrcChainId, setSelectedSrcChainId, selectedS
45
45
  (0, react_3.useEffect)(() => {
46
46
  appliedSrcMetadataRef.current = false;
47
47
  }, [selectedSrcToken.address, selectedSrcToken.chainId]);
48
- return ((0, jsx_runtime_1.jsxs)(react_2.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" }, className: "pay-section bg-as-surface-secondary border-as-border-secondary relative flex w-full flex-col gap-2 rounded-2xl border p-4 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-as-primary/50 flex h-7 items-center text-sm", children: "Pay" }), (0, jsx_runtime_1.jsx)("button", { className: "text-as-tertiarry flex h-7 items-center gap-2 text-sm transition-colors focus:!outline-none", onClick: onSelectCryptoPaymentMethod, children: selectedCryptoPaymentMethod === CryptoPaymentMethod_1.CryptoPaymentMethodType.CONNECT_WALLET ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isConnected ? ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-1", children: connectedName ? (0, utils_1.formatUsername)(connectedName) : (0, formatAddress_1.shortenAddress)(connectedAddress || "") })) : ("Connect wallet"), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] })) : selectedCryptoPaymentMethod === CryptoPaymentMethod_1.CryptoPaymentMethodType.GLOBAL_WALLET ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Global Account", (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] })) : selectedCryptoPaymentMethod === CryptoPaymentMethod_1.CryptoPaymentMethodType.TRANSFER_CRYPTO ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Transfer crypto", (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Select payment method", (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] })) })] }), (0, jsx_runtime_1.jsx)(OrderTokenAmount_1.OrderTokenAmount, { address: walletAddress, context: "from", inputValue: srcAmount, onChangeInput: value => {
48
+ return ((0, jsx_runtime_1.jsxs)(react_2.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" }, className: "pay-section bg-as-surface-secondary border-as-border-secondary relative flex w-full flex-col gap-2 rounded-2xl border p-4 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-as-primary/50 flex h-7 items-center text-sm", children: "Pay" }), (0, jsx_runtime_1.jsx)("button", { className: "text-as-tertiarry flex h-7 items-center gap-2 text-sm transition-colors focus:!outline-none", onClick: onSelectCryptoPaymentMethod, children: selectedCryptoPaymentMethod === CryptoPaymentMethod_1.CryptoPaymentMethodType.CONNECT_WALLET ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [walletAddress ? ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-1", children: connectedName ? (0, utils_1.formatUsername)(connectedName) : (0, formatAddress_1.shortenAddress)(walletAddress || "") })) : ("Connect wallet"), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] })) : selectedCryptoPaymentMethod === CryptoPaymentMethod_1.CryptoPaymentMethodType.GLOBAL_WALLET ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Global Account", (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] })) : selectedCryptoPaymentMethod === CryptoPaymentMethod_1.CryptoPaymentMethodType.TRANSFER_CRYPTO ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Transfer crypto", (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Select payment method", (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] })) })] }), (0, jsx_runtime_1.jsx)(OrderTokenAmount_1.OrderTokenAmount, { address: walletAddress, context: "from", inputValue: srcAmount, onChangeInput: value => {
49
49
  setIsSrcInputDirty(true);
50
50
  setSrcAmount(value);
51
- }, chainId: selectedSrcChainId, setChainId: setSelectedSrcChainId, token: selectedSrcToken, setToken: setSelectedSrcToken }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-as-primary/50 flex h-5 items-center text-sm", children: (0, number_1.formatDisplayNumber)(anyspendQuote?.data?.currencyIn?.amountUsd, {
51
+ }, chainId: selectedSrcChainId, setChainId: setSelectedSrcChainId, token: selectedSrcToken, setToken: setSelectedSrcToken, onTokenSelect: onTokenSelect }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-as-primary/50 flex h-5 items-center text-sm", children: (0, number_1.formatDisplayNumber)(anyspendQuote?.data?.currencyIn?.amountUsd, {
52
52
  style: "currency",
53
53
  fallback: "",
54
54
  }) }), (0, jsx_runtime_1.jsx)(TokenBalance_1.TokenBalance, { token: selectedSrcToken, walletAddress: walletAddress, onChangeInput: value => {