@b3dotfun/sdk 0.1.66 → 0.1.68

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 (365) hide show
  1. package/dist/cjs/anyspend/react/components/AnySpend.d.ts +9 -0
  2. package/dist/cjs/anyspend/react/components/AnySpend.js +40 -11
  3. package/dist/cjs/anyspend/react/components/AnySpendBondKit.d.ts +6 -1
  4. package/dist/cjs/anyspend/react/components/AnySpendBondKit.js +2 -2
  5. package/dist/cjs/anyspend/react/components/AnySpendBuySpin.d.ts +7 -1
  6. package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +2 -2
  7. package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +5 -1
  8. package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.js +2 -2
  9. package/dist/cjs/anyspend/react/components/AnySpendCustom.d.ts +9 -0
  10. package/dist/cjs/anyspend/react/components/AnySpendCustom.js +16 -14
  11. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +9 -0
  12. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +40 -10
  13. package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +10 -1
  14. package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +5 -4
  15. package/dist/cjs/anyspend/react/components/AnySpendDepositUpside.d.ts +7 -1
  16. package/dist/cjs/anyspend/react/components/AnySpendDepositUpside.js +2 -2
  17. package/dist/cjs/anyspend/react/components/AnySpendNFT.d.ts +7 -1
  18. package/dist/cjs/anyspend/react/components/AnySpendNFT.js +2 -2
  19. package/dist/cjs/anyspend/react/components/AnySpendStakeB3.d.ts +7 -1
  20. package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +2 -2
  21. package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +7 -1
  22. package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.js +2 -2
  23. package/dist/cjs/anyspend/react/components/AnySpendStakeUpside.d.ts +7 -1
  24. package/dist/cjs/anyspend/react/components/AnySpendStakeUpside.js +2 -2
  25. package/dist/cjs/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +7 -1
  26. package/dist/cjs/anyspend/react/components/AnySpendStakeUpsideExactIn.js +2 -2
  27. package/dist/cjs/anyspend/react/components/AnySpendTournament.d.ts +11 -0
  28. package/dist/cjs/anyspend/react/components/AnySpendTournament.js +2 -2
  29. package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +7 -1
  30. package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +2 -2
  31. package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.d.ts +5 -1
  32. package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.js +2 -2
  33. package/dist/cjs/anyspend/react/components/checkout/AddressForm.d.ts +9 -0
  34. package/dist/cjs/anyspend/react/components/checkout/AddressForm.js +14 -0
  35. package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckout.d.ts +117 -0
  36. package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckout.js +158 -0
  37. package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckoutTrigger.d.ts +81 -0
  38. package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckoutTrigger.js +61 -0
  39. package/dist/cjs/anyspend/react/components/checkout/CartItemRow.d.ts +8 -0
  40. package/dist/cjs/anyspend/react/components/checkout/CartItemRow.js +9 -0
  41. package/dist/cjs/anyspend/react/components/checkout/CartSummary.d.ts +30 -0
  42. package/dist/cjs/anyspend/react/components/checkout/CartSummary.js +20 -0
  43. package/dist/cjs/anyspend/react/components/checkout/CheckoutCartPanel.d.ts +32 -0
  44. package/dist/cjs/anyspend/react/components/checkout/CheckoutCartPanel.js +27 -0
  45. package/dist/cjs/anyspend/react/components/checkout/CheckoutFormField.d.ts +10 -0
  46. package/dist/cjs/anyspend/react/components/checkout/CheckoutFormField.js +31 -0
  47. package/dist/cjs/anyspend/react/components/checkout/CheckoutFormPanel.d.ts +39 -0
  48. package/dist/cjs/anyspend/react/components/checkout/CheckoutFormPanel.js +75 -0
  49. package/dist/cjs/anyspend/react/components/checkout/CheckoutLayout.d.ts +10 -0
  50. package/dist/cjs/anyspend/react/components/checkout/CheckoutLayout.js +13 -0
  51. package/dist/cjs/anyspend/react/components/checkout/CheckoutOrderStatus.d.ts +28 -0
  52. package/dist/cjs/anyspend/react/components/checkout/CheckoutOrderStatus.js +65 -0
  53. package/dist/cjs/anyspend/react/components/checkout/CheckoutPaymentPanel.d.ts +31 -0
  54. package/dist/cjs/anyspend/react/components/checkout/CheckoutPaymentPanel.js +64 -0
  55. package/dist/cjs/anyspend/react/components/checkout/CheckoutSuccess.d.ts +10 -0
  56. package/dist/cjs/anyspend/react/components/checkout/CheckoutSuccess.js +31 -0
  57. package/dist/cjs/anyspend/react/components/checkout/CoinbaseCheckoutPanel.d.ts +20 -0
  58. package/dist/cjs/anyspend/react/components/checkout/CoinbaseCheckoutPanel.js +170 -0
  59. package/dist/cjs/anyspend/react/components/checkout/CryptoPayPanel.d.ts +23 -0
  60. package/dist/cjs/anyspend/react/components/checkout/CryptoPayPanel.js +324 -0
  61. package/dist/cjs/anyspend/react/components/checkout/DiscountCodeInput.d.ts +12 -0
  62. package/dist/cjs/anyspend/react/components/checkout/DiscountCodeInput.js +62 -0
  63. package/dist/cjs/anyspend/react/components/checkout/FiatCheckoutPanel.d.ts +20 -0
  64. package/dist/cjs/anyspend/react/components/checkout/FiatCheckoutPanel.js +269 -0
  65. package/dist/cjs/anyspend/react/components/checkout/PoweredByBranding.d.ts +8 -0
  66. package/dist/cjs/anyspend/react/components/checkout/PoweredByBranding.js +9 -0
  67. package/dist/cjs/anyspend/react/components/checkout/ShippingSelector.d.ts +11 -0
  68. package/dist/cjs/anyspend/react/components/checkout/ShippingSelector.js +20 -0
  69. package/dist/cjs/anyspend/react/components/common/ConnectWalletPayment.js +19 -5
  70. package/dist/cjs/anyspend/react/components/common/CryptoPaySection.js +1 -1
  71. package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethodDisplay.js +1 -1
  72. package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.js +1 -1
  73. package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.js +4 -4
  74. package/dist/cjs/anyspend/react/components/common/OrderStatus.d.ts +2 -1
  75. package/dist/cjs/anyspend/react/components/common/OrderStatus.js +93 -19
  76. package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +4 -4
  77. package/dist/cjs/anyspend/react/components/common/PaySection.js +1 -1
  78. package/dist/cjs/anyspend/react/components/common/StepProgress.d.ts +5 -1
  79. package/dist/cjs/anyspend/react/components/common/StepProgress.js +6 -11
  80. package/dist/cjs/anyspend/react/components/common/TransferCryptoDetails.js +1 -1
  81. package/dist/cjs/anyspend/react/components/common/TransferResultScreen.js +5 -1
  82. package/dist/cjs/anyspend/react/components/context/AnySpendCustomizationContext.d.ts +16 -0
  83. package/dist/cjs/anyspend/react/components/context/AnySpendCustomizationContext.js +92 -0
  84. package/dist/cjs/anyspend/react/components/icons/AnimatedCheckmark.d.ts +23 -0
  85. package/dist/cjs/anyspend/react/components/icons/AnimatedCheckmark.js +71 -0
  86. package/dist/cjs/anyspend/react/components/index.d.ts +8 -1
  87. package/dist/cjs/anyspend/react/components/index.js +10 -1
  88. package/dist/cjs/anyspend/react/components/types/classes.d.ts +50 -0
  89. package/dist/cjs/anyspend/react/components/types/customization.d.ts +75 -0
  90. package/dist/cjs/anyspend/react/components/types/customization.js +2 -0
  91. package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOnrampOrder.d.ts +8 -2
  92. package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +8 -2
  93. package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.d.ts +15 -3
  94. package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.js +3 -2
  95. package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +9 -2
  96. package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.js +1 -0
  97. package/dist/cjs/anyspend/services/anyspend.d.ts +1 -0
  98. package/dist/cjs/anyspend/services/anyspend.js +17 -2
  99. package/dist/cjs/anyspend/types/forms.d.ts +92 -0
  100. package/dist/cjs/anyspend/types/forms.js +8 -0
  101. package/dist/cjs/anyspend/utils/format.js +12 -3
  102. package/dist/cjs/app.shared.js +8 -0
  103. package/dist/cjs/global-account/react/components/B3DynamicModal.js +9 -3
  104. package/dist/cjs/global-account/react/components/WalletImage/WalletImage.d.ts +1 -1
  105. package/dist/cjs/global-account/react/components/ui/command.d.ts +7 -7
  106. package/dist/cjs/global-account/react/components/ui/dialog.d.ts +2 -0
  107. package/dist/cjs/global-account/react/components/ui/dialog.js +2 -2
  108. package/dist/cjs/global-account/react/components/ui/drawer.d.ts +3 -1
  109. package/dist/cjs/global-account/react/components/ui/drawer.js +1 -1
  110. package/dist/cjs/global-account/react/hooks/useAuth.d.ts +1 -1
  111. package/dist/cjs/global-account/react/hooks/useAuthentication.d.ts +1 -1
  112. package/dist/cjs/global-account/react/hooks/useFirstEOA.d.ts +4 -4
  113. package/dist/cjs/global-account/react/hooks/useUser.d.ts +1 -1
  114. package/dist/cjs/global-account/react/hooks/useUserQuery.d.ts +1 -1
  115. package/dist/cjs/global-account/react/stores/useModalStore.d.ts +53 -1
  116. package/dist/cjs/shared/constants/chains/b3Chain.d.ts +2 -2
  117. package/dist/cjs/shared/constants/chains/supported.d.ts +3 -3
  118. package/dist/cjs/shared/utils/number.d.ts +5 -0
  119. package/dist/cjs/shared/utils/number.js +13 -0
  120. package/dist/esm/anyspend/react/components/AnySpend.d.ts +9 -0
  121. package/dist/esm/anyspend/react/components/AnySpend.js +41 -12
  122. package/dist/esm/anyspend/react/components/AnySpendBondKit.d.ts +6 -1
  123. package/dist/esm/anyspend/react/components/AnySpendBondKit.js +2 -2
  124. package/dist/esm/anyspend/react/components/AnySpendBuySpin.d.ts +7 -1
  125. package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +2 -2
  126. package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +5 -1
  127. package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.js +2 -2
  128. package/dist/esm/anyspend/react/components/AnySpendCustom.d.ts +9 -0
  129. package/dist/esm/anyspend/react/components/AnySpendCustom.js +16 -14
  130. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +9 -0
  131. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +42 -12
  132. package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +10 -1
  133. package/dist/esm/anyspend/react/components/AnySpendDeposit.js +5 -4
  134. package/dist/esm/anyspend/react/components/AnySpendDepositUpside.d.ts +7 -1
  135. package/dist/esm/anyspend/react/components/AnySpendDepositUpside.js +2 -2
  136. package/dist/esm/anyspend/react/components/AnySpendNFT.d.ts +7 -1
  137. package/dist/esm/anyspend/react/components/AnySpendNFT.js +2 -2
  138. package/dist/esm/anyspend/react/components/AnySpendStakeB3.d.ts +7 -1
  139. package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +2 -2
  140. package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +7 -1
  141. package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.js +2 -2
  142. package/dist/esm/anyspend/react/components/AnySpendStakeUpside.d.ts +7 -1
  143. package/dist/esm/anyspend/react/components/AnySpendStakeUpside.js +2 -2
  144. package/dist/esm/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +7 -1
  145. package/dist/esm/anyspend/react/components/AnySpendStakeUpsideExactIn.js +2 -2
  146. package/dist/esm/anyspend/react/components/AnySpendTournament.d.ts +11 -0
  147. package/dist/esm/anyspend/react/components/AnySpendTournament.js +2 -2
  148. package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +7 -1
  149. package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +2 -2
  150. package/dist/esm/anyspend/react/components/AnyspendSignatureMint.d.ts +5 -1
  151. package/dist/esm/anyspend/react/components/AnyspendSignatureMint.js +2 -2
  152. package/dist/esm/anyspend/react/components/checkout/AddressForm.d.ts +9 -0
  153. package/dist/esm/anyspend/react/components/checkout/AddressForm.js +11 -0
  154. package/dist/esm/anyspend/react/components/checkout/AnySpendCheckout.d.ts +117 -0
  155. package/dist/esm/anyspend/react/components/checkout/AnySpendCheckout.js +155 -0
  156. package/dist/esm/anyspend/react/components/checkout/AnySpendCheckoutTrigger.d.ts +81 -0
  157. package/dist/esm/anyspend/react/components/checkout/AnySpendCheckoutTrigger.js +58 -0
  158. package/dist/esm/anyspend/react/components/checkout/CartItemRow.d.ts +8 -0
  159. package/dist/esm/anyspend/react/components/checkout/CartItemRow.js +6 -0
  160. package/dist/esm/anyspend/react/components/checkout/CartSummary.d.ts +30 -0
  161. package/dist/esm/anyspend/react/components/checkout/CartSummary.js +17 -0
  162. package/dist/esm/anyspend/react/components/checkout/CheckoutCartPanel.d.ts +32 -0
  163. package/dist/esm/anyspend/react/components/checkout/CheckoutCartPanel.js +24 -0
  164. package/dist/esm/anyspend/react/components/checkout/CheckoutFormField.d.ts +10 -0
  165. package/dist/esm/anyspend/react/components/checkout/CheckoutFormField.js +28 -0
  166. package/dist/esm/anyspend/react/components/checkout/CheckoutFormPanel.d.ts +39 -0
  167. package/dist/esm/anyspend/react/components/checkout/CheckoutFormPanel.js +72 -0
  168. package/dist/esm/anyspend/react/components/checkout/CheckoutLayout.d.ts +10 -0
  169. package/dist/esm/anyspend/react/components/checkout/CheckoutLayout.js +10 -0
  170. package/dist/esm/anyspend/react/components/checkout/CheckoutOrderStatus.d.ts +28 -0
  171. package/dist/esm/anyspend/react/components/checkout/CheckoutOrderStatus.js +62 -0
  172. package/dist/esm/anyspend/react/components/checkout/CheckoutPaymentPanel.d.ts +31 -0
  173. package/dist/esm/anyspend/react/components/checkout/CheckoutPaymentPanel.js +61 -0
  174. package/dist/esm/anyspend/react/components/checkout/CheckoutSuccess.d.ts +10 -0
  175. package/dist/esm/anyspend/react/components/checkout/CheckoutSuccess.js +28 -0
  176. package/dist/esm/anyspend/react/components/checkout/CoinbaseCheckoutPanel.d.ts +20 -0
  177. package/dist/esm/anyspend/react/components/checkout/CoinbaseCheckoutPanel.js +167 -0
  178. package/dist/esm/anyspend/react/components/checkout/CryptoPayPanel.d.ts +23 -0
  179. package/dist/esm/anyspend/react/components/checkout/CryptoPayPanel.js +321 -0
  180. package/dist/esm/anyspend/react/components/checkout/DiscountCodeInput.d.ts +12 -0
  181. package/dist/esm/anyspend/react/components/checkout/DiscountCodeInput.js +59 -0
  182. package/dist/esm/anyspend/react/components/checkout/FiatCheckoutPanel.d.ts +20 -0
  183. package/dist/esm/anyspend/react/components/checkout/FiatCheckoutPanel.js +266 -0
  184. package/dist/esm/anyspend/react/components/checkout/PoweredByBranding.d.ts +8 -0
  185. package/dist/esm/anyspend/react/components/checkout/PoweredByBranding.js +6 -0
  186. package/dist/esm/anyspend/react/components/checkout/ShippingSelector.d.ts +11 -0
  187. package/dist/esm/anyspend/react/components/checkout/ShippingSelector.js +17 -0
  188. package/dist/esm/anyspend/react/components/common/ConnectWalletPayment.js +19 -5
  189. package/dist/esm/anyspend/react/components/common/CryptoPaySection.js +1 -1
  190. package/dist/esm/anyspend/react/components/common/CryptoPaymentMethodDisplay.js +1 -1
  191. package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.js +1 -1
  192. package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.js +4 -4
  193. package/dist/esm/anyspend/react/components/common/OrderStatus.d.ts +2 -1
  194. package/dist/esm/anyspend/react/components/common/OrderStatus.js +96 -22
  195. package/dist/esm/anyspend/react/components/common/PanelOnramp.js +4 -4
  196. package/dist/esm/anyspend/react/components/common/PaySection.js +1 -1
  197. package/dist/esm/anyspend/react/components/common/StepProgress.d.ts +5 -1
  198. package/dist/esm/anyspend/react/components/common/StepProgress.js +6 -11
  199. package/dist/esm/anyspend/react/components/common/TransferCryptoDetails.js +1 -1
  200. package/dist/esm/anyspend/react/components/common/TransferResultScreen.js +7 -3
  201. package/dist/esm/anyspend/react/components/context/AnySpendCustomizationContext.d.ts +16 -0
  202. package/dist/esm/anyspend/react/components/context/AnySpendCustomizationContext.js +88 -0
  203. package/dist/esm/anyspend/react/components/icons/AnimatedCheckmark.d.ts +23 -0
  204. package/dist/esm/anyspend/react/components/icons/AnimatedCheckmark.js +68 -0
  205. package/dist/esm/anyspend/react/components/index.d.ts +8 -1
  206. package/dist/esm/anyspend/react/components/index.js +5 -0
  207. package/dist/esm/anyspend/react/components/types/classes.d.ts +50 -0
  208. package/dist/esm/anyspend/react/components/types/customization.d.ts +75 -0
  209. package/dist/esm/anyspend/react/components/types/customization.js +1 -0
  210. package/dist/esm/anyspend/react/hooks/useAnyspendCreateOnrampOrder.d.ts +8 -2
  211. package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +8 -2
  212. package/dist/esm/anyspend/react/hooks/useAnyspendFlow.d.ts +15 -3
  213. package/dist/esm/anyspend/react/hooks/useAnyspendFlow.js +3 -2
  214. package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +9 -2
  215. package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.js +1 -0
  216. package/dist/esm/anyspend/services/anyspend.d.ts +1 -0
  217. package/dist/esm/anyspend/services/anyspend.js +17 -2
  218. package/dist/esm/anyspend/types/forms.d.ts +92 -0
  219. package/dist/esm/anyspend/types/forms.js +7 -0
  220. package/dist/esm/anyspend/utils/format.js +12 -3
  221. package/dist/esm/app.shared.js +8 -0
  222. package/dist/esm/global-account/react/components/B3DynamicModal.js +9 -3
  223. package/dist/esm/global-account/react/components/WalletImage/WalletImage.d.ts +1 -1
  224. package/dist/esm/global-account/react/components/ui/command.d.ts +7 -7
  225. package/dist/esm/global-account/react/components/ui/dialog.d.ts +2 -0
  226. package/dist/esm/global-account/react/components/ui/dialog.js +2 -2
  227. package/dist/esm/global-account/react/components/ui/drawer.d.ts +3 -1
  228. package/dist/esm/global-account/react/components/ui/drawer.js +1 -1
  229. package/dist/esm/global-account/react/hooks/useAuth.d.ts +1 -1
  230. package/dist/esm/global-account/react/hooks/useAuthentication.d.ts +1 -1
  231. package/dist/esm/global-account/react/hooks/useFirstEOA.d.ts +4 -4
  232. package/dist/esm/global-account/react/hooks/useUser.d.ts +1 -1
  233. package/dist/esm/global-account/react/hooks/useUserQuery.d.ts +1 -1
  234. package/dist/esm/global-account/react/stores/useModalStore.d.ts +53 -1
  235. package/dist/esm/shared/constants/chains/b3Chain.d.ts +2 -2
  236. package/dist/esm/shared/constants/chains/supported.d.ts +3 -3
  237. package/dist/esm/shared/utils/number.d.ts +5 -0
  238. package/dist/esm/shared/utils/number.js +12 -0
  239. package/dist/styles/index.css +1 -1
  240. package/dist/types/anyspend/react/components/AnySpend.d.ts +9 -0
  241. package/dist/types/anyspend/react/components/AnySpendBondKit.d.ts +6 -1
  242. package/dist/types/anyspend/react/components/AnySpendBuySpin.d.ts +7 -1
  243. package/dist/types/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +5 -1
  244. package/dist/types/anyspend/react/components/AnySpendCustom.d.ts +9 -0
  245. package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +9 -0
  246. package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +10 -1
  247. package/dist/types/anyspend/react/components/AnySpendDepositUpside.d.ts +7 -1
  248. package/dist/types/anyspend/react/components/AnySpendNFT.d.ts +7 -1
  249. package/dist/types/anyspend/react/components/AnySpendStakeB3.d.ts +7 -1
  250. package/dist/types/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +7 -1
  251. package/dist/types/anyspend/react/components/AnySpendStakeUpside.d.ts +7 -1
  252. package/dist/types/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +7 -1
  253. package/dist/types/anyspend/react/components/AnySpendTournament.d.ts +11 -0
  254. package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +7 -1
  255. package/dist/types/anyspend/react/components/AnyspendSignatureMint.d.ts +5 -1
  256. package/dist/types/anyspend/react/components/checkout/AddressForm.d.ts +9 -0
  257. package/dist/types/anyspend/react/components/checkout/AnySpendCheckout.d.ts +117 -0
  258. package/dist/types/anyspend/react/components/checkout/AnySpendCheckoutTrigger.d.ts +81 -0
  259. package/dist/types/anyspend/react/components/checkout/CartItemRow.d.ts +8 -0
  260. package/dist/types/anyspend/react/components/checkout/CartSummary.d.ts +30 -0
  261. package/dist/types/anyspend/react/components/checkout/CheckoutCartPanel.d.ts +32 -0
  262. package/dist/types/anyspend/react/components/checkout/CheckoutFormField.d.ts +10 -0
  263. package/dist/types/anyspend/react/components/checkout/CheckoutFormPanel.d.ts +39 -0
  264. package/dist/types/anyspend/react/components/checkout/CheckoutLayout.d.ts +10 -0
  265. package/dist/types/anyspend/react/components/checkout/CheckoutOrderStatus.d.ts +28 -0
  266. package/dist/types/anyspend/react/components/checkout/CheckoutPaymentPanel.d.ts +31 -0
  267. package/dist/types/anyspend/react/components/checkout/CheckoutSuccess.d.ts +10 -0
  268. package/dist/types/anyspend/react/components/checkout/CoinbaseCheckoutPanel.d.ts +20 -0
  269. package/dist/types/anyspend/react/components/checkout/CryptoPayPanel.d.ts +23 -0
  270. package/dist/types/anyspend/react/components/checkout/DiscountCodeInput.d.ts +12 -0
  271. package/dist/types/anyspend/react/components/checkout/FiatCheckoutPanel.d.ts +20 -0
  272. package/dist/types/anyspend/react/components/checkout/PoweredByBranding.d.ts +8 -0
  273. package/dist/types/anyspend/react/components/checkout/ShippingSelector.d.ts +11 -0
  274. package/dist/types/anyspend/react/components/common/OrderStatus.d.ts +2 -1
  275. package/dist/types/anyspend/react/components/common/StepProgress.d.ts +5 -1
  276. package/dist/types/anyspend/react/components/context/AnySpendCustomizationContext.d.ts +16 -0
  277. package/dist/types/anyspend/react/components/icons/AnimatedCheckmark.d.ts +23 -0
  278. package/dist/types/anyspend/react/components/index.d.ts +8 -1
  279. package/dist/types/anyspend/react/components/types/classes.d.ts +50 -0
  280. package/dist/types/anyspend/react/components/types/customization.d.ts +75 -0
  281. package/dist/types/anyspend/react/hooks/useAnyspendCreateOnrampOrder.d.ts +8 -2
  282. package/dist/types/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +8 -2
  283. package/dist/types/anyspend/react/hooks/useAnyspendFlow.d.ts +15 -3
  284. package/dist/types/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +9 -2
  285. package/dist/types/anyspend/services/anyspend.d.ts +1 -0
  286. package/dist/types/anyspend/types/forms.d.ts +92 -0
  287. package/dist/types/global-account/react/components/WalletImage/WalletImage.d.ts +1 -1
  288. package/dist/types/global-account/react/components/ui/command.d.ts +7 -7
  289. package/dist/types/global-account/react/components/ui/dialog.d.ts +2 -0
  290. package/dist/types/global-account/react/components/ui/drawer.d.ts +3 -1
  291. package/dist/types/global-account/react/hooks/useAuth.d.ts +1 -1
  292. package/dist/types/global-account/react/hooks/useAuthentication.d.ts +1 -1
  293. package/dist/types/global-account/react/hooks/useFirstEOA.d.ts +4 -4
  294. package/dist/types/global-account/react/hooks/useUser.d.ts +1 -1
  295. package/dist/types/global-account/react/hooks/useUserQuery.d.ts +1 -1
  296. package/dist/types/global-account/react/stores/useModalStore.d.ts +53 -1
  297. package/dist/types/shared/constants/chains/b3Chain.d.ts +2 -2
  298. package/dist/types/shared/constants/chains/supported.d.ts +3 -3
  299. package/dist/types/shared/utils/number.d.ts +5 -0
  300. package/package.json +1 -1
  301. package/src/anyspend/react/components/AnySpend.tsx +84 -37
  302. package/src/anyspend/react/components/AnySpendBondKit.tsx +12 -1
  303. package/src/anyspend/react/components/AnySpendBuySpin.tsx +14 -0
  304. package/src/anyspend/react/components/AnySpendCollectorClubPurchase.tsx +10 -0
  305. package/src/anyspend/react/components/AnySpendCustom.tsx +38 -20
  306. package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +82 -35
  307. package/src/anyspend/react/components/AnySpendDeposit.tsx +24 -2
  308. package/src/anyspend/react/components/AnySpendDepositUpside.tsx +14 -0
  309. package/src/anyspend/react/components/AnySpendNFT.tsx +14 -0
  310. package/src/anyspend/react/components/AnySpendStakeB3.tsx +14 -0
  311. package/src/anyspend/react/components/AnySpendStakeB3ExactIn.tsx +14 -0
  312. package/src/anyspend/react/components/AnySpendStakeUpside.tsx +14 -0
  313. package/src/anyspend/react/components/AnySpendStakeUpsideExactIn.tsx +14 -0
  314. package/src/anyspend/react/components/AnySpendTournament.tsx +19 -0
  315. package/src/anyspend/react/components/AnyspendDepositHype.tsx +14 -0
  316. package/src/anyspend/react/components/AnyspendSignatureMint.tsx +10 -0
  317. package/src/anyspend/react/components/checkout/AddressForm.tsx +98 -0
  318. package/src/anyspend/react/components/checkout/AnySpendCheckout.tsx +398 -0
  319. package/src/anyspend/react/components/checkout/AnySpendCheckoutTrigger.tsx +221 -0
  320. package/src/anyspend/react/components/checkout/CartItemRow.tsx +58 -0
  321. package/src/anyspend/react/components/checkout/CartSummary.tsx +158 -0
  322. package/src/anyspend/react/components/checkout/CheckoutCartPanel.tsx +98 -0
  323. package/src/anyspend/react/components/checkout/CheckoutFormField.tsx +129 -0
  324. package/src/anyspend/react/components/checkout/CheckoutFormPanel.tsx +241 -0
  325. package/src/anyspend/react/components/checkout/CheckoutLayout.tsx +52 -0
  326. package/src/anyspend/react/components/checkout/CheckoutOrderStatus.tsx +224 -0
  327. package/src/anyspend/react/components/checkout/CheckoutPaymentPanel.tsx +341 -0
  328. package/src/anyspend/react/components/checkout/CheckoutSuccess.tsx +110 -0
  329. package/src/anyspend/react/components/checkout/CoinbaseCheckoutPanel.tsx +279 -0
  330. package/src/anyspend/react/components/checkout/CryptoPayPanel.tsx +630 -0
  331. package/src/anyspend/react/components/checkout/DiscountCodeInput.tsx +127 -0
  332. package/src/anyspend/react/components/checkout/FiatCheckoutPanel.tsx +612 -0
  333. package/src/anyspend/react/components/checkout/PoweredByBranding.tsx +42 -0
  334. package/src/anyspend/react/components/checkout/ShippingSelector.tsx +73 -0
  335. package/src/anyspend/react/components/common/ConnectWalletPayment.tsx +29 -7
  336. package/src/anyspend/react/components/common/CryptoPaySection.tsx +1 -1
  337. package/src/anyspend/react/components/common/CryptoPaymentMethodDisplay.tsx +1 -1
  338. package/src/anyspend/react/components/common/CryptoReceiveSection.tsx +2 -2
  339. package/src/anyspend/react/components/common/OrderDetailsCollapsible.tsx +5 -5
  340. package/src/anyspend/react/components/common/OrderStatus.tsx +140 -34
  341. package/src/anyspend/react/components/common/PanelOnramp.tsx +9 -9
  342. package/src/anyspend/react/components/common/PaySection.tsx +1 -1
  343. package/src/anyspend/react/components/common/StepProgress.tsx +40 -52
  344. package/src/anyspend/react/components/common/TokenBalance.tsx +0 -12
  345. package/src/anyspend/react/components/common/TransferCryptoDetails.tsx +1 -9
  346. package/src/anyspend/react/components/common/TransferResultScreen.tsx +19 -11
  347. package/src/anyspend/react/components/context/AnySpendCustomizationContext.tsx +124 -0
  348. package/src/anyspend/react/components/icons/AnimatedCheckmark.tsx +119 -0
  349. package/src/anyspend/react/components/index.ts +33 -0
  350. package/src/anyspend/react/components/types/classes.ts +70 -0
  351. package/src/anyspend/react/components/types/customization.ts +99 -0
  352. package/src/anyspend/react/hooks/useAnyspendCreateOnrampOrder.ts +3 -2
  353. package/src/anyspend/react/hooks/useAnyspendCreateOrder.ts +3 -2
  354. package/src/anyspend/react/hooks/useAnyspendFlow.ts +5 -1
  355. package/src/anyspend/react/hooks/useCreateDepositFirstOrder.ts +5 -2
  356. package/src/anyspend/services/anyspend.ts +19 -2
  357. package/src/anyspend/types/forms.ts +97 -0
  358. package/src/anyspend/utils/format.ts +12 -3
  359. package/src/app.shared.ts +11 -0
  360. package/src/global-account/react/components/B3DynamicModal.tsx +13 -4
  361. package/src/global-account/react/components/ui/dialog.tsx +17 -8
  362. package/src/global-account/react/components/ui/drawer.tsx +2 -2
  363. package/src/global-account/react/stores/useModalStore.ts +52 -1
  364. package/src/shared/utils/number.ts +12 -0
  365. package/src/styles/index.css +48 -2
