@stridge/kit 0.1.0-alpha.6 → 0.1.0-alpha.60

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 (597) hide show
  1. package/README.md +22 -6
  2. package/dist/KitProvider.d.ts +61 -0
  3. package/dist/KitProvider.js +1 -1
  4. package/dist/_internal/activity/driver/index.d.ts +3 -0
  5. package/dist/_internal/activity/driver/index.js +1 -0
  6. package/dist/_internal/deposit/driver/index.d.ts +2 -2
  7. package/dist/_internal/drivers/stridge/index.d.ts +4 -2
  8. package/dist/_internal/drivers/stridge/index.js +1 -1
  9. package/dist/_internal/drivers/stridge-mock/index.d.ts +2 -1
  10. package/dist/_internal/drivers/stridge-mock/index.js +1 -1
  11. package/dist/_internal/withdraw/driver/index.d.ts +2 -2
  12. package/dist/activity/compound/index.d.ts +19 -0
  13. package/dist/activity/compound/index.js +1 -0
  14. package/dist/activity/dialog/index.d.ts +4 -0
  15. package/dist/activity/dialog/index.js +1 -0
  16. package/dist/activity/widgets/index.d.ts +5 -0
  17. package/dist/activity/widgets/index.js +1 -0
  18. package/dist/deposit/compound/index.d.ts +22 -15
  19. package/dist/deposit/compound/index.js +1 -1
  20. package/dist/deposit/dialog/index.d.ts +2 -1
  21. package/dist/deposit/widgets/index.d.ts +16 -0
  22. package/dist/deposit/widgets/index.js +1 -0
  23. package/dist/drivers/stridge/catalog.d.ts +54 -0
  24. package/dist/drivers/stridge/catalog.js +1 -0
  25. package/dist/drivers/stridge/createStridgeActivityDriver.d.ts +44 -0
  26. package/dist/drivers/stridge/createStridgeActivityDriver.js +1 -0
  27. package/dist/drivers/stridge/createStridgeDepositDriver.d.ts +10 -1
  28. package/dist/drivers/stridge/createStridgeDepositDriver.js +1 -1
  29. package/dist/drivers/stridge/createStridgeWithdrawDriver.d.ts +37 -14
  30. package/dist/drivers/stridge/createStridgeWithdrawDriver.js +1 -1
  31. package/dist/drivers/stridge/internal/ensureWalletChain.js +1 -0
  32. package/dist/drivers/stridge/internal/pollOnce.js +1 -1
  33. package/dist/drivers/stridge/internal/resolveAddEthereumChain.js +1 -0
  34. package/dist/drivers/stridge/internal/retry.js +1 -0
  35. package/dist/drivers/stridge/internal/supportedChains.js +1 -0
  36. package/dist/drivers/stridge/types.d.ts +20 -14
  37. package/dist/drivers/stridge/types.js +1 -1
  38. package/dist/drivers/stridge/wagmiSigner.js +1 -1
  39. package/dist/drivers/stridge-mock/createStridgeMockActivityDriver.d.ts +44 -0
  40. package/dist/drivers/stridge-mock/createStridgeMockActivityDriver.js +1 -0
  41. package/dist/drivers/stridge-mock/createStridgeMockDriver.d.ts +2 -2
  42. package/dist/drivers/stridge-mock/createStridgeMockDriver.js +1 -1
  43. package/dist/drivers/stridge-mock/createStridgeMockWithdrawDriver.d.ts +15 -3
  44. package/dist/drivers/stridge-mock/createStridgeMockWithdrawDriver.js +1 -1
  45. package/dist/drivers/stridge-mock/fixtures.d.ts +14 -12
  46. package/dist/drivers/stridge-mock/fixtures.js +1 -1
  47. package/dist/events/bus/createBus.d.ts +26 -0
  48. package/dist/events/bus/createBus.js +1 -0
  49. package/dist/events/bus/flowIdRegistry.d.ts +17 -0
  50. package/dist/events/bus/flowIdRegistry.js +1 -0
  51. package/dist/events/bus/index.js +1 -0
  52. package/dist/events/bus/metadata.js +1 -0
  53. package/dist/events/context.js +1 -0
  54. package/dist/events/emit/index.js +1 -0
  55. package/dist/events/emit/mapFailure.js +1 -0
  56. package/dist/events/emit/useActivityEmissions.js +1 -0
  57. package/dist/events/emit/useDepositEmissions.js +1 -0
  58. package/dist/events/emit/useKitEmitter.js +1 -0
  59. package/dist/events/emit/useWithdrawEmissions.js +1 -0
  60. package/dist/events/hooks/index.d.ts +6 -0
  61. package/dist/events/hooks/index.js +1 -0
  62. package/dist/events/hooks/useCurrentFlowId.d.ts +6 -0
  63. package/dist/events/hooks/useCurrentFlowId.js +1 -0
  64. package/dist/events/hooks/useStableHandler.js +1 -0
  65. package/dist/events/hooks/useStridgeEvent.d.ts +9 -0
  66. package/dist/events/hooks/useStridgeEvent.js +1 -0
  67. package/dist/events/hooks/useStridgeEventBus.d.ts +34 -0
  68. package/dist/events/hooks/useStridgeEventBus.js +1 -0
  69. package/dist/events/hooks/useStridgeEvents.d.ts +7 -0
  70. package/dist/events/hooks/useStridgeEvents.js +1 -0
  71. package/dist/events/hooks/useStridgeFlowEvent.d.ts +8 -0
  72. package/dist/events/hooks/useStridgeFlowEvent.js +1 -0
  73. package/dist/events/hooks/useStridgeFlowEvents.d.ts +6 -0
  74. package/dist/events/hooks/useStridgeFlowEvents.js +1 -0
  75. package/dist/events/index.d.ts +17 -0
  76. package/dist/events/index.js +1 -0
  77. package/dist/events/publish.js +1 -0
  78. package/dist/events/redact.d.ts +34 -0
  79. package/dist/events/redact.js +1 -0
  80. package/dist/events/types/activity.d.ts +53 -0
  81. package/dist/events/types/deposit.d.ts +235 -0
  82. package/dist/events/types/envelope.d.ts +145 -0
  83. package/dist/events/types/index.d.ts +32 -0
  84. package/dist/events/types/kit.d.ts +23 -0
  85. package/dist/events/types/withdraw.d.ts +150 -0
  86. package/dist/flows/activity/compound/ActivityFlow.d.ts +46 -0
  87. package/dist/flows/activity/compound/ActivityFlow.js +1 -0
  88. package/dist/flows/activity/compound/components/Boundary.d.ts +29 -0
  89. package/dist/flows/activity/compound/components/Boundary.js +1 -0
  90. package/dist/flows/activity/compound/components/Steps.d.ts +24 -0
  91. package/dist/flows/activity/compound/components/Steps.js +1 -0
  92. package/dist/flows/activity/dialog/ActivityDialog.d.ts +55 -0
  93. package/dist/flows/activity/dialog/ActivityDialog.js +1 -0
  94. package/dist/flows/activity/dialog/ActivityFlowBoundary.d.ts +1 -0
  95. package/dist/flows/activity/dialog/ActivityFlowBoundary.js +1 -0
  96. package/dist/flows/activity/driver/context.d.ts +38 -0
  97. package/dist/flows/activity/driver/context.js +1 -0
  98. package/dist/flows/activity/driver/types.d.ts +58 -0
  99. package/dist/flows/activity/orchestrator/controller.d.ts +11 -0
  100. package/dist/flows/activity/orchestrator/controller.js +1 -0
  101. package/dist/flows/activity/orchestrator/index.d.ts +4 -0
  102. package/dist/flows/activity/orchestrator/index.js +1 -0
  103. package/dist/flows/activity/orchestrator/reducer.d.ts +1 -0
  104. package/dist/flows/activity/orchestrator/reducer.js +1 -0
  105. package/dist/flows/activity/orchestrator/types.d.ts +71 -0
  106. package/dist/flows/activity/orchestrator/useActivity.d.ts +94 -0
  107. package/dist/flows/activity/orchestrator/useActivity.js +1 -0
  108. package/dist/flows/activity/widgets/ActivityDetail.d.ts +41 -0
  109. package/dist/flows/activity/widgets/ActivityDetail.js +1 -0
  110. package/dist/flows/activity/widgets/ActivityList.d.ts +38 -0
  111. package/dist/flows/activity/widgets/ActivityList.js +1 -0
  112. package/dist/flows/activity/widgets/useStandaloneActivitySource.js +1 -0
  113. package/dist/flows/deposit/bindings/DepositBindings.d.ts +87 -0
  114. package/dist/flows/deposit/bindings/DepositBindings.js +1 -0
  115. package/dist/flows/deposit/bindings/index.d.ts +1 -0
  116. package/dist/flows/deposit/bindings/index.js +1 -0
  117. package/dist/flows/deposit/dialog/DepositBootstrapErrorState.js +1 -1
  118. package/dist/flows/deposit/dialog/DepositDialog.d.ts +26 -79
  119. package/dist/flows/deposit/dialog/DepositDialog.js +1 -1
  120. package/dist/flows/deposit/dialog/WalletRequiredState.js +1 -0
  121. package/dist/flows/deposit/dialog/WalletRequiredState.styles.js +1 -0
  122. package/dist/flows/deposit/driver/payloads.d.ts +52 -5
  123. package/dist/flows/deposit/driver/transformers/balanceToBalancesPayload.d.ts +2 -0
  124. package/dist/flows/deposit/driver/transformers/balanceToBalancesPayload.js +1 -1
  125. package/dist/flows/deposit/driver/transformers/index.d.ts +1 -0
  126. package/dist/flows/deposit/driver/transformers/quoteToPayload.d.ts +2 -0
  127. package/dist/flows/deposit/driver/transformers/settlementToPayload.d.ts +25 -0
  128. package/dist/flows/deposit/driver/transformers/settlementToPayload.js +1 -1
  129. package/dist/flows/deposit/driver/transformers/startToAddressesPayload.d.ts +2 -0
  130. package/dist/flows/deposit/driver/transformers/startToAddressesPayload.js +1 -1
  131. package/dist/flows/deposit/driver/transformers/startToBrandPayload.d.ts +1 -0
  132. package/dist/flows/deposit/driver/transformers/startToTargetPayload.d.ts +2 -0
  133. package/dist/flows/deposit/driver/transformers/startToTargetPayload.js +1 -1
  134. package/dist/flows/deposit/driver/transformers/walletAddressToWalletPayload.d.ts +1 -0
  135. package/dist/flows/deposit/driver/types.d.ts +37 -4
  136. package/dist/flows/deposit/orchestrator/controller.js +1 -1
  137. package/dist/flows/deposit/orchestrator/index.d.ts +5 -0
  138. package/dist/flows/deposit/orchestrator/reducer.d.ts +1 -0
  139. package/dist/flows/deposit/orchestrator/reducer.js +1 -1
  140. package/dist/flows/deposit/orchestrator/types.d.ts +228 -7
  141. package/dist/flows/deposit/orchestrator/useDeposit.d.ts +45 -1
  142. package/dist/flows/deposit/orchestrator/useDeposit.js +1 -1
  143. package/dist/flows/deposit/shared/cash.d.ts +20 -0
  144. package/dist/flows/deposit/shared/cash.js +1 -0
  145. package/dist/flows/deposit/widgets/activity/DepositActivityDetail.d.ts +40 -0
  146. package/dist/flows/deposit/widgets/activity/DepositActivityDetail.js +1 -0
  147. package/dist/flows/deposit/widgets/activity/DepositActivityList.d.ts +38 -0
  148. package/dist/flows/deposit/widgets/activity/DepositActivityList.js +1 -0
  149. package/dist/flows/deposit/widgets/activity/index.d.ts +2 -0
  150. package/dist/flows/deposit/widgets/activity/index.js +1 -0
  151. package/dist/flows/deposit/widgets/activity/useDepositActivitySource.js +1 -0
  152. package/dist/flows/deposit/widgets/amount-entry/AmountEntry.d.ts +32 -5
  153. package/dist/flows/deposit/widgets/amount-entry/AmountEntry.js +1 -1
  154. package/dist/flows/deposit/widgets/amount-entry/footerIntent.js +1 -0
  155. package/dist/flows/deposit/widgets/asset-picker/AssetPicker.d.ts +24 -4
  156. package/dist/flows/deposit/widgets/asset-picker/AssetPicker.js +1 -1
  157. package/dist/flows/deposit/widgets/cash-amount-entry/CashAmountEntry.d.ts +71 -0
  158. package/dist/flows/deposit/widgets/cash-amount-entry/CashAmountEntry.js +1 -0
  159. package/dist/flows/deposit/widgets/cash-amount-entry/compound/CashAmountEntry.d.ts +69 -0
  160. package/dist/flows/deposit/widgets/cash-amount-entry/compound/CashAmountEntry.js +1 -0
  161. package/dist/flows/deposit/widgets/cash-amount-entry/compound/CashAmountEntry.slots.d.ts +16 -0
  162. package/dist/flows/deposit/widgets/cash-amount-entry/compound/CashAmountEntry.slots.js +1 -0
  163. package/dist/flows/deposit/widgets/cash-amount-entry/compound/CashAmountEntry.styles.js +1 -0
  164. package/dist/flows/deposit/widgets/cash-amount-entry/compound/components/HeroLabel.d.ts +13 -0
  165. package/dist/flows/deposit/widgets/cash-amount-entry/compound/components/HeroLabel.js +1 -0
  166. package/dist/flows/deposit/widgets/cash-amount-entry/compound/components/MethodChip.d.ts +18 -0
  167. package/dist/flows/deposit/widgets/cash-amount-entry/compound/components/MethodChip.js +1 -0
  168. package/dist/flows/deposit/widgets/cash-amount-entry/compound/components/ReceiveChip.d.ts +14 -0
  169. package/dist/flows/deposit/widgets/cash-amount-entry/compound/components/ReceiveChip.js +1 -0
  170. package/dist/flows/deposit/widgets/cash-amount-entry/compound/context.js +1 -0
  171. package/dist/flows/deposit/widgets/cash-amount-entry/compound/index.d.ts +3 -0
  172. package/dist/flows/deposit/widgets/cash-amount-entry/compound/index.js +1 -0
  173. package/dist/flows/deposit/widgets/cash-amount-entry/compound/types.d.ts +42 -0
  174. package/dist/flows/deposit/widgets/cash-amount-entry/index.d.ts +1 -0
  175. package/dist/flows/deposit/widgets/cash-amount-entry/index.js +1 -0
  176. package/dist/flows/deposit/widgets/cash-confirm/CashConfirm.d.ts +63 -0
  177. package/dist/flows/deposit/widgets/cash-confirm/CashConfirm.js +1 -0
  178. package/dist/flows/deposit/widgets/cash-confirm/compound/CashConfirm.d.ts +54 -0
  179. package/dist/flows/deposit/widgets/cash-confirm/compound/CashConfirm.js +1 -0
  180. package/dist/flows/deposit/widgets/cash-confirm/compound/CashConfirm.slots.d.ts +33 -0
  181. package/dist/flows/deposit/widgets/cash-confirm/compound/CashConfirm.slots.js +1 -0
  182. package/dist/flows/deposit/widgets/cash-confirm/compound/CashConfirm.styles.js +1 -0
  183. package/dist/flows/deposit/widgets/cash-confirm/compound/cashConfirmDimensions.js +1 -0
  184. package/dist/flows/deposit/widgets/cash-confirm/compound/components/ApplePayBody.d.ts +15 -0
  185. package/dist/flows/deposit/widgets/cash-confirm/compound/components/ApplePayBody.js +1 -0
  186. package/dist/flows/deposit/widgets/cash-confirm/compound/components/Body.d.ts +22 -0
  187. package/dist/flows/deposit/widgets/cash-confirm/compound/components/Body.js +1 -0
  188. package/dist/flows/deposit/widgets/cash-confirm/compound/components/BodyLabel.js +1 -0
  189. package/dist/flows/deposit/widgets/cash-confirm/compound/components/CardBody.d.ts +16 -0
  190. package/dist/flows/deposit/widgets/cash-confirm/compound/components/CardBody.js +1 -0
  191. package/dist/flows/deposit/widgets/cash-confirm/compound/components/CardInputRow.icons.js +1 -0
  192. package/dist/flows/deposit/widgets/cash-confirm/compound/components/CardInputRow.js +1 -0
  193. package/dist/flows/deposit/widgets/cash-confirm/compound/components/CardInputRow.keys.js +1 -0
  194. package/dist/flows/deposit/widgets/cash-confirm/compound/components/CardInputRow.state.js +1 -0
  195. package/dist/flows/deposit/widgets/cash-confirm/compound/components/CardInputRow.styles.js +1 -0
  196. package/dist/flows/deposit/widgets/cash-confirm/compound/components/GooglePayBody.d.ts +16 -0
  197. package/dist/flows/deposit/widgets/cash-confirm/compound/components/GooglePayBody.js +1 -0
  198. package/dist/flows/deposit/widgets/cash-confirm/compound/components/Header.d.ts +21 -0
  199. package/dist/flows/deposit/widgets/cash-confirm/compound/components/Header.js +1 -0
  200. package/dist/flows/deposit/widgets/cash-confirm/compound/components/Summary.d.ts +17 -0
  201. package/dist/flows/deposit/widgets/cash-confirm/compound/components/Summary.js +1 -0
  202. package/dist/flows/deposit/widgets/cash-confirm/compound/components/cardFormat.js +1 -0
  203. package/dist/flows/deposit/widgets/cash-confirm/compound/context.js +1 -0
  204. package/dist/flows/deposit/widgets/cash-confirm/compound/index.d.ts +3 -0
  205. package/dist/flows/deposit/widgets/cash-confirm/compound/index.js +1 -0
  206. package/dist/flows/deposit/widgets/cash-confirm/compound/types.d.ts +66 -0
  207. package/dist/flows/deposit/widgets/cash-confirm/index.d.ts +1 -0
  208. package/dist/flows/deposit/widgets/cash-confirm/index.js +1 -0
  209. package/dist/flows/deposit/widgets/cash-confirm/mocks.js +1 -0
  210. package/dist/flows/deposit/widgets/confirm-deposit/ConfirmDeposit.d.ts +37 -4
  211. package/dist/flows/deposit/widgets/confirm-deposit/ConfirmDeposit.js +1 -1
  212. package/dist/flows/deposit/widgets/deposit/Deposit.d.ts +39 -4
  213. package/dist/flows/deposit/widgets/deposit/Deposit.js +1 -1
  214. package/dist/flows/deposit/widgets/deposit/compound/Deposit.d.ts +58 -1
  215. package/dist/flows/deposit/widgets/deposit/compound/Deposit.js +1 -1
  216. package/dist/flows/deposit/widgets/deposit/compound/Deposit.slots.d.ts +6 -0
  217. package/dist/flows/deposit/widgets/deposit/compound/Deposit.slots.js +1 -1
  218. package/dist/flows/deposit/widgets/deposit/compound/Deposit.styles.js +1 -1
  219. package/dist/flows/deposit/widgets/deposit/compound/components/Boundary.d.ts +29 -0
  220. package/dist/flows/deposit/widgets/deposit/compound/components/Boundary.js +1 -0
  221. package/dist/flows/deposit/widgets/deposit/compound/components/Guards.d.ts +28 -0
  222. package/dist/flows/deposit/widgets/deposit/compound/components/Guards.js +1 -0
  223. package/dist/flows/deposit/widgets/deposit/compound/components/Header.d.ts +11 -0
  224. package/dist/flows/deposit/widgets/deposit/compound/components/Header.js +1 -1
  225. package/dist/flows/deposit/widgets/deposit/compound/components/Method.d.ts +7 -0
  226. package/dist/flows/deposit/widgets/deposit/compound/components/Method.js +1 -1
  227. package/dist/flows/deposit/widgets/deposit/compound/components/MethodSection.d.ts +40 -0
  228. package/dist/flows/deposit/widgets/deposit/compound/components/MethodSection.js +1 -0
  229. package/dist/flows/deposit/widgets/deposit/compound/components/Methods.d.ts +16 -9
  230. package/dist/flows/deposit/widgets/deposit/compound/components/Methods.js +1 -1
  231. package/dist/flows/deposit/widgets/deposit/compound/components/Rail.d.ts +18 -0
  232. package/dist/flows/deposit/widgets/deposit/compound/components/Rail.js +1 -0
  233. package/dist/flows/deposit/widgets/deposit/compound/components/RailPicker.d.ts +43 -0
  234. package/dist/flows/deposit/widgets/deposit/compound/components/RailPicker.js +1 -0
  235. package/dist/flows/deposit/widgets/deposit/compound/components/Steps.d.ts +24 -0
  236. package/dist/flows/deposit/widgets/deposit/compound/components/Steps.js +1 -0
  237. package/dist/flows/deposit/widgets/deposit/compound/index.d.ts +2 -1
  238. package/dist/flows/deposit/widgets/deposit/compound/types.d.ts +106 -4
  239. package/dist/flows/deposit/widgets/deposit-status-banner/DepositStatusBanner.d.ts +41 -1
  240. package/dist/flows/deposit/widgets/deposit-status-banner/DepositStatusBanner.js +1 -1
  241. package/dist/flows/deposit/widgets/deposit-status-banner/compound/DepositStatusBanner.js +1 -1
  242. package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Hero.js +1 -1
  243. package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/PrimaryAction.js +1 -1
  244. package/dist/flows/deposit/widgets/deposit-status-banner/compound/types.d.ts +5 -5
  245. package/dist/flows/deposit/widgets/error-state/ErrorState.d.ts +39 -4
  246. package/dist/flows/deposit/widgets/error-state/ErrorState.js +1 -1
  247. package/dist/flows/deposit/widgets/processing-state/ProcessingState.d.ts +30 -4
  248. package/dist/flows/deposit/widgets/processing-state/ProcessingState.js +1 -1
  249. package/dist/flows/deposit/widgets/success-state/SuccessState.d.ts +38 -4
  250. package/dist/flows/deposit/widgets/success-state/SuccessState.js +1 -1
  251. package/dist/flows/deposit/widgets/transfer-crypto/TransferCrypto.d.ts +34 -3
  252. package/dist/flows/deposit/widgets/transfer-crypto/TransferCrypto.js +1 -1
  253. package/dist/flows/deposit/widgets/transfer-crypto/compound/TransferCrypto.d.ts +1 -1
  254. package/dist/flows/deposit/widgets/transfer-crypto/compound/TransferCrypto.styles.js +1 -1
  255. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Address.js +1 -1
  256. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Disclosure.d.ts +5 -2
  257. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Disclosure.js +1 -1
  258. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Header.d.ts +6 -0
  259. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Header.js +1 -1
  260. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/QrCode.d.ts +4 -10
  261. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/QrCode.js +1 -1
  262. package/dist/flows/deposit/widgets/transfer-crypto/compound/types.d.ts +16 -2
  263. package/dist/flows/shared/transformers/computeQuoteAttrs.d.ts +1 -0
  264. package/dist/flows/shared/transformers/index.d.ts +1 -0
  265. package/dist/flows/shared/transformers/pickRelevantSettlement.d.ts +1 -0
  266. package/dist/flows/shared/transformers/pickRelevantSettlement.js +1 -1
  267. package/dist/flows/shared/transformers/testnets.js +1 -0
  268. package/dist/flows/withdraw/bindings/WithdrawBindings.d.ts +92 -0
  269. package/dist/flows/withdraw/bindings/WithdrawBindings.js +1 -0
  270. package/dist/flows/withdraw/bindings/index.d.ts +1 -0
  271. package/dist/flows/withdraw/bindings/index.js +1 -0
  272. package/dist/flows/withdraw/dialog/WithdrawDialog.d.ts +44 -71
  273. package/dist/flows/withdraw/dialog/WithdrawDialog.js +1 -1
  274. package/dist/flows/withdraw/driver/dto.d.ts +8 -7
  275. package/dist/flows/withdraw/driver/payloads.d.ts +16 -1
  276. package/dist/flows/withdraw/driver/transformers/settlementToWithdrawalPayload.js +1 -1
  277. package/dist/flows/withdraw/driver/transformers/supportedAssetsToReceiveOptionsPayload.js +1 -1
  278. package/dist/flows/withdraw/driver/types.d.ts +77 -14
  279. package/dist/flows/withdraw/orchestrator/controller.js +1 -1
  280. package/dist/flows/withdraw/orchestrator/index.d.ts +1 -1
  281. package/dist/flows/withdraw/orchestrator/reducer.js +1 -1
  282. package/dist/flows/withdraw/orchestrator/types.d.ts +218 -35
  283. package/dist/flows/withdraw/orchestrator/useWithdraw.d.ts +36 -1
  284. package/dist/flows/withdraw/orchestrator/useWithdraw.js +1 -1
  285. package/dist/flows/withdraw/widgets/activity/WithdrawActivityDetail.d.ts +39 -0
  286. package/dist/flows/withdraw/widgets/activity/WithdrawActivityDetail.js +1 -0
  287. package/dist/flows/withdraw/widgets/activity/WithdrawActivityList.d.ts +36 -0
  288. package/dist/flows/withdraw/widgets/activity/WithdrawActivityList.js +1 -0
  289. package/dist/flows/withdraw/widgets/activity/index.d.ts +2 -0
  290. package/dist/flows/withdraw/widgets/activity/index.js +1 -0
  291. package/dist/flows/withdraw/widgets/activity/useWithdrawActivitySource.js +1 -0
  292. package/dist/flows/withdraw/widgets/withdraw/compound/Withdraw.d.ts +60 -0
  293. package/dist/flows/withdraw/widgets/withdraw/compound/Withdraw.js +1 -0
  294. package/dist/flows/withdraw/widgets/withdraw/compound/Withdraw.slots.d.ts +13 -0
  295. package/dist/flows/withdraw/widgets/withdraw/compound/Withdraw.slots.js +1 -0
  296. package/dist/flows/withdraw/widgets/withdraw/compound/components/Boundary.d.ts +29 -0
  297. package/dist/flows/withdraw/widgets/withdraw/compound/components/Boundary.js +1 -0
  298. package/dist/flows/withdraw/widgets/withdraw/compound/components/Guards.d.ts +25 -0
  299. package/dist/flows/withdraw/widgets/withdraw/compound/components/Guards.js +1 -0
  300. package/dist/flows/withdraw/widgets/withdraw/compound/components/Steps.d.ts +27 -0
  301. package/dist/flows/withdraw/widgets/withdraw/compound/components/Steps.js +1 -0
  302. package/dist/flows/withdraw/widgets/withdraw/compound/index.d.ts +3 -0
  303. package/dist/flows/withdraw/widgets/withdraw/compound/index.js +1 -0
  304. package/dist/flows/withdraw/widgets/withdraw-error/WithdrawError.d.ts +45 -2
  305. package/dist/flows/withdraw/widgets/withdraw-error/WithdrawError.js +1 -1
  306. package/dist/flows/withdraw/widgets/withdraw-form/WithdrawForm.d.ts +32 -12
  307. package/dist/flows/withdraw/widgets/withdraw-form/WithdrawForm.js +1 -1
  308. package/dist/flows/withdraw/widgets/withdraw-form/compound/WithdrawForm.js +1 -1
  309. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Body.d.ts +7 -6
  310. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Header.d.ts +6 -1
  311. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Header.js +1 -1
  312. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/RecipientField.d.ts +7 -5
  313. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/RecipientField.js +1 -1
  314. package/dist/flows/withdraw/widgets/withdraw-form/compound/types.d.ts +15 -5
  315. package/dist/flows/withdraw/widgets/withdraw-form/validation.js +1 -1
  316. package/dist/flows/withdraw/widgets/withdraw-in-progress/WithdrawInProgress.d.ts +39 -3
  317. package/dist/flows/withdraw/widgets/withdraw-in-progress/WithdrawInProgress.js +1 -1
  318. package/dist/flows/withdraw/widgets/withdraw-success/WithdrawSuccess.d.ts +46 -2
  319. package/dist/flows/withdraw/widgets/withdraw-success/WithdrawSuccess.js +1 -1
  320. package/dist/format/index.d.ts +2 -1
  321. package/dist/format/index.js +1 -1
  322. package/dist/i18n/index.d.ts +5 -4
  323. package/dist/i18n/index.js +1 -1
  324. package/dist/i18n/locales/ar.js +1 -1
  325. package/dist/i18n/locales/es.js +1 -1
  326. package/dist/i18n/locales/source-keys.d.ts +12 -0
  327. package/dist/i18n/locales/source-keys.js +0 -0
  328. package/dist/icons/index.d.ts +12 -1
  329. package/dist/icons/index.js +1 -1
  330. package/dist/index.d.ts +36 -11
  331. package/dist/index.js +1 -1
  332. package/dist/package.js +1 -1
  333. package/dist/scope/KitPortalScope.js +1 -1
  334. package/dist/scope/KitScope.d.ts +27 -1
  335. package/dist/scope/KitScope.js +1 -1
  336. package/dist/scope/context.d.ts +24 -1
  337. package/dist/scope/index.d.ts +1 -1
  338. package/dist/shared/attribution/Attribution.js +1 -0
  339. package/dist/shared/attribution/Attribution.slots.js +1 -0
  340. package/dist/shared/attribution/Attribution.styles.js +1 -0
  341. package/dist/shared/attribution/index.js +1 -0
  342. package/dist/shared/chains/index.d.ts +48 -29
  343. package/dist/shared/chains/index.js +1 -1
  344. package/dist/shared/constants/brand-intercom.js +1 -0
  345. package/dist/shared/cuer/Cuer.js +1 -1
  346. package/dist/shared/dialog/DialogShell.d.ts +21 -6
  347. package/dist/shared/dialog/DialogShell.js +1 -1
  348. package/dist/shared/dialog/Frame.js +1 -1
  349. package/dist/shared/dialog/LoadingState.js +1 -0
  350. package/dist/shared/dialog/LoadingState.styles.js +1 -0
  351. package/dist/shared/dialog/StepTransition.js +1 -1
  352. package/dist/shared/dialog/useDirectionalChevronTransform.js +1 -1
  353. package/dist/shared/driver/types.d.ts +4 -3
  354. package/dist/shared/format/formatSmartRelative.d.ts +25 -0
  355. package/dist/shared/format/formatSmartRelative.js +1 -0
  356. package/dist/shared/format/formatUsd.js +1 -1
  357. package/dist/shared/i18n/KitI18nProvider.d.ts +11 -8
  358. package/dist/shared/i18n/KitI18nProvider.js +1 -1
  359. package/dist/shared/i18n/createKitI18n.d.ts +79 -16
  360. package/dist/shared/i18n/createKitI18n.js +1 -1
  361. package/dist/shared/i18n/useLingui.d.ts +11 -3
  362. package/dist/shared/icons/ActivityIcon.d.ts +12 -0
  363. package/dist/shared/icons/ActivityIcon.js +1 -0
  364. package/dist/shared/icons/AmexIcon.d.ts +14 -0
  365. package/dist/shared/icons/AmexIcon.js +1 -0
  366. package/dist/shared/icons/ApplePayIcon.d.ts +15 -0
  367. package/dist/shared/icons/ApplePayIcon.js +1 -0
  368. package/dist/shared/icons/BitcoinIcon.d.ts +17 -0
  369. package/dist/shared/icons/BitcoinIcon.js +1 -0
  370. package/dist/shared/icons/CardIcon.d.ts +16 -0
  371. package/dist/shared/icons/CardIcon.js +1 -0
  372. package/dist/shared/icons/CashIcon.d.ts +16 -0
  373. package/dist/shared/icons/CashIcon.js +1 -0
  374. package/dist/shared/icons/DiscoverIcon.d.ts +14 -0
  375. package/dist/shared/icons/DiscoverIcon.js +1 -0
  376. package/dist/shared/icons/GooglePayIcon.d.ts +15 -0
  377. package/dist/shared/icons/GooglePayIcon.js +1 -0
  378. package/dist/shared/icons/LogoIcon.d.ts +13 -0
  379. package/dist/shared/icons/LogoIcon.js +1 -0
  380. package/dist/shared/icons/MastercardIcon.d.ts +16 -0
  381. package/dist/shared/icons/MastercardIcon.js +1 -0
  382. package/dist/shared/icons/VisaIcon.d.ts +15 -0
  383. package/dist/shared/icons/VisaIcon.js +1 -0
  384. package/dist/shared/merchant-link/MerchantLink.d.ts +1 -0
  385. package/dist/shared/merchant-link/MerchantLink.js +1 -0
  386. package/dist/shared/merchant-link/MerchantLinkButton.d.ts +1 -0
  387. package/dist/shared/merchant-link/MerchantLinkButton.js +1 -0
  388. package/dist/shared/merchant-link/index.d.ts +1 -0
  389. package/dist/shared/merchant-link/index.js +1 -0
  390. package/dist/shared/merchant-link/resolveMerchantLink.js +1 -0
  391. package/dist/shared/orchestrator/activityOpenInput.d.ts +21 -0
  392. package/dist/shared/orchestrator/createActivityReducers.js +1 -0
  393. package/dist/shared/orchestrator/index.d.ts +2 -0
  394. package/dist/shared/orchestrator/index.js +1 -1
  395. package/dist/shared/orchestrator/resolveActivityEntry.d.ts +1 -0
  396. package/dist/shared/orchestrator/resolveActivityEntry.js +1 -0
  397. package/dist/shared/orchestrator/toFailure.js +1 -1
  398. package/dist/shared/orchestrator/types.d.ts +8 -0
  399. package/dist/shared/orchestrator/useSettlementWatcher.js +1 -1
  400. package/dist/shared/presentation/index.js +1 -0
  401. package/dist/shared/presentation/types.d.ts +30 -0
  402. package/dist/shared/presentation/types.js +1 -0
  403. package/dist/shared/presentation/useResolvedSurfaceKind.js +1 -0
  404. package/dist/shared/primitives/TxHashValue/TxHashValue.js +1 -1
  405. package/dist/shared/support/SupportConfigContext.d.ts +1 -0
  406. package/dist/shared/support/SupportConfigContext.js +1 -0
  407. package/dist/shared/support/SupportLink.d.ts +1 -0
  408. package/dist/shared/support/SupportLink.js +1 -0
  409. package/dist/shared/support/SupportSpinner.d.ts +1 -0
  410. package/dist/shared/support/SupportSpinner.js +1 -0
  411. package/dist/shared/support/index.d.ts +2 -0
  412. package/dist/shared/support/index.js +1 -0
  413. package/dist/shared/support/intercom-loader.d.ts +17 -0
  414. package/dist/shared/support/intercom-loader.js +1 -0
  415. package/dist/shared/support/types.d.ts +43 -0
  416. package/dist/shared/support/useIntercomMerchantContext.d.ts +27 -0
  417. package/dist/shared/support/useIntercomMerchantContext.js +1 -0
  418. package/dist/shared/support/useIntercomShutdownOnUnmount.js +1 -0
  419. package/dist/shared/support/useMerchantContext.d.ts +1 -0
  420. package/dist/shared/support/useMerchantContext.js +1 -0
  421. package/dist/shared/support/useSupportTrigger.js +1 -0
  422. package/dist/shared/terms/TermsConfigContext.d.ts +1 -0
  423. package/dist/shared/terms/TermsConfigContext.js +1 -0
  424. package/dist/shared/terms/TermsLink.d.ts +1 -0
  425. package/dist/shared/terms/TermsLink.js +1 -0
  426. package/dist/shared/terms/index.d.ts +1 -0
  427. package/dist/shared/terms/index.js +1 -0
  428. package/dist/shared/terms/types.d.ts +43 -0
  429. package/dist/shared/ui/AdaptiveSurface/AdaptiveSurface.d.ts +52 -0
  430. package/dist/shared/ui/AdaptiveSurface/AdaptiveSurface.js +1 -0
  431. package/dist/shared/ui/AdaptiveSurface/index.d.ts +2 -0
  432. package/dist/shared/ui/AdaptiveSurface/index.js +1 -0
  433. package/dist/shared/ui/Card/Card.d.ts +12 -9
  434. package/dist/shared/ui/Card/Card.js +1 -1
  435. package/dist/shared/ui/Card/Card.styles.js +1 -1
  436. package/dist/shared/ui/Details/Details.d.ts +9 -1
  437. package/dist/shared/ui/Details/Details.styles.js +1 -1
  438. package/dist/shared/ui/Dialog/Dialog.d.ts +10 -8
  439. package/dist/shared/ui/Dialog/Dialog.js +1 -1
  440. package/dist/shared/ui/Dialog/Dialog.styles.js +1 -1
  441. package/dist/shared/ui/Drawer/Drawer.d.ts +135 -0
  442. package/dist/shared/ui/Drawer/Drawer.js +1 -0
  443. package/dist/shared/ui/Drawer/Drawer.slots.d.ts +19 -0
  444. package/dist/shared/ui/Drawer/Drawer.slots.js +1 -0
  445. package/dist/shared/ui/Drawer/Drawer.styles.js +1 -0
  446. package/dist/shared/ui/Drawer/index.d.ts +2 -0
  447. package/dist/shared/ui/Drawer/index.js +1 -0
  448. package/dist/shared/ui/Select/Select.js +1 -1
  449. package/dist/shared/ui/SelectableTile/SelectableTile.d.ts +21 -8
  450. package/dist/shared/ui/SelectableTile/SelectableTile.js +1 -1
  451. package/dist/shared/ui/Steps/Steps.d.ts +52 -0
  452. package/dist/shared/ui/Steps/Steps.js +1 -0
  453. package/dist/shared/ui/Steps/Steps.slots.d.ts +7 -0
  454. package/dist/shared/ui/Steps/Steps.slots.js +1 -0
  455. package/dist/shared/ui/Steps/Steps.styles.js +1 -0
  456. package/dist/shared/ui/Steps/index.d.ts +2 -0
  457. package/dist/shared/ui/Steps/index.js +1 -0
  458. package/dist/shared/ui/Tabs/Tabs.d.ts +79 -0
  459. package/dist/shared/ui/Tabs/Tabs.js +1 -0
  460. package/dist/shared/ui/Tabs/Tabs.slots.d.ts +11 -0
  461. package/dist/shared/ui/Tabs/Tabs.slots.js +1 -0
  462. package/dist/shared/ui/Tabs/Tabs.styles.js +1 -0
  463. package/dist/shared/ui/Tabs/index.d.ts +2 -0
  464. package/dist/shared/ui/Tabs/index.js +1 -0
  465. package/dist/shared/ui/WalletRow/WalletRow.d.ts +1 -1
  466. package/dist/shared/ui/WalletRow/WalletRow.js +1 -1
  467. package/dist/shared/ui/surfaceContext.d.ts +9 -0
  468. package/dist/shared/ui/surfaceContext.js +1 -0
  469. package/dist/shared/utils/assertNever.js +1 -0
  470. package/dist/shared/utils/logos/types.d.ts +1 -1
  471. package/dist/shared/utils/useDeepMemo.js +1 -0
  472. package/dist/shared/wallet/ConnectWalletContext.d.ts +17 -0
  473. package/dist/shared/wallet/ConnectWalletContext.js +1 -0
  474. package/dist/shared/widgets/activity/ActivityTrigger.js +1 -0
  475. package/dist/shared/widgets/activity/ActivityTrigger.styles.js +1 -0
  476. package/dist/shared/widgets/activity/adapters/settlementToWidgetProps.js +1 -0
  477. package/dist/shared/widgets/activity/compound/Activity.d.ts +95 -0
  478. package/dist/shared/widgets/activity/compound/Activity.js +1 -0
  479. package/dist/shared/widgets/activity/compound/Activity.slots.d.ts +22 -0
  480. package/dist/shared/widgets/activity/compound/Activity.slots.js +1 -0
  481. package/dist/shared/widgets/activity/compound/Activity.styles.js +1 -0
  482. package/dist/shared/widgets/activity/compound/ActivityDetail.d.ts +82 -0
  483. package/dist/shared/widgets/activity/compound/ActivityDetail.js +1 -0
  484. package/dist/shared/widgets/activity/compound/Row.slots.d.ts +21 -0
  485. package/dist/shared/widgets/activity/compound/Row.slots.js +1 -0
  486. package/dist/shared/widgets/activity/compound/Row.styles.js +1 -0
  487. package/dist/shared/widgets/activity/compound/components/ActivityHeader.d.ts +39 -0
  488. package/dist/shared/widgets/activity/compound/components/ActivityHeader.js +1 -0
  489. package/dist/shared/widgets/activity/compound/components/Empty.d.ts +15 -0
  490. package/dist/shared/widgets/activity/compound/components/Empty.js +1 -0
  491. package/dist/shared/widgets/activity/compound/components/ErrorView.d.ts +26 -0
  492. package/dist/shared/widgets/activity/compound/components/ErrorView.js +1 -0
  493. package/dist/shared/widgets/activity/compound/components/List.d.ts +23 -0
  494. package/dist/shared/widgets/activity/compound/components/List.js +1 -0
  495. package/dist/shared/widgets/activity/compound/components/Row.d.ts +51 -0
  496. package/dist/shared/widgets/activity/compound/components/Row.js +1 -0
  497. package/dist/shared/widgets/activity/compound/components/StatusPip.js +1 -0
  498. package/dist/shared/widgets/activity/compound/context.d.ts +95 -0
  499. package/dist/shared/widgets/activity/compound/context.js +1 -0
  500. package/dist/shared/widgets/activity/compound/index.d.ts +8 -0
  501. package/dist/shared/widgets/activity/compound/index.js +1 -0
  502. package/dist/shared/widgets/activity/index.js +1 -0
  503. package/dist/shared/widgets/activity/payloads.d.ts +108 -0
  504. package/dist/shared/widgets/activity/transformers/activityResponseToPayload.js +1 -0
  505. package/dist/shared/widgets/activity/transformers/resolveDirection.js +1 -0
  506. package/dist/shared/widgets/amount-entry/compound/AmountEntry.d.ts +10 -2
  507. package/dist/shared/widgets/amount-entry/compound/AmountEntry.js +1 -1
  508. package/dist/shared/widgets/amount-entry/compound/AmountEntry.slots.d.ts +6 -0
  509. package/dist/shared/widgets/amount-entry/compound/AmountEntry.slots.js +1 -1
  510. package/dist/shared/widgets/amount-entry/compound/AmountEntry.styles.js +1 -1
  511. package/dist/shared/widgets/amount-entry/compound/components/Details.d.ts +34 -0
  512. package/dist/shared/widgets/amount-entry/compound/components/Details.js +1 -0
  513. package/dist/shared/widgets/amount-entry/compound/components/Footer.d.ts +2 -1
  514. package/dist/shared/widgets/amount-entry/compound/components/Footer.js +1 -1
  515. package/dist/shared/widgets/amount-entry/compound/components/Header.d.ts +6 -1
  516. package/dist/shared/widgets/amount-entry/compound/components/Header.js +1 -1
  517. package/dist/shared/widgets/amount-entry/compound/components/Hero/Hero.js +1 -1
  518. package/dist/shared/widgets/amount-entry/compound/components/Hero/SwapBackdrop.js +1 -1
  519. package/dist/shared/widgets/amount-entry/compound/components/Notice.d.ts +7 -0
  520. package/dist/shared/widgets/amount-entry/compound/components/Notice.js +1 -0
  521. package/dist/shared/widgets/amount-entry/compound/index.d.ts +1 -1
  522. package/dist/shared/widgets/amount-entry/compound/types.d.ts +63 -3
  523. package/dist/shared/widgets/asset-picker/compound/AssetPicker.d.ts +3 -0
  524. package/dist/shared/widgets/asset-picker/compound/AssetPicker.js +1 -1
  525. package/dist/shared/widgets/asset-picker/compound/AssetPicker.slots.d.ts +2 -0
  526. package/dist/shared/widgets/asset-picker/compound/AssetPicker.slots.js +1 -1
  527. package/dist/shared/widgets/asset-picker/compound/AssetPicker.styles.js +1 -1
  528. package/dist/shared/widgets/asset-picker/compound/components/Asset.d.ts +7 -1
  529. package/dist/shared/widgets/asset-picker/compound/components/Asset.js +1 -1
  530. package/dist/shared/widgets/asset-picker/compound/components/Empty.d.ts +15 -0
  531. package/dist/shared/widgets/asset-picker/compound/components/Empty.js +1 -0
  532. package/dist/shared/widgets/asset-picker/compound/components/Header.d.ts +6 -1
  533. package/dist/shared/widgets/asset-picker/compound/components/Header.js +1 -1
  534. package/dist/shared/widgets/asset-picker/compound/types.d.ts +15 -1
  535. package/dist/shared/widgets/confirm-transfer/compound/ConfirmTransfer.styles.js +1 -1
  536. package/dist/shared/widgets/confirm-transfer/compound/components/Breakdown.js +1 -1
  537. package/dist/shared/widgets/confirm-transfer/compound/components/Disclaimer.d.ts +4 -3
  538. package/dist/shared/widgets/confirm-transfer/compound/components/Disclaimer.js +1 -1
  539. package/dist/shared/widgets/confirm-transfer/compound/components/QuoteTimer.js +1 -1
  540. package/dist/shared/widgets/error-state/compound/components/AssetValue.js +1 -1
  541. package/dist/shared/widgets/error-state/compound/components/HelpInfo.js +1 -1
  542. package/dist/shared/widgets/error-state/compound/components/MoreDetails.d.ts +1 -1
  543. package/dist/shared/widgets/error-state/compound/components/MoreDetails.js +1 -1
  544. package/dist/shared/widgets/error-state/compound/components/StatusValue.js +1 -1
  545. package/dist/shared/widgets/processing-state/compound/ProcessingState.d.ts +1 -5
  546. package/dist/shared/widgets/processing-state/compound/ProcessingState.js +1 -1
  547. package/dist/shared/widgets/processing-state/compound/ProcessingState.slots.d.ts +0 -1
  548. package/dist/shared/widgets/processing-state/compound/ProcessingState.slots.js +1 -1
  549. package/dist/shared/widgets/processing-state/compound/ProcessingState.styles.js +1 -1
  550. package/dist/shared/widgets/processing-state/compound/components/Details.d.ts +6 -1
  551. package/dist/shared/widgets/processing-state/compound/components/Details.js +1 -1
  552. package/dist/shared/widgets/processing-state/compound/components/Header.d.ts +4 -3
  553. package/dist/shared/widgets/processing-state/compound/components/Header.js +1 -1
  554. package/dist/shared/widgets/processing-state/compound/components/Hero.d.ts +14 -7
  555. package/dist/shared/widgets/processing-state/compound/components/Hero.js +1 -1
  556. package/dist/shared/widgets/processing-state/compound/components/Rows.js +1 -1
  557. package/dist/shared/widgets/processing-state/compound/components/StatusPill.js +1 -1
  558. package/dist/shared/widgets/processing-state/compound/components/splitAmount.js +1 -0
  559. package/dist/shared/widgets/processing-state/compound/index.d.ts +1 -1
  560. package/dist/shared/widgets/processing-state/compound/types.d.ts +11 -29
  561. package/dist/shared/widgets/success-state/compound/components/Actions.js +1 -1
  562. package/dist/shared/widgets/success-state/compound/components/AssetValue.js +1 -1
  563. package/dist/shared/widgets/success-state/compound/components/MoreDetails.d.ts +1 -1
  564. package/dist/shared/widgets/success-state/compound/components/MoreDetails.js +1 -1
  565. package/dist/shared/widgets/success-state/compound/components/RouteValue.js +1 -1
  566. package/dist/shared/widgets/success-state/compound/components/StatusPill.js +1 -1
  567. package/dist/shared/widgets/success-state/compound/types.d.ts +5 -5
  568. package/dist/storage/context.d.ts +9 -1
  569. package/dist/storage/context.js +1 -1
  570. package/dist/storage/index.d.ts +1 -1
  571. package/dist/stridge/StridgeProvider.d.ts +187 -35
  572. package/dist/stridge/StridgeProvider.js +1 -1
  573. package/dist/stridge/depositOwner.js +1 -0
  574. package/dist/stridge/optionalWagmi.js +1 -0
  575. package/dist/stridge/stubs.js +1 -1
  576. package/dist/styles/index.css +607 -12
  577. package/dist/types.d.ts +7 -5
  578. package/dist/ui/index.d.ts +9 -1
  579. package/dist/ui/index.js +1 -1
  580. package/dist/version.d.ts +10 -0
  581. package/dist/version.js +1 -0
  582. package/dist/withdraw/compound/index.d.ts +11 -8
  583. package/dist/withdraw/compound/index.js +1 -1
  584. package/dist/withdraw/dialog/index.d.ts +4 -1
  585. package/dist/withdraw/widgets/index.d.ts +7 -0
  586. package/dist/withdraw/widgets/index.js +1 -0
  587. package/package.json +31 -7
  588. package/dist/_internal/deposit/widgets/index.d.ts +0 -11
  589. package/dist/_internal/deposit/widgets/index.js +0 -1
  590. package/dist/_internal/withdraw/widgets/index.d.ts +0 -5
  591. package/dist/_internal/withdraw/widgets/index.js +0 -1
  592. package/dist/flows/withdraw/dialog/WithdrawDialogEventsContext.d.ts +0 -36
  593. package/dist/flows/withdraw/dialog/WithdrawDialogEventsContext.js +0 -1
  594. package/dist/shared/widgets/processing-state/compound/components/Actions.d.ts +0 -17
  595. package/dist/shared/widgets/processing-state/compound/components/Actions.js +0 -1
  596. package/dist/stridge/StridgeContext.d.ts +0 -29
  597. package/dist/stridge/StridgeContext.js +0 -1
