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

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 (580) hide show
  1. package/README.md +22 -6
  2. package/dist/KitProvider.d.ts +40 -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 +3 -3
  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 +4 -2
  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 +25 -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 +17 -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/checkoutChannel.d.ts +31 -0
  40. package/dist/drivers/stridge-mock/checkoutChannel.js +1 -0
  41. package/dist/drivers/stridge-mock/createStridgeMockActivityDriver.d.ts +44 -0
  42. package/dist/drivers/stridge-mock/createStridgeMockActivityDriver.js +1 -0
  43. package/dist/drivers/stridge-mock/createStridgeMockDriver.d.ts +30 -2
  44. package/dist/drivers/stridge-mock/createStridgeMockDriver.js +1 -1
  45. package/dist/drivers/stridge-mock/createStridgeMockWithdrawDriver.d.ts +15 -3
  46. package/dist/drivers/stridge-mock/createStridgeMockWithdrawDriver.js +1 -1
  47. package/dist/drivers/stridge-mock/fixtures.d.ts +19 -13
  48. package/dist/drivers/stridge-mock/fixtures.js +1 -1
  49. package/dist/drivers/stridge-mock/triggers.d.ts +12 -0
  50. package/dist/events/bus/createBus.d.ts +26 -0
  51. package/dist/events/bus/createBus.js +1 -0
  52. package/dist/events/bus/flowIdRegistry.d.ts +17 -0
  53. package/dist/events/bus/flowIdRegistry.js +1 -0
  54. package/dist/events/bus/index.js +1 -0
  55. package/dist/events/bus/metadata.js +1 -0
  56. package/dist/events/context.js +1 -0
  57. package/dist/events/emit/index.js +1 -0
  58. package/dist/events/emit/mapFailure.js +1 -0
  59. package/dist/events/emit/useActivityEmissions.js +1 -0
  60. package/dist/events/emit/useDepositEmissions.js +1 -0
  61. package/dist/events/emit/useKitEmitter.js +1 -0
  62. package/dist/events/emit/useWithdrawEmissions.js +1 -0
  63. package/dist/events/hooks/index.d.ts +6 -0
  64. package/dist/events/hooks/index.js +1 -0
  65. package/dist/events/hooks/useCurrentFlowId.d.ts +6 -0
  66. package/dist/events/hooks/useCurrentFlowId.js +1 -0
  67. package/dist/events/hooks/useStableHandler.js +1 -0
  68. package/dist/events/hooks/useStridgeEvent.d.ts +9 -0
  69. package/dist/events/hooks/useStridgeEvent.js +1 -0
  70. package/dist/events/hooks/useStridgeEventBus.d.ts +34 -0
  71. package/dist/events/hooks/useStridgeEventBus.js +1 -0
  72. package/dist/events/hooks/useStridgeEvents.d.ts +7 -0
  73. package/dist/events/hooks/useStridgeEvents.js +1 -0
  74. package/dist/events/hooks/useStridgeFlowEvent.d.ts +8 -0
  75. package/dist/events/hooks/useStridgeFlowEvent.js +1 -0
  76. package/dist/events/hooks/useStridgeFlowEvents.d.ts +6 -0
  77. package/dist/events/hooks/useStridgeFlowEvents.js +1 -0
  78. package/dist/events/index.d.ts +17 -0
  79. package/dist/events/index.js +1 -0
  80. package/dist/events/publish.js +1 -0
  81. package/dist/events/redact.d.ts +34 -0
  82. package/dist/events/redact.js +1 -0
  83. package/dist/events/types/activity.d.ts +53 -0
  84. package/dist/events/types/deposit.d.ts +235 -0
  85. package/dist/events/types/envelope.d.ts +145 -0
  86. package/dist/events/types/index.d.ts +32 -0
  87. package/dist/events/types/kit.d.ts +23 -0
  88. package/dist/events/types/withdraw.d.ts +150 -0
  89. package/dist/flows/activity/compound/ActivityFlow.d.ts +46 -0
  90. package/dist/flows/activity/compound/ActivityFlow.js +1 -0
  91. package/dist/flows/activity/compound/components/Boundary.d.ts +29 -0
  92. package/dist/flows/activity/compound/components/Boundary.js +1 -0
  93. package/dist/flows/activity/compound/components/Steps.d.ts +24 -0
  94. package/dist/flows/activity/compound/components/Steps.js +1 -0
  95. package/dist/flows/activity/dialog/ActivityDialog.d.ts +55 -0
  96. package/dist/flows/activity/dialog/ActivityDialog.js +1 -0
  97. package/dist/flows/activity/dialog/ActivityFlowBoundary.d.ts +1 -0
  98. package/dist/flows/activity/dialog/ActivityFlowBoundary.js +1 -0
  99. package/dist/flows/activity/driver/context.d.ts +38 -0
  100. package/dist/flows/activity/driver/context.js +1 -0
  101. package/dist/flows/activity/driver/types.d.ts +58 -0
  102. package/dist/flows/activity/orchestrator/controller.d.ts +11 -0
  103. package/dist/flows/activity/orchestrator/controller.js +1 -0
  104. package/dist/flows/activity/orchestrator/index.d.ts +4 -0
  105. package/dist/flows/activity/orchestrator/index.js +1 -0
  106. package/dist/flows/activity/orchestrator/reducer.d.ts +1 -0
  107. package/dist/flows/activity/orchestrator/reducer.js +1 -0
  108. package/dist/flows/activity/orchestrator/types.d.ts +71 -0
  109. package/dist/flows/activity/orchestrator/useActivity.d.ts +94 -0
  110. package/dist/flows/activity/orchestrator/useActivity.js +1 -0
  111. package/dist/flows/activity/widgets/ActivityDetail.d.ts +41 -0
  112. package/dist/flows/activity/widgets/ActivityDetail.js +1 -0
  113. package/dist/flows/activity/widgets/ActivityList.d.ts +38 -0
  114. package/dist/flows/activity/widgets/ActivityList.js +1 -0
  115. package/dist/flows/activity/widgets/useStandaloneActivitySource.js +1 -0
  116. package/dist/flows/deposit/dialog/DepositBootstrapErrorState.js +1 -1
  117. package/dist/flows/deposit/dialog/DepositDialog.d.ts +26 -79
  118. package/dist/flows/deposit/dialog/DepositDialog.js +1 -1
  119. package/dist/flows/deposit/dialog/WalletRequiredState.js +1 -0
  120. package/dist/flows/deposit/dialog/WalletRequiredState.styles.js +1 -0
  121. package/dist/flows/deposit/driver/payloads.d.ts +109 -5
  122. package/dist/flows/deposit/driver/transformers/balanceToBalancesPayload.d.ts +2 -0
  123. package/dist/flows/deposit/driver/transformers/balanceToBalancesPayload.js +1 -1
  124. package/dist/flows/deposit/driver/transformers/index.d.ts +1 -0
  125. package/dist/flows/deposit/driver/transformers/quoteToPayload.d.ts +2 -0
  126. package/dist/flows/deposit/driver/transformers/settlementToPayload.d.ts +25 -0
  127. package/dist/flows/deposit/driver/transformers/settlementToPayload.js +1 -1
  128. package/dist/flows/deposit/driver/transformers/startToAddressesPayload.d.ts +2 -0
  129. package/dist/flows/deposit/driver/transformers/startToAddressesPayload.js +1 -1
  130. package/dist/flows/deposit/driver/transformers/startToBrandPayload.d.ts +1 -0
  131. package/dist/flows/deposit/driver/transformers/startToTargetPayload.d.ts +2 -0
  132. package/dist/flows/deposit/driver/transformers/startToTargetPayload.js +1 -1
  133. package/dist/flows/deposit/driver/transformers/walletAddressToWalletPayload.d.ts +1 -0
  134. package/dist/flows/deposit/driver/types.d.ts +92 -5
  135. package/dist/flows/deposit/orchestrator/controller.js +1 -1
  136. package/dist/flows/deposit/orchestrator/index.d.ts +5 -0
  137. package/dist/flows/deposit/orchestrator/reducer.d.ts +1 -0
  138. package/dist/flows/deposit/orchestrator/reducer.js +1 -1
  139. package/dist/flows/deposit/orchestrator/types.d.ts +276 -12
  140. package/dist/flows/deposit/orchestrator/useDeposit.d.ts +45 -1
  141. package/dist/flows/deposit/orchestrator/useDeposit.js +1 -1
  142. package/dist/flows/deposit/shared/checkoutPopup.js +1 -0
  143. package/dist/flows/deposit/shared/onramp.js +1 -0
  144. package/dist/flows/deposit/widgets/activity/DepositActivityDetail.d.ts +40 -0
  145. package/dist/flows/deposit/widgets/activity/DepositActivityDetail.js +1 -0
  146. package/dist/flows/deposit/widgets/activity/DepositActivityList.d.ts +38 -0
  147. package/dist/flows/deposit/widgets/activity/DepositActivityList.js +1 -0
  148. package/dist/flows/deposit/widgets/activity/index.d.ts +2 -0
  149. package/dist/flows/deposit/widgets/activity/index.js +1 -0
  150. package/dist/flows/deposit/widgets/activity/useDepositActivitySource.js +1 -0
  151. package/dist/flows/deposit/widgets/amount-entry/AmountEntry.d.ts +32 -5
  152. package/dist/flows/deposit/widgets/amount-entry/AmountEntry.js +1 -1
  153. package/dist/flows/deposit/widgets/amount-entry/footerIntent.js +1 -0
  154. package/dist/flows/deposit/widgets/asset-picker/AssetPicker.d.ts +24 -4
  155. package/dist/flows/deposit/widgets/asset-picker/AssetPicker.js +1 -1
  156. package/dist/flows/deposit/widgets/confirm-deposit/ConfirmDeposit.d.ts +37 -4
  157. package/dist/flows/deposit/widgets/confirm-deposit/ConfirmDeposit.js +1 -1
  158. package/dist/flows/deposit/widgets/deposit/Deposit.d.ts +39 -4
  159. package/dist/flows/deposit/widgets/deposit/Deposit.js +1 -1
  160. package/dist/flows/deposit/widgets/deposit/compound/Deposit.d.ts +58 -1
  161. package/dist/flows/deposit/widgets/deposit/compound/Deposit.js +1 -1
  162. package/dist/flows/deposit/widgets/deposit/compound/Deposit.slots.d.ts +6 -0
  163. package/dist/flows/deposit/widgets/deposit/compound/Deposit.slots.js +1 -1
  164. package/dist/flows/deposit/widgets/deposit/compound/Deposit.styles.js +1 -1
  165. package/dist/flows/deposit/widgets/deposit/compound/components/Boundary.d.ts +29 -0
  166. package/dist/flows/deposit/widgets/deposit/compound/components/Boundary.js +1 -0
  167. package/dist/flows/deposit/widgets/deposit/compound/components/Guards.d.ts +28 -0
  168. package/dist/flows/deposit/widgets/deposit/compound/components/Guards.js +1 -0
  169. package/dist/flows/deposit/widgets/deposit/compound/components/Header.d.ts +11 -0
  170. package/dist/flows/deposit/widgets/deposit/compound/components/Header.js +1 -1
  171. package/dist/flows/deposit/widgets/deposit/compound/components/Method.d.ts +7 -0
  172. package/dist/flows/deposit/widgets/deposit/compound/components/Method.js +1 -1
  173. package/dist/flows/deposit/widgets/deposit/compound/components/MethodSection.d.ts +40 -0
  174. package/dist/flows/deposit/widgets/deposit/compound/components/MethodSection.js +1 -0
  175. package/dist/flows/deposit/widgets/deposit/compound/components/Methods.d.ts +15 -9
  176. package/dist/flows/deposit/widgets/deposit/compound/components/Methods.js +1 -1
  177. package/dist/flows/deposit/widgets/deposit/compound/components/Rail.d.ts +18 -0
  178. package/dist/flows/deposit/widgets/deposit/compound/components/Rail.js +1 -0
  179. package/dist/flows/deposit/widgets/deposit/compound/components/RailPicker.d.ts +43 -0
  180. package/dist/flows/deposit/widgets/deposit/compound/components/RailPicker.js +1 -0
  181. package/dist/flows/deposit/widgets/deposit/compound/components/Steps.d.ts +24 -0
  182. package/dist/flows/deposit/widgets/deposit/compound/components/Steps.js +1 -0
  183. package/dist/flows/deposit/widgets/deposit/compound/index.d.ts +2 -1
  184. package/dist/flows/deposit/widgets/deposit/compound/types.d.ts +106 -4
  185. package/dist/flows/deposit/widgets/deposit-status-banner/DepositStatusBanner.d.ts +41 -1
  186. package/dist/flows/deposit/widgets/deposit-status-banner/DepositStatusBanner.js +1 -1
  187. package/dist/flows/deposit/widgets/deposit-status-banner/compound/DepositStatusBanner.js +1 -1
  188. package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Hero.js +1 -1
  189. package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/PrimaryAction.js +1 -1
  190. package/dist/flows/deposit/widgets/deposit-status-banner/compound/types.d.ts +5 -5
  191. package/dist/flows/deposit/widgets/error-state/ErrorState.d.ts +39 -4
  192. package/dist/flows/deposit/widgets/error-state/ErrorState.js +1 -1
  193. package/dist/flows/deposit/widgets/onramp-amount-entry/OnrampAmountEntry.d.ts +64 -0
  194. package/dist/flows/deposit/widgets/onramp-amount-entry/OnrampAmountEntry.js +1 -0
  195. package/dist/flows/deposit/widgets/onramp-amount-entry/compound/OnrampAmountEntry.d.ts +62 -0
  196. package/dist/flows/deposit/widgets/onramp-amount-entry/compound/OnrampAmountEntry.js +1 -0
  197. package/dist/flows/deposit/widgets/onramp-amount-entry/compound/OnrampAmountEntry.slots.d.ts +14 -0
  198. package/dist/flows/deposit/widgets/onramp-amount-entry/compound/OnrampAmountEntry.slots.js +1 -0
  199. package/dist/flows/deposit/widgets/onramp-amount-entry/compound/OnrampAmountEntry.styles.js +1 -0
  200. package/dist/flows/deposit/widgets/onramp-amount-entry/compound/components/HeroLabel.d.ts +13 -0
  201. package/dist/flows/deposit/widgets/onramp-amount-entry/compound/components/HeroLabel.js +1 -0
  202. package/dist/flows/deposit/widgets/onramp-amount-entry/compound/components/ReceiveChip.d.ts +14 -0
  203. package/dist/flows/deposit/widgets/onramp-amount-entry/compound/components/ReceiveChip.js +1 -0
  204. package/dist/flows/deposit/widgets/onramp-amount-entry/compound/context.js +1 -0
  205. package/dist/flows/deposit/widgets/onramp-amount-entry/compound/index.d.ts +3 -0
  206. package/dist/flows/deposit/widgets/onramp-amount-entry/compound/index.js +1 -0
  207. package/dist/flows/deposit/widgets/onramp-amount-entry/compound/types.d.ts +29 -0
  208. package/dist/flows/deposit/widgets/onramp-amount-entry/index.d.ts +1 -0
  209. package/dist/flows/deposit/widgets/onramp-amount-entry/index.js +1 -0
  210. package/dist/flows/deposit/widgets/onramp-confirm/OnrampConfirm.d.ts +50 -0
  211. package/dist/flows/deposit/widgets/onramp-confirm/OnrampConfirm.js +1 -0
  212. package/dist/flows/deposit/widgets/onramp-confirm/compound/OnrampConfirm.d.ts +42 -0
  213. package/dist/flows/deposit/widgets/onramp-confirm/compound/OnrampConfirm.js +1 -0
  214. package/dist/flows/deposit/widgets/onramp-confirm/compound/OnrampConfirm.slots.d.ts +24 -0
  215. package/dist/flows/deposit/widgets/onramp-confirm/compound/OnrampConfirm.slots.js +1 -0
  216. package/dist/flows/deposit/widgets/onramp-confirm/compound/OnrampConfirm.styles.js +1 -0
  217. package/dist/flows/deposit/widgets/onramp-confirm/compound/components/Body.d.ts +16 -0
  218. package/dist/flows/deposit/widgets/onramp-confirm/compound/components/Body.js +1 -0
  219. package/dist/flows/deposit/widgets/onramp-confirm/compound/components/Header.d.ts +15 -0
  220. package/dist/flows/deposit/widgets/onramp-confirm/compound/components/Header.js +1 -0
  221. package/dist/flows/deposit/widgets/onramp-confirm/compound/components/Summary.d.ts +15 -0
  222. package/dist/flows/deposit/widgets/onramp-confirm/compound/components/Summary.js +1 -0
  223. package/dist/flows/deposit/widgets/onramp-confirm/compound/context.d.ts +25 -0
  224. package/dist/flows/deposit/widgets/onramp-confirm/compound/context.js +1 -0
  225. package/dist/flows/deposit/widgets/onramp-confirm/compound/index.d.ts +4 -0
  226. package/dist/flows/deposit/widgets/onramp-confirm/compound/index.js +1 -0
  227. package/dist/flows/deposit/widgets/onramp-confirm/compound/types.d.ts +62 -0
  228. package/dist/flows/deposit/widgets/onramp-confirm/index.d.ts +1 -0
  229. package/dist/flows/deposit/widgets/onramp-confirm/index.js +1 -0
  230. package/dist/flows/deposit/widgets/onramp-payment-pending/OnrampPaymentPending.d.ts +48 -0
  231. package/dist/flows/deposit/widgets/onramp-payment-pending/OnrampPaymentPending.js +1 -0
  232. package/dist/flows/deposit/widgets/onramp-payment-pending/compound/OnrampPaymentPending.d.ts +63 -0
  233. package/dist/flows/deposit/widgets/onramp-payment-pending/compound/OnrampPaymentPending.js +1 -0
  234. package/dist/flows/deposit/widgets/onramp-payment-pending/compound/OnrampPaymentPending.slots.d.ts +14 -0
  235. package/dist/flows/deposit/widgets/onramp-payment-pending/compound/OnrampPaymentPending.slots.js +1 -0
  236. package/dist/flows/deposit/widgets/onramp-payment-pending/compound/components/ReopenButton.d.ts +11 -0
  237. package/dist/flows/deposit/widgets/onramp-payment-pending/compound/components/ReopenButton.js +1 -0
  238. package/dist/flows/deposit/widgets/onramp-payment-pending/compound/context.js +1 -0
  239. package/dist/flows/deposit/widgets/onramp-payment-pending/compound/index.d.ts +2 -0
  240. package/dist/flows/deposit/widgets/onramp-payment-pending/compound/index.js +1 -0
  241. package/dist/flows/deposit/widgets/onramp-payment-pending/index.d.ts +1 -0
  242. package/dist/flows/deposit/widgets/onramp-payment-pending/index.js +1 -0
  243. package/dist/flows/deposit/widgets/processing-state/ProcessingState.d.ts +30 -4
  244. package/dist/flows/deposit/widgets/processing-state/ProcessingState.js +1 -1
  245. package/dist/flows/deposit/widgets/success-state/SuccessState.d.ts +38 -4
  246. package/dist/flows/deposit/widgets/success-state/SuccessState.js +1 -1
  247. package/dist/flows/deposit/widgets/transfer-crypto/TransferCrypto.d.ts +34 -3
  248. package/dist/flows/deposit/widgets/transfer-crypto/TransferCrypto.js +1 -1
  249. package/dist/flows/deposit/widgets/transfer-crypto/compound/TransferCrypto.d.ts +1 -1
  250. package/dist/flows/deposit/widgets/transfer-crypto/compound/TransferCrypto.styles.js +1 -1
  251. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Address.js +1 -1
  252. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Disclosure.d.ts +5 -2
  253. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Disclosure.js +1 -1
  254. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Header.d.ts +6 -0
  255. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Header.js +1 -1
  256. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/QrCode.d.ts +4 -10
  257. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/QrCode.js +1 -1
  258. package/dist/flows/deposit/widgets/transfer-crypto/compound/types.d.ts +16 -2
  259. package/dist/flows/shared/transformers/computeQuoteAttrs.d.ts +1 -0
  260. package/dist/flows/shared/transformers/index.d.ts +1 -0
  261. package/dist/flows/shared/transformers/pickRelevantSettlement.d.ts +1 -0
  262. package/dist/flows/shared/transformers/pickRelevantSettlement.js +1 -1
  263. package/dist/flows/shared/transformers/testnets.js +1 -0
  264. package/dist/flows/withdraw/bindings/WithdrawBindings.d.ts +92 -0
  265. package/dist/flows/withdraw/bindings/WithdrawBindings.js +1 -0
  266. package/dist/flows/withdraw/bindings/index.d.ts +1 -0
  267. package/dist/flows/withdraw/bindings/index.js +1 -0
  268. package/dist/flows/withdraw/dialog/WithdrawDialog.d.ts +44 -71
  269. package/dist/flows/withdraw/dialog/WithdrawDialog.js +1 -1
  270. package/dist/flows/withdraw/driver/dto.d.ts +8 -7
  271. package/dist/flows/withdraw/driver/payloads.d.ts +16 -1
  272. package/dist/flows/withdraw/driver/transformers/settlementToWithdrawalPayload.js +1 -1
  273. package/dist/flows/withdraw/driver/transformers/supportedAssetsToReceiveOptionsPayload.js +1 -1
  274. package/dist/flows/withdraw/driver/types.d.ts +77 -14
  275. package/dist/flows/withdraw/orchestrator/controller.js +1 -1
  276. package/dist/flows/withdraw/orchestrator/index.d.ts +1 -1
  277. package/dist/flows/withdraw/orchestrator/reducer.js +1 -1
  278. package/dist/flows/withdraw/orchestrator/types.d.ts +218 -35
  279. package/dist/flows/withdraw/orchestrator/useWithdraw.d.ts +36 -1
  280. package/dist/flows/withdraw/orchestrator/useWithdraw.js +1 -1
  281. package/dist/flows/withdraw/widgets/activity/WithdrawActivityDetail.d.ts +39 -0
  282. package/dist/flows/withdraw/widgets/activity/WithdrawActivityDetail.js +1 -0
  283. package/dist/flows/withdraw/widgets/activity/WithdrawActivityList.d.ts +36 -0
  284. package/dist/flows/withdraw/widgets/activity/WithdrawActivityList.js +1 -0
  285. package/dist/flows/withdraw/widgets/activity/index.d.ts +2 -0
  286. package/dist/flows/withdraw/widgets/activity/index.js +1 -0
  287. package/dist/flows/withdraw/widgets/activity/useWithdrawActivitySource.js +1 -0
  288. package/dist/flows/withdraw/widgets/withdraw/compound/Withdraw.d.ts +60 -0
  289. package/dist/flows/withdraw/widgets/withdraw/compound/Withdraw.js +1 -0
  290. package/dist/flows/withdraw/widgets/withdraw/compound/Withdraw.slots.d.ts +13 -0
  291. package/dist/flows/withdraw/widgets/withdraw/compound/Withdraw.slots.js +1 -0
  292. package/dist/flows/withdraw/widgets/withdraw/compound/components/Boundary.d.ts +29 -0
  293. package/dist/flows/withdraw/widgets/withdraw/compound/components/Boundary.js +1 -0
  294. package/dist/flows/withdraw/widgets/withdraw/compound/components/Guards.d.ts +25 -0
  295. package/dist/flows/withdraw/widgets/withdraw/compound/components/Guards.js +1 -0
  296. package/dist/flows/withdraw/widgets/withdraw/compound/components/Steps.d.ts +27 -0
  297. package/dist/flows/withdraw/widgets/withdraw/compound/components/Steps.js +1 -0
  298. package/dist/flows/withdraw/widgets/withdraw/compound/index.d.ts +3 -0
  299. package/dist/flows/withdraw/widgets/withdraw/compound/index.js +1 -0
  300. package/dist/flows/withdraw/widgets/withdraw-error/WithdrawError.d.ts +45 -2
  301. package/dist/flows/withdraw/widgets/withdraw-error/WithdrawError.js +1 -1
  302. package/dist/flows/withdraw/widgets/withdraw-form/WithdrawForm.d.ts +32 -12
  303. package/dist/flows/withdraw/widgets/withdraw-form/WithdrawForm.js +1 -1
  304. package/dist/flows/withdraw/widgets/withdraw-form/compound/WithdrawForm.js +1 -1
  305. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Body.d.ts +7 -6
  306. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Header.d.ts +6 -1
  307. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Header.js +1 -1
  308. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/RecipientField.d.ts +7 -5
  309. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/RecipientField.js +1 -1
  310. package/dist/flows/withdraw/widgets/withdraw-form/compound/types.d.ts +15 -5
  311. package/dist/flows/withdraw/widgets/withdraw-form/validation.js +1 -1
  312. package/dist/flows/withdraw/widgets/withdraw-in-progress/WithdrawInProgress.d.ts +39 -3
  313. package/dist/flows/withdraw/widgets/withdraw-in-progress/WithdrawInProgress.js +1 -1
  314. package/dist/flows/withdraw/widgets/withdraw-success/WithdrawSuccess.d.ts +46 -2
  315. package/dist/flows/withdraw/widgets/withdraw-success/WithdrawSuccess.js +1 -1
  316. package/dist/format/index.d.ts +2 -1
  317. package/dist/format/index.js +1 -1
  318. package/dist/i18n/index.d.ts +5 -4
  319. package/dist/i18n/index.js +1 -1
  320. package/dist/i18n/locales/ar.js +1 -1
  321. package/dist/i18n/locales/es.js +1 -1
  322. package/dist/i18n/locales/source-keys.d.ts +12 -0
  323. package/dist/i18n/locales/source-keys.js +0 -0
  324. package/dist/icons/index.d.ts +5 -1
  325. package/dist/icons/index.js +1 -1
  326. package/dist/index.d.ts +35 -11
  327. package/dist/index.js +1 -1
  328. package/dist/package.js +1 -1
  329. package/dist/scope/KitPortalScope.js +1 -1
  330. package/dist/scope/KitScope.d.ts +27 -1
  331. package/dist/scope/KitScope.js +1 -1
  332. package/dist/scope/context.d.ts +24 -1
  333. package/dist/scope/index.d.ts +1 -1
  334. package/dist/shared/attribution/Attribution.js +1 -0
  335. package/dist/shared/attribution/Attribution.slots.js +1 -0
  336. package/dist/shared/attribution/Attribution.styles.js +1 -0
  337. package/dist/shared/attribution/index.js +1 -0
  338. package/dist/shared/chains/index.d.ts +48 -29
  339. package/dist/shared/chains/index.js +1 -1
  340. package/dist/shared/constants/brand-intercom.js +1 -0
  341. package/dist/shared/cuer/Cuer.js +1 -1
  342. package/dist/shared/dialog/DialogShell.d.ts +21 -6
  343. package/dist/shared/dialog/DialogShell.js +1 -1
  344. package/dist/shared/dialog/Frame.js +1 -1
  345. package/dist/shared/dialog/LoadingState.js +1 -0
  346. package/dist/shared/dialog/LoadingState.styles.js +1 -0
  347. package/dist/shared/dialog/StepTransition.js +1 -1
  348. package/dist/shared/dialog/useDirectionalChevronTransform.js +1 -1
  349. package/dist/shared/driver/types.d.ts +4 -3
  350. package/dist/shared/format/formatSmartRelative.d.ts +25 -0
  351. package/dist/shared/format/formatSmartRelative.js +1 -0
  352. package/dist/shared/format/formatUsd.js +1 -1
  353. package/dist/shared/i18n/KitI18nProvider.d.ts +11 -8
  354. package/dist/shared/i18n/KitI18nProvider.js +1 -1
  355. package/dist/shared/i18n/createKitI18n.d.ts +79 -16
  356. package/dist/shared/i18n/createKitI18n.js +1 -1
  357. package/dist/shared/i18n/useLingui.d.ts +11 -3
  358. package/dist/shared/icons/ActivityIcon.d.ts +12 -0
  359. package/dist/shared/icons/ActivityIcon.js +1 -0
  360. package/dist/shared/icons/BitcoinIcon.d.ts +14 -0
  361. package/dist/shared/icons/BitcoinIcon.js +1 -0
  362. package/dist/shared/icons/CardIcon.d.ts +16 -0
  363. package/dist/shared/icons/CardIcon.js +1 -0
  364. package/dist/shared/icons/LogoIcon.d.ts +13 -0
  365. package/dist/shared/icons/LogoIcon.js +1 -0
  366. package/dist/shared/merchant-link/MerchantLink.d.ts +1 -0
  367. package/dist/shared/merchant-link/MerchantLink.js +1 -0
  368. package/dist/shared/merchant-link/MerchantLinkButton.d.ts +1 -0
  369. package/dist/shared/merchant-link/MerchantLinkButton.js +1 -0
  370. package/dist/shared/merchant-link/index.d.ts +1 -0
  371. package/dist/shared/merchant-link/index.js +1 -0
  372. package/dist/shared/merchant-link/resolveMerchantLink.js +1 -0
  373. package/dist/shared/orchestrator/activityOpenInput.d.ts +21 -0
  374. package/dist/shared/orchestrator/createActivityReducers.js +1 -0
  375. package/dist/shared/orchestrator/index.d.ts +2 -0
  376. package/dist/shared/orchestrator/index.js +1 -1
  377. package/dist/shared/orchestrator/resolveActivityEntry.d.ts +1 -0
  378. package/dist/shared/orchestrator/resolveActivityEntry.js +1 -0
  379. package/dist/shared/orchestrator/toFailure.js +1 -1
  380. package/dist/shared/orchestrator/types.d.ts +8 -0
  381. package/dist/shared/orchestrator/useOnrampSessionWatcher.js +1 -0
  382. package/dist/shared/orchestrator/useSettlementWatcher.js +1 -1
  383. package/dist/shared/presentation/index.js +1 -0
  384. package/dist/shared/presentation/types.d.ts +30 -0
  385. package/dist/shared/presentation/types.js +1 -0
  386. package/dist/shared/presentation/useResolvedSurfaceKind.js +1 -0
  387. package/dist/shared/primitives/TxHashValue/TxHashValue.js +1 -1
  388. package/dist/shared/support/SupportConfigContext.d.ts +1 -0
  389. package/dist/shared/support/SupportConfigContext.js +1 -0
  390. package/dist/shared/support/SupportLink.d.ts +1 -0
  391. package/dist/shared/support/SupportLink.js +1 -0
  392. package/dist/shared/support/SupportSpinner.d.ts +1 -0
  393. package/dist/shared/support/SupportSpinner.js +1 -0
  394. package/dist/shared/support/index.d.ts +2 -0
  395. package/dist/shared/support/index.js +1 -0
  396. package/dist/shared/support/intercom-loader.d.ts +17 -0
  397. package/dist/shared/support/intercom-loader.js +1 -0
  398. package/dist/shared/support/types.d.ts +43 -0
  399. package/dist/shared/support/useIntercomMerchantContext.d.ts +27 -0
  400. package/dist/shared/support/useIntercomMerchantContext.js +1 -0
  401. package/dist/shared/support/useIntercomShutdownOnUnmount.js +1 -0
  402. package/dist/shared/support/useMerchantContext.d.ts +1 -0
  403. package/dist/shared/support/useMerchantContext.js +1 -0
  404. package/dist/shared/support/useSupportTrigger.js +1 -0
  405. package/dist/shared/terms/TermsConfigContext.d.ts +1 -0
  406. package/dist/shared/terms/TermsConfigContext.js +1 -0
  407. package/dist/shared/terms/TermsLink.d.ts +1 -0
  408. package/dist/shared/terms/TermsLink.js +1 -0
  409. package/dist/shared/terms/index.d.ts +1 -0
  410. package/dist/shared/terms/index.js +1 -0
  411. package/dist/shared/terms/types.d.ts +43 -0
  412. package/dist/shared/ui/AdaptiveSurface/AdaptiveSurface.d.ts +52 -0
  413. package/dist/shared/ui/AdaptiveSurface/AdaptiveSurface.js +1 -0
  414. package/dist/shared/ui/AdaptiveSurface/index.d.ts +2 -0
  415. package/dist/shared/ui/AdaptiveSurface/index.js +1 -0
  416. package/dist/shared/ui/Card/Card.d.ts +12 -9
  417. package/dist/shared/ui/Card/Card.js +1 -1
  418. package/dist/shared/ui/Card/Card.styles.js +1 -1
  419. package/dist/shared/ui/Details/Details.d.ts +9 -1
  420. package/dist/shared/ui/Details/Details.styles.js +1 -1
  421. package/dist/shared/ui/Dialog/Dialog.d.ts +10 -8
  422. package/dist/shared/ui/Dialog/Dialog.js +1 -1
  423. package/dist/shared/ui/Dialog/Dialog.styles.js +1 -1
  424. package/dist/shared/ui/Drawer/Drawer.d.ts +135 -0
  425. package/dist/shared/ui/Drawer/Drawer.js +1 -0
  426. package/dist/shared/ui/Drawer/Drawer.slots.d.ts +19 -0
  427. package/dist/shared/ui/Drawer/Drawer.slots.js +1 -0
  428. package/dist/shared/ui/Drawer/Drawer.styles.js +1 -0
  429. package/dist/shared/ui/Drawer/index.d.ts +2 -0
  430. package/dist/shared/ui/Drawer/index.js +1 -0
  431. package/dist/shared/ui/Select/Select.js +1 -1
  432. package/dist/shared/ui/SelectableTile/SelectableTile.d.ts +21 -8
  433. package/dist/shared/ui/SelectableTile/SelectableTile.js +1 -1
  434. package/dist/shared/ui/Steps/Steps.d.ts +52 -0
  435. package/dist/shared/ui/Steps/Steps.js +1 -0
  436. package/dist/shared/ui/Steps/Steps.slots.d.ts +7 -0
  437. package/dist/shared/ui/Steps/Steps.slots.js +1 -0
  438. package/dist/shared/ui/Steps/Steps.styles.js +1 -0
  439. package/dist/shared/ui/Steps/index.d.ts +2 -0
  440. package/dist/shared/ui/Steps/index.js +1 -0
  441. package/dist/shared/ui/Tabs/Tabs.d.ts +79 -0
  442. package/dist/shared/ui/Tabs/Tabs.js +1 -0
  443. package/dist/shared/ui/Tabs/Tabs.slots.d.ts +11 -0
  444. package/dist/shared/ui/Tabs/Tabs.slots.js +1 -0
  445. package/dist/shared/ui/Tabs/Tabs.styles.js +1 -0
  446. package/dist/shared/ui/Tabs/index.d.ts +2 -0
  447. package/dist/shared/ui/Tabs/index.js +1 -0
  448. package/dist/shared/ui/WalletRow/WalletRow.d.ts +1 -1
  449. package/dist/shared/ui/WalletRow/WalletRow.js +1 -1
  450. package/dist/shared/ui/surfaceContext.d.ts +9 -0
  451. package/dist/shared/ui/surfaceContext.js +1 -0
  452. package/dist/shared/utils/assertNever.js +1 -0
  453. package/dist/shared/utils/logos/types.d.ts +1 -1
  454. package/dist/shared/utils/useDeepMemo.js +1 -0
  455. package/dist/shared/wallet/ConnectWalletContext.d.ts +17 -0
  456. package/dist/shared/wallet/ConnectWalletContext.js +1 -0
  457. package/dist/shared/widgets/activity/ActivityTrigger.js +1 -0
  458. package/dist/shared/widgets/activity/ActivityTrigger.styles.js +1 -0
  459. package/dist/shared/widgets/activity/adapters/settlementToWidgetProps.js +1 -0
  460. package/dist/shared/widgets/activity/compound/Activity.d.ts +95 -0
  461. package/dist/shared/widgets/activity/compound/Activity.js +1 -0
  462. package/dist/shared/widgets/activity/compound/Activity.slots.d.ts +22 -0
  463. package/dist/shared/widgets/activity/compound/Activity.slots.js +1 -0
  464. package/dist/shared/widgets/activity/compound/Activity.styles.js +1 -0
  465. package/dist/shared/widgets/activity/compound/ActivityDetail.d.ts +82 -0
  466. package/dist/shared/widgets/activity/compound/ActivityDetail.js +1 -0
  467. package/dist/shared/widgets/activity/compound/Row.slots.d.ts +21 -0
  468. package/dist/shared/widgets/activity/compound/Row.slots.js +1 -0
  469. package/dist/shared/widgets/activity/compound/Row.styles.js +1 -0
  470. package/dist/shared/widgets/activity/compound/components/ActivityHeader.d.ts +39 -0
  471. package/dist/shared/widgets/activity/compound/components/ActivityHeader.js +1 -0
  472. package/dist/shared/widgets/activity/compound/components/Empty.d.ts +15 -0
  473. package/dist/shared/widgets/activity/compound/components/Empty.js +1 -0
  474. package/dist/shared/widgets/activity/compound/components/ErrorView.d.ts +26 -0
  475. package/dist/shared/widgets/activity/compound/components/ErrorView.js +1 -0
  476. package/dist/shared/widgets/activity/compound/components/List.d.ts +23 -0
  477. package/dist/shared/widgets/activity/compound/components/List.js +1 -0
  478. package/dist/shared/widgets/activity/compound/components/Row.d.ts +51 -0
  479. package/dist/shared/widgets/activity/compound/components/Row.js +1 -0
  480. package/dist/shared/widgets/activity/compound/components/StatusPip.js +1 -0
  481. package/dist/shared/widgets/activity/compound/context.d.ts +95 -0
  482. package/dist/shared/widgets/activity/compound/context.js +1 -0
  483. package/dist/shared/widgets/activity/compound/index.d.ts +8 -0
  484. package/dist/shared/widgets/activity/compound/index.js +1 -0
  485. package/dist/shared/widgets/activity/index.js +1 -0
  486. package/dist/shared/widgets/activity/payloads.d.ts +108 -0
  487. package/dist/shared/widgets/activity/transformers/activityResponseToPayload.js +1 -0
  488. package/dist/shared/widgets/activity/transformers/resolveDirection.js +1 -0
  489. package/dist/shared/widgets/amount-entry/compound/AmountEntry.d.ts +10 -2
  490. package/dist/shared/widgets/amount-entry/compound/AmountEntry.js +1 -1
  491. package/dist/shared/widgets/amount-entry/compound/AmountEntry.slots.d.ts +6 -0
  492. package/dist/shared/widgets/amount-entry/compound/AmountEntry.slots.js +1 -1
  493. package/dist/shared/widgets/amount-entry/compound/AmountEntry.styles.js +1 -1
  494. package/dist/shared/widgets/amount-entry/compound/components/Details.d.ts +34 -0
  495. package/dist/shared/widgets/amount-entry/compound/components/Details.js +1 -0
  496. package/dist/shared/widgets/amount-entry/compound/components/Footer.d.ts +2 -1
  497. package/dist/shared/widgets/amount-entry/compound/components/Footer.js +1 -1
  498. package/dist/shared/widgets/amount-entry/compound/components/Header.d.ts +6 -1
  499. package/dist/shared/widgets/amount-entry/compound/components/Header.js +1 -1
  500. package/dist/shared/widgets/amount-entry/compound/components/Hero/Hero.js +1 -1
  501. package/dist/shared/widgets/amount-entry/compound/components/Hero/SwapBackdrop.js +1 -1
  502. package/dist/shared/widgets/amount-entry/compound/components/Notice.d.ts +7 -0
  503. package/dist/shared/widgets/amount-entry/compound/components/Notice.js +1 -0
  504. package/dist/shared/widgets/amount-entry/compound/index.d.ts +1 -1
  505. package/dist/shared/widgets/amount-entry/compound/types.d.ts +69 -3
  506. package/dist/shared/widgets/asset-picker/compound/AssetPicker.d.ts +3 -0
  507. package/dist/shared/widgets/asset-picker/compound/AssetPicker.js +1 -1
  508. package/dist/shared/widgets/asset-picker/compound/AssetPicker.slots.d.ts +2 -0
  509. package/dist/shared/widgets/asset-picker/compound/AssetPicker.slots.js +1 -1
  510. package/dist/shared/widgets/asset-picker/compound/AssetPicker.styles.js +1 -1
  511. package/dist/shared/widgets/asset-picker/compound/components/Asset.d.ts +7 -1
  512. package/dist/shared/widgets/asset-picker/compound/components/Asset.js +1 -1
  513. package/dist/shared/widgets/asset-picker/compound/components/Empty.d.ts +15 -0
  514. package/dist/shared/widgets/asset-picker/compound/components/Empty.js +1 -0
  515. package/dist/shared/widgets/asset-picker/compound/components/Header.d.ts +6 -1
  516. package/dist/shared/widgets/asset-picker/compound/components/Header.js +1 -1
  517. package/dist/shared/widgets/asset-picker/compound/types.d.ts +15 -1
  518. package/dist/shared/widgets/confirm-transfer/compound/ConfirmTransfer.styles.js +1 -1
  519. package/dist/shared/widgets/confirm-transfer/compound/components/Breakdown.js +1 -1
  520. package/dist/shared/widgets/confirm-transfer/compound/components/Disclaimer.d.ts +4 -3
  521. package/dist/shared/widgets/confirm-transfer/compound/components/Disclaimer.js +1 -1
  522. package/dist/shared/widgets/confirm-transfer/compound/components/QuoteTimer.js +1 -1
  523. package/dist/shared/widgets/error-state/compound/components/AssetValue.js +1 -1
  524. package/dist/shared/widgets/error-state/compound/components/HelpInfo.js +1 -1
  525. package/dist/shared/widgets/error-state/compound/components/MoreDetails.d.ts +1 -1
  526. package/dist/shared/widgets/error-state/compound/components/MoreDetails.js +1 -1
  527. package/dist/shared/widgets/error-state/compound/components/StatusValue.js +1 -1
  528. package/dist/shared/widgets/processing-state/compound/ProcessingState.d.ts +1 -5
  529. package/dist/shared/widgets/processing-state/compound/ProcessingState.js +1 -1
  530. package/dist/shared/widgets/processing-state/compound/ProcessingState.slots.d.ts +0 -1
  531. package/dist/shared/widgets/processing-state/compound/ProcessingState.slots.js +1 -1
  532. package/dist/shared/widgets/processing-state/compound/ProcessingState.styles.js +1 -1
  533. package/dist/shared/widgets/processing-state/compound/components/Details.d.ts +6 -1
  534. package/dist/shared/widgets/processing-state/compound/components/Details.js +1 -1
  535. package/dist/shared/widgets/processing-state/compound/components/Header.d.ts +4 -3
  536. package/dist/shared/widgets/processing-state/compound/components/Header.js +1 -1
  537. package/dist/shared/widgets/processing-state/compound/components/Hero.d.ts +14 -7
  538. package/dist/shared/widgets/processing-state/compound/components/Hero.js +1 -1
  539. package/dist/shared/widgets/processing-state/compound/components/Rows.js +1 -1
  540. package/dist/shared/widgets/processing-state/compound/components/StatusPill.js +1 -1
  541. package/dist/shared/widgets/processing-state/compound/components/splitAmount.js +1 -0
  542. package/dist/shared/widgets/processing-state/compound/index.d.ts +1 -1
  543. package/dist/shared/widgets/processing-state/compound/types.d.ts +11 -29
  544. package/dist/shared/widgets/success-state/compound/components/Actions.js +1 -1
  545. package/dist/shared/widgets/success-state/compound/components/AssetValue.js +1 -1
  546. package/dist/shared/widgets/success-state/compound/components/MoreDetails.d.ts +1 -1
  547. package/dist/shared/widgets/success-state/compound/components/MoreDetails.js +1 -1
  548. package/dist/shared/widgets/success-state/compound/components/RouteValue.js +1 -1
  549. package/dist/shared/widgets/success-state/compound/components/StatusPill.js +1 -1
  550. package/dist/shared/widgets/success-state/compound/types.d.ts +5 -5
  551. package/dist/storage/context.d.ts +9 -1
  552. package/dist/storage/context.js +1 -1
  553. package/dist/storage/index.d.ts +1 -1
  554. package/dist/stridge/StridgeProvider.d.ts +177 -35
  555. package/dist/stridge/StridgeProvider.js +1 -1
  556. package/dist/stridge/depositOwner.js +1 -0
  557. package/dist/stridge/optionalWagmi.js +1 -0
  558. package/dist/stridge/stubs.js +1 -1
  559. package/dist/styles/index.css +567 -12
  560. package/dist/types.d.ts +8 -6
  561. package/dist/ui/index.d.ts +9 -1
  562. package/dist/ui/index.js +1 -1
  563. package/dist/version.d.ts +10 -0
  564. package/dist/version.js +1 -0
  565. package/dist/withdraw/compound/index.d.ts +11 -8
  566. package/dist/withdraw/compound/index.js +1 -1
  567. package/dist/withdraw/dialog/index.d.ts +4 -1
  568. package/dist/withdraw/widgets/index.d.ts +7 -0
  569. package/dist/withdraw/widgets/index.js +1 -0
  570. package/package.json +31 -7
  571. package/dist/_internal/deposit/widgets/index.d.ts +0 -11
  572. package/dist/_internal/deposit/widgets/index.js +0 -1
  573. package/dist/_internal/withdraw/widgets/index.d.ts +0 -5
  574. package/dist/_internal/withdraw/widgets/index.js +0 -1
  575. package/dist/flows/withdraw/dialog/WithdrawDialogEventsContext.d.ts +0 -36
  576. package/dist/flows/withdraw/dialog/WithdrawDialogEventsContext.js +0 -1
  577. package/dist/shared/widgets/processing-state/compound/components/Actions.d.ts +0 -17
  578. package/dist/shared/widgets/processing-state/compound/components/Actions.js +0 -1
  579. package/dist/stridge/StridgeContext.d.ts +0 -29
  580. package/dist/stridge/StridgeContext.js +0 -1
