@stridge/kit 0.1.0-alpha.0

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 (763) hide show
  1. package/LICENSE +21 -0
  2. package/dist/KitProvider.d.ts +91 -0
  3. package/dist/KitProvider.js +1 -0
  4. package/dist/_internal/deposit/driver/index.d.ts +5 -0
  5. package/dist/_internal/deposit/driver/index.js +1 -0
  6. package/dist/_internal/deposit/widgets/index.d.ts +11 -0
  7. package/dist/_internal/deposit/widgets/index.js +1 -0
  8. package/dist/_internal/drivers/stridge/index.d.ts +6 -0
  9. package/dist/_internal/drivers/stridge/index.js +1 -0
  10. package/dist/_internal/drivers/stridge-mock/index.d.ts +5 -0
  11. package/dist/_internal/drivers/stridge-mock/index.js +1 -0
  12. package/dist/_internal/index.d.ts +2 -0
  13. package/dist/_internal/index.js +1 -0
  14. package/dist/_internal/withdraw/driver/index.d.ts +6 -0
  15. package/dist/_internal/withdraw/driver/index.js +1 -0
  16. package/dist/_internal/withdraw/widgets/index.d.ts +5 -0
  17. package/dist/_internal/withdraw/widgets/index.js +1 -0
  18. package/dist/banners/index.d.ts +1 -0
  19. package/dist/banners/index.js +1 -0
  20. package/dist/banners/useBannerAck.d.ts +61 -0
  21. package/dist/banners/useBannerAck.js +1 -0
  22. package/dist/deposit/compound/index.d.ts +28 -0
  23. package/dist/deposit/compound/index.js +1 -0
  24. package/dist/deposit/dialog/index.d.ts +2 -0
  25. package/dist/deposit/dialog/index.js +1 -0
  26. package/dist/drivers/stridge/createStridgeDepositDriver.d.ts +29 -0
  27. package/dist/drivers/stridge/createStridgeDepositDriver.js +1 -0
  28. package/dist/drivers/stridge/createStridgeWithdrawDriver.d.ts +113 -0
  29. package/dist/drivers/stridge/createStridgeWithdrawDriver.js +1 -0
  30. package/dist/drivers/stridge/internal/encoding.js +1 -0
  31. package/dist/drivers/stridge/internal/env.js +1 -0
  32. package/dist/drivers/stridge/internal/metadata.js +1 -0
  33. package/dist/drivers/stridge/internal/pollOnce.js +1 -0
  34. package/dist/drivers/stridge/internal/signAndConfirm.js +1 -0
  35. package/dist/drivers/stridge/poll.js +1 -0
  36. package/dist/drivers/stridge/rpc.d.ts +77 -0
  37. package/dist/drivers/stridge/rpc.js +1 -0
  38. package/dist/drivers/stridge/types.d.ts +145 -0
  39. package/dist/drivers/stridge/types.js +1 -0
  40. package/dist/drivers/stridge/wagmiSigner.js +1 -0
  41. package/dist/drivers/stridge-mock/createStridgeMockDriver.d.ts +120 -0
  42. package/dist/drivers/stridge-mock/createStridgeMockDriver.js +1 -0
  43. package/dist/drivers/stridge-mock/createStridgeMockWithdrawDriver.d.ts +118 -0
  44. package/dist/drivers/stridge-mock/createStridgeMockWithdrawDriver.js +1 -0
  45. package/dist/drivers/stridge-mock/fixtures.d.ts +127 -0
  46. package/dist/drivers/stridge-mock/fixtures.js +1 -0
  47. package/dist/drivers/stridge-mock/store.js +1 -0
  48. package/dist/drivers/stridge-mock/triggers.d.ts +41 -0
  49. package/dist/flows/deposit/dialog/DepositBootstrapErrorState.js +1 -0
  50. package/dist/flows/deposit/dialog/DepositBootstrapErrorState.styles.js +1 -0
  51. package/dist/flows/deposit/dialog/DepositDialog.d.ts +112 -0
  52. package/dist/flows/deposit/dialog/DepositDialog.js +1 -0
  53. package/dist/flows/deposit/driver/context.d.ts +37 -0
  54. package/dist/flows/deposit/driver/context.js +1 -0
  55. package/dist/flows/deposit/driver/payloads.d.ts +342 -0
  56. package/dist/flows/deposit/driver/transformers/balanceToBalancesPayload.js +1 -0
  57. package/dist/flows/deposit/driver/transformers/quoteToPayload.js +1 -0
  58. package/dist/flows/deposit/driver/transformers/settlementToPayload.js +1 -0
  59. package/dist/flows/deposit/driver/transformers/startToAddressesPayload.js +1 -0
  60. package/dist/flows/deposit/driver/transformers/startToBrandPayload.js +1 -0
  61. package/dist/flows/deposit/driver/transformers/startToTargetPayload.js +1 -0
  62. package/dist/flows/deposit/driver/transformers/walletAddressToWalletPayload.js +1 -0
  63. package/dist/flows/deposit/driver/types.d.ts +177 -0
  64. package/dist/flows/deposit/orchestrator/controller.d.ts +11 -0
  65. package/dist/flows/deposit/orchestrator/controller.js +1 -0
  66. package/dist/flows/deposit/orchestrator/reducer.js +1 -0
  67. package/dist/flows/deposit/orchestrator/resolveAssetById.js +1 -0
  68. package/dist/flows/deposit/orchestrator/steps.d.ts +23 -0
  69. package/dist/flows/deposit/orchestrator/steps.js +1 -0
  70. package/dist/flows/deposit/orchestrator/types.d.ts +266 -0
  71. package/dist/flows/deposit/orchestrator/useDeposit.d.ts +35 -0
  72. package/dist/flows/deposit/orchestrator/useDeposit.js +1 -0
  73. package/dist/flows/deposit/widgets/amount-entry/AmountEntry.d.ts +35 -0
  74. package/dist/flows/deposit/widgets/amount-entry/AmountEntry.js +1 -0
  75. package/dist/flows/deposit/widgets/amount-entry/index.d.ts +1 -0
  76. package/dist/flows/deposit/widgets/amount-entry/index.js +1 -0
  77. package/dist/flows/deposit/widgets/asset-picker/AssetPicker.d.ts +25 -0
  78. package/dist/flows/deposit/widgets/asset-picker/AssetPicker.js +1 -0
  79. package/dist/flows/deposit/widgets/asset-picker/index.d.ts +1 -0
  80. package/dist/flows/deposit/widgets/asset-picker/index.js +1 -0
  81. package/dist/flows/deposit/widgets/confirm-deposit/ConfirmDeposit.d.ts +31 -0
  82. package/dist/flows/deposit/widgets/confirm-deposit/ConfirmDeposit.js +1 -0
  83. package/dist/flows/deposit/widgets/confirm-deposit/index.d.ts +1 -0
  84. package/dist/flows/deposit/widgets/confirm-deposit/index.js +1 -0
  85. package/dist/flows/deposit/widgets/deposit/Deposit.d.ts +30 -0
  86. package/dist/flows/deposit/widgets/deposit/Deposit.js +1 -0
  87. package/dist/flows/deposit/widgets/deposit/compound/Deposit.d.ts +51 -0
  88. package/dist/flows/deposit/widgets/deposit/compound/Deposit.js +1 -0
  89. package/dist/flows/deposit/widgets/deposit/compound/Deposit.slots.d.ts +11 -0
  90. package/dist/flows/deposit/widgets/deposit/compound/Deposit.slots.js +1 -0
  91. package/dist/flows/deposit/widgets/deposit/compound/Deposit.styles.js +1 -0
  92. package/dist/flows/deposit/widgets/deposit/compound/components/Header.d.ts +15 -0
  93. package/dist/flows/deposit/widgets/deposit/compound/components/Header.js +1 -0
  94. package/dist/flows/deposit/widgets/deposit/compound/components/Method.d.ts +32 -0
  95. package/dist/flows/deposit/widgets/deposit/compound/components/Method.js +1 -0
  96. package/dist/flows/deposit/widgets/deposit/compound/components/Methods.d.ts +23 -0
  97. package/dist/flows/deposit/widgets/deposit/compound/components/Methods.js +1 -0
  98. package/dist/flows/deposit/widgets/deposit/compound/context.js +1 -0
  99. package/dist/flows/deposit/widgets/deposit/compound/index.d.ts +3 -0
  100. package/dist/flows/deposit/widgets/deposit/compound/index.js +1 -0
  101. package/dist/flows/deposit/widgets/deposit/compound/types.d.ts +129 -0
  102. package/dist/flows/deposit/widgets/deposit/index.d.ts +1 -0
  103. package/dist/flows/deposit/widgets/deposit/index.js +1 -0
  104. package/dist/flows/deposit/widgets/deposit-status-banner/DepositStatusBanner.d.ts +20 -0
  105. package/dist/flows/deposit/widgets/deposit-status-banner/DepositStatusBanner.js +1 -0
  106. package/dist/flows/deposit/widgets/deposit-status-banner/compound/DepositStatusBanner.d.ts +102 -0
  107. package/dist/flows/deposit/widgets/deposit-status-banner/compound/DepositStatusBanner.js +1 -0
  108. package/dist/flows/deposit/widgets/deposit-status-banner/compound/DepositStatusBanner.slots.d.ts +20 -0
  109. package/dist/flows/deposit/widgets/deposit-status-banner/compound/DepositStatusBanner.slots.js +1 -0
  110. package/dist/flows/deposit/widgets/deposit-status-banner/compound/DepositStatusBanner.styles.js +1 -0
  111. package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Body.d.ts +17 -0
  112. package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Body.js +1 -0
  113. package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Close.d.ts +13 -0
  114. package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Close.js +1 -0
  115. package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Detail.d.ts +14 -0
  116. package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Detail.js +1 -0
  117. package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Details.d.ts +20 -0
  118. package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Details.js +1 -0
  119. package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Footer.d.ts +17 -0
  120. package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Footer.js +1 -0
  121. package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Hero.d.ts +17 -0
  122. package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Hero.js +1 -0
  123. package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/PrimaryAction.d.ts +26 -0
  124. package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/PrimaryAction.js +1 -0
  125. package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Rows.d.ts +35 -0
  126. package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Rows.js +1 -0
  127. package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Toggle.d.ts +18 -0
  128. package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Toggle.js +1 -0
  129. package/dist/flows/deposit/widgets/deposit-status-banner/compound/context.js +1 -0
  130. package/dist/flows/deposit/widgets/deposit-status-banner/compound/index.d.ts +3 -0
  131. package/dist/flows/deposit/widgets/deposit-status-banner/compound/index.js +1 -0
  132. package/dist/flows/deposit/widgets/deposit-status-banner/compound/types.d.ts +188 -0
  133. package/dist/flows/deposit/widgets/deposit-status-banner/index.d.ts +1 -0
  134. package/dist/flows/deposit/widgets/deposit-status-banner/index.js +1 -0
  135. package/dist/flows/deposit/widgets/error-state/ErrorState.d.ts +30 -0
  136. package/dist/flows/deposit/widgets/error-state/ErrorState.js +1 -0
  137. package/dist/flows/deposit/widgets/error-state/index.d.ts +1 -0
  138. package/dist/flows/deposit/widgets/error-state/index.js +1 -0
  139. package/dist/flows/deposit/widgets/processing-state/ProcessingState.d.ts +31 -0
  140. package/dist/flows/deposit/widgets/processing-state/ProcessingState.js +1 -0
  141. package/dist/flows/deposit/widgets/processing-state/index.d.ts +1 -0
  142. package/dist/flows/deposit/widgets/processing-state/index.js +1 -0
  143. package/dist/flows/deposit/widgets/success-state/SuccessState.d.ts +30 -0
  144. package/dist/flows/deposit/widgets/success-state/SuccessState.js +1 -0
  145. package/dist/flows/deposit/widgets/success-state/index.d.ts +1 -0
  146. package/dist/flows/deposit/widgets/success-state/index.js +1 -0
  147. package/dist/flows/deposit/widgets/transfer-crypto/TransferCrypto.d.ts +41 -0
  148. package/dist/flows/deposit/widgets/transfer-crypto/TransferCrypto.js +1 -0
  149. package/dist/flows/deposit/widgets/transfer-crypto/compound/TransferCrypto.d.ts +56 -0
  150. package/dist/flows/deposit/widgets/transfer-crypto/compound/TransferCrypto.js +1 -0
  151. package/dist/flows/deposit/widgets/transfer-crypto/compound/TransferCrypto.slots.d.ts +15 -0
  152. package/dist/flows/deposit/widgets/transfer-crypto/compound/TransferCrypto.slots.js +1 -0
  153. package/dist/flows/deposit/widgets/transfer-crypto/compound/TransferCrypto.styles.js +1 -0
  154. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Address.d.ts +10 -0
  155. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Address.js +1 -0
  156. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Disclosure.d.ts +17 -0
  157. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Disclosure.js +1 -0
  158. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Header.d.ts +15 -0
  159. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Header.js +1 -0
  160. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/InfoTooltip.js +1 -0
  161. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/QrCode.d.ts +21 -0
  162. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/QrCode.js +1 -0
  163. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Selectors.d.ts +11 -0
  164. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Selectors.js +1 -0
  165. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Summary.d.ts +11 -0
  166. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Summary.js +1 -0
  167. package/dist/flows/deposit/widgets/transfer-crypto/compound/context.js +1 -0
  168. package/dist/flows/deposit/widgets/transfer-crypto/compound/index.d.ts +3 -0
  169. package/dist/flows/deposit/widgets/transfer-crypto/compound/index.js +1 -0
  170. package/dist/flows/deposit/widgets/transfer-crypto/compound/types.d.ts +187 -0
  171. package/dist/flows/deposit/widgets/transfer-crypto/index.d.ts +1 -0
  172. package/dist/flows/deposit/widgets/transfer-crypto/index.js +1 -0
  173. package/dist/flows/shared/transformers/classifySettlementStatus.js +1 -0
  174. package/dist/flows/shared/transformers/computeQuoteAttrs.js +1 -0
  175. package/dist/flows/shared/transformers/parseIsoMs.js +1 -0
  176. package/dist/flows/shared/transformers/parseSmallestUnit.js +1 -0
  177. package/dist/flows/shared/transformers/pickRelevantSettlement.js +1 -0
  178. package/dist/flows/withdraw/dialog/WithdrawDialog.d.ts +103 -0
  179. package/dist/flows/withdraw/dialog/WithdrawDialog.js +1 -0
  180. package/dist/flows/withdraw/dialog/WithdrawDialogEventsContext.d.ts +36 -0
  181. package/dist/flows/withdraw/dialog/WithdrawDialogEventsContext.js +1 -0
  182. package/dist/flows/withdraw/driver/context.d.ts +24 -0
  183. package/dist/flows/withdraw/driver/context.js +1 -0
  184. package/dist/flows/withdraw/driver/dto.d.ts +41 -0
  185. package/dist/flows/withdraw/driver/payloads.d.ts +206 -0
  186. package/dist/flows/withdraw/driver/transformers/balanceToWithdrawableBalancesPayload.js +1 -0
  187. package/dist/flows/withdraw/driver/transformers/quoteToWithdrawalPayload.js +1 -0
  188. package/dist/flows/withdraw/driver/transformers/settlementToWithdrawalPayload.js +1 -0
  189. package/dist/flows/withdraw/driver/transformers/supportedAssetsToReceiveOptionsPayload.js +1 -0
  190. package/dist/flows/withdraw/driver/types.d.ts +133 -0
  191. package/dist/flows/withdraw/orchestrator/controller.d.ts +11 -0
  192. package/dist/flows/withdraw/orchestrator/controller.js +1 -0
  193. package/dist/flows/withdraw/orchestrator/index.d.ts +4 -0
  194. package/dist/flows/withdraw/orchestrator/index.js +1 -0
  195. package/dist/flows/withdraw/orchestrator/reducer.js +1 -0
  196. package/dist/flows/withdraw/orchestrator/types.d.ts +156 -0
  197. package/dist/flows/withdraw/orchestrator/useWithdraw.d.ts +23 -0
  198. package/dist/flows/withdraw/orchestrator/useWithdraw.js +1 -0
  199. package/dist/flows/withdraw/widgets/withdraw-error/WithdrawError.d.ts +22 -0
  200. package/dist/flows/withdraw/widgets/withdraw-error/WithdrawError.js +1 -0
  201. package/dist/flows/withdraw/widgets/withdraw-error/index.d.ts +1 -0
  202. package/dist/flows/withdraw/widgets/withdraw-error/index.js +1 -0
  203. package/dist/flows/withdraw/widgets/withdraw-form/WithdrawForm.d.ts +29 -0
  204. package/dist/flows/withdraw/widgets/withdraw-form/WithdrawForm.js +1 -0
  205. package/dist/flows/withdraw/widgets/withdraw-form/compound/WithdrawForm.d.ts +55 -0
  206. package/dist/flows/withdraw/widgets/withdraw-form/compound/WithdrawForm.js +1 -0
  207. package/dist/flows/withdraw/widgets/withdraw-form/compound/WithdrawForm.slots.d.ts +31 -0
  208. package/dist/flows/withdraw/widgets/withdraw-form/compound/WithdrawForm.slots.js +1 -0
  209. package/dist/flows/withdraw/widgets/withdraw-form/compound/WithdrawForm.styles.js +1 -0
  210. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/AmountField.d.ts +12 -0
  211. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/AmountField.js +1 -0
  212. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Body.d.ts +20 -0
  213. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Body.js +1 -0
  214. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/BreakdownCard.d.ts +17 -0
  215. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/BreakdownCard.js +1 -0
  216. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Footer.d.ts +18 -0
  217. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Footer.js +1 -0
  218. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Header.d.ts +21 -0
  219. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Header.js +1 -0
  220. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/InfoTooltip.js +1 -0
  221. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/ReceiveSelectors.d.ts +13 -0
  222. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/ReceiveSelectors.js +1 -0
  223. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/RecipientField.d.ts +19 -0
  224. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/RecipientField.js +1 -0
  225. package/dist/flows/withdraw/widgets/withdraw-form/compound/context.js +1 -0
  226. package/dist/flows/withdraw/widgets/withdraw-form/compound/index.d.ts +3 -0
  227. package/dist/flows/withdraw/widgets/withdraw-form/compound/index.js +1 -0
  228. package/dist/flows/withdraw/widgets/withdraw-form/compound/types.d.ts +149 -0
  229. package/dist/flows/withdraw/widgets/withdraw-form/index.d.ts +1 -0
  230. package/dist/flows/withdraw/widgets/withdraw-form/index.js +1 -0
  231. package/dist/flows/withdraw/widgets/withdraw-form/validation.js +1 -0
  232. package/dist/flows/withdraw/widgets/withdraw-in-progress/WithdrawInProgress.d.ts +19 -0
  233. package/dist/flows/withdraw/widgets/withdraw-in-progress/WithdrawInProgress.js +1 -0
  234. package/dist/flows/withdraw/widgets/withdraw-in-progress/index.d.ts +1 -0
  235. package/dist/flows/withdraw/widgets/withdraw-in-progress/index.js +1 -0
  236. package/dist/flows/withdraw/widgets/withdraw-success/WithdrawSuccess.d.ts +20 -0
  237. package/dist/flows/withdraw/widgets/withdraw-success/WithdrawSuccess.js +1 -0
  238. package/dist/flows/withdraw/widgets/withdraw-success/index.d.ts +1 -0
  239. package/dist/flows/withdraw/widgets/withdraw-success/index.js +1 -0
  240. package/dist/format/index.d.ts +10 -0
  241. package/dist/format/index.js +1 -0
  242. package/dist/i18n/index.d.ts +9 -0
  243. package/dist/i18n/index.js +1 -0
  244. package/dist/i18n/locales/ar.d.ts +6 -0
  245. package/dist/i18n/locales/ar.js +1 -0
  246. package/dist/i18n/locales/es.d.ts +6 -0
  247. package/dist/i18n/locales/es.js +1 -0
  248. package/dist/icons/index.d.ts +27 -0
  249. package/dist/icons/index.js +1 -0
  250. package/dist/index.d.ts +26 -0
  251. package/dist/index.js +1 -0
  252. package/dist/kit/package.js +1 -0
  253. package/dist/scope/KitPortalScope.d.ts +31 -0
  254. package/dist/scope/KitPortalScope.js +1 -0
  255. package/dist/scope/KitScope.d.ts +63 -0
  256. package/dist/scope/KitScope.js +1 -0
  257. package/dist/scope/KitScope.slots.js +1 -0
  258. package/dist/scope/context.d.ts +67 -0
  259. package/dist/scope/context.js +1 -0
  260. package/dist/scope/index.d.ts +3 -0
  261. package/dist/scope/index.js +1 -0
  262. package/dist/shared/chains/index.d.ts +40 -0
  263. package/dist/shared/chains/index.js +1 -0
  264. package/dist/shared/constants/brand-links.js +1 -0
  265. package/dist/shared/dialog/DialogShell.d.ts +63 -0
  266. package/dist/shared/dialog/DialogShell.js +1 -0
  267. package/dist/shared/dialog/Frame.js +1 -0
  268. package/dist/shared/dialog/GatewayKitRoot.js +1 -0
  269. package/dist/shared/dialog/StepTransition.js +1 -0
  270. package/dist/shared/dialog/useDirectionalChevronTransform.js +1 -0
  271. package/dist/shared/driver/types.d.ts +69 -0
  272. package/dist/shared/error-handling/components/GatewayKitBoundary.js +1 -0
  273. package/dist/shared/error-handling/components/GatewayKitErrorCard/GatewayKitErrorCard.js +1 -0
  274. package/dist/shared/error-handling/components/GatewayKitErrorCard/GatewayKitErrorCard.slots.js +1 -0
  275. package/dist/shared/error-handling/components/GatewayKitErrorCard/GatewayKitErrorCard.styles.js +1 -0
  276. package/dist/shared/error-handling/components/GatewayKitErrorCard/components/Action.js +1 -0
  277. package/dist/shared/error-handling/components/GatewayKitErrorCard/components/Actions.js +1 -0
  278. package/dist/shared/error-handling/components/GatewayKitErrorCard/components/CodeSample.js +1 -0
  279. package/dist/shared/error-handling/components/GatewayKitErrorCard/components/Description.js +1 -0
  280. package/dist/shared/error-handling/components/GatewayKitErrorCard/components/DetailRow.js +1 -0
  281. package/dist/shared/error-handling/components/GatewayKitErrorCard/components/Guidance.js +1 -0
  282. package/dist/shared/error-handling/components/GatewayKitErrorCard/components/Section.js +1 -0
  283. package/dist/shared/error-handling/components/GatewayKitErrorCard/components/TechnicalDetails.js +1 -0
  284. package/dist/shared/error-handling/components/GatewayKitErrorCard/components/TechnicalDetailsToggle.js +1 -0
  285. package/dist/shared/error-handling/components/GatewayKitErrorCard/components/Title.js +1 -0
  286. package/dist/shared/error-handling/components/GatewayKitErrorCard/context.js +1 -0
  287. package/dist/shared/error-handling/components/GatewayKitErrorCard/index.js +1 -0
  288. package/dist/shared/error-handling/components/GatewayKitRecoveryError.js +1 -0
  289. package/dist/shared/error-handling/components/GatewayKitSetupError.js +1 -0
  290. package/dist/shared/error-handling/constants/guides.js +1 -0
  291. package/dist/shared/error-handling/constants/snippets.js +6 -0
  292. package/dist/shared/error-handling/index.js +1 -0
  293. package/dist/shared/error-handling/lib/isWagmiProviderMissingError.js +1 -0
  294. package/dist/shared/format/formatDurationCoarse.d.ts +29 -0
  295. package/dist/shared/format/formatDurationCoarse.js +1 -0
  296. package/dist/shared/format/formatDurationCompact.d.ts +28 -0
  297. package/dist/shared/format/formatDurationCompact.js +1 -0
  298. package/dist/shared/format/formatNetworkName.d.ts +27 -0
  299. package/dist/shared/format/formatNetworkName.js +1 -0
  300. package/dist/shared/format/formatPercent.d.ts +23 -0
  301. package/dist/shared/format/formatPercent.js +1 -0
  302. package/dist/shared/format/formatTimestamp.d.ts +22 -0
  303. package/dist/shared/format/formatTimestamp.js +1 -0
  304. package/dist/shared/format/formatTokenAmount.d.ts +46 -0
  305. package/dist/shared/format/formatTokenAmount.js +1 -0
  306. package/dist/shared/format/formatUsd.d.ts +41 -0
  307. package/dist/shared/format/formatUsd.js +1 -0
  308. package/dist/shared/format/shortenAddress.d.ts +27 -0
  309. package/dist/shared/format/shortenAddress.js +1 -0
  310. package/dist/shared/format/types.d.ts +33 -0
  311. package/dist/shared/i18n/KitI18nProvider.d.ts +23 -0
  312. package/dist/shared/i18n/KitI18nProvider.js +1 -0
  313. package/dist/shared/i18n/Trans.d.ts +39 -0
  314. package/dist/shared/i18n/Trans.js +1 -0
  315. package/dist/shared/i18n/createKitI18n.d.ts +41 -0
  316. package/dist/shared/i18n/createKitI18n.js +1 -0
  317. package/dist/shared/i18n/defaultI18n.js +1 -0
  318. package/dist/shared/i18n/getLocaleDirection.d.ts +24 -0
  319. package/dist/shared/i18n/getLocaleDirection.js +1 -0
  320. package/dist/shared/i18n/locales.d.ts +31 -0
  321. package/dist/shared/i18n/locales.js +1 -0
  322. package/dist/shared/i18n/useKitI18n.d.ts +14 -0
  323. package/dist/shared/i18n/useKitI18n.js +1 -0
  324. package/dist/shared/i18n/useLingui.d.ts +35 -0
  325. package/dist/shared/i18n/useLingui.js +1 -0
  326. package/dist/shared/i18n/useT.d.ts +25 -0
  327. package/dist/shared/i18n/useT.js +1 -0
  328. package/dist/shared/icons/AlertIcon.d.ts +12 -0
  329. package/dist/shared/icons/AlertIcon.js +1 -0
  330. package/dist/shared/icons/ArrowDownIcon.d.ts +7 -0
  331. package/dist/shared/icons/ArrowDownIcon.js +1 -0
  332. package/dist/shared/icons/ArrowRightIcon.d.ts +7 -0
  333. package/dist/shared/icons/ArrowRightIcon.js +1 -0
  334. package/dist/shared/icons/ArrowRightLeftIcon.d.ts +7 -0
  335. package/dist/shared/icons/ArrowRightLeftIcon.js +1 -0
  336. package/dist/shared/icons/CheckIcon.d.ts +7 -0
  337. package/dist/shared/icons/CheckIcon.js +1 -0
  338. package/dist/shared/icons/ChevronDownIcon.d.ts +7 -0
  339. package/dist/shared/icons/ChevronDownIcon.js +1 -0
  340. package/dist/shared/icons/ChevronLeftIcon.d.ts +7 -0
  341. package/dist/shared/icons/ChevronLeftIcon.js +1 -0
  342. package/dist/shared/icons/ChevronRightIcon.d.ts +7 -0
  343. package/dist/shared/icons/ChevronRightIcon.js +1 -0
  344. package/dist/shared/icons/ChevronUpIcon.d.ts +7 -0
  345. package/dist/shared/icons/ChevronUpIcon.js +1 -0
  346. package/dist/shared/icons/CircleArrowUpIcon.d.ts +7 -0
  347. package/dist/shared/icons/CircleArrowUpIcon.js +1 -0
  348. package/dist/shared/icons/CircleHelpIcon.d.ts +7 -0
  349. package/dist/shared/icons/CircleHelpIcon.js +1 -0
  350. package/dist/shared/icons/ClockIcon.d.ts +7 -0
  351. package/dist/shared/icons/ClockIcon.js +1 -0
  352. package/dist/shared/icons/CopyIcon.d.ts +7 -0
  353. package/dist/shared/icons/CopyIcon.js +1 -0
  354. package/dist/shared/icons/ExternalLinkIcon.d.ts +7 -0
  355. package/dist/shared/icons/ExternalLinkIcon.js +1 -0
  356. package/dist/shared/icons/InfoIcon.d.ts +7 -0
  357. package/dist/shared/icons/InfoIcon.js +1 -0
  358. package/dist/shared/icons/LoaderIcon.d.ts +7 -0
  359. package/dist/shared/icons/LoaderIcon.js +1 -0
  360. package/dist/shared/icons/MailIcon.d.ts +7 -0
  361. package/dist/shared/icons/MailIcon.js +1 -0
  362. package/dist/shared/icons/PackageIcon.d.ts +7 -0
  363. package/dist/shared/icons/PackageIcon.js +1 -0
  364. package/dist/shared/icons/QrCodeIcon.d.ts +7 -0
  365. package/dist/shared/icons/QrCodeIcon.js +1 -0
  366. package/dist/shared/icons/WalletIcon.d.ts +7 -0
  367. package/dist/shared/icons/WalletIcon.js +1 -0
  368. package/dist/shared/icons/XIcon.d.ts +7 -0
  369. package/dist/shared/icons/XIcon.js +1 -0
  370. package/dist/shared/icons/exchanges/BinanceIcon.d.ts +7 -0
  371. package/dist/shared/icons/exchanges/BinanceIcon.js +1 -0
  372. package/dist/shared/icons/exchanges/CoinbaseIcon.d.ts +7 -0
  373. package/dist/shared/icons/exchanges/CoinbaseIcon.js +1 -0
  374. package/dist/shared/icons/exchanges/KrakenIcon.d.ts +7 -0
  375. package/dist/shared/icons/exchanges/KrakenIcon.js +1 -0
  376. package/dist/shared/icons/exchanges/OkxIcon.d.ts +7 -0
  377. package/dist/shared/icons/exchanges/OkxIcon.js +1 -0
  378. package/dist/shared/icons/exchanges/RobinhoodIcon.d.ts +7 -0
  379. package/dist/shared/icons/exchanges/RobinhoodIcon.js +1 -0
  380. package/dist/shared/icons/exchanges/index.d.ts +5 -0
  381. package/dist/shared/icons/exchanges/index.js +1 -0
  382. package/dist/shared/orchestrator/failureReason.js +1 -0
  383. package/dist/shared/orchestrator/index.js +1 -0
  384. package/dist/shared/orchestrator/toFailure.js +1 -0
  385. package/dist/shared/orchestrator/types.d.ts +20 -0
  386. package/dist/shared/orchestrator/useDialogLifecycle.js +1 -0
  387. package/dist/shared/orchestrator/useDriverSettlementListener.js +1 -0
  388. package/dist/shared/orchestrator/useEffectiveState.js +1 -0
  389. package/dist/shared/orchestrator/useSettlementWatcher.js +1 -0
  390. package/dist/shared/orchestrator/userRejection.js +1 -0
  391. package/dist/shared/primitives/TxHashValue/TxHashValue.d.ts +20 -0
  392. package/dist/shared/primitives/TxHashValue/TxHashValue.js +1 -0
  393. package/dist/shared/primitives/TxHashValue/TxHashValue.slots.js +1 -0
  394. package/dist/shared/primitives/TxHashValue/TxHashValue.styles.js +1 -0
  395. package/dist/shared/primitives/TxHashValue/index.d.ts +2 -0
  396. package/dist/shared/primitives/TxHashValue/index.js +1 -0
  397. package/dist/shared/primitives/TxHashValue/types.d.ts +25 -0
  398. package/dist/shared/primitives/WalletValue/WalletValue.d.ts +40 -0
  399. package/dist/shared/primitives/WalletValue/WalletValue.js +1 -0
  400. package/dist/shared/primitives/WalletValue/index.d.ts +1 -0
  401. package/dist/shared/primitives/WalletValue/index.js +1 -0
  402. package/dist/shared/quote/index.js +1 -0
  403. package/dist/shared/quote/useQuoteCountdown.js +1 -0
  404. package/dist/shared/styles/tokens.stylex.js +1 -0
  405. package/dist/shared/ui/Alert/Alert.d.ts +105 -0
  406. package/dist/shared/ui/Alert/Alert.js +1 -0
  407. package/dist/shared/ui/Alert/Alert.slots.d.ts +10 -0
  408. package/dist/shared/ui/Alert/Alert.slots.js +1 -0
  409. package/dist/shared/ui/Alert/Alert.styles.js +1 -0
  410. package/dist/shared/ui/Alert/index.d.ts +2 -0
  411. package/dist/shared/ui/Alert/index.js +1 -0
  412. package/dist/shared/ui/AmountInput/AmountInput.d.ts +132 -0
  413. package/dist/shared/ui/AmountInput/AmountInput.js +1 -0
  414. package/dist/shared/ui/AmountInput/AmountInput.slots.d.ts +11 -0
  415. package/dist/shared/ui/AmountInput/AmountInput.slots.js +1 -0
  416. package/dist/shared/ui/AmountInput/AmountInput.styles.js +1 -0
  417. package/dist/shared/ui/AmountInput/attachInputNormalization.js +1 -0
  418. package/dist/shared/ui/AmountInput/context.js +1 -0
  419. package/dist/shared/ui/AmountInput/index.d.ts +3 -0
  420. package/dist/shared/ui/AmountInput/index.js +1 -0
  421. package/dist/shared/ui/AmountInput/useAutoShrinkFontSize.js +14 -0
  422. package/dist/shared/ui/AmountInput/utils.d.ts +12 -0
  423. package/dist/shared/ui/AmountInput/utils.js +1 -0
  424. package/dist/shared/ui/Badge/Badge.d.ts +89 -0
  425. package/dist/shared/ui/Badge/Badge.js +1 -0
  426. package/dist/shared/ui/Badge/Badge.slots.d.ts +7 -0
  427. package/dist/shared/ui/Badge/Badge.slots.js +1 -0
  428. package/dist/shared/ui/Badge/Badge.styles.js +1 -0
  429. package/dist/shared/ui/Badge/index.d.ts +2 -0
  430. package/dist/shared/ui/Badge/index.js +1 -0
  431. package/dist/shared/ui/Button/Button.d.ts +82 -0
  432. package/dist/shared/ui/Button/Button.js +1 -0
  433. package/dist/shared/ui/Button/Button.slots.d.ts +7 -0
  434. package/dist/shared/ui/Button/Button.slots.js +1 -0
  435. package/dist/shared/ui/Button/Button.styles.js +1 -0
  436. package/dist/shared/ui/Button/index.d.ts +2 -0
  437. package/dist/shared/ui/Button/index.js +1 -0
  438. package/dist/shared/ui/Card/Card.d.ts +93 -0
  439. package/dist/shared/ui/Card/Card.js +1 -0
  440. package/dist/shared/ui/Card/Card.slots.d.ts +10 -0
  441. package/dist/shared/ui/Card/Card.slots.js +1 -0
  442. package/dist/shared/ui/Card/Card.styles.js +1 -0
  443. package/dist/shared/ui/Card/index.d.ts +2 -0
  444. package/dist/shared/ui/Card/index.js +1 -0
  445. package/dist/shared/ui/Collapsible/Collapsible.d.ts +57 -0
  446. package/dist/shared/ui/Collapsible/Collapsible.js +1 -0
  447. package/dist/shared/ui/Collapsible/Collapsible.slots.d.ts +10 -0
  448. package/dist/shared/ui/Collapsible/Collapsible.slots.js +1 -0
  449. package/dist/shared/ui/Collapsible/Collapsible.styles.js +1 -0
  450. package/dist/shared/ui/Collapsible/index.d.ts +2 -0
  451. package/dist/shared/ui/Collapsible/index.js +1 -0
  452. package/dist/shared/ui/Details/Details.d.ts +76 -0
  453. package/dist/shared/ui/Details/Details.js +1 -0
  454. package/dist/shared/ui/Details/Details.slots.d.ts +9 -0
  455. package/dist/shared/ui/Details/Details.slots.js +1 -0
  456. package/dist/shared/ui/Details/Details.styles.js +1 -0
  457. package/dist/shared/ui/Details/index.d.ts +2 -0
  458. package/dist/shared/ui/Details/index.js +1 -0
  459. package/dist/shared/ui/Dialog/Dialog.d.ts +147 -0
  460. package/dist/shared/ui/Dialog/Dialog.js +1 -0
  461. package/dist/shared/ui/Dialog/Dialog.slots.d.ts +17 -0
  462. package/dist/shared/ui/Dialog/Dialog.slots.js +1 -0
  463. package/dist/shared/ui/Dialog/Dialog.styles.js +1 -0
  464. package/dist/shared/ui/Dialog/index.d.ts +2 -0
  465. package/dist/shared/ui/Dialog/index.js +1 -0
  466. package/dist/shared/ui/ExternalLink/ExternalLink.d.ts +41 -0
  467. package/dist/shared/ui/ExternalLink/ExternalLink.js +1 -0
  468. package/dist/shared/ui/ExternalLink/ExternalLink.slots.d.ts +7 -0
  469. package/dist/shared/ui/ExternalLink/ExternalLink.slots.js +1 -0
  470. package/dist/shared/ui/ExternalLink/ExternalLink.styles.js +1 -0
  471. package/dist/shared/ui/ExternalLink/index.d.ts +2 -0
  472. package/dist/shared/ui/ExternalLink/index.js +1 -0
  473. package/dist/shared/ui/ExternalLink/toSafeHref.js +1 -0
  474. package/dist/shared/ui/Field/Field.d.ts +185 -0
  475. package/dist/shared/ui/Field/Field.js +1 -0
  476. package/dist/shared/ui/Field/Field.slots.d.ts +21 -0
  477. package/dist/shared/ui/Field/Field.slots.js +1 -0
  478. package/dist/shared/ui/Field/Field.styles.js +1 -0
  479. package/dist/shared/ui/Field/index.d.ts +2 -0
  480. package/dist/shared/ui/Field/index.js +1 -0
  481. package/dist/shared/ui/IconButton/IconButton.d.ts +48 -0
  482. package/dist/shared/ui/IconButton/IconButton.js +1 -0
  483. package/dist/shared/ui/IconButton/IconButton.slots.d.ts +7 -0
  484. package/dist/shared/ui/IconButton/IconButton.slots.js +1 -0
  485. package/dist/shared/ui/IconButton/IconButton.styles.js +1 -0
  486. package/dist/shared/ui/IconButton/index.d.ts +2 -0
  487. package/dist/shared/ui/IconButton/index.js +1 -0
  488. package/dist/shared/ui/Image/Image.d.ts +43 -0
  489. package/dist/shared/ui/Image/Image.js +1 -0
  490. package/dist/shared/ui/Image/Image.slots.d.ts +14 -0
  491. package/dist/shared/ui/Image/Image.slots.js +1 -0
  492. package/dist/shared/ui/Image/Image.styles.js +1 -0
  493. package/dist/shared/ui/Image/index.d.ts +3 -0
  494. package/dist/shared/ui/Image/index.js +1 -0
  495. package/dist/shared/ui/Image/types.d.ts +131 -0
  496. package/dist/shared/ui/InputGroup/InputGroup.d.ts +129 -0
  497. package/dist/shared/ui/InputGroup/InputGroup.js +1 -0
  498. package/dist/shared/ui/InputGroup/InputGroup.slots.d.ts +16 -0
  499. package/dist/shared/ui/InputGroup/InputGroup.slots.js +1 -0
  500. package/dist/shared/ui/InputGroup/InputGroup.styles.js +1 -0
  501. package/dist/shared/ui/InputGroup/index.d.ts +2 -0
  502. package/dist/shared/ui/InputGroup/index.js +1 -0
  503. package/dist/shared/ui/LtrAtom/LtrAtom.d.ts +31 -0
  504. package/dist/shared/ui/LtrAtom/LtrAtom.js +1 -0
  505. package/dist/shared/ui/LtrAtom/index.d.ts +1 -0
  506. package/dist/shared/ui/LtrAtom/index.js +1 -0
  507. package/dist/shared/ui/ScrollArea/ScrollArea.d.ts +86 -0
  508. package/dist/shared/ui/ScrollArea/ScrollArea.js +1 -0
  509. package/dist/shared/ui/ScrollArea/ScrollArea.slots.d.ts +12 -0
  510. package/dist/shared/ui/ScrollArea/ScrollArea.slots.js +1 -0
  511. package/dist/shared/ui/ScrollArea/ScrollArea.styles.js +1 -0
  512. package/dist/shared/ui/ScrollArea/index.d.ts +2 -0
  513. package/dist/shared/ui/ScrollArea/index.js +1 -0
  514. package/dist/shared/ui/Select/Select.context.d.ts +10 -0
  515. package/dist/shared/ui/Select/Select.context.js +1 -0
  516. package/dist/shared/ui/Select/Select.d.ts +243 -0
  517. package/dist/shared/ui/Select/Select.js +1 -0
  518. package/dist/shared/ui/Select/Select.slots.d.ts +20 -0
  519. package/dist/shared/ui/Select/Select.slots.js +1 -0
  520. package/dist/shared/ui/Select/Select.styles.js +1 -0
  521. package/dist/shared/ui/Select/index.d.ts +3 -0
  522. package/dist/shared/ui/Select/index.js +1 -0
  523. package/dist/shared/ui/SelectableTile/SelectableTile.d.ts +83 -0
  524. package/dist/shared/ui/SelectableTile/SelectableTile.js +1 -0
  525. package/dist/shared/ui/SelectableTile/SelectableTile.slots.d.ts +7 -0
  526. package/dist/shared/ui/SelectableTile/SelectableTile.slots.js +1 -0
  527. package/dist/shared/ui/SelectableTile/SelectableTile.styles.js +1 -0
  528. package/dist/shared/ui/SelectableTile/SelectableTileGroup.d.ts +82 -0
  529. package/dist/shared/ui/SelectableTile/SelectableTileGroup.js +1 -0
  530. package/dist/shared/ui/SelectableTile/index.d.ts +3 -0
  531. package/dist/shared/ui/SelectableTile/index.js +1 -0
  532. package/dist/shared/ui/Skeleton/Skeleton.d.ts +41 -0
  533. package/dist/shared/ui/Skeleton/Skeleton.js +1 -0
  534. package/dist/shared/ui/Skeleton/Skeleton.slots.d.ts +7 -0
  535. package/dist/shared/ui/Skeleton/Skeleton.slots.js +1 -0
  536. package/dist/shared/ui/Skeleton/Skeleton.styles.js +1 -0
  537. package/dist/shared/ui/Skeleton/index.d.ts +2 -0
  538. package/dist/shared/ui/Skeleton/index.js +1 -0
  539. package/dist/shared/ui/Text/Text.d.ts +87 -0
  540. package/dist/shared/ui/Text/Text.js +1 -0
  541. package/dist/shared/ui/Text/Text.slots.d.ts +7 -0
  542. package/dist/shared/ui/Text/Text.slots.js +1 -0
  543. package/dist/shared/ui/Text/Text.styles.js +1 -0
  544. package/dist/shared/ui/Text/index.d.ts +2 -0
  545. package/dist/shared/ui/Text/index.js +1 -0
  546. package/dist/shared/ui/TokenLogo/TokenLogo.d.ts +41 -0
  547. package/dist/shared/ui/TokenLogo/TokenLogo.js +1 -0
  548. package/dist/shared/ui/TokenLogo/index.d.ts +2 -0
  549. package/dist/shared/ui/TokenLogo/index.js +1 -0
  550. package/dist/shared/ui/TokenLogo/types.d.ts +64 -0
  551. package/dist/shared/ui/Tooltip/Tooltip.d.ts +171 -0
  552. package/dist/shared/ui/Tooltip/Tooltip.js +1 -0
  553. package/dist/shared/ui/Tooltip/Tooltip.slots.d.ts +11 -0
  554. package/dist/shared/ui/Tooltip/Tooltip.slots.js +1 -0
  555. package/dist/shared/ui/Tooltip/Tooltip.styles.js +1 -0
  556. package/dist/shared/ui/Tooltip/index.d.ts +2 -0
  557. package/dist/shared/ui/Tooltip/index.js +1 -0
  558. package/dist/shared/ui/WalletRow/WalletRow.d.ts +55 -0
  559. package/dist/shared/ui/WalletRow/WalletRow.js +1 -0
  560. package/dist/shared/ui/WalletRow/WalletRow.slots.d.ts +7 -0
  561. package/dist/shared/ui/WalletRow/WalletRow.slots.js +1 -0
  562. package/dist/shared/ui/WalletRow/WalletRow.styles.js +1 -0
  563. package/dist/shared/ui/WalletRow/index.d.ts +2 -0
  564. package/dist/shared/ui/WalletRow/index.js +1 -0
  565. package/dist/shared/utils/explorers.js +1 -0
  566. package/dist/shared/utils/joinClassNames.js +1 -0
  567. package/dist/shared/utils/logos/api.d.ts +54 -0
  568. package/dist/shared/utils/logos/api.js +1 -0
  569. package/dist/shared/utils/logos/chains.d.ts +32 -0
  570. package/dist/shared/utils/logos/chains.js +1 -0
  571. package/dist/shared/utils/logos/conventionUrls.js +1 -0
  572. package/dist/shared/utils/logos/index.js +1 -0
  573. package/dist/shared/utils/logos/resolveLogoSrc.js +1 -0
  574. package/dist/shared/utils/logos/types.d.ts +62 -0
  575. package/dist/shared/utils/mergeClassName.js +1 -0
  576. package/dist/shared/utils/mergeStyle.js +1 -0
  577. package/dist/shared/wallet/resolveSupportedChainIds.js +1 -0
  578. package/dist/shared/wallet/resolveSupportedChains.js +1 -0
  579. package/dist/shared/wallet/types.d.ts +103 -0
  580. package/dist/shared/wallet/useWalletState.d.ts +21 -0
  581. package/dist/shared/wallet/useWalletState.js +1 -0
  582. package/dist/shared/widgets/amount-entry/compound/AmountEntry.d.ts +59 -0
  583. package/dist/shared/widgets/amount-entry/compound/AmountEntry.js +1 -0
  584. package/dist/shared/widgets/amount-entry/compound/AmountEntry.slots.d.ts +15 -0
  585. package/dist/shared/widgets/amount-entry/compound/AmountEntry.slots.js +1 -0
  586. package/dist/shared/widgets/amount-entry/compound/AmountEntry.styles.js +1 -0
  587. package/dist/shared/widgets/amount-entry/compound/components/Flow.d.ts +14 -0
  588. package/dist/shared/widgets/amount-entry/compound/components/Flow.js +1 -0
  589. package/dist/shared/widgets/amount-entry/compound/components/Footer.d.ts +22 -0
  590. package/dist/shared/widgets/amount-entry/compound/components/Footer.js +1 -0
  591. package/dist/shared/widgets/amount-entry/compound/components/Header.d.ts +15 -0
  592. package/dist/shared/widgets/amount-entry/compound/components/Header.js +1 -0
  593. package/dist/shared/widgets/amount-entry/compound/components/Hero/Hero.d.ts +22 -0
  594. package/dist/shared/widgets/amount-entry/compound/components/Hero/Hero.js +1 -0
  595. package/dist/shared/widgets/amount-entry/compound/components/Hero/StaticBand.js +1 -0
  596. package/dist/shared/widgets/amount-entry/compound/components/Hero/SwapBackdrop.js +1 -0
  597. package/dist/shared/widgets/amount-entry/compound/components/Hero/index.d.ts +1 -0
  598. package/dist/shared/widgets/amount-entry/compound/components/Hero/index.js +1 -0
  599. package/dist/shared/widgets/amount-entry/compound/components/Hero/transitions.js +1 -0
  600. package/dist/shared/widgets/amount-entry/compound/components/Hero/useSwapState.js +1 -0
  601. package/dist/shared/widgets/amount-entry/compound/components/Hero/utils.js +1 -0
  602. package/dist/shared/widgets/amount-entry/compound/components/Pills.d.ts +22 -0
  603. package/dist/shared/widgets/amount-entry/compound/components/Pills.js +1 -0
  604. package/dist/shared/widgets/amount-entry/compound/context.js +1 -0
  605. package/dist/shared/widgets/amount-entry/compound/index.d.ts +3 -0
  606. package/dist/shared/widgets/amount-entry/compound/index.js +1 -0
  607. package/dist/shared/widgets/amount-entry/compound/types.d.ts +224 -0
  608. package/dist/shared/widgets/asset-descriptor.d.ts +27 -0
  609. package/dist/shared/widgets/asset-descriptor.js +1 -0
  610. package/dist/shared/widgets/asset-picker/compound/AssetPicker.d.ts +51 -0
  611. package/dist/shared/widgets/asset-picker/compound/AssetPicker.js +1 -0
  612. package/dist/shared/widgets/asset-picker/compound/AssetPicker.slots.d.ts +11 -0
  613. package/dist/shared/widgets/asset-picker/compound/AssetPicker.slots.js +1 -0
  614. package/dist/shared/widgets/asset-picker/compound/AssetPicker.styles.js +1 -0
  615. package/dist/shared/widgets/asset-picker/compound/components/Asset.d.ts +30 -0
  616. package/dist/shared/widgets/asset-picker/compound/components/Asset.js +1 -0
  617. package/dist/shared/widgets/asset-picker/compound/components/Footer.d.ts +16 -0
  618. package/dist/shared/widgets/asset-picker/compound/components/Footer.js +1 -0
  619. package/dist/shared/widgets/asset-picker/compound/components/Header.d.ts +19 -0
  620. package/dist/shared/widgets/asset-picker/compound/components/Header.js +1 -0
  621. package/dist/shared/widgets/asset-picker/compound/components/List.d.ts +22 -0
  622. package/dist/shared/widgets/asset-picker/compound/components/List.js +1 -0
  623. package/dist/shared/widgets/asset-picker/compound/context.js +1 -0
  624. package/dist/shared/widgets/asset-picker/compound/index.d.ts +3 -0
  625. package/dist/shared/widgets/asset-picker/compound/index.js +1 -0
  626. package/dist/shared/widgets/asset-picker/compound/types.d.ts +212 -0
  627. package/dist/shared/widgets/confirm-transfer/compound/ConfirmTransfer.d.ts +64 -0
  628. package/dist/shared/widgets/confirm-transfer/compound/ConfirmTransfer.js +1 -0
  629. package/dist/shared/widgets/confirm-transfer/compound/ConfirmTransfer.slots.d.ts +16 -0
  630. package/dist/shared/widgets/confirm-transfer/compound/ConfirmTransfer.slots.js +1 -0
  631. package/dist/shared/widgets/confirm-transfer/compound/ConfirmTransfer.styles.js +1 -0
  632. package/dist/shared/widgets/confirm-transfer/compound/components/Amounts.d.ts +15 -0
  633. package/dist/shared/widgets/confirm-transfer/compound/components/Amounts.js +1 -0
  634. package/dist/shared/widgets/confirm-transfer/compound/components/Breakdown.d.ts +17 -0
  635. package/dist/shared/widgets/confirm-transfer/compound/components/Breakdown.js +1 -0
  636. package/dist/shared/widgets/confirm-transfer/compound/components/Disclaimer.d.ts +15 -0
  637. package/dist/shared/widgets/confirm-transfer/compound/components/Disclaimer.js +1 -0
  638. package/dist/shared/widgets/confirm-transfer/compound/components/Footer.d.ts +26 -0
  639. package/dist/shared/widgets/confirm-transfer/compound/components/Footer.js +1 -0
  640. package/dist/shared/widgets/confirm-transfer/compound/components/Header.d.ts +13 -0
  641. package/dist/shared/widgets/confirm-transfer/compound/components/Header.js +1 -0
  642. package/dist/shared/widgets/confirm-transfer/compound/components/Hero.d.ts +16 -0
  643. package/dist/shared/widgets/confirm-transfer/compound/components/Hero.js +1 -0
  644. package/dist/shared/widgets/confirm-transfer/compound/components/Meta.d.ts +16 -0
  645. package/dist/shared/widgets/confirm-transfer/compound/components/Meta.js +1 -0
  646. package/dist/shared/widgets/confirm-transfer/compound/components/QuoteTimer.js +1 -0
  647. package/dist/shared/widgets/confirm-transfer/compound/components/splitAmount.js +1 -0
  648. package/dist/shared/widgets/confirm-transfer/compound/context.js +1 -0
  649. package/dist/shared/widgets/confirm-transfer/compound/index.d.ts +3 -0
  650. package/dist/shared/widgets/confirm-transfer/compound/index.js +1 -0
  651. package/dist/shared/widgets/confirm-transfer/compound/types.d.ts +338 -0
  652. package/dist/shared/widgets/error-state/compound/ErrorState.d.ts +96 -0
  653. package/dist/shared/widgets/error-state/compound/ErrorState.js +1 -0
  654. package/dist/shared/widgets/error-state/compound/ErrorState.slots.d.ts +18 -0
  655. package/dist/shared/widgets/error-state/compound/ErrorState.slots.js +1 -0
  656. package/dist/shared/widgets/error-state/compound/ErrorState.styles.js +1 -0
  657. package/dist/shared/widgets/error-state/compound/components/Actions.d.ts +17 -0
  658. package/dist/shared/widgets/error-state/compound/components/Actions.js +1 -0
  659. package/dist/shared/widgets/error-state/compound/components/AssetValue.d.ts +20 -0
  660. package/dist/shared/widgets/error-state/compound/components/AssetValue.js +1 -0
  661. package/dist/shared/widgets/error-state/compound/components/Detail.d.ts +14 -0
  662. package/dist/shared/widgets/error-state/compound/components/Detail.js +1 -0
  663. package/dist/shared/widgets/error-state/compound/components/Details.d.ts +12 -0
  664. package/dist/shared/widgets/error-state/compound/components/Details.js +1 -0
  665. package/dist/shared/widgets/error-state/compound/components/DisclosureChevron.d.ts +11 -0
  666. package/dist/shared/widgets/error-state/compound/components/DisclosureChevron.js +1 -0
  667. package/dist/shared/widgets/error-state/compound/components/Header.d.ts +13 -0
  668. package/dist/shared/widgets/error-state/compound/components/Header.js +1 -0
  669. package/dist/shared/widgets/error-state/compound/components/HelpInfo.d.ts +10 -0
  670. package/dist/shared/widgets/error-state/compound/components/HelpInfo.js +1 -0
  671. package/dist/shared/widgets/error-state/compound/components/Hero.d.ts +9 -0
  672. package/dist/shared/widgets/error-state/compound/components/Hero.js +1 -0
  673. package/dist/shared/widgets/error-state/compound/components/MoreDetails.d.ts +18 -0
  674. package/dist/shared/widgets/error-state/compound/components/MoreDetails.js +1 -0
  675. package/dist/shared/widgets/error-state/compound/components/Rows.d.ts +57 -0
  676. package/dist/shared/widgets/error-state/compound/components/Rows.js +1 -0
  677. package/dist/shared/widgets/error-state/compound/components/StatusValue.d.ts +14 -0
  678. package/dist/shared/widgets/error-state/compound/components/StatusValue.js +1 -0
  679. package/dist/shared/widgets/error-state/compound/context.js +1 -0
  680. package/dist/shared/widgets/error-state/compound/index.d.ts +3 -0
  681. package/dist/shared/widgets/error-state/compound/index.js +1 -0
  682. package/dist/shared/widgets/error-state/compound/types.d.ts +291 -0
  683. package/dist/shared/widgets/processing-state/compound/ProcessingState.d.ts +77 -0
  684. package/dist/shared/widgets/processing-state/compound/ProcessingState.js +1 -0
  685. package/dist/shared/widgets/processing-state/compound/ProcessingState.slots.d.ts +15 -0
  686. package/dist/shared/widgets/processing-state/compound/ProcessingState.slots.js +1 -0
  687. package/dist/shared/widgets/processing-state/compound/ProcessingState.styles.js +1 -0
  688. package/dist/shared/widgets/processing-state/compound/components/Actions.d.ts +17 -0
  689. package/dist/shared/widgets/processing-state/compound/components/Actions.js +1 -0
  690. package/dist/shared/widgets/processing-state/compound/components/Detail.d.ts +14 -0
  691. package/dist/shared/widgets/processing-state/compound/components/Detail.js +1 -0
  692. package/dist/shared/widgets/processing-state/compound/components/Details.d.ts +12 -0
  693. package/dist/shared/widgets/processing-state/compound/components/Details.js +1 -0
  694. package/dist/shared/widgets/processing-state/compound/components/Header.d.ts +15 -0
  695. package/dist/shared/widgets/processing-state/compound/components/Header.js +1 -0
  696. package/dist/shared/widgets/processing-state/compound/components/Hero.d.ts +16 -0
  697. package/dist/shared/widgets/processing-state/compound/components/Hero.js +1 -0
  698. package/dist/shared/widgets/processing-state/compound/components/Rows.d.ts +36 -0
  699. package/dist/shared/widgets/processing-state/compound/components/Rows.js +1 -0
  700. package/dist/shared/widgets/processing-state/compound/components/StatusPill.d.ts +13 -0
  701. package/dist/shared/widgets/processing-state/compound/components/StatusPill.js +1 -0
  702. package/dist/shared/widgets/processing-state/compound/context.js +1 -0
  703. package/dist/shared/widgets/processing-state/compound/index.d.ts +3 -0
  704. package/dist/shared/widgets/processing-state/compound/index.js +1 -0
  705. package/dist/shared/widgets/processing-state/compound/types.d.ts +216 -0
  706. package/dist/shared/widgets/success-state/compound/SuccessState.d.ts +105 -0
  707. package/dist/shared/widgets/success-state/compound/SuccessState.js +1 -0
  708. package/dist/shared/widgets/success-state/compound/SuccessState.slots.d.ts +21 -0
  709. package/dist/shared/widgets/success-state/compound/SuccessState.slots.js +1 -0
  710. package/dist/shared/widgets/success-state/compound/SuccessState.styles.js +1 -0
  711. package/dist/shared/widgets/success-state/compound/components/Actions.d.ts +18 -0
  712. package/dist/shared/widgets/success-state/compound/components/Actions.js +1 -0
  713. package/dist/shared/widgets/success-state/compound/components/AssetValue.d.ts +18 -0
  714. package/dist/shared/widgets/success-state/compound/components/AssetValue.js +1 -0
  715. package/dist/shared/widgets/success-state/compound/components/Detail.d.ts +18 -0
  716. package/dist/shared/widgets/success-state/compound/components/Detail.js +1 -0
  717. package/dist/shared/widgets/success-state/compound/components/Details.d.ts +16 -0
  718. package/dist/shared/widgets/success-state/compound/components/Details.js +1 -0
  719. package/dist/shared/widgets/success-state/compound/components/Header.d.ts +13 -0
  720. package/dist/shared/widgets/success-state/compound/components/Header.js +1 -0
  721. package/dist/shared/widgets/success-state/compound/components/Headline.d.ts +16 -0
  722. package/dist/shared/widgets/success-state/compound/components/Headline.js +1 -0
  723. package/dist/shared/widgets/success-state/compound/components/Hero.d.ts +10 -0
  724. package/dist/shared/widgets/success-state/compound/components/Hero.js +1 -0
  725. package/dist/shared/widgets/success-state/compound/components/MoreDetails.d.ts +19 -0
  726. package/dist/shared/widgets/success-state/compound/components/MoreDetails.js +1 -0
  727. package/dist/shared/widgets/success-state/compound/components/RouteValue.d.ts +15 -0
  728. package/dist/shared/widgets/success-state/compound/components/RouteValue.js +1 -0
  729. package/dist/shared/widgets/success-state/compound/components/Rows.d.ts +69 -0
  730. package/dist/shared/widgets/success-state/compound/components/Rows.js +1 -0
  731. package/dist/shared/widgets/success-state/compound/components/StatusPill.d.ts +13 -0
  732. package/dist/shared/widgets/success-state/compound/components/StatusPill.js +1 -0
  733. package/dist/shared/widgets/success-state/compound/context.js +1 -0
  734. package/dist/shared/widgets/success-state/compound/index.d.ts +3 -0
  735. package/dist/shared/widgets/success-state/compound/index.js +1 -0
  736. package/dist/shared/widgets/success-state/compound/types.d.ts +307 -0
  737. package/dist/storage/adapters.d.ts +29 -0
  738. package/dist/storage/adapters.js +1 -0
  739. package/dist/storage/context.d.ts +62 -0
  740. package/dist/storage/context.js +1 -0
  741. package/dist/storage/createKitStorage.d.ts +45 -0
  742. package/dist/storage/createKitStorage.js +1 -0
  743. package/dist/storage/index.d.ts +4 -0
  744. package/dist/storage/index.js +1 -0
  745. package/dist/storage/types.d.ts +26 -0
  746. package/dist/stridge/StridgeContext.d.ts +29 -0
  747. package/dist/stridge/StridgeContext.js +1 -0
  748. package/dist/stridge/StridgeProvider.d.ts +158 -0
  749. package/dist/stridge/StridgeProvider.js +1 -0
  750. package/dist/stridge/stubs.js +1 -0
  751. package/dist/styles/index.css +3494 -0
  752. package/dist/types.d.ts +15 -0
  753. package/dist/types.js +1 -0
  754. package/dist/ui/index.d.ts +48 -0
  755. package/dist/ui/index.js +1 -0
  756. package/dist/utils/src/use-copy-to-clipboard.js +1 -0
  757. package/dist/wallet/index.d.ts +3 -0
  758. package/dist/wallet/index.js +1 -0
  759. package/dist/withdraw/compound/index.d.ts +22 -0
  760. package/dist/withdraw/compound/index.js +1 -0
  761. package/dist/withdraw/dialog/index.d.ts +2 -0
  762. package/dist/withdraw/dialog/index.js +1 -0
  763. package/package.json +156 -0
