@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
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { ALL_CHAINS, EVM_CHAINS, getChainName, getErrorDisplay, getExplorerTxUrl, getPaymentUrl, getStatusDisplay, isNativeToken, RELAY_ETH_ADDRESS, RELAY_SOLANA_MAINNET_CHAIN_ID, } from "../../../../anyspend/index.js";
4
- import { Badge, Button, CopyToClipboard, ShinyButton, Skeleton, TextLoop, TextShimmer, useAccountWallet, useChainSwitchWithAction, useModalStore, useProfile, } from "../../../../global-account/react/index.js";
3
+ import { ALL_CHAINS, getChainName, getErrorDisplay, getExplorerTxUrl, getPaymentUrl, getStatusDisplay, isNativeToken, RELAY_ETH_ADDRESS, RELAY_SOLANA_MAINNET_CHAIN_ID, } from "../../../../anyspend/index.js";
4
+ import { Badge, Button, CopyToClipboard, ShinyButton, Skeleton, TextLoop, TextShimmer, useAccountWallet, useModalStore, useProfile, useUnifiedChainSwitchAndExecute, } from "../../../../global-account/react/index.js";
5
5
  import { useRouter, useSearchParams } from "../../../../shared/react/hooks/index.js";
6
6
  import { cn } from "../../../../shared/utils/index.js";
7
7
  import centerTruncate from "../../../../shared/utils/centerTruncate.js";
@@ -16,9 +16,10 @@ import { QRCodeSVG } from "qrcode.react";
16
16
  import { memo, useCallback, useEffect, useMemo, useState } from "react";
17
17
  import TimeAgo from "react-timeago";
18
18
  import { toast } from "sonner";
19
- import { erc20Abi } from "viem";
19
+ import { encodeFunctionData, erc20Abi } from "viem";
20
20
  import { b3 } from "viem/chains";
21
21
  import { useWaitForTransactionReceipt, useWalletClient } from "wagmi";
22
+ import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "./Accordion.js";
22
23
  import ConnectWalletPayment from "./ConnectWalletPayment.js";
23
24
  import { CryptoPaymentMethodType } from "./CryptoPaymentMethod.js";
24
25
  import { OrderDetailsCollapsible } from "./OrderDetailsCollapsible.js";