@@ -1,4 +1,5 @@
1
1
  import { Entity, SettlementFailureKind, TxRef } from "../../../shared/driver/types.js";
2
+ import { FormattedField } from "../../../shared/format/types.js";
2
3
  import { ReceiveOptionDto, ReceiveOptionsResponse, WithdrawableBalanceDto, WithdrawableBalancesResponse, WithdrawalQuoteDto, WithdrawalQuoteResponse, WithdrawalSettlementDto, WithdrawalSettlementResponse } from "./dto.js";
3
4
  import { ReceiveChainPayload, ReceiveTokenOptionPayload, WithdrawableBalanceItemPayload, WithdrawalQuoteBreakdownPayload, WithdrawalQuotePayload, WithdrawalReceiveAssetPayload, WithdrawalSettlementFailurePayload, WithdrawalSettlementPayload, WithdrawalSettlementPendingPayload, WithdrawalSettlementSuccessPayload } from "./payloads.js";
4
5
 
@@ -8,8 +9,9 @@ import { ReceiveChainPayload, ReceiveTokenOptionPayload, WithdrawableBalanceItem
8
9
  * {@link WithdrawDriver.getSnapshot} and consumed by `useSyncExternalStore`. The kit's
9
10
  * `useWithdrawSnapshot()` hook returns this shape.
10
11
  *
11
- * Each field is an {@link Entity} envelope — components switch on `status` and read `payload` on
12
- * the `ready` / `stale` variants.
12
+ * Most fields are {@link Entity} envelopes — components switch on `status` and read `payload` on
13
+ * the `ready` / `stale` variants. The optional `minAmountUsd` / `maxAmountUsd` carry static
14
+ * config-derived USD bounds (set once at driver construction) and stay outside the entity model.
13
15
  */
14
16
  interface WithdrawSnapshot {
15
17
  /**
@@ -23,7 +25,7 @@ interface WithdrawSnapshot {
23
25
  withdrawableBalances: Entity<ReadonlyArray<WithdrawableBalanceItemPayload>, WithdrawableBalancesResponse, WithdrawableBalancesResponse>;
24
26
  /**
25
27
  * Per-chain catalog of routable receive destinations. Drives the form's "Receive chain" /
26
- * "Receive token" pickers. Derived from `Uda.supportedAssets()`.
28
+ * "Receive token" pickers. Derived from `Gateway.assets()`.
27
29
  */
28
30
  receiveOptions: Entity<ReadonlyArray<ReceiveChainPayload>, ReadonlyArray<ReceiveOptionDto>, ReceiveOptionsResponse>;
29
31
  /**
@@ -37,6 +39,18 @@ interface WithdrawSnapshot {
37
39
  * error state screen renders.
38
40
  */
39
41
  settlement: Entity<WithdrawalSettlementPayload, WithdrawalSettlementDto, WithdrawalSettlementResponse>;
42
+ /**
43
+ * Optional lower USD bound on the withdraw amount. The withdraw form blocks submit with a
44
+ * localized "Min $X" CTA when the typed amount sits below `value`. Set from
45
+ * `<StridgeProvider flows.withdraw.minAmountUsd>` and constant across the driver's lifetime.
46
+ */
47
+ minAmountUsd?: FormattedField<number>;
48
+ /**
49
+ * Optional upper USD bound on the withdraw amount. The withdraw form blocks submit with a
50
+ * localized "Max $X" CTA when the typed amount sits above `value`. Set from
51
+ * `<StridgeProvider flows.withdraw.maxAmountUsd>` and constant across the driver's lifetime.
52
+ */
53
+ maxAmountUsd?: FormattedField<number>;
40
54
  }
41
55
  /**
42
56
  * Input to {@link WithdrawDriver.requestQuote}. The form widget builds this from current field
@@ -57,17 +71,57 @@ interface RequestWithdrawalQuoteInput {
57
71
  recipientAddress: string;
58
72
  }
59
73
  /**
60
- * Input to {@link WithdrawDriver.submitWithdrawal}. Identical to {@link RequestWithdrawalQuoteInput}
61
- * — the live driver re-uses the most recent quote for submit, so the same identifying fields
62
- * scope both calls.
74
+ * Input to {@link WithdrawDriver.prepareWithdrawal}. Identical to {@link RequestWithdrawalQuoteInput}
75
+ * — the live driver re-uses the most recent quote shape for the gateway/start call, so the same
76
+ * identifying fields scope both calls.
63
77
  */
64
- type SubmitWithdrawalInput = RequestWithdrawalQuoteInput;
78
+ type PrepareWithdrawalInput = RequestWithdrawalQuoteInput;
65
79
  /**
66
- * Input to {@link WithdrawDriver.watchSettlement}. Carries the broadcast tx ref so the watcher
67
- * can scope its poll to the in-flight withdraw.
80
+ * Result of {@link WithdrawDriver.prepareWithdrawal}. Carries everything the host's `onSubmit`
81
+ * callback needs to broadcast a transfer to the Stridge UDA on the brand-currency chain — the
82
+ * UDA address, the chain, the token, the amount — plus the Stridge correlation fields the host
83
+ * may want to mirror into their own backend logs.
84
+ */
85
+ interface WithdrawPreparation {
86
+ /**
87
+ * Where the host should send brand-currency funds. The kit has already provisioned a UDA
88
+ * (via `gateway/start`); the host's job is to broadcast a single on-chain transfer of
89
+ * `amount` of `tokenSymbol` from their treasury / custodial wallet to `address` on `chainId`.
90
+ * Stridge takes over from there to bridge into the user's chosen recipient/chain/token.
91
+ */
92
+ depositTarget: {
93
+ /** UDA deposit address on the brand-currency chain. */address: string; /** EIP-155 chain id of the brand-currency network. */
94
+ chainId: number; /** Brand-currency token symbol (e.g. `"USDC"`). */
95
+ tokenSymbol: string; /** ERC-20 contract address of the brand currency. Empty string for native gas tokens. */
96
+ tokenAddress: string; /** On-chain decimal precision (e.g. `6` for USDC on Ethereum, `18` for ETH). */
97
+ tokenDecimals: number; /** `true` when the brand currency is the chain's native gas token. */
98
+ isNative: boolean; /** Exact amount to transfer, in display units (kit-managed decimals already factored in). */
99
+ amount: number;
100
+ };
101
+ /**
102
+ * Stridge correlation slot the host can pass through to their own backend / logs. `owner`
103
+ * is the same value the kit threaded into `gateway/start.owner` for this UDA.
104
+ */
105
+ correlation: {
106
+ owner: string;
107
+ };
108
+ }
109
+ /**
110
+ * Input to {@link WithdrawDriver.watchSettlement}. `tx` is optional — when the host has
111
+ * surfaced a broadcast tx hash via the orchestrator's `setTxHash` action, the watcher anchors
112
+ * to it for precise matching. When omitted, the watcher falls back to a best-match heuristic
113
+ * (destination tuple + amount tolerance + submit-time window) so the kit can find the relevant
114
+ * settlement even if the host never surfaces a tx hash.
68
115
  */
69
116
  interface WatchWithdrawalSettlementInput {
70
- tx: TxRef;
117
+ tx?: TxRef;
118
+ /**
119
+ * Form snapshot at submit time. The driver uses this in best-match mode to filter
120
+ * `gateway/{owner}` to settlements whose destination matches the user's selection.
121
+ */
122
+ form: RequestWithdrawalQuoteInput;
123
+ /** Unix-ms timestamp the host called `beginProcessing` — the start of the matching window. */
124
+ submittedAt: number;
71
125
  }
72
126
  /**
73
127
  * Input to {@link WithdrawDriver.watchWithdrawableBalances}. Optional listener — the form's
@@ -107,16 +161,25 @@ interface WithdrawDriver {
107
161
  getSnapshot(): WithdrawSnapshot;
108
162
  /** Subscribe to entity transitions outside React (analytics, headless integrations). */
109
163
  subscribe(listener: () => void): () => void;
164
+ /**
165
+ * Idempotent bootstrap trigger. The kit calls this from `useWithdraw().open()` and the
166
+ * headless `usePrefetchWithdraw()` hook. First call kicks off any deferred network work
167
+ * (e.g. `supportedAssets` + the initial `balance/onchain` fetch); subsequent calls are
168
+ * no-ops while bootstrap is in flight or completed.
169
+ */
170
+ arm(): void;
110
171
  /**
111
172
  * Fetches a fresh quote for `input` and updates the `quote` entity through its lifecycle
112
173
  * (`idle | loading → ready | error`). The `signal` cancels in-flight work.
113
174
  */
114
175
  requestQuote(input: RequestWithdrawalQuoteInput, signal: AbortSignal): Promise<void>;
115
176
  /**
116
- * Submits the confirmed withdrawal. Resolves with the broadcast tx ref. The settlement
117
- * watcher takes over from there to populate the `settlement` entity.
177
+ * Provisions a fresh UDA for this withdrawal (via `gateway/start`) and returns the deposit
178
+ * target + Stridge correlation slot for the host's `onSubmit` callback to act on. The kit
179
+ * never signs the withdraw transfer itself — the host's backend (treasury wallet, custodial
180
+ * signer, hot-wallet service) does. See {@link WithdrawPreparation}.
118
181
  */
119
- submitWithdrawal(input: SubmitWithdrawalInput, signal: AbortSignal): Promise<TxRef>;
182
+ prepareWithdrawal(input: PrepareWithdrawalInput, signal: AbortSignal): Promise<WithdrawPreparation>;
120
183
  /**
121
184
  * Watches the settlement entity through its lifecycle (pending → succeeded / failed). The
122
185
  * listener fires on every transition with the new envelope; the FSM consumes these via the
@@ -130,4 +193,4 @@ interface WithdrawDriver {
130
193
  watchWithdrawableBalances?(input: WatchWithdrawableBalancesInput, listener: (entity: WithdrawSnapshot["withdrawableBalances"]) => void, signal: AbortSignal): void;
131
194
  }
132
195
  //#endregion
133
- export { RequestWithdrawalQuoteInput, SubmitWithdrawalInput, WatchWithdrawableBalancesInput, WatchWithdrawalSettlementInput, WithdrawDriver, WithdrawSnapshot };
196
+ export { PrepareWithdrawalInput, RequestWithdrawalQuoteInput, WatchWithdrawableBalancesInput, WatchWithdrawalSettlementInput, WithdrawDriver, WithdrawPreparation, WithdrawSnapshot };
@@ -1 +1 @@
1
- "use client";import{useLingui as e}from"../../../shared/i18n/useLingui.js";import"../../../i18n/index.js";import{toFailure as t}from"../../../shared/orchestrator/toFailure.js";import{useDriverSettlementListener as n}from"../../../shared/orchestrator/useDriverSettlementListener.js";import{useEffectiveState as r}from"../../../shared/orchestrator/useEffectiveState.js";import{useSettlementWatcher as i}from"../../../shared/orchestrator/useSettlementWatcher.js";import"../../../shared/orchestrator/index.js";import{useWithdrawDriverInstance as a}from"../driver/context.js";import{initialState as o,reducer as s}from"./reducer.js";import{createContext as c,use as l,useCallback as u,useMemo as d,useReducer as f,useRef as p}from"react";import{jsx as m}from"react/jsx-runtime";const h={id:`ldK3jJ`,message:`Failed to submit withdrawal.`},g={id:`kUFhUv`,message:`Withdrawal failed.`},_=c(null);_.displayName=`WithdrawControllerContext`;function v(){let e=l(_);if(!e)throw Error(`useWithdraw / WithdrawControllerProvider must be used inside <KitProvider withdraw={…} />. Mount KitProvider once at the host's app root with a withdraw driver.`);return e}function y(){return v().state}function b(){return v().effectiveState}function x(){return v().actions}function S({children:e}){let t=a(),[n,c]=f(s,o),l=w(n,c,t);i(t,n.name===`inProgress`?n.ctx.tx:void 0),T(n,c,t);let u=r(n),p=C(c,l);return m(_,{value:d(()=>({state:n,effectiveState:u,dispatch:c,controller:p,actions:l}),[n,u,p,l]),children:e})}function C(e,t){let n=u(()=>{e({type:`OPEN`})},[e]),r=u(()=>{e({type:`CLOSE`})},[e]);return d(()=>({open:n,close:r,actions:t}),[n,r,t])}function w(n,r,i){let a=p(n);a.current=n;let o=p(i);o.current=i;let s=p(r);s.current=r;let{i18n:c}=e(),l=p(c);l.current=c;let f=u(e=>{let n=o.current;s.current({type:`SUBMIT`,input:e});let r=new AbortController,i={sourceAssetSymbol:e.sourceAssetSymbol,sourceChainId:e.sourceChainId,amount:e.amount,receiveTokenSymbol:e.receiveTokenSymbol,receiveChainId:e.receiveChainId,recipientAddress:e.recipientAddress};n.submitWithdrawal(i,r.signal).then(e=>{r.signal.aborted||s.current({type:`SUBMIT_CONFIRMED`,tx:e})}).catch(n=>{r.signal.aborted||s.current({type:`SUBMIT_FAILED`,failure:t(n,l.current._(h)),input:e})})},[]),m=u(()=>{s.current({type:`CLOSE`})},[]),g=u(()=>{s.current({type:`RESET`})},[]),_=u(()=>{s.current({type:`CLEAR_NOTICE`})},[]);return d(()=>({submit:f,close:m,reset:g,clearNotice:_}),[f,m,g,_])}function T(t,r,i){let a=p(t);a.current=t;let{i18n:o}=e(),s=p(o);s.current=o,n(i,(e,t)=>{if(a.current.name===`inProgress`){if(e===`succeeded`){r({type:`SETTLEMENT_SUCCEEDED`});return}if(e===`failed`){let e=t.settlement,n=e.status===`ready`||e.status===`stale`?e.payload:null,i=n&&n.kind===`failed`?{reason:s.current._(g),code:n.failureKind}:void 0;r({type:`SETTLEMENT_FAILED`,...i?{failure:i}:{}})}}})}export{S as WithdrawControllerProvider,v as useControllerContext,x as useWithdrawActions,b as useWithdrawEffectiveState,y as useWithdrawState};
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{toFailure as n}from"../../../shared/orchestrator/toFailure.js";import{useDriverSettlementListener as r}from"../../../shared/orchestrator/useDriverSettlementListener.js";import{useEffectiveState as i}from"../../../shared/orchestrator/useEffectiveState.js";import{useSettlementWatcher as a}from"../../../shared/orchestrator/useSettlementWatcher.js";import"../../../shared/orchestrator/index.js";import{useWithdrawBindingsRef as o}from"../bindings/WithdrawBindings.js";import"../bindings/index.js";import{useWithdrawDriverInstance as s}from"../driver/context.js";import{initialState as c,reducer as l}from"./reducer.js";import{createContext as u,use as d,useCallback as f,useEffect as p,useMemo as m,useReducer as h,useRef as g}from"react";import{jsx as _}from"react/jsx-runtime";const v={id:`ldK3jJ`,message:`Failed to submit withdrawal.`},y={id:`kUFhUv`,message:`Withdrawal failed.`},b={id:`srsA0x`,message:`Withdrawal declined.`},x=u(null);x.displayName=`WithdrawControllerContext`;function S(){let e=d(x);if(!e)throw Error(`useWithdraw / WithdrawControllerProvider must be used inside <KitProvider withdraw={…} />. Mount KitProvider once at the host's app root with a withdraw driver.`);return e}function C(){return d(x)}function w(){return S().state}function T(){return S().effectiveState}function E(){return S().actions}function D({children:t}){let n=s(),r=e(),[o,u]=h(l,c),d=k(o,u,n,r),f=o.name===`inProgress`?{form:o.ctx.input,submittedAt:o.ctx.submittedAt,...o.ctx.tx?{tx:o.ctx.tx}:{}}:void 0;a(n,f,f?`${f.submittedAt}|${f.tx?.hash??``}`:void 0),A(r,o.name===`activityList`||o.name===`activityDetail`),j(o,u,n);let p=i(o),g=O(u,d,n);return _(x,{value:m(()=>({state:o,effectiveState:p,dispatch:u,controller:g,actions:d}),[o,p,g,d]),children:t})}function O(e,t,n){let r=g(n);r.current=n;let i=f(t=>(r.current.arm(),e({type:`OPEN`}),!0),[e]),a=f(()=>{e({type:`CLOSE`})},[e]);return m(()=>({open:i,close:a,actions:t}),[i,a,t])}function k(e,r,i,a){let s=g(e);s.current=e;let c=g(i);c.current=i;let l=g(a);l.current=a;let u=g(r);u.current=r;let{i18n:d}=t(),p=g(d);p.current=d;let h=o(),_=f(e=>{let t=c.current;u.current({type:`SUBMIT`,input:e});let r=new AbortController,i={sourceAssetSymbol:e.sourceAssetSymbol,sourceChainId:e.sourceChainId,amount:e.amount,receiveTokenSymbol:e.receiveTokenSymbol,receiveChainId:e.receiveChainId,recipientAddress:e.recipientAddress},a={beginProcessing(e){u.current({type:`BEGIN_PROCESSING`,submittedAt:Date.now(),...e?{tx:e}:{}});try{l.current?.invalidateActivity?.()}catch{}},setTxHash(e){u.current({type:`SET_TX_HASH`,tx:e,submittedAt:Date.now()})},fail(e){u.current({type:`MARK_FAILED`,...e?{failure:e}:{}})},decline(){u.current({type:`SUBMIT_FAILED`,failure:{reason:p.current._(b),code:`UserRejectedRequestError`},input:e})},succeed(){u.current({type:`MARK_SUCCEEDED`})}};t.prepareWithdrawal(i,r.signal).then(i=>{if(r.signal.aborted)return;let o=h.current.onSubmit;if(!o){u.current({type:`SUBMIT_FAILED`,failure:n(Error(`WithdrawDialog onSubmit is missing.`),p.current._(v)),input:e});return}let s=t.getSnapshot().quote,c=s.status===`ready`||s.status===`stale`?s.payload:void 0;try{let t=o({form:e,depositTarget:i.depositTarget,correlation:i.correlation,...c?{quote:c}:{}},a,r.signal);t&&typeof t.catch==`function`&&t.catch(t=>{r.signal.aborted||u.current({type:`SUBMIT_FAILED`,failure:n(t,p.current._(v)),input:e})})}catch(t){if(r.signal.aborted)return;u.current({type:`SUBMIT_FAILED`,failure:n(t,p.current._(v)),input:e})}}).catch(t=>{r.signal.aborted||u.current({type:`SUBMIT_FAILED`,failure:n(t,p.current._(v)),input:e})})},[]),y=f(()=>{u.current({type:`CLOSE`})},[]),x=f(()=>{u.current({type:`RESET`})},[]),S=f(()=>{u.current({type:`CLEAR_NOTICE`})},[]),C=f(()=>{u.current({type:`BACK`})},[]),w=f(()=>{if(l.current==null){process.env.NODE_ENV!==`production`&&console.warn("[@stridge/kit] useWithdrawActions().openActivity() was called but no activity driver is mounted. Wrap the host with `<KitProvider activity={…}>` (or `<StridgeProvider>` with any flow enabled) to enable the activity surface.");return}s.current.name===`form`&&u.current({type:`OPEN_ACTIVITY`})},[]),T=f(e=>{u.current({type:`SELECT_SETTLEMENT`,settlementId:e})},[]);return m(()=>({submit:_,close:y,reset:x,clearNotice:S,back:C,openActivity:w,selectSettlement:T}),[_,y,x,S,C,w,T])}function A(e,t){p(()=>{if(!t||!e)return;let n=new AbortController;return e.watchActivity(n.signal),()=>n.abort()},[t,e])}function j(e,n,i){let a=g(e);a.current=e;let{i18n:o}=t(),s=g(o);s.current=o,r(i,(e,t)=>{if(a.current.name===`inProgress`){if(e===`succeeded`){n({type:`SETTLEMENT_SUCCEEDED`});return}if(e===`failed`){let e=t.settlement,r=e.status===`ready`||e.status===`stale`?e.payload:null,i=r&&r.kind===`failed`?{reason:s.current._(y),code:r.failureKind}:void 0;n({type:`SETTLEMENT_FAILED`,...i?{failure:i}:{}})}}})}export{D as WithdrawControllerProvider,S as useControllerContext,C as useOptionalControllerContext,E as useWithdrawActions,T as useWithdrawEffectiveState,w as useWithdrawState};
@@ -1,4 +1,4 @@
1
1
  import { FailureInfo } from "../../../shared/orchestrator/types.js";
2
2
  import { WithdrawActions, WithdrawController, WithdrawEvent, WithdrawState, WithdrawStateName, WithdrawalFormSnapshot } from "./types.js";
3
3
  import { useWithdrawState } from "./controller.js";
4
- import { useWithdraw } from "./useWithdraw.js";
4
+ import { useOptionalWithdraw, usePrefetchWithdraw, useWithdraw } from "./useWithdraw.js";
@@ -1 +1 @@
1
- import{isUserRejectionFailure as e}from"../../../shared/orchestrator/userRejection.js";import"../../../shared/orchestrator/index.js";const t={name:`closed`};function n(e,t){switch(e.name){case`closed`:return r(t);case`form`:return i(e,t);case`submitting`:return a(e,t);case`inProgress`:return o(e,t);case`success`:return s(e,t);case`error`:return c(e,t);default:return l(e)}}function r(e){return e.type===`OPEN`?{name:`form`}:{name:`closed`}}function i(e,t){switch(t.type){case`SUBMIT`:return{name:`submitting`,ctx:{input:t.input}};case`CLEAR_NOTICE`:return e.ctx?.notice?{name:`form`}:e;case`CLOSE`:return{name:`closed`};default:return e}}function a(t,n){switch(n.type){case`SUBMIT_CONFIRMED`:return{name:`inProgress`,ctx:{input:t.ctx.input,tx:n.tx}};case`SUBMIT_FAILED`:return e(n.failure)?{name:`form`,ctx:{notice:n.failure.reason}}:{name:`error`,ctx:{input:n.input,failure:n.failure}};case`CLOSE`:return{name:`closed`};default:return t}}function o(e,t){switch(t.type){case`SETTLEMENT_SUCCEEDED`:return{name:`success`,ctx:{input:e.ctx.input,tx:e.ctx.tx}};case`SETTLEMENT_FAILED`:return{name:`error`,ctx:{input:e.ctx.input,tx:e.ctx.tx,...t.failure?{failure:t.failure}:{}}};case`CLOSE`:return{name:`closed`};default:return e}}function s(e,t){switch(t.type){case`RESET`:return{name:`form`};case`CLOSE`:return{name:`closed`};default:return e}}function c(e,t){switch(t.type){case`RESET`:return{name:`form`};case`CLOSE`:return{name:`closed`};default:return e}}function l(e){throw Error(`Unhandled withdraw state: ${JSON.stringify(e)}`)}export{t as initialState,n as reducer};
1
+ import{createActivityReducers as e}from"../../../shared/orchestrator/createActivityReducers.js";import{isUserRejectionFailure as t}from"../../../shared/orchestrator/userRejection.js";import"../../../shared/orchestrator/index.js";import{assertNever as n}from"../../../shared/utils/assertNever.js";const r={name:`closed`},{reduceFromActivityList:i,reduceFromActivityDetail:a}=e({activityList:e=>({name:`activityList`,ctx:{backTarget:e}}),activityDetail:(e,t,n)=>({name:`activityDetail`,ctx:{settlementId:e,backTarget:t,viaList:n}}),closed:()=>({name:`closed`}),restoreFromBackTarget:e=>p(e)});function o(e,t){switch(e.name){case`closed`:return s(t);case`form`:return c(e,t);case`submitting`:return l(e,t);case`inProgress`:return u(e,t);case`success`:return d(e,t);case`error`:return f(e,t);case`activityList`:return i(e,t);case`activityDetail`:return a(e,t);default:return n(e)}}function s(e){return e.type===`OPEN`?{name:`form`}:{name:`closed`}}function c(e,t){switch(t.type){case`SUBMIT`:return{name:`submitting`,ctx:{input:t.input}};case`CLEAR_NOTICE`:return e.ctx?.notice?{name:`form`}:e;case`OPEN_ACTIVITY`:return{name:`activityList`,ctx:{backTarget:{kind:`form`,...e.ctx?.notice?{notice:e.ctx.notice}:{}}}};case`CLOSE`:return{name:`closed`};default:return e}}function l(e,n){switch(n.type){case`BEGIN_PROCESSING`:return{name:`inProgress`,ctx:{input:e.ctx.input,submittedAt:n.submittedAt,...n.tx?{tx:n.tx}:{}}};case`SET_TX_HASH`:return{name:`inProgress`,ctx:{input:e.ctx.input,submittedAt:n.submittedAt,tx:n.tx}};case`MARK_SUCCEEDED`:return{name:`success`,ctx:{input:e.ctx.input}};case`MARK_FAILED`:return{name:`error`,ctx:{input:e.ctx.input,...n.failure?{failure:n.failure}:{}}};case`SUBMIT_FAILED`:return t(n.failure)?{name:`form`,ctx:{notice:n.failure.reason}}:{name:`error`,ctx:{input:n.input,failure:n.failure}};case`CLOSE`:return{name:`closed`};default:return e}}function u(e,t){switch(t.type){case`SET_TX_HASH`:return{name:`inProgress`,ctx:{...e.ctx,tx:t.tx}};case`BEGIN_PROCESSING`:return{name:`inProgress`,ctx:{input:e.ctx.input,submittedAt:e.ctx.submittedAt,...e.ctx.tx?{tx:e.ctx.tx}:t.tx?{tx:t.tx}:{}}};case`MARK_SUCCEEDED`:return{name:`success`,ctx:{input:e.ctx.input,...e.ctx.tx?{tx:e.ctx.tx}:{}}};case`MARK_FAILED`:return{name:`error`,ctx:{input:e.ctx.input,...e.ctx.tx?{tx:e.ctx.tx}:{},...t.failure?{failure:t.failure}:{}}};case`SETTLEMENT_SUCCEEDED`:return{name:`success`,ctx:{input:e.ctx.input,...e.ctx.tx?{tx:e.ctx.tx}:{}}};case`SETTLEMENT_FAILED`:return{name:`error`,ctx:{input:e.ctx.input,...e.ctx.tx?{tx:e.ctx.tx}:{},...t.failure?{failure:t.failure}:{}}};case`CLOSE`:return{name:`closed`};default:return e}}function d(e,t){switch(t.type){case`RESET`:return{name:`form`};case`CLOSE`:return{name:`closed`};default:return e}}function f(e,t){switch(t.type){case`RESET`:return{name:`form`};case`CLOSE`:return{name:`closed`};default:return e}}function p(e){return e.notice?{name:`form`,ctx:{notice:e.notice}}:{name:`form`}}export{r as initialState,o as reducer};
@@ -1,6 +1,7 @@
1
1
  import { TxRef } from "../../../shared/driver/types.js";
2
2
  import { FailureInfo } from "../../../shared/orchestrator/types.js";
3
-
3
+ import { WithdrawalQuotePayload } from "../driver/payloads.js";
4
+ import { WithdrawPreparation } from "../driver/types.js";
4
5
  //#region src/flows/withdraw/orchestrator/types.d.ts
5
6
  /**
6
7
  * Form values captured at submit time. The orchestrator carries this snapshot through every
@@ -20,24 +21,43 @@ interface WithdrawalFormSnapshot {
20
21
  receiveTokenSymbol: string;
21
22
  /** Receive-side chain id (EIP-155 numeric). */
22
23
  receiveChainId: number;
24
+ /**
25
+ * Pre-formatted USD figure the form displayed under the amount input at submit time. Carried
26
+ * through the FSM so the in-progress / success heroes can render the same dollar value the
27
+ * user just saw on the form, before the indexer prices the settlement legs. Optional because
28
+ * the form's USD computation already returns `undefined` for invalid amounts; the snapshot
29
+ * mirrors that. Pre-formatted (locale-aware) — the orchestrator does not re-format.
30
+ */
31
+ amountUsd?: string;
32
+ }
33
+ /**
34
+ * Where `BACK` lands when the user exits the activity surface. Encoded once at `OPEN_ACTIVITY`
35
+ * time — the in-flow header icon is the only way into withdraw activity now (direct-entry
36
+ * migrated to `useActivity()`), so the form is always the source step.
37
+ */
38
+ interface ActivityBackTarget {
39
+ kind: "form";
40
+ notice?: string;
23
41
  }
