@b3dotfun/sdk 0.0.23 → 0.0.24

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 (252) hide show
  1. package/dist/cjs/anyspend/react/components/AnySpend.js +5 -8
  2. package/dist/cjs/anyspend/react/components/AnySpendBondKit.js +2 -2
  3. package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +35 -28
  4. package/dist/cjs/anyspend/react/components/AnySpendCustom.js +4 -4
  5. package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +35 -28
  6. package/dist/cjs/anyspend/react/components/common/Accordion.d.ts +7 -0
  7. package/dist/cjs/anyspend/react/components/common/Accordion.js +53 -0
  8. package/dist/cjs/anyspend/react/components/common/ConnectWalletPayment.js +3 -22
  9. package/dist/cjs/anyspend/react/components/common/FiatPaymentMethod.js +2 -2
  10. package/dist/cjs/anyspend/react/components/common/OrderDetails.js +76 -83
  11. package/dist/cjs/anyspend/react/components/common/OrderStatus.js +1 -1
  12. package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +4 -3
  13. package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.js +1 -5
  14. package/dist/cjs/anyspend/react/components/common/StepProgress.js +2 -2
  15. package/dist/cjs/anyspend/react/components/common/TokenBalance.js +1 -1
  16. package/dist/cjs/anyspend/react/hooks/useGeoOnrampOptions.d.ts +0 -1
  17. package/dist/cjs/anyspend/react/hooks/useGeoOnrampOptions.js +2 -4
  18. package/dist/cjs/anyspend/react/hooks/useSigMint.d.ts +2 -2
  19. package/dist/cjs/anyspend/react/hooks/useStripeSupport.d.ts +0 -1
  20. package/dist/cjs/anyspend/react/hooks/useStripeSupport.js +0 -1
  21. package/dist/cjs/anyspend/utils/chain.js +1 -1
  22. package/dist/cjs/bondkit/abis/BondkitTokenABI.d.ts +1020 -0
  23. package/dist/cjs/bondkit/abis/BondkitTokenABI.js +1332 -0
  24. package/dist/cjs/bondkit/abis/BondkitTokenFactoryABI.d.ts +391 -0
  25. package/dist/cjs/bondkit/abis/BondkitTokenFactoryABI.js +514 -0
  26. package/dist/cjs/bondkit/abis/index.d.ts +2 -0
  27. package/dist/cjs/bondkit/abis/index.js +18 -0
  28. package/dist/cjs/bondkit/bondkitToken.d.ts +68 -0
  29. package/dist/cjs/bondkit/bondkitToken.js +456 -0
  30. package/dist/cjs/bondkit/bondkitTokenFactory.d.ts +60 -0
  31. package/dist/cjs/bondkit/bondkitTokenFactory.js +274 -0
  32. package/dist/cjs/bondkit/components/TradingView.d.ts +3 -0
  33. package/dist/cjs/bondkit/components/TradingView.js +296 -0
  34. package/dist/cjs/bondkit/components/config/cdn.d.ts +42 -0
  35. package/dist/cjs/bondkit/components/config/cdn.js +63 -0
  36. package/dist/cjs/bondkit/components/index.d.ts +5 -0
  37. package/dist/cjs/bondkit/components/index.js +25 -0
  38. package/dist/cjs/bondkit/components/types.d.ts +8 -0
  39. package/dist/cjs/bondkit/components/types.js +5 -0
  40. package/dist/cjs/bondkit/components/utils/cdn-loader.d.ts +24 -0
  41. package/dist/cjs/bondkit/components/utils/cdn-loader.js +73 -0
  42. package/dist/cjs/bondkit/components/utils/format.d.ts +4 -0
  43. package/dist/cjs/bondkit/components/utils/format.js +31 -0
  44. package/dist/cjs/bondkit/config.d.ts +10 -0
  45. package/dist/cjs/bondkit/config.js +18 -0
  46. package/dist/cjs/bondkit/constants.d.ts +3 -0
  47. package/dist/cjs/bondkit/constants.js +5 -0
  48. package/dist/cjs/bondkit/index.d.ts +7 -0
  49. package/dist/cjs/bondkit/index.js +33 -0
  50. package/dist/cjs/bondkit/json_abis/BondkitABI.json +1329 -0
  51. package/dist/cjs/bondkit/json_abis/BondkitFactoryABI.json +511 -0
  52. package/dist/cjs/bondkit/json_abis/index.d.ts +3 -0
  53. package/dist/cjs/bondkit/json_abis/index.js +10 -0
  54. package/dist/cjs/bondkit/json_abis/index.ts +4 -0
  55. package/dist/cjs/bondkit/types.d.ts +77 -0
  56. package/dist/cjs/bondkit/types.js +11 -0
  57. package/dist/cjs/global-account/react/components/B3DynamicModal.js +1 -1
  58. package/dist/cjs/global-account/react/components/MintButton/MintButton.js +0 -1
  59. package/dist/cjs/global-account/react/components/SendERC20Button/SendERC20Button.d.ts +13 -0
  60. package/dist/cjs/global-account/react/components/SendERC20Button/SendERC20Button.js +33 -0
  61. package/dist/cjs/global-account/react/components/SendETHButton/SendETHButton.d.ts +12 -0
  62. package/dist/cjs/global-account/react/components/SendETHButton/SendETHButton.js +23 -0
  63. package/dist/cjs/global-account/react/components/SignInWithB3/SignIn.js +4 -2
  64. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +2 -2
  65. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +1 -1
  66. package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStep.js +2 -2
  67. package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +2 -2
  68. package/dist/cjs/global-account/react/components/index.d.ts +2 -0
  69. package/dist/cjs/global-account/react/components/index.js +8 -2
  70. package/dist/cjs/global-account/react/components/ui/scroll-area.js +1 -1
  71. package/dist/cjs/global-account/react/components/ui/tooltip.d.ts +1 -1
  72. package/dist/cjs/global-account/react/hooks/index.d.ts +2 -1
  73. package/dist/cjs/global-account/react/hooks/index.js +18 -3
  74. package/dist/cjs/global-account/react/hooks/useAccountWallet.js +8 -0
  75. package/dist/cjs/global-account/react/hooks/useAuthentication.js +4 -4
  76. package/dist/cjs/global-account/react/hooks/useChainSwitchWithAction.d.ts +1 -2
  77. package/dist/cjs/global-account/react/hooks/useChainSwitchWithAction.js +2 -2
  78. package/dist/cjs/global-account/react/hooks/useFirstEOA.js +9 -7
  79. package/dist/cjs/global-account/react/hooks/useUnifiedChainSwitchAndExecute.d.ts +11 -0
  80. package/dist/cjs/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +160 -0
  81. package/dist/cjs/shared/constants/chains/supported.d.ts +4 -0
  82. package/dist/cjs/shared/constants/chains/supported.js +11 -0
  83. package/dist/cjs/shared/generated/chain-networks.json +1 -1
  84. package/dist/esm/anyspend/react/components/AnySpend.js +5 -8
  85. package/dist/esm/anyspend/react/components/AnySpendBondKit.js +2 -2
  86. package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +37 -30
  87. package/dist/esm/anyspend/react/components/AnySpendCustom.js +4 -4
  88. package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +37 -30
  89. package/dist/esm/anyspend/react/components/common/Accordion.d.ts +7 -0
  90. package/dist/esm/anyspend/react/components/common/Accordion.js +14 -0
  91. package/dist/esm/anyspend/react/components/common/ConnectWalletPayment.js +3 -22
  92. package/dist/esm/anyspend/react/components/common/FiatPaymentMethod.js +2 -2
  93. package/dist/esm/anyspend/react/components/common/OrderDetails.js +79 -86
  94. package/dist/esm/anyspend/react/components/common/OrderStatus.js +1 -1
  95. package/dist/esm/anyspend/react/components/common/PanelOnramp.js +5 -4
  96. package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.js +1 -5
  97. package/dist/esm/anyspend/react/components/common/StepProgress.js +2 -2
  98. package/dist/esm/anyspend/react/components/common/TokenBalance.js +1 -1
  99. package/dist/esm/anyspend/react/hooks/useGeoOnrampOptions.d.ts +0 -1
  100. package/dist/esm/anyspend/react/hooks/useGeoOnrampOptions.js +2 -4
  101. package/dist/esm/anyspend/react/hooks/useSigMint.d.ts +2 -2
  102. package/dist/esm/anyspend/react/hooks/useStripeSupport.d.ts +0 -1
  103. package/dist/esm/anyspend/react/hooks/useStripeSupport.js +0 -1
  104. package/dist/esm/anyspend/utils/chain.js +1 -1
  105. package/dist/esm/bondkit/abis/BondkitTokenABI.d.ts +1020 -0
  106. package/dist/esm/bondkit/abis/BondkitTokenABI.js +1329 -0
  107. package/dist/esm/bondkit/abis/BondkitTokenFactoryABI.d.ts +391 -0
  108. package/dist/esm/bondkit/abis/BondkitTokenFactoryABI.js +511 -0
  109. package/dist/esm/bondkit/abis/index.d.ts +2 -0
  110. package/dist/esm/bondkit/abis/index.js +2 -0
  111. package/dist/esm/bondkit/bondkitToken.d.ts +68 -0
  112. package/dist/esm/bondkit/bondkitToken.js +452 -0
  113. package/dist/esm/bondkit/bondkitTokenFactory.d.ts +60 -0
  114. package/dist/esm/bondkit/bondkitTokenFactory.js +270 -0
  115. package/dist/esm/bondkit/components/TradingView.d.ts +3 -0
  116. package/dist/esm/bondkit/components/TradingView.js +294 -0
  117. package/dist/esm/bondkit/components/config/cdn.d.ts +42 -0
  118. package/dist/esm/bondkit/components/config/cdn.js +55 -0
  119. package/dist/esm/bondkit/components/index.d.ts +5 -0
  120. package/dist/esm/bondkit/components/index.js +4 -0
  121. package/dist/esm/bondkit/components/types.d.ts +8 -0
  122. package/dist/esm/bondkit/components/types.js +4 -0
  123. package/dist/esm/bondkit/components/utils/cdn-loader.d.ts +24 -0
  124. package/dist/esm/bondkit/components/utils/cdn-loader.js +66 -0
  125. package/dist/esm/bondkit/components/utils/format.d.ts +4 -0
  126. package/dist/esm/bondkit/components/utils/format.js +28 -0
  127. package/dist/esm/bondkit/config.d.ts +10 -0
  128. package/dist/esm/bondkit/config.js +14 -0
  129. package/dist/esm/bondkit/constants.d.ts +3 -0
  130. package/dist/esm/bondkit/constants.js +2 -0
  131. package/dist/esm/bondkit/index.d.ts +7 -0
  132. package/dist/esm/bondkit/index.js +12 -0
  133. package/dist/esm/bondkit/json_abis/BondkitABI.json +1329 -0
  134. package/dist/esm/bondkit/json_abis/BondkitFactoryABI.json +511 -0
  135. package/dist/esm/bondkit/json_abis/index.d.ts +3 -0
  136. package/dist/esm/bondkit/json_abis/index.js +3 -0
  137. package/dist/esm/bondkit/json_abis/index.ts +4 -0
  138. package/dist/esm/bondkit/types.d.ts +77 -0
  139. package/dist/esm/bondkit/types.js +8 -0
  140. package/dist/esm/global-account/react/components/B3DynamicModal.js +1 -1
  141. package/dist/esm/global-account/react/components/MintButton/MintButton.js +0 -1
  142. package/dist/esm/global-account/react/components/SendERC20Button/SendERC20Button.d.ts +13 -0
  143. package/dist/esm/global-account/react/components/SendERC20Button/SendERC20Button.js +30 -0
  144. package/dist/esm/global-account/react/components/SendETHButton/SendETHButton.d.ts +12 -0
  145. package/dist/esm/global-account/react/components/SendETHButton/SendETHButton.js +20 -0
  146. package/dist/esm/global-account/react/components/SignInWithB3/SignIn.js +4 -2
  147. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +2 -2
  148. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +1 -1
  149. package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStep.js +2 -2
  150. package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +2 -2
  151. package/dist/esm/global-account/react/components/index.d.ts +2 -0
  152. package/dist/esm/global-account/react/components/index.js +4 -0
  153. package/dist/esm/global-account/react/components/ui/scroll-area.js +1 -1
  154. package/dist/esm/global-account/react/components/ui/tooltip.d.ts +1 -1
  155. package/dist/esm/global-account/react/hooks/index.d.ts +2 -1
  156. package/dist/esm/global-account/react/hooks/index.js +2 -1
  157. package/dist/esm/global-account/react/hooks/useAccountWallet.js +8 -0
  158. package/dist/esm/global-account/react/hooks/useAuthentication.js +4 -4
  159. package/dist/esm/global-account/react/hooks/useChainSwitchWithAction.d.ts +1 -2
  160. package/dist/esm/global-account/react/hooks/useChainSwitchWithAction.js +2 -2
  161. package/dist/esm/global-account/react/hooks/useFirstEOA.js +9 -7
  162. package/dist/esm/global-account/react/hooks/useUnifiedChainSwitchAndExecute.d.ts +11 -0
  163. package/dist/esm/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +154 -0
  164. package/dist/esm/shared/constants/chains/supported.d.ts +4 -0
  165. package/dist/esm/shared/constants/chains/supported.js +10 -0
  166. package/dist/esm/shared/generated/chain-networks.json +1 -1
  167. package/dist/styles/index.css +1 -1
  168. package/dist/types/anyspend/react/components/common/Accordion.d.ts +7 -0
  169. package/dist/types/anyspend/react/hooks/useGeoOnrampOptions.d.ts +0 -1
  170. package/dist/types/anyspend/react/hooks/useSigMint.d.ts +2 -2
  171. package/dist/types/anyspend/react/hooks/useStripeSupport.d.ts +0 -1
  172. package/dist/types/bondkit/abis/BondkitTokenABI.d.ts +1020 -0
  173. package/dist/types/bondkit/abis/BondkitTokenFactoryABI.d.ts +391 -0
  174. package/dist/types/bondkit/abis/index.d.ts +2 -0
  175. package/dist/types/bondkit/bondkitToken.d.ts +68 -0
  176. package/dist/types/bondkit/bondkitTokenFactory.d.ts +60 -0
  177. package/dist/types/bondkit/components/TradingView.d.ts +3 -0
  178. package/dist/types/bondkit/components/config/cdn.d.ts +42 -0
  179. package/dist/types/bondkit/components/index.d.ts +5 -0
  180. package/dist/types/bondkit/components/types.d.ts +8 -0
  181. package/dist/types/bondkit/components/utils/cdn-loader.d.ts +24 -0
  182. package/dist/types/bondkit/components/utils/format.d.ts +4 -0
  183. package/dist/types/bondkit/config.d.ts +10 -0
  184. package/dist/types/bondkit/constants.d.ts +3 -0
  185. package/dist/types/bondkit/index.d.ts +7 -0
  186. package/dist/types/bondkit/json_abis/index.d.ts +3 -0
  187. package/dist/types/bondkit/types.d.ts +77 -0
  188. package/dist/types/global-account/react/components/SendERC20Button/SendERC20Button.d.ts +13 -0
  189. package/dist/types/global-account/react/components/SendETHButton/SendETHButton.d.ts +12 -0
  190. package/dist/types/global-account/react/components/index.d.ts +2 -0
  191. package/dist/types/global-account/react/components/ui/tooltip.d.ts +1 -1
  192. package/dist/types/global-account/react/hooks/index.d.ts +2 -1
  193. package/dist/types/global-account/react/hooks/useChainSwitchWithAction.d.ts +1 -2
  194. package/dist/types/global-account/react/hooks/useUnifiedChainSwitchAndExecute.d.ts +11 -0
  195. package/dist/types/shared/constants/chains/supported.d.ts +4 -0
  196. package/package.json +42 -7
  197. package/src/anyspend/react/components/AnySpend.tsx +5 -23
  198. package/src/anyspend/react/components/AnySpendBondKit.tsx +2 -2
  199. package/src/anyspend/react/components/AnySpendBuySpin.tsx +42 -32
  200. package/src/anyspend/react/components/AnySpendCustom.tsx +7 -13
  201. package/src/anyspend/react/components/AnySpendStakeB3.tsx +44 -34
  202. package/src/anyspend/react/components/common/Accordion.tsx +56 -0
  203. package/src/anyspend/react/components/common/ConnectWalletPayment.tsx +0 -25
  204. package/src/anyspend/react/components/common/FiatPaymentMethod.tsx +1 -2
  205. package/src/anyspend/react/components/common/OrderDetails.tsx +292 -260
  206. package/src/anyspend/react/components/common/OrderStatus.tsx +1 -1
  207. package/src/anyspend/react/components/common/PanelOnramp.tsx +7 -7
  208. package/src/anyspend/react/components/common/PanelOnrampPayment.tsx +0 -6
  209. package/src/anyspend/react/components/common/StepProgress.tsx +2 -2
  210. package/src/anyspend/react/components/common/TokenBalance.tsx +3 -3
  211. package/src/anyspend/react/hooks/useGeoOnrampOptions.ts +2 -4
  212. package/src/anyspend/react/hooks/useStripeSupport.ts +0 -1
  213. package/src/anyspend/utils/chain.ts +1 -1
  214. package/src/bondkit/abis/BondkitTokenABI.ts +1329 -0
  215. package/src/bondkit/abis/BondkitTokenFactoryABI.ts +511 -0
  216. package/src/bondkit/abis/index.ts +2 -0
  217. package/src/bondkit/bondkitToken.ts +539 -0
  218. package/src/bondkit/bondkitTokenFactory.ts +336 -0
  219. package/src/bondkit/components/TradingView.tsx +341 -0
  220. package/src/bondkit/components/config/cdn.ts +63 -0
  221. package/src/bondkit/components/index.ts +5 -0
  222. package/src/bondkit/components/types.ts +9 -0
  223. package/src/bondkit/components/utils/cdn-loader.ts +77 -0
  224. package/src/bondkit/components/utils/format.ts +36 -0
  225. package/src/bondkit/config.ts +26 -0
  226. package/src/bondkit/constants.ts +5 -0
  227. package/src/bondkit/index.ts +16 -0
  228. package/src/bondkit/json_abis/BondkitABI.json +1329 -0
  229. package/src/bondkit/json_abis/BondkitFactoryABI.json +511 -0
  230. package/src/bondkit/json_abis/index.ts +4 -0
  231. package/src/bondkit/types.ts +98 -0
  232. package/src/global-account/react/components/B3DynamicModal.tsx +2 -1
  233. package/src/global-account/react/components/MintButton/MintButton.tsx +0 -1
  234. package/src/global-account/react/components/SendERC20Button/SendERC20Button.tsx +57 -0
  235. package/src/global-account/react/components/SendETHButton/SendETHButton.tsx +37 -0
  236. package/src/global-account/react/components/SignInWithB3/SignIn.tsx +21 -22
  237. package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +2 -2
  238. package/src/global-account/react/components/SignInWithB3/SignInWithB3Privy.tsx +1 -1
  239. package/src/global-account/react/components/SignInWithB3/steps/LoginStep.tsx +2 -2
  240. package/src/global-account/react/components/SignInWithB3/steps/LoginStepCustom.tsx +2 -2
  241. package/src/global-account/react/components/index.ts +6 -0
  242. package/src/global-account/react/components/ui/scroll-area.tsx +2 -2
  243. package/src/global-account/react/components/ui/tooltip.tsx +1 -1
  244. package/src/global-account/react/hooks/index.ts +2 -1
  245. package/src/global-account/react/hooks/useAccountWallet.tsx +10 -1
  246. package/src/global-account/react/hooks/useAuthentication.ts +4 -4
  247. package/src/global-account/react/hooks/useChainSwitchWithAction.ts +3 -4
  248. package/src/global-account/react/hooks/useFirstEOA.tsx +10 -7
  249. package/src/global-account/react/hooks/useUnifiedChainSwitchAndExecute.ts +186 -0
  250. package/src/shared/constants/chains/supported.ts +11 -0
  251. package/src/shared/generated/chain-networks.json +1 -1
  252. package/src/styles/index.css +27 -0