@@ -0,0 +1,29 @@
1
+ import { ErrorInfo, ReactNode } from "react";
2
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
3
+
4
+ //#region src/flows/withdraw/widgets/withdraw/compound/components/Boundary.d.ts
5
+ interface Props {
6
+ children: ReactNode;
7
+ /**
8
+ * Replaces the kit's default crash fallback. Compose `GatewayKitErrorCard` parts to keep
9
+ * kit styling, or render your own JSX for a fully custom recovery surface.
10
+ */
11
+ fallback?: ReactNode;
12
+ /**
13
+ * Fires once per caught render error. Pipe to your analytics or error-reporting pipeline.
14
+ */
15
+ onError?: (error: Error, errorInfo: ErrorInfo) => void;
16
+ }
17
+ /**
18
+ * Error-boundary part for the withdraw flow. Wraps children with the kit's
19
+ * `GatewayKitBoundary` and pipes the recovery action through `useWithdraw().close()` so a
20
+ * crash returns the user to a clean state. `onError` is host-supplied; `onReset` is wired
21
+ * internally.
22
+ */
23
+ declare function WithdrawBoundary({
24
+ children,
25
+ fallback,
26
+ onError
27
+ }: Props): _$react_jsx_runtime0.JSX.Element;
28
+ //#endregion
29
+ export { Props, WithdrawBoundary };
@@ -0,0 +1 @@
1
+ "use client";import{useWithdrawActions as e}from"../../../../orchestrator/controller.js";import{GatewayKitBoundary as t}from"../../../../../../shared/error-handling/components/GatewayKitBoundary.js";import"../../../../../../shared/error-handling/index.js";import{jsx as n}from"react/jsx-runtime";function r({children:r,fallback:i,onError:a}){let{close:o}=e();return n(t,{...a?{onError:a}:{},...i===void 0?{}:{fallback:i},onReset:o,children:r})}export{r as WithdrawBoundary};
@@ -0,0 +1,25 @@
1
+ import { ReactNode } from "react";
2
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
3
+
4
+ //#region src/flows/withdraw/widgets/withdraw/compound/components/Guards.d.ts
5
+ interface Props {
6
+ children: ReactNode;
7
+ }
8
+ /**
9
+ * Bootstrap-loading guard for the withdraw flow. While the lazy `arm()` is in flight,
10
+ * `receiveOptions` is `idle` / `loading` — the form widget would render against an empty
11
+ * catalog, so we surface a centered spinner inside the same frame instead of empty form
12
+ * chrome. Cache hits never trip this branch because the entity stays `ready` for the rest
13
+ * of the provider lifetime once it transitions there.
14
+ *
15
+ * Only applies to the `form` / `submitting` step pair — terminal steps (`inProgress` /
16
+ * `success` / `error`) read from `settlement`, which populates independently of bootstrap.
17
+ * The withdraw flow does NOT have a wallet-required gate; the host always supplies a
18
+ * `flows.withdraw.owner` via `<StridgeProvider>` (the business broadcasts the source-chain
19
+ * tx, not the end-user).
20
+ */
21
+ declare function WithdrawGuards({
22
+ children
23
+ }: Props): _$react_jsx_runtime0.JSX.Element;
24
+ //#endregion
25
+ export { Props, WithdrawGuards };
@@ -0,0 +1 @@
1
+ "use client";import{useWithdrawSnapshot as e}from"../../../../driver/context.js";import{useWithdrawEffectiveState as t}from"../../../../orchestrator/controller.js";import"../../../../orchestrator/index.js";import{LoadingState as n}from"../../../../../../shared/dialog/LoadingState.js";import{Fragment as r,jsx as i}from"react/jsx-runtime";function a({children:a}){let o=t(),s=e();return(o.name===`form`||o.name===`submitting`)&&(s.receiveOptions.status===`loading`||s.receiveOptions.status===`idle`)?i(n,{slot:`withdraw`}):i(r,{children:a})}export{a as WithdrawGuards};
@@ -0,0 +1,27 @@
1
+ import { ReactNode } from "react";
2
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
3
+
4
+ //#region src/flows/withdraw/widgets/withdraw/compound/components/Steps.d.ts
5
+ interface WithdrawStepsProps {
6
+ /**
7
+ * When true, the matched step renders without the kit's animated `StepTransition` wrapper.
8
+ * Forwarded to the underlying `Steps` primitive.
9
+ */
10
+ plain?: boolean;
11
+ children: ReactNode;
12
+ }
13
+ /**
14
+ * Withdraw-bound slot-routing parent. Reads the withdraw FSM's *effective* state name and
15
+ * renders only the matching `<Withdraw.Step name="…" />` child.
16
+ *
17
+ * Collapses `submitting → form` so the form widget stays mounted (and its slide animation
18
+ * does not re-trigger) while the host's `onSubmit` is in flight. Hosts therefore declare a
19
+ * single `<Withdraw.Step name="form">` to cover both the idle form and the post-submit
20
+ * pending state — declaring `name="submitting"` separately never matches.
21
+ */
22
+ declare function WithdrawSteps({
23
+ plain,
24
+ children
25
+ }: WithdrawStepsProps): _$react_jsx_runtime0.JSX.Element;
26
+ //#endregion
27
+ export { WithdrawSteps, type WithdrawStepsProps };
@@ -0,0 +1 @@
1
+ "use client";import{useWithdrawEffectiveState as e}from"../../../../orchestrator/controller.js";import"../../../../orchestrator/index.js";import{Steps as t}from"../../../../../../shared/ui/Steps/Steps.js";import"../../../../../../shared/ui/Steps/index.js";import{jsx as n}from"react/jsx-runtime";function r({plain:r,children:i}){let a=e();return n(t,{activeStep:a.name===`submitting`?`form`:a.name,...r===void 0?{}:{plain:r},children:i})}export{r as WithdrawSteps};
@@ -0,0 +1,3 @@
1
+ import { WithdrawStepsProps } from "./components/Steps.js";
2
+ import { Withdraw } from "./Withdraw.js";
3
+ import { WITHDRAW_SLOTS, WithdrawSlot } from "./Withdraw.slots.js";
@@ -0,0 +1 @@
1
+ import"./Withdraw.js";import"./Withdraw.slots.js";
@@ -1,4 +1,12 @@
1
- import { ComponentProps } from "react";
1
+ import { ErrorStateBodyProps, ErrorStateRowProps } from "../../../../shared/widgets/error-state/compound/types.js";
2
+ import { ErrorStateActions } from "../../../../shared/widgets/error-state/compound/components/Actions.js";
3
+ import { ErrorStateDetails } from "../../../../shared/widgets/error-state/compound/components/Details.js";
4
+ import { ErrorStateHeader } from "../../../../shared/widgets/error-state/compound/components/Header.js";
5
+ import { ErrorStateHelpInfo } from "../../../../shared/widgets/error-state/compound/components/HelpInfo.js";
6
+ import { ErrorStateHero } from "../../../../shared/widgets/error-state/compound/components/Hero.js";
7
+ import { ErrorStateMoreDetails } from "../../../../shared/widgets/error-state/compound/components/MoreDetails.js";
8
+ import { ErrorStateDestinationRow, ErrorStateFailedAtRow, ErrorStateFillStatusRow, ErrorStateSourceRow, ErrorStateSubmittedAtRow, ErrorStateYouReceiveRow } from "../../../../shared/widgets/error-state/compound/components/Rows.js";
9
+ import { ComponentProps, ReactNode } from "react";
2
10
  import * as _$react_jsx_runtime0 from "react/jsx-runtime";