@@ -138,7 +139,7 @@ export const OrderDetails = memo(function OrderDetails({ isMainnet, mode = "moda
138
139
  const [txHash, setTxHash] = useState();
139
140
  const [showQRCode, setShowQRCode] = useState(false);
140
141
  const { isLoading: txLoading, isSuccess: txSuccess } = useWaitForTransactionReceipt({ hash: txHash });
141
- const { switchChainAndExecute, isSwitchingOrExecuting } = useChainSwitchWithAction();
142
+ const { switchChainAndExecute, isSwitchingOrExecuting } = useUnifiedChainSwitchAndExecute();
142
143
  const { colorMode } = useColorMode();
143
144
  const roundedUpSrcAmount = useMemo(() => {
144
145
  // Display the full transfer amount without rounding since users need to see the exact value they're transferring.
@@ -148,40 +149,31 @@ export const OrderDetails = memo(function OrderDetails({ isMainnet, mode = "moda
148
149
  : undefined;
149
150
  return roundTokenAmount(formattedSrcAmount);
150
151
  }, [order.srcAmount, srcToken]);
151
- // This function handles the actual payment process
152
- const handlePaymentProcess = useCallback(async (currentWalletClient) => {
153
- if (!currentWalletClient || !currentWalletClient?.chain?.id) {
154
- toast.error("Please connect your wallet");
155
- return;
156
- }
157
- console.log("Processing transaction on chain:", currentWalletClient.chain.id);
158
- const signer = currentWalletClient.account;
159
- if (!signer) {
160
- toast.error("No account connected");
161
- return;
162
- }
163
- // Send transaction
152
+ // Unified payment handler for both EOA and AA wallets
153
+ const handleUnifiedPaymentProcess = useCallback(async () => {
154
+ let txData;
155
+ let value;
156
+ let to;
164
157
  if (isNativeToken(order.srcTokenAddress)) {
165
- const hash = await currentWalletClient.sendTransaction({
166
- account: signer,
167
- chain: EVM_CHAINS[order.srcChain].viem,
168
- to: order.globalAddress,
169
- value: BigInt(order.srcAmount),
170
- });
171
- setTxHash(hash);
158
+ // Native token transfer
159
+ to = order.globalAddress;
160
+ value = BigInt(order.srcAmount);
172
161
  }
173
162
  else {
174
- const hash = await currentWalletClient.writeContract({
175
- account: signer,
176
- chain: EVM_CHAINS[order.srcChain].viem,
177
- address: order.srcTokenAddress,
163
+ // ERC20 token transfer - encode the transfer function call using proper ABI
164
+ txData = encodeFunctionData({
178
165
  abi: erc20Abi,
179
166
  functionName: "transfer",
180
167
  args: [order.globalAddress, BigInt(order.srcAmount)],
181
168
  });
182
- setTxHash(hash);
169
+ to = order.srcTokenAddress;
170
+ value = BigInt(0);
171
+ }
172
+ const txHash = await switchChainAndExecute(order.srcChain, { to, data: txData, value });
173
+ if (txHash) {
174
+ setTxHash(txHash);
183
175
  }
184
- }, [order]);
176
+ }, [order, switchChainAndExecute]);
185
177
  // Main payment handler that triggers chain switch and payment
186
178
  const handlePayment = async () => {
187
179
  console.log("Initiating payment process. Target chain:", order.srcChain, "Current chain:", walletClient?.chain?.id);
@@ -189,7 +181,8 @@ export const OrderDetails = memo(function OrderDetails({ isMainnet, mode = "moda
189
181
  await initiatePhantomTransfer(order.srcAmount, order.srcTokenAddress, order.globalAddress);
190
182
  }
191
183
  else {
192
- await switchChainAndExecute(order.srcChain, handlePaymentProcess);
184
+ // Use unified payment process for both EOA and AA wallets
185
+ await handleUnifiedPaymentProcess();
193
186
  }
194
187
  };
195
188
  // When waitingForDeposit is true, we show a message to the user to wait for the deposit to be processed.
@@ -393,28 +386,28 @@ export const OrderDetails = memo(function OrderDetails({ isMainnet, mode = "moda
393
386
  }
394
387
  };
395
388
  if (refundTxs) {
396
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "relative mt-4 flex w-full flex-col gap-4", children: [_jsx("div", { className: "bg-b3-react-background absolute bottom-2 left-4 top-2 z-[5] w-2", children: _jsx(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
397
- ? depositTxs.map(dTx => (_jsx(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
398
- ? `Received payment`
399
- : `Received ${formatTokenAmount(BigInt(dTx.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTx, isProcessing: false }, dTx.txHash)))
400
- : null, refundTxs
401
- ? refundTxs.map(rTx => (_jsx(TransactionDetails, { title: `Refunded ${formatTokenAmount(BigInt(rTx.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: rTx, isProcessing: false }, rTx.txHash)))
402
- : null] }), order.errorDetails && (_jsx("div", { className: "flex justify-center", children: _jsx("span", { className: "text-as-primary/50 text-center text-sm", style: { maxWidth: "40ch" }, children: getErrorDisplay(order.errorDetails) }) })), _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" ? (_jsxs(_Fragment, { children: ["Return to Home ", _jsx(Home, { className: "ml-2 h-4 w-4" })] })) : ("Close") })] }));
389
+ return (_jsxs(_Fragment, { children: [_jsx(OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount }), _jsx(Accordion, { type: "single", collapsible: true, className: "w-full", children: _jsxs(AccordionItem, { value: "refund-details", children: [_jsx(AccordionTrigger, { children: "Transaction Details" }), _jsx(AccordionContent, { children: _jsxs("div", { className: "relative flex w-full flex-col gap-4", children: [_jsx("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: _jsx(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
390
+ ? depositTxs.map(dTx => (_jsx(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
391
+ ? `Received payment`
392
+ : `Received ${formatTokenAmount(BigInt(dTx.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTx, isProcessing: false }, dTx.txHash)))
393
+ : null, refundTxs
394
+ ? refundTxs.map(rTx => (_jsx(TransactionDetails, { title: `Refunded ${formatTokenAmount(BigInt(rTx.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: rTx, isProcessing: false }, rTx.txHash)))
395
+ : null] }) })] }) }), order.errorDetails && (_jsx("div", { className: "flex justify-center", children: _jsx("span", { className: "text-as-primary/50 text-center text-sm", style: { maxWidth: "40ch" }, children: getErrorDisplay(order.errorDetails) }) })), _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" ? (_jsxs(_Fragment, { children: ["Return to Home ", _jsx(Home, { className: "ml-2 h-4 w-4" })] })) : ("Close") })] }));
403
396
  }
404
397
  if (executeTx) {
405
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "relative mt-4 flex w-full flex-col gap-4", children: [_jsx("div", { className: "bg-b3-react-background absolute bottom-2 left-4 top-2 z-[5] w-2", children: _jsx(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
406
- ? depositTxs.map(dTxs => (_jsx(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
407
- ? `Received payment`
408
- : `Received ${formatTokenAmount(BigInt(dTxs.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTxs, isProcessing: false }, dTxs.txHash)))
409
- : null, _jsx(TransactionDetails, { title: "Processed Transaction", chainId: order.srcChain, tx: relayTx, delay: 0.5, isProcessing: false }), _jsx(TransactionDetails, { title: order.type === "swap"
410
- ? "Processed Swap"
411
- : order.type === "mint_nft"
412
- ? "Minted NFT"
413
- : order.type === "join_tournament"
414
- ? "Joined Tournament"
415
- : order.type === "fund_tournament"
416
- ? "Funded Tournament"
417
- : "Processed Order", chainId: order.dstChain, tx: executeTx, isProcessing: false, delay: 1 })] }), _jsx("div", { className: "flex w-full flex-col gap-8", children: _jsx(Button, { variant: "link", asChild: true, children: _jsxs("a", { href: getExplorerTxUrl(order.dstChain, executeTx.txHash), target: "_blank", className: "text-as-primary/70 hover:text-as-primary", style: { whiteSpace: "normal" }, children: [getOrderSuccessText({
398
+ return (_jsxs(_Fragment, { children: [_jsx(OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount }), _jsx(Accordion, { type: "single", collapsible: true, className: "w-full", children: _jsxs(AccordionItem, { value: "execute-details", children: [_jsx(AccordionTrigger, { children: "Transaction Details" }), _jsx(AccordionContent, { children: _jsxs("div", { className: "relative flex w-full flex-col gap-4", children: [_jsx("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: _jsx(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
399
+ ? depositTxs.map(dTxs => (_jsx(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
400
+ ? `Received payment`
401
+ : `Received ${formatTokenAmount(BigInt(dTxs.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTxs, isProcessing: false }, dTxs.txHash)))
402
+ : null, _jsx(TransactionDetails, { title: "Processed Transaction", chainId: order.srcChain, tx: relayTx, delay: 0.5, isProcessing: false }), _jsx(TransactionDetails, { title: order.type === "swap"
403
+ ? "Processed Swap"
404
+ : order.type === "mint_nft"
405
+ ? "Minted NFT"
406
+ : order.type === "join_tournament"
407
+ ? "Joined Tournament"
408
+ : order.type === "fund_tournament"
409
+ ? "Funded Tournament"
410
+ : "Processed Order", chainId: order.dstChain, tx: executeTx, isProcessing: false, delay: 1 })] }) })] }) }), _jsx("div", { className: "flex w-full flex-col gap-8", children: _jsx(Button, { variant: "link", asChild: true, children: _jsxs("a", { href: getExplorerTxUrl(order.dstChain, executeTx.txHash), target: "_blank", className: "text-as-primary/70 hover:text-as-primary", style: { whiteSpace: "normal" }, children: [getOrderSuccessText({
418
411
  order,
419
412
  tournament,
420
413
  formattedActualDstAmount: formattedActualDstAmount,
@@ -424,27 +417,27 @@ export const OrderDetails = memo(function OrderDetails({ isMainnet, mode = "moda
424
417
  }), _jsx(ExternalLink, { className: "ml-2 h-4 w-4" })] }) }) }), order.type === "join_tournament" && order.status === "executed" && (_jsxs(ShinyButton, { accentColor: "hsl(var(--as-brand))", textColor: "text-white", className: "flex w-full items-center gap-2", disabled: txLoading || isSwitchingOrExecuting, onClick: handleCloseModal, children: [_jsx("span", { className: "pl-4", children: "Continue to Tournament" }), _jsx(ChevronRight, { className: "h-4 w-4" })] })), order.status === "executed" && (_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" ? (_jsxs(_Fragment, { children: ["Return to Home ", _jsx(Home, { className: "ml-2 h-4 w-4" })] })) : ("Close") }))] }));
425
418
  }
426
419
  if (relayTx && relayTx.status === "success") {
427
- return (_jsxs(_Fragment, { children: [_jsx(OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount }), _jsxs("div", { className: "relative mt-4 flex w-full flex-col gap-4", children: [_jsx("div", { className: "bg-b3-react-background absolute bottom-2 left-4 top-2 z-[5] w-2", children: _jsx(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
428
- ? depositTxs.map(dTxs => (_jsx(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
429
- ? `Received payment`
430
- : `Received ${formatTokenAmount(BigInt(dTxs.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTxs, isProcessing: false }, dTxs.txHash)))
431
- : null, order.srcChain === order.dstChain ? (_jsx(TransactionDetails, { title: order.type === "swap"
432
- ? "Processed Swap"
433
- : order.type === "mint_nft"
434
- ? "Minted NFT"
435
- : order.type === "join_tournament"
436
- ? "Joined Tournament"
437
- : order.type === "fund_tournament"
438
- ? "Funded Tournament"
439
- : "Processed Transaction", chainId: order.srcChain, isProcessing: false, tx: relayTx, delay: 0.5 })) : (_jsxs(_Fragment, { children: [_jsx(TransactionDetails, { title: "Processed Transaction", chainId: order.srcChain, isProcessing: false, tx: relayTx, delay: 0.5 }), _jsx(TransactionDetails, { title: order.type === "swap"
440
- ? "Processing Swap"
441
- : order.type === "mint_nft"
442
- ? "Minting NFT"
443
- : order.type === "join_tournament"
444
- ? "Joining Tournament"
445
- : order.type === "fund_tournament"
446
- ? "Funding Tournament"
447
- : "Processing Bridge", chainId: order.dstChain, isProcessing: true, tx: executeTx, delay: 1 })] }))] }), _jsx("div", { className: "flex w-full flex-col gap-8", children: _jsx(Button, { variant: "link", asChild: true, children: _jsxs("a", { href: getExplorerTxUrl(order.dstChain, relayTx.txHash), target: "_blank", className: "text-as-primary/70 hover:text-as-primary", style: { whiteSpace: "normal" }, children: [getOrderSuccessText({
420
+ return (_jsxs(_Fragment, { children: [_jsx(OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount }), _jsx(Accordion, { type: "single", collapsible: true, className: "w-full", children: _jsxs(AccordionItem, { value: "more-details", children: [_jsx(AccordionTrigger, { children: "More Details" }), _jsx(AccordionContent, { children: _jsxs("div", { className: "relative flex w-full flex-col gap-4", children: [_jsx("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: _jsx(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
421
+ ? depositTxs.map(dTxs => (_jsx(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
422
+ ? `Received payment`
423
+ : `Received ${formatTokenAmount(BigInt(dTxs.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTxs, isProcessing: false }, dTxs.txHash)))
424
+ : null, order.srcChain === order.dstChain ? (_jsx(TransactionDetails, { title: order.type === "swap"
425
+ ? "Processed Swap"
426
+ : order.type === "mint_nft"
427
+ ? "Minted NFT"
428
+ : order.type === "join_tournament"
429
+ ? "Joined Tournament"
430
+ : order.type === "fund_tournament"
431
+ ? "Funded Tournament"
432
+ : "Processed Transaction", chainId: order.srcChain, isProcessing: false, tx: relayTx, delay: 0.5 })) : (_jsxs(_Fragment, { children: [_jsx(TransactionDetails, { title: "Processed Transaction", chainId: order.srcChain, isProcessing: false, tx: relayTx, delay: 0.5 }), _jsx(TransactionDetails, { title: order.type === "swap"
433
+ ? "Processing Swap"
434
+ : order.type === "mint_nft"
435
+ ? "Minting NFT"
436
+ : order.type === "join_tournament"
437
+ ? "Joining Tournament"
438
+ : order.type === "fund_tournament"
439
+ ? "Funding Tournament"
440
+ : "Processing Bridge", chainId: order.dstChain, isProcessing: true, tx: executeTx, delay: 1 })] }))] }) })] }) }), _jsx("div", { className: "flex w-full flex-col gap-8", children: _jsx(Button, { variant: "link", asChild: true, children: _jsxs("a", { href: getExplorerTxUrl(order.dstChain, relayTx.txHash), target: "_blank", className: "text-as-primary/70 hover:text-as-primary", style: { whiteSpace: "normal" }, children: [getOrderSuccessText({
448
441
  order,
449
442
  tournament,
450
443
  formattedActualDstAmount,
@@ -456,19 +449,19 @@ export const OrderDetails = memo(function OrderDetails({ isMainnet, mode = "moda
456
449
  // This boolean indicates that user finish payment, and waiting for the deposit to be confirmed. We get this from query params (waitingForDeposit=true)
457
450
  const waitingForDeposit = new URLSearchParams(window.location.search).get("waitingForDeposit") === "true";
458
451
  if (depositTxs?.length || waitingForDeposit) {
459
- return (_jsxs(_Fragment, { children: [_jsx(OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount }), _jsxs("div", { className: "relative mt-4 flex w-full flex-col gap-6", children: [_jsx("div", { className: "bg-b3-react-background absolute bottom-2 left-4 top-2 z-[5] w-2", children: _jsx(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) => (_jsx(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
460
- ? `Received payment`
461
- : `Received ${formatTokenAmount(BigInt(dTxs.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTxs, isProcessing: index < (depositTxs || []).length - 1 ? false : !depositEnoughAmount }, dTxs.txHash))), statusDisplay === "failure" ? (_jsx(TransactionDetails, { title: statusText, chainId: order.srcChain, tx: null, isProcessing: false, delay: 0.5 })) : depositEnoughAmount ? (_jsx(TransactionDetails, { title: order.type === "swap"
462
- ? "Processing Swap"
463
- : order.type === "mint_nft"
464
- ? "Minting NFT"
465
- : order.type === "join_tournament"
466
- ? "Joining Tournament"
467
- : order.type === "fund_tournament"
468
- ? "Funding Tournament"
469
- : "Processing Transaction", chainId: order.srcChain, tx: null, isProcessing: true, delay: 0.5 })) : (_jsx(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
470
- ? `Waiting for payment`
471
- : `Waiting for deposit ${formattedDepositDeficit} ${srcToken.symbol}`, chainId: order.srcChain, tx: null, isProcessing: true, delay: 0.5 }))] })] }));
452
+ return (_jsxs(_Fragment, { children: [_jsx(OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount }), _jsx(Accordion, { type: "single", collapsible: true, className: "w-full", children: _jsxs(AccordionItem, { value: "deposit-details", children: [_jsx(AccordionTrigger, { children: "Transaction Details" }), _jsx(AccordionContent, { children: _jsxs("div", { className: "relative flex w-full flex-col gap-6", children: [_jsx("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: _jsx(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) => (_jsx(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
453
+ ? `Received payment`
454
+ : `Received ${formatTokenAmount(BigInt(dTxs.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTxs, isProcessing: index < (depositTxs || []).length - 1 ? false : !depositEnoughAmount }, dTxs.txHash))), statusDisplay === "failure" ? (_jsx(TransactionDetails, { title: statusText, chainId: order.srcChain, tx: null, isProcessing: false, delay: 0.5 })) : depositEnoughAmount ? (_jsx(TransactionDetails, { title: order.type === "swap"
455
+ ? "Processing Swap"
456
+ : order.type === "mint_nft"
457
+ ? "Minting NFT"
458
+ : order.type === "join_tournament"
459
+ ? "Joining Tournament"
460
+ : order.type === "fund_tournament"
461
+ ? "Funding Tournament"
462
+ : "Processing Transaction", chainId: order.srcChain, tx: null, isProcessing: true, delay: 0.5 })) : (_jsx(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
463
+ ? `Waiting for payment`
464
+ : `Waiting for deposit ${formattedDepositDeficit} ${srcToken.symbol}`, chainId: order.srcChain, tx: null, isProcessing: true, delay: 0.5 }))] }) })] }) })] }));
472
465
  }
473
466
  return (_jsxs(_Fragment, { children: [statusDisplay === "processing" && (_jsx(_Fragment, { children: order.onrampMetadata ? (_jsx(PaymentVendorUI, { isMainnet: isMainnet, order: order, dstTokenSymbol: dstToken.symbol })) : effectiveCryptoPaymentMethod === CryptoPaymentMethodType.CONNECT_WALLET ? (_jsx(ConnectWalletPayment, { order: order, onPayment: handlePayment, onCancel: handleBack, txLoading: txLoading, isSwitchingOrExecuting: isSwitchingOrExecuting, phantomWalletAddress: phantomWalletAddress, tournament: tournament, nft: nft })) : effectiveCryptoPaymentMethod === CryptoPaymentMethodType.TRANSFER_CRYPTO ? (
474
467
  // Transfer Crypto Payment Method - Show new card-based UI
@@ -485,6 +478,6 @@ export const OrderDetails = memo(function OrderDetails({ isMainnet, mode = "moda
485
478
  _jsx(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: _jsxs("div", { className: "mt-8 flex flex-col items-center rounded-lg bg-white p-6 pb-3", children: [_jsx(QRCodeSVG, { value: getPaymentUrl(order.globalAddress, BigInt(order.srcAmount), order.srcTokenAddress === RELAY_ETH_ADDRESS ? srcToken?.symbol || "ETH" : order.srcTokenAddress, order.srcChain, srcToken?.decimals), className: "max-w-[200px]" }), _jsxs("div", { className: "mt-3 flex items-center justify-center gap-2 text-sm", children: [_jsx("span", { className: "label-style text-as-brand/70 text-sm", children: "Scan with" }), _jsxs(TextLoop, { interval: 3, children: [_jsx(WalletMetamask, { className: "h-5 w-5", variant: "branded" }), _jsx(WalletCoinbase, { className: "h-5 w-5", variant: "branded" }), _jsx(WalletPhantom, { className: "h-5 w-5", variant: "branded" }), _jsx(WalletTrust, { className: "h-5 w-5", variant: "branded" })] })] })] }) }))] })) })), _jsxs("div", { className: "flex w-full items-center justify-center gap-1 text-sm", children: [_jsx("div", { className: "text-as-primary/30", children: "Time remaining:" }), _jsx("div", { className: "text-as-primary", children: depositEnoughAmount ? ("Received") : order.status === "expired" ? ("Expired") : (_jsx(TimeAgo, { date: new Date(order.expiredAt), live: true })) })] }), statusDisplay !== "processing" && (_jsx(OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount })), _jsxs("button", { className: "flex w-full items-center justify-center gap-2", onClick: handleBack, children: [_jsx(RefreshCcw, { className: "ml-2 h-4 w-4" }), " Cancel and start over"] })] }));
486
479
  });
487
480
  function TransactionDetails({ title, chainId, tx, isProcessing, delay, }) {
488
- return (_jsxs("div", { className: "relative flex w-full flex-1 items-center justify-between gap-4", children: [_jsxs("div", { className: "flex grow items-center gap-4", children: [_jsx(motion.div, { className: "bg-b3-react-background relative h-10 w-10 rounded-full", children: isProcessing ? (_jsx(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: _jsx(Loader2, { className: "text-as-primary h-4 w-4 animate-spin" }) })) : (_jsx(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: _jsx(CheckIcon, { className: "text-as-primary h-3 w-3" }) })) }), _jsx(motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, ease: "easeInOut", delay }, className: "shrink-0 text-base", children: isProcessing ? (_jsx(TextShimmer, { duration: 1, children: title })) : (_jsx("span", { className: "text-as-primary", children: title })) })] }), _jsx("div", { className: "flex flex-col gap-1", children: tx ? (_jsx(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: _jsx("a", { href: getExplorerTxUrl(chainId, tx.txHash), target: "_blank", children: _jsx("div", { className: "text-as-primary/30 font-mono text-xs", children: centerTruncate(tx?.txHash, 6) }) }) })) : null })] }));
481
+ return (_jsxs("div", { className: "relative flex w-full flex-1 items-center justify-between gap-4", children: [_jsxs("div", { className: "flex grow items-center gap-4", children: [_jsx(motion.div, { className: "bg-as-surface-secondary relative h-10 w-10 rounded-full", children: isProcessing ? (_jsx(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: _jsx(Loader2, { className: "text-as-primary h-4 w-4 animate-spin" }) })) : (_jsx(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: _jsx(CheckIcon, { className: "text-as-content-icon-success h-4 w-4" }) })) }), _jsx(motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, ease: "easeInOut", delay }, className: "shrink-0 text-base", children: isProcessing ? (_jsx(TextShimmer, { duration: 1, children: title })) : (_jsx("span", { className: "text-as-primary", children: title })) })] }), _jsx("div", { className: "flex flex-col gap-1", children: tx ? (_jsx(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: _jsx("a", { href: getExplorerTxUrl(chainId, tx.txHash), target: "_blank", children: _jsx("div", { className: "text-as-primary/30 font-mono text-xs", children: centerTruncate(tx?.txHash, 6) }) }) })) : null })] }));
489
482
  }
490
483
  export const OrderDetailsLoadingView = (_jsxs("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-4", children: [_jsxs(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: [_jsx(Loader2, { className: "text-as-primary h-4 w-4 animate-spin" }), _jsx(TextShimmer, { duration: 1, className: "font-sf-rounded text-base font-semibold", children: "Loading..." })] }), _jsxs("div", { className: "flex w-full flex-1 flex-col", children: [_jsxs("div", { className: "mb-4 flex flex-col gap-1", children: [_jsx(Skeleton, { className: "h-4 w-24" }), _jsxs("div", { className: "mt-2 flex items-center gap-2", children: [_jsx(Skeleton, { className: "h-8 w-48" }), _jsx(Skeleton, { className: "ml-4 h-8 w-32" })] }), _jsx(Skeleton, { className: "mt-4 h-8 w-24" })] }), _jsx(Skeleton, { className: "mb-4 h-12 w-full" }), _jsxs("div", { className: "flex w-full items-center justify-between gap-4", children: [_jsxs(Skeleton, { className: "rounded-lg p-6 pb-3", children: [_jsx("div", { className: "h-[200px] w-[200px]" }), _jsx("div", { className: "mt-3 flex items-center justify-center gap-2", children: _jsx("div", { className: "h-5 w-5 rounded-full" }) })] }), _jsx("div", { className: "flex flex-1 flex-col gap-2", children: [1, 2, 3].map(i => (_jsx(Skeleton, { className: "h-10 w-full" }, i))) })] })] }), _jsxs("div", { className: "bg-b3-react-background mt-8 w-full rounded-lg p-4", children: [_jsx(Skeleton, { className: "mb-3 h-4 w-48" }), _jsxs("div", { className: "flex items-center gap-4", children: [_jsx(Skeleton, { className: "h-10 flex-1" }), _jsx(Skeleton, { className: "h-10 flex-1" })] })] }), _jsx(Skeleton, { className: "h-10 w-full" })] }));
@@ -20,7 +20,7 @@ export const OrderStatus = memo(function OrderStatus({ order }) {
20
20
  description: description,
21
21
  },
22
22
  ];
23
- if (["waiting_stripe_payment"].includes(order.status)) {
23
+ if (["waiting_stripe_payment", "scanning_deposit_transaction"].includes(order.status)) {
24
24
  return _jsx(StepProgress, { steps: paymentSteps, currentStepIndex: 0 });
25
25
  }
26
26
  if (["relay", "sending_token_from_vault"].includes(order.status)) {
@@ -2,7 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
2
2
  import { useCoinbaseOnrampOptions, useGeoOnrampOptions } from "../../../../anyspend/react/index.js";
3
3
  import { ALL_CHAINS } from "../../../../anyspend/utils/chain.js";
4
4
  import { Input, useGetGeo, useProfile } from "../../../../global-account/react/index.js";
5
- import { shortenAddress } from "../../../../shared/utils/formatAddress.js";
5
+ import { formatUsername } from "../../../../shared/utils/index.js";
6
+ import { formatAddress } from "../../../../shared/utils/formatAddress.js";
6
7
  import { ChevronRight, Wallet } from "lucide-react";
7
8
  import { useRef } from "react";
8
9
  import { toast } from "sonner";
@@ -47,7 +48,7 @@ export function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selectedPayme
47
48
  const { coinbaseOnrampOptions } = useCoinbaseOnrampOptions(true, geoData?.country || "US");
48
49
  // Get recipient profile for displaying name
49
50
  const recipientProfile = useProfile({ address: _recipientAddress });
50
- const recipientName = recipientProfile.data?.name?.replace(/\.b3\.fun/g, "");
51
+ const recipientName = recipientProfile.data?.name;
51
52
  const amountInputRef = useRef(null);
52
53
  const handleAmountChange = (e) => {
53
54
  // Only allow numbers and decimal points
@@ -67,9 +68,9 @@ export function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selectedPayme
67
68
  };
68
69
  return (_jsxs("div", { className: "bg-as-surface-primary flex w-full flex-col", children: [_jsxs("div", { className: "border-as-border-secondary bg-as-surface-secondary relative flex w-full flex-col rounded-2xl border p-4", children: [_jsxs("div", { className: "flex h-7 w-full items-center justify-between", children: [_jsx("span", { className: "text-as-tertiarry flex items-center text-sm font-bold", children: "Pay" }), _jsx("button", { className: "text-as-tertiarry flex h-7 items-center gap-1 text-sm", onClick: () => setActivePanel(7), children: selectedPaymentMethod === FiatPaymentMethod.COINBASE_PAY ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-blue-600", children: _jsx("span", { className: "text-xs font-bold text-white", children: "C" }) }), "Coinbase Pay"] }), _jsx(ChevronRight, { className: "h-4 w-4" })] })) : selectedPaymentMethod === FiatPaymentMethod.STRIPE ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-blue-600", children: _jsx("span", { className: "text-xs font-bold text-white", children: "S" }) }), "Stripe"] }), _jsx(ChevronRight, { className: "h-4 w-4" })] })) : (_jsxs(_Fragment, { children: ["Select payment method", _jsx(ChevronRight, { className: "h-4 w-4" })] })) })] }), _jsx("div", { className: "flex items-center justify-center pb-2 pt-8", children: _jsxs("div", { className: "flex gap-1", children: [_jsx("span", { className: "text-as-tertiarry text-2xl font-bold", children: "$" }), _jsx(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: {
69
70
  width: `${Math.max(50, srcAmountOnRamp.length * 34)}px`,
70
- } })] }) }), _jsx("div", { className: "mx-auto mb-6 inline-grid grid-cols-4 gap-2", children: ["5", "10", "25", "100"].map(value => (_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
71
+ } })] }) }), _jsx("div", { className: "mx-auto mb-6 inline-grid grid-cols-4 gap-2", children: ["5", "10", "20", "25"].map(value => (_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
71
72
  ? "border-as-border-secondary bg-as-surface-secondary"
72
- : "bg-as-surface-secondary hover:bg-as-surface-secondary"}`, children: ["$", value] }, value))) }), destinationToken && destinationChainId && (_jsx(OrderTokenAmountFiat, { address: _recipientAddress, context: "to", inputValue: destinationAmount || "0", onChangeInput: () => { }, chainId: destinationChainId, setChainId: onDestinationChainChange || (() => { }), token: destinationToken, setToken: onDestinationTokenChange || (() => { }) }))] }), _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: [_jsxs("div", { className: "flex w-full items-center justify-between gap-2", children: [_jsx("span", { className: "text-as-tertiarry flex items-center text-sm", children: "Recipient" }), _recipientAddress ? (_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: [_jsx("div", { className: "flex h-6 w-6 items-center justify-center rounded-full bg-orange-500 text-xs text-white", children: "\uD83E\uDD8A" }), _jsx("span", { className: "text-sm", children: recipientName || shortenAddress(_recipientAddress) }), _jsx(ChevronRight, { size: 16 })] })) : (_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: [_jsx(Wallet, { className: "text-as-brand", size: 16 }), "Select recipient", _jsx(ChevronRight, { size: 16 })] }))] }), _jsx("div", { className: "divider w-full" }), _jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-as-tertiarry text-sm", children: "Expected to receive" }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("span", { className: "text-as-primary font-semibold", children: [destinationAmount || "0", " ", destinationToken?.symbol || ""] }), _jsxs("span", { className: "text-as-tertiarry text-sm", children: ["on ", destinationChainId ? ALL_CHAINS[destinationChainId]?.name : ""] }), destinationToken && destinationChainId && destinationToken.metadata?.logoURI && (_jsx("img", { src: ALL_CHAINS[destinationChainId]?.logoUrl, alt: "Chain", className: "h-4 w-4 rounded-full" }))] })] }), _jsx("div", { className: "divider w-full" }), _jsx("div", { className: "", children: _jsx("div", { className: "flex items-center justify-between", children: (() => {
73
+ : "bg-as-surface-secondary hover:bg-as-surface-secondary"}`, children: ["$", value] }, value))) }), destinationToken && destinationChainId && (_jsx(OrderTokenAmountFiat, { address: _recipientAddress, context: "to", inputValue: destinationAmount || "0", onChangeInput: () => { }, chainId: destinationChainId, setChainId: onDestinationChainChange || (() => { }), token: destinationToken, setToken: onDestinationTokenChange || (() => { }) }))] }), _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: [_jsxs("div", { className: "flex w-full items-center justify-between gap-2", children: [_jsx("span", { className: "text-as-tertiarry flex items-center text-sm", children: "Recipient" }), _recipientAddress ? (_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: [_jsx("span", { className: "text-sm", children: recipientName ? formatUsername(recipientName) : formatAddress(_recipientAddress) }), _jsx(ChevronRight, { size: 16 })] })) : (_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: [_jsx(Wallet, { className: "text-as-brand", size: 16 }), "Select recipient", _jsx(ChevronRight, { size: 16 })] }))] }), _jsx("div", { className: "divider w-full" }), _jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-as-tertiarry text-sm", children: "Expected to receive" }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("span", { className: "text-as-primary font-semibold", children: [destinationAmount || "0", " ", destinationToken?.symbol || ""] }), _jsxs("span", { className: "text-as-tertiarry text-sm", children: ["on ", destinationChainId ? ALL_CHAINS[destinationChainId]?.name : ""] }), destinationToken && destinationChainId && destinationToken.metadata?.logoURI && (_jsx("img", { src: ALL_CHAINS[destinationChainId]?.logoUrl, alt: "Chain", className: "h-4 w-4 rounded-full" }))] })] }), _jsx("div", { className: "divider w-full" }), _jsx("div", { className: "", children: _jsx("div", { className: "flex items-center justify-between", children: (() => {
73
74
  const currentPaymentMethod = selectedPaymentMethod || FiatPaymentMethod.NONE;