@@ -25,6 +25,7 @@ const sonner_1 = require("sonner");
25
25
  const viem_1 = require("viem");
26
26
  const chains_1 = require("viem/chains");
27
27
  const wagmi_1 = require("wagmi");
28
+ const Accordion_1 = require("./Accordion");
28
29
  const ConnectWalletPayment_1 = __importDefault(require("./ConnectWalletPayment"));
29
30
  const CryptoPaymentMethod_1 = require("./CryptoPaymentMethod");
30
31
  const OrderDetailsCollapsible_1 = require("./OrderDetailsCollapsible");
@@ -144,7 +145,7 @@ exports.OrderDetails = (0, react_5.memo)(function OrderDetails({ isMainnet, mode
144
145
  const [txHash, setTxHash] = (0, react_5.useState)();
145
146
  const [showQRCode, setShowQRCode] = (0, react_5.useState)(false);
146
147
  const { isLoading: txLoading, isSuccess: txSuccess } = (0, wagmi_1.useWaitForTransactionReceipt)({ hash: txHash });
147
- const { switchChainAndExecute, isSwitchingOrExecuting } = (0, react_1.useChainSwitchWithAction)();
148
+ const { switchChainAndExecute, isSwitchingOrExecuting } = (0, react_1.useUnifiedChainSwitchAndExecute)();
148
149
  const { colorMode } = (0, react_2.useColorMode)();
149
150
  const roundedUpSrcAmount = (0, react_5.useMemo)(() => {
150
151
  // Display the full transfer amount without rounding since users need to see the exact value they're transferring.
@@ -154,40 +155,31 @@ exports.OrderDetails = (0, react_5.memo)(function OrderDetails({ isMainnet, mode
154
155
  : undefined;
155
156
  return roundTokenAmount(formattedSrcAmount);
156
157
  }, [order.srcAmount, srcToken]);
157
- // This function handles the actual payment process
158
- const handlePaymentProcess = (0, react_5.useCallback)(async (currentWalletClient) => {
159
- if (!currentWalletClient || !currentWalletClient?.chain?.id) {
160
- sonner_1.toast.error("Please connect your wallet");
161
- return;
162
- }
163
- console.log("Processing transaction on chain:", currentWalletClient.chain.id);
164
- const signer = currentWalletClient.account;
165
- if (!signer) {
166
- sonner_1.toast.error("No account connected");
167
- return;
168
- }
169
- // Send transaction
158
+ // Unified payment handler for both EOA and AA wallets
159
+ const handleUnifiedPaymentProcess = (0, react_5.useCallback)(async () => {
160
+ let txData;
161
+ let value;
162
+ let to;
170
163
  if ((0, anyspend_1.isNativeToken)(order.srcTokenAddress)) {
171
- const hash = await currentWalletClient.sendTransaction({
172
- account: signer,
173
- chain: anyspend_1.EVM_CHAINS[order.srcChain].viem,
174
- to: order.globalAddress,
175
- value: BigInt(order.srcAmount),
176
- });
177
- setTxHash(hash);
164
+ // Native token transfer
165
+ to = order.globalAddress;
166
+ value = BigInt(order.srcAmount);
178
167
  }
179
168
  else {
180
- const hash = await currentWalletClient.writeContract({
181
- account: signer,
182
- chain: anyspend_1.EVM_CHAINS[order.srcChain].viem,
183
- address: order.srcTokenAddress,
169
+ // ERC20 token transfer - encode the transfer function call using proper ABI
170
+ txData = (0, viem_1.encodeFunctionData)({
184
171
  abi: viem_1.erc20Abi,
185
172
  functionName: "transfer",
186
173
  args: [order.globalAddress, BigInt(order.srcAmount)],
187
174
  });
188
- setTxHash(hash);
175
+ to = order.srcTokenAddress;
176
+ value = BigInt(0);
177
+ }
178
+ const txHash = await switchChainAndExecute(order.srcChain, { to, data: txData, value });
179
+ if (txHash) {
180
+ setTxHash(txHash);
189
181
  }
190
- }, [order]);
182
+ }, [order, switchChainAndExecute]);
191
183
  // Main payment handler that triggers chain switch and payment
192
184
  const handlePayment = async () => {
193
185
  console.log("Initiating payment process. Target chain:", order.srcChain, "Current chain:", walletClient?.chain?.id);
@@ -195,7 +187,8 @@ exports.OrderDetails = (0, react_5.memo)(function OrderDetails({ isMainnet, mode
195
187
  await initiatePhantomTransfer(order.srcAmount, order.srcTokenAddress, order.globalAddress);
196
188
  }
197
189
  else {
198
- await switchChainAndExecute(order.srcChain, handlePaymentProcess);
190
+ // Use unified payment process for both EOA and AA wallets
191
+ await handleUnifiedPaymentProcess();
199
192
  }
200
193
  };
201
194
  // When waitingForDeposit is true, we show a message to the user to wait for the deposit to be processed.
@@ -399,28 +392,28 @@ exports.OrderDetails = (0, react_5.memo)(function OrderDetails({ isMainnet, mode
399
392
  }
400
393
  };
401
394
  if (refundTxs) {
402
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "relative mt-4 flex w-full flex-col gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-b3-react-background absolute bottom-2 left-4 top-2 z-[5] w-2", children: (0, jsx_runtime_1.jsx)(react_4.motion.div, { className: "from-as-brand/50 absolute left-[2px] top-0 z-10 w-[3px] bg-gradient-to-b from-20% via-purple-500/50 via-80% to-transparent", initial: { height: "0%" }, animate: { height: "100%" }, transition: { duration: 1.5, ease: "easeInOut" } }) }), depositTxs
403
- ? depositTxs.map(dTx => ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
404
- ? `Received payment`
405
- : `Received ${(0, number_1.formatTokenAmount)(BigInt(dTx.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTx, isProcessing: false }, dTx.txHash)))
406
- : null, refundTxs
407
- ? refundTxs.map(rTx => ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: `Refunded ${(0, number_1.formatTokenAmount)(BigInt(rTx.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: rTx, isProcessing: false }, rTx.txHash)))
408
- : null] }), order.errorDetails && ((0, jsx_runtime_1.jsx)("div", { className: "flex justify-center", children: (0, jsx_runtime_1.jsx)("span", { className: "text-as-primary/50 text-center text-sm", style: { maxWidth: "40ch" }, children: (0, anyspend_1.getErrorDisplay)(order.errorDetails) }) })), (0, jsx_runtime_1.jsx)("button", { className: "bg-as-brand flex w-full items-center justify-center gap-2 rounded-lg p-2 font-semibold text-white", onClick: mode === "page" ? handleBack : handleCloseModal, children: mode === "page" ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Return to Home ", (0, jsx_runtime_1.jsx)(lucide_react_1.Home, { className: "ml-2 h-4 w-4" })] })) : ("Close") })] }));
395
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OrderDetailsCollapsible_1.OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount }), (0, jsx_runtime_1.jsx)(Accordion_1.Accordion, { type: "single", collapsible: true, className: "w-full", children: (0, jsx_runtime_1.jsxs)(Accordion_1.AccordionItem, { value: "refund-details", children: [(0, jsx_runtime_1.jsx)(Accordion_1.AccordionTrigger, { children: "Transaction Details" }), (0, jsx_runtime_1.jsx)(Accordion_1.AccordionContent, { children: (0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full flex-col gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: (0, jsx_runtime_1.jsx)(react_4.motion.div, { className: "bg-as-border-primary absolute left-[2px] top-0 z-10 w-[3px]", initial: { height: "0%" }, animate: { height: "100%" }, transition: { duration: 1.5, ease: "easeInOut" } }) }), depositTxs
396
+ ? depositTxs.map(dTx => ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
397
+ ? `Received payment`
398
+ : `Received ${(0, number_1.formatTokenAmount)(BigInt(dTx.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTx, isProcessing: false }, dTx.txHash)))
399
+ : null, refundTxs
400
+ ? refundTxs.map(rTx => ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: `Refunded ${(0, number_1.formatTokenAmount)(BigInt(rTx.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: rTx, isProcessing: false }, rTx.txHash)))
401
+ : null] }) })] }) }), order.errorDetails && ((0, jsx_runtime_1.jsx)("div", { className: "flex justify-center", children: (0, jsx_runtime_1.jsx)("span", { className: "text-as-primary/50 text-center text-sm", style: { maxWidth: "40ch" }, children: (0, anyspend_1.getErrorDisplay)(order.errorDetails) }) })), (0, jsx_runtime_1.jsx)("button", { className: "bg-as-brand flex w-full items-center justify-center gap-2 rounded-lg p-2 font-semibold text-white", onClick: mode === "page" ? handleBack : handleCloseModal, children: mode === "page" ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Return to Home ", (0, jsx_runtime_1.jsx)(lucide_react_1.Home, { className: "ml-2 h-4 w-4" })] })) : ("Close") })] }));
409
402
  }
410
403
  if (executeTx) {
411
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "relative mt-4 flex w-full flex-col gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-b3-react-background absolute bottom-2 left-4 top-2 z-[5] w-2", children: (0, jsx_runtime_1.jsx)(react_4.motion.div, { className: "from-as-brand/50 absolute left-[2px] top-0 z-10 w-[3px] bg-gradient-to-b from-20% via-purple-500/50 via-80% to-transparent", initial: { height: "0%" }, animate: { height: "100%" }, transition: { duration: 1.5, ease: "easeInOut" } }) }), depositTxs
412
- ? depositTxs.map(dTxs => ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
413
- ? `Received payment`
414
- : `Received ${(0, number_1.formatTokenAmount)(BigInt(dTxs.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTxs, isProcessing: false }, dTxs.txHash)))
415
- : null, (0, jsx_runtime_1.jsx)(TransactionDetails, { title: "Processed Transaction", chainId: order.srcChain, tx: relayTx, delay: 0.5, isProcessing: false }), (0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.type === "swap"
416
- ? "Processed Swap"
417
- : order.type === "mint_nft"
418
- ? "Minted NFT"
419
- : order.type === "join_tournament"
420
- ? "Joined Tournament"
421
- : order.type === "fund_tournament"
422
- ? "Funded Tournament"
423
- : "Processed Order", chainId: order.dstChain, tx: executeTx, isProcessing: false, delay: 1 })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex w-full flex-col gap-8", children: (0, jsx_runtime_1.jsx)(react_1.Button, { variant: "link", asChild: true, children: (0, jsx_runtime_1.jsxs)("a", { href: (0, anyspend_1.getExplorerTxUrl)(order.dstChain, executeTx.txHash), target: "_blank", className: "text-as-primary/70 hover:text-as-primary", style: { whiteSpace: "normal" }, children: [getOrderSuccessText({
404
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OrderDetailsCollapsible_1.OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount }), (0, jsx_runtime_1.jsx)(Accordion_1.Accordion, { type: "single", collapsible: true, className: "w-full", children: (0, jsx_runtime_1.jsxs)(Accordion_1.AccordionItem, { value: "execute-details", children: [(0, jsx_runtime_1.jsx)(Accordion_1.AccordionTrigger, { children: "Transaction Details" }), (0, jsx_runtime_1.jsx)(Accordion_1.AccordionContent, { children: (0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full flex-col gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: (0, jsx_runtime_1.jsx)(react_4.motion.div, { className: "bg-as-border-primary absolute left-[2px] top-0 z-10 w-[3px]", initial: { height: "0%" }, animate: { height: "100%" }, transition: { duration: 1.5, ease: "easeInOut" } }) }), depositTxs
405
+ ? depositTxs.map(dTxs => ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
406
+ ? `Received payment`
407
+ : `Received ${(0, number_1.formatTokenAmount)(BigInt(dTxs.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTxs, isProcessing: false }, dTxs.txHash)))
408
+ : null, (0, jsx_runtime_1.jsx)(TransactionDetails, { title: "Processed Transaction", chainId: order.srcChain, tx: relayTx, delay: 0.5, isProcessing: false }), (0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.type === "swap"
409
+ ? "Processed Swap"
410
+ : order.type === "mint_nft"
411
+ ? "Minted NFT"
412
+ : order.type === "join_tournament"
413
+ ? "Joined Tournament"
414
+ : order.type === "fund_tournament"
415
+ ? "Funded Tournament"
416
+ : "Processed Order", chainId: order.dstChain, tx: executeTx, isProcessing: false, delay: 1 })] }) })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex w-full flex-col gap-8", children: (0, jsx_runtime_1.jsx)(react_1.Button, { variant: "link", asChild: true, children: (0, jsx_runtime_1.jsxs)("a", { href: (0, anyspend_1.getExplorerTxUrl)(order.dstChain, executeTx.txHash), target: "_blank", className: "text-as-primary/70 hover:text-as-primary", style: { whiteSpace: "normal" }, children: [getOrderSuccessText({
424
417
  order,