3
11
 
4
12
  //#region src/flows/withdraw/widgets/withdraw-error/WithdrawError.d.ts
@@ -17,6 +25,41 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
17
25
  *
18
26
  * The CTA wires to `actions.reset()` so clicking `Try again` returns the user to the empty form.
19
27
  */
20
- declare function WithdrawError(props: ComponentProps<"div">): _$react_jsx_runtime0.JSX.Element | null;
28
+ interface WithdrawErrorOwnProps {
29
+ /**
30
+ * Optional custom composition. Defaults vary by branch — settlement-derived failures render
31
+ * the receipt (`<Header />` + `<Body><Hero /><Details>…rows…</Details><HelpInfo /></Body>` +
32
+ * `<Actions />`); FSM-derived failures render the minimal headline-only shape. Pass children
33
+ * once and they apply to whichever branch renders.
34
+ */
35
+ children?: ReactNode;
36
+ }
37
+ declare function WithdrawError({
38
+ children,
39
+ ...props
40
+ }: ComponentProps<"div"> & WithdrawErrorOwnProps): _$react_jsx_runtime0.JSX.Element | null;
41
+ /**
42
+ * Withdraw-tuned default for the source-tx row label. Without this wrapper, hosts composing
43
+ * `<WithdrawError.DepositTxRow />` would inherit the deposit-flow's "Deposit tx" default —
44
+ * the wrong copy for a withdrawal. Host-supplied `label` overrides.
45
+ */
46
+ declare function WithdrawErrorDepositTxRow(props?: ErrorStateRowProps): _$react_jsx_runtime0.JSX.Element;
47
+ declare namespace WithdrawError {
48
+ type Props = ComponentProps<"div"> & WithdrawErrorOwnProps;
49
+ const Header: typeof ErrorStateHeader;
50
+ const Body: (props: ErrorStateBodyProps) => _$react_jsx_runtime0.JSX.Element;
51
+ const Hero: typeof ErrorStateHero;
52
+ const Details: typeof ErrorStateDetails;
53
+ const FillStatusRow: typeof ErrorStateFillStatusRow;
54
+ const SourceRow: typeof ErrorStateSourceRow;
55
+ const DestinationRow: typeof ErrorStateDestinationRow;
56
+ const YouReceiveRow: typeof ErrorStateYouReceiveRow;
57
+ const MoreDetails: typeof ErrorStateMoreDetails;
58
+ const DepositTxRow: typeof WithdrawErrorDepositTxRow;
59
+ const SubmittedAtRow: typeof ErrorStateSubmittedAtRow;
60
+ const FailedAtRow: typeof ErrorStateFailedAtRow;
61
+ const HelpInfo: typeof ErrorStateHelpInfo;
62
+ const Actions: typeof ErrorStateActions;
63
+ }
21
64
  //#endregion
