@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
|
@@ -9,6 +9,35 @@ import { FailureInfo } from "../../../shared/orchestrator/types.js";
|
|
|
9
9
|
* (transfer-crypto → process).
|
|
10
10
|
*/
|
|
11
11
|
type DepositMethod = "wallet" | "transfer";
|
|
12
|
+
/**
|
|
13
|
+
* Host-supplied disable lever for a single payment method on the deposit-method picker. The host
|
|
14
|
+
* decides eligibility — the kit ships no per-host inference (embedded vs. external wallet,
|
|
15
|
+
* region, KYC tier, …). When `disabled` is true the tile stays in the picker (preserves
|
|
16
|
+
* discoverability), renders natively disabled, can't be selected, and shows `disabledHint` as
|
|
17
|
+
* the inline meta line below the title (also folded into the tile's accessible name so screen
|
|
18
|
+
* readers convey the reason).
|
|
19
|
+
*/
|
|
20
|
+
interface DepositMethodConfig {
|
|
21
|
+
/** When true, the method is rendered disabled and can't be selected. */
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Plain-text reason shown inline as the tile's meta line — replaces the address+balance
|
|
25
|
+
* reading on the wallet tile and the `"No limit · Instant"` reading on the transfer tile so
|
|
26
|
+
* the explanation is unmissable and the auto-derived signals (which can read misleadingly,
|
|
27
|
+
* e.g. an embedded wallet's $0.00) are suppressed. Also folded into the tile's accessible
|
|
28
|
+
* name so screen readers convey it alongside the title. Ignored when `disabled` is falsy.
|
|
29
|
+
*/
|
|
30
|
+
disabledHint?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Per-method host configuration for the deposit picker. Omitting a method (or the whole object)
|
|
34
|
+
* keeps default behavior; supply `{ disabled: true, disabledHint: "…" }` to mark an option as
|
|
35
|
+
* unavailable for the current user.
|
|
36
|
+
*/
|
|
37
|
+
interface DepositMethodsConfig {
|
|
38
|
+
wallet?: DepositMethodConfig;
|
|
39
|
+
transfer?: DepositMethodConfig;
|
|
40
|
+
}
|
|
12
41
|
/**
|
|
13
42
|
* Confirm-deposit phase sub-union. Drives the confirm-deposit widget's hero / footer chrome.
|
|
14
43
|
* Phase data is pure navigation; the actual quote payload comes from the driver's `quote` entity.
|
|
@@ -47,6 +76,31 @@ type RetryTargetSpec = {
|
|
|
47
76
|
*/
|
|
48
77
|
kind: "fresh";
|
|
49
78
|
};
|
|
79
|
+
/**
|
|
80
|
+
* Where `BACK` lands when the user exits the activity surface. Encoded once at `OPEN_HISTORY`
|
|
81
|
+
* time so the back chevron can restore each pre-commit source state lossless — same precedent
|
|
82
|
+
* as {@link RetryTargetSpec}, just for the history-exit path instead of the error-retry path.
|
|
83
|
+
*
|
|
84
|
+
* The discriminant `kind` mirrors the source-state name. The remaining fields carry exactly the
|
|
85
|
+
* ctx slots needed to rebuild that state (method, asset, inner backTarget).
|
|
86
|
+
*/
|
|
87
|
+
type HistoryBackTarget = {
|
|
88
|
+
kind: "deposit";
|
|
89
|
+
backTarget: "closed";
|
|
90
|
+
} | {
|
|
91
|
+
kind: "assetPicker";
|
|
92
|
+
method: "wallet";
|
|
93
|
+
backTarget: "closed" | "deposit";
|
|
94
|
+
} | {
|
|
95
|
+
kind: "amountEntry";
|
|
96
|
+
method: "wallet";
|
|
97
|
+
asset: BalanceItemPayload;
|
|
98
|
+
backTarget: "closed" | "assetPicker";
|
|
99
|
+
} | {
|
|
100
|
+
kind: "transferCrypto";
|
|
101
|
+
method: "transfer";
|
|
102
|
+
backTarget: "closed" | "deposit";
|
|
103
|
+
};
|
|
50
104
|
/**
|
|
51
105
|
* State machine state nodes. Per-state discriminated ctx narrows what is available — illegal
|
|
52
106
|
* states (e.g. `confirmDeposit` without an asset) are unrepresentable.
|
|
@@ -115,6 +169,27 @@ type DepositState = {
|
|
|
115
169
|
failure?: FailureInfo; /** Source-chain tx hash when the error followed a successful broadcast. */
|
|
116
170
|
tx?: TxRef;
|
|
117
171
|
};
|
|
172
|
+
} | {
|
|
173
|
+
/**
|
|
174
|
+
* Activity history list — reachable from any pre-commit state via the header icon.
|
|
175
|
+
* `backTarget` snapshots the source state at `OPEN_HISTORY` time so the back chevron
|
|
176
|
+
* can restore it lossless.
|
|
177
|
+
*/
|
|
178
|
+
name: "historyList";
|
|
179
|
+
ctx: {
|
|
180
|
+
backTarget: HistoryBackTarget;
|
|
181
|
+
};
|
|
182
|
+
} | {
|
|
183
|
+
/**
|
|
184
|
+
* Activity history per-settlement detail — reached from `historyList` via
|
|
185
|
+
* `SELECT_SETTLEMENT`. Carries the selected row's id and the same `backTarget` so
|
|
186
|
+
* `BACK` collapses to `historyList` first, then to the original source step.
|
|
187
|
+
*/
|
|
188
|
+
name: "historyDetail";
|
|
189
|
+
ctx: {
|
|
190
|
+
settlementId: string;
|
|
191
|
+
backTarget: HistoryBackTarget;
|
|
192
|
+
};
|
|
118
193
|
};
|
|
119
194
|
type DepositStateName = DepositState["name"];
|
|
120
195
|
/**
|
|
@@ -205,6 +280,22 @@ type GatewayEvent = {
|
|
|
205
280
|
*/
|
|
206
281
|
type: "RESUME_TO_ERROR";
|
|
207
282
|
tx?: TxRef;
|
|
283
|
+
} | {
|
|
284
|
+
/**
|
|
285
|
+
* User tapped the header history icon. Legal from every pre-commit state
|
|
286
|
+
* (`deposit | assetPicker | amountEntry | transferCrypto`); ignored elsewhere. The
|
|
287
|
+
* reducer snapshots the source state into a {@link HistoryBackTarget} so the back
|
|
288
|
+
* chevron can restore it lossless.
|
|
289
|
+
*/
|
|
290
|
+
type: "OPEN_HISTORY";
|
|
291
|
+
} | {
|
|
292
|
+
/**
|
|
293
|
+
* User tapped a row in the activity list. Legal only from `historyList`; transitions
|
|
294
|
+
* to `historyDetail` carrying the selected `settlementId` and the same `backTarget`,
|
|
295
|
+
* so a later `BACK` from the list step restores the original source state.
|
|
296
|
+
*/
|
|
297
|
+
type: "SELECT_SETTLEMENT";
|
|
298
|
+
settlementId: string;
|
|
208
299
|
};
|
|
209
300
|
/**
|
|
210
301
|
* Public open-input variant accepted by `useDeposit().open()`. Hosts pass the small ID-based
|
|
@@ -261,6 +352,17 @@ interface DepositActions {
|
|
|
261
352
|
resumeToSuccess(method: DepositMethod, tx: TxRef): void;
|
|
262
353
|
/** Banner-driven jump into the error widget. */
|
|
263
354
|
resumeToError(tx?: TxRef): void;
|
|
355
|
+
/**
|
|
356
|
+
* Header-icon entry into the activity surface. Legal from every pre-commit state; ignored
|
|
357
|
+
* elsewhere. Snapshots the current state into a {@link HistoryBackTarget} so `back()` can
|
|
358
|
+
* restore it lossless.
|
|
359
|
+
*/
|
|
360
|
+
openHistory(): void;
|
|
361
|
+
/**
|
|
362
|
+
* Open the detail view for a settlement listed on the activity surface. Legal only from
|
|
363
|
+
* `historyList`; transitions the FSM to `historyDetail`.
|
|
364
|
+
*/
|
|
365
|
+
selectSettlement(settlementId: string): void;
|
|
264
366
|
}
|
|
265
367
|
//#endregion
|
|
266
|
-
export { ConfirmDepositPhase, DepositActions, DepositController, DepositMethod, DepositState, DepositStateName, GatewayEvent, OpenInput, ResolvedOpenInput, RetryTargetSpec };
|
|
368
|
+
export { ConfirmDepositPhase, DepositActions, DepositController, DepositMethod, DepositMethodConfig, DepositMethodsConfig, DepositState, DepositStateName, GatewayEvent, OpenInput, ResolvedOpenInput, RetryTargetSpec };
|
|
@@ -31,5 +31,49 @@ import { DepositController } from "./types.js";
|
|
|
31
31
|
* ```
|
|
32
32
|
*/
|
|
33
33
|
declare function useDeposit(): DepositController;
|
|
34
|
+
/**
|
|
35
|
+
* Non-throwing variant of {@link useDeposit} — returns `null` when called outside a
|
|
36
|
+
* `<KitProvider deposit={…} />`. Lets hosts mount `<StridgeProvider />` conditionally
|
|
37
|
+
* (e.g. only after a wallet is connected) without descendants crashing the moment they render
|
|
38
|
+
* before the provider exists.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* const deposit = useOptionalDeposit();
|
|
43
|
+
* return (
|
|
44
|
+
* <button onClick={() => deposit?.open()} disabled={!deposit}>
|
|
45
|
+
* Deposit
|
|
46
|
+
* </button>
|
|
47
|
+
* );
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
declare function useOptionalDeposit(): DepositController | null;
|
|
51
|
+
/**
|
|
52
|
+
* Headless prefetch handle for the deposit driver. Returns a stable function that arms the
|
|
53
|
+
* driver — kicks off the deferred `gateway/start` + `supportedAssets` + initial `balance/onchain`
|
|
54
|
+
* bootstrap. Calling it before the user opens the dialog warms the cache so the subsequent
|
|
55
|
+
* `useDeposit().open()` lands on populated data without a perceptible loading window.
|
|
56
|
+
*
|
|
57
|
+
* The function is fire-and-forget: returns `void`. To observe bootstrap state, read
|
|
58
|
+
* `useDepositSnapshot().target.status` directly — the snapshot is the single source of truth.
|
|
59
|
+
*
|
|
60
|
+
* The most common use is hover-to-warm:
|
|
61
|
+
*
|
|
62
|
+
* ```tsx
|
|
63
|
+
* const deposit = useDeposit();
|
|
64
|
+
* const prefetchDeposit = usePrefetchDeposit();
|
|
65
|
+
* <button onMouseEnter={prefetchDeposit} onClick={() => deposit.open()}>Deposit</button>;
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* Headless balance widgets that need data on render call this in an effect:
|
|
69
|
+
*
|
|
70
|
+
* ```tsx
|
|
71
|
+
* const prefetchDeposit = usePrefetchDeposit();
|
|
72
|
+
* useEffect(() => { prefetchDeposit(); }, [prefetchDeposit]);
|
|
73
|
+
* ```
|
|
74
|
+
*
|
|
75
|
+
* Idempotent — subsequent calls are no-ops while the driver is already armed.
|
|
76
|
+
*/
|
|
77
|
+
declare function usePrefetchDeposit(): () => void;
|
|
34
78
|
//#endregion
|
|
35
|
-
export { useDeposit };
|
|
79
|
+
export { useDeposit, useOptionalDeposit, usePrefetchDeposit };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{useDepositDriverInstance 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{i as useDeposit,a as useOptionalDeposit,o as usePrefetchDeposit};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/flows/deposit/widgets/activity-history/DepositHistoryDetail.d.ts
|
|
5
|
+
interface DepositHistoryDetailOwnProps {
|
|
6
|
+
/**
|
|
7
|
+
* Optional custom composition forwarded to the underlying `<ActivityHistoryDetail>`
|
|
8
|
+
* compound. Defaults to mounting all three per-kind parts; each gates internally on the
|
|
9
|
+
* resolved payload's `kind`.
|
|
10
|
+
*/
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Orchestrated activity-history detail wrapper for the deposit dialog. Mounts the cross-flow
|
|
15
|
+
* `<ActivityHistoryDetail>` compound and exposes per-kind parts (`Processing`, `Succeeded`,
|
|
16
|
+
* `Failed`) as namespace members. Renders `null` while the FSM is not on `historyDetail`.
|
|
17
|
+
*/
|
|
18
|
+
declare function DepositHistoryDetail({
|
|
19
|
+
children
|
|
20
|
+
}: DepositHistoryDetailOwnProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
21
|
+
declare namespace DepositHistoryDetail {
|
|
22
|
+
type Props = DepositHistoryDetailOwnProps;
|
|
23
|
+
const Processing: ({
|
|
24
|
+
children
|
|
25
|
+
}: {
|
|
26
|
+
children?: ReactNode;
|
|
27
|
+
}) => _$react_jsx_runtime0.JSX.Element | null;
|
|
28
|
+
const Succeeded: ({
|
|
29
|
+
children
|
|
30
|
+
}: {
|
|
31
|
+
children?: ReactNode;
|
|
32
|
+
}) => _$react_jsx_runtime0.JSX.Element | null;
|
|
33
|
+
const Failed: ({
|
|
34
|
+
children
|
|
35
|
+
}: {
|
|
36
|
+
children?: ReactNode;
|
|
37
|
+
}) => _$react_jsx_runtime0.JSX.Element | null;
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { DepositHistoryDetail };
|
|
@@ -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{useDepositActivityHistorySource as n}from"./useDepositActivityHistorySource.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 DepositHistoryDetail};
|
|
@@ -0,0 +1,38 @@
|
|
|
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/deposit/widgets/activity-history/DepositHistoryList.d.ts
|
|
10
|
+
interface DepositHistoryListOwnProps {
|
|
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 deposit dialog. Bridges the deposit
|
|
19
|
+
* flow's snapshot + actions + FSM state into the cross-flow `<ActivityHistory>` compound's
|
|
20
|
+
* source value. Renders `null` while the FSM is not on `historyList` — the dialog's step
|
|
21
|
+
* router only matches the active step, but the no-op guard keeps the component safe to mount
|
|
22
|
+
* in custom dialog compositions that skip the step router.
|
|
23
|
+
*/
|
|
24
|
+
declare function DepositHistoryList({
|
|
25
|
+
children,
|
|
26
|
+
...props
|
|
27
|
+
}: ComponentProps<"div"> & DepositHistoryListOwnProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
28
|
+
declare namespace DepositHistoryList {
|
|
29
|
+
type Props = ComponentProps<"div"> & DepositHistoryListOwnProps;
|
|
30
|
+
const Header: typeof ActivityHistoryHeader;
|
|
31
|
+
const ListHeader: typeof ActivityHistoryListHeader;
|
|
32
|
+
const List: typeof ActivityHistoryList;
|
|
33
|
+
const Row: typeof ActivityHistoryRow;
|
|
34
|
+
const Empty: typeof ActivityHistoryEmpty;
|
|
35
|
+
const ErrorView: typeof ActivityHistoryErrorView;
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { DepositHistoryList };
|
|
@@ -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{useDepositActivityHistorySource as n}from"./useDepositActivityHistorySource.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 DepositHistoryList};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./DepositHistoryDetail.js";import"./DepositHistoryList.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useDepositDriverInstance as e,useDepositSnapshot as t}from"../../driver/context.js";import{useLingui as n}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useDepositActions as r,useDepositEffectiveState as i}from"../../orchestrator/controller.js";import{defaultBlockExplorers as a}from"../../../../shared/utils/explorers.js";import{useCallback as o,useMemo as s}from"react";function c(){let c=t(),l=r(),u=e(),d=i(),{i18n:f}=n(),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=c.wallet,t=e.status===`ready`||e.status===`stale`?e.payload.address.value:`0x0000000000000000000000000000000000000000`,n=c.brand,r=n.status===`ready`||n.status===`stale`?n.payload.name:void 0,i={i18n:f,sourceWallet:{name:`Wallet`,address:t},explorers:a(),...r?{brandName:r}:{}};return{entity:c.history,refresh:p,selectSettlement:l.selectSettlement,back:l.back,...h===void 0?{}:{settlementId:h},settlementContext:i}},[c,l,m,h,f,p]),settlementId:h,step:d.name===`historyList`?`historyList`:d.name===`historyDetail`?`historyDetail`:`other`}}export{c as useDepositActivityHistorySource};
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { DialogShellControls } from "../../../../shared/dialog/DialogShell.js";
|
|
2
|
-
import {
|
|
2
|
+
import { AmountEntryBodyProps } from "../../../../shared/widgets/amount-entry/compound/types.js";
|
|
3
|
+
import { AmountEntryFlow } from "../../../../shared/widgets/amount-entry/compound/components/Flow.js";
|
|
4
|
+
import { AmountEntryFooter } from "../../../../shared/widgets/amount-entry/compound/components/Footer.js";
|
|
5
|
+
import { AmountEntryHeader } from "../../../../shared/widgets/amount-entry/compound/components/Header.js";
|
|
6
|
+
import { AmountEntryHero } from "../../../../shared/widgets/amount-entry/compound/components/Hero/Hero.js";
|
|
7
|
+
import { AmountEntryNotice } from "../../../../shared/widgets/amount-entry/compound/components/Notice.js";
|
|
8
|
+
import { AmountEntryPills } from "../../../../shared/widgets/amount-entry/compound/components/Pills.js";
|
|
9
|
+
import { ComponentProps, ReactNode } from "react";
|
|
3
10
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
11
|
|
|
5
12
|
//#region src/flows/deposit/widgets/amount-entry/AmountEntry.d.ts
|
|
@@ -14,11 +21,24 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
14
21
|
* minimum-deposit USD floor from the driver's `target` entity. Renders nothing on any other
|
|
15
22
|
* FSM state.
|
|
16
23
|
*
|
|
17
|
-
* Honors `target.payload.
|
|
24
|
+
* Honors `target.payload.minAmountUsd.value`: when the entered amount is below it, the footer
|
|
18
25
|
* CTA flips to "Update order" and clicking auto-snaps the amount up to the floor. The widget
|
|
19
26
|
* also prefills the entry to the floor on first render so the user starts at a valid amount.
|
|
20
27
|
*/
|
|
21
|
-
|
|
28
|
+
interface AmountEntryOwnProps {
|
|
29
|
+
/**
|
|
30
|
+
* Optional custom composition. Defaults to `<Header />` + `<Body><Hero /><Pills /><Flow />`
|
|
31
|
+
* + validation-notice slot `</Body>` + `<Footer />`. Pass children to interleave your own
|
|
32
|
+
* elements between compound parts. Note — the default composition embeds a runtime-driven
|
|
33
|
+
* `<NoticeSlot />` that surfaces validation hints (min / max / insufficient-balance); custom
|
|
34
|
+
* children replace it entirely.
|
|
35
|
+
*/
|
|
36
|
+
children?: ReactNode;
|
|
37
|
+
}
|
|
38
|
+
declare function AmountEntry({
|
|
39
|
+
children,
|
|
40
|
+
...props
|
|
41
|
+
}: ComponentProps<"div"> & AmountEntryOwnProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
22
42
|
declare function AmountEntryDialog({
|
|
23
43
|
open,
|
|
24
44
|
defaultOpen,
|
|
@@ -27,9 +47,16 @@ declare function AmountEntryDialog({
|
|
|
27
47
|
...rootProps
|
|
28
48
|
}: AmountEntry.DialogProps): _$react_jsx_runtime0.JSX.Element;
|
|
29
49
|
declare namespace AmountEntry {
|
|
30
|
-
type Props = ComponentProps<"div"
|
|
31
|
-
type DialogProps = ComponentProps<"div"> & DialogShellControls;
|
|
50
|
+
type Props = ComponentProps<"div"> & AmountEntryOwnProps;
|
|
51
|
+
type DialogProps = ComponentProps<"div"> & DialogShellControls & AmountEntryOwnProps;
|
|
32
52
|
const Dialog: typeof AmountEntryDialog;
|
|
53
|
+
const Header: typeof AmountEntryHeader;
|
|
54
|
+
const Body: (props: AmountEntryBodyProps) => _$react_jsx_runtime0.JSX.Element;
|
|
55
|
+
const Hero: typeof AmountEntryHero;
|
|
56
|
+
const Pills: typeof AmountEntryPills;
|
|
57
|
+
const Flow: typeof AmountEntryFlow;
|
|
58
|
+
const Footer: typeof AmountEntryFooter;
|
|
59
|
+
const Notice: typeof AmountEntryNotice;
|
|
33
60
|
}
|
|
34
61
|
//#endregion
|
|
35
62
|
export { AmountEntry };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useDepositSnapshot as
|
|
1
|
+
"use client";import{useDepositDriverInstance as e,useDepositSnapshot as t}from"../../driver/context.js";import{useKitI18n as n}from"../../../../shared/i18n/useKitI18n.js";import{Trans as r}from"../../../../shared/i18n/Trans.js";import{useLingui as i}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useDepositActions as a,useDepositEffectiveState as o}from"../../orchestrator/controller.js";import{formatTokenAmount as ee}from"../../../../shared/format/formatTokenAmount.js";import{useKitEmitter as te}from"../../../../events/emit/useKitEmitter.js";import"../../../../events/emit/index.js";import{DialogShell as s}from"../../../../shared/dialog/DialogShell.js";import{ActivityTrigger as c}from"../../../../shared/widgets/activity-history/ActivityTrigger.js";import"../../../../shared/widgets/activity-history/index.js";import{AmountEntry as l}from"../../../../shared/widgets/amount-entry/compound/AmountEntry.js";import"../../../../shared/widgets/amount-entry/compound/index.js";import{toAssetDescriptor as u}from"../../../../shared/widgets/asset-descriptor.js";import{effectiveMaxUsd as d,resolveFooterIntent as f}from"./footerIntent.js";import{useEffect as p,useRef as m,useState as h}from"react";import{Fragment as g,jsx as _,jsxs as v}from"react/jsx-runtime";const y=[{value:`25`,label:`25%`},{value:`50`,label:`50%`},{value:`75`,label:`75%`},{value:`max`,label:`Max`}];function b({children:r,...s}){let b=t(),C=o(),{confirmAmount:w,back:T,openHistory:E}=a(),D=typeof e().refreshHistory==`function`,{_:O}=i(),k=n(),A=b.target,j=A.status===`ready`||A.status===`stale`?A.payload:void 0,M=C.name===`amountEntry`?C.ctx.asset:void 0,N=M?.amountUsd?.value??0,P=j?.minAmountUsd?.value,F=j?.minAmountUsd?.formatted,I=j?.maxAmountUsd?.value,L=j?.maxAmountUsd?.formatted,R=d(N,I),z=M?.priceUsd,[B,V]=h(P??null),[H,U]=h(),W=te(),G=e=>{W({type:`deposit.amount.changed`,flow:`deposit`,tier:`ui`,payload:{raw:e===null?``:String(e),numeric:e}})},K=m(void 0),q=M?`${M.eip155Id??``}:${M.address??``}`:void 0;p(()=>{q&&K.current!==q&&(K.current=q,typeof P==`number`&&(V(P),U(void 0)))},[q,P]);let J=e=>{U(e);let t=e===`max`?1:Number.parseInt(e,10)/100;if(Number.isFinite(t)){let n=R*t;V(n),G(n),e===`max`&&W({type:`deposit.max.clicked`,flow:`deposit`,tier:`ui`,payload:{}})}},Y=e=>{V(e),U(void 0),G(e)},X=f({amount:B,...P===void 0?{}:{minAmountUsd:P},...I===void 0?{}:{maxAmountUsd:I},walletBalanceUsd:N}),Z=()=>{if(X===`aboveBalance`||X===`aboveCap`){V(R),U(`max`);return}if(X===`belowMin`&&typeof P==`number`){V(P),U(void 0);return}B!==null&&w(z&&z>0?B/z:B)};if(C.name!==`amountEntry`||!M||!j)return null;let Q=C.ctx.backTarget===`closed`?void 0:T,ne=u(M)??{symbol:M.symbol},re=u(j)??{symbol:j.symbol},ie=`${ee((B??0)/1,k,{maxDecimals:5})} ${j.symbol}`,$=x(X,{updateOrder:O({id:`bOZXx5`,message:`Update order`}),depositMax:O({id:`9cCjMJ`,message:`Deposit max balance`})}),ae=S(X,L,F);return _(l,{...s,amount:B,sendToken:ne,receiveToken:re,max:R,...P===void 0?{}:{min:P},onAmountChange:Y,...Q?{onBack:Q}:{},subLineAmount:ie,presets:y,...H===void 0?{}:{activePreset:H},onPresetSelect:J,...$===void 0?{}:{footerLabel:$},onContinue:Z,notice:ae,...D?{headerTrailing:_(c,{onOpen:E})}:{},children:r??v(g,{children:[_(l.Header,{}),v(l.Body,{children:[_(l.Hero,{}),_(l.Pills,{}),_(l.Flow,{}),_(l.Notice,{})]}),_(l.Footer,{})]})})}function x(e,t){if(e===`aboveCap`||e===`belowMin`)return t.updateOrder;if(e===`aboveBalance`)return t.depositMax}function S(e,t,n){if(e===`aboveCap`&&t)return _(r,{id:`-I_tc5`,message:`Max {formattedCap}`,values:{formattedCap:t}});if(e===`aboveBalance`)return _(r,{id:`znqB4T`,message:`Insufficient balance`});if(e===`belowMin`&&n)return _(r,{id:`3eKjkO`,message:`{formattedMin} minimum deposit`,values:{formattedMin:n}})}function C({open:e,defaultOpen:t,onOpenChange:n,trigger:r,...i}){return _(s,{open:e,defaultOpen:t,onOpenChange:n,trigger:r,children:_(b,{...i})})}(function(e){e.Dialog=C,e.Header=l.Header,e.Body=l.Body,e.Hero=l.Hero,e.Pills=l.Pills,e.Flow=l.Flow,e.Footer=l.Footer,e.Notice=l.Notice})(b||={});export{b as AmountEntry};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){let{amount:r,minAmountUsd:i,maxAmountUsd:a,walletBalanceUsd:o}=e,s=t(o,a);return r!==null&&s>0&&r>s?n(o,a)?`aboveCap`:`aboveBalance`:typeof i==`number`&&i>0&&(r===null||r<i)?`belowMin`:`ready`}function t(e,t){return typeof t==`number`&&t>0?Math.min(e,t):e}function n(e,t){return typeof t==`number`&&t>0&&t<=e}export{t as effectiveMaxUsd,e as resolveFooterIntent};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { DialogShellControls } from "../../../../shared/dialog/DialogShell.js";
|
|
2
|
-
import {
|
|
2
|
+
import { AssetPickerBodyProps } from "../../../../shared/widgets/asset-picker/compound/types.js";
|
|
3
|
+
import { AssetPickerFooter } from "../../../../shared/widgets/asset-picker/compound/components/Footer.js";
|
|
4
|
+
import { AssetPickerHeader } from "../../../../shared/widgets/asset-picker/compound/components/Header.js";
|
|
5
|
+
import { AssetPickerList } from "../../../../shared/widgets/asset-picker/compound/components/List.js";
|
|
6
|
+
import { ComponentProps, ReactNode } from "react";
|
|
3
7
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
8
|
|
|
5
9
|
//#region src/flows/deposit/widgets/asset-picker/AssetPicker.d.ts
|
|
@@ -8,7 +12,17 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
8
12
|
* entity and the destination header title from `target`. Owns the selected-id state locally and
|
|
9
13
|
* routes the footer Continue through orchestrator's `confirmAsset`.
|
|
10
14
|
*/
|
|
11
|
-
|
|
15
|
+
interface AssetPickerOwnProps {
|
|
16
|
+
/**
|
|
17
|
+
* Optional custom composition. Defaults to `<Header />` + `<Body><List /></Body>` + `<Footer />`.
|
|
18
|
+
* Pass children to interleave your own elements between compound parts.
|
|
19
|
+
*/
|
|
20
|
+
children?: ReactNode;
|
|
21
|
+
}
|
|
22
|
+
declare function AssetPicker({
|
|
23
|
+
children,
|
|
24
|
+
...props
|
|
25
|
+
}: ComponentProps<"div"> & AssetPickerOwnProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
12
26
|
declare function AssetPickerDialog({
|
|
13
27
|
open,
|
|
14
28
|
defaultOpen,
|
|
@@ -17,9 +31,13 @@ declare function AssetPickerDialog({
|
|
|
17
31
|
...rootProps
|
|
18
32
|
}: AssetPicker.DialogProps): _$react_jsx_runtime0.JSX.Element;
|
|
19
33
|
declare namespace AssetPicker {
|
|
20
|
-
type Props = ComponentProps<"div"
|
|
21
|
-
type DialogProps = ComponentProps<"div"> & DialogShellControls;
|
|
34
|
+
type Props = ComponentProps<"div"> & AssetPickerOwnProps;
|
|
35
|
+
type DialogProps = ComponentProps<"div"> & DialogShellControls & AssetPickerOwnProps;
|
|
22
36
|
const Dialog: typeof AssetPickerDialog;
|
|
37
|
+
const Header: typeof AssetPickerHeader;
|
|
38
|
+
const Body: (props: AssetPickerBodyProps) => _$react_jsx_runtime0.JSX.Element;
|
|
39
|
+
const List: typeof AssetPickerList;
|
|
40
|
+
const Footer: typeof AssetPickerFooter;
|
|
23
41
|
}
|
|
24
42
|
//#endregion
|
|
25
43
|
export { AssetPicker };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useDepositSnapshot as
|
|
1
|
+
"use client";import{useDepositDriverInstance as e,useDepositSnapshot as t}from"../../driver/context.js";import{useDepositActions as n,useDepositEffectiveState as r}from"../../orchestrator/controller.js";import{DialogShell as i}from"../../../../shared/dialog/DialogShell.js";import{ActivityTrigger as a}from"../../../../shared/widgets/activity-history/ActivityTrigger.js";import"../../../../shared/widgets/activity-history/index.js";import{AssetPicker as o}from"../../../../shared/widgets/asset-picker/compound/AssetPicker.js";import"../../../../shared/widgets/asset-picker/compound/index.js";import{useMemo as s,useState as c}from"react";import{Fragment as l,jsx as u,jsxs as d}from"react/jsx-runtime";const f=d(l,{children:[u(o.Header,{}),u(o.Body,{children:u(o.List,{})}),u(o.Footer,{})]});function p({children:i,...l}){let d=t(),p=r(),{confirmAsset:g,back:_,openHistory:v}=n(),y=typeof e().refreshHistory==`function`,[b,x]=c(void 0),S=d.balances,C=S.status===`ready`||S.status===`stale`?S.payload:[],w=s(()=>C.map(m),[C]),T=s(()=>(e=>e!==void 0&&w.some(t=>t.id===e&&!t.disabled))(b)?b:w.find(e=>!e.disabled)?.id,[b,w]),E=d.target,D=E.status===`ready`||E.status===`stale`?E.payload:void 0;if(p.name!==`assetPicker`)return null;let O=p.ctx.backTarget===`closed`?void 0:_,k=()=>{if(!T)return;let e=C.find(e=>h(e)===T);e&&g(e)};return u(o,{...l,...D?{token:{symbol:D.symbol}}:{},...T?{selectedId:T}:{},onSelect:x,assets:w,...O?{onBack:O}:{},onContinue:k,...y?{headerTrailing:u(a,{onOpen:v})}:{},children:i??f})}function m(e){let t=h(e),n=`${e.amount.formatted} ${e.symbol}`,r=e.amountUsd?.formatted??`—`;return{id:t,symbol:e.symbol,chain:e.networkName,balance:e.amount.value,balanceFormatted:n,fiatFormatted:r,...e.eip155Id?{chainId:Number(e.eip155Id)}:{},...e.address?{contractAddress:e.address}:{},isNative:e.isNative,...e.assetLogoUrl?{logoUrl:e.assetLogoUrl}:{},...e.chainLogoUrl?{chainLogoUrl:e.chainLogoUrl}:{},decimals:e.decimals,...e.priceUsd===void 0?{}:{priceUsd:e.priceUsd},...e.lowBalance?{lowBalance:!0}:{},...e.disabled?{disabled:!0}:{}}}function h(e){return e.eip155Id?`${e.eip155Id}:${e.address||`native`}`:e.symbol.toLowerCase()}function g({open:e,defaultOpen:t,onOpenChange:n,trigger:r,...a}){return u(i,{open:e,defaultOpen:t,onOpenChange:n,trigger:r,children:u(p,{...a})})}(function(e){e.Dialog=g,e.Header=o.Header,e.Body=o.Body,e.List=o.List,e.Footer=o.Footer})(p||={});export{p as AssetPicker};
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
import { DialogShellControls } from "../../../../shared/dialog/DialogShell.js";
|
|
2
|
-
import {
|
|
2
|
+
import { ConfirmTransferBodyProps } from "../../../../shared/widgets/confirm-transfer/compound/types.js";
|
|
3
|
+
import { ConfirmTransferAmounts } from "../../../../shared/widgets/confirm-transfer/compound/components/Amounts.js";
|
|
4
|
+
import { ConfirmTransferBreakdown } from "../../../../shared/widgets/confirm-transfer/compound/components/Breakdown.js";
|
|
5
|
+
import { ConfirmTransferDisclaimer } from "../../../../shared/widgets/confirm-transfer/compound/components/Disclaimer.js";
|
|
6
|
+
import { ConfirmTransferFooter } from "../../../../shared/widgets/confirm-transfer/compound/components/Footer.js";
|
|
7
|
+
import { ConfirmTransferHeader } from "../../../../shared/widgets/confirm-transfer/compound/components/Header.js";
|
|
8
|
+
import { ConfirmTransferHero } from "../../../../shared/widgets/confirm-transfer/compound/components/Hero.js";
|
|
9
|
+
import { ConfirmTransferMeta } from "../../../../shared/widgets/confirm-transfer/compound/components/Meta.js";
|
|
10
|
+
import { ComponentProps, ReactNode } from "react";
|
|
3
11
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
12
|
|
|
5
13
|
//#region src/flows/deposit/widgets/confirm-deposit/ConfirmDeposit.d.ts
|
|
14
|
+
interface ConfirmDepositOwnProps {
|
|
15
|
+
/**
|
|
16
|
+
* Optional custom composition. When omitted, the canonical default composition renders —
|
|
17
|
+
* `<Header />` + `<Body>` containing `<Hero />` `<Meta />` `<Amounts />` `<Breakdown />`
|
|
18
|
+
* `<Disclaimer />` + `<Footer />`. Pass children to interleave your own elements between
|
|
19
|
+
* compound parts, drop parts you don't want, or replace the composition entirely.
|
|
20
|
+
*/
|
|
21
|
+
children?: ReactNode;
|
|
22
|
+
}
|
|
6
23
|
/**
|
|
7
24
|
* Orchestrated `ConfirmDeposit` widget. Reads the driver's `quote` entity for the transfer
|
|
8
25
|
* payload + breakdown + hero amount, the driver's `brand` entity for the title brand, the FSM's
|
|
@@ -14,7 +31,10 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
14
31
|
* USD figure (`amount × asset.priceUsd`) so the user doesn't see `$0` flash before the
|
|
15
32
|
* round-trip completes.
|
|
16
33
|
*/
|
|
17
|
-
declare function ConfirmDeposit(
|
|
34
|
+
declare function ConfirmDeposit({
|
|
35
|
+
children,
|
|
36
|
+
...props
|
|
37
|
+
}: ComponentProps<"div"> & ConfirmDepositOwnProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
18
38
|
declare function ConfirmDepositDialog({
|
|
19
39
|
open,
|
|
20
40
|
defaultOpen,
|
|
@@ -23,9 +43,22 @@ declare function ConfirmDepositDialog({
|
|
|
23
43
|
...rootProps
|
|
24
44
|
}: ConfirmDeposit.DialogProps): _$react_jsx_runtime0.JSX.Element;
|
|
25
45
|
declare namespace ConfirmDeposit {
|
|
26
|
-
type Props = ComponentProps<"div"
|
|
27
|
-
type DialogProps = ComponentProps<"div"> & DialogShellControls;
|
|
46
|
+
type Props = ComponentProps<"div"> & ConfirmDepositOwnProps;
|
|
47
|
+
type DialogProps = ComponentProps<"div"> & DialogShellControls & ConfirmDepositOwnProps;
|
|
28
48
|
const Dialog: typeof ConfirmDepositDialog;
|
|
49
|
+
/**
|
|
50
|
+
* Compound sub-parts exposed off the orchestrated widget so consumers can compose without
|
|
51
|
+
* importing the headless compound separately. Identity-equal to the parts on
|
|
52
|
+
* {@link ConfirmTransfer} from `@stridge/kit/deposit/compound`.
|
|
53
|
+
*/
|
|
54
|
+
const Header: typeof ConfirmTransferHeader;
|
|
55
|
+
const Body: (props: ConfirmTransferBodyProps) => _$react_jsx_runtime0.JSX.Element;
|
|
56
|
+
const Hero: typeof ConfirmTransferHero;
|
|
57
|
+
const Meta: typeof ConfirmTransferMeta;
|
|
58
|
+
const Amounts: typeof ConfirmTransferAmounts;
|
|
59
|
+
const Breakdown: typeof ConfirmTransferBreakdown;
|
|
60
|
+
const Disclaimer: typeof ConfirmTransferDisclaimer;
|
|
61
|
+
const Footer: typeof ConfirmTransferFooter;
|
|
29
62
|
}
|
|
30
63
|
//#endregion
|
|
31
64
|
export { ConfirmDeposit };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useDepositSnapshot as e}from"../../driver/context.js";import{useKitI18n as t}from"../../../../shared/i18n/useKitI18n.js";import{useLingui as n}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useDepositActions as r,useDepositEffectiveState as i,useDepositState as a}from"../../orchestrator/controller.js";import{formatDurationCoarse as o}from"../../../../shared/format/formatDurationCoarse.js";import{formatUsd as s}from"../../../../shared/format/formatUsd.js";import{
|
|
1
|
+
"use client";import{useDepositSnapshot as e}from"../../driver/context.js";import{useKitI18n as t}from"../../../../shared/i18n/useKitI18n.js";import{useLingui as n}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useDepositActions as r,useDepositEffectiveState as i,useDepositState as a}from"../../orchestrator/controller.js";import{formatDurationCoarse as o}from"../../../../shared/format/formatDurationCoarse.js";import{formatUsd as s}from"../../../../shared/format/formatUsd.js";import{useKitEmitter as c}from"../../../../events/emit/useKitEmitter.js";import"../../../../events/emit/index.js";import{DialogShell as l}from"../../../../shared/dialog/DialogShell.js";import{ConfirmTransfer as u}from"../../../../shared/widgets/confirm-transfer/compound/ConfirmTransfer.js";import"../../../../shared/widgets/confirm-transfer/compound/index.js";import{useQuoteCountdown as d}from"../../../../shared/quote/useQuoteCountdown.js";import"../../../../shared/quote/index.js";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";const h=m(f,{children:[p(u.Header,{}),m(u.Body,{children:[p(u.Hero,{}),p(u.Meta,{}),p(u.Amounts,{}),p(u.Breakdown,{}),p(u.Disclaimer,{})]}),p(u.Footer,{})]});function g({children:o,...l}){let f=e(),m=i(),g=a(),{confirmDeposit:y,back:x}=r(),{_:S}=n(),C=t(),w=c(),T=()=>{w({type:`deposit.confirm.clicked`,flow:`deposit`,tier:`ui`,payload:{}}),y()},E=f.quote,D=m.name===`confirmDeposit`?m.ctx.phase:void 0,O=f.target,k=f.wallet,A=g.name===`confirmDeposit`&&g.ctx.phase.kind===`ready`,j=d({expiresAt:D?.kind===`ready`?D.quoteExpiresAt:void 0,enabled:A});if(!D)return null;let M=D.kind===`loading`||D.kind===`regenerating`,N=v(f,O,k,C),P=b(f,{routeLabel:S({id:`rT8e1f`,message:`Route`}),networkCostLabel:S({id:`bZnukT`,message:`Network cost`}),priceImpactLabel:S({id:`kH6wUX`,message:`Price impact`}),maxSlippageLabel:S({id:`SZRUQ4`,message:`Max slippage`})}),F=`$0.00`;if(E.status===`ready`||E.status===`stale`)F=E.payload.heroAmountUsd.formatted;else if(g.name===`confirmDeposit`){let e=g.ctx.asset,t=g.ctx.amount,n=e?.priceUsd;F=s(typeof n==`number`&&Number.isFinite(n)&&n>0?t*n:t,C)}let I=E.status===`ready`||E.status===`stale`?E.payload.quoteTotalSeconds:30,L=j,R=_(D),z=D.kind===`failed`?D.failure:void 0,B=D.kind===`regenerating`?D.notice:void 0,V=O.status===`ready`||O.status===`stale`?O.payload:void 0,H=f.brand.status===`ready`||f.brand.status===`stale`?f.brand.payload:void 0,U=V&&H?.name?S({id:`zbtijb`,message:`Deposit {0} to {1}`,values:{0:V.symbol,1:H.name}}):void 0;return p(u,{...l,transfer:N,breakdown:P,heroAmountUsd:F,loading:M,phase:R,...B?{notice:B}:{},...z?{error:{message:z.reason,...z.code?{code:z.code}:{}}}:{},...L===void 0?{}:{quoteSeconds:L},quoteTotalSeconds:I,...U?{headerTitle:U}:{},onBack:x,onConfirm:T,children:o??h})}function _(e){switch(e.kind){case`loading`:return`loading`;case`ready`:return`ready`;case`regenerating`:return`regenerating`;case`submitting`:return`submitting`;case`failed`:return`error`}}function v(e,t,n,r){let i=e.quote,a=i.status===`ready`||i.status===`stale`?i.payload:void 0,s=t.status===`ready`||t.status===`stale`?t.payload:void 0,c=n.status===`ready`||n.status===`stale`?n.payload:void 0,l=e.brand.status===`ready`||e.brand.status===`stale`?e.brand.payload:void 0,u=a?.sendAsset,d=a?.receiveAsset??s,f=l?.name?`${l.name} Account`:`Account`,p=a?.etaSeconds===void 0?`—`:o(a.etaSeconds*1e3,r);return{sourceLabel:c?`Wallet (${c.address.formatted})`:`Wallet`,destinationLabel:f,eta:p,sendAmount:a?a.sendAmount.formatted:`0`,sendToken:u?y(u):{symbol:`—`},receiveAmount:a?a.receiveAmount.formatted:`0`,receiveToken:d?y(d):{symbol:s?.symbol??`—`}}}function y(e){return{symbol:e.symbol,...e.chainId===void 0?{}:{chainId:e.chainId},...e.address?{address:e.address}:{},...e.isNative===void 0?{}:{isNative:e.isNative},...e.assetLogoUrl?{logoUrl:e.assetLogoUrl}:{}}}function b(e,t){let n=e.quote,r=n.status===`ready`||n.status===`stale`?n.payload:void 0;if(!r?.breakdown)return{};let i=r.breakdown,a={};return i.selectedRoute&&(a.selectedRoute={label:t.routeLabel,value:i.selectedRoute.label}),i.networkCost&&(a.networkCost={label:t.networkCostLabel,valueUsd:i.networkCost.formatted}),i.priceImpact&&(a.priceImpact={label:t.priceImpactLabel,valuePercent:i.priceImpact.formatted}),i.maxSlippage&&(a.maxSlippage={label:t.maxSlippageLabel,valuePercent:i.maxSlippage.value.formatted,auto:i.maxSlippage.auto}),a}function x({open:e,defaultOpen:t,onOpenChange:n,trigger:r,...i}){return p(l,{open:e,defaultOpen:t,onOpenChange:n,trigger:r,children:p(g,{...i})})}(function(e){e.Dialog=x,e.Header=u.Header,e.Body=u.Body,e.Hero=u.Hero,e.Meta=u.Meta,e.Amounts=u.Amounts,e.Breakdown=u.Breakdown,e.Disclaimer=u.Disclaimer,e.Footer=u.Footer})(g||={});export{g as ConfirmDeposit};
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { DialogShellControls } from "../../../../shared/dialog/DialogShell.js";
|
|
2
|
-
import {
|
|
2
|
+
import { DepositBodyProps } from "./compound/types.js";
|
|
3
|
+
import { DepositHeader } from "./compound/components/Header.js";
|
|
4
|
+
import { DepositMethod } from "./compound/components/Method.js";
|
|
5
|
+
import { DepositMethods } from "./compound/components/Methods.js";
|
|
6
|
+
import { DepositSteps } from "./compound/components/Steps.js";
|
|
7
|
+
import { Deposit as Deposit$1 } from "./compound/Deposit.js";
|
|
8
|
+
import { ComponentProps, ReactNode } from "react";
|
|
3
9
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
10
|
|
|
5
11
|
//#region src/flows/deposit/widgets/deposit/Deposit.d.ts
|
|
@@ -13,7 +19,19 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
13
19
|
* bar while `wallet.balanceTotalUsd` resolves, and the Transfer Crypto tile's chain stack is
|
|
14
20
|
* driven by whatever rows the driver has surfaced so far.
|
|
15
21
|
*/
|
|
16
|
-
|
|
22
|
+
interface DepositOwnProps {
|
|
23
|
+
/**
|
|
24
|
+
* Optional custom composition. When omitted, the canonical default composition renders —
|
|
25
|
+
* `<Header />` + `<Body>` containing `<Methods />`. Pass children to interleave your own
|
|
26
|
+
* elements between compound parts, drop parts you don't want, or replace the composition
|
|
27
|
+
* entirely.
|
|
28
|
+
*/
|
|
29
|
+
children?: ReactNode;
|
|
30
|
+
}
|
|
31
|
+
declare function Deposit({
|
|
32
|
+
children,
|
|
33
|
+
...props
|
|
34
|
+
}: ComponentProps<"div"> & DepositOwnProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
17
35
|
declare function DepositDialog({
|
|
18
36
|
open,
|
|
19
37
|
defaultOpen,
|
|
@@ -22,9 +40,20 @@ declare function DepositDialog({
|
|
|
22
40
|
...rootProps
|
|
23
41
|
}: Deposit.DialogProps): _$react_jsx_runtime0.JSX.Element;
|
|
24
42
|
declare namespace Deposit {
|
|
25
|
-
type Props = ComponentProps<"div"
|
|
26
|
-
type DialogProps = ComponentProps<"div"> & DialogShellControls;
|
|
43
|
+
type Props = ComponentProps<"div"> & DepositOwnProps;
|
|
44
|
+
type DialogProps = ComponentProps<"div"> & DialogShellControls & DepositOwnProps;
|
|
27
45
|
const Dialog: typeof DepositDialog;
|
|
46
|
+
/**
|
|
47
|
+
* Compound sub-parts aliased on the orchestrated widget so consumers can compose without
|
|
48
|
+
* importing the headless compound separately. Identity-equal to the parts on the compound
|
|
49
|
+
* exported from `@stridge/kit/deposit/compound`.
|
|
50
|
+
*/
|
|
51
|
+
const Header: typeof DepositHeader;
|
|
52
|
+
const Body: (props: DepositBodyProps) => _$react_jsx_runtime0.JSX.Element;
|
|
53
|
+
const Methods: typeof DepositMethods;
|
|
54
|
+
const Method: typeof DepositMethod;
|
|
55
|
+
const Steps: typeof DepositSteps;
|
|
56
|
+
const Step: typeof Deposit$1.Step;
|
|
28
57
|
}
|
|
29
58
|
//#endregion
|
|
30
59
|
export { Deposit };
|
|
@@ -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{QrCodeIcon as
|
|
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,useDepositMethodsConfig as i}from"../../orchestrator/controller.js";import{QrCodeIcon as a}from"../../../../shared/icons/QrCodeIcon.js";import{WalletIcon as o}from"../../../../shared/icons/WalletIcon.js";import"../../../../icons/index.js";import{DialogShell as s}from"../../../../shared/dialog/DialogShell.js";import{Image as c}from"../../../../shared/ui/Image/Image.js";import{Skeleton as l}from"../../../../shared/ui/Skeleton/Skeleton.js";import"../../../../shared/ui/Skeleton/index.js";import{TokenLogo as u}from"../../../../shared/ui/TokenLogo/TokenLogo.js";import"../../../../shared/ui/TokenLogo/index.js";import"../../../../ui/index.js";import{Deposit as d}from"./compound/Deposit.js";import"./compound/index.js";import{useMemo as f}from"react";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";const g={width:18,height:18,"aria-hidden":!0},_=h(p,{children:[m(d.Header,{}),m(d.Body,{children:m(d.Methods,{})})]});function v({children:s,...c}){let u=e(),p=r().name,{selectMethod:h}=n(),v=i(),{_:b}=t(),x=u.wallet,S=x.status===`ready`||x.status===`stale`?x.payload:void 0,C=S!==void 0,w=u.brand,T=w.status===`ready`||w.status===`stale`?w.payload:void 0,E=u.addresses,D=E.status===`ready`||E.status===`stale`?E.payload:[],O=u.balances.status===`error`,k=!S?.balanceTotalUsd?.formatted&&!O,A=!!u.brand,j=T?.name?b({id:`ogD_nm`,message:`Deposit to {0}`,values:{0:T.name}}):void 0,M=f(()=>y(D),[D]),N=v?.wallet,P=v?.transfer,F=f(()=>{let e=!C||k,t=N?.disabled??!1,n=e||t,r=t?N?.disabledHint:void 0,i=(()=>{if(t)return r;if(!C)return b({id:`5AApJw`,message:`Connect a wallet to continue`});if(S?.balanceTotalUsd?.formatted)return S.balanceTotalUsd.formatted;if(!O)return m(l,{width:56,height:12})})(),s=[{id:`wallet`,title:b({id:`sb9Y58`,message:`Wallet`}),icon:m(o,{...g}),...S&&!t?{titleAdornment:S.address.formatted}:{},...i===void 0?{}:{meta:i},recommended:!0,disabled:n,onSelect:n?void 0:()=>h(`wallet`)}];if(A){let e=P?.disabled??!1,t=e?P?.disabledHint:void 0,n=e?t:[b({id:`qtoOYG`,message:`No limit`}),b({id:`D79cZK`,message:`Instant`})];s.push({id:`transfer`,title:b({id:`3dqPLT`,message:`Transfer Crypto`}),icon:m(a,{...g}),...n===void 0?{}:{meta:n},...M?{trailing:M}:{},disabled:e,onSelect:e?void 0:()=>h(`transfer`)})}return s},[S,O,k,C,A,M,N,P,h,b]);return p===`deposit`?m(d,{...c,...j?{title:j}:{},methods:F,children:s??_}):null}function y(e){if(e.length!==0)return m(c.Group,{max:4,overflow:Math.max(0,e.length-4),size:`md`,children:e.map(e=>m(u,{isNative:!0,symbol:e.networkName,...e.eip155Id?{chainId:Number(e.eip155Id)}:{},...e.chainLogoUrl?{logoUrl:e.chainLogoUrl}:{},hideChainBadge:!0},e.eip155Id??e.networkName))})}function b({open:e,defaultOpen:t,onOpenChange:n,trigger:r,...i}){return m(s,{open:e,defaultOpen:t,onOpenChange:n,trigger:r,children:m(v,{...i})})}(function(e){e.Dialog=b,e.Header=d.Header,e.Body=d.Body,e.Methods=d.Methods,e.Method=d.Method,e.Steps=d.Steps,e.Step=d.Step})(v||={});export{v as Deposit};
|