425
418
  tournament,
426
419
  formattedActualDstAmount: formattedActualDstAmount,
@@ -430,27 +423,27 @@ exports.OrderDetails = (0, react_5.memo)(function OrderDetails({ isMainnet, mode
430
423
  }), (0, jsx_runtime_1.jsx)(lucide_react_1.ExternalLink, { className: "ml-2 h-4 w-4" })] }) }) }), order.type === "join_tournament" && order.status === "executed" && ((0, jsx_runtime_1.jsxs)(react_1.ShinyButton, { accentColor: "hsl(var(--as-brand))", textColor: "text-white", className: "flex w-full items-center gap-2", disabled: txLoading || isSwitchingOrExecuting, onClick: handleCloseModal, children: [(0, jsx_runtime_1.jsx)("span", { className: "pl-4", children: "Continue to Tournament" }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] })), order.status === "executed" && ((0, jsx_runtime_1.jsx)("button", { className: "bg-as-brand flex w-full items-center justify-center gap-2 rounded-lg p-2 font-semibold text-white", onClick: mode === "page" ? handleBack : handleCloseModal, children: mode === "page" ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Return to Home ", (0, jsx_runtime_1.jsx)(lucide_react_1.Home, { className: "ml-2 h-4 w-4" })] })) : ("Close") }))] }));
431
424
  }
432
425
  if (relayTx && relayTx.status === "success") {
433
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OrderDetailsCollapsible_1.OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount }), (0, jsx_runtime_1.jsxs)("div", { className: "relative mt-4 flex w-full flex-col gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-b3-react-background absolute bottom-2 left-4 top-2 z-[5] w-2", children: (0, jsx_runtime_1.jsx)(react_4.motion.div, { className: "from-as-brand/50 absolute left-[2px] top-0 z-10 w-[3px] bg-gradient-to-b from-20% via-purple-500/50 via-80% to-transparent", initial: { height: "0%" }, animate: { height: "100%" }, transition: { duration: 1.5, ease: "easeInOut" } }) }), depositTxs
434
- ? depositTxs.map(dTxs => ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
435
- ? `Received payment`
436
- : `Received ${(0, number_1.formatTokenAmount)(BigInt(dTxs.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTxs, isProcessing: false }, dTxs.txHash)))
437
- : null, order.srcChain === order.dstChain ? ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.type === "swap"
438
- ? "Processed Swap"
439
- : order.type === "mint_nft"
440
- ? "Minted NFT"
441
- : order.type === "join_tournament"
442
- ? "Joined Tournament"
443
- : order.type === "fund_tournament"
444
- ? "Funded Tournament"
445
- : "Processed Transaction", chainId: order.srcChain, isProcessing: false, tx: relayTx, delay: 0.5 })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(TransactionDetails, { title: "Processed Transaction", chainId: order.srcChain, isProcessing: false, tx: relayTx, delay: 0.5 }), (0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.type === "swap"
446
- ? "Processing Swap"
447
- : order.type === "mint_nft"
448
- ? "Minting NFT"
449
- : order.type === "join_tournament"
450
- ? "Joining Tournament"
451
- : order.type === "fund_tournament"
452
- ? "Funding Tournament"
453
- : "Processing Bridge", chainId: order.dstChain, isProcessing: true, tx: executeTx, delay: 1 })] }))] }), (0, jsx_runtime_1.jsx)("div", { className: "flex w-full flex-col gap-8", children: (0, jsx_runtime_1.jsx)(react_1.Button, { variant: "link", asChild: true, children: (0, jsx_runtime_1.jsxs)("a", { href: (0, anyspend_1.getExplorerTxUrl)(order.dstChain, relayTx.txHash), target: "_blank", className: "text-as-primary/70 hover:text-as-primary", style: { whiteSpace: "normal" }, children: [getOrderSuccessText({
426
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OrderDetailsCollapsible_1.OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount }), (0, jsx_runtime_1.jsx)(Accordion_1.Accordion, { type: "single", collapsible: true, className: "w-full", children: (0, jsx_runtime_1.jsxs)(Accordion_1.AccordionItem, { value: "more-details", children: [(0, jsx_runtime_1.jsx)(Accordion_1.AccordionTrigger, { children: "More Details" }), (0, jsx_runtime_1.jsx)(Accordion_1.AccordionContent, { children: (0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full flex-col gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: (0, jsx_runtime_1.jsx)(react_4.motion.div, { className: "bg-as-border-primary absolute left-[2px] top-0 z-10 w-[3px]", initial: { height: "0%" }, animate: { height: "100%" }, transition: { duration: 1.5, ease: "easeInOut" } }) }), depositTxs
427
+ ? depositTxs.map(dTxs => ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
428
+ ? `Received payment`
429
+ : `Received ${(0, number_1.formatTokenAmount)(BigInt(dTxs.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTxs, isProcessing: false }, dTxs.txHash)))
430
+ : null, order.srcChain === order.dstChain ? ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.type === "swap"
431
+ ? "Processed Swap"
432
+ : order.type === "mint_nft"
433
+ ? "Minted NFT"
434
+ : order.type === "join_tournament"
435
+ ? "Joined Tournament"
436
+ : order.type === "fund_tournament"
437
+ ? "Funded Tournament"
438
+ : "Processed Transaction", chainId: order.srcChain, isProcessing: false, tx: relayTx, delay: 0.5 })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(TransactionDetails, { title: "Processed Transaction", chainId: order.srcChain, isProcessing: false, tx: relayTx, delay: 0.5 }), (0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.type === "swap"
439
+ ? "Processing Swap"
440
+ : order.type === "mint_nft"
441
+ ? "Minting NFT"
442
+ : order.type === "join_tournament"
443
+ ? "Joining Tournament"
444
+ : order.type === "fund_tournament"
445
+ ? "Funding Tournament"
446
+ : "Processing Bridge", chainId: order.dstChain, isProcessing: true, tx: executeTx, delay: 1 })] }))] }) })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex w-full flex-col gap-8", children: (0, jsx_runtime_1.jsx)(react_1.Button, { variant: "link", asChild: true, children: (0, jsx_runtime_1.jsxs)("a", { href: (0, anyspend_1.getExplorerTxUrl)(order.dstChain, relayTx.txHash), target: "_blank", className: "text-as-primary/70 hover:text-as-primary", style: { whiteSpace: "normal" }, children: [getOrderSuccessText({
454
447
  order,