22
65
  export { WithdrawError };
@@ -1 +1 @@
1
- "use client";import{useLingui as e}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useFailureReasonForKind as t}from"../../../../shared/orchestrator/failureReason.js";import"../../../../shared/orchestrator/index.js";import{useWithdrawSnapshot as n}from"../../driver/context.js";import{useWithdrawActions as r,useWithdrawEffectiveState as i}from"../../orchestrator/controller.js";import{ErrorState as a}from"../../../../shared/widgets/error-state/compound/ErrorState.js";import"../../../../shared/widgets/error-state/compound/index.js";import{toAssetDescriptor as o}from"../../../../shared/widgets/asset-descriptor.js";import{jsx as s,jsxs as c}from"react/jsx-runtime";function l(l){let u=n(),d=i(),{reset:f}=r(),{_:p}=e(),m=t();if(d.name!==`error`)return null;let h=u.settlement,g=h.status===`ready`&&h.payload.kind===`failed`?h.payload:void 0,_=d.ctx.failure,v=p({id:`KTNWsg`,message:`Withdrawal failed`}),y=g?m(g.failureKind):_?.reason;if(!g)return c(a,{...l,headerTitle:v,headline:v,reason:y,onTryAgain:f,children:[s(a.Header,{}),s(a.Body,{children:s(a.Hero,{})}),s(a.Actions,{})]});let b=g,x={address:b.recipient.formatted},S=o(b.receiveAsset)??{symbol:b.receiveAsset.symbol},C=b.txHash?{hash:b.txHash.formatted,explorerUrl:b.txExplorerUrl}:void 0;return c(a,{...l,headerTitle:v,headline:v,reason:y,destination:x,receiveAmount:b.receiveAmount.formatted,receiveAsset:S,depositTx:C,submittedAt:b.submittedAt.formatted,failedAt:b.failedAt.formatted,onTryAgain:f,children:[s(a.Header,{}),c(a.Body,{children:[s(a.Hero,{}),c(a.Details,{children:[s(a.FillStatusRow,{}),s(a.DestinationRow,{}),s(a.YouReceiveRow,{}),c(a.MoreDetails,{children:[C?s(a.DepositTxRow,{label:p({id:`60ahSE`,message:`Withdrawal tx`})}):null,s(a.SubmittedAtRow,{}),s(a.FailedAtRow,{})]})]}),s(a.HelpInfo,{})]}),s(a.Actions,{})]})}export{l as WithdrawError};
1
+ "use client";import{useLingui as e}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useFailureReasonForKind as t}from"../../../../shared/orchestrator/failureReason.js";import"../../../../shared/orchestrator/index.js";import{useWithdrawSnapshot as n}from"../../driver/context.js";import{useWithdrawActions as r,useWithdrawEffectiveState as i}from"../../orchestrator/controller.js";import{ErrorState as a}from"../../../../shared/widgets/error-state/compound/ErrorState.js";import"../../../../shared/widgets/error-state/compound/index.js";import{toAssetDescriptor as o}from"../../../../shared/widgets/asset-descriptor.js";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";function u({children:u,...d}){let f=n(),p=i(),{reset:m}=r(),{_:h}=e(),g=t();if(p.name!==`error`)return null;let _=f.settlement,v=_.status===`ready`&&_.payload.kind===`failed`?_.payload:void 0,y=p.ctx.failure,b=h({id:`KTNWsg`,message:`Withdrawal failed`}),x=v?g(v.failureKind):y?.reason;if(!v)return c(a,{...d,headerTitle:b,headline:b,reason:x,onTryAgain:m,children:u??l(s,{children:[c(a.Header,{}),c(a.Body,{children:c(a.Hero,{})}),c(a.Actions,{})]})});let S=v,C={address:S.recipient.formatted},w=o(S.receiveAsset)??{symbol:S.receiveAsset.symbol},T=S.txHash?{hash:S.txHash.formatted,explorerUrl:S.txExplorerUrl}:void 0;return c(a,{...d,headerTitle:b,headline:b,reason:x,destination:C,receiveAmount:S.receiveAmount.formatted,receiveAsset:w,depositTx:T,submittedAt:S.submittedAt.formatted,failedAt:S.failedAt.formatted,onTryAgain:m,children:u??l(s,{children:[c(a.Header,{}),l(a.Body,{children:[c(a.Hero,{}),l(a.Details,{children:[c(a.FillStatusRow,{}),c(a.DestinationRow,{}),c(a.YouReceiveRow,{}),l(a.MoreDetails,{children:[T?c(a.DepositTxRow,{label:h({id:`60ahSE`,message:`Withdrawal tx`})}):null,c(a.SubmittedAtRow,{}),c(a.FailedAtRow,{})]})]}),c(a.HelpInfo,{})]}),c(a.Actions,{})]})})}function d(t={}){let{_:n}=e();return c(a.DepositTxRow,{...t,label:t.label??n({id:`60ahSE`,message:`Withdrawal tx`})})}(function(e){e.Header=a.Header,e.Body=a.Body,e.Hero=a.Hero,e.Details=a.Details,e.FillStatusRow=a.FillStatusRow,e.SourceRow=a.SourceRow,e.DestinationRow=a.DestinationRow,e.YouReceiveRow=a.YouReceiveRow,e.MoreDetails=a.MoreDetails,e.DepositTxRow=d,e.SubmittedAtRow=a.SubmittedAtRow,e.FailedAtRow=a.FailedAtRow,e.HelpInfo=a.HelpInfo,e.Actions=a.Actions})(u||={});export{u as WithdrawError};
@@ -1,16 +1,14 @@
1
- import { WithdrawFormEventCallbacks } from "../../dialog/WithdrawDialogEventsContext.js";
2
- import { ComponentProps } from "react";
1
+ import { WithdrawFormAmountField } from "./compound/components/AmountField.js";
2
+ import { WithdrawFormBody } from "./compound/components/Body.js";
3
+ import { WithdrawFormBreakdownCard } from "./compound/components/BreakdownCard.js";
4
+ import { WithdrawFormFooter } from "./compound/components/Footer.js";
5
+ import { WithdrawFormHeader } from "./compound/components/Header.js";
6
+ import { WithdrawFormReceiveSelectors } from "./compound/components/ReceiveSelectors.js";
7
+ import { WithdrawFormRecipientField } from "./compound/components/RecipientField.js";
8
+ import { ReactNode } from "react";
3
9
  import * as _$react_jsx_runtime0 from "react/jsx-runtime";