@@ -17,6 +17,7 @@ import { useCryptoPaymentMethodState } from "../hooks/useCryptoPaymentMethodStat
17
17
  import { useOnOrderSuccess } from "../hooks/useOnOrderSuccess.js";
18
18
  import { useRecipientAddressState } from "../hooks/useRecipientAddressState.js";
19
19
  import { AnySpendFingerprintWrapper, getFingerprintConfig } from "./AnySpendFingerprintWrapper.js";
20
+ import { AnySpendCustomizationProvider } from "./context/AnySpendCustomizationContext.js";
20
21
  import { CryptoPaymentMethod, CryptoPaymentMethodType } from "./common/CryptoPaymentMethod.js";
21
22
  import { CryptoPaymentMethodDisplay } from "./common/CryptoPaymentMethodDisplay.js";
22
23
  import { FeeBreakDown } from "./common/FeeBreakDown.js";
@@ -106,9 +107,9 @@ function generateGetRelayQuoteRequest({ orderType, srcChainId, srcToken, dstChai
106
107
  }
107
108
  export function AnySpendCustom(props) {
108
109
  const fingerprintConfig = getFingerprintConfig();
109
- return (_jsx(AnySpendFingerprintWrapper, { fingerprint: fingerprintConfig, children: _jsx(AnySpendCustomInner, { ...props }) }));
110
+ return (_jsx(AnySpendFingerprintWrapper, { fingerprint: fingerprintConfig, children: _jsx(AnySpendCustomizationProvider, { slots: props.slots, content: props.content, theme: props.theme, children: _jsx(AnySpendCustomInner, { ...props }) }) }));
110
111
  }
111
- function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabProps = "crypto", recipientAddress: recipientAddressProps, spenderAddress, orderType, dstChainId, dstToken, dstAmount, contractAddress, encodedData, metadata, header, onSuccess, showRecipient = true, onShowPointsDetail, srcFiatAmount: srcFiatAmountProps, forceFiatPayment, }) {
112
+ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabProps = "crypto", recipientAddress: recipientAddressProps, spenderAddress, orderType, dstChainId, dstToken, dstAmount, contractAddress, encodedData, metadata, header, onSuccess, showRecipient = true, onShowPointsDetail, srcFiatAmount: srcFiatAmountProps, forceFiatPayment, senderAddress, }) {
112
113
  const hasMounted = useHasMounted();
113
114
  const searchParams = useSearchParamsSSR();
114
115
  const router = useRouter();
@@ -132,14 +133,15 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
132
133
  const chainName = useMemo(() => simpleHashChainToChainName(srcChainId), [srcChainId]);
133
134
  const { data: tokenList } = useAnyspendTokenList(srcChainId, "");
134
135
  // Get token balances for the selected chain
136
+ const effectiveBalanceAddress = senderAddress || currentWallet?.wallet?.address || "";
135
137
  const { nativeTokens, fungibleTokens } = useTokenBalancesByChain({
136
- address: currentWallet?.wallet?.address || "",
138
+ address: effectiveBalanceAddress,
137
139
  chainsIds: [srcChainId],
138
- enabled: !!currentWallet?.wallet?.address && !!chainName,
140
+ enabled: !!effectiveBalanceAddress && !!chainName,
139
141
  });
140
142
  // Find a token with a balance, prioritizing tokens the user already owns
141
143
  const getTokenWithBalance = useCallback(() => {
142
- if (!currentWallet?.wallet?.address || (!nativeTokens && !fungibleTokens) || !tokenList) {
144
+ if (!effectiveBalanceAddress || (!nativeTokens && !fungibleTokens) || !tokenList) {
143
145
  return getDefaultToken(srcChainId);
144
146
  }
145
147
  // First check native tokens (ETH, etc.)
@@ -166,7 +168,7 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
166
168
  }
167
169
  // Default fallback
168
170
  return getDefaultToken(srcChainId);
169
- }, [currentWallet?.wallet?.address, nativeTokens, fungibleTokens, tokenList, srcChainId]);
171
+ }, [effectiveBalanceAddress, nativeTokens, fungibleTokens, tokenList, srcChainId]);
170
172
  // Set the selected token with preference for tokens user owns