455
448
  tournament,
456
449
  formattedActualDstAmount,
@@ -462,19 +455,19 @@ exports.OrderDetails = (0, react_5.memo)(function OrderDetails({ isMainnet, mode
462
455
  // This boolean indicates that user finish payment, and waiting for the deposit to be confirmed. We get this from query params (waitingForDeposit=true)
463
456
  const waitingForDeposit = new URLSearchParams(window.location.search).get("waitingForDeposit") === "true";
464
457
  if (depositTxs?.length || waitingForDeposit) {
465
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OrderDetailsCollapsible_1.OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount }), (0, jsx_runtime_1.jsxs)("div", { className: "relative mt-4 flex w-full flex-col gap-6", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-b3-react-background absolute bottom-2 left-4 top-2 z-[5] w-2", children: (0, jsx_runtime_1.jsx)(react_4.motion.div, { className: "from-as-brand/50 absolute left-[2px] top-0 z-10 w-[3px] bg-gradient-to-b from-20% via-purple-500/50 via-80% to-transparent", initial: { height: "0%" }, animate: { height: "100%" }, transition: { duration: 1, ease: "easeInOut" } }) }), (depositTxs || []).map((dTxs, index) => ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
466
- ? `Received payment`
467
- : `Received ${(0, number_1.formatTokenAmount)(BigInt(dTxs.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTxs, isProcessing: index < (depositTxs || []).length - 1 ? false : !depositEnoughAmount }, dTxs.txHash))), statusDisplay === "failure" ? ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: statusText, chainId: order.srcChain, tx: null, isProcessing: false, delay: 0.5 })) : depositEnoughAmount ? ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.type === "swap"
468
- ? "Processing Swap"
469
- : order.type === "mint_nft"
470
- ? "Minting NFT"
471
- : order.type === "join_tournament"
472
- ? "Joining Tournament"
473
- : order.type === "fund_tournament"
474
- ? "Funding Tournament"
475
- : "Processing Transaction", chainId: order.srcChain, tx: null, isProcessing: true, delay: 0.5 })) : ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
476
- ? `Waiting for payment`
477
- : `Waiting for deposit ${formattedDepositDeficit} ${srcToken.symbol}`, chainId: order.srcChain, tx: null, isProcessing: true, delay: 0.5 }))] })] }));
458
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OrderDetailsCollapsible_1.OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount }), (0, jsx_runtime_1.jsx)(Accordion_1.Accordion, { type: "single", collapsible: true, className: "w-full", children: (0, jsx_runtime_1.jsxs)(Accordion_1.AccordionItem, { value: "deposit-details", children: [(0, jsx_runtime_1.jsx)(Accordion_1.AccordionTrigger, { children: "Transaction Details" }), (0, jsx_runtime_1.jsx)(Accordion_1.AccordionContent, { children: (0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full flex-col gap-6", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: (0, jsx_runtime_1.jsx)(react_4.motion.div, { className: "from-as-brand/50 absolute left-[2px] top-0 z-10 w-[3px] bg-gradient-to-b from-20% via-purple-500/50 via-80% to-transparent", initial: { height: "0%" }, animate: { height: "100%" }, transition: { duration: 1, ease: "easeInOut" } }) }), (depositTxs || []).map((dTxs, index) => ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
459
+ ? `Received payment`
460
+ : `Received ${(0, number_1.formatTokenAmount)(BigInt(dTxs.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTxs, isProcessing: index < (depositTxs || []).length - 1 ? false : !depositEnoughAmount }, dTxs.txHash))), statusDisplay === "failure" ? ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: statusText, chainId: order.srcChain, tx: null, isProcessing: false, delay: 0.5 })) : depositEnoughAmount ? ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.type === "swap"
461
+ ? "Processing Swap"
462
+ : order.type === "mint_nft"
463
+ ? "Minting NFT"
464
+ : order.type === "join_tournament"
465
+ ? "Joining Tournament"
466
+ : order.type === "fund_tournament"
467
+ ? "Funding Tournament"
468
+ : "Processing Transaction", chainId: order.srcChain, tx: null, isProcessing: true, delay: 0.5 })) : ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
469
+ ? `Waiting for payment`
470
+ : `Waiting for deposit ${formattedDepositDeficit} ${srcToken.symbol}`, chainId: order.srcChain, tx: null, isProcessing: true, delay: 0.5 }))] }) })] }) })] }));
478
471
  }
