@stridge/kit 0.1.0-alpha.5 → 0.1.0-alpha.51
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.
- package/README.md +22 -6
- package/dist/KitProvider.d.ts +29 -0
- package/dist/KitProvider.js +1 -1
- package/dist/_internal/drivers/stridge/index.d.ts +3 -2
- package/dist/_internal/drivers/stridge/index.js +1 -1
- package/dist/_internal/withdraw/driver/index.d.ts +2 -2
- package/dist/activity-history/compound/index.d.ts +9 -0
- package/dist/activity-history/compound/index.js +1 -0
- package/dist/deposit/compound/index.d.ts +4 -3
- package/dist/deposit/widgets/index.d.ts +13 -0
- package/dist/deposit/widgets/index.js +1 -0
- package/dist/drivers/stridge/catalog.d.ts +54 -0
- package/dist/drivers/stridge/catalog.js +1 -0
- package/dist/drivers/stridge/createStridgeDepositDriver.d.ts +10 -1
- package/dist/drivers/stridge/createStridgeDepositDriver.js +1 -1
- package/dist/drivers/stridge/createStridgeWithdrawDriver.d.ts +37 -14
- package/dist/drivers/stridge/createStridgeWithdrawDriver.js +1 -1
- package/dist/drivers/stridge/internal/ensureWalletChain.js +1 -0
- package/dist/drivers/stridge/internal/pollOnce.js +1 -1
- package/dist/drivers/stridge/internal/resolveAddEthereumChain.js +1 -0
- package/dist/drivers/stridge/internal/retry.js +1 -0
- package/dist/drivers/stridge/internal/supportedChains.js +1 -0
- package/dist/drivers/stridge/types.d.ts +20 -14
- package/dist/drivers/stridge/types.js +1 -1
- package/dist/drivers/stridge/wagmiSigner.js +1 -1
- package/dist/drivers/stridge-mock/createStridgeMockDriver.d.ts +4 -2
- package/dist/drivers/stridge-mock/createStridgeMockDriver.js +1 -1
- package/dist/drivers/stridge-mock/createStridgeMockWithdrawDriver.d.ts +17 -4
- package/dist/drivers/stridge-mock/createStridgeMockWithdrawDriver.js +1 -1
- package/dist/drivers/stridge-mock/fixtures.d.ts +14 -12
- package/dist/drivers/stridge-mock/fixtures.js +1 -1
- package/dist/events/bus/createBus.d.ts +7 -0
- package/dist/events/bus/createBus.js +1 -0
- package/dist/events/bus/flowIdRegistry.d.ts +17 -0
- package/dist/events/bus/flowIdRegistry.js +1 -0
- package/dist/events/bus/index.js +1 -0
- package/dist/events/bus/metadata.js +1 -0
- package/dist/events/context.js +1 -0
- package/dist/events/emit/index.js +1 -0
- package/dist/events/emit/mapFailure.js +1 -0
- package/dist/events/emit/useDepositEmissions.js +1 -0
- package/dist/events/emit/useKitEmitter.js +1 -0
- package/dist/events/emit/useWithdrawEmissions.js +1 -0
- package/dist/events/hooks/index.d.ts +6 -0
- package/dist/events/hooks/index.js +1 -0
- package/dist/events/hooks/useCurrentFlowId.d.ts +6 -0
- package/dist/events/hooks/useCurrentFlowId.js +1 -0
- package/dist/events/hooks/useStableHandler.js +1 -0
- package/dist/events/hooks/useStridgeEvent.d.ts +8 -0
- package/dist/events/hooks/useStridgeEvent.js +1 -0
- package/dist/events/hooks/useStridgeEventBus.d.ts +33 -0
- package/dist/events/hooks/useStridgeEventBus.js +1 -0
- package/dist/events/hooks/useStridgeEvents.d.ts +6 -0
- package/dist/events/hooks/useStridgeEvents.js +1 -0
- package/dist/events/hooks/useStridgeFlowEvent.d.ts +8 -0
- package/dist/events/hooks/useStridgeFlowEvent.js +1 -0
- package/dist/events/hooks/useStridgeFlowEvents.d.ts +6 -0
- package/dist/events/hooks/useStridgeFlowEvents.js +1 -0
- package/dist/events/index.d.ts +14 -0
- package/dist/events/index.js +1 -0
- package/dist/events/publish.js +1 -0
- package/dist/events/types/deposit.d.ts +235 -0
- package/dist/events/types/envelope.d.ts +145 -0
- package/dist/events/types/index.d.ts +31 -0
- package/dist/events/types/kit.d.ts +23 -0
- package/dist/events/types/withdraw.d.ts +150 -0
- package/dist/flows/deposit/dialog/DepositDialog.d.ts +20 -82
- package/dist/flows/deposit/dialog/DepositDialog.js +1 -1
- package/dist/flows/deposit/dialog/WalletRequiredState.js +1 -0
- package/dist/flows/deposit/dialog/WalletRequiredState.styles.js +1 -0
- package/dist/flows/deposit/driver/payloads.d.ts +17 -4
- package/dist/flows/deposit/driver/transformers/balanceToBalancesPayload.d.ts +2 -0
- package/dist/flows/deposit/driver/transformers/balanceToBalancesPayload.js +1 -1
- package/dist/flows/deposit/driver/transformers/index.d.ts +1 -0
- package/dist/flows/deposit/driver/transformers/quoteToPayload.d.ts +2 -0
- package/dist/flows/deposit/driver/transformers/settlementToPayload.d.ts +25 -0
- package/dist/flows/deposit/driver/transformers/startToAddressesPayload.d.ts +2 -0
- package/dist/flows/deposit/driver/transformers/startToAddressesPayload.js +1 -1
- package/dist/flows/deposit/driver/transformers/startToBrandPayload.d.ts +1 -0
- package/dist/flows/deposit/driver/transformers/startToTargetPayload.d.ts +2 -0
- package/dist/flows/deposit/driver/transformers/startToTargetPayload.js +1 -1
- package/dist/flows/deposit/driver/transformers/walletAddressToWalletPayload.d.ts +1 -0
- package/dist/flows/deposit/driver/types.d.ts +64 -3
- package/dist/flows/deposit/orchestrator/controller.js +1 -1
- package/dist/flows/deposit/orchestrator/reducer.js +1 -1
- package/dist/flows/deposit/orchestrator/types.d.ts +103 -1
- package/dist/flows/deposit/orchestrator/useDeposit.d.ts +45 -1
- package/dist/flows/deposit/orchestrator/useDeposit.js +1 -1
- package/dist/flows/deposit/widgets/activity-history/DepositHistoryDetail.d.ts +40 -0
- package/dist/flows/deposit/widgets/activity-history/DepositHistoryDetail.js +1 -0
- package/dist/flows/deposit/widgets/activity-history/DepositHistoryList.d.ts +38 -0
- package/dist/flows/deposit/widgets/activity-history/DepositHistoryList.js +1 -0
- package/dist/flows/deposit/widgets/activity-history/index.d.ts +2 -0
- package/dist/flows/deposit/widgets/activity-history/index.js +1 -0
- package/dist/flows/deposit/widgets/activity-history/useDepositActivityHistorySource.js +1 -0
- package/dist/flows/deposit/widgets/amount-entry/AmountEntry.d.ts +32 -5
- package/dist/flows/deposit/widgets/amount-entry/AmountEntry.js +1 -1
- package/dist/flows/deposit/widgets/amount-entry/footerIntent.js +1 -0
- package/dist/flows/deposit/widgets/asset-picker/AssetPicker.d.ts +22 -4
- package/dist/flows/deposit/widgets/asset-picker/AssetPicker.js +1 -1
- package/dist/flows/deposit/widgets/confirm-deposit/ConfirmDeposit.d.ts +37 -4
- package/dist/flows/deposit/widgets/confirm-deposit/ConfirmDeposit.js +1 -1
- package/dist/flows/deposit/widgets/deposit/Deposit.d.ts +33 -4
- package/dist/flows/deposit/widgets/deposit/Deposit.js +1 -1
- package/dist/flows/deposit/widgets/deposit/compound/Deposit.d.ts +32 -0
- package/dist/flows/deposit/widgets/deposit/compound/Deposit.js +1 -1
- package/dist/flows/deposit/widgets/deposit/compound/Deposit.styles.js +1 -1
- package/dist/flows/deposit/widgets/deposit/compound/components/Boundary.d.ts +29 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Boundary.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Guards.d.ts +28 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Guards.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Header.d.ts +10 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Header.js +1 -1
- package/dist/flows/deposit/widgets/deposit/compound/components/Method.d.ts +6 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Method.js +1 -1
- package/dist/flows/deposit/widgets/deposit/compound/components/Steps.d.ts +24 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Steps.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/index.d.ts +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/types.d.ts +6 -3
- package/dist/flows/deposit/widgets/deposit-status-banner/DepositStatusBanner.d.ts +41 -1
- package/dist/flows/deposit/widgets/deposit-status-banner/DepositStatusBanner.js +1 -1
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/DepositStatusBanner.js +1 -1
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Hero.js +1 -1
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/PrimaryAction.js +1 -1
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/types.d.ts +5 -5
- package/dist/flows/deposit/widgets/error-state/ErrorState.d.ts +39 -4
- package/dist/flows/deposit/widgets/error-state/ErrorState.js +1 -1
- package/dist/flows/deposit/widgets/processing-state/ProcessingState.d.ts +30 -4
- package/dist/flows/deposit/widgets/processing-state/ProcessingState.js +1 -1
- package/dist/flows/deposit/widgets/success-state/SuccessState.d.ts +38 -4
- package/dist/flows/deposit/widgets/success-state/SuccessState.js +1 -1
- package/dist/flows/deposit/widgets/transfer-crypto/TransferCrypto.d.ts +34 -3
- package/dist/flows/deposit/widgets/transfer-crypto/TransferCrypto.js +1 -1
- package/dist/flows/deposit/widgets/transfer-crypto/compound/TransferCrypto.d.ts +1 -1
- package/dist/flows/deposit/widgets/transfer-crypto/compound/TransferCrypto.styles.js +1 -1
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Address.js +1 -1
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Disclosure.d.ts +5 -2
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Disclosure.js +1 -1
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Header.d.ts +5 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Header.js +1 -1
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/QrCode.d.ts +4 -10
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/QrCode.js +1 -1
- package/dist/flows/deposit/widgets/transfer-crypto/compound/types.d.ts +16 -2
- package/dist/flows/shared/transformers/computeQuoteAttrs.d.ts +1 -0
- package/dist/flows/shared/transformers/index.d.ts +1 -0
- package/dist/flows/shared/transformers/pickRelevantSettlement.d.ts +1 -0
- package/dist/flows/shared/transformers/pickRelevantSettlement.js +1 -1
- package/dist/flows/shared/transformers/testnets.js +1 -0
- package/dist/flows/withdraw/bindings/WithdrawBindings.d.ts +92 -0
- package/dist/flows/withdraw/bindings/WithdrawBindings.js +1 -0
- package/dist/flows/withdraw/bindings/index.d.ts +1 -0
- package/dist/flows/withdraw/bindings/index.js +1 -0
- package/dist/flows/withdraw/dialog/WithdrawDialog.d.ts +35 -71
- package/dist/flows/withdraw/dialog/WithdrawDialog.js +1 -1
- package/dist/flows/withdraw/driver/dto.d.ts +8 -7
- package/dist/flows/withdraw/driver/payloads.d.ts +16 -1
- package/dist/flows/withdraw/driver/transformers/settlementToWithdrawalPayload.js +1 -1
- package/dist/flows/withdraw/driver/transformers/supportedAssetsToReceiveOptionsPayload.js +1 -1
- package/dist/flows/withdraw/driver/types.d.ts +111 -14
- package/dist/flows/withdraw/orchestrator/controller.js +1 -1
- package/dist/flows/withdraw/orchestrator/index.d.ts +1 -1
- package/dist/flows/withdraw/orchestrator/reducer.js +1 -1
- package/dist/flows/withdraw/orchestrator/types.d.ts +201 -32
- package/dist/flows/withdraw/orchestrator/useWithdraw.d.ts +36 -1
- package/dist/flows/withdraw/orchestrator/useWithdraw.js +1 -1
- package/dist/flows/withdraw/widgets/activity-history/WithdrawHistoryDetail.d.ts +39 -0
- package/dist/flows/withdraw/widgets/activity-history/WithdrawHistoryDetail.js +1 -0
- package/dist/flows/withdraw/widgets/activity-history/WithdrawHistoryList.d.ts +36 -0
- package/dist/flows/withdraw/widgets/activity-history/WithdrawHistoryList.js +1 -0
- package/dist/flows/withdraw/widgets/activity-history/index.d.ts +2 -0
- package/dist/flows/withdraw/widgets/activity-history/index.js +1 -0
- package/dist/flows/withdraw/widgets/activity-history/useWithdrawActivityHistorySource.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/Withdraw.d.ts +60 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/Withdraw.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/Withdraw.slots.d.ts +13 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/Withdraw.slots.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/components/Boundary.d.ts +29 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/components/Boundary.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/components/Guards.d.ts +25 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/components/Guards.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/components/Steps.d.ts +27 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/components/Steps.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/index.d.ts +3 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/index.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-error/WithdrawError.d.ts +45 -2
- package/dist/flows/withdraw/widgets/withdraw-error/WithdrawError.js +1 -1
- package/dist/flows/withdraw/widgets/withdraw-form/WithdrawForm.d.ts +32 -12
- package/dist/flows/withdraw/widgets/withdraw-form/WithdrawForm.js +1 -1
- package/dist/flows/withdraw/widgets/withdraw-form/compound/WithdrawForm.js +1 -1
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Header.d.ts +6 -1
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Header.js +1 -1
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/RecipientField.d.ts +7 -5
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/RecipientField.js +1 -1
- package/dist/flows/withdraw/widgets/withdraw-form/compound/types.d.ts +15 -5
- package/dist/flows/withdraw/widgets/withdraw-form/validation.js +1 -1
- package/dist/flows/withdraw/widgets/withdraw-in-progress/WithdrawInProgress.d.ts +39 -3
- package/dist/flows/withdraw/widgets/withdraw-in-progress/WithdrawInProgress.js +1 -1
- package/dist/flows/withdraw/widgets/withdraw-success/WithdrawSuccess.d.ts +46 -2
- package/dist/flows/withdraw/widgets/withdraw-success/WithdrawSuccess.js +1 -1
- package/dist/i18n/index.d.ts +5 -4
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/locales/ar.js +1 -1
- package/dist/i18n/locales/es.js +1 -1
- package/dist/i18n/locales/source-keys.d.ts +12 -0
- package/dist/i18n/locales/source-keys.js +0 -0
- package/dist/icons/index.d.ts +3 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +22 -9
- package/dist/index.js +1 -1
- package/dist/package.js +1 -1
- package/dist/scope/KitPortalScope.js +1 -1
- package/dist/scope/KitScope.d.ts +18 -1
- package/dist/scope/KitScope.js +1 -1
- package/dist/scope/context.d.ts +17 -1
- package/dist/scope/index.d.ts +1 -1
- package/dist/shared/attribution/Attribution.js +1 -0
- package/dist/shared/attribution/Attribution.slots.js +1 -0
- package/dist/shared/attribution/Attribution.styles.js +1 -0
- package/dist/shared/attribution/index.js +1 -0
- package/dist/shared/chains/index.d.ts +48 -29
- package/dist/shared/chains/index.js +1 -1
- package/dist/shared/constants/brand-intercom.js +1 -0
- package/dist/shared/cuer/Cuer.js +1 -1
- package/dist/shared/dialog/Frame.js +1 -1
- package/dist/shared/dialog/LoadingState.js +1 -0
- package/dist/shared/dialog/LoadingState.styles.js +1 -0
- package/dist/shared/dialog/StepTransition.js +1 -1
- package/dist/shared/dialog/useDirectionalChevronTransform.js +1 -1
- package/dist/shared/driver/types.d.ts +4 -3
- package/dist/shared/i18n/KitI18nProvider.d.ts +11 -8
- package/dist/shared/i18n/KitI18nProvider.js +1 -1
- package/dist/shared/i18n/createKitI18n.d.ts +79 -16
- package/dist/shared/i18n/createKitI18n.js +1 -1
- package/dist/shared/i18n/useLingui.d.ts +11 -3
- package/dist/shared/icons/HistoryIcon.d.ts +12 -0
- package/dist/shared/icons/HistoryIcon.js +1 -0
- package/dist/shared/icons/LogoIcon.d.ts +13 -0
- package/dist/shared/icons/LogoIcon.js +1 -0
- package/dist/shared/merchant-link/MerchantLink.d.ts +1 -0
- package/dist/shared/merchant-link/MerchantLink.js +1 -0
- package/dist/shared/merchant-link/MerchantLinkButton.d.ts +1 -0
- package/dist/shared/merchant-link/MerchantLinkButton.js +1 -0
- package/dist/shared/merchant-link/index.d.ts +1 -0
- package/dist/shared/merchant-link/index.js +1 -0
- package/dist/shared/merchant-link/resolveMerchantLink.js +1 -0
- package/dist/shared/orchestrator/useSettlementWatcher.js +1 -1
- package/dist/shared/primitives/TxHashValue/TxHashValue.js +1 -1
- package/dist/shared/support/SupportConfigContext.d.ts +1 -0
- package/dist/shared/support/SupportConfigContext.js +1 -0
- package/dist/shared/support/SupportLink.d.ts +1 -0
- package/dist/shared/support/SupportLink.js +1 -0
- package/dist/shared/support/SupportSpinner.d.ts +1 -0
- package/dist/shared/support/SupportSpinner.js +1 -0
- package/dist/shared/support/index.d.ts +2 -0
- package/dist/shared/support/index.js +1 -0
- package/dist/shared/support/intercom-loader.d.ts +17 -0
- package/dist/shared/support/intercom-loader.js +1 -0
- package/dist/shared/support/types.d.ts +43 -0
- package/dist/shared/support/useIntercomMerchantContext.d.ts +27 -0
- package/dist/shared/support/useIntercomMerchantContext.js +1 -0
- package/dist/shared/support/useIntercomShutdownOnUnmount.js +1 -0
- package/dist/shared/support/useMerchantContext.d.ts +1 -0
- package/dist/shared/support/useMerchantContext.js +1 -0
- package/dist/shared/support/useSupportTrigger.js +1 -0
- package/dist/shared/terms/TermsConfigContext.d.ts +1 -0
- package/dist/shared/terms/TermsConfigContext.js +1 -0
- package/dist/shared/terms/TermsLink.d.ts +1 -0
- package/dist/shared/terms/TermsLink.js +1 -0
- package/dist/shared/terms/index.d.ts +1 -0
- package/dist/shared/terms/index.js +1 -0
- package/dist/shared/terms/types.d.ts +43 -0
- package/dist/shared/ui/Card/Card.styles.js +1 -1
- package/dist/shared/ui/Details/Details.d.ts +9 -1
- package/dist/shared/ui/Details/Details.styles.js +1 -1
- package/dist/shared/ui/Dialog/Dialog.js +1 -1
- package/dist/shared/ui/Dialog/Dialog.styles.js +1 -1
- package/dist/shared/ui/Select/Select.js +1 -1
- package/dist/shared/ui/SelectableTile/SelectableTile.d.ts +21 -8
- package/dist/shared/ui/SelectableTile/SelectableTile.js +1 -1
- package/dist/shared/ui/Steps/Steps.d.ts +52 -0
- package/dist/shared/ui/Steps/Steps.js +1 -0
- package/dist/shared/ui/Steps/Steps.slots.d.ts +7 -0
- package/dist/shared/ui/Steps/Steps.slots.js +1 -0
- package/dist/shared/ui/Steps/Steps.styles.js +1 -0
- package/dist/shared/ui/Steps/index.d.ts +2 -0
- package/dist/shared/ui/Steps/index.js +1 -0
- package/dist/shared/ui/WalletRow/WalletRow.d.ts +1 -1
- package/dist/shared/ui/WalletRow/WalletRow.js +1 -1
- package/dist/shared/utils/logos/types.d.ts +1 -1
- package/dist/shared/utils/useDeepMemo.js +1 -0
- package/dist/shared/wallet/ConnectWalletContext.d.ts +17 -0
- package/dist/shared/wallet/ConnectWalletContext.js +1 -0
- package/dist/shared/widgets/activity-history/ActivityTrigger.js +1 -0
- package/dist/shared/widgets/activity-history/ActivityTrigger.styles.js +1 -0
- package/dist/shared/widgets/activity-history/adapters/settlementToWidgetProps.js +1 -0
- package/dist/shared/widgets/activity-history/compound/ActivityHistory.d.ts +95 -0
- package/dist/shared/widgets/activity-history/compound/ActivityHistory.js +1 -0
- package/dist/shared/widgets/activity-history/compound/ActivityHistory.slots.d.ts +22 -0
- package/dist/shared/widgets/activity-history/compound/ActivityHistory.slots.js +1 -0
- package/dist/shared/widgets/activity-history/compound/ActivityHistory.styles.js +1 -0
- package/dist/shared/widgets/activity-history/compound/ActivityHistoryDetail.d.ts +75 -0
- package/dist/shared/widgets/activity-history/compound/ActivityHistoryDetail.js +1 -0
- package/dist/shared/widgets/activity-history/compound/Row.slots.d.ts +21 -0
- package/dist/shared/widgets/activity-history/compound/Row.slots.js +1 -0
- package/dist/shared/widgets/activity-history/compound/Row.styles.js +1 -0
- package/dist/shared/widgets/activity-history/compound/components/Empty.d.ts +15 -0
- package/dist/shared/widgets/activity-history/compound/components/Empty.js +1 -0
- package/dist/shared/widgets/activity-history/compound/components/ErrorView.d.ts +26 -0
- package/dist/shared/widgets/activity-history/compound/components/ErrorView.js +1 -0
- package/dist/shared/widgets/activity-history/compound/components/HistoryHeader.d.ts +39 -0
- package/dist/shared/widgets/activity-history/compound/components/HistoryHeader.js +1 -0
- package/dist/shared/widgets/activity-history/compound/components/List.d.ts +23 -0
- package/dist/shared/widgets/activity-history/compound/components/List.js +1 -0
- package/dist/shared/widgets/activity-history/compound/components/Row.d.ts +54 -0
- package/dist/shared/widgets/activity-history/compound/components/Row.js +1 -0
- package/dist/shared/widgets/activity-history/compound/components/StatusPip.js +1 -0
- package/dist/shared/widgets/activity-history/compound/context.d.ts +79 -0
- package/dist/shared/widgets/activity-history/compound/context.js +1 -0
- package/dist/shared/widgets/activity-history/index.js +1 -0
- package/dist/shared/widgets/activity-history/payloads.d.ts +81 -0
- package/dist/shared/widgets/activity-history/transformers/historyResponseToPayload.js +1 -0
- package/dist/shared/widgets/activity-history/transformers/resolveDirection.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/AmountEntry.d.ts +4 -1
- package/dist/shared/widgets/amount-entry/compound/AmountEntry.js +1 -1
- package/dist/shared/widgets/amount-entry/compound/AmountEntry.slots.d.ts +1 -0
- package/dist/shared/widgets/amount-entry/compound/AmountEntry.slots.js +1 -1
- package/dist/shared/widgets/amount-entry/compound/AmountEntry.styles.js +1 -1
- package/dist/shared/widgets/amount-entry/compound/components/Header.d.ts +6 -1
- package/dist/shared/widgets/amount-entry/compound/components/Header.js +1 -1
- package/dist/shared/widgets/amount-entry/compound/components/Hero/Hero.js +1 -1
- package/dist/shared/widgets/amount-entry/compound/components/Hero/SwapBackdrop.js +1 -1
- package/dist/shared/widgets/amount-entry/compound/components/Notice.d.ts +7 -0
- package/dist/shared/widgets/amount-entry/compound/components/Notice.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/types.d.ts +26 -1
- package/dist/shared/widgets/asset-picker/compound/AssetPicker.js +1 -1
- package/dist/shared/widgets/asset-picker/compound/AssetPicker.styles.js +1 -1
- package/dist/shared/widgets/asset-picker/compound/components/Asset.d.ts +7 -1
- package/dist/shared/widgets/asset-picker/compound/components/Asset.js +1 -1
- package/dist/shared/widgets/asset-picker/compound/components/Header.d.ts +6 -1
- package/dist/shared/widgets/asset-picker/compound/components/Header.js +1 -1
- package/dist/shared/widgets/asset-picker/compound/types.d.ts +14 -0
- package/dist/shared/widgets/confirm-transfer/compound/ConfirmTransfer.styles.js +1 -1
- package/dist/shared/widgets/confirm-transfer/compound/components/Disclaimer.d.ts +4 -3
- package/dist/shared/widgets/confirm-transfer/compound/components/Disclaimer.js +1 -1
- package/dist/shared/widgets/confirm-transfer/compound/components/QuoteTimer.js +1 -1
- package/dist/shared/widgets/error-state/compound/components/AssetValue.js +1 -1
- package/dist/shared/widgets/error-state/compound/components/HelpInfo.js +1 -1
- package/dist/shared/widgets/error-state/compound/components/MoreDetails.d.ts +1 -1
- package/dist/shared/widgets/error-state/compound/components/MoreDetails.js +1 -1
- package/dist/shared/widgets/error-state/compound/components/StatusValue.js +1 -1
- package/dist/shared/widgets/processing-state/compound/ProcessingState.d.ts +1 -5
- package/dist/shared/widgets/processing-state/compound/ProcessingState.js +1 -1
- package/dist/shared/widgets/processing-state/compound/ProcessingState.slots.d.ts +0 -1
- package/dist/shared/widgets/processing-state/compound/ProcessingState.slots.js +1 -1
- package/dist/shared/widgets/processing-state/compound/ProcessingState.styles.js +1 -1
- package/dist/shared/widgets/processing-state/compound/components/Details.d.ts +6 -1
- package/dist/shared/widgets/processing-state/compound/components/Details.js +1 -1
- package/dist/shared/widgets/processing-state/compound/components/Header.d.ts +4 -3
- package/dist/shared/widgets/processing-state/compound/components/Header.js +1 -1
- package/dist/shared/widgets/processing-state/compound/components/Hero.d.ts +14 -7
- package/dist/shared/widgets/processing-state/compound/components/Hero.js +1 -1
- package/dist/shared/widgets/processing-state/compound/components/Rows.js +1 -1
- package/dist/shared/widgets/processing-state/compound/components/StatusPill.js +1 -1
- package/dist/shared/widgets/processing-state/compound/components/splitAmount.js +1 -0
- package/dist/shared/widgets/processing-state/compound/index.d.ts +1 -1
- package/dist/shared/widgets/processing-state/compound/types.d.ts +11 -29
- package/dist/shared/widgets/success-state/compound/components/Actions.js +1 -1
- package/dist/shared/widgets/success-state/compound/components/AssetValue.js +1 -1
- package/dist/shared/widgets/success-state/compound/components/MoreDetails.d.ts +1 -1
- package/dist/shared/widgets/success-state/compound/components/MoreDetails.js +1 -1
- package/dist/shared/widgets/success-state/compound/components/RouteValue.js +1 -1
- package/dist/shared/widgets/success-state/compound/components/StatusPill.js +1 -1
- package/dist/shared/widgets/success-state/compound/types.d.ts +5 -5
- package/dist/stridge/StridgeProvider.d.ts +165 -35
- package/dist/stridge/StridgeProvider.js +1 -1
- package/dist/stridge/depositOwner.js +1 -0
- package/dist/stridge/optionalWagmi.js +1 -0
- package/dist/stridge/stubs.js +1 -1
- package/dist/styles/index.css +228 -10
- package/dist/types.d.ts +5 -4
- package/dist/ui/index.d.ts +3 -1
- package/dist/ui/index.js +1 -1
- package/dist/withdraw/compound/index.d.ts +5 -2
- package/dist/withdraw/compound/index.js +1 -1
- package/dist/withdraw/dialog/index.d.ts +3 -1
- package/dist/withdraw/widgets/index.d.ts +7 -0
- package/dist/withdraw/widgets/index.js +1 -0
- package/package.json +23 -7
- package/dist/_internal/deposit/widgets/index.d.ts +0 -11
- package/dist/_internal/deposit/widgets/index.js +0 -1
- package/dist/_internal/withdraw/widgets/index.d.ts +0 -5
- package/dist/_internal/withdraw/widgets/index.js +0 -1
- package/dist/flows/withdraw/dialog/WithdrawDialogEventsContext.d.ts +0 -36
- package/dist/flows/withdraw/dialog/WithdrawDialogEventsContext.js +0 -1
- package/dist/shared/widgets/processing-state/compound/components/Actions.d.ts +0 -17
- package/dist/shared/widgets/processing-state/compound/components/Actions.js +0 -1
- package/dist/stridge/StridgeContext.d.ts +0 -29
- package/dist/stridge/StridgeContext.js +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TxRef } from "../../../shared/driver/types.js";
|
|
2
2
|
import { FailureInfo } from "../../../shared/orchestrator/types.js";
|
|
3
|
-
|
|
3
|
+
import { WithdrawalQuotePayload } from "../driver/payloads.js";
|
|
4
|
+
import { WithdrawPreparation } from "../driver/types.js";
|
|
4
5
|
//#region src/flows/withdraw/orchestrator/types.d.ts
|
|
5
6
|
/**
|
|
6
7
|
* Form values captured at submit time. The orchestrator carries this snapshot through every
|
|
@@ -20,24 +21,45 @@ interface WithdrawalFormSnapshot {
|
|
|
20
21
|
receiveTokenSymbol: string;
|
|
21
22
|
/** Receive-side chain id (EIP-155 numeric). */
|
|
22
23
|
receiveChainId: number;
|
|
24
|
+
/**
|
|
25
|
+
* Pre-formatted USD figure the form displayed under the amount input at submit time. Carried
|
|
26
|
+
* through the FSM so the in-progress / success heroes can render the same dollar value the
|
|
27
|
+
* user just saw on the form, before the indexer prices the settlement legs. Optional because
|
|
28
|
+
* the form's USD computation already returns `undefined` for invalid amounts; the snapshot
|
|
29
|
+
* mirrors that. Pre-formatted (locale-aware) — the orchestrator does not re-format.
|
|
30
|
+
*/
|
|
31
|
+
amountUsd?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Where `BACK` lands when the user exits the activity surface. Encoded once at `OPEN_HISTORY`
|
|
35
|
+
* time so the back chevron can restore the source state lossless. The withdraw flow's only
|
|
36
|
+
* pre-submit step is `form`, so the discriminated union is single-variant today — keeping the
|
|
37
|
+
* `kind` slot lets the shape grow if the form ever splits into multiple steps (mirrors deposit
|
|
38
|
+
* for cross-flow symmetry).
|
|
39
|
+
*/
|
|
40
|
+
interface HistoryBackTarget {
|
|
41
|
+
kind: "form";
|
|
42
|
+
notice?: string;
|
|
23
43
|
}
|
|
24
44
|
/**
|
|
25
|
-
* State machine state for the orchestrated withdraw dialog. Per-state discriminated `ctx`
|
|
26
|
-
* what data is available
|
|
27
|
-
* unrepresentable.
|
|
45
|
+
* State machine state for the orchestrated withdraw dialog. Per-state discriminated `ctx`
|
|
46
|
+
* narrows what data is available.
|
|
28
47
|
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
48
|
+
* **Host-paced lifecycle** (different from the old wagmi-signed model): the kit stays in
|
|
49
|
+
* `submitting` until the host's `onSubmit` callback calls one of the controller's actions
|
|
50
|
+
* (`beginProcessing`, `fail`, `succeed`). `inProgress` accepts an optional `tx` — the host may
|
|
51
|
+
* move the user into processing before a broadcast tx hash exists; the kit polls
|
|
52
|
+
* `gateway/{owner}` and best-matches the relevant settlement (destination tuple + amount +
|
|
53
|
+
* submit-time window) until the host supplies a tx hash via `setTxHash`. `success` / `error`
|
|
54
|
+
* similarly accept optional `tx` since the host may declare a terminal verdict directly.
|
|
31
55
|
*/
|
|
32
56
|
type WithdrawState = {
|
|
33
57
|
name: "closed";
|
|
34
58
|
} | {
|
|
35
59
|
name: "form";
|
|
36
60
|
/**
|
|
37
|
-
* Optional notice rendered inline near the submit footer.
|
|
38
|
-
*
|
|
39
|
-
* recipient + amount + receive selection) with `notice = "Signature declined…"` so they
|
|
40
|
-
* can retry without losing context. Cleared on the next SUBMIT or CLOSE.
|
|
61
|
+
* Optional notice rendered inline near the submit footer. Cleared on the next SUBMIT
|
|
62
|
+
* or CLOSE.
|
|
41
63
|
*/
|
|
42
64
|
ctx?: {
|
|
43
65
|
notice?: string;
|
|
@@ -50,27 +72,52 @@ type WithdrawState = {
|
|
|
50
72
|
} | {
|
|
51
73
|
name: "inProgress";
|
|
52
74
|
ctx: {
|
|
53
|
-
input: WithdrawalFormSnapshot;
|
|
54
|
-
|
|
75
|
+
input: WithdrawalFormSnapshot; /** Unix-ms timestamp the host moved the FSM into processing (drives best-match windowing). */
|
|
76
|
+
submittedAt: number;
|
|
77
|
+
/**
|
|
78
|
+
* Source-chain broadcast hash, when the host has surfaced one via
|
|
79
|
+
* `actions.setTxHash`. Absent while the kit relies on the best-match heuristic.
|
|
80
|
+
*/
|
|
81
|
+
tx?: TxRef;
|
|
55
82
|
};
|
|
56
83
|
} | {
|
|
57
84
|
name: "success";
|
|
58
85
|
ctx: {
|
|
59
86
|
input: WithdrawalFormSnapshot;
|
|
60
|
-
tx
|
|
87
|
+
tx?: TxRef;
|
|
61
88
|
};
|
|
62
89
|
} | {
|
|
63
90
|
name: "error";
|
|
64
91
|
ctx: {
|
|
65
92
|
/**
|
|
66
93
|
* Form snapshot captured at submit time. Set when error follows a submit attempt;
|
|
67
|
-
* absent when the error path was reached without a known prior submit
|
|
68
|
-
* unreachable in V2 — kept optional so resume-style entries can re-use the slot).
|
|
94
|
+
* absent when the error path was reached without a known prior submit.
|
|
69
95
|
*/
|
|
70
|
-
input?: WithdrawalFormSnapshot; /** Optional non-settlement failure (quote / submission rejection). */
|
|
96
|
+
input?: WithdrawalFormSnapshot; /** Optional non-settlement failure (quote / submission rejection, host-supplied failure). */
|
|
71
97
|
failure?: FailureInfo; /** Source-chain broadcast tx hash when the error followed a successful broadcast. */
|
|
72
98
|
tx?: TxRef;
|
|
73
99
|
};
|
|
100
|
+
} | {
|
|
101
|
+
/**
|
|
102
|
+
* Activity history list — reachable from `form` via the header icon. `backTarget`
|
|
103
|
+
* snapshots the source state (including any inline notice) at `OPEN_HISTORY` time so
|
|
104
|
+
* the back chevron can restore it lossless.
|
|
105
|
+
*/
|
|
106
|
+
name: "historyList";
|
|
107
|
+
ctx: {
|
|
108
|
+
backTarget: HistoryBackTarget;
|
|
109
|
+
};
|
|
110
|
+
} | {
|
|
111
|
+
/**
|
|
112
|
+
* Activity history per-settlement detail — reached from `historyList` via
|
|
113
|
+
* `SELECT_SETTLEMENT`. Carries the selected row's id and the same `backTarget` so
|
|
114
|
+
* `BACK` collapses to `historyList` first, then to the original source step.
|
|
115
|
+
*/
|
|
116
|
+
name: "historyDetail";
|
|
117
|
+
ctx: {
|
|
118
|
+
settlementId: string;
|
|
119
|
+
backTarget: HistoryBackTarget;
|
|
120
|
+
};
|
|
74
121
|
};
|
|
75
122
|
/**
|
|
76
123
|
* Public state-name discriminator — useful for analytics and React-side gating without unwrapping
|
|
@@ -79,6 +126,16 @@ type WithdrawState = {
|
|
|
79
126
|
type WithdrawStateName = WithdrawState["name"];
|
|
80
127
|
/**
|
|
81
128
|
* Reducer event union. Strict discriminated; no stringly-typed transitions.
|
|
129
|
+
*
|
|
130
|
+
* The host-paced lifecycle splits the old `SUBMIT_CONFIRMED { tx }` event into three pieces so
|
|
131
|
+
* the host can move the user forward at whichever step their backend actually completes:
|
|
132
|
+
*
|
|
133
|
+
* - `BEGIN_PROCESSING { tx?, submittedAt }` — host accepted the request; move to inProgress with
|
|
134
|
+
* or without a tx hash.
|
|
135
|
+
* - `SET_TX_HASH { tx }` — host surfaced a broadcast hash later; upgrade best-match polling to
|
|
136
|
+
* tx-anchored.
|
|
137
|
+
* - `MARK_SUCCEEDED` / `MARK_FAILED { failure? }` — host short-circuits to a terminal verdict
|
|
138
|
+
* (e.g. their own settlement verification ran independently of Stridge's poll).
|
|
82
139
|
*/
|
|
83
140
|
type WithdrawEvent = {
|
|
84
141
|
type: "OPEN";
|
|
@@ -88,12 +145,22 @@ type WithdrawEvent = {
|
|
|
88
145
|
type: "SUBMIT";
|
|
89
146
|
input: WithdrawalFormSnapshot;
|
|
90
147
|
} | {
|
|
91
|
-
type: "
|
|
148
|
+
type: "BEGIN_PROCESSING";
|
|
149
|
+
submittedAt: number;
|
|
150
|
+
tx?: TxRef;
|
|
151
|
+
} | {
|
|
152
|
+
type: "SET_TX_HASH";
|
|
92
153
|
tx: TxRef;
|
|
154
|
+
submittedAt: number;
|
|
93
155
|
} | {
|
|
94
156
|
type: "SUBMIT_FAILED";
|
|
95
157
|
failure: FailureInfo;
|
|
96
158
|
input: WithdrawalFormSnapshot;
|
|
159
|
+
} | {
|
|
160
|
+
type: "MARK_SUCCEEDED";
|
|
161
|
+
} | {
|
|
162
|
+
type: "MARK_FAILED";
|
|
163
|
+
failure?: FailureInfo;
|
|
97
164
|
} | {
|
|
98
165
|
type: "SETTLEMENT_SUCCEEDED";
|
|
99
166
|
} | {
|
|
@@ -101,16 +168,29 @@ type WithdrawEvent = {
|
|
|
101
168
|
failure?: FailureInfo;
|
|
102
169
|
} | {
|
|
103
170
|
type: "RESET";
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Drops the inline notice on the `form` state. Dispatched by the form widget when the user
|
|
107
|
-
* starts editing again after a wallet-rejection landed them back on `form{notice}`. Mirror of
|
|
108
|
-
* deposit's `regenerating → ready` transition (where the notice clears as a side-effect of
|
|
109
|
-
* the next quote resolving) — withdraw's form has no FSM-driven phase to ride on, so the
|
|
110
|
-
* widget signals it explicitly.
|
|
111
|
-
*/
|
|
112
|
-
| {
|
|
171
|
+
} | {
|
|
113
172
|
type: "CLEAR_NOTICE";
|
|
173
|
+
} | {
|
|
174
|
+
/**
|
|
175
|
+
* User tapped the back chevron. Legal only from `historyList` / `historyDetail` today —
|
|
176
|
+
* the form step has no source to return to (closing the dialog is `CLOSE`). Two-step
|
|
177
|
+
* collapse: `historyDetail → historyList → source`.
|
|
178
|
+
*/
|
|
179
|
+
type: "BACK";
|
|
180
|
+
} | {
|
|
181
|
+
/**
|
|
182
|
+
* User tapped the header history icon. Legal from `form`; ignored elsewhere. Snapshots
|
|
183
|
+
* the source state into a {@link HistoryBackTarget} so the back chevron can restore it
|
|
184
|
+
* lossless (including any inline notice surfaced after a recent submit failure).
|
|
185
|
+
*/
|
|
186
|
+
type: "OPEN_HISTORY";
|
|
187
|
+
} | {
|
|
188
|
+
/**
|
|
189
|
+
* User tapped a row in the activity list. Legal only from `historyList`; transitions
|
|
190
|
+
* to `historyDetail` carrying the selected `settlementId`.
|
|
191
|
+
*/
|
|
192
|
+
type: "SELECT_SETTLEMENT";
|
|
193
|
+
settlementId: string;
|
|
114
194
|
};
|
|
115
195
|
/**
|
|
116
196
|
* Imperative controller returned by `useWithdraw()`. Mirrors {@link import("#/flows/deposit/orchestrator").DepositController}'s
|
|
@@ -134,9 +214,11 @@ interface WithdrawController {
|
|
|
134
214
|
*/
|
|
135
215
|
interface WithdrawActions {
|
|
136
216
|
/**
|
|
137
|
-
* Submits the withdrawal
|
|
138
|
-
*
|
|
139
|
-
* the
|
|
217
|
+
* Submits the withdrawal. Dispatches `SUBMIT` synchronously (so the form flips to the
|
|
218
|
+
* loading-button state) and then fires the host's `<WithdrawDialog onSubmit>` callback with
|
|
219
|
+
* the prepared UDA target + a `WithdrawSubmitActions` handle. The kit stays in `submitting`
|
|
220
|
+
* until the host calls one of those actions (`beginProcessing`, `setTxHash`, `decline`,
|
|
221
|
+
* `fail`, `succeed`).
|
|
140
222
|
*/
|
|
141
223
|
submit(input: WithdrawalFormSnapshot): void;
|
|
142
224
|
/** Close the dialog. Idempotent. */
|
|
@@ -147,10 +229,97 @@ interface WithdrawActions {
|
|
|
147
229
|
*/
|
|
148
230
|
reset(): void;
|
|
149
231
|
/**
|
|
150
|
-
* Clear the form's inline notice
|
|
151
|
-
* No-op when there's no notice or the FSM isn't on `form`.
|
|
232
|
+
* Clear the form's inline notice. No-op when there's no notice or the FSM isn't on `form`.
|
|
152
233
|
*/
|
|
153
234
|
clearNotice(): void;
|
|
235
|
+
/**
|
|
236
|
+
* Back-chevron action. Today the chevron is only rendered on the activity history step
|
|
237
|
+
* (detail → list → source); other steps either render no chevron or close directly via
|
|
238
|
+
* {@link close}.
|
|
239
|
+
*/
|
|
240
|
+
back(): void;
|
|
241
|
+
/**
|
|
242
|
+
* Header-icon entry into the activity surface. Legal from `form`; ignored elsewhere.
|
|
243
|
+
* Snapshots the current state into a {@link HistoryBackTarget} so `back()` can restore it
|
|
244
|
+
* lossless.
|
|
245
|
+
*/
|
|
246
|
+
openHistory(): void;
|
|
247
|
+
/**
|
|
248
|
+
* Open the detail view for a settlement listed on the activity surface. Legal only from
|
|
249
|
+
* `historyList`; transitions the FSM to `historyDetail`.
|
|
250
|
+
*/
|
|
251
|
+
selectSettlement(settlementId: string): void;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Payload the kit hands to the host's `<WithdrawDialog onSubmit>` callback. Carries everything
|
|
255
|
+
* the host needs to broadcast the source-chain transfer to the UDA (or to validate the request
|
|
256
|
+
* server-side before broadcasting / queueing).
|
|
257
|
+
*/
|
|
258
|
+
interface WithdrawSubmitInput {
|
|
259
|
+
/** What the user picked on the form (recipient, amount, receive token + chain). */
|
|
260
|
+
form: WithdrawalFormSnapshot;
|
|
261
|
+
/** Where the host should send brand-currency funds to trigger the bridge. */
|
|
262
|
+
depositTarget: WithdrawPreparation["depositTarget"];
|
|
263
|
+
/** Stridge correlation slot — useful for backend logs / cross-system traces. */
|
|
264
|
+
correlation: WithdrawPreparation["correlation"];
|
|
265
|
+
/** Active quote payload at submit time, when one is available. */
|
|
266
|
+
quote?: WithdrawalQuotePayload;
|
|
154
267
|
}
|
|
268
|
+
/**
|
|
269
|
+
* Imperative handles the host's `onSubmit` callback receives. Each action advances the kit's
|
|
270
|
+
* FSM at the point the host's backend reaches the matching state. All actions are optional —
|
|
271
|
+
* the host calls only what fits their flow (e.g. backend pre-validates and accepts ⇒
|
|
272
|
+
* `beginProcessing()`; later the broadcast lands ⇒ `setTxHash({ hash })`; settlement watching
|
|
273
|
+
* via Stridge takes over from there). The kit also exposes a `signal` for cancellation when
|
|
274
|
+
* the user closes the dialog mid-submit.
|
|
275
|
+
*/
|
|
276
|
+
interface WithdrawSubmitActions {
|
|
277
|
+
/**
|
|
278
|
+
* Move the FSM into `inProgress`. Pass `tx` if a broadcast hash already exists at this point;
|
|
279
|
+
* otherwise omit — the kit polls `gateway/{owner}` with a best-match heuristic until you
|
|
280
|
+
* call {@link setTxHash}. Idempotent — calling more than once is a no-op.
|
|
281
|
+
*/
|
|
282
|
+
beginProcessing(tx?: TxRef): void;
|
|
283
|
+
/**
|
|
284
|
+
* Surface a broadcast hash mid-processing. Upgrades the watcher from best-match to
|
|
285
|
+
* tx-anchored. Legal from `inProgress` or `submitting` (auto-promotes to `inProgress`).
|
|
286
|
+
*/
|
|
287
|
+
setTxHash(tx: TxRef): void;
|
|
288
|
+
/**
|
|
289
|
+
* Mark the withdraw failed. Legal from `submitting` (pre-broadcast rejection) and
|
|
290
|
+
* `inProgress` (post-broadcast failure). The optional `failure` carries a localized
|
|
291
|
+
* reason + machine code for analytics; omit when the host has nothing meaningful to
|
|
292
|
+
* report and just needs to terminate the flow.
|
|
293
|
+
*
|
|
294
|
+
* For user-rejection (the user said no in their wallet), prefer {@link decline} so the
|
|
295
|
+
* kit can emit `withdraw.submission.declined` instead of `withdraw.submission.failed`.
|
|
296
|
+
*/
|
|
297
|
+
fail(failure?: FailureInfo): void;
|
|
298
|
+
/**
|
|
299
|
+
* Mark the withdraw as user-declined. Use when the user explicitly refused a wallet
|
|
300
|
+
* prompt or backed out of a host-side confirmation step. The kit routes the FSM back to
|
|
301
|
+
* `form{notice}` (same as the wallet-rejection heuristic) and emits
|
|
302
|
+
* `withdraw.submission.declined` on the unified bus — distinct from `*.failed` because
|
|
303
|
+
* declining is a user choice, not an error. Analytics that count `.failed` events stay
|
|
304
|
+
* accurate.
|
|
305
|
+
*
|
|
306
|
+
* Legal from `submitting`. When the host doesn't call this explicitly, the kit's
|
|
307
|
+
* built-in rejection heuristic still classifies wallet-rejection-shaped errors as
|
|
308
|
+
* declines automatically.
|
|
309
|
+
*/
|
|
310
|
+
decline(): void;
|
|
311
|
+
/**
|
|
312
|
+
* Mark the withdraw succeeded directly. Useful when the host runs their own settlement
|
|
313
|
+
* verification independently of Stridge's poll. Legal from `submitting` and `inProgress`.
|
|
314
|
+
*/
|
|
315
|
+
succeed(): void;
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Host-supplied callback fired when the user submits the withdrawal form. The kit hands the
|
|
319
|
+
* callback the resolved {@link WithdrawSubmitInput} plus a {@link WithdrawSubmitActions} handle
|
|
320
|
+
* the host calls to advance the FSM. The kit does NOT await the callback's promise — the host
|
|
321
|
+
* is in control of pacing via the actions. The `signal` aborts when the user closes the dialog.
|
|
322
|
+
*/
|
|
323
|
+
type WithdrawSubmitCallback = (input: WithdrawSubmitInput, actions: WithdrawSubmitActions, signal: AbortSignal) => void | Promise<void>;
|
|
155
324
|
//#endregion
|
|
156
|
-
export { WithdrawActions, WithdrawController, WithdrawEvent, WithdrawState, WithdrawStateName, WithdrawalFormSnapshot };
|
|
325
|
+
export { WithdrawActions, WithdrawController, WithdrawEvent, WithdrawState, WithdrawStateName, WithdrawSubmitActions, WithdrawSubmitCallback, WithdrawSubmitInput, WithdrawalFormSnapshot };
|
|
@@ -19,5 +19,40 @@ import { WithdrawController } from "./types.js";
|
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
21
|
declare function useWithdraw(): WithdrawController;
|
|
22
|
+
/**
|
|
23
|
+
* Non-throwing variant of {@link useWithdraw} — returns `null` when called outside a
|
|
24
|
+
* `<KitProvider withdraw={…} />`. Lets hosts mount `<StridgeProvider />` conditionally
|
|
25
|
+
* (e.g. only after a wallet is connected) without descendants crashing the moment they render
|
|
26
|
+
* before the provider exists.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* const withdraw = useOptionalWithdraw();
|
|
31
|
+
* return (
|
|
32
|
+
* <button onClick={() => withdraw?.open()} disabled={!withdraw}>
|
|
33
|
+
* Withdraw
|
|
34
|
+
* </button>
|
|
35
|
+
* );
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
declare function useOptionalWithdraw(): WithdrawController | null;
|
|
39
|
+
/**
|
|
40
|
+
* Headless prefetch handle for the withdraw driver. Returns a stable function that arms the
|
|
41
|
+
* driver — kicks off the deferred `supportedAssets` + initial `balance/onchain` bootstrap.
|
|
42
|
+
* Calling it before the user opens the dialog warms the cache so the subsequent
|
|
43
|
+
* `useWithdraw().open()` lands on populated data without a perceptible loading window.
|
|
44
|
+
*
|
|
45
|
+
* Fire-and-forget: returns `void`. Observe bootstrap state via
|
|
46
|
+
* `useWithdrawSnapshot().receiveOptions.status` if needed.
|
|
47
|
+
*
|
|
48
|
+
* ```tsx
|
|
49
|
+
* const withdraw = useWithdraw();
|
|
50
|
+
* const prefetchWithdraw = usePrefetchWithdraw();
|
|
51
|
+
* <button onMouseEnter={prefetchWithdraw} onClick={() => withdraw.open()}>Withdraw</button>;
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* Idempotent — subsequent calls are no-ops while the driver is already armed.
|
|
55
|
+
*/
|
|
56
|
+
declare function usePrefetchWithdraw(): () => void;
|
|
22
57
|
//#endregion
|
|
23
|
-
export { useWithdraw };
|
|
58
|
+
export { useOptionalWithdraw, usePrefetchWithdraw, useWithdraw };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{useWithdrawDriverInstance as e}from"../driver/context.js";import{useControllerContext as t,useOptionalControllerContext as n}from"./controller.js";import{useCallback as r}from"react";function i(){return t().controller}function a(){return n()?.controller??null}function o(){let t=e();return r(()=>{t.arm()},[t])}export{a as useOptionalWithdraw,o as usePrefetchWithdraw,i as useWithdraw};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/flows/withdraw/widgets/activity-history/WithdrawHistoryDetail.d.ts
|
|
5
|
+
interface WithdrawHistoryDetailOwnProps {
|
|
6
|
+
/**
|
|
7
|
+
* Optional custom composition forwarded to the underlying `<ActivityHistoryDetail>`
|
|
8
|
+
* compound. Defaults to mounting all three per-kind parts.
|
|
9
|
+
*/
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Orchestrated activity-history detail wrapper for the withdraw dialog. Mirrors
|
|
14
|
+
* {@link import("#/flows/deposit/widgets/activity-history").DepositHistoryDetail}. Renders
|
|
15
|
+
* `null` while the FSM is not on `historyDetail`.
|
|
16
|
+
*/
|
|
17
|
+
declare function WithdrawHistoryDetail({
|
|
18
|
+
children
|
|
19
|
+
}: WithdrawHistoryDetailOwnProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
20
|
+
declare namespace WithdrawHistoryDetail {
|
|
21
|
+
type Props = WithdrawHistoryDetailOwnProps;
|
|
22
|
+
const Processing: ({
|
|
23
|
+
children
|
|
24
|
+
}: {
|
|
25
|
+
children?: ReactNode;
|
|
26
|
+
}) => _$react_jsx_runtime0.JSX.Element | null;
|
|
27
|
+
const Succeeded: ({
|
|
28
|
+
children
|
|
29
|
+
}: {
|
|
30
|
+
children?: ReactNode;
|
|
31
|
+
}) => _$react_jsx_runtime0.JSX.Element | null;
|
|
32
|
+
const Failed: ({
|
|
33
|
+
children
|
|
34
|
+
}: {
|
|
35
|
+
children?: ReactNode;
|
|
36
|
+
}) => _$react_jsx_runtime0.JSX.Element | null;
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { WithdrawHistoryDetail };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{ActivityHistorySourceProvider as e}from"../../../../shared/widgets/activity-history/compound/context.js";import{ActivityHistoryDetail as t}from"../../../../shared/widgets/activity-history/compound/ActivityHistoryDetail.js";import"../../../../activity-history/compound/index.js";import{useWithdrawActivityHistorySource as n}from"./useWithdrawActivityHistorySource.js";import{jsx as r}from"react/jsx-runtime";function i({children:i}){let{sourceValue:a,step:o}=n();return o!==`historyDetail`||!a?null:r(e,{value:a,children:r(t,{children:i})})}(function(e){e.Processing=t.Processing,e.Succeeded=t.Succeeded,e.Failed=t.Failed})(i||={});export{i as WithdrawHistoryDetail};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ActivityHistoryEmpty } from "../../../../shared/widgets/activity-history/compound/components/Empty.js";
|
|
2
|
+
import { ActivityHistoryErrorView } from "../../../../shared/widgets/activity-history/compound/components/ErrorView.js";
|
|
3
|
+
import { ActivityHistoryHeader, ActivityHistoryListHeader } from "../../../../shared/widgets/activity-history/compound/components/HistoryHeader.js";
|
|
4
|
+
import { ActivityHistoryList } from "../../../../shared/widgets/activity-history/compound/components/List.js";
|
|
5
|
+
import { ActivityHistoryRow } from "../../../../shared/widgets/activity-history/compound/components/Row.js";
|
|
6
|
+
import { ComponentProps, ReactNode } from "react";
|
|
7
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
8
|
+
|
|
9
|
+
//#region src/flows/withdraw/widgets/activity-history/WithdrawHistoryList.d.ts
|
|
10
|
+
interface WithdrawHistoryListOwnProps {
|
|
11
|
+
/**
|
|
12
|
+
* Optional custom composition forwarded to the underlying `<ActivityHistory>` compound.
|
|
13
|
+
* Defaults to the compound's `<Header /> + <List />` shape.
|
|
14
|
+
*/
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Orchestrated activity-history list wrapper for the withdraw dialog. Mirrors
|
|
19
|
+
* {@link import("#/flows/deposit/widgets/activity-history").DepositHistoryList}. Renders
|
|
20
|
+
* `null` while the FSM is not on `historyList`.
|
|
21
|
+
*/
|
|
22
|
+
declare function WithdrawHistoryList({
|
|
23
|
+
children,
|
|
24
|
+
...props
|
|
25
|
+
}: ComponentProps<"div"> & WithdrawHistoryListOwnProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
26
|
+
declare namespace WithdrawHistoryList {
|
|
27
|
+
type Props = ComponentProps<"div"> & WithdrawHistoryListOwnProps;
|
|
28
|
+
const Header: typeof ActivityHistoryHeader;
|
|
29
|
+
const ListHeader: typeof ActivityHistoryListHeader;
|
|
30
|
+
const List: typeof ActivityHistoryList;
|
|
31
|
+
const Row: typeof ActivityHistoryRow;
|
|
32
|
+
const Empty: typeof ActivityHistoryEmpty;
|
|
33
|
+
const ErrorView: typeof ActivityHistoryErrorView;
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { WithdrawHistoryList };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{ActivityHistorySourceProvider as e}from"../../../../shared/widgets/activity-history/compound/context.js";import{ActivityHistory as t}from"../../../../shared/widgets/activity-history/compound/ActivityHistory.js";import"../../../../activity-history/compound/index.js";import{useWithdrawActivityHistorySource as n}from"./useWithdrawActivityHistorySource.js";import{jsx as r}from"react/jsx-runtime";function i({children:i,...a}){let{sourceValue:o,step:s}=n();return s!==`historyList`||!o?null:r(e,{value:o,children:r(t,{...a,children:i})})}(function(e){e.Header=t.Header,e.ListHeader=t.ListHeader,e.List=t.List,e.Row=t.Row,e.Empty=t.Empty,e.ErrorView=t.ErrorView})(i||={});export{i as WithdrawHistoryList};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./WithdrawHistoryDetail.js";import"./WithdrawHistoryList.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useLingui as e}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useWithdrawDriverInstance as t,useWithdrawSnapshot as n}from"../../driver/context.js";import{useWithdrawActions as r,useWithdrawEffectiveState as i}from"../../orchestrator/controller.js";import"../../orchestrator/index.js";import{defaultBlockExplorers as a}from"../../../../shared/utils/explorers.js";import{useCallback as o,useMemo as s}from"react";function c(){let c=n(),l=r(),u=t(),d=i(),{i18n:f}=e(),p=o(e=>{u.refreshHistory?.(e)},[u]),m=d.name===`historyList`||d.name===`historyDetail`,h=d.name===`historyDetail`?d.ctx.settlementId:void 0;return{sourceValue:s(()=>{if(!m)return null;let e={i18n:f,sourceWallet:{name:`Wallet`,address:`0x0000000000000000000000000000000000000000`},explorers:a()};return{entity:c.history,refresh:p,selectSettlement:l.selectSettlement,back:l.back,...h===void 0?{}:{settlementId:h},settlementContext:e}},[c,l,m,h,f,p]),settlementId:h,step:d.name===`historyList`?`historyList`:d.name===`historyDetail`?`historyDetail`:`other`}}export{c as useWithdrawActivityHistorySource};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { WithdrawStateName } from "../../../orchestrator/types.js";
|
|
2
|
+
import { Props, WithdrawBoundary } from "./components/Boundary.js";
|
|
3
|
+
import { Props as Props$1, WithdrawGuards } from "./components/Guards.js";
|
|
4
|
+
import { WithdrawSteps, WithdrawStepsProps } from "./components/Steps.js";
|
|
5
|
+
import { ReactNode } from "react";
|
|
6
|
+
|
|
7
|
+
//#region src/flows/withdraw/widgets/withdraw/compound/Withdraw.d.ts
|
|
8
|
+
interface WithdrawStepProps {
|
|
9
|
+
/**
|
|
10
|
+
* Matches against the withdraw FSM's effective state name (with `submitting` collapsed
|
|
11
|
+
* to `form`). Declaring `name="submitting"` never matches — use `name="form"` and the
|
|
12
|
+
* widget stays mounted across both states.
|
|
13
|
+
*/
|
|
14
|
+
name: WithdrawStateName;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Top-level `Withdraw` compound namespace. Today exposes the slot-routing primitives that
|
|
19
|
+
* let hosts compose multi-screen withdraw flows; the namespace exists at this position so
|
|
20
|
+
* future `Withdraw.*` parts (Header, Body, …) can extend it without churning the import path.
|
|
21
|
+
*
|
|
22
|
+
* Hosts wire it like the deposit equivalent:
|
|
23
|
+
*
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <Withdraw.Steps>
|
|
26
|
+
* <Withdraw.Step name="form"><WithdrawForm /></Withdraw.Step>
|
|
27
|
+
* <Withdraw.Step name="inProgress"><WithdrawInProgress /></Withdraw.Step>
|
|
28
|
+
* <Withdraw.Step name="success"><WithdrawSuccess /></Withdraw.Step>
|
|
29
|
+
* <Withdraw.Step name="error"><WithdrawError /></Withdraw.Step>
|
|
30
|
+
* </Withdraw.Steps>
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* Rendered directly (`<Withdraw />`) the component is a no-op — reach into the sub-parts.
|
|
34
|
+
*/
|
|
35
|
+
declare function Withdraw(): null;
|
|
36
|
+
declare namespace Withdraw {
|
|
37
|
+
type StepsProps = WithdrawStepsProps;
|
|
38
|
+
type StepProps = WithdrawStepProps;
|
|
39
|
+
type GuardsProps = Props$1;
|
|
40
|
+
type BoundaryProps = Props;
|
|
41
|
+
const Steps: typeof WithdrawSteps;
|
|
42
|
+
/**
|
|
43
|
+
* Slot consumed by {@link Withdraw.Steps}. `name` is the FSM state to match; the matched
|
|
44
|
+
* step's `children` are rendered, every other branch is dropped.
|
|
45
|
+
*/
|
|
46
|
+
const Step: (props: WithdrawStepProps) => null;
|
|
47
|
+
/**
|
|
48
|
+
* Bootstrap-loading guard. While `gateway/start` is in flight on the form / submitting
|
|
49
|
+
* step pair, renders a centered spinner instead of empty form chrome. Falls through to
|
|
50
|
+
* children for every other state.
|
|
51
|
+
*/
|
|
52
|
+
const Guards: typeof WithdrawGuards;
|
|
53
|
+
/**
|
|
54
|
+
* Error-boundary part. Wires the kit's `GatewayKitBoundary` with withdraw-flow recovery —
|
|
55
|
+
* `onReset` calls `useWithdraw().close()` internally; `onError` is host-supplied.
|
|
56
|
+
*/
|
|
57
|
+
const Boundary: typeof WithdrawBoundary;
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
export { Withdraw };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{Step as e}from"../../../../../shared/ui/Steps/Steps.js";import"../../../../../shared/ui/Steps/index.js";import{WithdrawBoundary as t}from"./components/Boundary.js";import{WithdrawGuards as n}from"./components/Guards.js";import{WithdrawSteps as r}from"./components/Steps.js";function i(){return null}(function(i){i.Steps=r,i.Step=e,i.Guards=n,i.Boundary=t})(i||={});export{i as Withdraw};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/flows/withdraw/widgets/withdraw/compound/Withdraw.slots.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* `<Withdraw.*>` slot vocabulary. Today the namespace only houses `Withdraw.Steps` /
|
|
4
|
+
* `Withdraw.Step`, both of which route their slot attribute through the shared `Steps`
|
|
5
|
+
* primitive. The constant exists so future `Withdraw.*` parts (Header, Body, …) have a
|
|
6
|
+
* canonical slot map ready when they land.
|
|
7
|
+
*/
|
|
8
|
+
declare const WITHDRAW_SLOTS: {
|
|
9
|
+
readonly root: "withdraw-root";
|
|
10
|
+
};
|
|
11
|
+
type WithdrawSlot = (typeof WITHDRAW_SLOTS)[keyof typeof WITHDRAW_SLOTS];
|
|
12
|
+
//#endregion
|
|
13
|
+
export { WITHDRAW_SLOTS, WithdrawSlot };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={root:`withdraw-root`};export{e as WITHDRAW_SLOTS};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ErrorInfo, ReactNode } from "react";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/flows/withdraw/widgets/withdraw/compound/components/Boundary.d.ts
|
|
5
|
+
interface Props {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Replaces the kit's default crash fallback. Compose `GatewayKitErrorCard` parts to keep
|
|
9
|
+
* kit styling, or render your own JSX for a fully custom recovery surface.
|
|
10
|
+
*/
|
|
11
|
+
fallback?: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Fires once per caught render error. Pipe to your analytics or error-reporting pipeline.
|
|
14
|
+
*/
|
|
15
|
+
onError?: (error: Error, errorInfo: ErrorInfo) => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Error-boundary part for the withdraw flow. Wraps children with the kit's
|
|
19
|
+
* `GatewayKitBoundary` and pipes the recovery action through `useWithdraw().close()` so a
|
|
20
|
+
* crash returns the user to a clean state. `onError` is host-supplied; `onReset` is wired
|
|
21
|
+
* internally.
|
|
22
|
+
*/
|
|
23
|
+
declare function WithdrawBoundary({
|
|
24
|
+
children,
|
|
25
|
+
fallback,
|
|
26
|
+
onError
|
|
27
|
+
}: Props): _$react_jsx_runtime0.JSX.Element;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { Props, WithdrawBoundary };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useWithdrawActions as e}from"../../../../orchestrator/controller.js";import{GatewayKitBoundary as t}from"../../../../../../shared/error-handling/components/GatewayKitBoundary.js";import"../../../../../../shared/error-handling/index.js";import{jsx as n}from"react/jsx-runtime";function r({children:r,fallback:i,onError:a}){let{close:o}=e();return n(t,{...a?{onError:a}:{},...i===void 0?{}:{fallback:i},onReset:o,children:r})}export{r as WithdrawBoundary};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/flows/withdraw/widgets/withdraw/compound/components/Guards.d.ts
|
|
5
|
+
interface Props {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Bootstrap-loading guard for the withdraw flow. While the lazy `arm()` is in flight,
|
|
10
|
+
* `receiveOptions` is `idle` / `loading` — the form widget would render against an empty
|
|
11
|
+
* catalog, so we surface a centered spinner inside the same frame instead of empty form
|
|
12
|
+
* chrome. Cache hits never trip this branch because the entity stays `ready` for the rest
|
|
13
|
+
* of the provider lifetime once it transitions there.
|
|
14
|
+
*
|
|
15
|
+
* Only applies to the `form` / `submitting` step pair — terminal steps (`inProgress` /
|
|
16
|
+
* `success` / `error`) read from `settlement`, which populates independently of bootstrap.
|
|
17
|
+
* The withdraw flow does NOT have a wallet-required gate; the host always supplies a
|
|
18
|
+
* `flows.withdraw.owner` via `<StridgeProvider>` (the business broadcasts the source-chain
|
|
19
|
+
* tx, not the end-user).
|
|
20
|
+
*/
|
|
21
|
+
declare function WithdrawGuards({
|
|
22
|
+
children
|
|
23
|
+
}: Props): _$react_jsx_runtime0.JSX.Element;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { Props, WithdrawGuards };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useWithdrawSnapshot as e}from"../../../../driver/context.js";import{useWithdrawEffectiveState as t}from"../../../../orchestrator/controller.js";import"../../../../orchestrator/index.js";import{LoadingState as n}from"../../../../../../shared/dialog/LoadingState.js";import{Fragment as r,jsx as i}from"react/jsx-runtime";function a({children:a}){let o=t(),s=e();return(o.name===`form`||o.name===`submitting`)&&(s.receiveOptions.status===`loading`||s.receiveOptions.status===`idle`)?i(n,{slot:`withdraw`}):i(r,{children:a})}export{a as WithdrawGuards};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/flows/withdraw/widgets/withdraw/compound/components/Steps.d.ts
|
|
5
|
+
interface WithdrawStepsProps {
|
|
6
|
+
/**
|
|
7
|
+
* When true, the matched step renders without the kit's animated `StepTransition` wrapper.
|
|
8
|
+
* Forwarded to the underlying `Steps` primitive.
|
|
9
|
+
*/
|
|
10
|
+
plain?: boolean;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Withdraw-bound slot-routing parent. Reads the withdraw FSM's *effective* state name and
|
|
15
|
+
* renders only the matching `<Withdraw.Step name="…" />` child.
|
|
16
|
+
*
|
|
17
|
+
* Collapses `submitting → form` so the form widget stays mounted (and its slide animation
|
|
18
|
+
* does not re-trigger) while the host's `onSubmit` is in flight. Hosts therefore declare a
|
|
19
|
+
* single `<Withdraw.Step name="form">` to cover both the idle form and the post-submit
|
|
20
|
+
* pending state — declaring `name="submitting"` separately never matches.
|
|
21
|
+
*/
|
|
22
|
+
declare function WithdrawSteps({
|
|
23
|
+
plain,
|
|
24
|
+
children
|
|
25
|
+
}: WithdrawStepsProps): _$react_jsx_runtime0.JSX.Element;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { WithdrawSteps, type WithdrawStepsProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useWithdrawEffectiveState as e}from"../../../../orchestrator/controller.js";import"../../../../orchestrator/index.js";import{Steps as t}from"../../../../../../shared/ui/Steps/Steps.js";import"../../../../../../shared/ui/Steps/index.js";import{jsx as n}from"react/jsx-runtime";function r({plain:r,children:i}){let a=e();return n(t,{activeStep:a.name===`submitting`?`form`:a.name,...r===void 0?{}:{plain:r},children:i})}export{r as WithdrawSteps};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./Withdraw.js";import"./Withdraw.slots.js";
|