171
173
  const [srcToken, setSrcToken] = useState(getDefaultToken(srcChainId));
172
174
  const [dirtySelectSrcToken, setDirtySelectSrcToken] = useState(false);
@@ -300,7 +302,7 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
300
302
  dstToken: dstToken,
301
303
  srcAmount: srcAmount.toString(),
302
304
  recipientAddress,
303
- creatorAddress: currentWallet?.wallet?.address,
305
+ creatorAddress: senderAddress || currentWallet?.wallet?.address,
304
306
  nft: orderType === "mint_nft"
305
307
  ? metadata.nftContract.type === "erc1155"
306
308
  ? {
@@ -458,13 +460,13 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
458
460
  opacity: hasMounted ? 1 : 0,
459
461
  y: hasMounted ? 0 : 20,
460
462
  filter: hasMounted ? "blur(0px)" : "blur(10px)",
461
- }, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: "flex w-full items-center justify-between gap-4", children: [_jsx("div", { className: "text-as-tertiarry text-sm", children: orderType === "swap"
463
+ }, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: "flex w-full items-center justify-between gap-4", children: [_jsx("div", { className: "text-as-tertiary text-sm", children: orderType === "swap"
462
464
  ? "Recipient"
463
465
  : orderType === "mint_nft"
464
466
  ? "Receive NFT at"
465
467
  : orderType === "join_tournament"
466
468
  ? "Join for"
467
- : "Recipient" }), _jsxs("div", { className: "flex flex-wrap items-center justify-end gap-2", children: [recipientAddress ? (_jsx("button", { className: cn("text-as-tertiarry flex items-center gap-2 rounded-lg"), onClick: () => setActivePanel(PanelView.RECIPIENT_SELECTION), children: _jsx("div", { className: "text-as-tertiarry flex items-center gap-1 text-sm", children: _jsx("span", { className: "whitespace-nowrap", children: recipientName ? formatUsername(recipientName) : shortenAddress(recipientAddress) }) }) })) : (_jsx("button", { className: "text-as-primary/70 flex items-center gap-1 rounded-lg", onClick: () => setActivePanel(PanelView.RECIPIENT_SELECTION), children: _jsx("div", { className: "whitespace-nowrap text-sm font-medium", children: "Select recipient" }) })), _jsx(ChevronRight, { className: "h-4 w-4 shrink-0" })] })] }, recipientAddress)) : null;
469
+ : "Recipient" }), _jsxs("div", { className: "flex flex-wrap items-center justify-end gap-2", children: [recipientAddress ? (_jsx("button", { className: cn("text-as-tertiary flex items-center gap-2 rounded-lg"), onClick: () => setActivePanel(PanelView.RECIPIENT_SELECTION), children: _jsx("div", { className: "text-as-tertiary flex items-center gap-1 text-sm", children: _jsx("span", { className: "whitespace-nowrap", children: recipientName ? formatUsername(recipientName) : shortenAddress(recipientAddress) }) }) })) : (_jsx("button", { className: "text-as-primary/70 flex items-center gap-1 rounded-lg", onClick: () => setActivePanel(PanelView.RECIPIENT_SELECTION), children: _jsx("div", { className: "whitespace-nowrap text-sm font-medium", children: "Select recipient" }) })), _jsx(ChevronRight, { className: "h-4 w-4 shrink-0" })] })] }, recipientAddress)) : null;
468
470
  const historyView = (_jsx("div", { className: cn("mx-auto flex w-full max-w-2xl flex-col items-center", mode === "modal" && "bg-b3-react-background"), children: _jsx(OrderHistory, { mode: mode, onBack: () => {
469
471
  setActivePanel(PanelView.HISTORY);
470
472
  }, onSelectOrder: onSelectOrder }) }));