479
472
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [statusDisplay === "processing" && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: order.onrampMetadata ? ((0, jsx_runtime_1.jsx)(PaymentVendorUI_1.default, { isMainnet: isMainnet, order: order, dstTokenSymbol: dstToken.symbol })) : effectiveCryptoPaymentMethod === CryptoPaymentMethod_1.CryptoPaymentMethodType.CONNECT_WALLET ? ((0, jsx_runtime_1.jsx)(ConnectWalletPayment_1.default, { order: order, onPayment: handlePayment, onCancel: handleBack, txLoading: txLoading, isSwitchingOrExecuting: isSwitchingOrExecuting, phantomWalletAddress: phantomWalletAddress, tournament: tournament, nft: nft })) : effectiveCryptoPaymentMethod === CryptoPaymentMethod_1.CryptoPaymentMethodType.TRANSFER_CRYPTO ? (
480
473
  // Transfer Crypto Payment Method - Show new card-based UI
@@ -491,6 +484,6 @@ exports.OrderDetails = (0, react_5.memo)(function OrderDetails({ isMainnet, mode
491
484
  (0, jsx_runtime_1.jsx)(react_4.motion.div, { initial: { opacity: 0, filter: "blur(10px)" }, animate: { opacity: 1, filter: "blur(0px)" }, transition: { duration: 0.5, ease: "easeInOut" }, className: "flex w-full items-center justify-evenly gap-4", children: (0, jsx_runtime_1.jsxs)("div", { className: "mt-8 flex flex-col items-center rounded-lg bg-white p-6 pb-3", children: [(0, jsx_runtime_1.jsx)(qrcode_react_1.QRCodeSVG, { value: (0, anyspend_1.getPaymentUrl)(order.globalAddress, BigInt(order.srcAmount), order.srcTokenAddress === anyspend_1.RELAY_ETH_ADDRESS ? srcToken?.symbol || "ETH" : order.srcTokenAddress, order.srcChain, srcToken?.decimals), className: "max-w-[200px]" }), (0, jsx_runtime_1.jsxs)("div", { className: "mt-3 flex items-center justify-center gap-2 text-sm", children: [(0, jsx_runtime_1.jsx)("span", { className: "label-style text-as-brand/70 text-sm", children: "Scan with" }), (0, jsx_runtime_1.jsxs)(react_1.TextLoop, { interval: 3, children: [(0, jsx_runtime_1.jsx)(react_3.WalletMetamask, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_3.WalletCoinbase, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_3.WalletPhantom, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_3.WalletTrust, { className: "h-5 w-5", variant: "branded" })] })] })] }) }))] })) })), (0, jsx_runtime_1.jsxs)("div", { className: "flex w-full items-center justify-center gap-1 text-sm", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-as-primary/30", children: "Time remaining:" }), (0, jsx_runtime_1.jsx)("div", { className: "text-as-primary", children: depositEnoughAmount ? ("Received") : order.status === "expired" ? ("Expired") : ((0, jsx_runtime_1.jsx)(react_timeago_1.default, { date: new Date(order.expiredAt), live: true })) })] }), statusDisplay !== "processing" && ((0, jsx_runtime_1.jsx)(OrderDetailsCollapsible_1.OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount })), (0, jsx_runtime_1.jsxs)("button", { className: "flex w-full items-center justify-center gap-2", onClick: handleBack, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCcw, { className: "ml-2 h-4 w-4" }), " Cancel and start over"] })] }));
492
485
  });