74
75
  const fee = getFeeFromApi(currentPaymentMethod);
75
76
  return (_jsxs(_Fragment, { children: [_jsx("span", { className: "text-as-tertiarry text-sm", children: fee !== null ? `Total (included $${fee.toFixed(2)} fee)` : "Total" }), _jsxs("span", { className: "text-as-primary font-semibold", children: ["$", getTotalAmount(currentPaymentMethod).toFixed(2)] })] }));
@@ -13,7 +13,7 @@ export function PanelOnrampPayment(props) {
13
13
  }
14
14
  function PanelOnrampPaymentInner(props) {
15
15
  const { srcAmountOnRamp, recipientAddress, isMainnet, isBuyMode, destinationTokenChainId, destinationTokenAddress, selectedDstChainId, selectedDstToken, anyspendQuote, globalAddress, onOrderCreated, onBack, orderType, nft, tournament, payload, recipientEnsName, recipientImageUrl, } = props;
16
- const { geoData, coinbaseOnrampOptions, coinbaseAvailablePaymentMethods, isStripeOnrampSupported, stripeWeb2Support, isLoading: isLoadingGeoOnramp, } = useGeoOnrampOptions(isMainnet, srcAmountOnRamp);
16
+ const { geoData, coinbaseOnrampOptions, coinbaseAvailablePaymentMethods, stripeWeb2Support, isLoading: isLoadingGeoOnramp, } = useGeoOnrampOptions(isMainnet, srcAmountOnRamp);
17
17
  const isLoading = isLoadingGeoOnramp;
18
18
  const { createOrder, isCreatingOrder } = useAnyspendCreateOnrampOrder({
19
19
  onSuccess: data => {
@@ -39,10 +39,6 @@ function PanelOnrampPaymentInner(props) {
39
39
  toast.error("Onramp options not available");
40
40
  return;
41
41
  }
42
- if (vendor === "stripe" && !isStripeOnrampSupported) {
43
- toast.error("Stripe onramp not available");
44
- return;
45
- }
46
42
  if (vendor === "stripe-web2" && !stripeWeb2Support.isSupport) {
47
43
  toast.error("Stripe credit card not available");
48
44
  return;
@@ -4,7 +4,7 @@ import { motion } from "framer-motion";
4
4
  import { CheckIcon } from "lucide-react";
5
5
  export function StepProgress({ steps, currentStepIndex, className = "" }) {
6
6
  const currentStep = steps[currentStepIndex];
7
- return (_jsxs("div", { className: `flex w-full flex-col items-center gap-4 ${className}`, children: [_jsx("div", { className: "flex items-center gap-2", children: steps.map((step, index) => (_jsxs(_Fragment, { children: [_jsx("div", { className: "flex items-center", children: _jsx(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
7
+ return (_jsxs("div", { className: `flex w-full flex-col items-center gap-4 ${className}`, children: [_jsx("div", { className: "flex items-center gap-2", children: steps.map((_, index) => (_jsxs(_Fragment, { children: [_jsx("div", { className: "flex items-center", children: _jsx(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
8
8
  ? "bg-as-success-secondary" // Completed step
9
9
  : index === currentStepIndex
10
10
  ? "border-as-border-secondary border-[3px]" // Current step
@@ -15,5 +15,5 @@ export function StepProgress({ steps, currentStepIndex, className = "" }) {
15
15
  // Current step - show spinning border and step number
16
16
  _jsxs(_Fragment, { children: [_jsx("div", { className: "border-t-as-primary absolute -inset-0.5 animate-spin rounded-full border-[3px] border-transparent" }), _jsx("span", { className: "text-as-primary font-semibold", children: index + 1 })] })) : (
17
17
  // Future step - show step number with disabled styling
18
- _jsx("span", { className: "text-as-content-disabled font-semibold", children: index + 1 })) }) }, step.id), index < steps.length - 1 && (_jsx("div", { className: "flex w-8 items-center justify-center gap-1", children: Array.from({ length: 6 }).map((_, dotIndex) => (_jsx("div", { className: "bg-as-primary/30 h-[2px] w-[2px] rounded-full" }, dotIndex))) }))] }))) }), currentStep && (_jsxs(motion.div, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { delay: 0.3 }, className: "text-center", children: [_jsx("h2", { className: "text-as-primary text-xl font-semibold", children: currentStep.title }), currentStep.description && _jsx("p", { className: "text-as-primary/50 mt-1 text-sm", children: currentStep.description })] }))] }));
18
+ _jsx("span", { className: "text-as-content-disabled font-semibold", children: index + 1 })) }) }, index), index < steps.length - 1 && (_jsx("div", { className: "flex w-8 items-center justify-center gap-1", children: Array.from({ length: 6 }).map((_, dotIndex) => (_jsx("div", { className: "bg-as-primary/30 h-[2px] w-[2px] rounded-full" }, dotIndex))) }))] }))) }), currentStep && (_jsxs(motion.div, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { delay: 0.3 }, className: "text-center", children: [_jsx("h2", { className: "text-as-primary text-xl font-semibold", children: currentStep.title }), currentStep.description && _jsx("p", { className: "text-as-primary/50 mt-1 text-sm", children: currentStep.description })] }))] }));
19
19
  }