@@ -507,18 +509,18 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
507
509
  opacity: hasMounted ? 1 : 0,
508
510
  y: hasMounted ? 0 : 20,
509
511
  filter: hasMounted ? "blur(0px)" : "blur(10px)",
510
- }, transition: { duration: 0.3, delay: 0, ease: "easeInOut" }, className: "relative flex w-full items-center justify-between", children: [_jsx("div", { className: "text-as-tertiarry flex h-7 items-center text-sm", children: "Pay" }), _jsx("button", { className: "text-as-tertiarry flex flex-wrap items-center justify-end gap-2 text-sm transition-colors hover:text-blue-700", onClick: () => setActivePanel(PanelView.CRYPTO_PAYMENT_METHOD), children: _jsx(CryptoPaymentMethodDisplay, { paymentMethod: effectiveCryptoPaymentMethod, connectedAddress: connectedAddress, connectedName: connectedName }) })] }), _jsx("div", { className: "divider w-full" }), recipientSection, _jsx("div", { className: "divider w-full" }), _jsxs("div", { className: "flex flex-col gap-4", children: [_jsxs(motion.div, { initial: false, animate: {
512
+ }, transition: { duration: 0.3, delay: 0, ease: "easeInOut" }, className: "relative flex w-full items-center justify-between", children: [_jsx("div", { className: "text-as-tertiary flex h-7 items-center text-sm", children: "Pay" }), _jsx("button", { className: "text-as-tertiary flex flex-wrap items-center justify-end gap-2 text-sm transition-colors hover:text-blue-700", onClick: () => setActivePanel(PanelView.CRYPTO_PAYMENT_METHOD), children: _jsx(CryptoPaymentMethodDisplay, { paymentMethod: effectiveCryptoPaymentMethod, connectedAddress: connectedAddress, connectedName: connectedName }) })] }), _jsx("div", { className: "divider w-full" }), recipientSection, _jsx("div", { className: "divider w-full" }), _jsxs("div", { className: "flex flex-col gap-4", children: [_jsxs(motion.div, { initial: false, animate: {
511
513
  opacity: hasMounted ? 1 : 0,
512
514
  y: hasMounted ? 0 : 20,
513
515
  filter: hasMounted ? "blur(0px)" : "blur(10px)",
514
- }, transition: { duration: 0.3, delay: 0, ease: "easeInOut" }, className: "relative flex w-full items-center justify-between", children: [_jsx("div", { className: "text-as-tertiarry text-sm", children: "Pay with" }), _jsx(OrderToken, { address: currentWallet?.wallet?.address, context: "from", chainId: srcChainId, setChainId: setSrcChainId, token: srcToken, setToken: token => {
516
+ }, transition: { duration: 0.3, delay: 0, ease: "easeInOut" }, className: "relative flex w-full items-center justify-between", children: [_jsx("div", { className: "text-as-tertiary text-sm", children: "Pay with" }), _jsx(OrderToken, { address: effectiveBalanceAddress || undefined, context: "from", chainId: srcChainId, setChainId: setSrcChainId, token: srcToken, setToken: token => {
515
517
  setDirtySelectSrcToken(true);
516
518
  setSrcToken(token);
517
519
  }, requiredAmount: srcAmount || undefined })] }), _jsx("div", { className: "divider w-full" }), _jsxs(motion.div, { initial: false, animate: {
518
520
  opacity: hasMounted ? 1 : 0,
519
521
  y: hasMounted ? 0 : 20,
520
522
  filter: hasMounted ? "blur(0px)" : "blur(10px)",
521
- }, transition: { duration: 0.3, delay: 0.1, ease: "easeInOut" }, className: "relative flex w-full items-center justify-between gap-4", children: [_jsxs("span", { className: "text-as-tertiarry flex flex-wrap items-center gap-1.5 text-sm", children: [_jsxs("span", { className: "whitespace-nowrap", children: ["Total ", _jsx("span", { className: "text-as-tertiarry", children: "(with fee)" })] }), anyspendQuote?.data?.fee && (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { className: "text-as-primary/40 hover:text-as-primary/60 transition-colors", children: _jsx(Info, { className: "h-4 w-4" }) }) }), _jsx(TooltipContent, { side: "top", children: _jsx(FeeBreakDown, { fee: anyspendQuote.data.fee }) })] }) }))] }), _jsxs("div", { className: "flex flex-col items-end gap-0.5", children: [_jsxs("div", { className: "flex flex-wrap items-center justify-end gap-2", children: [renderPointsBadge(), _jsxs("span", { className: "text-as-primary whitespace-nowrap font-semibold", children: [formattedSrcAmount || "--", " ", srcToken.symbol] })] }), anyspendQuote?.data?.fee?.type === "standard_fee" && anyspendQuote.data.currencyIn?.amountUsd && (_jsxs("span", { className: "text-as-secondary text-xs", children: ["incl. $", ((Number(anyspendQuote.data.currencyIn.amountUsd) * anyspendQuote.data.fee.finalFeeBps) /
523
+ }, transition: { duration: 0.3, delay: 0.1, ease: "easeInOut" }, className: "relative flex w-full items-center justify-between gap-4", children: [_jsxs("span", { className: "text-as-tertiary flex flex-wrap items-center gap-1.5 text-sm", children: [_jsxs("span", { className: "whitespace-nowrap", children: ["Total ", _jsx("span", { className: "text-as-tertiary", children: "(with fee)" })] }), anyspendQuote?.data?.fee && (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { className: "text-as-primary/40 hover:text-as-primary/60 transition-colors", children: _jsx(Info, { className: "h-4 w-4" }) }) }), _jsx(TooltipContent, { side: "top", children: _jsx(FeeBreakDown, { fee: anyspendQuote.data.fee }) })] }) }))] }), _jsxs("div", { className: "flex flex-col items-end gap-0.5", children: [_jsxs("div", { className: "flex flex-wrap items-center justify-end gap-2", children: [renderPointsBadge(), _jsxs("span", { className: "text-as-primary whitespace-nowrap font-semibold", children: [formattedSrcAmount || "--", " ", srcToken.symbol] })] }), anyspendQuote?.data?.fee?.type === "standard_fee" && anyspendQuote.data.currencyIn?.amountUsd && (_jsxs("span", { className: "text-as-secondary text-xs", children: ["incl. $", ((Number(anyspendQuote.data.currencyIn.amountUsd) * anyspendQuote.data.fee.finalFeeBps) /
522
524
  10000).toFixed(2), " ", "fee"] }))] })] })] })] }), _jsx("div", { className: cn("flex w-full flex-col items-center justify-between gap-2"), children: _jsx(motion.div, { initial: false, animate: {
523
525
  opacity: hasMounted ? 1 : 0,
524
526
  y: hasMounted ? 0 : 20,
@@ -527,7 +529,7 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
527
529
  opacity: hasMounted ? 1 : 0,
528
530
  y: hasMounted ? 0 : 20,
529
531
  filter: hasMounted ? "blur(0px)" : "blur(10px)",
530
- }, transition: { duration: 0.3, delay: 0, ease: "easeInOut" }, className: "relative flex w-full items-center justify-between", children: [_jsx("div", { className: "text-as-tertiarry flex h-7 items-center text-sm", children: "Pay with" }), _jsx("button", { className: "text-as-tertiarry flex flex-wrap items-center justify-end gap-2 text-sm transition-colors hover:text-blue-700", onClick: () => setActivePanel(PanelView.FIAT_PAYMENT_METHOD), children: (() => {
532
+ }, transition: { duration: 0.3, delay: 0, ease: "easeInOut" }, className: "relative flex w-full items-center justify-between", children: [_jsx("div", { className: "text-as-tertiary flex h-7 items-center text-sm", children: "Pay with" }), _jsx("button", { className: "text-as-tertiary flex flex-wrap items-center justify-end gap-2 text-sm transition-colors hover:text-blue-700", onClick: () => setActivePanel(PanelView.FIAT_PAYMENT_METHOD), children: (() => {
531
533
  const config = FIAT_PAYMENT_METHOD_DISPLAY[selectedFiatPaymentMethod];
532
534
  if (config) {
533
535
  return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center gap-2 whitespace-nowrap", children: [_jsx("div", { className: "flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-blue-600", children: _jsx("span", { className: "text-xs font-bold text-white", children: config.icon }) }), config.label] }), _jsx(ChevronRight, { className: "h-4 w-4 shrink-0" })] }));
@@ -537,7 +539,7 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
537
539
  opacity: hasMounted ? 1 : 0,
538
540
  y: hasMounted ? 0 : 20,
539
541
  filter: hasMounted ? "blur(0px)" : "blur(10px)",
540
- }, transition: { duration: 0.3, delay: 0.1, ease: "easeInOut" }, className: "relative flex w-full items-center justify-between gap-4", children: [_jsxs("span", { className: "text-as-tertiarry flex flex-wrap items-center gap-1.5 text-sm", children: [_jsxs("span", { className: "whitespace-nowrap", children: ["Total ", _jsx("span", { className: "text-as-tertiarry", children: "(USD)" })] }), anyspendQuote?.data?.fee && (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { className: "text-as-primary/40 hover:text-as-primary/60 transition-colors", children: _jsx(Info, { className: "h-4 w-4" }) }) }), _jsx(TooltipContent, { side: "top", children: _jsx(FeeBreakDown, { fee: anyspendQuote.data.fee }) })] }) }))] }), _jsxs("div", { className: "flex flex-col items-end gap-0.5", children: [_jsxs("div", { className: "flex flex-wrap items-center justify-end gap-2", children: [renderPointsBadge(), isLoadingAnyspendQuote ? (_jsx("div", { className: "bg-as-surface-secondary h-7 w-16 animate-pulse rounded" })) : (_jsx("span", { className: "text-as-primary whitespace-nowrap text-xl font-semibold", children: anyspendQuote?.data?.currencyIn?.amountUsd ? (`$${Number(anyspendQuote.data.currencyIn.amountUsd).toFixed(2)}`) : (_jsxs(_Fragment, { children: ["$", parseFloat(srcFiatAmount || "0").toFixed(2), _jsx("span", { className: "text-as-tertiarry text-base", children: "+" })] })) }))] }), (() => {
542
+ }, transition: { duration: 0.3, delay: 0.1, ease: "easeInOut" }, className: "relative flex w-full items-center justify-between gap-4", children: [_jsxs("span", { className: "text-as-tertiary flex flex-wrap items-center gap-1.5 text-sm", children: [_jsxs("span", { className: "whitespace-nowrap", children: ["Total ", _jsx("span", { className: "text-as-tertiary", children: "(USD)" })] }), anyspendQuote?.data?.fee && (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { className: "text-as-primary/40 hover:text-as-primary/60 transition-colors", children: _jsx(Info, { className: "h-4 w-4" }) }) }), _jsx(TooltipContent, { side: "top", children: _jsx(FeeBreakDown, { fee: anyspendQuote.data.fee }) })] }) }))] }), _jsxs("div", { className: "flex flex-col items-end gap-0.5", children: [_jsxs("div", { className: "flex flex-wrap items-center justify-end gap-2", children: [renderPointsBadge(), isLoadingAnyspendQuote ? (_jsx("div", { className: "bg-as-surface-secondary h-7 w-16 animate-pulse rounded" })) : (_jsx("span", { className: "text-as-primary whitespace-nowrap text-xl font-semibold", children: anyspendQuote?.data?.currencyIn?.amountUsd ? (`$${Number(anyspendQuote.data.currencyIn.amountUsd).toFixed(2)}`) : (_jsxs(_Fragment, { children: ["$", parseFloat(srcFiatAmount || "0").toFixed(2), _jsx("span", { className: "text-as-tertiary text-base", children: "+" })] })) }))] }), (() => {
541
543
  if (anyspendQuote?.data?.fee?.type === "stripeweb2_fee" && anyspendQuote.data.fee.originalAmount) {
542
544
  const fee = (Number(anyspendQuote.data.fee.originalAmount) - Number(anyspendQuote.data.fee.finalAmount)) /
543
545
  1e6;
@@ -1,6 +1,7 @@
1
1
  import { components } from "../../../anyspend/types/api";
2
2
  import { GetQuoteResponse } from "../../../anyspend/types/api_req_res";
3
3
  import type { AnySpendCustomExactInClasses } from "./types/classes";
4
+ import type { AnySpendContent, AnySpendSlots, AnySpendTheme } from "./types/customization";
4
5
  type CustomExactInConfig = {
5
6
  functionAbi: string;
6
7
  functionName: string;
@@ -46,6 +47,14 @@ export interface AnySpendCustomExactInProps {
46
47
  allowDirectTransfer?: boolean;
47
48
  /** Opaque metadata passed to the order for callbacks (e.g., workflow form data) */
48
49
  callbackMetadata?: Record<string, unknown>;
50
+ /** Optional sender (payer) address — pre-fills token balances when the user address is known ahead of time */
51
+ senderAddress?: string;
52
+ /** Render function overrides for replaceable UI elements */
53
+ slots?: AnySpendSlots;
54
+ /** String or ReactNode overrides for text/messages */
55
+ content?: AnySpendContent;
56
+ /** Structured color/theme configuration */
57
+ theme?: AnySpendTheme;
49
58
  }
50
59
  export declare function AnySpendCustomExactIn(props: AnySpendCustomExactInProps): import("react/jsx-runtime").JSX.Element;
51
60
  export {};
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { getChainName, getExplorerTxUrl } from "../../../anyspend/index.js";
3
3
  import { useGasPrice } from "../../../anyspend/react/index.js";
4
4
  import { normalizeAddress } from "../../../anyspend/utils/index.js";
@@ -6,9 +6,11 @@ import { Button, ShinyButton, StyleRoot, toast, TransitionPanel, useAccountWalle
6
6
  import { cn } from "../../../shared/utils/cn.js";
7
7
  import { formatUnits } from "../../../shared/utils/number.js";
8
8
  import invariant from "invariant";
9
- import { ArrowDown, CheckCircle, Loader2 } from "lucide-react";
9
+ import { ArrowDown, Loader2 } from "lucide-react";
10
+ import { AnimatedCheckmark } from "./icons/AnimatedCheckmark.js";
10
11
  import { motion } from "motion/react";
11
12
  import { useEffect, useMemo, useRef, useState } from "react";
13
+ import { AnySpendCustomizationProvider, useAnySpendCustomization } from "./context/AnySpendCustomizationContext.js";
12
14
  import { useSetActiveWallet } from "thirdweb/react";
13
15
  import { B3_TOKEN } from "../../constants/index.js";
14
16
  import { useDirectTransfer } from "../hooks/useDirectTransfer.js";
@@ -27,9 +29,10 @@ import { RecipientSelection } from "./common/RecipientSelection.js";
27
29
  const SLIPPAGE_PERCENT = 3;
28
30
  export function AnySpendCustomExactIn(props) {
29
31
  const fingerprintConfig = getFingerprintConfig();
30
- return (_jsx(AnySpendFingerprintWrapper, { fingerprint: fingerprintConfig, children: _jsx(AnySpendCustomExactInInner, { ...props }) }));
32
+ return (_jsx(AnySpendFingerprintWrapper, { fingerprint: fingerprintConfig, children: _jsx(AnySpendCustomizationProvider, { slots: props.slots, content: props.content, theme: props.theme, children: _jsx(AnySpendCustomExactInInner, { ...props }) }) }));
31
33
  }
32
- function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddress, paymentType = "crypto", sourceTokenAddress, sourceTokenChainId, destinationToken, destinationChainId, onSuccess, onOpenCustomModal, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, customExactInConfig, destinationTokenAmount, orderType = "custom_exact_in", minDestinationAmount, header, returnToHomeUrl, customRecipientLabel, returnHomeLabel, classes, allowDirectTransfer = false, callbackMetadata, }) {
34
+ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddress, paymentType = "crypto", sourceTokenAddress, sourceTokenChainId, destinationToken, destinationChainId, onSuccess, onOpenCustomModal, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, customExactInConfig, destinationTokenAmount, orderType = "custom_exact_in", minDestinationAmount, header, returnToHomeUrl, customRecipientLabel, returnHomeLabel, classes, allowDirectTransfer = false, callbackMetadata, senderAddress, }) {
35
+ const { slots, content } = useAnySpendCustomization();
33
36
  const actionLabel = customExactInConfig?.action ?? "Custom Execution";
34
37
  const setB3ModalOpen = useModalStore(state => state.setB3ModalOpen);
35
38
  const DESTINATION_TOKEN_DETAILS = {
@@ -49,6 +52,7 @@ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddres
49
52
  disableUrlParamManagement: true,
50
53
  orderType,
51
54
  customExactInConfig,
55
+ senderAddress,
52
56
  });
53
57
  const { connectedEOAWallet } = useAccountWallet();
54
58
  const setActiveWallet = useSetActiveWallet();
@@ -226,10 +230,15 @@ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddres
226
230
  "swap-direction-button border-as-stroke bg-as-surface-primary z-10 h-10 w-10 cursor-default rounded-xl border-2 sm:h-8 sm:w-8 sm:rounded-xl", children: _jsx("div", { className: "relative flex items-center justify-center transition-opacity", children: _jsx(ArrowDown, { className: "text-as-primary/50 h-5 w-5" }) }) }) }), paymentType === "crypto" && (_jsx(CryptoReceiveSection, { isDepositMode: false, isBuyMode: false, effectiveRecipientAddress: selectedRecipientOrDefault, recipientName: recipientName || undefined, customRecipientLabel: customRecipientLabel, onSelectRecipient: () => setActivePanel(PanelView.RECIPIENT_SELECTION), dstAmount: isSrcInputDirty && !destinationTokenAmount ? dstAmount : dstAmountInput, dstToken: selectedDstToken, dstTokenSymbol: DESTINATION_TOKEN_DETAILS.SYMBOL, dstTokenLogoURI: DESTINATION_TOKEN_DETAILS.LOGO_URI, selectedDstChainId: selectedDstChainId, setSelectedDstChainId: () => { }, setSelectedDstToken: () => { }, isSrcInputDirty: isSrcInputDirty, onChangeDstAmount: value => {
227
231
  setIsSrcInputDirty(false);
228
232
  setDstAmountInput(value);
229
- }, disableAmountInput: !!destinationTokenAmount, anyspendQuote: isDirectTransfer ? undefined : anyspendQuote, onShowPointsDetail: isDirectTransfer ? undefined : () => setActivePanel(PanelView.POINTS_DETAIL), onShowFeeDetail: isDirectTransfer ? undefined : () => setActivePanel(PanelView.FEE_DETAIL) }))] }) }), _jsx(motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: cn("mt-4 flex w-full max-w-[460px] flex-col gap-2"), children: _jsx(ShinyButton, { accentColor: "hsl(var(--as-brand))", disabled: btnInfo.disable, onClick: onMainButtonClick, className: (btnInfo.error && classes?.mainButtonError) ||
233
+ }, disableAmountInput: !!destinationTokenAmount, anyspendQuote: isDirectTransfer ? undefined : anyspendQuote, onShowPointsDetail: isDirectTransfer ? undefined : () => setActivePanel(PanelView.POINTS_DETAIL), onShowFeeDetail: isDirectTransfer ? undefined : () => setActivePanel(PanelView.FEE_DETAIL) }))] }) }), _jsx(motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: cn("mt-4 flex w-full max-w-[460px] flex-col gap-2"), children: slots.actionButton ? (slots.actionButton({
234
+ onClick: onMainButtonClick,
235
+ disabled: btnInfo.disable,
236
+ loading: btnInfo.loading,
237
+ text: btnInfo.text,
238
+ })) : (_jsx(ShinyButton, { accentColor: "hsl(var(--as-brand))", disabled: btnInfo.disable, onClick: onMainButtonClick, className: (btnInfo.error && classes?.mainButtonError) ||
230
239
  (btnInfo.disable && classes?.mainButtonDisabled) ||
231
240
  classes?.mainButton ||
232
- cn("as-main-button relative w-full", btnInfo.error ? "!bg-as-red" : btnInfo.disable ? "!bg-as-on-surface-2" : "!bg-as-brand"), textClassName: cn(btnInfo.error ? "text-white" : btnInfo.disable ? "text-as-secondary" : "text-white"), children: _jsxs("div", { className: "flex items-center justify-center gap-2", children: [btnInfo.loading && _jsx(Loader2, { className: "h-4 w-4 animate-spin" }), btnInfo.text] }) }) }), gasPriceData && !isLoadingGas && paymentType === "crypto" && !isDirectTransfer && (_jsx(GasIndicator, { gasPrice: gasPriceData, className: classes?.gasIndicator || "mt-2 w-full" })), mainFooter ? mainFooter : null] }));
241
+ cn("as-main-button relative w-full", btnInfo.error ? "!bg-as-red" : btnInfo.disable ? "!bg-as-on-surface-2" : "!bg-as-brand"), textClassName: cn(btnInfo.error ? "text-white" : btnInfo.disable ? "text-as-secondary" : "text-white"), children: _jsxs("div", { className: "flex items-center justify-center gap-2", children: [btnInfo.loading && _jsx(Loader2, { className: "h-4 w-4 animate-spin" }), btnInfo.text] }) })) }), gasPriceData && !isLoadingGas && paymentType === "crypto" && !isDirectTransfer && (_jsx(GasIndicator, { gasPrice: gasPriceData, className: classes?.gasIndicator || "mt-2 w-full" })), mainFooter ? mainFooter : null] }));
233
242
  const handleCryptoOrder = async () => {
234
243
  try {
235
244
  const isDirectTransfer = isSameChainSameToken && allowDirectTransfer;
@@ -269,7 +278,7 @@ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddres
269
278
  dstToken: selectedDstToken,
270
279
  srcAmount: srcAmountFromQuote,
271
280
  expectedDstAmount,
272
- creatorAddress: globalAddress,
281
+ creatorAddress: senderAddress || globalAddress,
273
282
  payload: {
274
283
  amount: activeOutputAmountInWei,
275
284
  data: encodedData,
@@ -294,7 +303,7 @@ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddres
294
303
  dstToken: selectedDstToken,
295
304
  srcAmount: srcAmountBigInt.toString(),
296
305
  expectedDstAmount: expectedDstAmountRaw,
297
- creatorAddress: globalAddress,
306
+ creatorAddress: senderAddress || globalAddress,
298
307
  payload,
299
308
  callbackMetadata,
300
309
  });
@@ -352,7 +361,7 @@ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddres
352
361
  srcFiatAmount: srcAmount,
353
362
  onramp: onrampOptions,
354
363
  expectedDstAmount,
355
- creatorAddress: globalAddress,
364
+ creatorAddress: senderAddress || globalAddress,
356
365
  payload: {
357
366
  amount: activeOutputAmountInWei,
358
367
  data: encodedData,
@@ -374,7 +383,7 @@ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddres
374
383
  srcFiatAmount: srcAmount,
375
384
  onramp: onrampOptions,
376
385
  expectedDstAmount: expectedDstAmountRaw,
377
- creatorAddress: globalAddress,
386
+ creatorAddress: senderAddress || globalAddress,
378
387
  payload,
379
388
  });