493
486
  function TransactionDetails({ title, chainId, tx, isProcessing, delay, }) {
494
- return ((0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full flex-1 items-center justify-between gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex grow items-center gap-4", children: [(0, jsx_runtime_1.jsx)(react_4.motion.div, { className: "bg-b3-react-background relative h-10 w-10 rounded-full", children: isProcessing ? ((0, jsx_runtime_1.jsx)(react_4.motion.div, { initial: { opacity: 0, scale: 0.3 }, animate: { opacity: 1, scale: 1 }, transition: { duration: 0.5, ease: "easeInOut", delay }, className: "absolute z-10 m-2 flex h-6 w-6 items-center justify-center rounded-full bg-black/70 shadow-lg backdrop-blur-sm", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "text-as-primary h-4 w-4 animate-spin" }) })) : ((0, jsx_runtime_1.jsx)(react_4.motion.div, { initial: { opacity: 0, scale: 0.3 }, animate: { opacity: 1, scale: 1 }, transition: { duration: 0.5, ease: "easeOut", delay }, className: "bg-as-brand/70 absolute z-10 m-2 flex h-6 w-6 items-center justify-center rounded-full border border-white/30 shadow-lg backdrop-blur-sm", children: (0, jsx_runtime_1.jsx)(lucide_react_1.CheckIcon, { className: "text-as-primary h-3 w-3" }) })) }), (0, jsx_runtime_1.jsx)(react_4.motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, ease: "easeInOut", delay }, className: "shrink-0 text-base", children: isProcessing ? ((0, jsx_runtime_1.jsx)(react_1.TextShimmer, { duration: 1, children: title })) : ((0, jsx_runtime_1.jsx)("span", { className: "text-as-primary", children: title })) })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex flex-col gap-1", children: tx ? ((0, jsx_runtime_1.jsx)(react_4.motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, ease: "easeInOut", delay: (delay || 0) + 0.3 }, className: "flex items-center gap-3", children: (0, jsx_runtime_1.jsx)("a", { href: (0, anyspend_1.getExplorerTxUrl)(chainId, tx.txHash), target: "_blank", children: (0, jsx_runtime_1.jsx)("div", { className: "text-as-primary/30 font-mono text-xs", children: (0, centerTruncate_1.default)(tx?.txHash, 6) }) }) })) : null })] }));
487
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full flex-1 items-center justify-between gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex grow items-center gap-4", children: [(0, jsx_runtime_1.jsx)(react_4.motion.div, { className: "bg-as-surface-secondary relative h-10 w-10 rounded-full", children: isProcessing ? ((0, jsx_runtime_1.jsx)(react_4.motion.div, { initial: { opacity: 0, scale: 0.3 }, animate: { opacity: 1, scale: 1 }, transition: { duration: 0.5, ease: "easeInOut", delay }, className: "border-as-border-secondary absolute z-10 m-2 flex h-6 w-6 items-center justify-center rounded-full border-2 shadow-lg backdrop-blur-sm", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "text-as-primary h-4 w-4 animate-spin" }) })) : ((0, jsx_runtime_1.jsx)(react_4.motion.div, { initial: { opacity: 0, scale: 0.3 }, animate: { opacity: 1, scale: 1 }, transition: { duration: 0.5, ease: "easeOut", delay }, className: "bg-as-success-secondary absolute z-10 m-2 flex h-6 w-6 items-center justify-center rounded-full border border-white/30 shadow-lg backdrop-blur-sm", children: (0, jsx_runtime_1.jsx)(lucide_react_1.CheckIcon, { className: "text-as-content-icon-success h-4 w-4" }) })) }), (0, jsx_runtime_1.jsx)(react_4.motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, ease: "easeInOut", delay }, className: "shrink-0 text-base", children: isProcessing ? ((0, jsx_runtime_1.jsx)(react_1.TextShimmer, { duration: 1, children: title })) : ((0, jsx_runtime_1.jsx)("span", { className: "text-as-primary", children: title })) })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex flex-col gap-1", children: tx ? ((0, jsx_runtime_1.jsx)(react_4.motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, ease: "easeInOut", delay: (delay || 0) + 0.3 }, className: "flex items-center gap-3", children: (0, jsx_runtime_1.jsx)("a", { href: (0, anyspend_1.getExplorerTxUrl)(chainId, tx.txHash), target: "_blank", children: (0, jsx_runtime_1.jsx)("div", { className: "text-as-primary/30 font-mono text-xs", children: (0, centerTruncate_1.default)(tx?.txHash, 6) }) }) })) : null })] }));
495
488
  }
496
489
  exports.OrderDetailsLoadingView = ((0, jsx_runtime_1.jsxs)("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-4", children: [(0, jsx_runtime_1.jsxs)(react_1.Badge, { variant: "default", className: "hover:bg-b3-react-background flex items-center gap-3 border-white/20 bg-white/10 px-4 py-1 text-base transition-colors", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "text-as-primary h-4 w-4 animate-spin" }), (0, jsx_runtime_1.jsx)(react_1.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_1.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_1.Skeleton, { className: "h-8 w-48" }), (0, jsx_runtime_1.jsx)(react_1.Skeleton, { className: "ml-4 h-8 w-32" })] }), (0, jsx_runtime_1.jsx)(react_1.Skeleton, { className: "mt-4 h-8 w-24" })] }), (0, jsx_runtime_1.jsx)(react_1.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_1.Skeleton, { className: "rounded-lg p-6 pb-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "h-[200px] w-[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: "h-5 w-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_1.Skeleton, { className: "h-10 w-full" }, i))) })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-b3-react-background mt-8 w-full rounded-lg p-4", children: [(0, jsx_runtime_1.jsx)(react_1.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_1.Skeleton, { className: "h-10 flex-1" }), (0, jsx_runtime_1.jsx)(react_1.Skeleton, { className: "h-10 flex-1" })] })] }), (0, jsx_runtime_1.jsx)(react_1.Skeleton, { className: "h-10 w-full" })] }));
@@ -23,7 +23,7 @@ exports.OrderStatus = (0, react_1.memo)(function OrderStatus({ order }) {
23
23
  description: description,
24
24
  },
25
25
  ];
