@stridge/kit 0.1.0-alpha.4 → 0.1.0-alpha.40

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 (248) hide show
  1. package/README.md +22 -6
  2. package/dist/KitProvider.d.ts +29 -0
  3. package/dist/KitProvider.js +1 -1
  4. package/dist/_internal/drivers/stridge/index.d.ts +3 -2
  5. package/dist/_internal/drivers/stridge/index.js +1 -1
  6. package/dist/_internal/withdraw/driver/index.d.ts +2 -2
  7. package/dist/deposit/compound/index.d.ts +3 -3
  8. package/dist/drivers/stridge/catalog.d.ts +54 -0
  9. package/dist/drivers/stridge/catalog.js +1 -0
  10. package/dist/drivers/stridge/createStridgeDepositDriver.d.ts +9 -0
  11. package/dist/drivers/stridge/createStridgeDepositDriver.js +1 -1
  12. package/dist/drivers/stridge/createStridgeWithdrawDriver.d.ts +34 -13
  13. package/dist/drivers/stridge/createStridgeWithdrawDriver.js +1 -1
  14. package/dist/drivers/stridge/internal/retry.js +1 -0
  15. package/dist/drivers/stridge/internal/supportedChains.js +1 -0
  16. package/dist/drivers/stridge/types.d.ts +20 -14
  17. package/dist/drivers/stridge/types.js +1 -1
  18. package/dist/drivers/stridge-mock/createStridgeMockDriver.d.ts +2 -2
  19. package/dist/drivers/stridge-mock/createStridgeMockDriver.js +1 -1
  20. package/dist/drivers/stridge-mock/createStridgeMockWithdrawDriver.d.ts +15 -3
  21. package/dist/drivers/stridge-mock/createStridgeMockWithdrawDriver.js +1 -1
  22. package/dist/drivers/stridge-mock/fixtures.d.ts +13 -11
  23. package/dist/drivers/stridge-mock/fixtures.js +1 -1
  24. package/dist/events/bus/createBus.d.ts +7 -0
  25. package/dist/events/bus/createBus.js +1 -0
  26. package/dist/events/bus/flowIdRegistry.d.ts +17 -0
  27. package/dist/events/bus/flowIdRegistry.js +1 -0
  28. package/dist/events/bus/index.js +1 -0
  29. package/dist/events/bus/metadata.js +1 -0
  30. package/dist/events/context.js +1 -0
  31. package/dist/events/emit/index.js +1 -0
  32. package/dist/events/emit/mapFailure.js +1 -0
  33. package/dist/events/emit/useDepositEmissions.js +1 -0
  34. package/dist/events/emit/useKitEmitter.js +1 -0
  35. package/dist/events/emit/useWithdrawEmissions.js +1 -0
  36. package/dist/events/hooks/index.d.ts +6 -0
  37. package/dist/events/hooks/index.js +1 -0
  38. package/dist/events/hooks/useCurrentFlowId.d.ts +6 -0
  39. package/dist/events/hooks/useCurrentFlowId.js +1 -0
  40. package/dist/events/hooks/useStableHandler.js +1 -0
  41. package/dist/events/hooks/useStridgeEvent.d.ts +8 -0
  42. package/dist/events/hooks/useStridgeEvent.js +1 -0
  43. package/dist/events/hooks/useStridgeEventBus.d.ts +33 -0
  44. package/dist/events/hooks/useStridgeEventBus.js +1 -0
  45. package/dist/events/hooks/useStridgeEvents.d.ts +6 -0
  46. package/dist/events/hooks/useStridgeEvents.js +1 -0
  47. package/dist/events/hooks/useStridgeFlowEvent.d.ts +8 -0
  48. package/dist/events/hooks/useStridgeFlowEvent.js +1 -0
  49. package/dist/events/hooks/useStridgeFlowEvents.d.ts +6 -0
  50. package/dist/events/hooks/useStridgeFlowEvents.js +1 -0
  51. package/dist/events/index.d.ts +14 -0
  52. package/dist/events/index.js +1 -0
  53. package/dist/events/publish.js +1 -0
  54. package/dist/events/types/deposit.d.ts +235 -0
  55. package/dist/events/types/envelope.d.ts +145 -0
  56. package/dist/events/types/index.d.ts +31 -0
  57. package/dist/events/types/kit.d.ts +23 -0
  58. package/dist/events/types/withdraw.d.ts +150 -0
  59. package/dist/flows/deposit/dialog/DepositDialog.d.ts +14 -81
  60. package/dist/flows/deposit/dialog/DepositDialog.js +1 -1
  61. package/dist/flows/deposit/dialog/WalletRequiredState.js +1 -0
  62. package/dist/flows/deposit/dialog/WalletRequiredState.styles.js +1 -0
  63. package/dist/flows/deposit/driver/payloads.d.ts +10 -4
  64. package/dist/flows/deposit/driver/transformers/balanceToBalancesPayload.js +1 -1
  65. package/dist/flows/deposit/driver/transformers/startToAddressesPayload.js +1 -1
  66. package/dist/flows/deposit/driver/transformers/startToTargetPayload.js +1 -1
  67. package/dist/flows/deposit/driver/types.d.ts +11 -0
  68. package/dist/flows/deposit/orchestrator/controller.js +1 -1
  69. package/dist/flows/deposit/orchestrator/types.d.ts +30 -1
  70. package/dist/flows/deposit/orchestrator/useDeposit.d.ts +45 -1
  71. package/dist/flows/deposit/orchestrator/useDeposit.js +1 -1
  72. package/dist/flows/deposit/widgets/amount-entry/AmountEntry.d.ts +1 -1
  73. package/dist/flows/deposit/widgets/amount-entry/AmountEntry.js +1 -1
  74. package/dist/flows/deposit/widgets/amount-entry/footerIntent.js +1 -0
  75. package/dist/flows/deposit/widgets/confirm-deposit/ConfirmDeposit.js +1 -1
  76. package/dist/flows/deposit/widgets/deposit/Deposit.js +1 -1
  77. package/dist/flows/deposit/widgets/deposit/compound/components/Method.d.ts +6 -0
  78. package/dist/flows/deposit/widgets/deposit/compound/components/Method.js +1 -1
  79. package/dist/flows/deposit/widgets/deposit/compound/types.d.ts +6 -3
  80. package/dist/flows/deposit/widgets/deposit-status-banner/DepositStatusBanner.d.ts +7 -0
  81. package/dist/flows/deposit/widgets/deposit-status-banner/DepositStatusBanner.js +1 -1
  82. package/dist/flows/deposit/widgets/deposit-status-banner/compound/DepositStatusBanner.js +1 -1
  83. package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Hero.js +1 -1
  84. package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/PrimaryAction.js +1 -1
  85. package/dist/flows/deposit/widgets/processing-state/ProcessingState.js +1 -1
  86. package/dist/flows/deposit/widgets/transfer-crypto/TransferCrypto.js +1 -1
  87. package/dist/flows/deposit/widgets/transfer-crypto/compound/TransferCrypto.d.ts +1 -1
  88. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Address.js +1 -1
  89. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Disclosure.d.ts +2 -1
  90. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Disclosure.js +1 -1
  91. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/QrCode.d.ts +4 -10
  92. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/QrCode.js +1 -1
  93. package/dist/flows/shared/transformers/pickRelevantSettlement.js +1 -1
  94. package/dist/flows/shared/transformers/testnets.js +1 -0
  95. package/dist/flows/withdraw/bindings/WithdrawBindings.d.ts +92 -0
  96. package/dist/flows/withdraw/bindings/WithdrawBindings.js +1 -0
  97. package/dist/flows/withdraw/bindings/index.d.ts +1 -0
  98. package/dist/flows/withdraw/bindings/index.js +1 -0
  99. package/dist/flows/withdraw/dialog/WithdrawDialog.d.ts +35 -71
  100. package/dist/flows/withdraw/dialog/WithdrawDialog.js +1 -1
  101. package/dist/flows/withdraw/driver/payloads.d.ts +16 -1
  102. package/dist/flows/withdraw/driver/transformers/settlementToWithdrawalPayload.js +1 -1
  103. package/dist/flows/withdraw/driver/transformers/supportedAssetsToReceiveOptionsPayload.js +1 -1
  104. package/dist/flows/withdraw/driver/types.d.ts +76 -13
  105. package/dist/flows/withdraw/orchestrator/controller.js +1 -1
  106. package/dist/flows/withdraw/orchestrator/index.d.ts +1 -1
  107. package/dist/flows/withdraw/orchestrator/reducer.js +1 -1
  108. package/dist/flows/withdraw/orchestrator/types.d.ts +131 -32
  109. package/dist/flows/withdraw/orchestrator/useWithdraw.d.ts +36 -1
  110. package/dist/flows/withdraw/orchestrator/useWithdraw.js +1 -1
  111. package/dist/flows/withdraw/widgets/withdraw-form/WithdrawForm.d.ts +5 -13
  112. package/dist/flows/withdraw/widgets/withdraw-form/WithdrawForm.js +1 -1
  113. package/dist/flows/withdraw/widgets/withdraw-form/compound/WithdrawForm.js +1 -1
  114. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/RecipientField.d.ts +7 -5
  115. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/RecipientField.js +1 -1
  116. package/dist/flows/withdraw/widgets/withdraw-form/compound/types.d.ts +15 -5
  117. package/dist/flows/withdraw/widgets/withdraw-form/validation.js +1 -1
  118. package/dist/flows/withdraw/widgets/withdraw-in-progress/WithdrawInProgress.d.ts +2 -1
  119. package/dist/flows/withdraw/widgets/withdraw-in-progress/WithdrawInProgress.js +1 -1
  120. package/dist/flows/withdraw/widgets/withdraw-success/WithdrawSuccess.js +1 -1
  121. package/dist/i18n/index.d.ts +5 -4
  122. package/dist/i18n/index.js +1 -1
  123. package/dist/i18n/locales/ar.js +1 -1
  124. package/dist/i18n/locales/es.js +1 -1
  125. package/dist/i18n/locales/source-keys.d.ts +12 -0
  126. package/dist/i18n/locales/source-keys.js +0 -0
  127. package/dist/icons/index.d.ts +2 -1
  128. package/dist/icons/index.js +1 -1
  129. package/dist/index.d.ts +21 -9
  130. package/dist/index.js +1 -1
  131. package/dist/package.js +1 -1
  132. package/dist/scope/KitPortalScope.js +1 -1
  133. package/dist/scope/KitScope.d.ts +18 -1
  134. package/dist/scope/KitScope.js +1 -1
  135. package/dist/scope/context.d.ts +17 -1
  136. package/dist/scope/index.d.ts +1 -1
  137. package/dist/shared/attribution/Attribution.js +1 -0
  138. package/dist/shared/attribution/Attribution.slots.js +1 -0
  139. package/dist/shared/attribution/Attribution.styles.js +1 -0
  140. package/dist/shared/attribution/index.js +1 -0
  141. package/dist/shared/chains/index.d.ts +48 -29
  142. package/dist/shared/chains/index.js +1 -1
  143. package/dist/shared/constants/brand-intercom.js +1 -0
  144. package/dist/shared/cuer/Cuer.js +1 -0
  145. package/dist/shared/cuer/QrCode.js +1 -0
  146. package/dist/shared/cuer/index.js +1 -0
  147. package/dist/shared/dialog/Frame.js +1 -1
  148. package/dist/shared/dialog/LoadingState.js +1 -0
  149. package/dist/shared/dialog/LoadingState.styles.js +1 -0
  150. package/dist/shared/dialog/StepTransition.js +1 -1
  151. package/dist/shared/driver/types.d.ts +4 -3
  152. package/dist/shared/i18n/KitI18nProvider.d.ts +11 -8
  153. package/dist/shared/i18n/KitI18nProvider.js +1 -1
  154. package/dist/shared/i18n/createKitI18n.d.ts +79 -16
  155. package/dist/shared/i18n/createKitI18n.js +1 -1
  156. package/dist/shared/i18n/useLingui.d.ts +11 -3
  157. package/dist/shared/icons/LogoIcon.d.ts +13 -0
  158. package/dist/shared/icons/LogoIcon.js +1 -0
  159. package/dist/shared/merchant-link/MerchantLink.d.ts +1 -0
  160. package/dist/shared/merchant-link/MerchantLink.js +1 -0
  161. package/dist/shared/merchant-link/MerchantLinkButton.d.ts +1 -0
  162. package/dist/shared/merchant-link/MerchantLinkButton.js +1 -0
  163. package/dist/shared/merchant-link/index.d.ts +1 -0
  164. package/dist/shared/merchant-link/index.js +1 -0
  165. package/dist/shared/merchant-link/resolveMerchantLink.js +1 -0
  166. package/dist/shared/orchestrator/useSettlementWatcher.js +1 -1
  167. package/dist/shared/primitives/TxHashValue/TxHashValue.js +1 -1
  168. package/dist/shared/support/SupportConfigContext.d.ts +1 -0
  169. package/dist/shared/support/SupportConfigContext.js +1 -0
  170. package/dist/shared/support/SupportLink.d.ts +1 -0
  171. package/dist/shared/support/SupportLink.js +1 -0
  172. package/dist/shared/support/SupportSpinner.d.ts +1 -0
  173. package/dist/shared/support/SupportSpinner.js +1 -0
  174. package/dist/shared/support/index.d.ts +2 -0
  175. package/dist/shared/support/index.js +1 -0
  176. package/dist/shared/support/intercom-loader.d.ts +17 -0
  177. package/dist/shared/support/intercom-loader.js +1 -0
  178. package/dist/shared/support/types.d.ts +43 -0
  179. package/dist/shared/support/useIntercomMerchantContext.d.ts +27 -0
  180. package/dist/shared/support/useIntercomMerchantContext.js +1 -0
  181. package/dist/shared/support/useIntercomShutdownOnUnmount.js +1 -0
  182. package/dist/shared/support/useMerchantContext.d.ts +1 -0
  183. package/dist/shared/support/useMerchantContext.js +1 -0
  184. package/dist/shared/support/useSupportTrigger.js +1 -0
  185. package/dist/shared/terms/TermsConfigContext.d.ts +1 -0
  186. package/dist/shared/terms/TermsConfigContext.js +1 -0
  187. package/dist/shared/terms/TermsLink.d.ts +1 -0
  188. package/dist/shared/terms/TermsLink.js +1 -0
  189. package/dist/shared/terms/index.d.ts +1 -0
  190. package/dist/shared/terms/index.js +1 -0
  191. package/dist/shared/terms/types.d.ts +43 -0
  192. package/dist/shared/ui/Card/Card.styles.js +1 -1
  193. package/dist/shared/ui/Details/Details.d.ts +9 -1
  194. package/dist/shared/ui/Details/Details.styles.js +1 -1
  195. package/dist/shared/ui/Dialog/Dialog.js +1 -1
  196. package/dist/shared/ui/Dialog/Dialog.styles.js +1 -1
  197. package/dist/shared/ui/Select/Select.js +1 -1
  198. package/dist/shared/ui/WalletRow/WalletRow.d.ts +1 -1
  199. package/dist/shared/ui/WalletRow/WalletRow.js +1 -1
  200. package/dist/shared/utils/useDeepMemo.js +1 -0
  201. package/dist/shared/wallet/ConnectWalletContext.d.ts +17 -0
  202. package/dist/shared/wallet/ConnectWalletContext.js +1 -0
  203. package/dist/shared/widgets/amount-entry/compound/components/Hero/Hero.js +1 -1
  204. package/dist/shared/widgets/amount-entry/compound/components/Hero/SwapBackdrop.js +1 -1
  205. package/dist/shared/widgets/asset-picker/compound/components/Asset.d.ts +7 -1
  206. package/dist/shared/widgets/asset-picker/compound/components/Asset.js +1 -1
  207. package/dist/shared/widgets/confirm-transfer/compound/components/Disclaimer.d.ts +4 -3
  208. package/dist/shared/widgets/confirm-transfer/compound/components/Disclaimer.js +1 -1
  209. package/dist/shared/widgets/error-state/compound/components/AssetValue.js +1 -1
  210. package/dist/shared/widgets/error-state/compound/components/HelpInfo.js +1 -1
  211. package/dist/shared/widgets/error-state/compound/components/StatusValue.js +1 -1
  212. package/dist/shared/widgets/processing-state/compound/ProcessingState.d.ts +1 -5
  213. package/dist/shared/widgets/processing-state/compound/ProcessingState.js +1 -1
  214. package/dist/shared/widgets/processing-state/compound/ProcessingState.slots.d.ts +0 -1
  215. package/dist/shared/widgets/processing-state/compound/ProcessingState.slots.js +1 -1
  216. package/dist/shared/widgets/processing-state/compound/ProcessingState.styles.js +1 -1
  217. package/dist/shared/widgets/processing-state/compound/components/Details.d.ts +6 -1
  218. package/dist/shared/widgets/processing-state/compound/components/Details.js +1 -1
  219. package/dist/shared/widgets/processing-state/compound/components/Header.d.ts +4 -3
  220. package/dist/shared/widgets/processing-state/compound/components/Header.js +1 -1
  221. package/dist/shared/widgets/processing-state/compound/components/Hero.d.ts +14 -7
  222. package/dist/shared/widgets/processing-state/compound/components/Hero.js +1 -1
  223. package/dist/shared/widgets/processing-state/compound/components/Rows.js +1 -1
  224. package/dist/shared/widgets/processing-state/compound/components/StatusPill.js +1 -1
  225. package/dist/shared/widgets/processing-state/compound/components/splitAmount.js +1 -0
  226. package/dist/shared/widgets/processing-state/compound/index.d.ts +1 -1
  227. package/dist/shared/widgets/processing-state/compound/types.d.ts +7 -26
  228. package/dist/shared/widgets/success-state/compound/components/Actions.js +1 -1
  229. package/dist/shared/widgets/success-state/compound/components/AssetValue.js +1 -1
  230. package/dist/shared/widgets/success-state/compound/components/RouteValue.js +1 -1
  231. package/dist/shared/widgets/success-state/compound/components/StatusPill.js +1 -1
  232. package/dist/stridge/StridgeProvider.d.ts +165 -35
  233. package/dist/stridge/StridgeProvider.js +1 -1
  234. package/dist/stridge/depositOwner.js +1 -0
  235. package/dist/stridge/optionalWagmi.js +1 -0
  236. package/dist/stridge/stubs.js +1 -1
  237. package/dist/styles/index.css +126 -10
  238. package/dist/types.d.ts +5 -4
  239. package/dist/ui/index.js +1 -1
  240. package/dist/withdraw/compound/index.d.ts +2 -2
  241. package/dist/withdraw/dialog/index.d.ts +3 -1
  242. package/package.json +13 -9
  243. package/dist/flows/withdraw/dialog/WithdrawDialogEventsContext.d.ts +0 -36
  244. package/dist/flows/withdraw/dialog/WithdrawDialogEventsContext.js +0 -1
  245. package/dist/shared/widgets/processing-state/compound/components/Actions.d.ts +0 -17
  246. package/dist/shared/widgets/processing-state/compound/components/Actions.js +0 -1
  247. package/dist/stridge/StridgeContext.d.ts +0 -29
  248. package/dist/stridge/StridgeContext.js +0 -1