380
389
  }
@@ -407,7 +416,28 @@ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddres
407
416
  : anyspendQuote.data.currencyIn?.amountUsd
408
417
  ? Number(anyspendQuote.data.currencyIn.amountUsd)
409
418
  : undefined, onBack: () => setActivePanel(PanelView.MAIN) })) : null;
410
- const directTransferSuccessView = (_jsxs(motion.div, { initial: { opacity: 0, scale: 0.95 }, animate: { opacity: 1, scale: 1 }, className: "flex flex-col items-center justify-center gap-6 py-8", children: [_jsx("div", { className: "flex h-16 w-16 items-center justify-center rounded-full bg-green-500/20", children: _jsx(CheckCircle, { className: "h-10 w-10 text-green-500" }) }), _jsxs("div", { className: "text-center", children: [_jsx("h2", { className: "text-as-primary mb-2 text-xl font-bold", children: "Transfer Complete!" }), _jsxs("p", { className: "text-as-primary/60 text-sm", children: [srcAmount, " ", selectedSrcToken.symbol, " sent on ", getChainName(selectedSrcChainId)] }), _jsxs("p", { className: "text-as-primary/60 mt-1 text-sm", children: ["to ", selectedRecipientOrDefault?.slice(0, 6), "...", selectedRecipientOrDefault?.slice(-4)] })] }), directTransferTxHash && (_jsx("a", { href: getExplorerTxUrl(selectedSrcChainId, directTransferTxHash || ""), target: "_blank", rel: "noopener noreferrer", className: "text-as-brand text-sm underline", children: "View Transaction" })), _jsx(Button, { className: "bg-as-brand hover:bg-as-brand/90 mt-4 w-full rounded-xl py-3 font-semibold text-white", onClick: () => {
419
+ const exactInSuccessTitle = content.successTitle || "Transfer Complete!";
420
+ const exactInSuccessDesc = content.successDescription || `${srcAmount} ${selectedSrcToken.symbol} sent on ${getChainName(selectedSrcChainId)}`;
421
+ const exactInReturnLabel = content.returnButtonLabel || returnHomeLabel;
422
+ const directTransferSuccessView = slots.successScreen ? (_jsx(_Fragment, { children: slots.successScreen({
423
+ title: typeof exactInSuccessTitle === "string" ? exactInSuccessTitle : "Transfer Complete!",
424
+ description: typeof exactInSuccessDesc === "string" ? exactInSuccessDesc : "",
425
+ txHash: directTransferTxHash,
426
+ explorerUrl: directTransferTxHash
427
+ ? getExplorerTxUrl(selectedSrcChainId, directTransferTxHash || "")
428
+ : undefined,
429
+ onDone: () => {
430
+ onSuccess?.(srcAmount);
431
+ if (returnToHomeUrl) {
432
+ window.location.href = returnToHomeUrl;
433
+ }
434
+ else {
435
+ setB3ModalOpen(false);
436
+ }
437
+ },
438
+ returnUrl: returnToHomeUrl,
439
+ returnLabel: exactInReturnLabel || undefined,
440
+ }) })) : (_jsxs(motion.div, { initial: { opacity: 0, scale: 0.95 }, animate: { opacity: 1, scale: 1 }, className: "flex flex-col items-center justify-center gap-6 py-8", children: [_jsx(AnimatedCheckmark, { className: "h-16 w-16" }), _jsxs("div", { className: "text-center", children: [_jsx("h2", { className: "text-as-primary mb-2 text-xl font-bold", children: exactInSuccessTitle }), _jsx("p", { className: "text-as-primary/60 text-sm", children: exactInSuccessDesc }), _jsxs("p", { className: "text-as-primary/60 mt-1 text-sm", children: ["to ", selectedRecipientOrDefault?.slice(0, 6), "...", selectedRecipientOrDefault?.slice(-4)] })] }), directTransferTxHash && (_jsx("a", { href: getExplorerTxUrl(selectedSrcChainId, directTransferTxHash || ""), target: "_blank", rel: "noopener noreferrer", className: "text-as-brand text-sm underline", children: "View Transaction" })), _jsx(Button, { className: "bg-as-brand hover:bg-as-brand/90 mt-4 w-full rounded-xl py-3 font-semibold text-white", onClick: () => {
411
441
  onSuccess?.(srcAmount);
412
442
  if (returnToHomeUrl) {
413
443
  window.location.href = returnToHomeUrl;
@@ -415,7 +445,7 @@ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddres
415
445
  else {
416
446
  setB3ModalOpen(false);
417
447
  }
418
- }, children: returnHomeLabel || (returnToHomeUrl ? "Return to Home" : "Done") })] }));
448
+ }, children: exactInReturnLabel || (returnToHomeUrl ? "Return to Home" : "Done") })] }));
419
449
  return (_jsx(StyleRoot, { children: _jsx("div", { className: classes?.root ||
420
450
  cn("anyspend-container font-inter bg-as-surface-primary mx-auto w-full max-w-[460px] p-6", mode === "page" && "border-as-border-secondary overflow-hidden rounded-2xl border shadow-xl"), children: _jsx(TransitionPanel, { activeIndex: orderId
421
451
  ? oat
@@ -1,6 +1,7 @@
1
1
  import { components } from "../../../anyspend/types/api";
2
2
  import { GetQuoteResponse } from "../../../anyspend/types/api_req_res";
3
3
  import type { AnySpendAllClasses } from "./types/classes";
4
+ import type { AnySpendContent, AnySpendSlots, AnySpendTheme } from "./types/customization";
4
5
  export interface DepositContractConfig {
5
6
  /** Custom function ABI JSON string */
6
7
  functionAbi: string;
@@ -103,6 +104,14 @@ export interface AnySpendDepositProps {
103
104
  destinationTokenAmount?: string;
104
105
  /** Opaque metadata passed to the order for callbacks (e.g., workflow form data) */
105
106
  callbackMetadata?: Record<string, unknown>;
107
+ /** Optional sender (payer) address — pre-fills token balances when the user address is known ahead of time */
108
+ senderAddress?: string;
109
+ /** Custom slot overrides for sub-components */
110
+ slots?: AnySpendSlots;
111
+ /** Custom content overrides for sub-components */
112
+ content?: AnySpendContent;
113
+ /** Custom theme overrides for sub-components */
114
+ theme?: AnySpendTheme;
106
115
  }
107
116
  /**
108
117
  * A flexible deposit component that wraps AnySpendCustomExactIn with optional chain selection.
@@ -139,4 +148,4 @@ export interface AnySpendDepositProps {
139
148
  * onSuccess={(amount) => console.log(`Deposited ${amount}`)}
140
149
  * />
141
150
  */
142
- export declare function AnySpendDeposit({ loadOrder, mode, recipientAddress, paymentType: initialPaymentType, sourceTokenAddress, sourceTokenChainId: initialSourceChainId, destinationTokenAddress, destinationTokenChainId, onSuccess, onOpenCustomModal, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, minDestinationAmount, header, orderType, depositContractConfig, showChainSelection, supportedChains, minPoolSize, topChainsCount, onClose, returnToHomeUrl, customRecipientLabel, returnHomeLabel, isCustomDeposit, classes, allowDirectTransfer, destinationTokenAmount, callbackMetadata, }: AnySpendDepositProps): import("react/jsx-runtime").JSX.Element | null;
151
+ export declare function AnySpendDeposit({ loadOrder, mode, recipientAddress, paymentType: initialPaymentType, sourceTokenAddress, sourceTokenChainId: initialSourceChainId, destinationTokenAddress, destinationTokenChainId, onSuccess, onOpenCustomModal, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, minDestinationAmount, header, orderType, depositContractConfig, showChainSelection, supportedChains, minPoolSize, topChainsCount, onClose, returnToHomeUrl, customRecipientLabel, returnHomeLabel, isCustomDeposit, classes, allowDirectTransfer, destinationTokenAmount, callbackMetadata, senderAddress, slots, content, theme, }: AnySpendDepositProps): import("react/jsx-runtime").JSX.Element | null;
@@ -94,7 +94,7 @@ function ChainIcon({ chainId, className }) {
94
94
  * onSuccess={(amount) => console.log(`Deposited ${amount}`)}
95
95
  * />
96
96
  */
97
- export function AnySpendDeposit({ loadOrder, mode = "modal", recipientAddress, paymentType: initialPaymentType, sourceTokenAddress, sourceTokenChainId: initialSourceChainId, destinationTokenAddress, destinationTokenChainId, onSuccess, onOpenCustomModal, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, minDestinationAmount, header, orderType, depositContractConfig, showChainSelection, supportedChains = DEFAULT_SUPPORTED_CHAINS, minPoolSize = DEFAULT_MIN_POOL_SIZE, topChainsCount = 3, onClose, returnToHomeUrl, customRecipientLabel, returnHomeLabel, isCustomDeposit = false, classes, allowDirectTransfer = false, destinationTokenAmount, callbackMetadata, }) {
97
+ export function AnySpendDeposit({ loadOrder, mode = "modal", recipientAddress, paymentType: initialPaymentType, sourceTokenAddress, sourceTokenChainId: initialSourceChainId, destinationTokenAddress, destinationTokenChainId, onSuccess, onOpenCustomModal, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, minDestinationAmount, header, orderType, depositContractConfig, showChainSelection, supportedChains = DEFAULT_SUPPORTED_CHAINS, minPoolSize = DEFAULT_MIN_POOL_SIZE, topChainsCount = 3, onClose, returnToHomeUrl, customRecipientLabel, returnHomeLabel, isCustomDeposit = false, classes, allowDirectTransfer = false, destinationTokenAmount, callbackMetadata, senderAddress, slots, content, theme, }) {
98
98
  // Extract deposit-specific classes for convenience
99
99
  const depositClasses = classes?.deposit;
100
100
  const { connectedEOAWallet } = useAccountWallet();
@@ -115,8 +115,9 @@ export function AnySpendDeposit({ loadOrder, mode = "modal", recipientAddress, p
115
115
  decimals: destinationTokenData?.decimals ?? 18,
116
116
  metadata: { logoURI: destinationTokenData?.logoURI },
117
117
  }), [destinationTokenAddress, destinationTokenChainId, destinationTokenData]);
118
- // Fetch balances for EOA wallet
119
- const { data: balanceData, isLoading: isBalanceLoading } = useSimBalance(shouldShowChainSelection ? eoaAddress : undefined, supportedChains.map(c => c.id));
118
+ // Fetch balances for EOA wallet (use senderAddress as fallback for pre-filled balance display)
119
+ const effectiveBalanceAddress = senderAddress || eoaAddress;
120
+ const { data: balanceData, isLoading: isBalanceLoading } = useSimBalance(shouldShowChainSelection ? effectiveBalanceAddress : undefined, supportedChains.map(c => c.id));
120
121
  // Group balances by chain and calculate total USD value per chain
121
122
  const chainBalances = useMemo(() => {
122
123
  if (!balanceData?.balances)
@@ -206,5 +207,5 @@ export function AnySpendDeposit({ loadOrder, mode = "modal", recipientAddress, p
206
207
  // Deposit view
207
208
  return (_jsxs("div", { className: depositClasses?.form || "anyspend-deposit anyspend-deposit-form relative", children: [shouldShowChainSelection && (_jsxs("button", { onClick: handleBack, className: depositClasses?.backButton ||
208
209
  "anyspend-deposit-back-button text-as-secondary hover:text-as-primary absolute left-4 top-4 z-10 flex items-center gap-1", children: [_jsx("svg", { className: depositClasses?.backIcon || "anyspend-deposit-back-icon h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) }), _jsx("span", { className: depositClasses?.backText || "anyspend-deposit-back-text text-sm", children: "Back" })] })), onClose && (_jsx("button", { onClick: onClose, className: depositClasses?.closeButton ||
209
- "anyspend-deposit-close-button text-as-secondary hover:text-as-primary absolute right-4 top-4 z-10", children: _jsx("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })), _jsx("div", { className: depositClasses?.formContent || cn("anyspend-deposit-form-content", shouldShowChainSelection && "pt-8"), children: isCustomDeposit ? (_jsx(AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, paymentType: paymentType, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: selectedChainId, destinationToken: destinationToken, destinationChainId: destinationTokenChainId, orderType: effectiveOrderType, minDestinationAmount: minDestinationAmount, header: header ?? defaultHeader, onSuccess: onSuccess, onOpenCustomModal: onOpenCustomModal, mainFooter: mainFooter, onTokenSelect: onTokenSelect, customUsdInputValues: customUsdInputValues, preferEoa: preferEoa, customExactInConfig: depositContractConfig, returnToHomeUrl: returnToHomeUrl, customRecipientLabel: customRecipientLabel, returnHomeLabel: returnHomeLabel, classes: classes?.customExactIn, allowDirectTransfer: allowDirectTransfer, destinationTokenAmount: destinationTokenAmount, callbackMetadata: callbackMetadata }, selectedChainId)) : (_jsx(AnySpend, { loadOrder: loadOrder, mode: mode, defaultActiveTab: paymentType, recipientAddress: recipientAddress, sourceChainId: selectedChainId, destinationTokenAddress: destinationTokenAddress, destinationTokenChainId: destinationTokenChainId, onSuccess: txHash => onSuccess?.(txHash ?? ""), onTokenSelect: onTokenSelect, customUsdInputValues: customUsdInputValues, hideHeader: true, hideBottomNavigation: true, disableUrlParamManagement: true, returnToHomeUrl: returnToHomeUrl, customRecipientLabel: customRecipientLabel, returnHomeLabel: returnHomeLabel, classes: classes?.anySpend, allowDirectTransfer: allowDirectTransfer, destinationTokenAmount: destinationTokenAmount, callbackMetadata: callbackMetadata }, selectedChainId)) }), _jsx(ChainWarningText, { chainId: destinationTokenChainId, classes: classes?.chainWarningText || { root: "px-4 pb-4" } })] }));
210
+ "anyspend-deposit-close-button text-as-secondary hover:text-as-primary absolute right-4 top-4 z-10", children: _jsx("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })), _jsx("div", { className: depositClasses?.formContent || cn("anyspend-deposit-form-content", shouldShowChainSelection && "pt-8"), children: isCustomDeposit ? (_jsx(AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, paymentType: paymentType, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: selectedChainId, destinationToken: destinationToken, destinationChainId: destinationTokenChainId, orderType: effectiveOrderType, minDestinationAmount: minDestinationAmount, header: header ?? defaultHeader, onSuccess: onSuccess, onOpenCustomModal: onOpenCustomModal, mainFooter: mainFooter, onTokenSelect: onTokenSelect, customUsdInputValues: customUsdInputValues, preferEoa: preferEoa, customExactInConfig: depositContractConfig, returnToHomeUrl: returnToHomeUrl, customRecipientLabel: customRecipientLabel, returnHomeLabel: returnHomeLabel, classes: classes?.customExactIn, allowDirectTransfer: allowDirectTransfer, destinationTokenAmount: destinationTokenAmount, callbackMetadata: callbackMetadata, senderAddress: senderAddress, slots: slots, content: content, theme: theme }, selectedChainId)) : (_jsx(AnySpend, { loadOrder: loadOrder, mode: mode, defaultActiveTab: paymentType, recipientAddress: recipientAddress, sourceChainId: selectedChainId, destinationTokenAddress: destinationTokenAddress, destinationTokenChainId: destinationTokenChainId, onSuccess: txHash => onSuccess?.(txHash ?? ""), onTokenSelect: onTokenSelect, customUsdInputValues: customUsdInputValues, hideHeader: true, hideBottomNavigation: true, disableUrlParamManagement: true, returnToHomeUrl: returnToHomeUrl, customRecipientLabel: customRecipientLabel, returnHomeLabel: returnHomeLabel, classes: classes?.anySpend, allowDirectTransfer: allowDirectTransfer, destinationTokenAmount: destinationTokenAmount, callbackMetadata: callbackMetadata, senderAddress: senderAddress, slots: slots, content: content, theme: theme }, selectedChainId)) }), _jsx(ChainWarningText, { chainId: destinationTokenChainId, classes: classes?.chainWarningText || { root: "px-4 pb-4" } })] }));
210
211
  }
@@ -1,5 +1,6 @@
1
1
  import { components } from "../../../anyspend/types/api";
2
- export declare function AnySpendDepositUpside({ loadOrder, mode, recipientAddress, sourceTokenAddress, sourceTokenChainId, depositContractAddress, token, onSuccess, }: {
2
+ import type { AnySpendContent, AnySpendSlots, AnySpendTheme } from "./types/customization";
3
+ export declare function AnySpendDepositUpside({ loadOrder, mode, recipientAddress, sourceTokenAddress, sourceTokenChainId, depositContractAddress, token, onSuccess, senderAddress, slots, content, theme, }: {
3
4
  loadOrder?: string;
4
5
  mode?: "modal" | "page";
5
6
  recipientAddress: string;
@@ -8,4 +9,9 @@ export declare function AnySpendDepositUpside({ loadOrder, mode, recipientAddres
8
9
  depositContractAddress: string;
9
10
  token: components["schemas"]["Token"];
10
11
  onSuccess?: (amount: string) => void;
12
+ /** Optional sender (payer) address — pre-fills token balances when the user address is known ahead of time */
13
+ senderAddress?: string;
14
+ slots?: AnySpendSlots;
15
+ content?: AnySpendContent;
16
+ theme?: AnySpendTheme;
11
17
  }): import("react/jsx-runtime").JSX.Element | null;
@@ -22,7 +22,7 @@ const DEPOSIT_FOR_FUNCTION_ABI = JSON.stringify([
22
22
  type: "function",
23
23
  },
24
24
  ]);
25
- export function AnySpendDepositUpside({ loadOrder, mode = "modal", recipientAddress, sourceTokenAddress, sourceTokenChainId, depositContractAddress, token, onSuccess, }) {
25
+ export function AnySpendDepositUpside({ loadOrder, mode = "modal", recipientAddress, sourceTokenAddress, sourceTokenChainId, depositContractAddress, token, onSuccess, senderAddress, slots, content, theme, }) {
26
26
  if (!recipientAddress)
27
27
  return null;
28
28
  const header = () => (_jsx(_Fragment, { children: _jsx("div", { className: "from-b3-react-background to-as-on-surface-1 w-full rounded-t-lg bg-gradient-to-t", children: _jsx("div", { className: "mb-1 flex w-full flex-col items-center gap-2", children: _jsxs("span", { className: "font-sf-rounded text-2xl font-semibold", children: ["Swap & Deposit ", token.symbol] }) }) }) }));
@@ -34,5 +34,5 @@ export function AnySpendDepositUpside({ loadOrder, mode = "modal", recipientAddr
34
34
  spenderAddress: depositContractAddress,
35
35
  action: `deposit ${token.symbol}`,
36
36
  };
37
- return (_jsx(AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: token, destinationChainId: base.id, customExactInConfig: customExactInConfig, header: header, onSuccess: onSuccess }));
37
+ return (_jsx(AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: token, destinationChainId: base.id, customExactInConfig: customExactInConfig, header: header, onSuccess: onSuccess, senderAddress: senderAddress, slots: slots, content: content, theme: theme }));
38
38
  }
@@ -1,9 +1,15 @@
1
1
  import { components } from "../../../anyspend/types/api";
2
- export declare function AnySpendNFT({ loadOrder, mode, recipientAddress, nftContract, onSuccess, onShowPointsDetail, }: {
2
+ import type { AnySpendContent, AnySpendSlots, AnySpendTheme } from "./types/customization";
3
+ export declare function AnySpendNFT({ loadOrder, mode, recipientAddress, nftContract, onSuccess, onShowPointsDetail, senderAddress, slots, content, theme, }: {
3
4
  loadOrder?: string;
4
5
  mode?: "modal" | "page";
5
6
  recipientAddress?: string;
6
7
  nftContract: components["schemas"]["NftContract"];
7
8
  onSuccess?: (txHash?: string) => void;
8
9
  onShowPointsDetail?: () => void;
10
+ /** Optional sender (payer) address — pre-fills token balances when the user address is known ahead of time */
11
+ senderAddress?: string;
12
+ slots?: AnySpendSlots;
13
+ content?: AnySpendContent;
14
+ theme?: AnySpendTheme;
9
15
  }): import("react/jsx-runtime").JSX.Element;
@@ -26,7 +26,7 @@ const CONTRACT_URI_ABI = [
26
26
  type: "function",
27
27
  },
28
28
  ];
29
- export function AnySpendNFT({ loadOrder, mode = "modal", recipientAddress, nftContract, onSuccess, onShowPointsDetail, }) {
29
+ export function AnySpendNFT({ loadOrder, mode = "modal", recipientAddress, nftContract, onSuccess, onShowPointsDetail, senderAddress, slots, content, theme, }) {
30
30
  const [imageUrlWithFallback, setFallbackImageUrl] = useState(nftContract.imageUrl);
31
31
  const hasFetchedRef = useRef(false);
32
32
  // Fetch contract metadata when imageUrl is empty
@@ -83,7 +83,7 @@ export function AnySpendNFT({ loadOrder, mode = "modal", recipientAddress, nftCo
83
83
  return (_jsx(AnySpendCustom, { loadOrder: loadOrder, mode: mode, activeTab: "fiat", recipientAddress: recipientAddress, orderType: "mint_nft", dstChainId: nftContract.chainId, dstToken: nftContract.currency, dstAmount: nftContract.price, contractAddress: nftContract.contractAddress, encodedData: "0x", metadata: {
84
84
  type: "mint_nft",
85
85
  nftContract: nftContract,
86
- }, header: header, onSuccess: onSuccess, onShowPointsDetail: onShowPointsDetail }));
86
+ }, header: header, onSuccess: onSuccess, onShowPointsDetail: onShowPointsDetail, senderAddress: senderAddress, slots: slots, content: content, theme: theme }));
87
87
  }
88
88
  function DropdownMenu({ nftContract }) {
89
89
  const [open, setOpen] = useState(false);
@@ -1,7 +1,13 @@
1
- export declare function AnySpendStakeB3({ loadOrder, mode, recipientAddress, stakeAmount, onSuccess, }: {
1
+ import type { AnySpendContent, AnySpendSlots, AnySpendTheme } from "./types/customization";
2
+ export declare function AnySpendStakeB3({ loadOrder, mode, recipientAddress, stakeAmount, onSuccess, senderAddress, slots, content, theme, }: {
2
3
  loadOrder?: string;
3
4
  mode?: "modal" | "page";
4
5
  recipientAddress: string;
5
6
  stakeAmount?: string;
6
7
  onSuccess?: () => void;
8
+ /** Optional sender (payer) address — pre-fills token balances when the user address is known ahead of time */
9
+ senderAddress?: string;
10
+ slots?: AnySpendSlots;
11
+ content?: AnySpendContent;
12
+ theme?: AnySpendTheme;
7
13
  }): import("react/jsx-runtime").JSX.Element;
@@ -28,7 +28,7 @@ function generateEncodedDataForStakingB3(amount, beneficiary) {
28
28
  });
29
29
  return encodedData;
30
30
  }
31
- export function AnySpendStakeB3({ loadOrder, mode = "modal", recipientAddress, stakeAmount, onSuccess, }) {
31
+ export function AnySpendStakeB3({ loadOrder, mode = "modal", recipientAddress, stakeAmount, onSuccess, senderAddress, slots, content, theme, }) {
32
32
  const hasMounted = useHasMounted();
33
33
  const { setB3ModalOpen } = useModalStore();
34
34
  // Wagmi hooks for direct staking
@@ -270,5 +270,5 @@ export function AnySpendStakeB3({ loadOrder, mode = "modal", recipientAddress, s
270
270
  const encodedData = generateEncodedDataForStakingB3(userStakeAmount, recipientAddress);
271
271
  return (_jsx(AnySpendCustom, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, orderType: "custom", dstChainId: base.id, dstToken: B3_TOKEN, dstAmount: userStakeAmount, contractAddress: ERC20Staking, encodedData: encodedData, metadata: {
272
272
  action: "stake B3",
273
- }, header: header, onSuccess: onSuccess, showRecipient: true }));
273
+ }, header: header, onSuccess: onSuccess, showRecipient: true, senderAddress: senderAddress, slots: slots, content: content, theme: theme }));
274
274
  }
@@ -1,4 +1,5 @@
1
- export declare function AnySpendStakeB3ExactIn({ loadOrder, mode, sourceTokenAddress, sourceTokenChainId, recipientAddress, stakeAmount, onSuccess, }: {
1
+ import type { AnySpendContent, AnySpendSlots, AnySpendTheme } from "./types/customization";
2
+ export declare function AnySpendStakeB3ExactIn({ loadOrder, mode, sourceTokenAddress, sourceTokenChainId, recipientAddress, stakeAmount, onSuccess, senderAddress, slots, content, theme, }: {
2
3
  loadOrder?: string;
3
4
  mode?: "modal" | "page";
4
5
  sourceTokenAddress?: string;
@@ -6,4 +7,9 @@ export declare function AnySpendStakeB3ExactIn({ loadOrder, mode, sourceTokenAdd
6
7
  recipientAddress: string;
7
8
  stakeAmount?: string;
8
9
  onSuccess?: (amount: string) => void;
10
+ /** Optional sender (payer) address — pre-fills token balances when the user address is known ahead of time */
11
+ senderAddress?: string;
12
+ slots?: AnySpendSlots;
13
+ content?: AnySpendContent;
14
+ theme?: AnySpendTheme;
9
15
  }): import("react/jsx-runtime").JSX.Element | null;
@@ -31,7 +31,7 @@ const STAKE_FUNCTION_ABI = JSON.stringify([
31
31
  outputs: [],
32
32
  },
33
33
  ]);
34
- export function AnySpendStakeB3ExactIn({ loadOrder, mode = "modal", sourceTokenAddress, sourceTokenChainId, recipientAddress, stakeAmount, onSuccess, }) {
34
+ export function AnySpendStakeB3ExactIn({ loadOrder, mode = "modal", sourceTokenAddress, sourceTokenChainId, recipientAddress, stakeAmount, onSuccess, senderAddress, slots, content, theme, }) {
35
35
  const hasMounted = useHasMounted();
36
36
  const { setB3ModalOpen } = useModalStore();
37
37
  // Wagmi hooks for direct staking
@@ -280,5 +280,5 @@ export function AnySpendStakeB3ExactIn({ loadOrder, mode = "modal", sourceTokenA
280
280
  onSuccess?.(formatTokenAmount(BigInt(userStakeAmount), 18) ?? "");
281
281
  }, className: "bg-as-brand hover:bg-as-brand/90 text-as-primary h-14 w-full rounded-xl text-lg font-medium", children: "Done" })] })] }) }));
282
282
  }
283
- return (_jsx(AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: B3_TOKEN, destinationChainId: base.id, customExactInConfig: customExactInConfig, header: header, onSuccess: onSuccess }));
283
+ return (_jsx(AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: B3_TOKEN, destinationChainId: base.id, customExactInConfig: customExactInConfig, header: header, onSuccess: onSuccess, senderAddress: senderAddress, slots: slots, content: content, theme: theme }));
284
284
  }
@@ -1,5 +1,6 @@
1
1
  import { components } from "../../../anyspend/types/api";
2
- export declare function AnySpendStakeUpside({ loadOrder, mode, beneficiaryAddress, stakeAmount, stakingContractAddress, token, onSuccess, activeTab, }: {
2
+ import type { AnySpendContent, AnySpendSlots, AnySpendTheme } from "./types/customization";
3
+ export declare function AnySpendStakeUpside({ loadOrder, mode, beneficiaryAddress, stakeAmount, stakingContractAddress, token, onSuccess, activeTab, senderAddress, slots, content, theme, }: {
3
4
  loadOrder?: string;
4
5
  mode?: "modal" | "page";
5
6
  beneficiaryAddress: string;
@@ -8,4 +9,9 @@ export declare function AnySpendStakeUpside({ loadOrder, mode, beneficiaryAddres
8
9
  token: components["schemas"]["Token"];
9
10
  onSuccess?: () => void;
10
11
  activeTab?: "crypto" | "fiat";
12
+ /** Optional sender (payer) address — pre-fills token balances when the user address is known ahead of time */
13
+ senderAddress?: string;
14
+ slots?: AnySpendSlots;
15
+ content?: AnySpendContent;
16
+ theme?: AnySpendTheme;
11
17
  }): import("react/jsx-runtime").JSX.Element;
@@ -14,7 +14,7 @@ function generateEncodedDataForStaking(amount, beneficiary) {
14
14
  args: [beneficiary, BigInt(amount)],
15
15
  });
16
16
  }
17
- export function AnySpendStakeUpside({ loadOrder, mode = "modal", beneficiaryAddress, stakeAmount, stakingContractAddress, token, onSuccess, activeTab, }) {
17
+ export function AnySpendStakeUpside({ loadOrder, mode = "modal", beneficiaryAddress, stakeAmount, stakingContractAddress, token, onSuccess, activeTab, senderAddress, slots, content, theme, }) {
18
18
  const header = () => (_jsx(_Fragment, { children: _jsxs("div", { className: "from-b3-react-background to-as-on-surface-1 mt-[-60px] w-full rounded-t-lg bg-gradient-to-t", children: [_jsx("div", { className: "h-[60px] w-full" }), _jsx("div", { className: "mb-1 flex w-full flex-col items-center gap-2 p-5", children: _jsxs("span", { className: "font-sf-rounded text-2xl font-semibold", children: ["Swap & Stake ", stakeAmount ? formatTokenAmount(BigInt(stakeAmount), token.decimals) : "", " ", token.symbol] }) })] }) }));
19
19
  // Only generate encoded data if we have a valid beneficiary address
20
20
  // This is used for the AnySpendCustom swap & stake flow
@@ -24,5 +24,5 @@ export function AnySpendStakeUpside({ loadOrder, mode = "modal", beneficiaryAddr
24
24
  const encodedData = generateEncodedDataForStaking(stakeAmount, beneficiaryAddress);
25
25
  return (_jsx(AnySpendCustom, { loadOrder: loadOrder, mode: mode, recipientAddress: beneficiaryAddress, orderType: "custom", dstChainId: base.id, dstToken: token, dstAmount: stakeAmount, contractAddress: stakingContractAddress, encodedData: encodedData, metadata: {
26
26
  action: `stake ${token.symbol}`,
27
- }, header: header, onSuccess: onSuccess, showRecipient: true, activeTab: activeTab }));
27
+ }, header: header, onSuccess: onSuccess, showRecipient: true, activeTab: activeTab, senderAddress: senderAddress, slots: slots, content: content, theme: theme }));
28
28
  }
@@ -1,5 +1,6 @@
1
1
  import { components } from "../../../anyspend/types/api";
2
- export declare function AnySpendStakeUpsideExactIn({ loadOrder, mode, recipientAddress, sourceTokenAddress, sourceTokenChainId, destinationTokenAmount, stakingContractAddress, token, onSuccess, }: {
2
+ import type { AnySpendContent, AnySpendSlots, AnySpendTheme } from "./types/customization";
3
+ export declare function AnySpendStakeUpsideExactIn({ loadOrder, mode, recipientAddress, sourceTokenAddress, sourceTokenChainId, destinationTokenAmount, stakingContractAddress, token, onSuccess, senderAddress, slots, content, theme, }: {
3
4
  loadOrder?: string;
4
5
  mode?: "modal" | "page";
5
6
  recipientAddress: string;
@@ -9,4 +10,9 @@ export declare function AnySpendStakeUpsideExactIn({ loadOrder, mode, recipientA
9
10
  token: components["schemas"]["Token"];
10
11
  destinationTokenAmount?: string;
11
12
  onSuccess?: (amount: string) => void;
13
+ /** Optional sender (payer) address — pre-fills token balances when the user address is known ahead of time */
14
+ senderAddress?: string;
15
+ slots?: AnySpendSlots;
16
+ content?: AnySpendContent;
17
+ theme?: AnySpendTheme;
12
18
  }): import("react/jsx-runtime").JSX.Element | null;
@@ -14,7 +14,7 @@ const STAKE_FOR_FUNCTION_ABI = JSON.stringify([
14
14
  outputs: [],
15
15
  },
16
16
  ]);
17
- export function AnySpendStakeUpsideExactIn({ loadOrder, mode = "modal", recipientAddress, sourceTokenAddress, sourceTokenChainId, destinationTokenAmount, stakingContractAddress, token, onSuccess, }) {
17
+ export function AnySpendStakeUpsideExactIn({ loadOrder, mode = "modal", recipientAddress, sourceTokenAddress, sourceTokenChainId, destinationTokenAmount, stakingContractAddress, token, onSuccess, senderAddress, slots, content, theme, }) {
18
18
  if (!recipientAddress)
19
19
  return null;
20
20
  const header = () => (_jsx(_Fragment, { children: _jsx("div", { className: "from-b3-react-background to-as-on-surface-1 w-full rounded-t-lg bg-gradient-to-t", children: _jsx("div", { className: "mb-1 flex w-full flex-col items-center gap-2", children: _jsxs("span", { className: "font-sf-rounded text-2xl font-semibold", children: ["Swap & Stake ", token.symbol, " (Exact In)"] }) }) }) }));
@@ -26,5 +26,5 @@ export function AnySpendStakeUpsideExactIn({ loadOrder, mode = "modal", recipien
26
26
  spenderAddress: stakingContractAddress,
27
27
  action: `stake ${token.symbol}`,
28
28
  };
29
- return (_jsx(AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: token, destinationChainId: base.id, destinationTokenAmount: destinationTokenAmount, customExactInConfig: customExactInConfig, header: header, onSuccess: onSuccess }));
29
+ return (_jsx(AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: token, destinationChainId: base.id, destinationTokenAmount: destinationTokenAmount, customExactInConfig: customExactInConfig, header: header, onSuccess: onSuccess, senderAddress: senderAddress, slots: slots, content: content, theme: theme }));
30
30
  }