@@ -14,5 +14,5 @@ export function TokenBalance({ token, walletAddress, onChangeInput, }) {
14
14
  const amount = percentage === 100 ? rawBalance : (rawBalance * BigInt(percentage)) / BigInt(100);
15
15
  onChangeInput(formatUnits(amount, token.decimals));
16
16
  };
17
- return (_jsx("div", { className: "flex h-7 items-center justify-end gap-1", children: !isLoading && (_jsxs(_Fragment, { children: [_jsx("div", { className: "text-as-primary/50 inline-flex rounded-lg text-sm", children: rawBalance ? `Balance: ${formattedBalance}` : `Balance: 0` }), !!rawBalance && (_jsxs(_Fragment, { children: [_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%" }), _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%" }), _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}`));
17
+ return (_jsx("div", { className: "flex h-7 items-center justify-end gap-1", children: !isLoading && (_jsxs(_Fragment, { children: [_jsx("div", { className: "text-as-primary/50 inline-flex rounded-lg text-sm", children: rawBalance ? `Balance: ${formattedBalance}` : `Balance: 0` }), !!rawBalance && (_jsx(_Fragment, { children: _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}`));
18
18
  }
@@ -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
  } | {
@@ -13,7 +13,7 @@ export function useGeoOnrampOptions(isMainnet, srcFiatAmount) {
13
13
  // Use existing hooks
14
14
  const { geoData, loading: isLoadingGeo, error: geoError } = useGetGeo();
15
15
  const { coinbaseOnrampOptions, isLoadingCoinbaseOnrampOptions, coinbaseOnrampOptionsError } = useCoinbaseOnrampOptions(isMainnet, geoData?.country, visitorData);
16
- const { isStripeOnrampSupported, stripeWeb2Support, isLoadingStripeSupport, stripeSupportError } = useStripeSupport(isMainnet, srcFiatAmount, visitorData);
16
+ const { stripeWeb2Support, isLoadingStripeSupport, stripeSupportError } = useStripeSupport(isMainnet, srcFiatAmount, visitorData);
17
17
  // Calculate available payment methods based on the amount
18
18
  const coinbaseAvailablePaymentMethods = useMemo(() => {
19
19
  if (!coinbaseOnrampOptions?.paymentCurrencies?.[0]?.limits || !srcFiatAmount)
@@ -31,9 +31,8 @@ export function useGeoOnrampOptions(isMainnet, srcFiatAmount) {
31
31
  geoData,
32
32
  coinbaseOnrampOptions,
33
33
  coinbaseAvailablePaymentMethods,
34
- isStripeOnrampSupported,
35
34
  stripeWeb2Support,
36
- isOnrampSupported: coinbaseAvailablePaymentMethods.length > 0 || isStripeOnrampSupported || stripeWeb2Support,
35
+ isOnrampSupported: coinbaseAvailablePaymentMethods.length > 0 || stripeWeb2Support,
37
36
  isLoading: isLoadingGeo || isLoadingCoinbaseOnrampOptions || isLoadingStripeSupport || isLoadingVisitorData,
38
37
  isLoadingGeo,
39
38
  isLoadingCoinbaseOnrampOptions,
@@ -45,7 +44,6 @@ export function useGeoOnrampOptions(isMainnet, srcFiatAmount) {
45
44
  geoData,
46
45
  coinbaseOnrampOptions,
47
46
  coinbaseAvailablePaymentMethods,
48
- isStripeOnrampSupported,
49
47
  stripeWeb2Support,
50
48
  isLoadingGeo,
51
49
  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
  } | {
@@ -8,7 +8,6 @@ export function useStripeSupport(isMainnet, usdAmount, visitorData, isLoadingVis
8
8
  enabled: !isLoadingVisitorData,
9
9
  });
10
10
  return useMemo(() => ({
11
- isStripeOnrampSupported: data?.stripeOnramp || false,
12
11
  stripeWeb2Support: data?.stripeWeb2 || { isSupport: false },
13
12
  isLoadingStripeSupport: isLoading,
14
13
  stripeSupportError: error,
@@ -105,7 +105,7 @@ export const EVM_MAINNET = {
105
105
  logoUrl: "https://avatars.githubusercontent.com/u/45615063?s=280&v=4",
106
106
  type: ChainType.EVM,
107
107
  nativeRequired: parseEther("0.00001"),
108
- canDepositNative: false,
108
+ canDepositNative: true,
109
109
  defaultToken: getBnbToken(),
110
110
  nativeToken: getBnbToken(),
111
111
  viem: getCustomEvmChain(bsc, "https://bsc-rpc.publicnode.com"),