4
10
 
5
11
  //#region src/flows/withdraw/widgets/withdraw-form/WithdrawForm.d.ts
6
- type OrchestratedProps = ComponentProps<"div"> & {
7
- /**
8
- * Form-level event callbacks. Optional — when omitted, the form falls back to whatever the
9
- * enclosing `<WithdrawDialog>` provides via context. Hosts using `<WithdrawForm>` directly
10
- * (custom UI without the dialog) can pass callbacks here.
11
- */
12
- events?: WithdrawFormEventCallbacks;
13
- };
14
12
  /**
15
13
  * Orchestrated `WithdrawForm` widget. Reads source-side balances, the receive-options catalog,
16
14
  * and the active quote payload from the driver, drives the FSM via `useWithdrawActions().submit`,
@@ -21,9 +19,31 @@ type OrchestratedProps = ComponentProps<"div"> & {
21
19
  * Quote lifecycle: the form fires `driver.requestQuote(...)` (debounced ~400ms) whenever both
22
20
  * `recipientAddress` and `amount > 0` are populated and re-fires on receive-side changes. Stale
23
21
  * entity transitions keep showing the last-known payload until the user changes a field.
22
+ *
23
+ * Interaction events (`withdraw.recipient.changed`, `withdraw.amount.changed`, `withdraw.amount.maxed`,
24
+ * `withdraw.receive.token.changed`, `withdraw.receive.chain.changed`, `withdraw.submit.clicked`)
25
+ * flow through the unified event bus — the form takes no callback props.
24
26
  */
27
+ interface WithdrawFormOwnProps {
28
+ /**
29
+ * Optional custom composition. Defaults to `<Header />` + `<Body><RecipientField />
30
+ * <AmountField /><ReceiveSelectors /><BreakdownCard /></Body>` + `<Footer />`. Pass children
31
+ * to interleave your own elements between compound parts.
32
+ */
33
+ children?: ReactNode;
34
+ }
25
35
  declare function WithdrawForm({
26
- events: localEvents
27
- }: OrchestratedProps): _$react_jsx_runtime0.JSX.Element | null;
36
+ children
37
+ }?: WithdrawFormOwnProps): _$react_jsx_runtime0.JSX.Element | null;
38
+ declare namespace WithdrawForm {
39
+ type Props = WithdrawFormOwnProps;
40
+ const Header: typeof WithdrawFormHeader;
41
+ const Body: typeof WithdrawFormBody;
42
+ const RecipientField: typeof WithdrawFormRecipientField;
43
+ const AmountField: typeof WithdrawFormAmountField;
44
+ const ReceiveSelectors: typeof WithdrawFormReceiveSelectors;
45
+ const BreakdownCard: typeof WithdrawFormBreakdownCard;
46
+ const Footer: typeof WithdrawFormFooter;
47
+ }
28
48
  //#endregion
29
49
  export { WithdrawForm };