24
42
  /**
25
- * State machine state for the orchestrated withdraw dialog. Per-state discriminated `ctx` narrows
26
- * what data is available — illegal states (e.g. `inProgress` without a tx ref) are
27
- * unrepresentable.
43
+ * State machine state for the orchestrated withdraw dialog. Per-state discriminated `ctx`
44
+ * narrows what data is available.
28
45
  *
29
- * The reducer carries navigation intent only — entity-derived data (quote payload, settlement
30
- * payload, balances) lives on the driver and is read directly by widgets.
46
+ * **Host-paced lifecycle** (different from the old wagmi-signed model): the kit stays in
47
+ * `submitting` until the host's `onSubmit` callback calls one of the controller's actions
48
+ * (`beginProcessing`, `fail`, `succeed`). `inProgress` accepts an optional `tx` — the host may
49
+ * move the user into processing before a broadcast tx hash exists; the kit polls
50
+ * `gateway/{owner}` and best-matches the relevant settlement (destination tuple + amount +
51
+ * submit-time window) until the host supplies a tx hash via `setTxHash`. `success` / `error`
52
+ * similarly accept optional `tx` since the host may declare a terminal verdict directly.
31
53
  */
32
54
  type WithdrawState = {
33
55
  name: "closed";
34
56
  } | {
35
57
  name: "form";
36
58
  /**
37
- * Optional notice rendered inline near the submit footer. Currently set when the user
38
- * declines the wallet signature: the FSM lands the user back on the form (preserving
39
- * recipient + amount + receive selection) with `notice = "Signature declined…"` so they
40
- * can retry without losing context. Cleared on the next SUBMIT or CLOSE.
59
+ * Optional notice rendered inline near the submit footer. Cleared on the next SUBMIT
60
+ * or CLOSE.
41
61
  */
42
62
  ctx?: {
43
63
  notice?: string;
@@ -50,27 +70,56 @@ type WithdrawState = {
50
70
  } | {
51
71
  name: "inProgress";
52
72
  ctx: {
53
- input: WithdrawalFormSnapshot;
54
- tx: TxRef;
73
+ input: WithdrawalFormSnapshot; /** Unix-ms timestamp the host moved the FSM into processing (drives best-match windowing). */
74
+ submittedAt: number;
75
+ /**
76
+ * Source-chain broadcast hash, when the host has surfaced one via
77
+ * `actions.setTxHash`. Absent while the kit relies on the best-match heuristic.
78
+ */
79
+ tx?: TxRef;
55
80
  };
56
81
  } | {
57
82
  name: "success";
58
83
  ctx: {
59
84
  input: WithdrawalFormSnapshot;
60
- tx: TxRef;
85
+ tx?: TxRef;
61
86
  };
62
87
  } | {
63
88
  name: "error";
64
89
  ctx: {
65
90
  /**
66
91
  * Form snapshot captured at submit time. Set when error follows a submit attempt;
67
- * absent when the error path was reached without a known prior submit (currently
68
- * unreachable in V2 — kept optional so resume-style entries can re-use the slot).
92
+ * absent when the error path was reached without a known prior submit.
69
93
  */
70
- input?: WithdrawalFormSnapshot; /** Optional non-settlement failure (quote / submission rejection). */
94
+ input?: WithdrawalFormSnapshot; /** Optional non-settlement failure (quote / submission rejection, host-supplied failure). */
71
95
  failure?: FailureInfo; /** Source-chain broadcast tx hash when the error followed a successful broadcast. */
72
96
  tx?: TxRef;
73
97
  };
98
+ } | {
99
+ /**
100
+ * Activity list — reachable from `form` via the header icon. `backTarget`
101
+ * snapshots the source state (including any inline notice) at `OPEN_ACTIVITY` time so
102
+ * the back chevron can restore it lossless.
103
+ */
104
+ name: "activityList";
105
+ ctx: {
106
+ backTarget: ActivityBackTarget;
107
+ };
108
+ } | {
109
+ /**
110
+ * Activity per-settlement detail — reached from `activityList` via
111
+ * `SELECT_SETTLEMENT`. Carries the selected row's id, the same `backTarget` so `BACK`
112
+ * collapses through `activityList` to the original source step, and a `viaList` flag
113
+ * that disambiguates "reached via the list" from "reached imperatively"; the latter
114
+ * skips the list interlude on `BACK`. For direct-entry into the activity surface,
115
+ * see {@link useActivity}.
116
+ */
117
+ name: "activityDetail";
118
+ ctx: {
119
+ settlementId: string;
120
+ backTarget: ActivityBackTarget;
121
+ viaList: boolean;
122
+ };
74
123
  };
75
124
  /**
76
125
  * Public state-name discriminator — useful for analytics and React-side gating without unwrapping
@@ -79,21 +128,41 @@ type WithdrawState = {
79
128
  type WithdrawStateName = WithdrawState["name"];
80
129
  /**
81
130
  * Reducer event union. Strict discriminated; no stringly-typed transitions.
131
+ *
132
+ * The host-paced lifecycle splits the old `SUBMIT_CONFIRMED { tx }` event into three pieces so
133
+ * the host can move the user forward at whichever step their backend actually completes:
134
+ *
135
+ * - `BEGIN_PROCESSING { tx?, submittedAt }` — host accepted the request; move to inProgress with
136
+ * or without a tx hash.
137
+ * - `SET_TX_HASH { tx }` — host surfaced a broadcast hash later; upgrade best-match polling to
138
+ * tx-anchored.
139
+ * - `MARK_SUCCEEDED` / `MARK_FAILED { failure? }` — host short-circuits to a terminal verdict
140
+ * (e.g. their own settlement verification ran independently of Stridge's poll).
82
141
  */
83
142
  type WithdrawEvent = {
84
- type: "OPEN";
143
+ /** Lifecycle entry. Always lands the FSM on `form`. */type: "OPEN";
85
144
  } | {
86
145
  type: "CLOSE";
87
146
  } | {
88
147
  type: "SUBMIT";
89
148
  input: WithdrawalFormSnapshot;
90
149
  } | {
91
- type: "SUBMIT_CONFIRMED";
150
+ type: "BEGIN_PROCESSING";
151
+ submittedAt: number;
152
+ tx?: TxRef;
153
+ } | {
154
+ type: "SET_TX_HASH";
92
155
  tx: TxRef;
156
+ submittedAt: number;
93
157
  } | {
94
158
  type: "SUBMIT_FAILED";
95
159
  failure: FailureInfo;
96
160
  input: WithdrawalFormSnapshot;
161
+ } | {
162
+ type: "MARK_SUCCEEDED";
163
+ } | {
164
+ type: "MARK_FAILED";
165
+ failure?: FailureInfo;
97
166
  } | {
98
167
  type: "SETTLEMENT_SUCCEEDED";
99
168
  } | {
@@ -101,24 +170,48 @@ type WithdrawEvent = {
101
170
  failure?: FailureInfo;
102
171
  } | {
103
172
  type: "RESET";
104
- }
105
- /**
106
- * Drops the inline notice on the `form` state. Dispatched by the form widget when the user
107
- * starts editing again after a wallet-rejection landed them back on `form{notice}`. Mirror of
108
- * deposit's `regenerating → ready` transition (where the notice clears as a side-effect of
109
- * the next quote resolving) — withdraw's form has no FSM-driven phase to ride on, so the
110
- * widget signals it explicitly.
111
- */
112
- | {
173
+ } | {
113
174
  type: "CLEAR_NOTICE";
175
+ } | {
176
+ /**
177
+ * User tapped the back chevron. Legal only from `activityList` / `activityDetail` today —
178
+ * the form step has no source to return to (closing the dialog is `CLOSE`). Two-step
179
+ * collapse: `activityDetail → activityList → source`.
180
+ */
181
+ type: "BACK";
182
+ } | {
183
+ /**
184
+ * User tapped the header activity icon. Legal from `form`; ignored elsewhere. Snapshots
185
+ * the source state into a {@link ActivityBackTarget} so the back chevron can restore it
186
+ * lossless (including any inline notice surfaced after a recent submit failure).
187
+ */
188
+ type: "OPEN_ACTIVITY";
189
+ } | {
190
+ /**
191
+ * User tapped a row in the activity list. Legal only from `activityList`; transitions
192
+ * to `activityDetail` carrying the selected `settlementId`.
193
+ */
194
+ type: "SELECT_SETTLEMENT";
195
+ settlementId: string;
114
196
  };
197
+ /**
198
+ * Public open-input variant accepted by `useWithdraw().open()`. Today the withdraw flow has no
199
+ * `{ method }` arm — opening always lands on `form`.
200
+ *
201
+ * For direct-entry into the activity surface, see {@link useActivity}.
202
+ */
203
+ type WithdrawOpenInput = undefined;
115
204
  /**
116
205
  * Imperative controller returned by `useWithdraw()`. Mirrors {@link import("#/flows/deposit/orchestrator").DepositController}'s
117
206
  * surface so hosts can drive both flows symmetrically. Stable across re-renders.
118
207
  */
119
208
  interface WithdrawController {
120
- /** Open the withdraw dialog. Idempotent. */
121
- open(): void;
209
+ /**
210
+ * Open the withdraw dialog on `form`. Returns `true` whenever the open() call advanced the
211
+ * dialog past its guards — there is no per-method disable lever on withdraw, so the only
212
+ * `false` path is reserved for forward compatibility. Idempotent.
213
+ */
214
+ open(input?: WithdrawOpenInput): boolean;
122
215
  /** Close the withdraw dialog. Idempotent. */
123
216
  close(): void;
124
217
  /**
@@ -134,9 +227,11 @@ interface WithdrawController {
134
227
  */
135
228
  interface WithdrawActions {
136
229
  /**
137
- * Submits the withdrawal through the driver. Dispatches `SUBMIT` synchronously (so the form
138
- * flips to the loading-button state) and then `SUBMIT_CONFIRMED` / `SUBMIT_FAILED` based on
139
- * the driver's `submitWithdrawal` resolution.
230
+ * Submits the withdrawal. Dispatches `SUBMIT` synchronously (so the form flips to the
231
+ * loading-button state) and then fires the host's `<WithdrawDialog onSubmit>` callback with
232
+ * the prepared UDA target + a `WithdrawSubmitActions` handle. The kit stays in `submitting`
233
+ * until the host calls one of those actions (`beginProcessing`, `setTxHash`, `decline`,
234
+ * `fail`, `succeed`).
140
235
  */
141
236
  submit(input: WithdrawalFormSnapshot): void;
142
237
  /** Close the dialog. Idempotent. */
@@ -147,10 +242,98 @@ interface WithdrawActions {
147
242
  */
148
243
  reset(): void;
149
244
  /**
150
- * Clear the form's inline notice (typically the post-rejection "Signature declined." hint).
151
- * No-op when there's no notice or the FSM isn't on `form`.
245
+ * Clear the form's inline notice. No-op when there's no notice or the FSM isn't on `form`.
152
246
  */
153
247
  clearNotice(): void;
248
+ /**
249
+ * Back-chevron action. Today the chevron is only rendered on the activity step
250
+ * (detail → list → source); other steps either render no chevron or close directly via
251
+ * {@link close}.
252
+ */
253
+ back(): void;
254
+ /**
255
+ * Header-icon entry into the activity surface. Legal from `form`; ignored elsewhere.
256
+ * Snapshots the current state into a {@link ActivityBackTarget} so `back()` can restore it
257
+ * lossless. No-ops with a dev-mode warning when no activity driver is mounted (host wired the
258
+ * action without `<KitProvider activity={…}>`).
259
+ */
260
+ openActivity(): void;
261
+ /**
262
+ * Open the detail view for a settlement listed on the activity surface. Legal only from
263
+ * `activityList`; transitions the FSM to `activityDetail`.
264
+ */
265
+ selectSettlement(settlementId: string): void;
266
+ }
267
+ /**
268
+ * Payload the kit hands to the host's `<WithdrawDialog onSubmit>` callback. Carries everything
269
+ * the host needs to broadcast the source-chain transfer to the UDA (or to validate the request
270
+ * server-side before broadcasting / queueing).
271
+ */
272
+ interface WithdrawSubmitInput {
273
+ /** What the user picked on the form (recipient, amount, receive token + chain). */
274
+ form: WithdrawalFormSnapshot;
275
+ /** Where the host should send brand-currency funds to trigger the bridge. */
276
+ depositTarget: WithdrawPreparation["depositTarget"];
277
+ /** Stridge correlation slot — useful for backend logs / cross-system traces. */
278
+ correlation: WithdrawPreparation["correlation"];
279
+ /** Active quote payload at submit time, when one is available. */
280
+ quote?: WithdrawalQuotePayload;
154
281
  }
282
+ /**
283
+ * Imperative handles the host's `onSubmit` callback receives. Each action advances the kit's
284
+ * FSM at the point the host's backend reaches the matching state. All actions are optional —
285
+ * the host calls only what fits their flow (e.g. backend pre-validates and accepts ⇒
286
+ * `beginProcessing()`; later the broadcast lands ⇒ `setTxHash({ hash })`; settlement watching
287
+ * via Stridge takes over from there). The kit also exposes a `signal` for cancellation when
288
+ * the user closes the dialog mid-submit.
289
+ */
290
+ interface WithdrawSubmitActions {
291
+ /**
292
+ * Move the FSM into `inProgress`. Pass `tx` if a broadcast hash already exists at this point;
293
+ * otherwise omit — the kit polls `gateway/{owner}` with a best-match heuristic until you
294
+ * call {@link setTxHash}. Idempotent — calling more than once is a no-op.
295
+ */
296
+ beginProcessing(tx?: TxRef): void;
297
+ /**
298
+ * Surface a broadcast hash mid-processing. Upgrades the watcher from best-match to
299
+ * tx-anchored. Legal from `inProgress` or `submitting` (auto-promotes to `inProgress`).
300
+ */
301
+ setTxHash(tx: TxRef): void;
302
+ /**
303
+ * Mark the withdraw failed. Legal from `submitting` (pre-broadcast rejection) and
304
+ * `inProgress` (post-broadcast failure). The optional `failure` carries a localized
305
+ * reason + machine code for analytics; omit when the host has nothing meaningful to
306
+ * report and just needs to terminate the flow.
307
+ *
308
+ * For user-rejection (the user said no in their wallet), prefer {@link decline} so the
309
+ * kit can emit `withdraw.submission.declined` instead of `withdraw.submission.failed`.
310
+ */
311
+ fail(failure?: FailureInfo): void;
312
+ /**
313
+ * Mark the withdraw as user-declined. Use when the user explicitly refused a wallet
314
+ * prompt or backed out of a host-side confirmation step. The kit routes the FSM back to
315
+ * `form{notice}` (same as the wallet-rejection heuristic) and emits
316
+ * `withdraw.submission.declined` on the unified bus — distinct from `*.failed` because
317
+ * declining is a user choice, not an error. Analytics that count `.failed` events stay
318
+ * accurate.
319
+ *
320
+ * Legal from `submitting`. When the host doesn't call this explicitly, the kit's
321
+ * built-in rejection heuristic still classifies wallet-rejection-shaped errors as
322
+ * declines automatically.
323
+ */
324
+ decline(): void;
325
+ /**
326
+ * Mark the withdraw succeeded directly. Useful when the host runs their own settlement
327
+ * verification independently of Stridge's poll. Legal from `submitting` and `inProgress`.
328
+ */
329
+ succeed(): void;
330
+ }
331
+ /**
332
+ * Host-supplied callback fired when the user submits the withdrawal form. The kit hands the
333
+ * callback the resolved {@link WithdrawSubmitInput} plus a {@link WithdrawSubmitActions} handle
334
+ * the host calls to advance the FSM. The kit does NOT await the callback's promise — the host
335
+ * is in control of pacing via the actions. The `signal` aborts when the user closes the dialog.
336
+ */
337
+ type WithdrawSubmitCallback = (input: WithdrawSubmitInput, actions: WithdrawSubmitActions, signal: AbortSignal) => void | Promise<void>;
155
338
  //#endregion
156
- export { WithdrawActions, WithdrawController, WithdrawEvent, WithdrawState, WithdrawStateName, WithdrawalFormSnapshot };
339
+ export { WithdrawActions, WithdrawController, WithdrawEvent, WithdrawState, WithdrawStateName, WithdrawSubmitActions, WithdrawSubmitCallback, WithdrawSubmitInput, WithdrawalFormSnapshot };
@@ -19,5 +19,40 @@ import { WithdrawController } from "./types.js";
19
19
  * ```
20
20
  */
21
21
  declare function useWithdraw(): WithdrawController;
22
+ /**
23
+ * Non-throwing variant of {@link useWithdraw} — returns `null` when called outside a
24
+ * `<KitProvider withdraw={…} />`. Lets hosts mount `<StridgeProvider />` conditionally
25
+ * (e.g. only after a wallet is connected) without descendants crashing the moment they render
26
+ * before the provider exists.
27
+ *
28
+ * @example
29
+ * ```tsx
30
+ * const withdraw = useOptionalWithdraw();
31
+ * return (
32
+ * <button onClick={() => withdraw?.open()} disabled={!withdraw}>
33
+ * Withdraw
34
+ * </button>
35
+ * );
36
+ * ```
37
+ */
38
+ declare function useOptionalWithdraw(): WithdrawController | null;
39
+ /**
40
+ * Headless prefetch handle for the withdraw driver. Returns a stable function that arms the
41
+ * driver — kicks off the deferred `supportedAssets` + initial `balance/onchain` bootstrap.
42
+ * Calling it before the user opens the dialog warms the cache so the subsequent
43
+ * `useWithdraw().open()` lands on populated data without a perceptible loading window.
44
+ *
45
+ * Fire-and-forget: returns `void`. Observe bootstrap state via
46
+ * `useWithdrawSnapshot().receiveOptions.status` if needed.
47
+ *
48
+ * ```tsx
49
+ * const withdraw = useWithdraw();
50
+ * const prefetchWithdraw = usePrefetchWithdraw();
51
+ * <button onMouseEnter={prefetchWithdraw} onClick={() => withdraw.open()}>Withdraw</button>;
52
+ * ```
53
+ *
54
+ * Idempotent — subsequent calls are no-ops while the driver is already armed.
55
+ */
56
+ declare function usePrefetchWithdraw(): () => void;
22
57
  //#endregion
23
- export { useWithdraw };
58
+ export { useOptionalWithdraw, usePrefetchWithdraw, useWithdraw };
@@ -1 +1 @@
1
- "use client";import{useControllerContext as e}from"./controller.js";function t(){return e().controller}export{t as useWithdraw};
1
+ "use client";import{useWithdrawDriverInstance as e}from"../driver/context.js";import{useControllerContext as t,useOptionalControllerContext as n}from"./controller.js";import{useCallback as r}from"react";function i(){return t().controller}function a(){return n()?.controller??null}function o(){let t=e();return r(()=>{t.arm()},[t])}export{a as useOptionalWithdraw,o as usePrefetchWithdraw,i as useWithdraw};
@@ -0,0 +1,39 @@
1
+ import { ReactNode } from "react";
2
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
3
+
4
+ //#region src/flows/withdraw/widgets/activity/WithdrawActivityDetail.d.ts
5
+ interface WithdrawActivityDetailOwnProps {
6
+ /**
7
+ * Optional custom composition forwarded to the underlying `<ActivityDetail>`
8
+ * compound. Defaults to mounting all three per-kind parts.
9
+ */
10
+ children?: ReactNode;
11
+ }
12
+ /**
13
+ * Orchestrated activity detail wrapper for the withdraw dialog. Mirrors
14
+ * {@link import("#/flows/deposit/widgets/activity").DepositActivityDetail}. Renders
15
+ * `null` while the FSM is not on `activityDetail`.
16
+ */
17
+ declare function WithdrawActivityDetail({
18
+ children
19
+ }: WithdrawActivityDetailOwnProps): _$react_jsx_runtime0.JSX.Element | null;
20
+ declare namespace WithdrawActivityDetail {
21
+ type Props = WithdrawActivityDetailOwnProps;
22
+ const Processing: ({
23
+ children
24
+ }: {
25
+ children?: ReactNode;
26
+ }) => _$react_jsx_runtime0.JSX.Element | null;
27
+ const Succeeded: ({
28
+ children
29
+ }: {
30
+ children?: ReactNode;
31
+ }) => _$react_jsx_runtime0.JSX.Element | null;
32
+ const Failed: ({
33
+ children
34
+ }: {
35
+ children?: ReactNode;
36
+ }) => _$react_jsx_runtime0.JSX.Element | null;
37
+ }
38
+ //#endregion
39
+ export { WithdrawActivityDetail };
@@ -0,0 +1 @@
1
+ "use client";import{ActivitySourceProvider as e}from"../../../../shared/widgets/activity/compound/context.js";import{ActivityDetail as t}from"../../../../shared/widgets/activity/compound/ActivityDetail.js";import"../../../../shared/widgets/activity/compound/index.js";import{useWithdrawActivitySource as n}from"./useWithdrawActivitySource.js";import{jsx as r}from"react/jsx-runtime";function i({children:i}){let{sourceValue:a,step:o}=n();return o!==`activityDetail`||!a?null:r(e,{value:a,children:r(t,{children:i})})}(function(e){e.Processing=t.Processing,e.Succeeded=t.Succeeded,e.Failed=t.Failed})(i||={});export{i as WithdrawActivityDetail};