@@ -1 +1 @@
1
- "use client";import{useLingui as e}from"../../../../../shared/i18n/useLingui.js";import"../../../../../i18n/index.js";import{useKitConfig as t}from"../../../../../scope/context.js";import{Collapsible as n}from"../../../../../shared/ui/Collapsible/Collapsible.js";import"../../../../../shared/ui/Collapsible/index.js";import{DEPOSIT_STATUS_BANNER_SLOTS as r}from"./DepositStatusBanner.slots.js";import{styles as i}from"./DepositStatusBanner.styles.js";import{DepositStatusBannerBody as a}from"./components/Body.js";import{DepositStatusBannerContext as o}from"./context.js";import{DepositStatusBannerClose as s}from"./components/Close.js";import{DepositStatusBannerDetail as c}from"./components/Detail.js";import{DepositStatusBannerDetails as l}from"./components/Details.js";import{DepositStatusBannerFooter as u}from"./components/Footer.js";import{DepositStatusBannerHero as d}from"./components/Hero.js";import{DepositStatusBannerPrimaryAction as f}from"./components/PrimaryAction.js";import{DepositStatusBannerCompletionTxRow as p,DepositStatusBannerDepositTxRow as m,DepositStatusBannerFilledAtRow as h,DepositStatusBannerSubmittedAtRow as g}from"./components/Rows.js";import{DepositStatusBannerToggle as _}from"./components/Toggle.js";import{useEffect as v,useLayoutEffect as y,useMemo as b,useRef as x}from"react";import{jsx as S}from"react/jsx-runtime";import*as C from"@stylexjs/stylex";import{motion as w}from"motion/react";const T=[.16,1,.3,1],E=[.4,0,1,1];function D({kind:a,asset:s,headline:c,subline:l,expanded:u,onToggleExpanded:d,onDismiss:f,depositTx:p,completionTx:m,submittedAt:h,filledAt:g,onPrimaryAction:_,inline:D,children:O}){let{_:k}=e(),{direction:A}=t(),j=c??k(a===`succeeded`?{id:`3kg1gB`,message:`Deposit completed`}:a===`failed`?{id:`Rxjdjn`,message:`Deposit didn't complete`}:{id:`junZX6`,message:`Deposit received and processing…`}),M=l??k(a===`succeeded`?{id:`9JHY2T`,message:`Your deposit has been credited to your account.`}:a===`failed`?{id:`Z1WbO6`,message:`Funds are safe on the source chain — contact support to recover.`}:{id:`Offl0a`,message:`Your deposit will be credited to your account.`}),N=b(()=>({kind:a,asset:s,headline:j,subline:M,expanded:u,onToggleExpanded:d,onDismiss:f,depositTx:p,completionTx:m,submittedAt:h,filledAt:g,onPrimaryAction:_}),[a,s,j,M,u,d,f,p,m,h,g,_]),P=x(null),F=x(null),I=x(a),L=x(null),R=x(null);y(()=>{let e=P.current;if(!e)return;let t=e.getBoundingClientRect().height;if(I.current===a){F.current=t;return}let n=F.current;if(I.current=a,F.current=t,n===null||n===t)return;let r=e.style.transition;e.style.transition=`none`,e.style.height=`${n}px`,e.offsetHeight,e.style.transition=r,R.current!==null&&window.cancelAnimationFrame(R.current),R.current=window.requestAnimationFrame(()=>{R.current=null,P.current&&(P.current.style.height=`${t}px`)}),L.current!==null&&window.clearTimeout(L.current),L.current=window.setTimeout(()=>{L.current=null;let e=P.current;e&&(e.style.height=``)},320)}),v(()=>()=>{L.current!==null&&(window.clearTimeout(L.current),L.current=null),R.current!==null&&(window.cancelAnimationFrame(R.current),R.current=null)},[]);let z=D?`0%`:`-50%`;return S(o.Provider,{value:N,children:S(n,{open:u,onOpenChange:e=>{e!==u&&d()},children:S(w.div,{"data-stridge-slot":r.root,dir:A,...C.props(i.root,D&&i.rootInline),initial:{x:z,y:`100%`,opacity:0},animate:{x:z,y:`0%`,opacity:1,transition:{duration:.3,ease:T}},exit:{x:z,y:`100%`,opacity:0,transition:{duration:.22,ease:E}},children:S(`div`,{ref:P,style:{display:`flex`,flexDirection:`column`,overflow:`hidden`,transition:`height 260ms cubic-bezier(0.3, 0, 0.06, 1)`},children:O})})})})}(function(e){e.Body=a,e.Hero=d,e.Close=s,e.Details=l,e.Detail=c,e.Footer=u,e.Toggle=_,e.PrimaryAction=f,e.DepositTxRow=m,e.CompletionTxRow=p,e.SubmittedAtRow=g,e.FilledAtRow=h})(D||={});export{D as DepositStatusBanner};
1
+ "use client";import{useLingui as e}from"../../../../../shared/i18n/useLingui.js";import"../../../../../i18n/index.js";import{useKitConfig as t}from"../../../../../scope/context.js";import{Collapsible as n}from"../../../../../shared/ui/Collapsible/Collapsible.js";import"../../../../../shared/ui/Collapsible/index.js";import{DEPOSIT_STATUS_BANNER_SLOTS as r}from"./DepositStatusBanner.slots.js";import{styles as i}from"./DepositStatusBanner.styles.js";import{DepositStatusBannerBody as a}from"./components/Body.js";import{DepositStatusBannerContext as o}from"./context.js";import{DepositStatusBannerClose as s}from"./components/Close.js";import{DepositStatusBannerDetail as c}from"./components/Detail.js";import{DepositStatusBannerDetails as l}from"./components/Details.js";import{DepositStatusBannerFooter as u}from"./components/Footer.js";import{DepositStatusBannerHero as d}from"./components/Hero.js";import{DepositStatusBannerPrimaryAction as f}from"./components/PrimaryAction.js";import{DepositStatusBannerCompletionTxRow as p,DepositStatusBannerDepositTxRow as m,DepositStatusBannerFilledAtRow as h,DepositStatusBannerSubmittedAtRow as g}from"./components/Rows.js";import{DepositStatusBannerToggle as _}from"./components/Toggle.js";import{useEffect as v,useLayoutEffect as y,useMemo as b,useRef as x}from"react";import{jsx as S}from"react/jsx-runtime";import{m as C}from"motion/react";import*as w from"@stylexjs/stylex";const T=[.16,1,.3,1],E=[.4,0,1,1];function D({kind:a,asset:s,headline:c,subline:l,expanded:u,onToggleExpanded:d,onDismiss:f,depositTx:p,completionTx:m,submittedAt:h,filledAt:g,onPrimaryAction:_,inline:D,children:O}){let{_:k}=e(),{direction:A}=t(),j=c??k(a===`succeeded`?{id:`3kg1gB`,message:`Deposit completed`}:a===`failed`?{id:`Rxjdjn`,message:`Deposit didn't complete`}:{id:`junZX6`,message:`Deposit received and processing…`}),M=l??k(a===`succeeded`?{id:`9JHY2T`,message:`Your deposit has been credited to your account.`}:a===`failed`?{id:`Z1WbO6`,message:`Funds are safe on the source chain — contact support to recover.`}:{id:`Offl0a`,message:`Your deposit will be credited to your account.`}),N=b(()=>({kind:a,asset:s,headline:j,subline:M,expanded:u,onToggleExpanded:d,onDismiss:f,depositTx:p,completionTx:m,submittedAt:h,filledAt:g,onPrimaryAction:_}),[a,s,j,M,u,d,f,p,m,h,g,_]),P=x(null),F=x(null),I=x(a),L=x(null),R=x(null);y(()=>{let e=P.current;if(!e)return;let t=e.getBoundingClientRect().height;if(I.current===a){F.current=t;return}let n=F.current;if(I.current=a,F.current=t,n===null||n===t||document.visibilityState===`hidden`)return;let r=e.style.transition;e.style.transition=`none`,e.style.height=`${n}px`,e.offsetHeight,e.style.transition=r,R.current!==null&&window.cancelAnimationFrame(R.current),R.current=window.requestAnimationFrame(()=>{R.current=null,P.current&&(P.current.style.height=`${t}px`)}),L.current!==null&&window.clearTimeout(L.current),L.current=window.setTimeout(()=>{L.current=null;let e=P.current;e&&(e.style.height=``)},320)}),v(()=>{let e=()=>{if(document.visibilityState!==`hidden`)return;R.current!==null&&(window.cancelAnimationFrame(R.current),R.current=null),L.current!==null&&(window.clearTimeout(L.current),L.current=null);let e=P.current;e&&(e.style.height=``)};return document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e),L.current!==null&&(window.clearTimeout(L.current),L.current=null),R.current!==null&&(window.cancelAnimationFrame(R.current),R.current=null)}},[]);let z=D?`0%`:`-50%`;return S(o.Provider,{value:N,children:S(n,{open:u,onOpenChange:e=>{e!==u&&d()},children:S(C.div,{"data-stridge-slot":r.root,dir:A,...w.props(i.root,D&&i.rootInline),initial:{x:z,y:`100%`,opacity:0},animate:{x:z,y:`0%`,opacity:1,transition:{duration:.3,ease:T}},exit:{x:z,y:`100%`,opacity:0,transition:{duration:.22,ease:E}},children:S(`div`,{ref:P,style:{display:`flex`,flexDirection:`column`,overflow:`hidden`,transition:`height 260ms cubic-bezier(0.3, 0, 0.06, 1)`},children:O})})})})}(function(e){e.Body=a,e.Hero=d,e.Close=s,e.Details=l,e.Detail=c,e.Footer=u,e.Toggle=_,e.PrimaryAction=f,e.DepositTxRow=m,e.CompletionTxRow=p,e.SubmittedAtRow=g,e.FilledAtRow=h})(D||={});export{D as DepositStatusBanner};
@@ -1 +1 @@
1
- "use client";import{AlertIcon as e}from"../../../../../../shared/icons/AlertIcon.js";import{ArrowDownIcon as t}from"../../../../../../shared/icons/ArrowDownIcon.js";import{CheckIcon as n}from"../../../../../../shared/icons/CheckIcon.js";import"../../../../../../icons/index.js";import{TokenLogo as r}from"../../../../../../shared/ui/TokenLogo/TokenLogo.js";import"../../../../../../shared/ui/TokenLogo/index.js";import{DEPOSIT_STATUS_BANNER_SLOTS as i}from"../DepositStatusBanner.slots.js";import{styles as a}from"../DepositStatusBanner.styles.js";import{useDepositStatusBannerContext as o}from"../context.js";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";import*as u from"@stylexjs/stylex";import{AnimatePresence as d,motion as f}from"motion/react";const p=[.16,1,.3,1],m=.22,h=.08,g=.14,_={enter:{opacity:0,y:6,filter:`blur(4px)`},center:{opacity:1,y:0,filter:`blur(0px)`,transition:{duration:m,delay:h,ease:p}},exit:{opacity:0,y:-6,filter:`blur(4px)`,transition:{duration:g,ease:p}}},v={enter:{opacity:0,scale:.6},center:{opacity:1,scale:1,transition:{duration:m,delay:h,ease:p}},exit:{opacity:0,scale:.6,transition:{duration:g,ease:p}}};function y(){let{kind:e,asset:t,headline:n,subline:p}=o(`DepositStatusBanner.Hero`);return l(s,{children:[l(`span`,{"data-stridge-slot":i.logo,...u.props(a.logo),children:[c(r,{size:32,symbol:t.symbol,...typeof t.chainId==`number`?{chainId:t.chainId}:{},...t.address?{address:t.address}:{},...t.isNative===void 0?{}:{isNative:t.isNative},...t.logoUrl?{logoUrl:t.logoUrl}:{},hideChainBadge:!0}),c(`span`,{"aria-hidden":!0,"data-stridge-slot":i.badge,...u.props(a.badge,e===`succeeded`&&a.badgeSucceeded,e===`failed`&&a.badgeFailed,e===`pending`&&a.badgePending),children:c(d,{mode:`wait`,initial:!1,children:c(f.span,{variants:v,initial:`enter`,animate:`center`,exit:`exit`,style:{display:`flex`,alignItems:`center`,justifyContent:`center`},children:c(b,{kind:e})},e)})})]}),c(`div`,{"data-stridge-slot":i.text,...u.props(a.text),children:c(d,{mode:`wait`,initial:!1,children:l(f.div,{variants:_,initial:`enter`,animate:`center`,exit:`exit`,style:{display:`flex`,flexDirection:`column`,gap:`2px`,minWidth:0},children:[c(`span`,{"data-stridge-slot":i.headline,...u.props(a.headline),children:n}),c(`span`,{"data-stridge-slot":i.subline,...u.props(a.subline),children:p})]},e)})})]})}function b({kind:r}){let i=u.props(a.badgeIcon);return c(r===`succeeded`?n:r===`failed`?e:t,{"aria-hidden":!0,...i})}export{y as DepositStatusBannerHero};
1
+ "use client";import{AlertIcon as e}from"../../../../../../shared/icons/AlertIcon.js";import{ArrowDownIcon as t}from"../../../../../../shared/icons/ArrowDownIcon.js";import{CheckIcon as n}from"../../../../../../shared/icons/CheckIcon.js";import"../../../../../../icons/index.js";import{TokenLogo as r}from"../../../../../../shared/ui/TokenLogo/TokenLogo.js";import"../../../../../../shared/ui/TokenLogo/index.js";import{DEPOSIT_STATUS_BANNER_SLOTS as i}from"../DepositStatusBanner.slots.js";import{styles as a}from"../DepositStatusBanner.styles.js";import{useDepositStatusBannerContext as o}from"../context.js";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";import{AnimatePresence as u,m as d}from"motion/react";import*as f from"@stylexjs/stylex";const p=[.16,1,.3,1],m=.22,h=.08,g=.14,_={enter:{opacity:0,y:6,filter:`blur(4px)`},center:{opacity:1,y:0,filter:`blur(0px)`,transition:{duration:m,delay:h,ease:p}},exit:{opacity:0,y:-6,filter:`blur(4px)`,transition:{duration:g,ease:p}}},v={enter:{opacity:0,scale:.6},center:{opacity:1,scale:1,transition:{duration:m,delay:h,ease:p}},exit:{opacity:0,scale:.6,transition:{duration:g,ease:p}}};function y(){let{kind:e,asset:t,headline:n,subline:p}=o(`DepositStatusBanner.Hero`);return l(s,{children:[l(`span`,{"data-stridge-slot":i.logo,...f.props(a.logo),children:[c(r,{size:32,symbol:t.symbol,...typeof t.chainId==`number`?{chainId:t.chainId}:{},...t.address?{address:t.address}:{},...t.isNative===void 0?{}:{isNative:t.isNative},...t.logoUrl?{logoUrl:t.logoUrl}:{},hideChainBadge:!0}),c(`span`,{"aria-hidden":!0,"data-stridge-slot":i.badge,...f.props(a.badge,e===`succeeded`&&a.badgeSucceeded,e===`failed`&&a.badgeFailed,e===`pending`&&a.badgePending),children:c(u,{mode:`wait`,initial:!1,children:c(d.span,{variants:v,initial:`enter`,animate:`center`,exit:`exit`,style:{display:`flex`,alignItems:`center`,justifyContent:`center`},children:c(b,{kind:e})},e)})})]}),c(`div`,{"data-stridge-slot":i.text,...f.props(a.text),children:c(u,{mode:`wait`,initial:!1,children:l(d.div,{variants:_,initial:`enter`,animate:`center`,exit:`exit`,style:{display:`flex`,flexDirection:`column`,gap:`2px`,minWidth:0},children:[c(`span`,{"data-stridge-slot":i.headline,...f.props(a.headline),children:n}),c(`span`,{"data-stridge-slot":i.subline,...f.props(a.subline),children:p})]},e)})})]})}function b({kind:r}){let i=f.props(a.badgeIcon);return c(r===`succeeded`?n:r===`failed`?e:t,{"aria-hidden":!0,...i})}export{y as DepositStatusBannerHero};
@@ -1 +1 @@
1
- "use client";import{useLingui as e}from"../../../../../../shared/i18n/useLingui.js";import"../../../../../../i18n/index.js";import{ChevronRightIcon as t}from"../../../../../../shared/icons/ChevronRightIcon.js";import"../../../../../../icons/index.js";import{Button as n}from"../../../../../../shared/ui/Button/Button.js";import"../../../../../../shared/ui/Button/index.js";import{DEPOSIT_STATUS_BANNER_SLOTS as r}from"../DepositStatusBanner.slots.js";import{useDepositStatusBannerContext as i}from"../context.js";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{AnimatePresence as s,motion as c}from"motion/react";const l=[.16,1,.3,1],u={enter:{opacity:0,y:`60%`},center:{opacity:1,y:`0%`,transition:{duration:.22,ease:l}},exit:{opacity:0,y:`-60%`,transition:{duration:.18,ease:l}}};function d({onClick:l,label:d}={}){let f=i(`DepositStatusBanner.PrimaryAction`),{kind:p}=f,m=l??f.onPrimaryAction,{_:h}=e();if(!m)return null;let g=d??h(p===`succeeded`?{id:`AO44G_`,message:`View receipt`}:p===`failed`?{id:`2Eoi_a`,message:`View details`}:{id:`Oi8TiZ`,message:`View progress`}),_=d??[h({id:`Oi8TiZ`,message:`View progress`}),h({id:`AO44G_`,message:`View receipt`}),h({id:`2Eoi_a`,message:`View details`})].reduce((e,t)=>t.length>e.length?t:e);return a(n,{type:`button`,onClick:m,variant:`default`,size:`sm`,suffix:a(t,{"aria-hidden":!0}),"data-stridge-slot":r.primaryAction,children:o(`span`,{style:{position:`relative`,display:`inline-flex`,alignItems:`center`,overflow:`hidden`},children:[a(`span`,{"aria-hidden":!0,style:{visibility:`hidden`,whiteSpace:`nowrap`},children:_}),a(s,{mode:`popLayout`,initial:!1,children:a(c.span,{variants:u,initial:`enter`,animate:`center`,exit:`exit`,style:{position:`absolute`,insetInlineStart:0,insetBlockStart:0,width:`100%`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,whiteSpace:`nowrap`},children:g},g)})]})})}export{d as DepositStatusBannerPrimaryAction};
1
+ "use client";import{useLingui as e}from"../../../../../../shared/i18n/useLingui.js";import"../../../../../../i18n/index.js";import{ChevronRightIcon as t}from"../../../../../../shared/icons/ChevronRightIcon.js";import"../../../../../../icons/index.js";import{Button as n}from"../../../../../../shared/ui/Button/Button.js";import"../../../../../../shared/ui/Button/index.js";import{DEPOSIT_STATUS_BANNER_SLOTS as r}from"../DepositStatusBanner.slots.js";import{useDepositStatusBannerContext as i}from"../context.js";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{AnimatePresence as s,m as c}from"motion/react";const l=[.16,1,.3,1],u={enter:{opacity:0,y:`60%`},center:{opacity:1,y:`0%`,transition:{duration:.22,ease:l}},exit:{opacity:0,y:`-60%`,transition:{duration:.18,ease:l}}};function d({onClick:l,label:d}={}){let f=i(`DepositStatusBanner.PrimaryAction`),{kind:p}=f,m=l??f.onPrimaryAction,{_:h}=e();if(!m)return null;let g=d??h(p===`succeeded`?{id:`AO44G_`,message:`View receipt`}:p===`failed`?{id:`2Eoi_a`,message:`View details`}:{id:`Oi8TiZ`,message:`View progress`}),_=d??[h({id:`Oi8TiZ`,message:`View progress`}),h({id:`AO44G_`,message:`View receipt`}),h({id:`2Eoi_a`,message:`View details`})].reduce((e,t)=>t.length>e.length?t:e);return a(n,{type:`button`,onClick:m,variant:`default`,size:`sm`,suffix:a(t,{"aria-hidden":!0}),"data-stridge-slot":r.primaryAction,children:o(`span`,{style:{position:`relative`,display:`inline-flex`,alignItems:`center`,overflow:`hidden`},children:[a(`span`,{"aria-hidden":!0,style:{visibility:`hidden`,whiteSpace:`nowrap`},children:_}),a(s,{mode:`popLayout`,initial:!1,children:a(c.span,{variants:u,initial:`enter`,animate:`center`,exit:`exit`,style:{position:`absolute`,insetInlineStart:0,insetBlockStart:0,width:`100%`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,whiteSpace:`nowrap`},children:g},g)})]})})}export{d as DepositStatusBannerPrimaryAction};
@@ -1 +1 @@
1
- "use client";import{useDepositSnapshot as e}from"../../driver/context.js";import{useLingui as t}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useDepositActions as n,useDepositEffectiveState as r}from"../../orchestrator/controller.js";import{shortenAddress as i}from"../../../../shared/format/shortenAddress.js";import{DialogShell as a}from"../../../../shared/dialog/DialogShell.js";import{ProcessingState as o}from"../../../../shared/widgets/processing-state/compound/ProcessingState.js";import"../../../../shared/widgets/processing-state/compound/index.js";import{jsx as s,jsxs as c}from"react/jsx-runtime";function l(a){let l=e(),u=r(),{back:d,close:f}=n(),{_:p}=t();if(u.name!==`processing`)return null;let m=l.settlement,h=(m.status===`ready`||m.status===`stale`)&&m.payload.kind===`pending`?m.payload:void 0,g=l.brand,_=g.status===`ready`||g.status===`stale`?g.payload.name:void 0,v=l.target,y=v.status===`ready`||v.status===`stale`?v.payload:void 0,b=l.wallet,x=b.status===`ready`||b.status===`stale`?b.payload:void 0,S=!h||h.receiveAmount.value===0,C=h?h.receiveAmount.formatted:``,w=h?.creditedAsset.symbol??y?.symbol??``,T=h?.creditedTo||_||w,E=u.ctx.tx,D=h?.txHash?.formatted??(E.hash?i(E.hash):``),O=h?.txExplorerUrl??E.explorerUrl,k=h?.sourceWallet.name??p({id:`sb9Y58`,message:`Wallet`}),A=h?.sourceWallet.address.formatted??x?.address.formatted??``,j=h?.sourceWallet.explorerUrl,M=A?{name:k,address:A,...j?{explorerUrl:j}:{}}:void 0,N=D?{hash:D,...O?{explorerUrl:O}:{}}:void 0;return c(o,{...a,amount:C,creditedAsset:{symbol:w},creditedTo:T,...S?{loading:!0}:{},onBack:d,...M?{sourceWallet:M}:{},...N?{sourceTx:N}:{},...h?.submittedAt?{submittedAt:h.submittedAt.formatted}:{},...h?.detectedAt?{detectedAt:h.detectedAt.formatted}:{},onClose:f,children:[s(o.Header,{}),c(o.Body,{children:[s(o.Hero,{}),s(o.StatusPill,{}),c(o.Details,{children:[s(o.SourceRow,{}),s(o.SourceTxRow,{}),s(o.SubmittedAtRow,{}),s(o.DetectedAtRow,{})]})]}),s(o.Actions,{})]})}function u({open:e,defaultOpen:t,onOpenChange:n,trigger:r,...i}){return s(a,{open:e,defaultOpen:t,onOpenChange:n,trigger:r,children:s(l,{...i})})}(function(e){e.Dialog=u})(l||={});export{l as ProcessingState};
1
+ "use client";import{useDepositSnapshot as e}from"../../driver/context.js";import{useLingui as t}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useDepositActions as n,useDepositEffectiveState as r}from"../../orchestrator/controller.js";import{shortenAddress as i}from"../../../../shared/format/shortenAddress.js";import{DialogShell as a}from"../../../../shared/dialog/DialogShell.js";import{ProcessingState as o}from"../../../../shared/widgets/processing-state/compound/ProcessingState.js";import"../../../../shared/widgets/processing-state/compound/index.js";import{jsx as s,jsxs as c}from"react/jsx-runtime";function l(a){let l=e(),u=r(),{back:d}=n(),{_:f}=t();if(u.name!==`processing`)return null;let p=l.settlement,m=(p.status===`ready`||p.status===`stale`)&&p.payload.kind===`pending`?p.payload:void 0,h=l.brand,g=h.status===`ready`||h.status===`stale`?h.payload.name:void 0,_=l.target,v=_.status===`ready`||_.status===`stale`?_.payload:void 0,y=l.wallet,b=y.status===`ready`||y.status===`stale`?y.payload:void 0,x=!m||m.receiveAmount.value===0,S=m?m.receiveAmount.formatted:``,C=m?.creditedAsset.symbol??v?.symbol??``,w=m?.creditedTo||g||C,T=u.ctx.tx,E=m?.txHash?.formatted??(T.hash?i(T.hash):``),D=m?.txExplorerUrl??T.explorerUrl,O=m?.sourceWallet.name??f({id:`sb9Y58`,message:`Wallet`}),k=m?.sourceWallet.address.formatted??b?.address.formatted??``,A=m?.sourceWallet.explorerUrl,j=k?{name:O,address:k,...A?{explorerUrl:A}:{}}:void 0,M=E?{hash:E,...D?{explorerUrl:D}:{}}:void 0;return c(o,{...a,amount:S,creditedAsset:{symbol:C},creditedTo:w,...x?{loading:!0}:{},onBack:d,...j?{sourceWallet:j}:{},...M?{sourceTx:M}:{},...m?.submittedAt?{submittedAt:m.submittedAt.formatted}:{},...m?.detectedAt?{detectedAt:m.detectedAt.formatted}:{},children:[s(o.Header,{}),c(o.Body,{children:[s(o.Hero,{}),s(o.StatusPill,{}),c(o.Details,{children:[s(o.SourceRow,{}),s(o.SourceTxRow,{}),s(o.SubmittedAtRow,{}),s(o.DetectedAtRow,{})]})]})]})}function u({open:e,defaultOpen:t,onOpenChange:n,trigger:r,...i}){return s(a,{open:e,defaultOpen:t,onOpenChange:n,trigger:r,children:s(l,{...i})})}(function(e){e.Dialog=u})(l||={});export{l as ProcessingState};
@@ -1 +1 @@
1
- "use client";import{useDepositSnapshot as e}from"../../driver/context.js";import{useDepositActions as t,useDepositEffectiveState as n}from"../../orchestrator/controller.js";import{DialogShell as r}from"../../../../shared/dialog/DialogShell.js";import{TransferCrypto as i}from"./compound/TransferCrypto.js";import"./compound/index.js";import{useMemo as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";function l(r){let l=e(),u=n(),d=u.name,{back:f}=t(),p=u.name===`transferCrypto`&&u.ctx.backTarget!==`closed`?f:void 0,m=l.addresses,h=m.status===`ready`||m.status===`stale`?m.payload:[],g=l.target,_=g.status===`ready`||g.status===`stale`?g.payload:void 0,v=_?.minDepositUsd?.formatted,y=a(()=>{let e=new Map;for(let t of h)for(let n of t.acceptedAssets??[]){let r=n.symbol.toUpperCase(),i=e.get(r);i?i.push({chain:t,asset:n}):e.set(r,[{chain:t,asset:n}])}return e},[h]),b=a(()=>y.size===0?_?[{symbol:_.symbol,..._.eip155Id?{chainId:Number(_.eip155Id)}:{},..._.address?{address:_.address}:{},..._.isNative===void 0?{}:{isNative:_.isNative},..._.assetLogoUrl?{logoUrl:_.assetLogoUrl}:{}}]:[]:[...y.values()].map(e=>{let t=e[0];return{symbol:t.asset.symbol,...t.chain.eip155Id?{chainId:Number(t.chain.eip155Id)}:{},...t.asset.address?{address:t.asset.address}:{},isNative:t.asset.isNative,...t.asset.assetLogoUrl?{logoUrl:t.asset.assetLogoUrl}:{}}}),[y,_]),[x,S]=o(void 0),[C,w]=o(void 0),T=a(()=>{if(x&&b.some(e=>e.symbol.toUpperCase()===x.symbol.toUpperCase()))return x;let e=_?.symbol.toUpperCase();return b.find(t=>t.symbol.toUpperCase()===e)??b[0]},[x,b,_?.symbol]),E=a(()=>(T?y.get(T.symbol.toUpperCase())?.map(e=>e.chain)??[...h]:[...h]).map(e=>{let t=e.minDepositUsd?.formatted??v;return{symbol:e.networkName,...e.eip155Id?{chainId:Number(e.eip155Id)}:{},isNative:!0,...e.chainLogoUrl?{logoUrl:e.chainLogoUrl}:{},...t?{minDeposit:t}:{}}}),[T,y,h,v]),D=a(()=>{if(C&&E.some(e=>e.chainId===C.chainId))return C;let e=_?.eip155Id?Number(_.eip155Id):void 0;return(e===void 0?void 0:E.find(t=>t.chainId===e))??E[0]},[C,E,_?.eip155Id]),O=a(()=>D?.chainId?h.find(e=>e.eip155Id&&Number(e.eip155Id)===D.chainId)??h[0]:h[0],[D,h]),k=a(()=>{if(!T)return;let e=O?.acceptedAssets?.find(e=>e.symbol.toUpperCase()===T.symbol.toUpperCase());return e?{symbol:e.symbol,...D?.chainId===void 0?{}:{chainId:D.chainId},...e.address?{address:e.address}:{},isNative:e.isNative,...e.assetLogoUrl?{logoUrl:e.assetLogoUrl}:{}}:T},[T,O,D?.chainId]),A=O?.address.value??``;if(d!==`transferCrypto`||!_||h.length===0)return null;let j={symbol:_.symbol,..._.eip155Id?{chainId:Number(_.eip155Id)}:{},..._.address?{address:_.address}:{},..._.isNative===void 0?{}:{isNative:_.isNative},..._.assetLogoUrl?{logoUrl:_.assetLogoUrl}:{}},M={symbol:_.networkName,..._.eip155Id?{chainId:Number(_.eip155Id)}:{},isNative:!0,..._.chainLogoUrl?{logoUrl:_.chainLogoUrl}:{}};return c(i,{...r,depositAddress:A,token:k,chain:D,onTokenChange:S,onChainChange:w,tokenOptions:b,chainOptions:E,sendAsset:k,sendNetwork:D,receiveAsset:j,receiveNetwork:M,children:[s(i.Header,{...p?{onBack:p}:{}}),c(i.Body,{children:[s(i.Selectors,{}),s(i.QrCode,{}),s(i.Summary,{}),s(i.Address,{}),s(i.Disclosure,{})]})]})}function u({open:e,defaultOpen:t,onOpenChange:n,trigger:i,...a}){return s(r,{open:e,defaultOpen:t,onOpenChange:n,trigger:i,children:s(l,{...a})})}(function(e){e.Dialog=u})(l||={});export{l as TransferCrypto};
1
+ "use client";import{useDepositSnapshot as e}from"../../driver/context.js";import{useDepositActions as t,useDepositEffectiveState as n}from"../../orchestrator/controller.js";import{useKitEmitter as r}from"../../../../events/emit/useKitEmitter.js";import"../../../../events/emit/index.js";import{DialogShell as i}from"../../../../shared/dialog/DialogShell.js";import{TransferCrypto as a}from"./compound/TransferCrypto.js";import"./compound/index.js";import{useCallback as o,useMemo as s,useState as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";function d(i){let d=e(),f=n(),p=f.name,{back:m}=t(),h=f.name===`transferCrypto`&&f.ctx.backTarget!==`closed`?m:void 0,g=d.addresses,_=g.status===`ready`||g.status===`stale`?g.payload:[],v=d.target,y=v.status===`ready`||v.status===`stale`?v.payload:void 0,b=y?.minAmountUsd?.formatted,x=s(()=>{let e=new Map;for(let t of _)for(let n of t.acceptedAssets??[]){let r=n.symbol.toUpperCase(),i=e.get(r);i?i.push({chain:t,asset:n}):e.set(r,[{chain:t,asset:n}])}return e},[_]),S=s(()=>x.size===0?y?[{symbol:y.symbol,...y.eip155Id?{chainId:Number(y.eip155Id)}:{},...y.address?{address:y.address}:{},...y.isNative===void 0?{}:{isNative:y.isNative},...y.assetLogoUrl?{logoUrl:y.assetLogoUrl}:{}}]:[]:[...x.values()].map(e=>{let t=e[0];return{symbol:t.asset.symbol,...t.chain.eip155Id?{chainId:Number(t.chain.eip155Id)}:{},...t.asset.address?{address:t.asset.address}:{},isNative:t.asset.isNative,...t.asset.assetLogoUrl?{logoUrl:t.asset.assetLogoUrl}:{}}}),[x,y]),[C,w]=c(void 0),[T,E]=c(void 0),D=r(),O=o(e=>{w(e),D({type:`deposit.transfer.token.changed`,flow:`deposit`,tier:`ui`,payload:{token:e}})},[D]),k=o(e=>{E(e),D({type:`deposit.transfer.chain.changed`,flow:`deposit`,tier:`ui`,payload:{chain:e}})},[D]),A=o(e=>{D({type:`deposit.transfer.address.copied`,flow:`deposit`,tier:`ui`,payload:{address:e}})},[D]),j=s(()=>{if(C&&S.some(e=>e.symbol.toUpperCase()===C.symbol.toUpperCase()))return C;let e=y?.symbol.toUpperCase();return S.find(t=>t.symbol.toUpperCase()===e)??S[0]},[C,S,y?.symbol]),M=s(()=>(j?x.get(j.symbol.toUpperCase())?.map(e=>e.chain)??[..._]:[..._]).map(e=>{let t=e.minAmountUsd?.formatted??b;return{symbol:e.networkName,...e.eip155Id?{chainId:Number(e.eip155Id)}:{},isNative:!0,...e.chainLogoUrl?{logoUrl:e.chainLogoUrl}:{},...t?{minDeposit:t}:{}}}),[j,x,_,b]),N=s(()=>{if(T&&M.some(e=>e.chainId===T.chainId))return T;let e=y?.eip155Id?Number(y.eip155Id):void 0;return(e===void 0?void 0:M.find(t=>t.chainId===e))??M[0]},[T,M,y?.eip155Id]),P=s(()=>N?.chainId?_.find(e=>e.eip155Id&&Number(e.eip155Id)===N.chainId)??_[0]:_[0],[N,_]),F=s(()=>{if(!j)return;let e=P?.acceptedAssets?.find(e=>e.symbol.toUpperCase()===j.symbol.toUpperCase());return e?{symbol:e.symbol,...N?.chainId===void 0?{}:{chainId:N.chainId},...e.address?{address:e.address}:{},isNative:e.isNative,...e.assetLogoUrl?{logoUrl:e.assetLogoUrl}:{}}:j},[j,P,N?.chainId]),I=P?.address.value??``;if(p!==`transferCrypto`||!y||_.length===0)return null;let L={symbol:y.symbol,...y.eip155Id?{chainId:Number(y.eip155Id)}:{},...y.address?{address:y.address}:{},...y.isNative===void 0?{}:{isNative:y.isNative},...y.assetLogoUrl?{logoUrl:y.assetLogoUrl}:{}},R={symbol:y.networkName,...y.eip155Id?{chainId:Number(y.eip155Id)}:{},isNative:!0,...y.chainLogoUrl?{logoUrl:y.chainLogoUrl}:{}};return u(a,{...i,depositAddress:I,token:F,chain:N,onTokenChange:O,onChainChange:k,onCopy:A,tokenOptions:S,chainOptions:M,sendAsset:F,sendNetwork:N,receiveAsset:L,receiveNetwork:R,children:[l(a.Header,{...h?{onBack:h}:{}}),u(a.Body,{children:[l(a.Selectors,{}),l(a.QrCode,{}),l(a.Summary,{}),l(a.Address,{}),l(a.Disclosure,{})]})]})}function f({open:e,defaultOpen:t,onOpenChange:n,trigger:r,...a}){return l(i,{open:e,defaultOpen:t,onOpenChange:n,trigger:r,children:l(d,{...a})})}(function(e){e.Dialog=f})(d||={});export{d as TransferCrypto};
@@ -1,5 +1,5 @@
1
- import { TransferCryptoAddress } from "./components/Address.js";
2
1
  import { TransferCryptoBodyProps, TransferCryptoDialogProps, TransferCryptoDisclosureProps, TransferCryptoHeaderProps, TransferCryptoProps } from "./types.js";
2
+ import { TransferCryptoAddress } from "./components/Address.js";
3
3
  import { TransferCryptoDisclosure } from "./components/Disclosure.js";
4
4
  import { TransferCryptoHeader } from "./components/Header.js";
5
5
  import { TransferCryptoQrCode } from "./components/QrCode.js";
@@ -1 +1 @@
1
- "use client";import{useLingui as e}from"../../../../../../shared/i18n/useLingui.js";import"../../../../../../i18n/index.js";import{CopyIcon as t}from"../../../../../../shared/icons/CopyIcon.js";import{InfoIcon as n}from"../../../../../../shared/icons/InfoIcon.js";import"../../../../../../icons/index.js";import{Button as r}from"../../../../../../shared/ui/Button/Button.js";import"../../../../../../shared/ui/Button/index.js";import{Card as i}from"../../../../../../shared/ui/Card/Card.js";import{ExternalLink as a}from"../../../../../../shared/ui/ExternalLink/ExternalLink.js";import"../../../../../../shared/ui/ExternalLink/index.js";import{text as o}from"../../../../../../shared/ui/Text/Text.js";import"../../../../../../ui/index.js";import{BRAND_LINKS as s}from"../../../../../../shared/constants/brand-links.js";import{useCopyToClipboard as c}from"../../../../../../shared/utils/useCopyToClipboard.js";import{useTransferCryptoContext as l}from"../context.js";import{TRANSFER_CRYPTO_SLOTS as u}from"../TransferCrypto.slots.js";import{styles as d}from"../TransferCrypto.styles.js";import{InfoTooltip as f}from"./InfoTooltip.js";import{useCallback as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import*as g from"@stylexjs/stylex";function _(){let _=l(`TransferCrypto.Address`),{_:v}=e(),{isCopied:y,copy:b}=c(_.depositAddress),x=v({id:`6D8qH6`,message:`Send the selected token on the selected chain to this address. Funds appear in your account once the network confirms the transfer.`}),S=p(async()=>{await b()&&_.onCopy?.(_.depositAddress)},[b,_]);return h(`div`,{"data-stridge-slot":u.address,...g.props(d.addressSection),children:[h(`div`,{...g.props(d.addressLabelRow),children:[h(o.span,{size:`meta`,fontWeight:`medium`,leading:`tight`,...g.props(d.addressLabel),children:[v({id:`pCzTTC`,message:`Your deposit address`}),m(f,{content:x,children:m(n,{"aria-hidden":!0,...g.props(d.addressLabelInfo)})})]}),m(a,{href:s.terms,...g.props(d.termsLink),children:m(o.span,{size:`xs`,fontWeight:`medium`,leading:`tight`,color:`inherit`,children:v({id:`cGYrpE`,message:`Terms apply`})})})]}),h(i,{variant:`subdued`,dir:`ltr`,...g.props(d.addressPill),children:[m(o.span,{size:`xs`,fontWeight:`medium`,leading:`tight`,tracking:`normal`,font:`mono`,...g.props(d.addressText),children:_.depositAddress}),h(r,{variant:`secondary`,onClick:S,"aria-label":v({id:`SOVBoe`,message:`Copy deposit address`}),...g.props(d.copyButton),children:[m(t,{"aria-hidden":!0,...g.props(d.copyIcon)}),m(o.span,{size:`meta`,fontWeight:`semibold`,leading:`tight`,tracking:`tight`,color:`inherit`,children:v(y?{id:`PiH3UR`,message:`Copied!`}:{id:`he3ygx`,message:`Copy`})})]})]})]})}export{_ as TransferCryptoAddress};
1
+ "use client";import{useLingui as e}from"../../../../../../shared/i18n/useLingui.js";import"../../../../../../i18n/index.js";import{CopyIcon as t}from"../../../../../../shared/icons/CopyIcon.js";import{InfoIcon as n}from"../../../../../../shared/icons/InfoIcon.js";import"../../../../../../icons/index.js";import{Button as r}from"../../../../../../shared/ui/Button/Button.js";import"../../../../../../shared/ui/Button/index.js";import{Card as i}from"../../../../../../shared/ui/Card/Card.js";import{text as a}from"../../../../../../shared/ui/Text/Text.js";import"../../../../../../ui/index.js";import{TermsLink as o}from"../../../../../../shared/terms/TermsLink.js";import"../../../../../../shared/terms/index.js";import{useCopyToClipboard as s}from"../../../../../../shared/utils/useCopyToClipboard.js";import{useTransferCryptoContext as c}from"../context.js";import{TRANSFER_CRYPTO_SLOTS as l}from"../TransferCrypto.slots.js";import{styles as u}from"../TransferCrypto.styles.js";import{InfoTooltip as d}from"./InfoTooltip.js";import{useCallback as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";import*as h from"@stylexjs/stylex";function g(){let g=c(`TransferCrypto.Address`),{_}=e(),{isCopied:v,copy:y}=s(g.depositAddress),b=_({id:`6D8qH6`,message:`Send the selected token on the selected chain to this address. Funds appear in your account once the network confirms the transfer.`}),x=f(async()=>{await y()&&g.onCopy?.(g.depositAddress)},[y,g]);return m(`div`,{"data-stridge-slot":l.address,...h.props(u.addressSection),children:[m(`div`,{...h.props(u.addressLabelRow),children:[m(a.span,{size:`meta`,fontWeight:`medium`,leading:`tight`,...h.props(u.addressLabel),children:[_({id:`pCzTTC`,message:`Your deposit address`}),p(d,{content:b,children:p(n,{"aria-hidden":!0,...h.props(u.addressLabelInfo)})})]}),p(o,{...h.props(u.termsLink),children:p(a.span,{size:`xs`,fontWeight:`medium`,leading:`tight`,color:`inherit`,children:_({id:`cGYrpE`,message:`Terms apply`})})})]}),m(i,{variant:`subdued`,dir:`ltr`,...h.props(u.addressPill),children:[p(a.span,{size:`xs`,fontWeight:`medium`,leading:`tight`,tracking:`normal`,font:`mono`,...h.props(u.addressText),children:g.depositAddress}),m(r,{variant:`secondary`,onClick:x,"aria-label":_({id:`SOVBoe`,message:`Copy deposit address`}),...h.props(u.copyButton),children:[p(t,{"aria-hidden":!0,...h.props(u.copyIcon)}),p(a.span,{size:`meta`,fontWeight:`semibold`,leading:`tight`,tracking:`tight`,color:`inherit`,children:_(v?{id:`PiH3UR`,message:`Copied!`}:{id:`he3ygx`,message:`Copy`})})]})]})]})}export{g as TransferCryptoAddress};
@@ -5,7 +5,8 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
5
5
  /**
6
6
  * Disclosure part — collapsible footer surfacing the rough processing-time
7
7
  * hint as the trigger and the "Have questions?" help row inside the panel.
8
- * The help row always renders and links to {@link BRAND_LINKS.support}.
8
+ * The help row always renders and opens the Stridge messenger via
9
+ * {@link SupportLink}.
9
10
  */
10
11
  declare function TransferCryptoDisclosure({
11
12
  defaultOpen,
@@ -1 +1 @@
1
- "use client";import{useLingui as e}from"../../../../../../shared/i18n/useLingui.js";import"../../../../../../i18n/index.js";import{ChevronDownIcon as t}from"../../../../../../shared/icons/ChevronDownIcon.js";import{CircleHelpIcon as n}from"../../../../../../shared/icons/CircleHelpIcon.js";import{ClockIcon as r}from"../../../../../../shared/icons/ClockIcon.js";import"../../../../../../icons/index.js";import{Card as i}from"../../../../../../shared/ui/Card/Card.js";import{Collapsible as a}from"../../../../../../shared/ui/Collapsible/Collapsible.js";import"../../../../../../shared/ui/Collapsible/index.js";import{ExternalLink as o}from"../../../../../../shared/ui/ExternalLink/ExternalLink.js";import"../../../../../../shared/ui/ExternalLink/index.js";import{text as s}from"../../../../../../shared/ui/Text/Text.js";import"../../../../../../ui/index.js";import{BRAND_LINKS as c}from"../../../../../../shared/constants/brand-links.js";import{TRANSFER_CRYPTO_SLOTS as l}from"../TransferCrypto.slots.js";import{styles as u}from"../TransferCrypto.styles.js";import{jsx as d,jsxs as f}from"react/jsx-runtime";import*as p from"@stylexjs/stylex";function m({defaultOpen:m=!1,open:h,onOpenChange:g,processingTime:_}){let{_:v}=e(),y=_??v({id:`KuqCAK`,message:`~ 2 min`});return f(a,{"data-stridge-slot":l.disclosure,defaultOpen:m,open:h,onOpenChange:g,render:d(i,{variant:`subdued`}),...p.props(u.disclosure),children:[f(a.Trigger,{render:d(`div`,{}),nativeButton:!1,...p.props(u.disclosureHeader),children:[d(r,{"aria-hidden":!0,...p.props(u.disclosureRowIcon)}),d(`div`,{...p.props(u.disclosureRowTextWithInfo),children:d(s.span,{size:`meta`,fontWeight:`medium`,leading:`tight`,children:v({id:`7evBec`,message:`Processing time: {resolvedProcessingTime}`,values:{resolvedProcessingTime:y}})})}),d(t,{"aria-hidden":!0,...p.props(u.disclosureChevron,u.disclosureHeaderChevron)})]}),d(a.Panel,{children:d(`div`,{...p.props(u.disclosurePanelInner),children:f(`div`,{...p.props(u.disclosureRow),children:[d(n,{"aria-hidden":!0,...p.props(u.disclosureRowIcon)}),f(`div`,{children:[d(s.span,{size:`meta`,fontWeight:`medium`,leading:`tight`,...p.props(u.helpQuestion),children:v({id:`QU2cIs`,message:`Have questions?`})}),d(o,{href:c.support,...p.props(u.helpLink),children:d(s.span,{size:`meta`,fontWeight:`medium`,leading:`tight`,color:`inherit`,children:v({id:`AWtGgd`,message:`Get help`})})})]})]})})})]})}export{m as TransferCryptoDisclosure};
1
+ "use client";import{useLingui as e}from"../../../../../../shared/i18n/useLingui.js";import"../../../../../../i18n/index.js";import{ChevronDownIcon as t}from"../../../../../../shared/icons/ChevronDownIcon.js";import{CircleHelpIcon as n}from"../../../../../../shared/icons/CircleHelpIcon.js";import{ClockIcon as r}from"../../../../../../shared/icons/ClockIcon.js";import"../../../../../../icons/index.js";import{SupportLink as i}from"../../../../../../shared/support/SupportLink.js";import"../../../../../../shared/support/index.js";import{Card as a}from"../../../../../../shared/ui/Card/Card.js";import{Collapsible as o}from"../../../../../../shared/ui/Collapsible/Collapsible.js";import"../../../../../../shared/ui/Collapsible/index.js";import{text as s}from"../../../../../../shared/ui/Text/Text.js";import"../../../../../../ui/index.js";import{TRANSFER_CRYPTO_SLOTS as c}from"../TransferCrypto.slots.js";import{styles as l}from"../TransferCrypto.styles.js";import{jsx as u,jsxs as d}from"react/jsx-runtime";import*as f from"@stylexjs/stylex";function p({defaultOpen:p=!1,open:m,onOpenChange:h,processingTime:g}){let{_}=e(),v=g??_({id:`KuqCAK`,message:`~ 2 min`});return d(o,{"data-stridge-slot":c.disclosure,defaultOpen:p,open:m,onOpenChange:h,render:u(a,{variant:`subdued`}),...f.props(l.disclosure),children:[d(o.Trigger,{render:u(`div`,{}),nativeButton:!1,...f.props(l.disclosureHeader),children:[u(r,{"aria-hidden":!0,...f.props(l.disclosureRowIcon)}),u(`div`,{...f.props(l.disclosureRowTextWithInfo),children:u(s.span,{size:`meta`,fontWeight:`medium`,leading:`tight`,children:_({id:`7evBec`,message:`Processing time: {resolvedProcessingTime}`,values:{resolvedProcessingTime:v}})})}),u(t,{"aria-hidden":!0,...f.props(l.disclosureChevron,l.disclosureHeaderChevron)})]}),u(o.Panel,{children:u(`div`,{...f.props(l.disclosurePanelInner),children:d(`div`,{...f.props(l.disclosureRow),children:[u(n,{"aria-hidden":!0,...f.props(l.disclosureRowIcon)}),d(`div`,{children:[u(s.span,{size:`meta`,fontWeight:`medium`,leading:`tight`,...f.props(l.helpQuestion),children:_({id:`QU2cIs`,message:`Have questions?`})}),u(i,{...f.props(l.helpLink),children:u(s.span,{size:`meta`,fontWeight:`medium`,leading:`tight`,color:`inherit`,children:_({id:`AWtGgd`,message:`Get help`})})})]})]})})})]})}export{p as TransferCryptoDisclosure};
@@ -5,16 +5,10 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
5
5
  * QR code part — renders the deposit address as a QR code with the
6
6
  * selected chain's logo punched out at the center.
7
7
  *
8
- * The arena is rendered inside an SVG `<foreignObject>` whose
9
- * coordinate system is the QR's viewBox (cells, ~33 user units across)
10
- * rather than CSS pixels. So `px` values on HTML descendants get
11
- * scaled by the SVG factor (~4.85× for a 160-pixel QR with a 33-cell
12
- * grid) — `height: 36px` on the icon turned into ~175 actual pixels
13
- * and the SVG ballooned. Percentages resolve correctly because they
14
- * stay in the local user-unit space, so the img sizes against Cuer's
15
- * arena `<foreignObject>` width/height directly. `object-fit: contain`
16
- * preserves aspect ratio so chain logos with non-square viewBoxes
17
- * (Ethereum is 784×1277) don't squish.
8
+ * The logo is rendered via `Cuer.Arena` as a native SVG `<image>`
9
+ * `preserveAspectRatio="xMidYMid meet"` (the SVG equivalent of
10
+ * `object-fit: contain`) keeps non-square chain artwork from squishing,
11
+ * and the SVG coordinate system places it exactly on the QR centre.
18
12
  */
19
13
  declare function TransferCryptoQrCode(): _$react_jsx_runtime0.JSX.Element;
20
14
  //#endregion
@@ -1 +1 @@
1
- "use client";import{resolveChainLogoChain as e}from"../../../../../../shared/utils/logos/resolveLogoSrc.js";import"../../../../../../shared/utils/logos/index.js";import{useTransferCryptoContext as t}from"../context.js";import{TRANSFER_CRYPTO_SLOTS as n}from"../TransferCrypto.slots.js";import{styles as r}from"../TransferCrypto.styles.js";import{useEffect as i,useState as a}from"react";import{jsx as o}from"react/jsx-runtime";import*as s from"@stylexjs/stylex";import{Cuer as c}from"cuer";function l(){let l=t(`TransferCrypto.QrCode`),u=e({...l.chain.chainId===void 0?{}:{chainId:l.chain.chainId},...l.chain.logoUrl===void 0?{}:{chainLogoUrl:l.chain.logoUrl}}),[d,f]=a(0);i(()=>{f(0)},[u.join(`|`)]);let p=u[d];return o(`div`,{"data-stridge-slot":n.qr,...s.props(r.qrFrame),children:o(c,{value:l.depositAddress,size:160,arena:p?o(`img`,{src:p,alt:l.chain.symbol,"data-stridge-slot":n.qrArena,onError:()=>{d<u.length-1&&f(d+1)},style:{width:`100%`,height:`100%`,objectFit:`contain`,display:`block`,borderRadius:`var(--stridge-kit-radius-lg)`}},p):null,...s.props(r.qrSvg)})})}export{l as TransferCryptoQrCode};
1
+ "use client";import{resolveChainLogoChain as e}from"../../../../../../shared/utils/logos/resolveLogoSrc.js";import"../../../../../../shared/utils/logos/index.js";import{useTransferCryptoContext as t}from"../context.js";import{TRANSFER_CRYPTO_SLOTS as n}from"../TransferCrypto.slots.js";import{styles as r}from"../TransferCrypto.styles.js";import{Cuer as i}from"../../../../../../shared/cuer/Cuer.js";import"../../../../../../shared/cuer/index.js";import{useEffect as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import*as l from"@stylexjs/stylex";function u(){let u=t(`TransferCrypto.QrCode`),d=e({...u.chain.chainId===void 0?{}:{chainId:u.chain.chainId},...u.chain.logoUrl===void 0?{}:{chainLogoUrl:u.chain.logoUrl}}),[f,p]=o(0);a(()=>{p(0)},[d.join(`|`)]);let m=d[f];return s(`div`,{"data-stridge-slot":n.qr,...l.props(r.qrFrame),children:c(i.Root,{value:u.depositAddress,size:160,...l.props(r.qrSvg),children:[s(i.Finder,{}),s(i.Cells,{}),m&&s(i.Arena,{href:m,"aria-label":u.chain.symbol,"data-stridge-slot":n.qrArena,onError:()=>{f<d.length-1&&p(f+1)}},m)]})})}export{u as TransferCryptoQrCode};
@@ -1 +1 @@
1
- function e(e,t={}){let n=e.settlements??[],r=t.txHash?.toLowerCase(),i=t.sinceIso??``,a=n.filter(e=>r?e.from?.tx_id?.toLowerCase()===r:(e.created_at??``)>=i);if(a.length!==0)return[...a].sort((e,t)=>(t.updated_at??``).localeCompare(e.updated_at??``))[0]}export{e as pickRelevantSettlement};
1
+ function e(e,t={}){let n=e.settlements??[],r=t.txHash?.toLowerCase();if(r){let e=n.filter(e=>e.from?.tx_id?.toLowerCase()===r);return e.length===0?void 0:[...e].sort((e,t)=>(t.updated_at??``).localeCompare(e.updated_at??``))[0]}let i=t.bestMatch;if(i){let t=i.destination.recipientAddress.toLowerCase(),r=i.destination.tokenSymbol.toLowerCase(),a=new Date(i.submittedAt).toISOString(),o=i.sourceAmountBaseUnits,s=n.filter(n=>{let s=n.created_at??``;if(s&&s<a)return!1;let c=e.destination;return!(Number(c.eip155_id)!==i.destination.chainId||(c.asset_symbol??``).toLowerCase()!==r||(c.address??``).toLowerCase()!==t||o!==void 0&&n.from?.raw_amount!==o)});return s.length===0?void 0:[...s].sort((e,t)=>(t.updated_at??``).localeCompare(e.updated_at??``))[0]}let a=t.sinceIso??``,o=n.filter(e=>(e.created_at??``)>=a);if(o.length!==0)return[...o].sort((e,t)=>(t.updated_at??``).localeCompare(e.updated_at??``))[0]}export{e as pickRelevantSettlement};
@@ -0,0 +1 @@
1
+ const e=new Set([11155111,5,80001,80002,84532,421614,11155420,97]);export{e as KNOWN_TESTNET_EIP155_IDS};
@@ -0,0 +1,92 @@
1
+ import { WithdrawSubmitCallback } from "../orchestrator/types.js";
2
+ import { ReactNode } from "react";
3
+ //#region src/flows/withdraw/bindings/WithdrawBindings.d.ts
4
+ /**
5
+ * Withdrawable balance the host surfaces to the withdraw form. Two accepted forms:
6
+ *
7
+ * - `number` — bare amount in display units (kit infers symbol from the provider-level
8
+ * `asset.symbol`; USD value is derived for known stablecoins or hidden otherwise).
9
+ * - `{ amount, amountUsd? }` — explicit amount plus optional pre-computed USD value.
10
+ *
11
+ * `undefined` represents the loading state — the kit renders a skeleton / em-dashes instead
12
+ * of a value.
13
+ */
14
+ type WithdrawBalanceInput = number | {
15
+ amount: number;
16
+ amountUsd?: number;
17
+ };
18
+ /**
19
+ * Trusted-recipient prefill chip surfaced next to the recipient address input. The kit no
20
+ * longer auto-derives a chip from `wagmi.address` — that misled users on embedded-wallet
21
+ * integrations, where `wagmi.address` is the integration's generated wallet rather than the
22
+ * user's primary self-custodial wallet. Hosts that have a verified, user-trusted address (a
23
+ * saved wallet on the user's profile, a KYC-bound payout destination, a whitelisted withdrawal
24
+ * address) pass it via {@link useWithdrawBindings} (or the `<WithdrawDialog>` prop of the same
25
+ * name); the chip's `aria-label` reads off `label` so the affordance is unambiguous about which
26
+ * address the user is filling with.
27
+ */
28
+ interface WithdrawSuggestedRecipient {
29
+ /** Address that fills the recipient input when the chip is clicked. */
30
+ address: string;
31
+ /**
32
+ * Short human label for the chip — used as the accessible name (`aria-label`) so screen
33
+ * readers and click targets describe the saved address concretely (e.g. `"Saved wallet"`,
34
+ * `"Your verified address"`). When omitted, the chip falls back to a generic kit-default.
35
+ */
36
+ label?: string;
37
+ /**
38
+ * Receive-side chain id this address belongs to (EIP-155 numeric). When set, the chip is
39
+ * surfaced only while the form's selected receive chain matches — prevents the user from
40
+ * one-click-filling an Ethereum address while routing to BSC, etc. When omitted, the chip
41
+ * is surfaced unconditionally and address-chain compatibility is the integrator's concern.
42
+ */
43
+ chainId?: number;
44
+ }
45
+ /**
46
+ * Render-time inputs the host supplies to the withdraw flow. Whoever renders the withdraw UI —
47
+ * the kit's `<WithdrawDialog>` or a fully custom headless surface — publishes these via
48
+ * {@link useWithdrawBindings}. Form widgets read the display values reactively; the orchestrator's
49
+ * submit action reads `onSubmit` at submit time to fire the host's callback.
50
+ */
51
+ interface WithdrawBindings {
52
+ /** Host-supplied source-side balance the form renders. */
53
+ balance?: WithdrawBalanceInput;
54
+ /**
55
+ * Host-supplied submit handler. Fired when the user submits the form (after the kit has
56
+ * prepared a fresh UDA target). The host calls the supplied actions to advance the FSM at
57
+ * the points its backend reaches the matching state.
58
+ */
59
+ onSubmit?: WithdrawSubmitCallback;
60
+ /**
61
+ * Trusted recipient address surfaced as a prefill chip on the recipient field. See
62
+ * {@link WithdrawSuggestedRecipient}.
63
+ */
64
+ suggestedRecipient?: WithdrawSuggestedRecipient;
65
+ }
66
+ /**
67
+ * Publish the host's render-time withdraw inputs (`balance`, `onSubmit`, `suggestedRecipient`)
68
+ * into the kit's withdraw scope. Call it once from whatever component renders the withdraw UI:
69
+ *
70
+ * - The kit's `<WithdrawDialog>` calls it internally with its render-time props.
71
+ * - A **headless** host that renders fully custom withdraw UI from `useWithdraw()` /
72
+ * `useWithdrawState()` / `useWithdrawSnapshot()` calls it directly — it's the supported way
73
+ * to wire `onSubmit` (and the optional display inputs) without mounting the dialog.
74
+ *
75
+ * Writes synchronously to the bridge ref during render so the controller's submit action always
76
+ * reads the latest `onSubmit`; a deferred `setState` updates the reactive state read by display
77
+ * widgets. Clears the bridge on unmount.
78
+ *
79
+ * @example Headless usage
80
+ * ```tsx
81
+ * useWithdrawBindings({
82
+ * balance: walletBalance,
83
+ * onSubmit: async (input, actions) => {
84
+ * const txHash = await backend.broadcastWithdrawal(input.depositTarget);
85
+ * actions.beginProcessing({ hash: txHash });
86
+ * },
87
+ * });
88
+ * ```
89
+ */
90
+ declare function useWithdrawBindings(bindings: WithdrawBindings): void;
91
+ //#endregion
92
+ export { WithdrawBalanceInput, WithdrawBindings, WithdrawSuggestedRecipient, useWithdrawBindings };
@@ -0,0 +1 @@
1
+ "use client";import{createContext as e,use as t,useEffect as n,useMemo as r,useRef as i,useState as a}from"react";import{jsx as o}from"react/jsx-runtime";const s=e(null);s.displayName=`WithdrawBindingsContext`;function c({children:e}){let[t,n]=a({}),c=i({});return o(s,{value:r(()=>({bindings:t,setBindings:n,ref:c}),[t]),children:e})}function l(){return t(s)?.bindings??{}}function u(){let e=t(s),n=i({});return e?.ref??n}function d(e){let r=t(s),a=e.balance,o=e.onSubmit,c=e.suggestedRecipient;r&&(r.ref.current={...a===void 0?{}:{balance:a},...o?{onSubmit:o}:{},...c?{suggestedRecipient:c}:{}});let l=i(r?.setBindings);l.current=r?.setBindings;let u=i(r?.ref);u.current=r?.ref,n(()=>{let e=l.current;if(e)return e({...a===void 0?{}:{balance:a},...o?{onSubmit:o}:{},...c?{suggestedRecipient:c}:{}}),()=>{let e=l.current,t=u.current;t&&(t.current={}),e&&e({})}},[a,o,c])}export{c as WithdrawBindingsProvider,d as useWithdrawBindings,u as useWithdrawBindingsRef,l as useWithdrawBindingsValue};
@@ -0,0 +1 @@
1
+ import { WithdrawBalanceInput, WithdrawBindings, WithdrawSuggestedRecipient, useWithdrawBindings } from "./WithdrawBindings.js";
@@ -0,0 +1 @@
1
+ import"./WithdrawBindings.js";
@@ -1,102 +1,66 @@
1
- import { TxRef } from "../../../shared/driver/types.js";
2
- import { WithdrawalQuotePayload, WithdrawalSettlementFailurePayload, WithdrawalSettlementPendingPayload, WithdrawalSettlementSuccessPayload } from "../driver/payloads.js";
3
- import { SubmitWithdrawalInput } from "../driver/types.js";
4
- import { FailureInfo } from "../../../shared/orchestrator/types.js";
5
- import { WithdrawStateName } from "../orchestrator/types.js";
6
- import { WithdrawFormEventCallbacks } from "./WithdrawDialogEventsContext.js";
1
+ import { WithdrawSubmitCallback } from "../orchestrator/types.js";
2
+ import { WithdrawBalanceInput, WithdrawSuggestedRecipient } from "../bindings/WithdrawBindings.js";
7
3
  import { ErrorInfo } from "react";
8
4
  import * as _$react_jsx_runtime0 from "react/jsx-runtime";
9
5
 
10
6
  //#region src/flows/withdraw/dialog/WithdrawDialog.d.ts
11
7
  /**
12
- * Top-level withdraw dialog. Mounts inside `<KitProvider withdraw={…} />` once at the host's
13
- * app root and binds open state to the controller's `state.name !== "closed"`.
8
+ * Top-level withdraw dialog. Mounts inside `<StridgeProvider>` and binds open state to the
9
+ * controller's `state.name !== "closed"`.
14
10
  *
15
11
  * Body switch is keyed off the orchestrator's *effective* state (not logical state) so the
16
12
  * widget the user was looking at stays mounted through the dialog's close animation.
17
13
  *
18
- * Three top-level callbacks (`onOpened`, `onClosed`, `onStepChanged`) describe the dialog as a
19
- * stateful component. The grouped `events={{ }}` prop carries the operational lifecycle —
20
- * form-level inputs, quote / submit / settlement transitions for the active withdrawal.
14
+ * Lifecycle observability is delivered by the unified event bus exported from
15
+ * `@stridge/kit/events`. The dialog takes no `on*` callback props; subscribe via
16
+ * `useStridgeFlowEvents` / `useStridgeEvents` for analytics or behavioural reactions.
17
+ * `onSubmit` is the host contract — its return value drives the FSM, distinct from any bus
18
+ * event.
21
19
  */
22
20
  declare function WithdrawDialog({
23
21
  container,
22
+ metadata,
24
23
  onError,
25
- onOpened,
26
- onClosed,
27
- onStepChanged,
28
- events
24
+ balance,
25
+ onSubmit,
26
+ suggestedRecipient
29
27
  }?: WithdrawDialog.Props): _$react_jsx_runtime0.JSX.Element;
30
28
  declare namespace WithdrawDialog {
31
29
  interface Props {
32
30
  /**
33
31
  * Element the dialog portals into. Defaults to `document.body` (full-page overlay).
34
- * Pass a transformed ancestor with `overflow: clip` — e.g. a mobile mockup frame — to
35
- * scope the dialog's width, height, and backdrop to that rect.
36
32
  */
37
33
  container?: HTMLElement | null;
34
+ /**
35
+ * Consumer-attached metadata that rides along on every bus event emitted from this
36
+ * dialog's session. Snapshotted at `withdraw.opened` and frozen for the session.
37
+ */
38
+ metadata?: Record<string, unknown>;
38
39
  /** Forwarded to the dialog's internal {@link GatewayKitBoundary} for crash reporting. */
39
40
  onError?: (error: Error, errorInfo: ErrorInfo) => void;
40
41
  /**
41
- * Fires once when the dialog transitions from `closed` to any open step. The withdraw
42
- * flow has no `open({ method })` overload `onOpened` carries no payload.
42
+ * Withdrawable balance to display in the form. Either a bare amount in display units
43
+ * (kit short-circuits USD to $1 for known stablecoins) or `{ amount, amountUsd? }`
44
+ * with an explicit pre-computed USD value. Pass `undefined` while loading; the form
45
+ * renders a skeleton until a value arrives.
43
46
  */
44
- onOpened?: () => void;
45
- /** Fires once when the dialog transitions back to `closed`. `atStep` is the last open step. */
46
- onClosed?: (atStep: WithdrawStateName) => void;
47
- /** Fires on every logical step transition. */
48
- onStepChanged?: (event: {
49
- from: WithdrawStateName;
50
- to: WithdrawStateName;
51
- }) => void;
47
+ balance?: WithdrawBalanceInput;
52
48
  /**
53
- * Operational eventsuser actions, quote / submit / settlement transitions for the
54
- * active withdrawal. Each callback is optional and fires after the controller has acted
55
- * (state machine has transitioned, driver entity has settled), so payloads are guaranteed
56
- * valid for the named event.
49
+ * Submit handlerfires once the kit has prepared a fresh UDA target for the
50
+ * withdrawal. The host's backend is responsible for broadcasting a transfer of the
51
+ * brand currency to that UDA; the kit hands a `WithdrawSubmitActions` handle the host
52
+ * calls (`beginProcessing` / `setTxHash` / `succeed` / `fail` / `decline`) to advance
53
+ * the FSM. Required when the dialog is used — a missing callback lands the user on
54
+ * the error screen instead of an infinite spinner. This is a contract, not a bus
55
+ * event: return value drives the FSM.
57
56
  */
58
- events?: Events;
59
- }
60
- /**
61
- * Operational lifecycle hooks. Splits cleanly into:
62
- *
63
- * - **Form-level inputs** (`onRecipientChanged` / `onAmountChanged` / `onReceiveTokenChanged`
64
- * / `onReceiveChainChanged`) — fire on every change of the form's local state.
65
- * - **User actions** (`onWithdrawalConfirmed`) — fire when the user submits the form.
66
- * - **Quote lifecycle** — track the form's quote entity through `loading → ready / error`.
67
- * - **Submit lifecycle** — track the wagmi-driven broadcast through wagmi → receipt → terminal
68
- * verdict.
69
- * - **Settlement entity** — track the gateway's settlement payload through pending / succeeded /
70
- * failed.
71
- */
72
- interface Events extends WithdrawFormEventCallbacks {
73
- /** User submitted the form (the SUBMIT action — wallet prompt is about to fire). */
74
- onWithdrawalConfirmed?: () => void;
75
- /** Quote entity reached `ready` with the formatted payload. */
76
- onQuoteResolved?: (quote: WithdrawalQuotePayload) => void;
77
- /** Quote entity reached `error`. */
78
- onQuoteFailed?: (failure: {
79
- reason: string;
80
- code?: string;
81
- }) => void;
82
- /** Wagmi broadcast completed and the orchestrator transitioned into `inProgress`. */
83
- onWithdrawalSubmitted?: (event: {
84
- input: SubmitWithdrawalInput;
85
- tx: TxRef;
86
- }) => void;
87
- /** User declined the wallet signature prompt; orchestrator transitioned into `error`. */
88
- onSignatureDeclined?: () => void;
89
- /** Submission failed for a non-rejection reason (network, bad input, etc). */
90
- onSubmissionFailed?: (failure: FailureInfo) => void;
91
- /** The driver's `settlement` entity emitted a progressive pending update. */
92
- onProcessingProgress?: (update: WithdrawalSettlementPendingPayload) => void;
93
- /** Terminal success — settlement entity reached `ready{kind: "succeeded"}`. */
94
- onSucceeded?: (result: WithdrawalSettlementSuccessPayload) => void;
57
+ onSubmit?: WithdrawSubmitCallback;
95
58
  /**
96
- * Terminal failure either a settlement-driven failure (driver-emitted classification) or
97
- * an FSM-derived failure (submission rejection escalated to the global error arm).
59
+ * Trusted recipient address surfaced as a one-click prefill chip next to the
60
+ * recipient input. The kit no longer auto-derives this from `wagmi.address`. Pass an
61
+ * explicit address you trust the user wants to fill with. Omit to hide the chip.
98
62
  */
99
- onFailed?: (failure: WithdrawalSettlementFailurePayload | FailureInfo) => void;
63
+ suggestedRecipient?: WithdrawSuggestedRecipient;
100
64
  }
101
65
  }
102
66
  //#endregion
@@ -1 +1 @@
1
- "use client";import{useDialogLifecycle as e}from"../../../shared/orchestrator/useDialogLifecycle.js";import"../../../shared/orchestrator/index.js";import{useWithdrawSnapshot as t}from"../driver/context.js";import{useWithdrawEffectiveState as n,useWithdrawState as r}from"../orchestrator/controller.js";import{useWithdraw as i}from"../orchestrator/useWithdraw.js";import"../orchestrator/index.js";import{Dialog as a}from"../../../shared/ui/Dialog/Dialog.js";import"../../../shared/ui/Dialog/index.js";import{StepTransition as o}from"../../../shared/dialog/StepTransition.js";import{GatewayKitBoundary as s}from"../../../shared/error-handling/components/GatewayKitBoundary.js";import"../../../shared/error-handling/index.js";import{WithdrawError as c}from"../widgets/withdraw-error/WithdrawError.js";import{WithdrawDialogEventsProvider as l}from"./WithdrawDialogEventsContext.js";import{WithdrawForm as u}from"../widgets/withdraw-form/WithdrawForm.js";import{WithdrawInProgress as d}from"../widgets/withdraw-in-progress/WithdrawInProgress.js";import{WithdrawSuccess as f}from"../widgets/withdraw-success/WithdrawSuccess.js";import"../../../_internal/withdraw/widgets/index.js";import{useRef as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";function g({container:e,onError:p,onOpened:g,onClosed:v,onStepChanged:y,events:b}={}){let x=r(),S=n(),{close:C}=i(),w=t(),T=x.name!==`closed`;_(x,w.settlement,w.quote,{onOpened:g,onClosed:v,onStepChanged:y,events:b});let E=S.name===`submitting`?`form`:S.name;return m(a,{open:T,onOpenChange:e=>e?void 0:C(),children:m(a.Content,{container:e,children:m(s,{onError:p,onReset:C,children:m(l,{events:b??{},children:h(o,{stateKey:E,children:[S.name===`form`||S.name===`submitting`?m(u,{}):null,S.name===`inProgress`?m(d,{}):null,S.name===`success`?m(f,{}):null,S.name===`error`?m(c,{}):null]})})})})})}function _(t,n,r,i){let a=p(i);a.current=i,e({state:t,settlement:n,quote:r,fireFsm:(e,t)=>v(e,t,a.current),fireSettlement:(e,t)=>y(t,a.current),fireQuote:(e,t)=>{if(t.status===e)return;let n=a.current.events;t.status===`ready`&&n?.onQuoteResolved?.(t.payload),t.status===`error`&&n?.onQuoteFailed?.({reason:t.error.message||`Quote failed.`,...t.error.name?{code:t.error.name}:{}})}})}function v(e,t,n){let{onOpened:r,onClosed:i,onStepChanged:a,events:o}=n,s=e.name===`form`&&!!e.ctx?.notice;if(t.name===`form`&&t.ctx?.notice&&!s&&o?.onSignatureDeclined?.(),e.name!==t.name&&(e.name===`closed`&&t.name!==`closed`&&r?.(),e.name!==`closed`&&t.name===`closed`&&i?.(e.name),a?.({from:e.name,to:t.name}),e.name===`form`&&t.name===`submitting`&&o?.onWithdrawalConfirmed?.(),e.name===`submitting`&&t.name===`inProgress`&&o?.onWithdrawalSubmitted?.({input:t.ctx.input,tx:t.ctx.tx}),t.name===`error`)){let e=t.ctx.failure;e!==void 0&&t.ctx.tx===void 0&&e&&(o?.onSubmissionFailed?.(e),o?.onFailed?.(e))}}function y(e,t){if(e.status!==`ready`&&e.status!==`stale`)return;let n=e.payload,r=t.events;if(r){if(n.kind===`pending`){r.onProcessingProgress?.(n);return}if(n.kind===`succeeded`){r.onSucceeded?.(n);return}n.kind===`failed`&&r.onFailed?.(n)}}export{g as WithdrawDialog};
1
+ "use client";import{useWithdrawBindings as e}from"../bindings/WithdrawBindings.js";import"../bindings/index.js";import{useWithdrawSnapshot as t}from"../driver/context.js";import{useWithdrawEffectiveState as n,useWithdrawState as r}from"../orchestrator/controller.js";import{useWithdraw as i}from"../orchestrator/useWithdraw.js";import"../orchestrator/index.js";import{useWithdrawEmissions as a}from"../../../events/emit/useWithdrawEmissions.js";import"../../../events/emit/index.js";import{useIntercomShutdownOnUnmount as o}from"../../../shared/support/useIntercomShutdownOnUnmount.js";import"../../../shared/support/index.js";import{Dialog as s}from"../../../shared/ui/Dialog/Dialog.js";import"../../../shared/ui/Dialog/index.js";import{LoadingState as c}from"../../../shared/dialog/LoadingState.js";import{StepTransition as l}from"../../../shared/dialog/StepTransition.js";import{GatewayKitBoundary as u}from"../../../shared/error-handling/components/GatewayKitBoundary.js";import"../../../shared/error-handling/index.js";import{WithdrawError as d}from"../widgets/withdraw-error/WithdrawError.js";import{WithdrawForm as f}from"../widgets/withdraw-form/WithdrawForm.js";import{WithdrawInProgress as p}from"../widgets/withdraw-in-progress/WithdrawInProgress.js";import{WithdrawSuccess as m}from"../widgets/withdraw-success/WithdrawSuccess.js";import"../../../_internal/withdraw/widgets/index.js";import{jsx as h,jsxs as g}from"react/jsx-runtime";function _({container:_,metadata:v,onError:y,balance:b,onSubmit:x,suggestedRecipient:S}={}){let C=r(),w=n(),{close:T}=i(),E=t(),D=C.name!==`closed`;a({state:C,settlement:E.settlement,quote:E.quote,metadata:v}),o(),e({...b===void 0?{}:{balance:b},...x?{onSubmit:x}:{},...S?{suggestedRecipient:S}:{}});let O=w.name===`submitting`?`form`:w.name,k=(w.name===`form`||w.name===`submitting`)&&(E.receiveOptions.status===`loading`||E.receiveOptions.status===`idle`);return h(s,{open:D,onOpenChange:e=>e?void 0:T(),children:h(s.Content,{container:_,children:h(u,{onError:y,onReset:T,children:k?h(c,{slot:`withdraw`}):g(l,{stateKey:O,children:[w.name===`form`||w.name===`submitting`?h(f,{}):null,w.name===`inProgress`?h(p,{}):null,w.name===`success`?h(m,{}):null,w.name===`error`?h(d,{}):null]})})})})}export{_ as WithdrawDialog};
@@ -1,5 +1,7 @@
1
1
  import { SettlementFailureKind } from "../../../shared/driver/types.js";
2
2
  import { FormattedField } from "../../../shared/format/types.js";
3
+ import { ChainType } from "../../../shared/chains/index.js";
4
+
3
5
  //#region src/flows/withdraw/driver/payloads.d.ts
4
6
  /**
5
7
  * Per-asset balance available to withdraw — the brand-managed source the cash-out flow draws
@@ -108,6 +110,12 @@ interface WithdrawalSettlementPendingPayload {
108
110
  kind: "pending";
109
111
  receiveAsset: WithdrawalReceiveAssetPayload;
110
112
  receiveAmount: FormattedField<number>;
113
+ /**
114
+ * USD value of `receiveAmount` at the settlement leg's price snapshot. Sourced from the
115
+ * gateway leg's `amount_usd` (`to` preferred, `from` fallback). Omitted when neither leg
116
+ * carries a priced amount — the in-progress hero then falls back to the quote's USD figure.
117
+ */
118
+ receiveAmountUsd?: FormattedField<number>;
111
119
  /** Recipient address — the destination the user supplied on the form. */
112
120
  recipient: FormattedField<string>;
113
121
  /** Unix-ms timestamp when the withdrawal was submitted. */
@@ -191,8 +199,15 @@ interface ReceiveChainPayload {
191
199
  networkId: string;
192
200
  /** Human-readable network name (e.g. `"Polygon"`). */
193
201
  networkName: string;
194
- /** EIP-155 chain id (numeric). */
202
+ /** EIP-155 chain id (numeric). Only meaningful when `chainType === "evm"`. */
195
203
  eip155Id: number;
204
+ /**
205
+ * Chain family this network belongs to — driver-populated from the gateway's `chain_type`
206
+ * tag. The withdraw form drives recipient-address validation off this so a non-EVM receive
207
+ * chain accepts its own address shape instead of the EVM `0x…` form. Drivers that can't
208
+ * determine the family tag it `"unknown"`, which keeps the address gate permissive.
209
+ */
210
+ chainType: ChainType;
196
211
  /** Resolved chain icon URL — derived from the chain's native_currency.logo. */
197
212
  chainLogoUrl?: string;
198
213
  /**
@@ -1 +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{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=e.to,l=i(r?.confirmed_at)??i(e.created_at)??Date.now(),u=p(t,n),d=m(a,t.destination.asset_decimals)||m(r,r?.asset_decimals??t.destination.asset_decimals),f=t.destination.address,g=r?.tx_id,_=r?.eip155_id===void 0?void 0:Number(r.eip155_id);return{kind:`pending`,receiveAsset:u,receiveAmount:{value:d,formatted:s(d,n.i18n,{maxDecimals:t.destination.asset_decimals})},recipient:{value:f,formatted:c(f)},submittedAt:{value:l,formatted:o(l,n.i18n)},...g?{txHash:{value:g,formatted:c(g)},...h(n,_,g)?{txExplorerUrl:h(n,_,g)}:{}}:{}}}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),_=Math.round(f/1e3),v=p(t,n),y=m(l,t.destination.asset_decimals),b=t.destination.address,x=r?.tx_id??``,S=r?.eip155_id===void 0?void 0:Number(r.eip155_id),C=l?.tx_id,w=h(n,g(l?.eip155_id)??g(t.destination.eip155_id),C);return{kind:`succeeded`,receiveAsset:v,receiveAmount:{value:y,formatted:s(y,n.i18n,{maxDecimals:t.destination.asset_decimals})},recipient:{value:b,formatted:c(b)},submittedAt:{value:u,formatted:o(u,n.i18n)},filledAt:{value:d,formatted:o(d,n.i18n)},totalTime:{value:_,formatted:a(f,n.i18n)},txHash:{value:x,formatted:x?c(x):``},...h(n,S,x)?{txExplorerUrl:h(n,S,x)}:{},...C?{completionTx:{hash:{value:C,formatted:c(C)},...w?{explorerUrl:w}:{}}}:{}}}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=p(n,r),f=n.destination.address,m=a?.tx_id,g=a?.eip155_id===void 0?void 0:Number(a.eip155_id);return{kind:`failed`,failureKind:e(t.error),receiveAsset:d,receiveAmount:{value:0,formatted:s(0,r.i18n)},recipient:{value:f,formatted:c(f)},submittedAt:{value:l,formatted:o(l,r.i18n)},failedAt:{value:u,formatted:o(u,r.i18n)},...m?{txHash:{value:m,formatted:c(m)},...h(r,g,m)?{txExplorerUrl:h(r,g,m)}:{}}:{}}}function p(e,t){let n=t.receiveAssetEnrichment,r=Number(e.destination.eip155_id);return{symbol:e.destination.asset_symbol,decimals:e.destination.asset_decimals,address:e.destination.asset_address,isNative:!e.destination.asset_address,...n?.assetLogoUrl?{assetLogoUrl:n.assetLogoUrl}:{},networkId:e.destination.network_id,networkName:n?.networkName??e.destination.network_name,...Number.isFinite(r)?{eip155Id:e.destination.eip155_id}:{},...n?.chainLogoUrl?{chainLogoUrl:n.chainLogoUrl}:{}}}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(!n||t===void 0)return;let r=e.explorers?.[t];if(r)return`${r.replace(/\/+$/,``)}/tx/${n}`}function g(e){if(e==null||e===``)return;let t=Number(e);return Number.isFinite(t)?t:void 0}export{l as settlementToWithdrawalPayload};
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{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{formatUsd as c}from"../../../../shared/format/formatUsd.js";import{shortenAddress as l}from"../../../../shared/format/shortenAddress.js";function u(e,n,r){let i=t(e.status);return i===`completed`?f(e,n,r):i===`failed`?p(e,n,r):d(e,n,r)}function d(e,t,r){let a=e.from,u=e.to,d=i(a?.confirmed_at)??i(e.created_at)??Date.now(),f=m(t,r),p=g(u,t,r),v=h(u,p),y=n(u?.amount_usd)||n(a?.amount_usd),b=t.destination.address,x=a?.tx_id,S=a?.eip155_id===void 0?void 0:Number(a.eip155_id);return{kind:`pending`,receiveAsset:f,receiveAmount:{value:v,formatted:s(v,r.i18n,{maxDecimals:p})},...y>0?{receiveAmountUsd:{value:y,formatted:c(y,r.i18n)}}:{},recipient:{value:b,formatted:l(b)},submittedAt:{value:d,formatted:o(d,r.i18n)},...x?{txHash:{value:x,formatted:l(x)},..._(r,S,x)?{txExplorerUrl:_(r,S,x)}:{}}:{}}}function f(e,t,n){let r=e.from,c=e.to,u=i(r?.confirmed_at)??i(e.created_at)??Date.now(),d=i(c?.settled_at)??i(e.updated_at)??Date.now(),f=Math.max(0,d-u),p=Math.round(f/1e3),y=m(t,n),b=g(c,t,n),x=h(c,b),S=t.destination.address,C=r?.tx_id??``,w=r?.eip155_id===void 0?void 0:Number(r.eip155_id),T=c?.tx_id,E=_(n,v(c?.eip155_id)??v(t.destination.eip155_id),T);return{kind:`succeeded`,receiveAsset:y,receiveAmount:{value:x,formatted:s(x,n.i18n,{maxDecimals:b})},recipient:{value:S,formatted:l(S)},submittedAt:{value:u,formatted:o(u,n.i18n)},filledAt:{value:d,formatted:o(d,n.i18n)},totalTime:{value:p,formatted:a(f,n.i18n)},txHash:{value:C,formatted:C?l(C):``},..._(n,w,C)?{txExplorerUrl:_(n,w,C)}:{},...T?{completionTx:{hash:{value:T,formatted:l(T)},...E?{explorerUrl:E}:{}}}:{}}}function p(t,n,r){let a=t.from,c=i(a?.confirmed_at)??i(t.created_at)??Date.now(),u=i(t.updated_at)??Date.now(),d=m(n,r),f=n.destination.address,p=a?.tx_id,h=a?.eip155_id===void 0?void 0:Number(a.eip155_id);return{kind:`failed`,failureKind:e(t.error),receiveAsset:d,receiveAmount:{value:0,formatted:s(0,r.i18n)},recipient:{value:f,formatted:l(f)},submittedAt:{value:c,formatted:o(c,r.i18n)},failedAt:{value:u,formatted:o(u,r.i18n)},...p?{txHash:{value:p,formatted:l(p)},..._(r,h,p)?{txExplorerUrl:_(r,h,p)}:{}}:{}}}function m(e,t){let n=t.receiveAssetEnrichment,r=Number(e.destination.eip155_id);return{symbol:e.destination.asset_symbol,decimals:e.destination.asset_decimals,address:e.destination.asset_address,isNative:!e.destination.asset_address,...n?.assetLogoUrl?{assetLogoUrl:n.assetLogoUrl}:{},networkId:e.destination.network_id,networkName:n?.networkName??e.destination.network_name,...Number.isFinite(r)?{eip155Id:e.destination.eip155_id}:{},...n?.chainLogoUrl?{chainLogoUrl:n.chainLogoUrl}:{}}}function h(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 g(e,t,n){return n.receiveAssetDecimals??e?.asset_decimals??t.destination.asset_decimals}function _(e,t,n){if(!n||t===void 0)return;let r=e.explorers?.[t];if(r)return`${r.replace(/\/+$/,``)}/tx/${n}`}function v(e){if(e==null||e===``)return;let t=Number(e);return Number.isFinite(t)?t:void 0}export{u as settlementToWithdrawalPayload};
@@ -1 +1 @@
1
- import{formatNetworkName as e}from"../../../../shared/format/formatNetworkName.js";function t(t,n={}){let r=n.excludedChainIds,i=[];for(let n of t.assets){if(r?.has(n.eip155_id))continue;let t=n.native_currency,a=new Set,o=(e,t)=>`${e.toUpperCase()}@${t.toLowerCase()}`,s=[];if(t?.symbol){let e={symbol:t.symbol,name:t.name??t.symbol,address:``,decimals:typeof t.decimals==`number`?t.decimals:18,isNative:!0,...t.logo?{assetLogoUrl:t.logo}:{}};s.push(e),a.add(o(e.symbol,e.address))}let c=t?.symbol?.toUpperCase();for(let e of n.assets){if(!e.symbol||!e.address||c&&e.symbol.toUpperCase()===c)continue;let t=o(e.symbol,e.address);a.has(t)||(a.add(t),s.push({symbol:e.symbol,name:e.name??e.symbol,address:e.address,decimals:e.decimals,isNative:!1,...e.logo?{assetLogoUrl:e.logo}:{}}))}s.length!==0&&i.push({networkId:n.network_id,networkName:e(n.network_name),eip155Id:n.eip155_id,...t?.logo?{chainLogoUrl:t.logo}:{},tokens:s})}return i.sort((e,t)=>e.eip155Id-t.eip155Id),i}export{t as supportedAssetsToReceiveOptionsPayload};
1
+ import{toChainType as e}from"../../../../shared/chains/index.js";import{formatNetworkName as t}from"../../../../shared/format/formatNetworkName.js";function n(n,r={}){let i=r.excludedChainIds,a=[];for(let r of n.assets){if(i?.has(r.eip155_id))continue;let n=r.native_currency,o=new Set,s=(e,t)=>`${e.toUpperCase()}@${t.toLowerCase()}`,c=[];if(n?.symbol){let e={symbol:n.symbol,name:n.name??n.symbol,address:``,decimals:typeof n.decimals==`number`?n.decimals:18,isNative:!0,...n.logo?{assetLogoUrl:n.logo}:{}};c.push(e),o.add(s(e.symbol,e.address))}let l=n?.symbol?.toUpperCase();for(let e of r.assets){if(!e.symbol||!e.address||l&&e.symbol.toUpperCase()===l)continue;let t=s(e.symbol,e.address);o.has(t)||(o.add(t),c.push({symbol:e.symbol,name:e.name??e.symbol,address:e.address,decimals:e.decimals,isNative:!1,...e.logo?{assetLogoUrl:e.logo}:{}}))}c.length!==0&&a.push({networkId:r.network_id,networkName:t(r.network_name),eip155Id:r.eip155_id,chainType:e(r.chain_type),...n?.logo?{chainLogoUrl:n.logo}:{},tokens:c})}return a.sort((e,t)=>e.eip155Id-t.eip155Id),a}export{n as supportedAssetsToReceiveOptionsPayload};