@@ -1 +1 @@
1
- "use client";import{useKitI18n as e}from"../../../../shared/i18n/useKitI18n.js";import{useLingui as t}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useWithdrawDriverInstance as n,useWithdrawSnapshot as r}from"../../driver/context.js";import{useWithdrawActions as i,useWithdrawEffectiveState as ee}from"../../orchestrator/controller.js";import{parseAmountInputValue as a}from"../../../../shared/ui/AmountInput/utils.js";import"../../../../shared/ui/AmountInput/index.js";import{toAssetDescriptor as o}from"../../../../shared/widgets/asset-descriptor.js";import{useQuoteCountdown as te}from"../../../../shared/quote/useQuoteCountdown.js";import"../../../../shared/quote/index.js";import{WithdrawForm as s}from"./compound/WithdrawForm.js";import"./compound/index.js";import{useWithdrawDialogEvents as ne}from"../../dialog/WithdrawDialogEventsContext.js";import{isValidEvmAddress as re,resolveSubmitLabel as ie}from"./validation.js";import{useCallback as c,useEffect as l,useMemo as u,useRef as d,useState as f}from"react";import{jsx as p,jsxs as ae}from"react/jsx-runtime";import{useAccount as oe}from"wagmi";function m({events:m}){let h=r(),g=n(),_=ee(),v=i(),{_:y}=t(),b=ne(),se=u(()=>({...b,...m??{}}),[b,m]),x=d(se);x.current=se;let{address:ce}=oe(),le=ce??``,[S,ue]=f(``),[de,fe]=f(``),C=_.name===`submitting`,w=_.name===`form`?_.ctx?.notice:void 0,T=d(w);T.current=w;let E=h.withdrawableBalances.status===`ready`||h.withdrawableBalances.status===`stale`?h.withdrawableBalances.payload[0]:void 0,D=u(()=>o(E)??{symbol:`USDC`},[E]),pe=u(()=>o(E?{symbol:E.networkName,eip155Id:E.eip155Id,isNative:!0,logoUrl:E.chainLogoUrl}:void 0)??{symbol:`BSC`},[E]),me=E?{amount:E.amount.formatted,symbol:E.symbol}:void 0,O=h.receiveOptions.status===`ready`||h.receiveOptions.status===`stale`?h.receiveOptions.payload:[],k=E?.eip155Id?Number(E.eip155Id):void 0,A=E?.symbol??D.symbol,j=u(()=>{let e=new Map;for(let t of O)for(let n of t.tokens){let r=n.symbol.toUpperCase(),i=e.get(r);i?i.push({chain:t,token:n}):e.set(r,[{chain:t,token:n}])}return e},[O]),M=u(()=>{if(j.size===0)return;let e=A.toUpperCase();return j.has(e)?e:j.keys().next().value},[j,A]),N=c(e=>{let t=j.get(e);if(!(!t||t.length===0))return(k===void 0?void 0:t.find(e=>e.chain.eip155Id===k))??t[0]},[j,k]),[P,F]=f(void 0),[I,L]=f(void 0);l(()=>{if(I||!M)return;let e=N(M);e&&(F(e.chain),L(e.token))},[M,N,I]);let R=c(()=>{T.current&&v.clearNotice()},[v]),he=c(e=>{R(),ue(e),x.current.onRecipientChanged?.(e)},[R]),z=e().locale,B=c(e=>{R(),fe(e);let t=a(e,z);x.current.onAmountChanged?.({raw:e,numeric:t})},[R,z]),V=c(e=>{R();let t=e.symbol.toUpperCase(),n=j.get(t)?.find(e=>e.chain.eip155Id===P?.eip155Id)??N(t);n&&(F(n.chain),L(n.token),x.current.onReceiveTokenChanged?.(n.token),n.chain.eip155Id!==P?.eip155Id&&x.current.onReceiveChainChanged?.(n.chain))},[R,j,N,P?.eip155Id]),ge=c(e=>{R(),F(e);let t=I?.symbol.toUpperCase(),n=(t?e.tokens.find(e=>e.symbol.toUpperCase()===t):void 0)??e.tokens[0];n&&L(n),x.current.onReceiveChainChanged?.(e),n&&n.symbol!==I?.symbol&&x.current.onReceiveTokenChanged?.(n)},[R,I?.symbol]),H=a(de,z),U=H!==null&&H>0,_e=S.trim(),ve=_e.length>0,W=re(_e),G=P!==void 0&&I!==void 0,K=U&&E!==void 0&&H>E.amount.value,[q,ye]=f(null),J=(h.quote.status===`ready`||h.quote.status===`stale`)&&ve&&U&&G&&q!==null&&q.recipient===S&&q.amount===H&&q.receiveChainId===P.eip155Id&&q.receiveSymbol===I.symbol?h.quote.payload:void 0,be=u(()=>j.size===0?[D]:[...j.values()].map(e=>{let t=e[0];return o({symbol:t.token.symbol,eip155Id:t.chain.eip155Id,address:t.token.address,isNative:t.token.isNative,logoUrl:t.token.assetLogoUrl})??{symbol:t.token.symbol}}),[j,D]),xe=u(()=>{let e=I?.symbol.toUpperCase(),t=e?j.get(e):void 0;return(t?t.map(e=>e.chain):O).map(e=>o({symbol:e.networkName,eip155Id:e.eip155Id,isNative:!0,logoUrl:e.chainLogoUrl})??{symbol:e.networkName})},[I?.symbol,j,O]),Se=I?o({symbol:I.symbol,eip155Id:P?.eip155Id,address:I.address,isNative:I.isNative,logoUrl:I.assetLogoUrl}):D,Ce=P?o({symbol:P.networkName,eip155Id:P.eip155Id,isNative:!0,logoUrl:P.chainLogoUrl}):pe,we=u(()=>{if(J?.breakdown)return{route:J.breakdown.selectedRoute?.label,networkCost:J.breakdown.networkCost?.formatted,priceImpact:J.breakdown.priceImpact?.formatted}},[J]),Te=u(()=>{if(U)return J?.receiveAmountUsd?J.receiveAmountUsd.formatted:`$${H.toFixed(2)}`},[H,U,J]),Ee=J&&U?J.receiveAmount.formatted:void 0,De=J?.receiveAmountUsd?.formatted,Y=W&&U&&!K&&G&&J===void 0&&h.quote.status!==`error`,X=W&&U&&!K&&G&&J!==void 0,Oe=te({expiresAt:J?.expiresAt,enabled:X}),ke=X&&J?J.quoteTotalSeconds:void 0,[Z,Q]=f(!1);l(()=>{Q(!1)},[S,H,P?.eip155Id,I?.symbol,_.name]),l(()=>{if(!X||!J||_.name!==`form`||Z)return;let e=Math.max(0,J.expiresAt-Date.now()),t=setTimeout(()=>{Q(!0)},e);return()=>clearTimeout(t)},[X,J,_.name,Z]),l(()=>{if(!Z||_.name!==`form`||k===void 0||!P||!I||!W||!U||K)return;let e=new AbortController,t={recipient:S,amount:H??0,receiveChainId:P.eip155Id,receiveSymbol:I.symbol},n={sourceAssetSymbol:A,sourceChainId:k,amount:H??0,receiveTokenSymbol:I.symbol,receiveChainId:P.eip155Id,recipientAddress:S};return x.current.onQuoteRequested?.(n),g.requestQuote(n,e.signal).then(()=>{e.signal.aborted||ye(t)}).catch(()=>{}).finally(()=>{e.signal.aborted||Q(!1)}),()=>e.abort()},[Z,g,S,H,W,U,K,k,A,P,I,_.name]);let $=!W||!U||K||!G||Y||Z,Ae=ie({enterRecipientAddress:y({id:`nr03QI`,message:`Enter Recipient Address`}),enterValidRecipientAddress:y({id:`GZPxmc`,message:`Enter Valid Recipient Address`}),enterAmount:y({id:`yH9V_J`,message:`Enter Amount`}),insufficientBalance:y({id:`N2DUxS`,message:`Insufficient Balance`}),regeneratingQuote:y({id:`Ly6geA`,message:`Regenerating quote…`}),estimatingQuote:y({id:`Uevt3L`,message:`Estimating quote`})},{isRecipientFilled:ve,isRecipientValid:W,isAmountValid:U,exceedsBalance:K,quoteEstimating:Y,quoteRegenerating:Z}),je=d(null);l(()=>{if(je.current?.abort(),!W||!U||K||!G||_.name!==`form`||k===void 0)return;let e=new AbortController;je.current=e;let t={recipient:S,amount:H,receiveChainId:P.eip155Id,receiveSymbol:I.symbol},n=setTimeout(()=>{let n={sourceAssetSymbol:A,sourceChainId:k,amount:H,receiveTokenSymbol:I.symbol,receiveChainId:P.eip155Id,recipientAddress:S};x.current.onQuoteRequested?.(n),g.requestQuote(n,e.signal).then(()=>{e.signal.aborted||ye(t)}).catch(()=>{})},400);return()=>{clearTimeout(n),e.abort()}},[g,S,H,W,U,K,G,k,A,P?.eip155Id,I?.symbol,_.name]);let Me=c(()=>{E&&B(E.amount.formatted)},[E,B]),Ne=c(()=>{C||$||k===void 0||!P||!I||v.submit({sourceAssetSymbol:A,sourceChainId:k,amount:H??0,recipientAddress:S,receiveTokenSymbol:I.symbol,receiveChainId:P.eip155Id})},[v,H,k,A,P,I,S,$,C]),Pe=c(e=>{let t=O.find(t=>String(t.eip155Id)===String(e.chainId));t&&ge(t)},[ge,O]),Fe=c(e=>{let t=e.symbol.toUpperCase(),n=j.get(t);!n||n.length===0||V((n.find(e=>e.chain.eip155Id===P?.eip155Id)??n[0]).token)},[V,j,P?.eip155Id]);return _.name!==`form`&&_.name!==`submitting`?null:ae(s,{recipientAddress:S,onRecipientChange:he,connectedAddress:le,amount:de,onAmountChange:B,onAmountMax:Me,sourceAsset:D,sourceChain:pe,receiveAsset:Se,receiveChain:Ce,receiveAssetOptions:be,onReceiveAssetChange:Fe,receiveChainOptions:xe,onReceiveChainChange:Pe,balance:me,amountUsd:Te,receiveAmount:Ee,receiveAmountUsd:De,breakdown:we,quoteEstimating:Y,quoteRegenerating:Z,...Oe===void 0?{}:{quoteSeconds:Oe},...ke===void 0?{}:{quoteTotalSeconds:ke},submitting:C,submitDisabled:$,submitLabel:Ae,...w?{notice:w}:{},onSubmit:Ne,children:[p(s.Header,{}),ae(s.Body,{children:[p(s.RecipientField,{}),p(s.AmountField,{}),p(s.ReceiveSelectors,{}),p(s.BreakdownCard,{})]}),p(s.Footer,{})]})}export{m as WithdrawForm};
1
+ "use client";import{isValidAddressForChainType as e}from"../../../../shared/chains/index.js";import{useKitI18n as t}from"../../../../shared/i18n/useKitI18n.js";import{useLingui as n}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useWithdrawBindingsValue as ee}from"../../bindings/WithdrawBindings.js";import"../../bindings/index.js";import{useWithdrawDriverInstance as r,useWithdrawSnapshot as te}from"../../driver/context.js";import{useWithdrawActions as ne,useWithdrawEffectiveState as re}from"../../orchestrator/controller.js";import{formatTokenAmount as ie}from"../../../../shared/format/formatTokenAmount.js";import{useKitEmitter as ae}from"../../../../events/emit/useKitEmitter.js";import"../../../../events/emit/index.js";import{parseAmountInputValue as oe}from"../../../../shared/ui/AmountInput/utils.js";import"../../../../shared/ui/AmountInput/index.js";import{toAssetDescriptor as i}from"../../../../shared/widgets/asset-descriptor.js";import{useQuoteCountdown as se}from"../../../../shared/quote/useQuoteCountdown.js";import"../../../../shared/quote/index.js";import{WithdrawForm as a}from"./compound/WithdrawForm.js";import"./compound/index.js";import{resolveSubmitLabel as ce}from"./validation.js";import{useCallback as o,useEffect as s,useMemo as c,useRef as le,useState as l}from"react";import{Fragment as ue,jsx as u,jsxs as de}from"react/jsx-runtime";function fe({children:fe}={}){let d=te(),f=r(),p=re(),m=ne(),{i18n:pe,_:h}=n(),g=ae(),{balance:_,suggestedRecipient:me}=ee(),[v,he]=l(``),[ge,_e]=l(``),y=p.name===`submitting`,b=p.name===`form`?p.ctx?.notice:void 0,ve=le(b);ve.current=b;let x=d.withdrawableBalances.status===`ready`||d.withdrawableBalances.status===`stale`?d.withdrawableBalances.payload[0]:void 0,S=c(()=>i(x)??{symbol:`USDC`},[x]),ye=c(()=>i(x?{symbol:x.networkName,eip155Id:x.eip155Id,isNative:!0,logoUrl:x.chainLogoUrl}:void 0)??{symbol:`BSC`},[x]),C=typeof _==`number`?_:typeof _==`object`?_.amount:void 0,be=x?.symbol??S.symbol,w=C??x?.amount.value,xe=C===void 0?x?.symbol:be,T=w!==void 0&&xe!==void 0?{amount:C===void 0?x?.amount.formatted??ie(w,pe):ie(C,pe),symbol:xe}:void 0,E=d.receiveOptions.status===`ready`||d.receiveOptions.status===`stale`?d.receiveOptions.payload:[],D=x?.eip155Id?Number(x.eip155Id):void 0,O=x?.symbol??S.symbol,k=c(()=>{let e=new Map;for(let t of E)for(let n of t.tokens){let ee=n.symbol.toUpperCase(),r=e.get(ee);r?r.push({chain:t,token:n}):e.set(ee,[{chain:t,token:n}])}return e},[E]),A=c(()=>{if(k.size===0)return;let e=O.toUpperCase();return k.has(e)?e:k.keys().next().value},[k,O]),j=o(e=>{let t=k.get(e);if(!(!t||t.length===0))return(D===void 0?void 0:t.find(e=>e.chain.eip155Id===D))??t[0]},[k,D]),[M,N]=l(void 0),[P,F]=l(void 0);s(()=>{if(P||!A)return;let e=j(A);e&&(N(e.chain),F(e.token))},[A,j,P]);let I=o(()=>{ve.current&&m.clearNotice()},[m]),Se=o(e=>{I(),he(e),g({type:`withdraw.recipient.changed`,flow:`withdraw`,tier:`ui`,payload:{value:e}})},[I,g]),L=t().locale,R=o(e=>{I(),_e(e),g({type:`withdraw.amount.changed`,flow:`withdraw`,tier:`ui`,payload:{raw:e,numeric:oe(e,L)}})},[I,g,L]),Ce=o(e=>{I();let t=e.symbol.toUpperCase(),n=k.get(t)?.find(e=>e.chain.eip155Id===M?.eip155Id)??j(t);n&&(N(n.chain),F(n.token),g({type:`withdraw.receive.token.changed`,flow:`withdraw`,tier:`ui`,payload:{token:n.token}}),n.chain.eip155Id!==M?.eip155Id&&g({type:`withdraw.receive.chain.changed`,flow:`withdraw`,tier:`ui`,payload:{chain:n.chain}}))},[I,g,k,j,M?.eip155Id]),we=o(e=>{I(),N(e);let t=P?.symbol.toUpperCase(),n=(t?e.tokens.find(e=>e.symbol.toUpperCase()===t):void 0)??e.tokens[0];n&&F(n),g({type:`withdraw.receive.chain.changed`,flow:`withdraw`,tier:`ui`,payload:{chain:e}}),n!==void 0&&(P===void 0||n.address!==P.address)&&g({type:`withdraw.receive.token.changed`,flow:`withdraw`,tier:`ui`,payload:{token:n}})},[I,g,P]),z=oe(ge,L),B=z!==null&&z>0,Te=v.trim(),Ee=Te.length>0,De=M?.chainType??`unknown`,V=e(Te,De),H=M!==void 0&&P!==void 0,U=B&&w!==void 0&&z>w,W=d.minAmountUsd,G=d.maxAmountUsd,Oe=x?.amountUsd&&x.amount.value>0?x.amountUsd.value/x.amount.value:void 0,K=Oe!==void 0&&z!==null?z*Oe:void 0,q=B&&K!==void 0&&W!==void 0&&W.value>0&&K<W.value,J=B&&K!==void 0&&G!==void 0&&G.value>0&&K>G.value,[Y,ke]=l(null),X=(d.quote.status===`ready`||d.quote.status===`stale`)&&Ee&&B&&H&&Y!==null&&Y.recipient===v&&Y.amount===z&&Y.receiveChainId===M.eip155Id&&Y.receiveSymbol===P.symbol?d.quote.payload:void 0,Ae=c(()=>k.size===0?[S]:[...k.values()].map(e=>{let t=e[0];return i({symbol:t.token.symbol,eip155Id:t.chain.eip155Id,address:t.token.address,isNative:t.token.isNative,logoUrl:t.token.assetLogoUrl})??{symbol:t.token.symbol}}),[k,S]),je=c(()=>{let e=P?.symbol.toUpperCase(),t=e?k.get(e):void 0;return(t?t.map(e=>e.chain):E).map(e=>i({symbol:e.networkName,eip155Id:e.eip155Id,isNative:!0,logoUrl:e.chainLogoUrl})??{symbol:e.networkName})},[P?.symbol,k,E]),Me=P?i({symbol:P.symbol,eip155Id:M?.eip155Id,address:P.address,isNative:P.isNative,logoUrl:P.assetLogoUrl}):S,Ne=M?i({symbol:M.networkName,eip155Id:M.eip155Id,isNative:!0,logoUrl:M.chainLogoUrl}):ye,Pe=c(()=>{if(X?.breakdown)return{route:X.breakdown.selectedRoute?.label,networkCost:X.breakdown.networkCost?.formatted,priceImpact:X.breakdown.priceImpact?.formatted}},[X]),Z=c(()=>{if(B)return X?.receiveAmountUsd?X.receiveAmountUsd.formatted:`$${z.toFixed(2)}`},[z,B,X]),Fe=X&&B?X.receiveAmount.formatted:void 0,Ie=X?.receiveAmountUsd?.formatted,Le=V&&B&&!U&&!q&&!J&&H&&X===void 0&&d.quote.status!==`error`,Q=V&&B&&!U&&!q&&!J&&H&&X!==void 0,Re=se({expiresAt:X?.expiresAt,enabled:Q}),ze=Q&&X?X.quoteTotalSeconds:void 0,[$,Be]=l(!1);s(()=>{Be(!1)},[v,z,M?.eip155Id,P?.symbol,p.name]),s(()=>{if(!Q||!X||p.name!==`form`||$)return;let e=Math.max(0,X.expiresAt-Date.now()),t=setTimeout(()=>{Be(!0),g({type:`withdraw.quote.expired`,flow:`withdraw`,tier:`flow`,payload:{}})},e);return()=>clearTimeout(t)},[g,Q,X,p.name,$]),s(()=>{if(!$||p.name!==`form`||D===void 0||!M||!P||!V||!B||U||q||J)return;let e=new AbortController,t={recipient:v,amount:z??0,receiveChainId:M.eip155Id,receiveSymbol:P.symbol},n={sourceAssetSymbol:O,sourceChainId:D,amount:z??0,receiveTokenSymbol:P.symbol,receiveChainId:M.eip155Id,recipientAddress:v};return g({type:`withdraw.quote.requested`,flow:`withdraw`,tier:`flow`,payload:{input:n}}),f.requestQuote(n,e.signal).then(()=>{e.signal.aborted||ke(t)}).catch(()=>{}).finally(()=>{e.signal.aborted||Be(!1)}),()=>e.abort()},[g,$,f,v,z,V,B,U,q,J,D,O,M,P,p.name]);let Ve=!V||!B||U||q||J||!H||Le||$,He=ce({enterRecipientAddress:h({id:`nr03QI`,message:`Enter Recipient Address`}),enterValidRecipientAddress:h({id:`GZPxmc`,message:`Enter Valid Recipient Address`}),enterAmount:h({id:`yH9V_J`,message:`Enter Amount`}),insufficientBalance:h({id:`N2DUxS`,message:`Insufficient Balance`}),...W?{belowMinimumAmount:h({id:`WkRH60`,message:`Min {0}`,values:{0:W.formatted}})}:{},...G?{aboveCapAmount:h({id:`AHyker`,message:`Max {0}`,values:{0:G.formatted}})}:{},regeneratingQuote:h({id:`Ly6geA`,message:`Regenerating quote…`}),estimatingQuote:h({id:`Uevt3L`,message:`Estimating quote`})},{isRecipientFilled:Ee,isRecipientValid:V,isAmountValid:B,exceedsBalance:U,belowMinimum:q,aboveCap:J,quoteEstimating:Le,quoteRegenerating:$}),Ue=le(null);s(()=>{if(Ue.current?.abort(),!V||!B||U||q||J||!H||p.name!==`form`||D===void 0)return;let e=new AbortController;Ue.current=e;let t={recipient:v,amount:z,receiveChainId:M.eip155Id,receiveSymbol:P.symbol},n=setTimeout(()=>{let n={sourceAssetSymbol:O,sourceChainId:D,amount:z,receiveTokenSymbol:P.symbol,receiveChainId:M.eip155Id,recipientAddress:v};g({type:`withdraw.quote.requested`,flow:`withdraw`,tier:`flow`,payload:{input:n}}),f.requestQuote(n,e.signal).then(()=>{e.signal.aborted||ke(t)}).catch(()=>{})},400);return()=>{clearTimeout(n),e.abort()}},[g,f,v,z,V,B,U,q,J,H,D,O,M?.eip155Id,P?.symbol,p.name]);let We=o(()=>{T&&(R(T.amount),g({type:`withdraw.max.clicked`,flow:`withdraw`,tier:`ui`,payload:{}}))},[T,g,R]),Ge=o(()=>{g({type:`withdraw.submit.clicked`,flow:`withdraw`,tier:`ui`,payload:{}}),!(y||Ve)&&(D===void 0||!M||!P||m.submit({sourceAssetSymbol:O,sourceChainId:D,amount:z??0,recipientAddress:v,receiveTokenSymbol:P.symbol,receiveChainId:M.eip155Id,...Z?{amountUsd:Z}:{}}))},[m,z,Z,g,D,O,M,P,v,Ve,y]),Ke=o(e=>{let t=E.find(t=>String(t.eip155Id)===String(e.chainId));t&&we(t)},[we,E]),qe=o(e=>{let t=e.symbol.toUpperCase(),n=k.get(t);!n||n.length===0||Ce((n.find(e=>e.chain.eip155Id===M?.eip155Id)??n[0]).token)},[Ce,k,M?.eip155Id]);return p.name!==`form`&&p.name!==`submitting`?null:u(a,{recipientAddress:v,onRecipientChange:Se,recipientChainType:De,...me?{suggestedRecipient:me}:{},amount:ge,onAmountChange:R,onAmountMax:We,sourceAsset:S,sourceChain:ye,receiveAsset:Me,receiveChain:Ne,receiveAssetOptions:Ae,onReceiveAssetChange:qe,receiveChainOptions:je,onReceiveChainChange:Ke,balance:T,amountUsd:Z,receiveAmount:Fe,receiveAmountUsd:Ie,breakdown:Pe,quoteEstimating:Le,quoteRegenerating:$,...Re===void 0?{}:{quoteSeconds:Re},...ze===void 0?{}:{quoteTotalSeconds:ze},submitting:y,submitDisabled:Ve,submitLabel:He,...b?{notice:b}:{},onSubmit:Ge,onBreakdownOpenChange:e=>g({type:`withdraw.breakdown.clicked`,flow:`withdraw`,tier:`ui`,payload:{open:e}}),children:fe??de(ue,{children:[u(a.Header,{}),de(a.Body,{children:[u(a.RecipientField,{}),u(a.AmountField,{}),u(a.ReceiveSelectors,{}),u(a.BreakdownCard,{})]}),u(a.Footer,{})]})})}(function(e){e.Header=a.Header,e.Body=a.Body,e.RecipientField=a.RecipientField,e.AmountField=a.AmountField,e.ReceiveSelectors=a.ReceiveSelectors,e.BreakdownCard=a.BreakdownCard,e.Footer=a.Footer})(fe||={});export{fe as WithdrawForm};
@@ -1 +1 @@
1
- "use client";import{DialogShell as e}from"../../../../../shared/dialog/DialogShell.js";import{Tooltip as t}from"../../../../../shared/ui/Tooltip/Tooltip.js";import"../../../../../shared/ui/Tooltip/index.js";import{Frame as n}from"../../../../../shared/dialog/Frame.js";import{WithdrawFormContext as r}from"./context.js";import{WITHDRAW_FORM_SLOTS as i}from"./WithdrawForm.slots.js";import{styles as a}from"./WithdrawForm.styles.js";import{WithdrawFormAmountField as o}from"./components/AmountField.js";import{WithdrawFormBody as s}from"./components/Body.js";import{WithdrawFormBreakdownCard as c}from"./components/BreakdownCard.js";import{WithdrawFormFooter as l}from"./components/Footer.js";import{WithdrawFormHeader as u}from"./components/Header.js";import{WithdrawFormReceiveSelectors as d}from"./components/ReceiveSelectors.js";import{WithdrawFormRecipientField as f}from"./components/RecipientField.js";import{useCallback as p,useMemo as m,useState as h}from"react";import{jsx as g}from"react/jsx-runtime";import*as _ from"@stylexjs/stylex";const v=()=>void 0;function y(e){let{recipientAddress:o=``,onRecipientChange:s,connectedAddress:c,amount:l=``,onAmountChange:u,onAmountMax:d,sourceAsset:f,sourceChain:y,receiveAsset:b,receiveChain:x,receiveAssetOptions:S,onReceiveAssetChange:C,receiveChainOptions:w,onReceiveChainChange:T,balance:E,amountUsd:D,receiveAmount:O,receiveAmountUsd:k,breakdown:A,quoteEstimating:j=!1,quoteRegenerating:M=!1,quoteSeconds:N,quoteTotalSeconds:P,submitting:F=!1,submitDisabled:I=!1,submitLabel:L,notice:R,onSubmit:z,defaultBreakdownOpen:B=!1,breakdownOpen:V,onBreakdownOpenChange:H,children:U}=e,[W,G]=h(B),K=V!==void 0,q=K?V:W,J=p(e=>{K||G(e),H?.(e)},[K,H]),Y=b??f,X=x??y;return g(r,{value:m(()=>({recipientAddress:o,onRecipientChange:s??v,connectedAddress:c,amount:l,onAmountChange:u??v,onAmountMax:d,sourceAsset:f,sourceChain:y,receiveAsset:Y,receiveChain:X,receiveAssetOptions:S,onReceiveAssetChange:C,receiveChainOptions:w,onReceiveChainChange:T,balance:E,amountUsd:D,receiveAmount:O,receiveAmountUsd:k,breakdown:A,quoteEstimating:j,quoteRegenerating:M,quoteSeconds:N,quoteTotalSeconds:P,submitting:F,submitDisabled:I,submitLabel:L,notice:R,onSubmit:z,breakdownOpen:q,onBreakdownOpenChange:J}),[o,s,c,l,u,d,f,y,Y,X,S,C,w,T,E,D,O,k,A,j,M,N,P,F,I,L,R,z,q,J]),children:g(t.Provider,{children:g(n,{"data-stridge-slot":i.root,..._.props(a.root),children:U})})})}function b({open:t,defaultOpen:n,onOpenChange:r,trigger:i,children:a,...o}){return g(e,{open:t,defaultOpen:n,onOpenChange:r,trigger:i,children:g(y,{...o,children:a})})}(function(e){e.Header=u,e.Body=s,e.RecipientField=f,e.AmountField=o,e.ReceiveSelectors=d,e.BreakdownCard=c,e.Footer=l,e.Dialog=b})(y||={});export{y as WithdrawForm};
1
+ "use client";import{DialogShell as e}from"../../../../../shared/dialog/DialogShell.js";import{Tooltip as t}from"../../../../../shared/ui/Tooltip/Tooltip.js";import"../../../../../shared/ui/Tooltip/index.js";import{Frame as n}from"../../../../../shared/dialog/Frame.js";import{WithdrawFormContext as r}from"./context.js";import{WITHDRAW_FORM_SLOTS as i}from"./WithdrawForm.slots.js";import{styles as a}from"./WithdrawForm.styles.js";import{WithdrawFormAmountField as o}from"./components/AmountField.js";import{WithdrawFormBody as s}from"./components/Body.js";import{WithdrawFormBreakdownCard as c}from"./components/BreakdownCard.js";import{WithdrawFormFooter as l}from"./components/Footer.js";import{WithdrawFormHeader as u}from"./components/Header.js";import{WithdrawFormReceiveSelectors as d}from"./components/ReceiveSelectors.js";import{WithdrawFormRecipientField as f}from"./components/RecipientField.js";import{useCallback as p,useMemo as m,useState as h}from"react";import{jsx as g}from"react/jsx-runtime";import*as _ from"@stylexjs/stylex";const v=()=>void 0;function y(e){let{recipientAddress:o=``,onRecipientChange:s,recipientChainType:c=`evm`,suggestedRecipient:l,amount:u=``,onAmountChange:d,onAmountMax:f,sourceAsset:y,sourceChain:b,receiveAsset:x,receiveChain:S,receiveAssetOptions:C,onReceiveAssetChange:w,receiveChainOptions:T,onReceiveChainChange:E,balance:D,amountUsd:O,receiveAmount:k,receiveAmountUsd:A,breakdown:j,quoteEstimating:M=!1,quoteRegenerating:N=!1,quoteSeconds:P,quoteTotalSeconds:F,submitting:I=!1,submitDisabled:L=!1,submitLabel:R,notice:z,onSubmit:B,defaultBreakdownOpen:V=!1,breakdownOpen:H,onBreakdownOpenChange:U,children:W}=e,[G,K]=h(V),q=H!==void 0,J=q?H:G,Y=p(e=>{q||K(e),U?.(e)},[q,U]),X=x??y,Z=S??b;return g(r,{value:m(()=>({recipientAddress:o,onRecipientChange:s??v,recipientChainType:c,suggestedRecipient:l,amount:u,onAmountChange:d??v,onAmountMax:f,sourceAsset:y,sourceChain:b,receiveAsset:X,receiveChain:Z,receiveAssetOptions:C,onReceiveAssetChange:w,receiveChainOptions:T,onReceiveChainChange:E,balance:D,amountUsd:O,receiveAmount:k,receiveAmountUsd:A,breakdown:j,quoteEstimating:M,quoteRegenerating:N,quoteSeconds:P,quoteTotalSeconds:F,submitting:I,submitDisabled:L,submitLabel:R,notice:z,onSubmit:B,breakdownOpen:J,onBreakdownOpenChange:Y}),[o,s,c,l,u,d,f,y,b,X,Z,C,w,T,E,D,O,k,A,j,M,N,P,F,I,L,R,z,B,J,Y]),children:g(t.Provider,{children:g(n,{"data-stridge-slot":i.root,..._.props(a.root),children:W})})})}function b({open:t,defaultOpen:n,onOpenChange:r,trigger:i,children:a,...o}){return g(e,{open:t,defaultOpen:n,onOpenChange:r,trigger:i,children:g(y,{...o,children:a})})}(function(e){e.Header=u,e.Body=s,e.RecipientField=f,e.AmountField=o,e.ReceiveSelectors=d,e.BreakdownCard=c,e.Footer=l,e.Dialog=b})(y||={});export{y as WithdrawForm};
@@ -4,13 +4,14 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
4
4
  //#region src/flows/withdraw/widgets/withdraw-form/compound/components/Body.d.ts