@@ -0,0 +1 @@
1
+ import{classifyFailureKind as e,classifySettlementStatus as t}from"../../../shared/transformers/classifySettlementStatus.js";import{parseDecimalSafe as n,parseSmallestUnit as r}from"../../../shared/transformers/parseSmallestUnit.js";import{parseIsoMs as i}from"../../../shared/transformers/parseIsoMs.js";import"../../../shared/transformers/pickRelevantSettlement.js";import{formatDurationCompact as a}from"../../../../shared/format/formatDurationCompact.js";import{formatTimestamp as o}from"../../../../shared/format/formatTimestamp.js";import{formatTokenAmount as s}from"../../../../shared/format/formatTokenAmount.js";import{shortenAddress as c}from"../../../../shared/format/shortenAddress.js";function l(e,n,r){let i=t(e.status);return i===`completed`?d(e,n,r):i===`failed`?f(e,n,r):u(e,n,r)}function u(e,t,n){let r=e.from,a=i(r?.confirmed_at)??i(e.created_at),l=i(r?.confirmed_at)??i(e.created_at)??Date.now(),u=m(e.to,t.destination.asset_decimals);return{kind:`pending`,sourceWallet:p(n),creditedAsset:{symbol:t.destination.asset_symbol,decimals:t.destination.asset_decimals,address:t.destination.asset_address??``,isNative:!t.destination.asset_address},creditedTo:n.brandName??t.destination.address,...r?.tx_id?{txHash:{value:r.tx_id,formatted:c(r.tx_id)},...h(r,n,r.tx_id)?{txExplorerUrl:h(r,n,r.tx_id)}:{}}:{},...a===void 0?{}:{detectedAt:{value:a,formatted:o(a,n.i18n)}},submittedAt:{value:l,formatted:o(l,n.i18n)},receiveAmount:{value:u,formatted:s(u,n.i18n,{maxDecimals:t.destination.asset_decimals})}}}function d(e,t,n){let r=e.from,l=e.to,u=i(r?.confirmed_at)??i(e.created_at)??Date.now(),d=i(l?.settled_at)??i(e.updated_at)??Date.now(),f=Math.max(0,d-u),_=m(l,t.destination.asset_decimals),v=t.destination.address;return{kind:`succeeded`,sourceWallet:p(n),destination:{...n.brandName?{name:n.brandName}:{},address:{value:v,formatted:c(v)}},creditedAsset:{symbol:t.destination.asset_symbol,decimals:t.destination.asset_decimals,address:t.destination.asset_address??``,isNative:!t.destination.asset_address},receiveAmount:{value:_,formatted:s(_,n.i18n,{maxDecimals:t.destination.asset_decimals})},routeHops:g(e),totalTime:{value:f,formatted:a(f,n.i18n)},...r?.tx_id?{depositTx:{hash:{value:r.tx_id,formatted:c(r.tx_id)},...h(r,n,r.tx_id)?{explorerUrl:h(r,n,r.tx_id)}:{}}}:{depositTx:{hash:{value:``,formatted:``}}},...l?.tx_id?{completionTx:{hash:{value:l.tx_id,formatted:c(l.tx_id)},...h(l,n,l.tx_id)?{explorerUrl:h(l,n,l.tx_id)}:{}}}:{},submittedAt:{value:u,formatted:o(u,n.i18n)},filledAt:{value:d,formatted:o(d,n.i18n)}}}function f(t,n,r){let a=t.from,l=i(a?.confirmed_at)??i(t.created_at)??Date.now(),u=i(t.updated_at)??Date.now(),d=a?.tx_id??``,f=n.destination.address;return{kind:`failed`,failureKind:e(t.error),sourceWallet:p(r),destination:{...r.brandName?{name:r.brandName}:{},address:{value:f,formatted:c(f)}},creditedAsset:{symbol:n.destination.asset_symbol,decimals:n.destination.asset_decimals,address:n.destination.asset_address??``,isNative:!n.destination.asset_address},receiveAmount:{value:0,formatted:s(0,r.i18n)},txHash:{value:d,formatted:d?c(d):``},...h(a,r,d)?{txExplorerUrl:h(a,r,d)}:{},submittedAt:{value:l,formatted:o(l,r.i18n)},failedAt:{value:u,formatted:o(u,r.i18n)}}}function p(e){return{...e.sourceWallet.name?{name:e.sourceWallet.name}:{},address:{value:e.sourceWallet.address,formatted:c(e.sourceWallet.address)},...e.sourceWallet.explorerUrl?{explorerUrl:e.sourceWallet.explorerUrl}:{}}}function m(e,t){if(!e)return 0;if(e.amount){let t=n(e.amount);if(t>0)return t}return e.raw_amount?r(e.raw_amount,t):0}function h(e,t,n){if(!e||!n)return;let r=e.eip155_id===void 0?void 0:Number(e.eip155_id);if(r===void 0||!t.explorers)return;let i=t.explorers[r];if(i)return`${i.replace(/\/+$/,``)}/tx/${n}`}function g(e){let t=e.from,n=e.to,r=e.route?.provider??``,i=[];return t?.eip155_id!==void 0&&i.push({provider:r,chainId:Number(t.eip155_id)}),n?.eip155_id!==void 0&&n.eip155_id!==t?.eip155_id&&i.push({provider:r,chainId:Number(n.eip155_id)}),i}export{l as settlementToPayload};
@@ -0,0 +1 @@
1
+ import{formatNetworkName as e}from"../../../../shared/format/formatNetworkName.js";import{formatUsd as t}from"../../../../shared/format/formatUsd.js";import{shortenAddress as n}from"../../../../shared/format/shortenAddress.js";const r=new Set([11155111,5,80001,80002,84532,421614,11155420,97]);function i(i,o={}){let s=o.includeTestnets??!1;return i.flatMap(i=>{let c=String(i.eip155_id??``),l=Number(c);if(!s&&Number.isFinite(l)&&r.has(l))return[];let u=o.explorers?.[l],d=o.i18n&&c?o.minDepositUsdByEip155Id?.[c]:void 0,f=a(i.accepted_assets,c?o.nativeAssetByEip155Id?.[c]:void 0);return[{networkName:e(i.network_name??``),...c?{eip155Id:c}:{},...o.chainLogos?.[c]?{chainLogoUrl:o.chainLogos[c]}:{},address:{value:i.address,formatted:n(i.address)},...u?{explorerUrl:`${u.replace(/\/+$/,``)}/address/${i.address}`}:{},...d!==void 0&&o.i18n?{minDepositUsd:{value:d,formatted:t(d,o.i18n)}}:{},...f.length>0?{acceptedAssets:f}:{}}]})}function a(e,t){let n=Array.isArray(e)?e.map(o):[];return!t||new Set(n.map(e=>e.symbol.toUpperCase())).has(t.symbol.toUpperCase())?n:[t,...n]}function o(e){let t=e.logo,n=!e.address;return{symbol:e.symbol,address:e.address,decimals:e.decimals,...typeof t==`string`&&t.length>0?{assetLogoUrl:t}:{},isNative:n}}export{i as startToAddressesPayload};
@@ -0,0 +1 @@
1
+ function e(e){let n=t(e,`brand_name`),r=t(e,`checkout_item_title`),i={};return n!==void 0&&(i.name=n),r!==void 0&&(i.checkoutItemTitle=r),i}function t(e,t){if(!e)return;let n=e[t];if(typeof n!=`string`)return;let r=n.trim();return r.length>0?r:void 0}export{e as startToBrandPayload};
@@ -0,0 +1 @@
1
+ import{formatNetworkName as e}from"../../../../shared/format/formatNetworkName.js";import{formatUsd as t}from"../../../../shared/format/formatUsd.js";function n(n,r){let i=n.assets.find(e=>String(e.network_id)===r.networkId);if(!i)return;let a=i.assets.find(e=>e.symbol.toUpperCase()===r.assetSymbol.toUpperCase());if(!a)return;let o=i.native_currency?.logo;return{networkId:r.networkId,networkName:e(i.network_name),eip155Id:String(i.eip155_id),...o?{chainLogoUrl:o}:{},symbol:a.symbol,decimals:a.decimals,address:a.address??``,isNative:!a.address,...a.logo?{assetLogoUrl:a.logo}:{},...r.minDepositUsd===void 0?{}:{minDepositUsd:{value:r.minDepositUsd,formatted:t(r.minDepositUsd,r.i18n)}}}}export{n as startToTargetPayload};
@@ -0,0 +1 @@
1
+ import{shortenAddress as e}from"../../../../shared/format/shortenAddress.js";function t(t){return{address:{value:t.address,formatted:e(t.address)},...t.chainId===void 0?{}:{chainId:t.chainId}}}export{t as walletAddressToWalletPayload};
@@ -0,0 +1,177 @@
1
+ import { Entity, SettlementFailureKind, TxRef } from "../../../shared/driver/types.js";
2
+ import { AcceptedAssetPayload, AddressItemPayload, AssetPayload, BalanceItemPayload, BrandPayload, ChainPayload, QuoteBreakdownPayload, QuotePayload, QuoteRoutePayload, SettlementFailurePayload, SettlementPayload, SettlementPendingPayload, SettlementSuccessPayload, SourceWalletPayload, TargetPayload, WalletInfo, WalletPayload } from "./payloads.js";
3
+ import { DepositAddressDto, GatewayPollResponse, GatewaySettlementDto, GatewayStartResponse, OnchainBalanceResponse, QuoteResponse, SupportedAssetDto, SupportedAssetsResponse } from "@stridge/sdk";
4
+
5
+ //#region src/flows/deposit/driver/types.d.ts
6
+ /**
7
+ * Snapshot of every entity the driver currently exposes. Returned by {@link DepositDriver.getSnapshot}
8
+ * and consumed by `useSyncExternalStore`. The kit's `useDepositSnapshot()` hook returns this shape.
9
+ *
10
+ * Each field is an {@link Entity} envelope — components switch on `status` and read `payload` on
11
+ * the `ready` / `stale` variants.
12
+ */
13
+ interface DepositSnapshot {
14
+ /** Brand metadata — merchant name, checkout item title. Backed by `gateway/start.metadata`. */
15
+ brand: Entity<BrandPayload, GatewayStartResponse["metadata"], GatewayStartResponse>;
16
+ /**
17
+ * Settlement destination — the (network × asset) tuple the host configured. Backed by the
18
+ * matched supported-assets entry.
19
+ */
20
+ target: Entity<TargetPayload, SupportedAssetDto, SupportedAssetsResponse>;
21
+ /**
22
+ * Provisioned deposit addresses (one per supported source chain). List-shaped envelope —
23
+ * `payload` is an array, `raw` is the underlying `deposit_addresses` array, `response` is the
24
+ * full `gateway/start` response.
25
+ */
26
+ addresses: Entity<ReadonlyArray<AddressItemPayload>, ReadonlyArray<DepositAddressDto>, GatewayStartResponse>;
27
+ /**
28
+ * Source-side per-asset balances for the connected wallet. List-shaped envelope. The list is
29
+ * derived from the response's `chains[].tokens[]` so `raw` carries the entire response
30
+ * (there is no single per-row DTO that backs an individual `BalanceItemPayload` 1:1).
31
+ */
32
+ balances: Entity<ReadonlyArray<BalanceItemPayload>, OnchainBalanceResponse, OnchainBalanceResponse>;
33
+ /**
34
+ * Active deposit quote. Drives the confirm-deposit widget. Transitions to `stale` on expiry.
35
+ */
36
+ quote: Entity<QuotePayload, QuoteResponse, QuoteResponse>;
37
+ /**
38
+ * The most-recent settlement observed for the connected wallet. The discriminated `kind` on
39
+ * the payload (`pending` / `succeeded` / `failed`) drives whether `<ProcessingState>`,
40
+ * `<SuccessState>`, or `<ErrorState>` is shown.
41
+ */
42
+ settlement: Entity<SettlementPayload, GatewaySettlementDto, GatewayPollResponse>;
43
+ /**
44
+ * Connected-wallet identity. `idle` when no wallet is connected; `ready` once the host has
45
+ * supplied an address. The `payload.address.formatted` field is the canonical
46
+ * `0x…<last 4>` form components render anywhere a connected-wallet pill appears outside a
47
+ * settlement (deposit-method tile, amount-entry source pill, banner disconnected-state copy).
48
+ */
49
+ wallet: Entity<WalletPayload, WalletInfo, WalletInfo>;
50
+ }
51
+ /**
52
+ * Input to {@link DepositDriver.requestQuote}.
53
+ */
54
+ interface RequestQuoteInput {
55
+ sourceChainId: number;
56
+ sourceTokenAddress: string;
57
+ sourceTokenDecimals: number;
58
+ sourceTokenSymbol: string;
59
+ sourceIsNative: boolean;
60
+ /** Send amount in display units (post-decimals). */
61
+ amount: number;
62
+ /**
63
+ * Optional source-token unit price in USD. Drives the confirm-deposit hero amount: when set,
64
+ * the live driver passes it through to {@link import("./transformers").quoteToPayload}'s
65
+ * `sendPriceUsd` so the hero reads `$<amount × priceUsd>` instead of falling back to the raw
66
+ * source-token amount. The kit's orchestrator pulls this from the picked
67
+ * {@link BalanceItemPayload}'s `priceUsd` at confirm time; BYO drivers can ignore it if they
68
+ * surface their own hero math.
69
+ */
70
+ sourcePriceUsd?: number;
71
+ }
72
+ /**
73
+ * Input to {@link DepositDriver.submitDeposit}.
74
+ */
75
+ interface SubmitDepositInput {
76
+ sourceChainId: number;
77
+ sourceTokenAddress: string;
78
+ sourceTokenDecimals: number;
79
+ sourceIsNative: boolean;
80
+ /** Send amount in display units. */
81
+ amount: number;
82
+ }
83
+ /**
84
+ * Input to {@link DepositDriver.watchSourceTx}. Path B — kit waits for an inbound transfer to the
85
+ * deposit address.
86
+ */
87
+ interface WatchSourceTxInput {
88
+ /** Optional last-known tx hash (used to ack snapshots on dialog reopen). */
89
+ sinceTxHash?: string;
90
+ }
91
+ /**
92
+ * Input to {@link DepositDriver.watchSettlement}. Carries the source-chain tx hash so the watcher can
93
+ * scope its poll to a specific in-flight settlement.
94
+ */
95
+ interface WatchSettlementInput {
96
+ tx: TxRef;
97
+ }
98
+ /**
99
+ * Input to {@link DepositDriver.fetchActiveSettlement}. The kit calls this on dialog open so a
100
+ * still-in-flight deposit lands the user straight on the processing screen.
101
+ */
102
+ type FetchActiveSettlementInput = Record<string, never>;
103
+ /**
104
+ * One-shot snapshot returned by {@link DepositDriver.fetchActiveSettlement}. Resolves to `null` when
105
+ * nothing is in-flight.
106
+ */
107
+ interface SettlementSnapshot {
108
+ payload: SettlementPayload;
109
+ raw: GatewaySettlementDto;
110
+ response: GatewayPollResponse;
111
+ }
112
+ /**
113
+ * Unified driver contract. A `DepositDriver` is the single host-supplied source of both reactive
114
+ * data (the 6 entities) and imperative actions (quote / submit / watch / fetch). One contract,
115
+ * one implementation per backend — `createStridgeDriver` for live Stridge integrations,
116
+ * `createStridgeMockDriver` for demos / tests / Storybook.
117
+ *
118
+ * The driver also implements the `useSyncExternalStore` contract (`subscribe` + `getSnapshot`) so
119
+ * `<KitProvider />` + `useDepositSnapshot()` get standard React 18+ external-store semantics.
120
+ *
121
+ * @example
122
+ *
123
+ * ```ts
124
+ * import { createStridgeDriver } from "@stridge/kit/drivers/stridge";
125
+ *
126
+ * const driver = createStridgeDriver({
127
+ * projectKey: process.env.NEXT_PUBLIC_STRIDGE_GATEWAY_KEY!,
128
+ * wagmiConfig,
129
+ * destination: { network_id: "9006", asset_symbol: "USDC" },
130
+ * userAddress,
131
+ * getI18n: () => i18n,
132
+ * });
133
+ *
134
+ * <KitProvider deposit={driver}>{children}</KitProvider>;
135
+ * ```
136
+ */
137
+ interface DepositDriver {
138
+ /** Lets you read the current snapshot of every reactive entity (used by `useSyncExternalStore`). */
139
+ getSnapshot(): DepositSnapshot;
140
+ /** Lets you subscribe to entity transitions outside React (analytics, headless integrations). */
141
+ subscribe(listener: () => void): () => void;
142
+ /**
143
+ * Fetches a fresh quote for `input` and updates the `quote` entity through its lifecycle
144
+ * (`idle | loading → ready | error`). The optional `signal` cancels in-flight work.
145
+ */
146
+ requestQuote(input: RequestQuoteInput, signal: AbortSignal): Promise<void>;
147
+ /**
148
+ * Submits the confirmed deposit. Resolves with the broadcast tx ref. Settlement watcher takes
149
+ * over from there to populate the `settlement` entity.
150
+ */
151
+ submitDeposit(input: SubmitDepositInput, signal: AbortSignal): Promise<TxRef>;
152
+ /**
153
+ * Watches the connected wallet's source-side balances. Updates the `balances` entity. Optional
154
+ * — when omitted, the asset-picker hides its USD-balance overlay.
155
+ */
156
+ watchBalances?(input: Record<string, never>, listener: (entity: DepositSnapshot["balances"]) => void, signal: AbortSignal): void;
157
+ /**
158
+ * Path B watcher — observes the deposit address until an inbound source-chain tx is detected,
159
+ * then fires the listener with the {@link TxRef}. Optional — when omitted, the orchestrator
160
+ * hides the transfer-crypto method tile.
161
+ */
162
+ watchSourceTx?(input: WatchSourceTxInput, listener: (tx: TxRef) => void, signal: AbortSignal): void;
163
+ /**
164
+ * Watches the settlement entity through its lifecycle (pending → succeeded / failed). Listener
165
+ * fires on every transition with the new envelope; the FSM consumes these to advance phases.
166
+ */
167
+ watchSettlement(input: WatchSettlementInput, listener: (entity: DepositSnapshot["settlement"]) => void, signal: AbortSignal): void;
168
+ /**
169
+ * One-shot resume probe — called at dialog `open()` time. Resolves with the most-recent
170
+ * **pending** settlement if any, so the dialog routes straight to `<ProcessingState>` instead
171
+ * of making the user re-do work. Optional — when omitted, the kit always opens at the deposit
172
+ * method picker.
173
+ */
174
+ fetchActiveSettlement?(input: FetchActiveSettlementInput, signal: AbortSignal): Promise<SettlementSnapshot | null>;
175
+ }
176
+ //#endregion
177
+ export { DepositDriver, DepositSnapshot, FetchActiveSettlementInput, RequestQuoteInput, SettlementSnapshot, SubmitDepositInput, WatchSettlementInput, WatchSourceTxInput };
@@ -0,0 +1,11 @@
1
+ import { DepositState } from "./types.js";
2
+ import { ReactNode } from "react";
3
+ //#region src/flows/deposit/orchestrator/controller.d.ts
4
+ /**
5
+ * Read the **logical** gateway state — what the reducer says. Transitions to `closed` are
6
+ * surfaced synchronously, so this is the right hook for "is the dialog open?" gating, analytics,
7
+ * and any headless UI that drives off live machine state.
8
+ */
9
+ declare function useDepositState(): DepositState;
10
+ //#endregion
11
+ export { useDepositState };
@@ -0,0 +1 @@
1
+ "use client";import{useDepositDriverInstance as e}from"../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{isUserRejectionFailure as a}from"../../../shared/orchestrator/userRejection.js";import{useSettlementWatcher as o}from"../../../shared/orchestrator/useSettlementWatcher.js";import"../../../shared/orchestrator/index.js";import{initialState as s,reducer as c}from"./reducer.js";import{resolveAssetById as l}from"./resolveAssetById.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:`ELhVSL`,message:`Failed to submit deposit.`},y={id:`Ej5HL9`,message:`Signature declined. Please try again.`},b=u(null);b.displayName=`GatewayControllerContext`;function x(){let e=d(b);if(!e)throw Error(`useDeposit / GatewayController must be used inside <KitProvider deposit={…} />. Mount KitProvider once at the host's app root.`);return e}function S(){return x().state}function C(){return x().effectiveState}function w(){return x().actions}function T({children:t}){let n=e(),[r,a]=h(c,s),o=D(r,a,n);O(r,a,n),k(r,a,n);let l=i(r),u=E(r,a,n,o);return _(b,{value:m(()=>({state:r,effectiveState:l,dispatch:a,controller:u,actions:o}),[r,l,u,o]),children:t})}function E(e,t,n,r){let i=g(n);i.current=n;let a=f(e=>{if(!e)return t({type:`OPEN`,input:void 0}),!0;if(e.method===`transfer`)return t({type:`OPEN`,input:{method:`transfer`}}),!0;if(e.method===`wallet`&&e.assetId!==void 0){let n=l(i.current.getSnapshot(),e.assetId);return n?(t({type:`OPEN`,input:{method:`wallet`,asset:n}}),!0):!1}return t({type:`OPEN`,input:{method:`wallet`}}),!0},[t]),o=f(()=>{t({type:`CLOSE`})},[t]);return m(()=>({open:a,close:o,actions:r}),[a,o,r])}function D(e,r,i){let o=g(e);o.current=e;let s=g(i);s.current=i;let c=g(r);c.current=r;let{i18n:l}=t(),u=g(l);u.current=l;let d=f((e,t)=>{let r=s.current,i=new AbortController,o=j(e,t);r.submitDeposit(o,i.signal).then(e=>{i.signal.aborted||c.current({type:`DEPOSIT_SUBMITTED`,tx:e})}).catch(e=>{if(i.signal.aborted)return;let t=n(e,u.current._(v));if(a(t)){c.current({type:`DEPOSIT_SIGNATURE_DECLINED`,notice:u.current._(y)});return}c.current({type:`DEPOSIT_SUBMISSION_FAILED`,failure:t})})},[]),p=f(e=>{c.current({type:`DEPOSIT_METHOD_SELECTED`,method:e})},[]),h=f(e=>{c.current({type:`ASSET_CONFIRMED`,asset:e})},[]),_=f(e=>{o.current.name===`amountEntry`&&c.current({type:`AMOUNT_CONFIRMED`,amount:e})},[]),b=f(()=>{let e=o.current;if(e.name!==`confirmDeposit`)return;let t=e.ctx.phase;if(t.kind===`failed`){c.current({type:`QUOTE_RETRY`});return}if(t.kind!==`ready`)return;let{asset:n,amount:r}=e.ctx;c.current({type:`DEPOSIT_CONFIRMED`}),d(n,r)},[d]),x=f(()=>{c.current({type:`BACK`})},[]),S=f(()=>{c.current({type:`CLOSE`})},[]),C=f(()=>{c.current({type:`SUCCESS_DONE`})},[]),w=f(()=>{c.current({type:`ERROR_TRY_AGAIN`})},[]),T=f((e,t)=>{c.current({type:`RESUME_TO_PROCESSING`,method:e,tx:t})},[]),E=f((e,t)=>{c.current({type:`RESUME_TO_SUCCESS`,method:e,tx:t})},[]),D=f(e=>{c.current({type:`RESUME_TO_ERROR`,...e?{tx:e}:{}})},[]);return m(()=>({selectMethod:p,confirmAsset:h,confirmAmount:_,confirmDeposit:b,back:x,close:S,successDone:C,tryAgain:w,resumeToProcessing:T,resumeToSuccess:E,resumeToError:D}),[p,h,_,b,x,S,C,w,T,E,D])}function O(e,t,r){p(()=>{if(e.name!==`confirmDeposit`||e.ctx.phase.kind!==`loading`&&e.ctx.phase.kind!==`regenerating`)return;let i=new AbortController,a=A(e.ctx.asset,e.ctx.amount);return r.requestQuote(a,i.signal).catch(e=>{i.signal.aborted||t({type:`QUOTE_FAILED`,failure:n(e,`Failed to fetch quote.`)})}),()=>i.abort()},[e.name,e.name===`confirmDeposit`?e.ctx.phase.kind:void 0,e.name===`confirmDeposit`?e.ctx.asset:void 0,e.name===`confirmDeposit`?e.ctx.amount:void 0,r,t]),p(()=>{if(e.name!==`confirmDeposit`||e.ctx.phase.kind!==`ready`)return;let n=e.ctx.phase.quoteExpiresAt,r=Math.max(0,n-Date.now()),i=setTimeout(()=>{t({type:`QUOTE_EXPIRED`})},r);return()=>clearTimeout(i)},[e.name,e.name===`confirmDeposit`&&e.ctx.phase.kind===`ready`?e.ctx.phase.quoteExpiresAt:void 0,t])}function k(e,t,n){o(n,e.name===`processing`?e.ctx.tx:void 0),p(()=>{if(e.name!==`transferCrypto`||!n.watchSourceTx)return;let t=new AbortController,r;return n.watchSourceTx({},e=>{t.signal.aborted||r||(r=new AbortController,n.watchSettlement({tx:e},()=>{},r.signal))},t.signal),()=>{t.abort(),r?.abort()}},[e.name,n]),p(()=>{if(e.name===`closed`||e.name===`transferCrypto`||e.name===`processing`||!n.fetchActiveSettlement)return;let t=new AbortController,r,i,a=!1,o=async()=>{try{let e=await n.fetchActiveSettlement({},t.signal);if(a)return;if(e&&!r&&e.payload.kind===`pending`){let t=e.payload.txHash?.value;t&&(r=new AbortController,n.watchSettlement({tx:{hash:t}},()=>{},r.signal))}}catch{}a||(i=setTimeout(o,5e3))};return o(),()=>{a=!0,t.abort(),r?.abort(),i&&clearTimeout(i)}},[e.name,n]);let i=g(e);i.current=e,r(n,e=>{i.current.name===`processing`&&(e===`succeeded`?t({type:`PROCESSING_SUCCEEDED`}):e===`failed`&&t({type:`PROCESSING_FAILED`}))});let a=g(null);p(()=>{let e=()=>{let e=n.getSnapshot(),r=i.current,o=e.quote;o.status!==a.current&&(a.current=o.status,o.status===`ready`&&r.name===`confirmDeposit`?(r.ctx.phase.kind===`loading`||r.ctx.phase.kind===`regenerating`)&&t({type:`QUOTE_RESOLVED`,expiresAt:o.payload.expiresAt}):o.status===`error`&&r.name===`confirmDeposit`&&(r.ctx.phase.kind===`loading`||r.ctx.phase.kind===`regenerating`)&&t({type:`QUOTE_FAILED`,failure:{reason:o.error.message,code:o.error.name}}))},r=n.subscribe(e);return e(),r},[n,t])}function A(e,t){let n=e.eip155Id;if(!n)throw Error(`Asset ${e.symbol} is missing eip155Id; cannot build quote input.`);return{sourceChainId:Number(n),sourceTokenAddress:e.address,sourceTokenDecimals:e.decimals,sourceTokenSymbol:e.symbol,sourceIsNative:e.isNative,amount:t,...e.priceUsd===void 0?{}:{sourcePriceUsd:e.priceUsd}}}function j(e,t){let n=e.eip155Id;if(!n)throw Error(`Asset ${e.symbol} is missing eip155Id; cannot build submit input.`);return{sourceChainId:Number(n),sourceTokenAddress:e.address,sourceTokenDecimals:e.decimals,sourceIsNative:e.isNative,amount:t}}export{T as GatewayController,x as useControllerContext,w as useDepositActions,C as useDepositEffectiveState,S as useDepositState};
@@ -0,0 +1 @@
1
+ const e={name:`closed`};function t(e,t){if(t.type===`RESUME_TO_PROCESSING`)return e.name===`closed`?e:{name:`processing`,ctx:{method:t.method,tx:t.tx,retryTargetForFailure:{kind:`fresh`}}};if(t.type===`RESUME_TO_SUCCESS`)return e.name===`closed`?e:{name:`success`,ctx:{method:t.method,tx:t.tx}};if(t.type===`RESUME_TO_ERROR`)return e.name===`closed`?e:{name:`error`,ctx:{retryTarget:{kind:`fresh`},...t.tx?{tx:t.tx}:{}}};switch(e.name){case`closed`:return n(t);case`deposit`:return r(e,t);case`assetPicker`:return i(e,t);case`amountEntry`:return a(e,t);case`confirmDeposit`:return o(e,t);case`transferCrypto`:return s(e,t);case`processing`:return c(e,t);case`success`:return l(e,t);case`error`:return u(e,t);default:return f(e)}}function n(e){if(e.type!==`OPEN`)return{name:`closed`};let t=e.input;return t?t.method===`transfer`?{name:`transferCrypto`,ctx:{method:`transfer`,backTarget:`closed`}}:t.asset?{name:`amountEntry`,ctx:{method:`wallet`,asset:t.asset,backTarget:`closed`}}:{name:`assetPicker`,ctx:{method:`wallet`,backTarget:`closed`}}:{name:`deposit`,ctx:{backTarget:`closed`}}}function r(e,t){switch(t.type){case`DEPOSIT_METHOD_SELECTED`:return t.method===`wallet`?{name:`assetPicker`,ctx:{method:`wallet`,backTarget:`deposit`}}:{name:`transferCrypto`,ctx:{method:`transfer`,backTarget:`deposit`}};case`BACK`:case`CLOSE`:return{name:`closed`};default:return e}}function i(e,t){switch(t.type){case`ASSET_CONFIRMED`:return{name:`amountEntry`,ctx:{method:`wallet`,asset:t.asset,backTarget:`assetPicker`}};case`BACK`:return e.ctx.backTarget===`deposit`?{name:`deposit`,ctx:{backTarget:`closed`}}:{name:`closed`};case`CLOSE`:return{name:`closed`};default:return e}}function a(e,t){switch(t.type){case`AMOUNT_CONFIRMED`:return{name:`confirmDeposit`,ctx:{method:`wallet`,asset:e.ctx.asset,amount:t.amount,phase:{kind:`loading`},backTarget:`amountEntry`}};case`BACK`:return e.ctx.backTarget===`assetPicker`?{name:`assetPicker`,ctx:{method:`wallet`,backTarget:`deposit`}}:{name:`closed`};case`CLOSE`:return{name:`closed`};default:return e}}function o(e,t){let n=e.ctx.phase;switch(t.type){case`QUOTE_RESOLVED`:return n.kind===`loading`||n.kind===`regenerating`?{...e,ctx:{...e.ctx,phase:{kind:`ready`,quoteExpiresAt:t.expiresAt}}}:e;case`QUOTE_FAILED`:return n.kind===`loading`||n.kind===`regenerating`?{...e,ctx:{...e.ctx,phase:{kind:`failed`,failure:t.failure,recoverFrom:`quote`}}}:e;case`QUOTE_RETRY`:return n.kind===`failed`?{...e,ctx:{...e.ctx,phase:{kind:`loading`}}}:e;case`QUOTE_EXPIRED`:return n.kind===`ready`?{...e,ctx:{...e.ctx,phase:{kind:`regenerating`}}}:e;case`DEPOSIT_CONFIRMED`:return n.kind===`ready`?{...e,ctx:{...e.ctx,phase:{kind:`submitting`}}}:e;case`DEPOSIT_SUBMITTED`:if(n.kind===`submitting`){let n={kind:`confirmDepositReady`,method:`wallet`,asset:e.ctx.asset,amount:e.ctx.amount};return{name:`processing`,ctx:{method:`wallet`,tx:t.tx,retryTargetForFailure:n}}}return e;case`DEPOSIT_SUBMISSION_FAILED`:return n.kind===`submitting`?{...e,ctx:{...e.ctx,phase:{kind:`failed`,failure:t.failure,recoverFrom:`submission`}}}:e;case`DEPOSIT_SIGNATURE_DECLINED`:return n.kind===`submitting`?{...e,ctx:{...e.ctx,phase:{kind:`regenerating`,...t.notice?{notice:t.notice}:{}}}}:e;case`BACK`:return{name:`amountEntry`,ctx:{method:`wallet`,asset:e.ctx.asset,backTarget:`assetPicker`}};case`CLOSE`:return{name:`closed`};default:return e}}function s(e,t){switch(t.type){case`BACK`:return e.ctx.backTarget===`deposit`?{name:`deposit`,ctx:{backTarget:`closed`}}:{name:`closed`};case`CLOSE`:return{name:`closed`};default:return e}}function c(e,t){switch(t.type){case`PROCESSING_SUCCEEDED`:return{name:`success`,ctx:{method:e.ctx.method,tx:e.ctx.tx}};case`PROCESSING_FAILED`:return{name:`error`,ctx:{retryTarget:e.ctx.retryTargetForFailure,tx:e.ctx.tx}};case`CLOSE`:return{name:`closed`};default:return e}}function l(e,t){return t.type===`SUCCESS_DONE`||t.type===`CLOSE`?{name:`closed`}:e}function u(e,t){return t.type===`ERROR_TRY_AGAIN`?d(e.ctx.retryTarget):t.type===`CLOSE`?{name:`closed`}:e}function d(e){return e.kind===`fresh`?{name:`deposit`,ctx:{backTarget:`closed`}}:e.kind===`transferCrypto`?{name:`transferCrypto`,ctx:{method:`transfer`,backTarget:e.backTarget}}:{name:`confirmDeposit`,ctx:{method:`wallet`,asset:e.asset,amount:e.amount,phase:{kind:`loading`},backTarget:`amountEntry`}}}function f(e){throw Error(`Unhandled state: ${JSON.stringify(e)}`)}export{e as initialState,t as reducer};
@@ -0,0 +1 @@
1
+ function e(e,t){if(e.balances.status!==`ready`&&e.balances.status!==`stale`)return;let n=e.balances.payload,r=t.toLowerCase();for(let e of n){let t=e.eip155Id;if(t&&`${t}:${e.address}`.toLowerCase()===r)return e}let i=[];for(let e of n)e.symbol.toLowerCase()===r&&i.push(e);return i.length===1?i[0]:void 0}export{e as resolveAssetById};
@@ -0,0 +1,23 @@
1
+ import { DepositStateName } from "./types.js";
2
+
3
+ //#region src/flows/deposit/orchestrator/steps.d.ts
4
+ /**
5
+ * FSM steps that already render a full-size view of the active settlement entity
6
+ * (`processing`, `success`, `error`). The settlement-status banner is suppressed on these
7
+ * steps because the underlying screen IS the settlement view — overlaying a banner on top
8
+ * would duplicate the same payload and clutter the dialog.
9
+ *
10
+ * Exported as the canonical "is the settlement self-rendered here?" predicate so widgets
11
+ * (orchestrated `<DepositStatusBanner />`) and headless banner consumers
12
+ * (`useBannerAckForSettlement` callsites in integrator code) compute visibility from one
13
+ * source instead of hand-rolling string-equality checks scattered across components.
14
+ */
15
+ declare const STEPS_WITH_OWN_SETTLEMENT_VIEW: ReadonlySet<DepositStateName>;
16
+ /**
17
+ * `true` when `state` already paints the active settlement (`processing` / `success` /
18
+ * `error`). Convenience wrapper over {@link STEPS_WITH_OWN_SETTLEMENT_VIEW} for callsites
19
+ * that just need a boolean.
20
+ */
21
+ declare function stepRendersSettlement(state: DepositStateName): boolean;
22
+ //#endregion
23
+ export { STEPS_WITH_OWN_SETTLEMENT_VIEW, stepRendersSettlement };
@@ -0,0 +1 @@
1
+ const e=new Set([`processing`,`success`,`error`]);function t(t){return e.has(t)}export{e as STEPS_WITH_OWN_SETTLEMENT_VIEW,t as stepRendersSettlement};
@@ -0,0 +1,266 @@
1
+ import { TxRef } from "../../../shared/driver/types.js";
2
+ import { BalanceItemPayload } from "../driver/payloads.js";
3
+ import { FailureInfo } from "../../../shared/orchestrator/types.js";
4
+
5
+ //#region src/flows/deposit/orchestrator/types.d.ts
6
+ /**
7
+ * Deposit method picked on the `Deposit` widget. `wallet` enters Path A
8
+ * (asset → amount → confirm → process), `transfer` enters Path B
9
+ * (transfer-crypto → process).
10
+ */
11
+ type DepositMethod = "wallet" | "transfer";
12
+ /**
13
+ * Confirm-deposit phase sub-union. Drives the confirm-deposit widget's hero / footer chrome.
14
+ * Phase data is pure navigation; the actual quote payload comes from the driver's `quote` entity.
15
+ */
16
+ type ConfirmDepositPhase = {
17
+ kind: "loading";
18
+ } | {
19
+ kind: "ready";
20
+ quoteExpiresAt: number;
21
+ } | {
22
+ kind: "regenerating";
23
+ notice?: string;
24
+ } | {
25
+ kind: "submitting";
26
+ } | {
27
+ kind: "failed";
28
+ failure: FailureInfo;
29
+ recoverFrom: "quote" | "submission";
30
+ };
31
+ /**
32
+ * Where `ERROR_TRY_AGAIN` lands. Encoded once at error-entry time so retry is deterministic.
33
+ */
34
+ type RetryTargetSpec = {
35
+ kind: "confirmDepositReady";
36
+ method: "wallet";
37
+ asset: BalanceItemPayload;
38
+ amount: number;
39
+ } | {
40
+ kind: "transferCrypto";
41
+ backTarget: "closed" | "deposit";
42
+ } | {
43
+ /**
44
+ * No re-runnable target — used when `ERROR_TRY_AGAIN` should route the user back to the
45
+ * deposit picker (e.g. processing failures from a settlement we resumed via
46
+ * `fetchActiveSettlement`, where the original signature happened outside this session).
47
+ */
48
+ kind: "fresh";
49
+ };
50
+ /**
51
+ * State machine state nodes. Per-state discriminated ctx narrows what is available — illegal
52
+ * states (e.g. `confirmDeposit` without an asset) are unrepresentable.
53
+ *
54
+ * Entity-derived data (quote, settlement, balances, target, brand, addresses, wallet) lives on
55
+ * the driver — widgets read it via `useDepositSnapshot()`. The reducer only carries navigation
56
+ * intent: which screen, which method, which asset/amount the user has confirmed so far.
57
+ */
58
+ type DepositState = {
59
+ name: "closed";
60
+ } | {
61
+ name: "deposit";
62
+ ctx: {
63
+ backTarget: "closed";
64
+ };
65
+ } | {
66
+ name: "assetPicker";
67
+ ctx: {
68
+ method: "wallet";
69
+ backTarget: "closed" | "deposit";
70
+ };
71
+ } | {
72
+ name: "amountEntry";
73
+ ctx: {
74
+ method: "wallet";
75
+ asset: BalanceItemPayload;
76
+ backTarget: "closed" | "assetPicker";
77
+ };
78
+ } | {
79
+ name: "confirmDeposit";
80
+ ctx: {
81
+ method: "wallet";
82
+ asset: BalanceItemPayload;
83
+ amount: number;
84
+ phase: ConfirmDepositPhase;
85
+ backTarget: "amountEntry";
86
+ };
87
+ } | {
88
+ name: "transferCrypto";
89
+ ctx: {
90
+ method: "transfer";
91
+ backTarget: "closed" | "deposit";
92
+ };
93
+ } | {
94
+ name: "processing";
95
+ ctx: {
96
+ method: DepositMethod;
97
+ tx: TxRef;
98
+ retryTargetForFailure: RetryTargetSpec;
99
+ };
100
+ } | {
101
+ name: "success";
102
+ ctx: {
103
+ method: DepositMethod;
104
+ tx: TxRef;
105
+ };
106
+ } | {
107
+ name: "error";
108
+ ctx: {
109
+ retryTarget: RetryTargetSpec;
110
+ /**
111
+ * Set for non-settlement failures (quote / submission rejections that escalate via
112
+ * the orchestrated `error` arm). Settlement failures leave this `undefined` — the
113
+ * widget renders from the driver's `settlement` entity (`kind: "failed"`) instead.
114
+ */
115
+ failure?: FailureInfo; /** Source-chain tx hash when the error followed a successful broadcast. */
116
+ tx?: TxRef;
117
+ };
118
+ };
119
+ type DepositStateName = DepositState["name"];
120
+ /**
121
+ * Resolved variant of {@link OpenInput} — the controller turns the public `assetId` form into
122
+ * `asset: BalanceItemPayload` (resolved against the driver's `balances` entity) before
123
+ * dispatching, so the reducer never has to perform lookups.
124
+ */
125
+ type ResolvedOpenInput = undefined | {
126
+ method: "wallet";
127
+ asset?: BalanceItemPayload;
128
+ } | {
129
+ method: "transfer";
130
+ };
131
+ /**
132
+ * Reducer event union. Strict discriminated; no stringly-typed transitions, no payload
133
+ * polymorphism beyond the discriminator.
134
+ */
135
+ type GatewayEvent = {
136
+ type: "OPEN";
137
+ input: ResolvedOpenInput;
138
+ } | {
139
+ type: "CLOSE";
140
+ } | {
141
+ type: "BACK";
142
+ } | {
143
+ type: "DEPOSIT_METHOD_SELECTED";
144
+ method: DepositMethod;
145
+ } | {
146
+ type: "ASSET_CONFIRMED";
147
+ asset: BalanceItemPayload;
148
+ } | {
149
+ type: "AMOUNT_CONFIRMED";
150
+ amount: number;
151
+ } | {
152
+ type: "QUOTE_RESOLVED";
153
+ expiresAt: number;
154
+ } | {
155
+ type: "QUOTE_FAILED";
156
+ failure: FailureInfo;
157
+ } | {
158
+ type: "QUOTE_RETRY";
159
+ } | {
160
+ type: "QUOTE_EXPIRED";
161
+ } | {
162
+ type: "DEPOSIT_CONFIRMED";
163
+ } | {
164
+ type: "DEPOSIT_SUBMITTED";
165
+ tx: TxRef;
166
+ } | {
167
+ type: "DEPOSIT_SUBMISSION_FAILED";
168
+ failure: FailureInfo;
169
+ } | {
170
+ /**
171
+ * User declined the wallet signature prompt while `confirmDeposit{submitting}`. Distinct
172
+ * from `DEPOSIT_SUBMISSION_FAILED` because rejection is a recoverable UX event — the
173
+ * orchestrator regenerates the quote and surfaces an inline notice instead of dropping
174
+ * into the global error state.
175
+ */
176
+ type: "DEPOSIT_SIGNATURE_DECLINED";
177
+ notice?: string;
178
+ } | {
179
+ type: "PROCESSING_SUCCEEDED";
180
+ } | {
181
+ type: "PROCESSING_FAILED";
182
+ } | {
183
+ type: "SUCCESS_DONE";
184
+ } | {
185
+ type: "ERROR_TRY_AGAIN";
186
+ } | {
187
+ /**
188
+ * Banner-driven jump into the full processing widget. Bypasses the per-state switch so
189
+ * any non-closed state can route directly. The retry target is `fresh` because banner
190
+ * resumes surface deposits that originated outside this session.
191
+ */
192
+ type: "RESUME_TO_PROCESSING";
193
+ method: DepositMethod;
194
+ tx: TxRef;
195
+ } | {
196
+ /**
197
+ * Banner-driven jump into the success widget once the banner observed terminal success.
198
+ */
199
+ type: "RESUME_TO_SUCCESS";
200
+ method: DepositMethod;
201
+ tx: TxRef;
202
+ } | {
203
+ /**
204
+ * Banner-driven jump into the error widget once the banner observed terminal failure.
205
+ */
206
+ type: "RESUME_TO_ERROR";
207
+ tx?: TxRef;
208
+ };
209
+ /**
210
+ * Public open-input variant accepted by `useDeposit().open()`. Hosts pass the small ID-based
211
+ * shape; the controller resolves IDs against the driver's `balances` entity and rejects when the
212
+ * lookup fails.
213
+ */
214
+ type OpenInput = undefined | {
215
+ method: "wallet";
216
+ assetId?: string;
217
+ } | {
218
+ method: "transfer";
219
+ };
220
+ /**
221
+ * Imperative controller returned by `useDeposit()`. Stable across re-renders.
222
+ */
223
+ interface DepositController {
224
+ /**
225
+ * Open the deposit dialog.
226
+ *
227
+ * - `open()` → `deposit` (method picker)
228
+ * - `open({ method: "wallet" })` → `assetPicker`
229
+ * - `open({ method: "wallet", assetId })` → `amountEntry` (rejects if `assetId` doesn't resolve)
230
+ * - `open({ method: "transfer" })` → `transferCrypto`
231
+ *
232
+ * Returns `false` when `assetId` is provided but doesn't match any asset on the kit's
233
+ * `balances` entity.
234
+ */
235
+ open(input?: OpenInput): boolean;
236
+ /** Close the deposit dialog. Idempotent. */
237
+ close(): void;
238
+ /**
239
+ * Action dispatchers — fire the same FSM transitions the kit's compound widgets fire. Use
240
+ * these when building fully-custom headless UI; the dialog and compound layers wire them up
241
+ * automatically.
242
+ */
243
+ actions: DepositActions;
244
+ }
245
+ /**
246
+ * Imperative actions consumed by widgets. Read with `useDepositActions()` and dispatch into the
247
+ * deposit FSM directly — there's no host-supplied transitions handler in between.
248
+ */
249
+ interface DepositActions {
250
+ selectMethod(method: DepositMethod): void;
251
+ confirmAsset(asset: BalanceItemPayload): void;
252
+ confirmAmount(amount: number): void;
253
+ confirmDeposit(): void;
254
+ back(): void;
255
+ close(): void;
256
+ successDone(): void;
257
+ tryAgain(): void;
258
+ /** Banner-driven jump into the full processing widget. */
259
+ resumeToProcessing(method: DepositMethod, tx: TxRef): void;
260
+ /** Banner-driven jump into the success widget. */
261
+ resumeToSuccess(method: DepositMethod, tx: TxRef): void;
262
+ /** Banner-driven jump into the error widget. */
263
+ resumeToError(tx?: TxRef): void;
264
+ }
265
+ //#endregion
266
+ export { ConfirmDepositPhase, DepositActions, DepositController, DepositMethod, DepositState, DepositStateName, GatewayEvent, OpenInput, ResolvedOpenInput, RetryTargetSpec };
@@ -0,0 +1,35 @@
1
+ import { DepositController } from "./types.js";
2
+
3
+ //#region src/flows/deposit/orchestrator/useDeposit.d.ts
4
+ /**
5
+ * Imperative handle to the orchestrated deposit flow. Use to open / close the deposit dialog from
6
+ * anywhere in the host app.
7
+ *
8
+ * Mount `<KitProvider deposit={…} />` once at the host's app root first — the hook throws when
9
+ * called outside.
10
+ *
11
+ * @example
12
+ * ```tsx
13
+ * import { useDeposit } from "@stridge/kit";
14
+ *
15
+ * function DepositButton() {
16
+ * const { open } = useDeposit();
17
+ * return <button onClick={() => open()}>Deposit</button>;
18
+ * }
19
+ * ```
20
+ *
21
+ * @example
22
+ * ```tsx
23
+ * // Open straight to the wallet flow with an asset pre-selected.
24
+ * open({ method: "wallet", assetId: "1:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" });
25
+ * ```
26
+ *
27
+ * @example
28
+ * ```tsx
29
+ * // Open straight to the transfer-crypto flow.
30
+ * open({ method: "transfer" });
31
+ * ```
32
+ */
33
+ declare function useDeposit(): DepositController;
34
+ //#endregion
35
+ export { useDeposit };
@@ -0,0 +1 @@
1
+ "use client";import{useControllerContext as e}from"./controller.js";function t(){return e().controller}export{t as useDeposit};
@@ -0,0 +1,35 @@
1
+ import { DialogShellControls } from "../../../../shared/dialog/DialogShell.js";
2
+ import { ComponentProps } from "react";
3
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
4
+
5
+ //#region src/flows/deposit/widgets/amount-entry/AmountEntry.d.ts
6
+ /**
7
+ * Orchestrated `AmountEntry` widget. The user enters a USD amount; the widget displays the
8
+ * receive-token amount as the sub-line and converts the entered USD into source-token units
9
+ * before dispatching `confirmAmount` (the orchestrator's `ctx.amount` carries source-token
10
+ * units that flow into the gateway's quote request).
11
+ *
12
+ * Reads the source asset from the FSM's `amountEntry.ctx` (carries `priceUsd` for the USD↔token
13
+ * conversion and `amountUsd.value` for the wallet ceiling) and the receive token +
14
+ * minimum-deposit USD floor from the driver's `target` entity. Renders nothing on any other
15
+ * FSM state.
16
+ *
17
+ * Honors `target.payload.minDepositUsd.value`: when the entered amount is below it, the footer
18
+ * CTA flips to "Update order" and clicking auto-snaps the amount up to the floor. The widget
19
+ * also prefills the entry to the floor on first render so the user starts at a valid amount.
20
+ */
21
+ declare function AmountEntry(props: ComponentProps<"div">): _$react_jsx_runtime0.JSX.Element | null;
22
+ declare function AmountEntryDialog({
23
+ open,
24
+ defaultOpen,
25
+ onOpenChange,
26
+ trigger,
27
+ ...rootProps
28
+ }: AmountEntry.DialogProps): _$react_jsx_runtime0.JSX.Element;
29
+ declare namespace AmountEntry {
30
+ type Props = ComponentProps<"div">;
31
+ type DialogProps = ComponentProps<"div"> & DialogShellControls;
32
+ const Dialog: typeof AmountEntryDialog;
33
+ }
34
+ //#endregion
35
+ export { AmountEntry };
@@ -0,0 +1 @@
1
+ "use client";import{useDepositSnapshot as e}from"../../driver/context.js";import{useKitI18n as t}from"../../../../shared/i18n/useKitI18n.js";import{Trans as n}from"../../../../shared/i18n/Trans.js";import{useLingui as r}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useDepositActions as i,useDepositEffectiveState as a}from"../../orchestrator/controller.js";import{formatTokenAmount as o}from"../../../../shared/format/formatTokenAmount.js";import{DialogShell as s}from"../../../../shared/dialog/DialogShell.js";import{text as c}from"../../../../shared/ui/Text/Text.js";import"../../../../shared/ui/Text/index.js";import{AmountEntry as l}from"../../../../shared/widgets/amount-entry/compound/AmountEntry.js";import"../../../../shared/widgets/amount-entry/compound/index.js";import{toAssetDescriptor as u}from"../../../../shared/widgets/asset-descriptor.js";import{useEffect as d,useMemo as f,useRef as p,useState as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";const _=[{value:`25`,label:`25%`},{value:`50`,label:`50%`},{value:`75`,label:`75%`},{value:`max`,label:`Max`}];function v(s){let v=e(),y=a(),{confirmAmount:b,back:x}=i(),{_:S}=r(),C=t(),w=v.target,T=w.status===`ready`||w.status===`stale`?w.payload:void 0,E=y.name===`amountEntry`?y.ctx.asset:void 0,D=E?.amountUsd?.value??0,O=T?.minDepositUsd?.value,k=T?.minDepositUsd?.formatted,A=E?.priceUsd,[j,M]=m(O??null),[N,P]=m(),F=p(void 0),I=E?`${E.eip155Id??``}:${E.address??``}`:void 0;d(()=>{I&&F.current!==I&&(F.current=I,typeof O==`number`&&(M(O),P(void 0)))},[I,O]);let L=e=>{P(e);let t=e===`max`?1:Number.parseInt(e,10)/100;Number.isFinite(t)&&M(D*t)},R=e=>{M(e),P(void 0)},z=f(()=>typeof O!=`number`||O<=0?!1:j===null||j<O,[j,O]),B=f(()=>typeof D!=`number`||D<=0?!1:j!==null&&j>D,[j,D]),V=()=>{if(B){M(D),P(`max`);return}if(z&&typeof O==`number`){M(O),P(void 0);return}j!==null&&b(A&&A>0?j/A:j)};if(y.name!==`amountEntry`||!E||!T)return null;let H=y.ctx.backTarget===`closed`?void 0:x,U=u(E)??{symbol:E.symbol},W=u(T)??{symbol:T.symbol},G=`${o((j??0)/1,C,{maxDecimals:5})} ${T.symbol}`,K=B?S({id:`9cCjMJ`,message:`Deposit max balance`}):z&&k?S({id:`bOZXx5`,message:`Update order`}):void 0;return g(l,{...s,amount:j,sendToken:U,receiveToken:W,max:D,...O===void 0?{}:{min:O},onAmountChange:R,...H?{onBack:H}:{},subLineAmount:G,presets:_,...N===void 0?{}:{activePreset:N},onPresetSelect:L,...K===void 0?{}:{footerLabel:K},onContinue:V,children:[h(l.Header,{}),g(l.Body,{children:[h(l.Hero,{}),h(l.Pills,{}),B?h(c.p,{size:`sm`,color:`subdued`,className:`AmountEntry__noticeStyles.root x2b8uid x1vvogim`,"data-style-src":`@stridge/kit:src/flows/deposit/widgets/amount-entry/AmountEntry.tsx:16`,children:h(n,{id:`znqB4T`,message:`Insufficient balance`})}):null,h(l.Flow,{}),!B&&z&&k?h(c.p,{size:`sm`,color:`subdued`,className:`AmountEntry__noticeStyles.root x2b8uid x1vvogim`,"data-style-src":`@stridge/kit:src/flows/deposit/widgets/amount-entry/AmountEntry.tsx:16`,children:h(n,{id:`3eKjkO`,message:`{formattedMin} minimum deposit`,values:{formattedMin:k}})}):null]}),h(l.Footer,{})]})}function y({open:e,defaultOpen:t,onOpenChange:n,trigger:r,...i}){return h(s,{open:e,defaultOpen:t,onOpenChange:n,trigger:r,children:h(v,{...i})})}(function(e){e.Dialog=y})(v||={});export{v as AmountEntry};
@@ -0,0 +1 @@
1
+ import { AmountEntry } from "./AmountEntry.js";
@@ -0,0 +1 @@
1
+ import"./AmountEntry.js";