26
- if (["waiting_stripe_payment"].includes(order.status)) {
26
+ if (["waiting_stripe_payment", "scanning_deposit_transaction"].includes(order.status)) {
27
27
  return (0, jsx_runtime_1.jsx)(StepProgress_1.StepProgress, { steps: paymentSteps, currentStepIndex: 0 });
28
28
  }
29
29
  if (["relay", "sending_token_from_vault"].includes(order.status)) {
@@ -5,6 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("../../../../anyspend/react");
6
6
  const chain_1 = require("../../../../anyspend/utils/chain");
7
7
  const react_2 = require("../../../../global-account/react");
8
+ const utils_1 = require("../../../../shared/utils");
8
9
  const formatAddress_1 = require("../../../../shared/utils/formatAddress");
9
10
  const lucide_react_1 = require("lucide-react");
10
11
  const react_3 = require("react");
@@ -50,7 +51,7 @@ function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selectedPaymentMetho
50
51
  const { coinbaseOnrampOptions } = (0, react_1.useCoinbaseOnrampOptions)(true, geoData?.country || "US");
51
52
  // Get recipient profile for displaying name
52
53
  const recipientProfile = (0, react_2.useProfile)({ address: _recipientAddress });
53
- const recipientName = recipientProfile.data?.name?.replace(/\.b3\.fun/g, "");
54
+ const recipientName = recipientProfile.data?.name;
54
55
  const amountInputRef = (0, react_3.useRef)(null);
55
56
  const handleAmountChange = (e) => {
56
57
  // Only allow numbers and decimal points
@@ -70,9 +71,9 @@ function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selectedPaymentMetho
70
71
  };
71
72
  return ((0, jsx_runtime_1.jsxs)("div", { className: "bg-as-surface-primary flex w-full flex-col", children: [(0, jsx_runtime_1.jsxs)("div", { className: "border-as-border-secondary bg-as-surface-secondary relative flex w-full flex-col rounded-2xl border p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex h-7 w-full items-center justify-between", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-as-tertiarry flex items-center text-sm font-bold", children: "Pay" }), (0, jsx_runtime_1.jsx)("button", { className: "text-as-tertiarry flex h-7 items-center gap-1 text-sm", onClick: () => setActivePanel(7), children: selectedPaymentMethod === FiatPaymentMethod_1.FiatPaymentMethod.COINBASE_PAY ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-blue-600", children: (0, jsx_runtime_1.jsx)("span", { className: "text-xs font-bold text-white", children: "C" }) }), "Coinbase Pay"] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] })) : selectedPaymentMethod === FiatPaymentMethod_1.FiatPaymentMethod.STRIPE ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-blue-600", children: (0, jsx_runtime_1.jsx)("span", { className: "text-xs font-bold text-white", children: "S" }) }), "Stripe"] }), (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)("div", { className: "flex items-center justify-center pb-2 pt-8", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-1", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-as-tertiarry text-2xl font-bold", children: "$" }), (0, jsx_runtime_1.jsx)(react_2.Input, { ref: amountInputRef, type: "text", value: srcAmountOnRamp, onChange: handleAmountChange, placeholder: "5", className: "text-as-primary placeholder:text-as-primary/50 h-auto min-w-[70px] border-0 bg-transparent p-0 px-3 pt-1 text-4xl font-bold focus-visible:ring-0 focus-visible:ring-offset-0", style: {
72
73
  width: `${Math.max(50, srcAmountOnRamp.length * 34)}px`,
73
- } })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "mx-auto mb-6 inline-grid grid-cols-4 gap-2", children: ["5", "10", "25", "100"].map(value => ((0, jsx_runtime_1.jsxs)("button", { onClick: () => handleQuickAmount(value), className: `bg-as-surface-secondary border-as-border-secondary hover:border-as-border-secondary h-7 w-14 rounded-lg border text-sm font-medium transition-all duration-200 ${srcAmountOnRamp === value
74
+ } })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "mx-auto mb-6 inline-grid grid-cols-4 gap-2", children: ["5", "10", "20", "25"].map(value => ((0, jsx_runtime_1.jsxs)("button", { onClick: () => handleQuickAmount(value), className: `bg-as-surface-secondary border-as-border-secondary hover:border-as-border-secondary h-7 w-14 rounded-lg border text-sm font-medium transition-all duration-200 ${srcAmountOnRamp === value
74
75
  ? "border-as-border-secondary bg-as-surface-secondary"
75
- : "bg-as-surface-secondary hover:bg-as-surface-secondary"}`, children: ["$", value] }, value))) }), destinationToken && destinationChainId && ((0, jsx_runtime_1.jsx)(OrderTokenAmountFiat_1.OrderTokenAmountFiat, { address: _recipientAddress, context: "to", inputValue: destinationAmount || "0", onChangeInput: () => { }, chainId: destinationChainId, setChainId: onDestinationChainChange || (() => { }), token: destinationToken, setToken: onDestinationTokenChange || (() => { }) }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "border-as-border-secondary bg-as-surface-secondary mt-4 flex w-full flex-col gap-3 rounded-xl border p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex w-full items-center justify-between gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-as-tertiarry flex items-center text-sm", children: "Recipient" }), _recipientAddress ? ((0, jsx_runtime_1.jsxs)("button", { className: "text-as-tertiarry flex h-7 items-center gap-1 text-sm transition-colors hover:text-blue-700", onClick: () => setActivePanel(5), children: [(0, jsx_runtime_1.jsx)("div", { className: "flex h-6 w-6 items-center justify-center rounded-full bg-orange-500 text-xs text-white", children: "\uD83E\uDD8A" }), (0, jsx_runtime_1.jsx)("span", { className: "text-sm", children: recipientName || (0, formatAddress_1.shortenAddress)(_recipientAddress) }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { size: 16 })] })) : ((0, jsx_runtime_1.jsxs)("button", { className: "text-as-tertiarry flex h-7 items-center gap-1 text-sm transition-colors hover:text-blue-700", onClick: () => setActivePanel(5), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Wallet, { className: "text-as-brand", size: 16 }), "Select recipient", (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { size: 16 })] }))] }), (0, jsx_runtime_1.jsx)("div", { className: "divider w-full" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-as-tertiarry text-sm", children: "Expected to receive" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-as-primary font-semibold", children: [destinationAmount || "0", " ", destinationToken?.symbol || ""] }), (0, jsx_runtime_1.jsxs)("span", { className: "text-as-tertiarry text-sm", children: ["on ", destinationChainId ? chain_1.ALL_CHAINS[destinationChainId]?.name : ""] }), destinationToken && destinationChainId && destinationToken.metadata?.logoURI && ((0, jsx_runtime_1.jsx)("img", { src: chain_1.ALL_CHAINS[destinationChainId]?.logoUrl, alt: "Chain", className: "h-4 w-4 rounded-full" }))] })] }), (0, jsx_runtime_1.jsx)("div", { className: "divider w-full" }), (0, jsx_runtime_1.jsx)("div", { className: "", children: (0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-between", children: (() => {
76
+ : "bg-as-surface-secondary hover:bg-as-surface-secondary"}`, children: ["$", value] }, value))) }), destinationToken && destinationChainId && ((0, jsx_runtime_1.jsx)(OrderTokenAmountFiat_1.OrderTokenAmountFiat, { address: _recipientAddress, context: "to", inputValue: destinationAmount || "0", onChangeInput: () => { }, chainId: destinationChainId, setChainId: onDestinationChainChange || (() => { }), token: destinationToken, setToken: onDestinationTokenChange || (() => { }) }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "border-as-border-secondary bg-as-surface-secondary mt-4 flex w-full flex-col gap-3 rounded-xl border p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex w-full items-center justify-between gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-as-tertiarry flex items-center text-sm", children: "Recipient" }), _recipientAddress ? ((0, jsx_runtime_1.jsxs)("button", { className: "text-as-tertiarry flex h-7 items-center gap-1 text-sm transition-colors hover:text-blue-700", onClick: () => setActivePanel(5), children: [(0, jsx_runtime_1.jsx)("span", { className: "text-sm", children: recipientName ? (0, utils_1.formatUsername)(recipientName) : (0, formatAddress_1.formatAddress)(_recipientAddress) }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { size: 16 })] })) : ((0, jsx_runtime_1.jsxs)("button", { className: "text-as-tertiarry flex h-7 items-center gap-1 text-sm transition-colors hover:text-blue-700", onClick: () => setActivePanel(5), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Wallet, { className: "text-as-brand", size: 16 }), "Select recipient", (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { size: 16 })] }))] }), (0, jsx_runtime_1.jsx)("div", { className: "divider w-full" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-as-tertiarry text-sm", children: "Expected to receive" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-as-primary font-semibold", children: [destinationAmount || "0", " ", destinationToken?.symbol || ""] }), (0, jsx_runtime_1.jsxs)("span", { className: "text-as-tertiarry text-sm", children: ["on ", destinationChainId ? chain_1.ALL_CHAINS[destinationChainId]?.name : ""] }), destinationToken && destinationChainId && destinationToken.metadata?.logoURI && ((0, jsx_runtime_1.jsx)("img", { src: chain_1.ALL_CHAINS[destinationChainId]?.logoUrl, alt: "Chain", className: "h-4 w-4 rounded-full" }))] })] }), (0, jsx_runtime_1.jsx)("div", { className: "divider w-full" }), (0, jsx_runtime_1.jsx)("div", { className: "", children: (0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-between", children: (() => {
76
77
  const currentPaymentMethod = selectedPaymentMethod || FiatPaymentMethod_1.FiatPaymentMethod.NONE;
77
78
  const fee = getFeeFromApi(currentPaymentMethod);
78
79
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { className: "text-as-tertiarry text-sm", children: fee !== null ? `Total (included $${fee.toFixed(2)} fee)` : "Total" }), (0, jsx_runtime_1.jsxs)("span", { className: "text-as-primary font-semibold", children: ["$", getTotalAmount(currentPaymentMethod).toFixed(2)] })] }));
@@ -19,7 +19,7 @@ function PanelOnrampPayment(props) {
19
19
  }
20
20
  function PanelOnrampPaymentInner(props) {
21
21
  const { srcAmountOnRamp, recipientAddress, isMainnet, isBuyMode, destinationTokenChainId, destinationTokenAddress, selectedDstChainId, selectedDstToken, anyspendQuote, globalAddress, onOrderCreated, onBack, orderType, nft, tournament, payload, recipientEnsName, recipientImageUrl, } = props;
22
- const { geoData, coinbaseOnrampOptions, coinbaseAvailablePaymentMethods, isStripeOnrampSupported, stripeWeb2Support, isLoading: isLoadingGeoOnramp, } = (0, react_1.useGeoOnrampOptions)(isMainnet, srcAmountOnRamp);
22
+ const { geoData, coinbaseOnrampOptions, coinbaseAvailablePaymentMethods, stripeWeb2Support, isLoading: isLoadingGeoOnramp, } = (0, react_1.useGeoOnrampOptions)(isMainnet, srcAmountOnRamp);
23
23
  const isLoading = isLoadingGeoOnramp;
24
24
  const { createOrder, isCreatingOrder } = (0, react_1.useAnyspendCreateOnrampOrder)({
25
25
  onSuccess: data => {
@@ -45,10 +45,6 @@ function PanelOnrampPaymentInner(props) {
45
45
  sonner_1.toast.error("Onramp options not available");
46
46
  return;
47
47
  }
48
- if (vendor === "stripe" && !isStripeOnrampSupported) {
49
- sonner_1.toast.error("Stripe onramp not available");
50
- return;
51
- }
52
48
  if (vendor === "stripe-web2" && !stripeWeb2Support.isSupport) {
53
49
  sonner_1.toast.error("Stripe credit card not available");
54
50
  return;
@@ -7,7 +7,7 @@ const framer_motion_1 = require("framer-motion");
7
7
  const lucide_react_1 = require("lucide-react");
8
8
  function StepProgress({ steps, currentStepIndex, className = "" }) {
9
9
  const currentStep = steps[currentStepIndex];
10
- return ((0, jsx_runtime_1.jsxs)("div", { className: `flex w-full flex-col items-center gap-4 ${className}`, children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2", children: steps.map((step, index) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center", children: (0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, { initial: { scale: 0.8, opacity: 0 }, animate: { scale: 1, opacity: 1 }, transition: { delay: index * 0.2 }, className: `relative flex h-10 w-10 items-center justify-center rounded-full ${index < currentStepIndex
10
+ return ((0, jsx_runtime_1.jsxs)("div", { className: `flex w-full flex-col items-center gap-4 ${className}`, children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2", children: steps.map((_, index) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center", children: (0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, { initial: { scale: 0.8, opacity: 0 }, animate: { scale: 1, opacity: 1 }, transition: { delay: index * 0.2 }, className: `relative flex h-10 w-10 items-center justify-center rounded-full ${index < currentStepIndex
11
11
  ? "bg-as-success-secondary" // Completed step
12
12
  : index === currentStepIndex
13
13
  ? "border-as-border-secondary border-[3px]" // Current step
@@ -18,5 +18,5 @@ function StepProgress({ steps, currentStepIndex, className = "" }) {
18
18
  // Current step - show spinning border and step number
19
19
  (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "border-t-as-primary absolute -inset-0.5 animate-spin rounded-full border-[3px] border-transparent" }), (0, jsx_runtime_1.jsx)("span", { className: "text-as-primary font-semibold", children: index + 1 })] })) : (
20
20
  // Future step - show step number with disabled styling
21
- (0, jsx_runtime_1.jsx)("span", { className: "text-as-content-disabled font-semibold", children: index + 1 })) }) }, step.id), index < steps.length - 1 && ((0, jsx_runtime_1.jsx)("div", { className: "flex w-8 items-center justify-center gap-1", children: Array.from({ length: 6 }).map((_, dotIndex) => ((0, jsx_runtime_1.jsx)("div", { className: "bg-as-primary/30 h-[2px] w-[2px] rounded-full" }, dotIndex))) }))] }))) }), currentStep && ((0, jsx_runtime_1.jsxs)(framer_motion_1.motion.div, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { delay: 0.3 }, className: "text-center", children: [(0, jsx_runtime_1.jsx)("h2", { className: "text-as-primary text-xl font-semibold", children: currentStep.title }), currentStep.description && (0, jsx_runtime_1.jsx)("p", { className: "text-as-primary/50 mt-1 text-sm", children: currentStep.description })] }))] }));
21
+ (0, jsx_runtime_1.jsx)("span", { className: "text-as-content-disabled font-semibold", children: index + 1 })) }) }, index), index < steps.length - 1 && ((0, jsx_runtime_1.jsx)("div", { className: "flex w-8 items-center justify-center gap-1", children: Array.from({ length: 6 }).map((_, dotIndex) => ((0, jsx_runtime_1.jsx)("div", { className: "bg-as-primary/30 h-[2px] w-[2px] rounded-full" }, dotIndex))) }))] }))) }), currentStep && ((0, jsx_runtime_1.jsxs)(framer_motion_1.motion.div, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { delay: 0.3 }, className: "text-center", children: [(0, jsx_runtime_1.jsx)("h2", { className: "text-as-primary text-xl font-semibold", children: currentStep.title }), currentStep.description && (0, jsx_runtime_1.jsx)("p", { className: "text-as-primary/50 mt-1 text-sm", children: currentStep.description })] }))] }));
22
22
  }