5
5
  /**
6
6
  * Body part — vertical stack hosting the form fields, selectors, summary row, and breakdown
7
- * card. Becomes the scrollable region when the widget is mounted inside `Dialog.Content`.
7
+ * card. Becomes the scrollable region when a parent (dialog content panel, or canvas-mode
8
+ * consumer that caps the body) imposes a block-size constraint.
8
9
  *
9
- * In dialog mode, `Card.Body` injects its own scroll-area + viewport + inner-flex chain (see
10
- * `bodyStyles.root` in `Card.styles.ts`), which wraps the children in an extra `<div>` that
11
- * isolates them from any padding / gap a caller passes via spread props. We wrap the children
12
- * in our own slot div so the body's `gap: 22px` and `padding: 28/22/22/22` apply where the
13
- * fields actually live (i.e. as siblings) instead of getting redirected to the viewport.
10
+ * `Card.Body` injects its own scroll-area + viewport + inner-flex chain (see `bodyStyles.root`
11
+ * in `Card.styles.ts`), which wraps the children in an extra `<div>` that isolates them from
12
+ * any padding / gap a caller passes via spread props. We wrap the children in our own slot
13
+ * div so the body's `gap: 22px` and `padding: 28/22/22/22` apply where the fields actually
14
+ * live (i.e. as siblings) instead of getting redirected to the viewport.
14
15
  */
15
16
  declare function WithdrawFormBody({
16
17
  children,
@@ -5,13 +5,18 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
5
5
  /**
6
6
  * Header part — back chevron + title + (optional) quote countdown ring + dialog close. Mirrors
7
7
  * `TransferCrypto.Header`'s shape so both flows render the same modal-chrome rhythm. The chevron
8
- * only renders when `onBack` is supplied; in V2 the orchestrated wrapper omits it (`form` has no
8
+ * only renders when `onBack` is supplied; the orchestrated wrapper omits it (`form` has no
9
9
  * parent step).
10
10
  *
11
11
  * The quote countdown ring renders only when the orchestrated wrapper supplies both
12
12
  * `quoteSeconds` and `quoteTotalSeconds` — i.e. when there's an actively-tracked quote whose
13
13
  * freshness window is meaningful (recipient is valid, amount > 0, balance covers it). Mirrors
14
14
  * deposit's confirm-deposit timer.
15
+ *
16
+ * Activity trigger — between the optional quote timer and the close X, an
17
+ * `<ActivityTrigger>` button opens the cross-flow activity surface. Gated on a standalone
18
+ * activity driver being mounted via `<KitProvider activity={…}>`; the steps router only mounts
19
+ * this header on `form`, so an additional FSM-state allow-list would be redundant.
15
20
  */
16
21
  declare function WithdrawFormHeader({
17
22
  onBack,
@@ -1 +1 @@
1
- "use client";import{useLingui as e}from"../../../../../../shared/i18n/useLingui.js";import"../../../../../../i18n/index.js";import{ChevronLeftIcon as t}from"../../../../../../shared/icons/ChevronLeftIcon.js";import"../../../../../../icons/index.js";import{IconButton as n}from"../../../../../../shared/ui/IconButton/IconButton.js";import{Dialog as r}from"../../../../../../shared/ui/Dialog/Dialog.js";import"../../../../../../shared/ui/Dialog/index.js";import{Card as i}from"../../../../../../shared/ui/Card/Card.js";import{text as a}from"../../../../../../shared/ui/Text/Text.js";import"../../../../../../ui/index.js";import{QuoteTimer as o}from"../../../../../../shared/widgets/confirm-transfer/compound/components/QuoteTimer.js";import{useWithdrawFormContext as s}from"../context.js";import{WITHDRAW_FORM_SLOTS as c}from"../WithdrawForm.slots.js";import{styles as l}from"../WithdrawForm.styles.js";import{jsx as u,jsxs as d}from"react/jsx-runtime";import*as f from"@stylexjs/stylex";function p({onBack:p,title:m}){let{_:h}=e(),g=s(`WithdrawForm.Header`),_=m??h({id:`OsyKSt`,message:`Withdraw`}),v=g.quoteSeconds!==void 0&&g.quoteTotalSeconds!==void 0&&g.quoteTotalSeconds>0;return d(i.Header,{"data-stridge-slot":c.header,...f.props(l.header),children:[d(`div`,{...f.props(l.headerLeft),children:[typeof p==`function`?u(n,{"aria-label":h({id:`iH8pgl`,message:`Back`}),onClick:p,children:u(t,{"aria-hidden":!0,...f.props(l.backIcon)})}):null,u(a.span,{size:`base`,fontWeight:`semibold`,leading:`tight`,tracking:`tight`,style:{margin:0},children:_})]}),d(`div`,{...f.props(l.headerRight),children:[v?u(o,{seconds:g.quoteSeconds??0,total:g.quoteTotalSeconds}):null,u(r.CloseButton,{})]})]})}export{p as WithdrawFormHeader};
1
+ "use client";import{useOptionalActivityDriverInstance as e}from"../../../../../activity/driver/context.js";import{useLingui as t}from"../../../../../../shared/i18n/useLingui.js";import"../../../../../../i18n/index.js";import{useWithdrawActions as n}from"../../../../orchestrator/controller.js";import{ChevronLeftIcon as r}from"../../../../../../shared/icons/ChevronLeftIcon.js";import"../../../../../../icons/index.js";import{IconButton as i}from"../../../../../../shared/ui/IconButton/IconButton.js";import{Dialog as a}from"../../../../../../shared/ui/Dialog/Dialog.js";import"../../../../../../shared/ui/Dialog/index.js";import{Card as o}from"../../../../../../shared/ui/Card/Card.js";import{text as s}from"../../../../../../shared/ui/Text/Text.js";import"../../../../../../ui/index.js";import{ActivityTrigger as c}from"../../../../../../shared/widgets/activity/ActivityTrigger.js";import"../../../../../../shared/widgets/activity/index.js";import{QuoteTimer as l}from"../../../../../../shared/widgets/confirm-transfer/compound/components/QuoteTimer.js";import{useWithdrawFormContext as u}from"../context.js";import{WITHDRAW_FORM_SLOTS as d}from"../WithdrawForm.slots.js";import{styles as f}from"../WithdrawForm.styles.js";import{jsx as p,jsxs as m}from"react/jsx-runtime";import*as h from"@stylexjs/stylex";function g({onBack:g,title:_}){let{_:v}=t(),y=u(`WithdrawForm.Header`),{openActivity:b}=n(),x=e()!==null,S=_??v({id:`OsyKSt`,message:`Withdraw`}),C=y.quoteSeconds!==void 0&&y.quoteTotalSeconds!==void 0&&y.quoteTotalSeconds>0;return m(o.Header,{"data-stridge-slot":d.header,...h.props(f.header),children:[m(`div`,{...h.props(f.headerLeft),children:[typeof g==`function`?p(i,{"aria-label":v({id:`iH8pgl`,message:`Back`}),onClick:g,children:p(r,{"aria-hidden":!0,...h.props(f.backIcon)})}):null,p(s.span,{size:`base`,fontWeight:`semibold`,leading:`tight`,tracking:`tight`,style:{margin:0},children:S})]}),m(`div`,{...h.props(f.headerRight),children:[C?p(l,{seconds:y.quoteSeconds??0,total:y.quoteTotalSeconds}):null,x?p(c,{onOpen:b}):null,p(a.CloseButton,{})]})]})}export{g as WithdrawFormHeader};
@@ -2,17 +2,19 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/flows/withdraw/widgets/withdraw-form/compound/components/RecipientField.d.ts
4
4
  /**
5
- * Recipient address field — label + auto-growing textarea + trailing wallet pill.
5
+ * Recipient address field — label + auto-growing textarea + trailing prefill chip.
6
6
  *
7
7
  * The textarea wraps long hex addresses up to `maxBlockSize`, then scrolls. Single-line semantics
8
8
  * are kept by stripping any `\r\n` in `onChange` — no `onKeyDown` Enter-blocker, since that would
9
9
  * also swallow IME composition keys for CJK input. The stripping handler lives here (not in
10
10
  * `InputGroup.Textarea`) so the kit primitive stays neutral on the single-vs-multi-line decision.
11
11
  *
12
- * The pill becomes an interactive button when `connectedAddress` is set; clicking it fills the
13
- * input. Omitted entirely when `connectedAddress` is absent. The pill renders the truncated
14
- * address (`0x70…79C8`) the user recognizes their own address, making the action self-evident
15
- * while keeping pill width deterministic across locales.
12
+ * The chip is host-controlled via `suggestedRecipient` on `<WithdrawDialog>` (or the compound
13
+ * root prop). Clicking it fills the input. Hidden entirely when no suggestion is supplied. The
14
+ * chip's `aria-label` reads off the host-supplied `label` so screen readers describe which
15
+ * address is being prefilled; the visible text shows the truncated address so sighted users
16
+ * see "this is mine" recognition. The kit no longer auto-derives this from `wagmi.address` —
17
+ * that misled users on embedded-wallet integrations.
16
18
  */
17
19
  declare function WithdrawFormRecipientField(): _$react_jsx_runtime0.JSX.Element;
18
20
  //#endregion
@@ -1 +1 @@
1
- "use client";import{useLingui as e}from"../../../../../../shared/i18n/useLingui.js";import"../../../../../../i18n/index.js";import{Field as t}from"../../../../../../shared/ui/Field/Field.js";import"../../../../../../shared/ui/Field/index.js";import{Image as n}from"../../../../../../shared/ui/Image/Image.js";import"../../../../../../shared/ui/Image/index.js";import{InputGroup as r}from"../../../../../../shared/ui/InputGroup/InputGroup.js";import"../../../../../../shared/ui/InputGroup/index.js";import{useWithdrawFormContext as i}from"../context.js";import{WITHDRAW_FORM_SLOTS as a}from"../WithdrawForm.slots.js";import{styles as o}from"../WithdrawForm.styles.js";import{useCallback as s,useId as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import*as d from"@stylexjs/stylex";function f(){let f=i(`WithdrawForm.RecipientField`),{_:m}=e(),h=m({id:`yy2rkt`,message:`0x…`}),g=m({id:`MZ_nQf`,message:`Recipient address`}),_=c(),{connectedAddress:v,onRecipientChange:y}=f,b=s(e=>{y(e.target.value.replace(/[\r\n]+/g,``))},[y]),x=s(()=>{v&&y(v)},[v,y]),S=v?p(v):``;return u(t,{"data-stridge-slot":a.recipientField,children:[l(t.Label,{htmlFor:_,children:g}),u(r,{children:[l(r.Textarea,{id:_,"data-stridge-slot":a.recipientInput,rows:1,spellCheck:!1,autoComplete:`off`,autoCorrect:`off`,autoCapitalize:`off`,placeholder:h,value:f.recipientAddress,onChange:b,...d.props(o.recipientInputMono)}),v?l(r.Addon,{align:`inline-end`,children:u(`button`,{type:`button`,"data-stridge-slot":a.recipientPill,onClick:x,"aria-label":m({id:`8Fcmiu`,message:`Use connected wallet address`}),...d.props(o.pillBase,o.pillInteractive,o.recipientPill),children:[l(n,{size:`sm`,alt:m({id:`sb9Y58`,message:`Wallet`})}),l(`span`,{...d.props(o.recipientPillText),children:S})]})}):null]})]})}function p(e){return e.length<=10?e:`${e.slice(0,4)}…${e.slice(-4)}`}export{f as WithdrawFormRecipientField};
1
+ "use client";import{useLingui as e}from"../../../../../../shared/i18n/useLingui.js";import"../../../../../../i18n/index.js";import{Field as t}from"../../../../../../shared/ui/Field/Field.js";import"../../../../../../shared/ui/Field/index.js";import{Image as n}from"../../../../../../shared/ui/Image/Image.js";import"../../../../../../shared/ui/Image/index.js";import{InputGroup as r}from"../../../../../../shared/ui/InputGroup/InputGroup.js";import"../../../../../../shared/ui/InputGroup/index.js";import{useWithdrawFormContext as i}from"../context.js";import{WITHDRAW_FORM_SLOTS as a}from"../WithdrawForm.slots.js";import{styles as o}from"../WithdrawForm.styles.js";import{useCallback as s,useId as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import*as d from"@stylexjs/stylex";function f(){let f=i(`WithdrawForm.RecipientField`),{_:m}=e(),h=f.recipientChainType===`tron`?m({id:`9XIJb8`,message:`T…`}):m({id:`yy2rkt`,message:`0x…`}),g=m({id:`MZ_nQf`,message:`Recipient address`}),_=c(),{suggestedRecipient:v,onRecipientChange:y}=f,b=v?.address,x=v?.label?.trim()||m({id:`BhQhbU`,message:`Use suggested recipient address`}),S=s(e=>{y(e.target.value.replace(/[\r\n]+/g,``))},[y]),C=s(()=>{b&&y(b)},[b,y]),w=b?p(b):``;return u(t,{"data-stridge-slot":a.recipientField,children:[l(t.Label,{htmlFor:_,children:g}),u(r,{children:[l(r.Textarea,{id:_,"data-stridge-slot":a.recipientInput,rows:1,spellCheck:!1,autoComplete:`off`,autoCorrect:`off`,autoCapitalize:`off`,placeholder:h,value:f.recipientAddress,onChange:S,...d.props(o.recipientInputMono)}),b?l(r.Addon,{align:`inline-end`,children:u(`button`,{type:`button`,"data-stridge-slot":a.recipientPill,onClick:C,"aria-label":x,...d.props(o.pillBase,o.pillInteractive,o.recipientPill),children:[l(n,{size:`sm`,alt:m({id:`sb9Y58`,message:`Wallet`})}),l(`span`,{...d.props(o.recipientPillText),children:w})]})}):null]})]})}function p(e){return e.length<=10?e:`${e.slice(0,4)}…${e.slice(-4)}`}export{f as WithdrawFormRecipientField};
@@ -1,5 +1,7 @@
1
+ import { ChainType } from "../../../../../shared/chains/index.js";
1
2
  import { DialogShellControls } from "../../../../../shared/dialog/DialogShell.js";
2
3
  import { AssetDescriptor } from "../../../../../shared/widgets/asset-descriptor.js";
4
+ import { WithdrawSuggestedRecipient } from "../../../bindings/WithdrawBindings.js";
3
5
  import { ComponentProps, ReactNode } from "react";
4
6
 
5
7
  //#region src/flows/withdraw/widgets/withdraw-form/compound/types.d.ts
@@ -38,12 +40,20 @@ interface WithdrawFormProps {
38
40
  /** Fired when the user types into the recipient field. */
39
41
  onRecipientChange?: (next: string) => void;
40
42
  /**
41
- * Connected-wallet address surfaced behind the trailing "Use connected" pill in
42
- * {@link WithdrawForm.RecipientField}. When provided, clicking the pill fills the recipient
43
- * input with this address (via {@link WithdrawFormProps.onRecipientChange}). When omitted,
44
- * the pill renders as a static decorative chip.
43
+ * Chain family of the selected receive chain. Drives the recipient field's placeholder
44
+ * (`0x…` for EVM, `T…` for Tron) so the hint matches the address shape the user must enter.
45
+ * Defaults to `"evm"` when omitted the historical behavior before non-EVM receive chains.
45
46
  */
46
- connectedAddress?: string;
47
+ recipientChainType?: ChainType;
48
+ /**
49
+ * Host-supplied recipient suggestion surfaced as a prefill chip on
50
+ * {@link WithdrawForm.RecipientField}. Clicking the chip fills the recipient input via
51
+ * {@link WithdrawFormProps.onRecipientChange}. The chip's accessible name reads off
52
+ * `suggestedRecipient.label` so the user knows which address they are filling with. When
53
+ * omitted, no chip renders. See {@link WithdrawSuggestedRecipient} for the rationale —
54
+ * the kit no longer auto-derives this from `wagmi.address`.
55
+ */
56
+ suggestedRecipient?: WithdrawSuggestedRecipient;
47
57
  /** Current amount-field value, in display units, as a string (controlled). */
48
58
  amount?: string;
49
59
  /** Fired when the user types into the amount field. */
@@ -1 +1 @@
1
- function e(e){return/^0x[0-9a-fA-F]{40}$/.test(e)}function t(e,t){if(!t.isRecipientFilled)return e.enterRecipientAddress;if(!t.isRecipientValid)return e.enterValidRecipientAddress;if(!t.isAmountValid)return e.enterAmount;if(t.exceedsBalance)return e.insufficientBalance;if(t.quoteRegenerating)return e.regeneratingQuote;if(t.quoteEstimating)return e.estimatingQuote}export{e as isValidEvmAddress,t as resolveSubmitLabel};
1
+ function e(e,t){if(!t.isRecipientFilled)return e.enterRecipientAddress;if(!t.isRecipientValid)return e.enterValidRecipientAddress;if(!t.isAmountValid)return e.enterAmount;if(t.exceedsBalance)return e.insufficientBalance;if(t.belowMinimum&&e.belowMinimumAmount)return e.belowMinimumAmount;if(t.aboveCap&&e.aboveCapAmount)return e.aboveCapAmount;if(t.quoteRegenerating)return e.regeneratingQuote;if(t.quoteEstimating)return e.estimatingQuote}export{e as resolveSubmitLabel};
@@ -1,19 +1,55 @@
1
- import { ComponentProps } from "react";
1
+ import { ProcessingStateBodyProps, ProcessingStateRowProps } from "../../../../shared/widgets/processing-state/compound/types.js";
2
+ import { ProcessingStateDetails } from "../../../../shared/widgets/processing-state/compound/components/Details.js";
3
+ import { ProcessingStateHeader } from "../../../../shared/widgets/processing-state/compound/components/Header.js";
4
+ import { ProcessingStateHero } from "../../../../shared/widgets/processing-state/compound/components/Hero.js";
5
+ import { ProcessingStateDetectedAtRow, ProcessingStateSourceRow, ProcessingStateSubmittedAtRow } from "../../../../shared/widgets/processing-state/compound/components/Rows.js";
6
+ import { ProcessingStateStatusPill } from "../../../../shared/widgets/processing-state/compound/components/StatusPill.js";
7
+ import { ComponentProps, ReactNode } from "react";
2
8
  import * as _$react_jsx_runtime0 from "react/jsx-runtime";
3
9
 
4
10
  //#region src/flows/withdraw/widgets/withdraw-in-progress/WithdrawInProgress.d.ts
5
11
  /**
6
12
  * Orchestrated `WithdrawInProgress` widget. Composes the shared `ProcessingState` compound so
7
13
  * the in-flight surface matches the deposit flow's processing screen 1:1 — same Hero / StatusPill /
8
- * Details / Actions architecture. Withdraw-specific deltas:
14
+ * Details architecture. Withdraw-specific deltas:
9
15
  *
10
16
  * - No source-wallet row (the user IS the source); `<SourceRow>` is omitted.
11
17
  * - The single broadcast hash is surfaced through `<SourceTxRow>` with the "Withdrawal tx" label.
12
18
  * - No "Detected" row (no indexer step in the withdraw flow).
13
19
  * - Hero subcaption is the recipient address (truncated) — passed through `creditedTo`.
20
+ * - Hero promotes the USD figure (`amountUsd`) over the token amount, which drops to a subline.
14
21
  *
15
22
  * Renders only while the FSM is on `inProgress`.
16
23
  */
17
- declare function WithdrawInProgress(props: ComponentProps<"div">): _$react_jsx_runtime0.JSX.Element | null;
24
+ interface WithdrawInProgressOwnProps {
25
+ /**
26
+ * Optional custom composition. Defaults to `<Header />` + `<Body><Hero /><StatusPill />
27
+ * <Details><SourceTxRow label="Withdrawal tx" /><SubmittedAtRow /></Details></Body>`. Pass
28
+ * children to interleave your own elements between compound parts.
29
+ */
30
+ children?: ReactNode;
31
+ }
32
+ declare function WithdrawInProgress({
33
+ children,
34
+ ...props
35
+ }: ComponentProps<"div"> & WithdrawInProgressOwnProps): _$react_jsx_runtime0.JSX.Element | null;
36
+ /**
37
+ * Withdraw-tuned default for the source-tx row label. Without this wrapper, hosts composing
38
+ * `<WithdrawInProgress.SourceTxRow />` would inherit the deposit-flow's "Deposit tx" default —
39
+ * the wrong copy for a withdrawal. Host-supplied `label` overrides.
40
+ */
41
+ declare function WithdrawInProgressSourceTxRow(props?: ProcessingStateRowProps): _$react_jsx_runtime0.JSX.Element;
42
+ declare namespace WithdrawInProgress {
43
+ type Props = ComponentProps<"div"> & WithdrawInProgressOwnProps;
44
+ const Header: typeof ProcessingStateHeader;
45
+ const Body: (props: ProcessingStateBodyProps) => _$react_jsx_runtime0.JSX.Element;
46
+ const Hero: typeof ProcessingStateHero;
47
+ const StatusPill: typeof ProcessingStateStatusPill;
48
+ const Details: typeof ProcessingStateDetails;
49
+ const SourceRow: typeof ProcessingStateSourceRow;
50
+ const SourceTxRow: typeof WithdrawInProgressSourceTxRow;
51
+ const SubmittedAtRow: typeof ProcessingStateSubmittedAtRow;
52
+ const DetectedAtRow: typeof ProcessingStateDetectedAtRow;
53
+ }
18
54
  //#endregion
19
55
  export { WithdrawInProgress };
@@ -1 +1 @@
1
- "use client";import{useLingui as e}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useWithdrawSnapshot as t}from"../../driver/context.js";import{useWithdrawActions as n,useWithdrawEffectiveState as r}from"../../orchestrator/controller.js";import{formatTokenAmount as i}from"../../../../shared/format/formatTokenAmount.js";import{ProcessingState as a}from"../../../../shared/widgets/processing-state/compound/ProcessingState.js";import"../../../../shared/widgets/processing-state/compound/index.js";import{toAssetDescriptor as o}from"../../../../shared/widgets/asset-descriptor.js";import{jsx as s,jsxs as c}from"react/jsx-runtime";function l(l){let u=t(),d=r(),{close:f}=n(),{_:p,i18n:m}=e(),h=u.settlement,g=(h.status===`ready`||h.status===`stale`)&&h.payload.kind===`pending`?h.payload:void 0;if(d.name!==`inProgress`)return null;let _=d.ctx.input,v=g?.txHash?.formatted,y=g?.txExplorerUrl,b=g?.recipient.formatted,x=g?.receiveAsset,S=g?.receiveAmount,C=S&&S.value>0?S.formatted:i(_.amount,m,{...x?.decimals===void 0?{}:{maxDecimals:x.decimals}}),w=x?.symbol??_.receiveTokenSymbol,T=o(x)??{symbol:w},E=v?{hash:v,explorerUrl:y}:void 0;return c(a,{...l,headerTitle:p({id:`w-2VR9`,message:`Withdrawal in progress…`}),amount:C,creditedAsset:T,creditedTo:b,sourceTx:E,submittedAt:g?.submittedAt.formatted,onClose:f,children:[s(a.Header,{}),c(a.Body,{children:[s(a.Hero,{}),s(a.StatusPill,{}),c(a.Details,{children:[s(a.SourceTxRow,{label:p({id:`60ahSE`,message:`Withdrawal tx`})}),s(a.SubmittedAtRow,{})]})]}),s(a.Actions,{})]})}export{l as WithdrawInProgress};
1
+ "use client";import{useLingui as e}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useWithdrawSnapshot as t}from"../../driver/context.js";import{useWithdrawEffectiveState as n}from"../../orchestrator/controller.js";import{ProcessingState as r}from"../../../../shared/widgets/processing-state/compound/ProcessingState.js";import"../../../../shared/widgets/processing-state/compound/index.js";import{toAssetDescriptor as i}from"../../../../shared/widgets/asset-descriptor.js";import{Fragment as a,jsx as o,jsxs as s}from"react/jsx-runtime";function c({children:c,...l}){let u=t(),d=n(),{_:f}=e(),p=u.settlement,m=(p.status===`ready`||p.status===`stale`)&&p.payload.kind===`pending`?p.payload:void 0;if(d.name!==`inProgress`)return null;let h=d.ctx.input,g=m?.txHash?.formatted,_=m?.txExplorerUrl,v=m?.recipient.formatted,y=u.quote,b=y.status===`ready`||y.status===`stale`?y.payload:void 0,x=i(m?.receiveAsset??b?.receiveAsset)??{symbol:h.receiveTokenSymbol},S=m?.receiveAmount,C=S&&S.value>0?S.formatted:b?.receiveAmount.formatted,w=C===void 0,T=m?.receiveAmountUsd?.formatted??b?.receiveAmountUsd?.formatted??h.amountUsd,E=g?{hash:g,explorerUrl:_}:void 0;return o(r,{...l,headerTitle:f({id:`w-2VR9`,message:`Withdrawal in progress…`}),amount:C??``,...T?{amountUsd:T}:{},...w?{loading:!0}:{},creditedAsset:x,creditedTo:v,sourceTx:E,submittedAt:m?.submittedAt.formatted,children:c??s(a,{children:[o(r.Header,{}),s(r.Body,{children:[o(r.Hero,{}),o(r.StatusPill,{}),s(r.Details,{children:[o(r.SourceTxRow,{label:f({id:`60ahSE`,message:`Withdrawal tx`})}),o(r.SubmittedAtRow,{})]})]})]})})}function l(t={}){let{_:n}=e();return o(r.SourceTxRow,{...t,label:t.label??n({id:`60ahSE`,message:`Withdrawal tx`})})}(function(e){e.Header=r.Header,e.Body=r.Body,e.Hero=r.Hero,e.StatusPill=r.StatusPill,e.Details=r.Details,e.SourceRow=r.SourceRow,e.SourceTxRow=l,e.SubmittedAtRow=r.SubmittedAtRow,e.DetectedAtRow=r.DetectedAtRow})(c||={});export{c as WithdrawInProgress};