@@ -17,5 +17,5 @@ function TokenBalance({ token, walletAddress, onChangeInput, }) {
17
17
  const amount = percentage === 100 ? rawBalance : (rawBalance * BigInt(percentage)) / BigInt(100);
18
18
  onChangeInput((0, viem_1.formatUnits)(amount, token.decimals));
19
19
  };
20
- return ((0, jsx_runtime_1.jsx)("div", { className: "flex h-7 items-center justify-end gap-1", children: !isLoading && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-as-primary/50 inline-flex rounded-lg text-sm", children: rawBalance ? `Balance: ${formattedBalance}` : `Balance: 0` }), !!rawBalance && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("button", { onClick: () => handlePercentageClick(20), className: "text-as-primary/50 bg-as-on-surface-2 hover:bg-as-on-surface-3 inline-flex rounded-lg px-2 py-1 text-xs transition-colors sm:hidden", children: "20%" }), (0, jsx_runtime_1.jsx)("button", { onClick: () => handlePercentageClick(50), className: "text-as-primary/50 bg-as-on-surface-2 hover:bg-as-on-surface-3 inline-flex rounded-lg px-2 py-1 text-xs transition-colors", children: "50%" }), (0, jsx_runtime_1.jsx)("button", { onClick: () => handlePercentageClick(100), className: "text-as-primary/50 bg-as-on-surface-2 hover:bg-as-on-surface-3 inline-flex rounded-lg px-2 py-1 text-xs transition-colors", children: "MAX" })] }))] })) }, `balance-${token.address}-${token.chainId}`));
20
+ return ((0, jsx_runtime_1.jsx)("div", { className: "flex h-7 items-center justify-end gap-1", children: !isLoading && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-as-primary/50 inline-flex rounded-lg text-sm", children: rawBalance ? `Balance: ${formattedBalance}` : `Balance: 0` }), !!rawBalance && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("button", { onClick: () => handlePercentageClick(100), className: "text-as-primary/50 bg-as-on-surface-2 hover:bg-as-on-surface-3 inline-flex cursor-pointer rounded-lg px-2 py-1 text-xs transition-colors", children: "MAX" }) }))] })) }, `balance-${token.address}-${token.chainId}`));
21
21
  }
@@ -30,7 +30,6 @@ export declare function useGeoOnrampOptions(isMainnet: boolean, srcFiatAmount: s
30
30
  min?: string;
31
31
  max?: string;
32
32
  }[];
33
- isStripeOnrampSupported: boolean;
34
33
  stripeWeb2Support: {
35
34
  isSupport: false;
36
35
  } | {
@@ -16,7 +16,7 @@ function useGeoOnrampOptions(isMainnet, srcFiatAmount) {
16
16
  // Use existing hooks
17
17
  const { geoData, loading: isLoadingGeo, error: geoError } = (0, useGetGeo_1.useGetGeo)();
18
18
  const { coinbaseOnrampOptions, isLoadingCoinbaseOnrampOptions, coinbaseOnrampOptionsError } = (0, useCoinbaseOnrampOptions_1.useCoinbaseOnrampOptions)(isMainnet, geoData?.country, visitorData);
19
- const { isStripeOnrampSupported, stripeWeb2Support, isLoadingStripeSupport, stripeSupportError } = (0, useStripeSupport_1.useStripeSupport)(isMainnet, srcFiatAmount, visitorData);
19
+ const { stripeWeb2Support, isLoadingStripeSupport, stripeSupportError } = (0, useStripeSupport_1.useStripeSupport)(isMainnet, srcFiatAmount, visitorData);
20
20
  // Calculate available payment methods based on the amount
21
21
  const coinbaseAvailablePaymentMethods = (0, react_1.useMemo)(() => {
22
22
  if (!coinbaseOnrampOptions?.paymentCurrencies?.[0]?.limits || !srcFiatAmount)
@@ -34,9 +34,8 @@ function useGeoOnrampOptions(isMainnet, srcFiatAmount) {
34
34
  geoData,
35
35
  coinbaseOnrampOptions,
36
36
  coinbaseAvailablePaymentMethods,
37
- isStripeOnrampSupported,
38
37
  stripeWeb2Support,
39
- isOnrampSupported: coinbaseAvailablePaymentMethods.length > 0 || isStripeOnrampSupported || stripeWeb2Support,
38
+ isOnrampSupported: coinbaseAvailablePaymentMethods.length > 0 || stripeWeb2Support,
40
39
  isLoading: isLoadingGeo || isLoadingCoinbaseOnrampOptions || isLoadingStripeSupport || isLoadingVisitorData,
41
40
  isLoadingGeo,
42
41
  isLoadingCoinbaseOnrampOptions,
@@ -48,7 +47,6 @@ function useGeoOnrampOptions(isMainnet, srcFiatAmount) {
48
47
  geoData,
49
48
  coinbaseOnrampOptions,
50
49
  coinbaseAvailablePaymentMethods,
51
- isStripeOnrampSupported,
52
50
  stripeWeb2Support,
53
51
  isLoadingGeo,
54
52
  isLoadingCoinbaseOnrampOptions,
@@ -8,8 +8,8 @@ export declare const useGenerateSigMintData: ({ recipientAddress, contractAddres
8
8
  payload: any;
9
9
  collection: {
10
10
  description?: string | undefined;
11
- metadata?: {} | undefined;
12
11
  status?: "DRAFT" | "ACTIVE" | "INACTIVE" | undefined;
12
+ metadata?: {} | undefined;
13
13
  createdAt?: string | undefined;
14
14
  updatedAt?: string | undefined;
15
15
  logoURI?: string | undefined;
@@ -38,9 +38,9 @@ export declare const useGenerateSigMintData: ({ recipientAddress, contractAddres
38
38
  maxSupply?: number | undefined;
39
39
  conditions?: {
40
40
  chainId: number;
41
+ tokenAddress: string;
41
42
  conditionType: "user-owns-tokens";
42
43
  isOnchain: boolean;
43
- tokenAddress: string;
44
44
  tokenAmount: string;
45
45
  }[] | undefined;
46
46
  isFreeMint?: boolean | undefined;
@@ -1,6 +1,5 @@
1
1
  import { VisitorData } from "../../../anyspend/types/fingerprint";
2
2
  export declare function useStripeSupport(isMainnet: boolean, usdAmount?: string, visitorData?: VisitorData, isLoadingVisitorData?: boolean): {
3
- isStripeOnrampSupported: boolean;
4
3
  stripeWeb2Support: {
5
4
  isSupport: false;
6
5
  } | {
@@ -11,7 +11,6 @@ function useStripeSupport(isMainnet, usdAmount, visitorData, isLoadingVisitorDat
11
11
  enabled: !isLoadingVisitorData,
12
12
  });
13
13
  return (0, react_1.useMemo)(() => ({
14
- isStripeOnrampSupported: data?.stripeOnramp || false,
15
14
  stripeWeb2Support: data?.stripeWeb2 || { isSupport: false },
16
15
  isLoadingStripeSupport: isLoading,
17
16
  stripeSupportError: error,
@@ -128,7 +128,7 @@ exports.EVM_MAINNET = {
128
128
  logoUrl: "https://avatars.githubusercontent.com/u/45615063?s=280&v=4",
129
129
  type: chain_1.ChainType.EVM,
130
130
  nativeRequired: (0, viem_1.parseEther)("0.00001"),
131
- canDepositNative: false,
131
+ canDepositNative: true,
132
132
  defaultToken: (0, token_1.getBnbToken)(),
133
133
  nativeToken: (0, token_1.getBnbToken)(),
134
134
  viem: getCustomEvmChain(chains_1.bsc, "https://bsc-rpc.publicnode.com"),