@stridge/kit 0.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/KitProvider.d.ts +91 -0
- package/dist/KitProvider.js +1 -0
- package/dist/_internal/deposit/driver/index.d.ts +5 -0
- package/dist/_internal/deposit/driver/index.js +1 -0
- package/dist/_internal/deposit/widgets/index.d.ts +11 -0
- package/dist/_internal/deposit/widgets/index.js +1 -0
- package/dist/_internal/drivers/stridge/index.d.ts +6 -0
- package/dist/_internal/drivers/stridge/index.js +1 -0
- package/dist/_internal/drivers/stridge-mock/index.d.ts +5 -0
- package/dist/_internal/drivers/stridge-mock/index.js +1 -0
- package/dist/_internal/index.d.ts +2 -0
- package/dist/_internal/index.js +1 -0
- package/dist/_internal/withdraw/driver/index.d.ts +6 -0
- package/dist/_internal/withdraw/driver/index.js +1 -0
- package/dist/_internal/withdraw/widgets/index.d.ts +5 -0
- package/dist/_internal/withdraw/widgets/index.js +1 -0
- package/dist/banners/index.d.ts +1 -0
- package/dist/banners/index.js +1 -0
- package/dist/banners/useBannerAck.d.ts +61 -0
- package/dist/banners/useBannerAck.js +1 -0
- package/dist/deposit/compound/index.d.ts +28 -0
- package/dist/deposit/compound/index.js +1 -0
- package/dist/deposit/dialog/index.d.ts +2 -0
- package/dist/deposit/dialog/index.js +1 -0
- package/dist/drivers/stridge/createStridgeDepositDriver.d.ts +29 -0
- package/dist/drivers/stridge/createStridgeDepositDriver.js +1 -0
- package/dist/drivers/stridge/createStridgeWithdrawDriver.d.ts +113 -0
- package/dist/drivers/stridge/createStridgeWithdrawDriver.js +1 -0
- package/dist/drivers/stridge/internal/encoding.js +1 -0
- package/dist/drivers/stridge/internal/env.js +1 -0
- package/dist/drivers/stridge/internal/metadata.js +1 -0
- package/dist/drivers/stridge/internal/pollOnce.js +1 -0
- package/dist/drivers/stridge/internal/signAndConfirm.js +1 -0
- package/dist/drivers/stridge/poll.js +1 -0
- package/dist/drivers/stridge/rpc.d.ts +77 -0
- package/dist/drivers/stridge/rpc.js +1 -0
- package/dist/drivers/stridge/types.d.ts +145 -0
- package/dist/drivers/stridge/types.js +1 -0
- package/dist/drivers/stridge/wagmiSigner.js +1 -0
- package/dist/drivers/stridge-mock/createStridgeMockDriver.d.ts +120 -0
- package/dist/drivers/stridge-mock/createStridgeMockDriver.js +1 -0
- package/dist/drivers/stridge-mock/createStridgeMockWithdrawDriver.d.ts +118 -0
- package/dist/drivers/stridge-mock/createStridgeMockWithdrawDriver.js +1 -0
- package/dist/drivers/stridge-mock/fixtures.d.ts +127 -0
- package/dist/drivers/stridge-mock/fixtures.js +1 -0
- package/dist/drivers/stridge-mock/store.js +1 -0
- package/dist/drivers/stridge-mock/triggers.d.ts +41 -0
- package/dist/flows/deposit/dialog/DepositBootstrapErrorState.js +1 -0
- package/dist/flows/deposit/dialog/DepositBootstrapErrorState.styles.js +1 -0
- package/dist/flows/deposit/dialog/DepositDialog.d.ts +112 -0
- package/dist/flows/deposit/dialog/DepositDialog.js +1 -0
- package/dist/flows/deposit/driver/context.d.ts +37 -0
- package/dist/flows/deposit/driver/context.js +1 -0
- package/dist/flows/deposit/driver/payloads.d.ts +342 -0
- package/dist/flows/deposit/driver/transformers/balanceToBalancesPayload.js +1 -0
- package/dist/flows/deposit/driver/transformers/quoteToPayload.js +1 -0
- package/dist/flows/deposit/driver/transformers/settlementToPayload.js +1 -0
- package/dist/flows/deposit/driver/transformers/startToAddressesPayload.js +1 -0
- package/dist/flows/deposit/driver/transformers/startToBrandPayload.js +1 -0
- package/dist/flows/deposit/driver/transformers/startToTargetPayload.js +1 -0
- package/dist/flows/deposit/driver/transformers/walletAddressToWalletPayload.js +1 -0
- package/dist/flows/deposit/driver/types.d.ts +177 -0
- package/dist/flows/deposit/orchestrator/controller.d.ts +11 -0
- package/dist/flows/deposit/orchestrator/controller.js +1 -0
- package/dist/flows/deposit/orchestrator/reducer.js +1 -0
- package/dist/flows/deposit/orchestrator/resolveAssetById.js +1 -0
- package/dist/flows/deposit/orchestrator/steps.d.ts +23 -0
- package/dist/flows/deposit/orchestrator/steps.js +1 -0
- package/dist/flows/deposit/orchestrator/types.d.ts +266 -0
- package/dist/flows/deposit/orchestrator/useDeposit.d.ts +35 -0
- package/dist/flows/deposit/orchestrator/useDeposit.js +1 -0
- package/dist/flows/deposit/widgets/amount-entry/AmountEntry.d.ts +35 -0
- package/dist/flows/deposit/widgets/amount-entry/AmountEntry.js +1 -0
- package/dist/flows/deposit/widgets/amount-entry/index.d.ts +1 -0
- package/dist/flows/deposit/widgets/amount-entry/index.js +1 -0
- package/dist/flows/deposit/widgets/asset-picker/AssetPicker.d.ts +25 -0
- package/dist/flows/deposit/widgets/asset-picker/AssetPicker.js +1 -0
- package/dist/flows/deposit/widgets/asset-picker/index.d.ts +1 -0
- package/dist/flows/deposit/widgets/asset-picker/index.js +1 -0
- package/dist/flows/deposit/widgets/confirm-deposit/ConfirmDeposit.d.ts +31 -0
- package/dist/flows/deposit/widgets/confirm-deposit/ConfirmDeposit.js +1 -0
- package/dist/flows/deposit/widgets/confirm-deposit/index.d.ts +1 -0
- package/dist/flows/deposit/widgets/confirm-deposit/index.js +1 -0
- package/dist/flows/deposit/widgets/deposit/Deposit.d.ts +30 -0
- package/dist/flows/deposit/widgets/deposit/Deposit.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/Deposit.d.ts +51 -0
- package/dist/flows/deposit/widgets/deposit/compound/Deposit.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/Deposit.slots.d.ts +11 -0
- package/dist/flows/deposit/widgets/deposit/compound/Deposit.slots.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/Deposit.styles.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Header.d.ts +15 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Header.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Method.d.ts +32 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Method.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Methods.d.ts +23 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Methods.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/context.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/index.d.ts +3 -0
- package/dist/flows/deposit/widgets/deposit/compound/index.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/types.d.ts +129 -0
- package/dist/flows/deposit/widgets/deposit/index.d.ts +1 -0
- package/dist/flows/deposit/widgets/deposit/index.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/DepositStatusBanner.d.ts +20 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/DepositStatusBanner.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/DepositStatusBanner.d.ts +102 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/DepositStatusBanner.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/DepositStatusBanner.slots.d.ts +20 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/DepositStatusBanner.slots.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/DepositStatusBanner.styles.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Body.d.ts +17 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Body.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Close.d.ts +13 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Close.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Detail.d.ts +14 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Detail.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Details.d.ts +20 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Details.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Footer.d.ts +17 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Footer.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Hero.d.ts +17 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Hero.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/PrimaryAction.d.ts +26 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/PrimaryAction.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Rows.d.ts +35 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Rows.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Toggle.d.ts +18 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Toggle.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/context.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/index.d.ts +3 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/index.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/types.d.ts +188 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/index.d.ts +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/index.js +1 -0
- package/dist/flows/deposit/widgets/error-state/ErrorState.d.ts +30 -0
- package/dist/flows/deposit/widgets/error-state/ErrorState.js +1 -0
- package/dist/flows/deposit/widgets/error-state/index.d.ts +1 -0
- package/dist/flows/deposit/widgets/error-state/index.js +1 -0
- package/dist/flows/deposit/widgets/processing-state/ProcessingState.d.ts +31 -0
- package/dist/flows/deposit/widgets/processing-state/ProcessingState.js +1 -0
- package/dist/flows/deposit/widgets/processing-state/index.d.ts +1 -0
- package/dist/flows/deposit/widgets/processing-state/index.js +1 -0
- package/dist/flows/deposit/widgets/success-state/SuccessState.d.ts +30 -0
- package/dist/flows/deposit/widgets/success-state/SuccessState.js +1 -0
- package/dist/flows/deposit/widgets/success-state/index.d.ts +1 -0
- package/dist/flows/deposit/widgets/success-state/index.js +1 -0
- package/dist/flows/deposit/widgets/transfer-crypto/TransferCrypto.d.ts +41 -0
- package/dist/flows/deposit/widgets/transfer-crypto/TransferCrypto.js +1 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/TransferCrypto.d.ts +56 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/TransferCrypto.js +1 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/TransferCrypto.slots.d.ts +15 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/TransferCrypto.slots.js +1 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/TransferCrypto.styles.js +1 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Address.d.ts +10 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Address.js +1 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Disclosure.d.ts +17 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Disclosure.js +1 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Header.d.ts +15 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Header.js +1 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/InfoTooltip.js +1 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/QrCode.d.ts +21 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/QrCode.js +1 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Selectors.d.ts +11 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Selectors.js +1 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Summary.d.ts +11 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Summary.js +1 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/context.js +1 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/index.d.ts +3 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/index.js +1 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/types.d.ts +187 -0
- package/dist/flows/deposit/widgets/transfer-crypto/index.d.ts +1 -0
- package/dist/flows/deposit/widgets/transfer-crypto/index.js +1 -0
- package/dist/flows/shared/transformers/classifySettlementStatus.js +1 -0
- package/dist/flows/shared/transformers/computeQuoteAttrs.js +1 -0
- package/dist/flows/shared/transformers/parseIsoMs.js +1 -0
- package/dist/flows/shared/transformers/parseSmallestUnit.js +1 -0
- package/dist/flows/shared/transformers/pickRelevantSettlement.js +1 -0
- package/dist/flows/withdraw/dialog/WithdrawDialog.d.ts +103 -0
- package/dist/flows/withdraw/dialog/WithdrawDialog.js +1 -0
- package/dist/flows/withdraw/dialog/WithdrawDialogEventsContext.d.ts +36 -0
- package/dist/flows/withdraw/dialog/WithdrawDialogEventsContext.js +1 -0
- package/dist/flows/withdraw/driver/context.d.ts +24 -0
- package/dist/flows/withdraw/driver/context.js +1 -0
- package/dist/flows/withdraw/driver/dto.d.ts +41 -0
- package/dist/flows/withdraw/driver/payloads.d.ts +206 -0
- package/dist/flows/withdraw/driver/transformers/balanceToWithdrawableBalancesPayload.js +1 -0
- package/dist/flows/withdraw/driver/transformers/quoteToWithdrawalPayload.js +1 -0
- package/dist/flows/withdraw/driver/transformers/settlementToWithdrawalPayload.js +1 -0
- package/dist/flows/withdraw/driver/transformers/supportedAssetsToReceiveOptionsPayload.js +1 -0
- package/dist/flows/withdraw/driver/types.d.ts +133 -0
- package/dist/flows/withdraw/orchestrator/controller.d.ts +11 -0
- package/dist/flows/withdraw/orchestrator/controller.js +1 -0
- package/dist/flows/withdraw/orchestrator/index.d.ts +4 -0
- package/dist/flows/withdraw/orchestrator/index.js +1 -0
- package/dist/flows/withdraw/orchestrator/reducer.js +1 -0
- package/dist/flows/withdraw/orchestrator/types.d.ts +156 -0
- package/dist/flows/withdraw/orchestrator/useWithdraw.d.ts +23 -0
- package/dist/flows/withdraw/orchestrator/useWithdraw.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-error/WithdrawError.d.ts +22 -0
- package/dist/flows/withdraw/widgets/withdraw-error/WithdrawError.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-error/index.d.ts +1 -0
- package/dist/flows/withdraw/widgets/withdraw-error/index.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/WithdrawForm.d.ts +29 -0
- package/dist/flows/withdraw/widgets/withdraw-form/WithdrawForm.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/WithdrawForm.d.ts +55 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/WithdrawForm.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/WithdrawForm.slots.d.ts +31 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/WithdrawForm.slots.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/WithdrawForm.styles.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/AmountField.d.ts +12 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/AmountField.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Body.d.ts +20 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Body.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/BreakdownCard.d.ts +17 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/BreakdownCard.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Footer.d.ts +18 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Footer.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Header.d.ts +21 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Header.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/InfoTooltip.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/ReceiveSelectors.d.ts +13 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/ReceiveSelectors.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/RecipientField.d.ts +19 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/RecipientField.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/context.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/index.d.ts +3 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/index.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/types.d.ts +149 -0
- package/dist/flows/withdraw/widgets/withdraw-form/index.d.ts +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/index.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/validation.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-in-progress/WithdrawInProgress.d.ts +19 -0
- package/dist/flows/withdraw/widgets/withdraw-in-progress/WithdrawInProgress.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-in-progress/index.d.ts +1 -0
- package/dist/flows/withdraw/widgets/withdraw-in-progress/index.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-success/WithdrawSuccess.d.ts +20 -0
- package/dist/flows/withdraw/widgets/withdraw-success/WithdrawSuccess.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-success/index.d.ts +1 -0
- package/dist/flows/withdraw/widgets/withdraw-success/index.js +1 -0
- package/dist/format/index.d.ts +10 -0
- package/dist/format/index.js +1 -0
- package/dist/i18n/index.d.ts +9 -0
- package/dist/i18n/index.js +1 -0
- package/dist/i18n/locales/ar.d.ts +6 -0
- package/dist/i18n/locales/ar.js +1 -0
- package/dist/i18n/locales/es.d.ts +6 -0
- package/dist/i18n/locales/es.js +1 -0
- package/dist/icons/index.d.ts +27 -0
- package/dist/icons/index.js +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +1 -0
- package/dist/kit/package.js +1 -0
- package/dist/scope/KitPortalScope.d.ts +31 -0
- package/dist/scope/KitPortalScope.js +1 -0
- package/dist/scope/KitScope.d.ts +63 -0
- package/dist/scope/KitScope.js +1 -0
- package/dist/scope/KitScope.slots.js +1 -0
- package/dist/scope/context.d.ts +67 -0
- package/dist/scope/context.js +1 -0
- package/dist/scope/index.d.ts +3 -0
- package/dist/scope/index.js +1 -0
- package/dist/shared/chains/index.d.ts +40 -0
- package/dist/shared/chains/index.js +1 -0
- package/dist/shared/constants/brand-links.js +1 -0
- package/dist/shared/dialog/DialogShell.d.ts +63 -0
- package/dist/shared/dialog/DialogShell.js +1 -0
- package/dist/shared/dialog/Frame.js +1 -0
- package/dist/shared/dialog/GatewayKitRoot.js +1 -0
- package/dist/shared/dialog/StepTransition.js +1 -0
- package/dist/shared/dialog/useDirectionalChevronTransform.js +1 -0
- package/dist/shared/driver/types.d.ts +69 -0
- package/dist/shared/error-handling/components/GatewayKitBoundary.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitErrorCard/GatewayKitErrorCard.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitErrorCard/GatewayKitErrorCard.slots.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitErrorCard/GatewayKitErrorCard.styles.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitErrorCard/components/Action.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitErrorCard/components/Actions.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitErrorCard/components/CodeSample.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitErrorCard/components/Description.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitErrorCard/components/DetailRow.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitErrorCard/components/Guidance.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitErrorCard/components/Section.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitErrorCard/components/TechnicalDetails.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitErrorCard/components/TechnicalDetailsToggle.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitErrorCard/components/Title.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitErrorCard/context.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitErrorCard/index.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitRecoveryError.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitSetupError.js +1 -0
- package/dist/shared/error-handling/constants/guides.js +1 -0
- package/dist/shared/error-handling/constants/snippets.js +6 -0
- package/dist/shared/error-handling/index.js +1 -0
- package/dist/shared/error-handling/lib/isWagmiProviderMissingError.js +1 -0
- package/dist/shared/format/formatDurationCoarse.d.ts +29 -0
- package/dist/shared/format/formatDurationCoarse.js +1 -0
- package/dist/shared/format/formatDurationCompact.d.ts +28 -0
- package/dist/shared/format/formatDurationCompact.js +1 -0
- package/dist/shared/format/formatNetworkName.d.ts +27 -0
- package/dist/shared/format/formatNetworkName.js +1 -0
- package/dist/shared/format/formatPercent.d.ts +23 -0
- package/dist/shared/format/formatPercent.js +1 -0
- package/dist/shared/format/formatTimestamp.d.ts +22 -0
- package/dist/shared/format/formatTimestamp.js +1 -0
- package/dist/shared/format/formatTokenAmount.d.ts +46 -0
- package/dist/shared/format/formatTokenAmount.js +1 -0
- package/dist/shared/format/formatUsd.d.ts +41 -0
- package/dist/shared/format/formatUsd.js +1 -0
- package/dist/shared/format/shortenAddress.d.ts +27 -0
- package/dist/shared/format/shortenAddress.js +1 -0
- package/dist/shared/format/types.d.ts +33 -0
- package/dist/shared/i18n/KitI18nProvider.d.ts +23 -0
- package/dist/shared/i18n/KitI18nProvider.js +1 -0
- package/dist/shared/i18n/Trans.d.ts +39 -0
- package/dist/shared/i18n/Trans.js +1 -0
- package/dist/shared/i18n/createKitI18n.d.ts +41 -0
- package/dist/shared/i18n/createKitI18n.js +1 -0
- package/dist/shared/i18n/defaultI18n.js +1 -0
- package/dist/shared/i18n/getLocaleDirection.d.ts +24 -0
- package/dist/shared/i18n/getLocaleDirection.js +1 -0
- package/dist/shared/i18n/locales.d.ts +31 -0
- package/dist/shared/i18n/locales.js +1 -0
- package/dist/shared/i18n/useKitI18n.d.ts +14 -0
- package/dist/shared/i18n/useKitI18n.js +1 -0
- package/dist/shared/i18n/useLingui.d.ts +35 -0
- package/dist/shared/i18n/useLingui.js +1 -0
- package/dist/shared/i18n/useT.d.ts +25 -0
- package/dist/shared/i18n/useT.js +1 -0
- package/dist/shared/icons/AlertIcon.d.ts +12 -0
- package/dist/shared/icons/AlertIcon.js +1 -0
- package/dist/shared/icons/ArrowDownIcon.d.ts +7 -0
- package/dist/shared/icons/ArrowDownIcon.js +1 -0
- package/dist/shared/icons/ArrowRightIcon.d.ts +7 -0
- package/dist/shared/icons/ArrowRightIcon.js +1 -0
- package/dist/shared/icons/ArrowRightLeftIcon.d.ts +7 -0
- package/dist/shared/icons/ArrowRightLeftIcon.js +1 -0
- package/dist/shared/icons/CheckIcon.d.ts +7 -0
- package/dist/shared/icons/CheckIcon.js +1 -0
- package/dist/shared/icons/ChevronDownIcon.d.ts +7 -0
- package/dist/shared/icons/ChevronDownIcon.js +1 -0
- package/dist/shared/icons/ChevronLeftIcon.d.ts +7 -0
- package/dist/shared/icons/ChevronLeftIcon.js +1 -0
- package/dist/shared/icons/ChevronRightIcon.d.ts +7 -0
- package/dist/shared/icons/ChevronRightIcon.js +1 -0
- package/dist/shared/icons/ChevronUpIcon.d.ts +7 -0
- package/dist/shared/icons/ChevronUpIcon.js +1 -0
- package/dist/shared/icons/CircleArrowUpIcon.d.ts +7 -0
- package/dist/shared/icons/CircleArrowUpIcon.js +1 -0
- package/dist/shared/icons/CircleHelpIcon.d.ts +7 -0
- package/dist/shared/icons/CircleHelpIcon.js +1 -0
- package/dist/shared/icons/ClockIcon.d.ts +7 -0
- package/dist/shared/icons/ClockIcon.js +1 -0
- package/dist/shared/icons/CopyIcon.d.ts +7 -0
- package/dist/shared/icons/CopyIcon.js +1 -0
- package/dist/shared/icons/ExternalLinkIcon.d.ts +7 -0
- package/dist/shared/icons/ExternalLinkIcon.js +1 -0
- package/dist/shared/icons/InfoIcon.d.ts +7 -0
- package/dist/shared/icons/InfoIcon.js +1 -0
- package/dist/shared/icons/LoaderIcon.d.ts +7 -0
- package/dist/shared/icons/LoaderIcon.js +1 -0
- package/dist/shared/icons/MailIcon.d.ts +7 -0
- package/dist/shared/icons/MailIcon.js +1 -0
- package/dist/shared/icons/PackageIcon.d.ts +7 -0
- package/dist/shared/icons/PackageIcon.js +1 -0
- package/dist/shared/icons/QrCodeIcon.d.ts +7 -0
- package/dist/shared/icons/QrCodeIcon.js +1 -0
- package/dist/shared/icons/WalletIcon.d.ts +7 -0
- package/dist/shared/icons/WalletIcon.js +1 -0
- package/dist/shared/icons/XIcon.d.ts +7 -0
- package/dist/shared/icons/XIcon.js +1 -0
- package/dist/shared/icons/exchanges/BinanceIcon.d.ts +7 -0
- package/dist/shared/icons/exchanges/BinanceIcon.js +1 -0
- package/dist/shared/icons/exchanges/CoinbaseIcon.d.ts +7 -0
- package/dist/shared/icons/exchanges/CoinbaseIcon.js +1 -0
- package/dist/shared/icons/exchanges/KrakenIcon.d.ts +7 -0
- package/dist/shared/icons/exchanges/KrakenIcon.js +1 -0
- package/dist/shared/icons/exchanges/OkxIcon.d.ts +7 -0
- package/dist/shared/icons/exchanges/OkxIcon.js +1 -0
- package/dist/shared/icons/exchanges/RobinhoodIcon.d.ts +7 -0
- package/dist/shared/icons/exchanges/RobinhoodIcon.js +1 -0
- package/dist/shared/icons/exchanges/index.d.ts +5 -0
- package/dist/shared/icons/exchanges/index.js +1 -0
- package/dist/shared/orchestrator/failureReason.js +1 -0
- package/dist/shared/orchestrator/index.js +1 -0
- package/dist/shared/orchestrator/toFailure.js +1 -0
- package/dist/shared/orchestrator/types.d.ts +20 -0
- package/dist/shared/orchestrator/useDialogLifecycle.js +1 -0
- package/dist/shared/orchestrator/useDriverSettlementListener.js +1 -0
- package/dist/shared/orchestrator/useEffectiveState.js +1 -0
- package/dist/shared/orchestrator/useSettlementWatcher.js +1 -0
- package/dist/shared/orchestrator/userRejection.js +1 -0
- package/dist/shared/primitives/TxHashValue/TxHashValue.d.ts +20 -0
- package/dist/shared/primitives/TxHashValue/TxHashValue.js +1 -0
- package/dist/shared/primitives/TxHashValue/TxHashValue.slots.js +1 -0
- package/dist/shared/primitives/TxHashValue/TxHashValue.styles.js +1 -0
- package/dist/shared/primitives/TxHashValue/index.d.ts +2 -0
- package/dist/shared/primitives/TxHashValue/index.js +1 -0
- package/dist/shared/primitives/TxHashValue/types.d.ts +25 -0
- package/dist/shared/primitives/WalletValue/WalletValue.d.ts +40 -0
- package/dist/shared/primitives/WalletValue/WalletValue.js +1 -0
- package/dist/shared/primitives/WalletValue/index.d.ts +1 -0
- package/dist/shared/primitives/WalletValue/index.js +1 -0
- package/dist/shared/quote/index.js +1 -0
- package/dist/shared/quote/useQuoteCountdown.js +1 -0
- package/dist/shared/styles/tokens.stylex.js +1 -0
- package/dist/shared/ui/Alert/Alert.d.ts +105 -0
- package/dist/shared/ui/Alert/Alert.js +1 -0
- package/dist/shared/ui/Alert/Alert.slots.d.ts +10 -0
- package/dist/shared/ui/Alert/Alert.slots.js +1 -0
- package/dist/shared/ui/Alert/Alert.styles.js +1 -0
- package/dist/shared/ui/Alert/index.d.ts +2 -0
- package/dist/shared/ui/Alert/index.js +1 -0
- package/dist/shared/ui/AmountInput/AmountInput.d.ts +132 -0
- package/dist/shared/ui/AmountInput/AmountInput.js +1 -0
- package/dist/shared/ui/AmountInput/AmountInput.slots.d.ts +11 -0
- package/dist/shared/ui/AmountInput/AmountInput.slots.js +1 -0
- package/dist/shared/ui/AmountInput/AmountInput.styles.js +1 -0
- package/dist/shared/ui/AmountInput/attachInputNormalization.js +1 -0
- package/dist/shared/ui/AmountInput/context.js +1 -0
- package/dist/shared/ui/AmountInput/index.d.ts +3 -0
- package/dist/shared/ui/AmountInput/index.js +1 -0
- package/dist/shared/ui/AmountInput/useAutoShrinkFontSize.js +14 -0
- package/dist/shared/ui/AmountInput/utils.d.ts +12 -0
- package/dist/shared/ui/AmountInput/utils.js +1 -0
- package/dist/shared/ui/Badge/Badge.d.ts +89 -0
- package/dist/shared/ui/Badge/Badge.js +1 -0
- package/dist/shared/ui/Badge/Badge.slots.d.ts +7 -0
- package/dist/shared/ui/Badge/Badge.slots.js +1 -0
- package/dist/shared/ui/Badge/Badge.styles.js +1 -0
- package/dist/shared/ui/Badge/index.d.ts +2 -0
- package/dist/shared/ui/Badge/index.js +1 -0
- package/dist/shared/ui/Button/Button.d.ts +82 -0
- package/dist/shared/ui/Button/Button.js +1 -0
- package/dist/shared/ui/Button/Button.slots.d.ts +7 -0
- package/dist/shared/ui/Button/Button.slots.js +1 -0
- package/dist/shared/ui/Button/Button.styles.js +1 -0
- package/dist/shared/ui/Button/index.d.ts +2 -0
- package/dist/shared/ui/Button/index.js +1 -0
- package/dist/shared/ui/Card/Card.d.ts +93 -0
- package/dist/shared/ui/Card/Card.js +1 -0
- package/dist/shared/ui/Card/Card.slots.d.ts +10 -0
- package/dist/shared/ui/Card/Card.slots.js +1 -0
- package/dist/shared/ui/Card/Card.styles.js +1 -0
- package/dist/shared/ui/Card/index.d.ts +2 -0
- package/dist/shared/ui/Card/index.js +1 -0
- package/dist/shared/ui/Collapsible/Collapsible.d.ts +57 -0
- package/dist/shared/ui/Collapsible/Collapsible.js +1 -0
- package/dist/shared/ui/Collapsible/Collapsible.slots.d.ts +10 -0
- package/dist/shared/ui/Collapsible/Collapsible.slots.js +1 -0
- package/dist/shared/ui/Collapsible/Collapsible.styles.js +1 -0
- package/dist/shared/ui/Collapsible/index.d.ts +2 -0
- package/dist/shared/ui/Collapsible/index.js +1 -0
- package/dist/shared/ui/Details/Details.d.ts +76 -0
- package/dist/shared/ui/Details/Details.js +1 -0
- package/dist/shared/ui/Details/Details.slots.d.ts +9 -0
- package/dist/shared/ui/Details/Details.slots.js +1 -0
- package/dist/shared/ui/Details/Details.styles.js +1 -0
- package/dist/shared/ui/Details/index.d.ts +2 -0
- package/dist/shared/ui/Details/index.js +1 -0
- package/dist/shared/ui/Dialog/Dialog.d.ts +147 -0
- package/dist/shared/ui/Dialog/Dialog.js +1 -0
- package/dist/shared/ui/Dialog/Dialog.slots.d.ts +17 -0
- package/dist/shared/ui/Dialog/Dialog.slots.js +1 -0
- package/dist/shared/ui/Dialog/Dialog.styles.js +1 -0
- package/dist/shared/ui/Dialog/index.d.ts +2 -0
- package/dist/shared/ui/Dialog/index.js +1 -0
- package/dist/shared/ui/ExternalLink/ExternalLink.d.ts +41 -0
- package/dist/shared/ui/ExternalLink/ExternalLink.js +1 -0
- package/dist/shared/ui/ExternalLink/ExternalLink.slots.d.ts +7 -0
- package/dist/shared/ui/ExternalLink/ExternalLink.slots.js +1 -0
- package/dist/shared/ui/ExternalLink/ExternalLink.styles.js +1 -0
- package/dist/shared/ui/ExternalLink/index.d.ts +2 -0
- package/dist/shared/ui/ExternalLink/index.js +1 -0
- package/dist/shared/ui/ExternalLink/toSafeHref.js +1 -0
- package/dist/shared/ui/Field/Field.d.ts +185 -0
- package/dist/shared/ui/Field/Field.js +1 -0
- package/dist/shared/ui/Field/Field.slots.d.ts +21 -0
- package/dist/shared/ui/Field/Field.slots.js +1 -0
- package/dist/shared/ui/Field/Field.styles.js +1 -0
- package/dist/shared/ui/Field/index.d.ts +2 -0
- package/dist/shared/ui/Field/index.js +1 -0
- package/dist/shared/ui/IconButton/IconButton.d.ts +48 -0
- package/dist/shared/ui/IconButton/IconButton.js +1 -0
- package/dist/shared/ui/IconButton/IconButton.slots.d.ts +7 -0
- package/dist/shared/ui/IconButton/IconButton.slots.js +1 -0
- package/dist/shared/ui/IconButton/IconButton.styles.js +1 -0
- package/dist/shared/ui/IconButton/index.d.ts +2 -0
- package/dist/shared/ui/IconButton/index.js +1 -0
- package/dist/shared/ui/Image/Image.d.ts +43 -0
- package/dist/shared/ui/Image/Image.js +1 -0
- package/dist/shared/ui/Image/Image.slots.d.ts +14 -0
- package/dist/shared/ui/Image/Image.slots.js +1 -0
- package/dist/shared/ui/Image/Image.styles.js +1 -0
- package/dist/shared/ui/Image/index.d.ts +3 -0
- package/dist/shared/ui/Image/index.js +1 -0
- package/dist/shared/ui/Image/types.d.ts +131 -0
- package/dist/shared/ui/InputGroup/InputGroup.d.ts +129 -0
- package/dist/shared/ui/InputGroup/InputGroup.js +1 -0
- package/dist/shared/ui/InputGroup/InputGroup.slots.d.ts +16 -0
- package/dist/shared/ui/InputGroup/InputGroup.slots.js +1 -0
- package/dist/shared/ui/InputGroup/InputGroup.styles.js +1 -0
- package/dist/shared/ui/InputGroup/index.d.ts +2 -0
- package/dist/shared/ui/InputGroup/index.js +1 -0
- package/dist/shared/ui/LtrAtom/LtrAtom.d.ts +31 -0
- package/dist/shared/ui/LtrAtom/LtrAtom.js +1 -0
- package/dist/shared/ui/LtrAtom/index.d.ts +1 -0
- package/dist/shared/ui/LtrAtom/index.js +1 -0
- package/dist/shared/ui/ScrollArea/ScrollArea.d.ts +86 -0
- package/dist/shared/ui/ScrollArea/ScrollArea.js +1 -0
- package/dist/shared/ui/ScrollArea/ScrollArea.slots.d.ts +12 -0
- package/dist/shared/ui/ScrollArea/ScrollArea.slots.js +1 -0
- package/dist/shared/ui/ScrollArea/ScrollArea.styles.js +1 -0
- package/dist/shared/ui/ScrollArea/index.d.ts +2 -0
- package/dist/shared/ui/ScrollArea/index.js +1 -0
- package/dist/shared/ui/Select/Select.context.d.ts +10 -0
- package/dist/shared/ui/Select/Select.context.js +1 -0
- package/dist/shared/ui/Select/Select.d.ts +243 -0
- package/dist/shared/ui/Select/Select.js +1 -0
- package/dist/shared/ui/Select/Select.slots.d.ts +20 -0
- package/dist/shared/ui/Select/Select.slots.js +1 -0
- package/dist/shared/ui/Select/Select.styles.js +1 -0
- package/dist/shared/ui/Select/index.d.ts +3 -0
- package/dist/shared/ui/Select/index.js +1 -0
- package/dist/shared/ui/SelectableTile/SelectableTile.d.ts +83 -0
- package/dist/shared/ui/SelectableTile/SelectableTile.js +1 -0
- package/dist/shared/ui/SelectableTile/SelectableTile.slots.d.ts +7 -0
- package/dist/shared/ui/SelectableTile/SelectableTile.slots.js +1 -0
- package/dist/shared/ui/SelectableTile/SelectableTile.styles.js +1 -0
- package/dist/shared/ui/SelectableTile/SelectableTileGroup.d.ts +82 -0
- package/dist/shared/ui/SelectableTile/SelectableTileGroup.js +1 -0
- package/dist/shared/ui/SelectableTile/index.d.ts +3 -0
- package/dist/shared/ui/SelectableTile/index.js +1 -0
- package/dist/shared/ui/Skeleton/Skeleton.d.ts +41 -0
- package/dist/shared/ui/Skeleton/Skeleton.js +1 -0
- package/dist/shared/ui/Skeleton/Skeleton.slots.d.ts +7 -0
- package/dist/shared/ui/Skeleton/Skeleton.slots.js +1 -0
- package/dist/shared/ui/Skeleton/Skeleton.styles.js +1 -0
- package/dist/shared/ui/Skeleton/index.d.ts +2 -0
- package/dist/shared/ui/Skeleton/index.js +1 -0
- package/dist/shared/ui/Text/Text.d.ts +87 -0
- package/dist/shared/ui/Text/Text.js +1 -0
- package/dist/shared/ui/Text/Text.slots.d.ts +7 -0
- package/dist/shared/ui/Text/Text.slots.js +1 -0
- package/dist/shared/ui/Text/Text.styles.js +1 -0
- package/dist/shared/ui/Text/index.d.ts +2 -0
- package/dist/shared/ui/Text/index.js +1 -0
- package/dist/shared/ui/TokenLogo/TokenLogo.d.ts +41 -0
- package/dist/shared/ui/TokenLogo/TokenLogo.js +1 -0
- package/dist/shared/ui/TokenLogo/index.d.ts +2 -0
- package/dist/shared/ui/TokenLogo/index.js +1 -0
- package/dist/shared/ui/TokenLogo/types.d.ts +64 -0
- package/dist/shared/ui/Tooltip/Tooltip.d.ts +171 -0
- package/dist/shared/ui/Tooltip/Tooltip.js +1 -0
- package/dist/shared/ui/Tooltip/Tooltip.slots.d.ts +11 -0
- package/dist/shared/ui/Tooltip/Tooltip.slots.js +1 -0
- package/dist/shared/ui/Tooltip/Tooltip.styles.js +1 -0
- package/dist/shared/ui/Tooltip/index.d.ts +2 -0
- package/dist/shared/ui/Tooltip/index.js +1 -0
- package/dist/shared/ui/WalletRow/WalletRow.d.ts +55 -0
- package/dist/shared/ui/WalletRow/WalletRow.js +1 -0
- package/dist/shared/ui/WalletRow/WalletRow.slots.d.ts +7 -0
- package/dist/shared/ui/WalletRow/WalletRow.slots.js +1 -0
- package/dist/shared/ui/WalletRow/WalletRow.styles.js +1 -0
- package/dist/shared/ui/WalletRow/index.d.ts +2 -0
- package/dist/shared/ui/WalletRow/index.js +1 -0
- package/dist/shared/utils/explorers.js +1 -0
- package/dist/shared/utils/joinClassNames.js +1 -0
- package/dist/shared/utils/logos/api.d.ts +54 -0
- package/dist/shared/utils/logos/api.js +1 -0
- package/dist/shared/utils/logos/chains.d.ts +32 -0
- package/dist/shared/utils/logos/chains.js +1 -0
- package/dist/shared/utils/logos/conventionUrls.js +1 -0
- package/dist/shared/utils/logos/index.js +1 -0
- package/dist/shared/utils/logos/resolveLogoSrc.js +1 -0
- package/dist/shared/utils/logos/types.d.ts +62 -0
- package/dist/shared/utils/mergeClassName.js +1 -0
- package/dist/shared/utils/mergeStyle.js +1 -0
- package/dist/shared/wallet/resolveSupportedChainIds.js +1 -0
- package/dist/shared/wallet/resolveSupportedChains.js +1 -0
- package/dist/shared/wallet/types.d.ts +103 -0
- package/dist/shared/wallet/useWalletState.d.ts +21 -0
- package/dist/shared/wallet/useWalletState.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/AmountEntry.d.ts +59 -0
- package/dist/shared/widgets/amount-entry/compound/AmountEntry.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/AmountEntry.slots.d.ts +15 -0
- package/dist/shared/widgets/amount-entry/compound/AmountEntry.slots.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/AmountEntry.styles.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/components/Flow.d.ts +14 -0
- package/dist/shared/widgets/amount-entry/compound/components/Flow.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/components/Footer.d.ts +22 -0
- package/dist/shared/widgets/amount-entry/compound/components/Footer.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/components/Header.d.ts +15 -0
- package/dist/shared/widgets/amount-entry/compound/components/Header.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/components/Hero/Hero.d.ts +22 -0
- package/dist/shared/widgets/amount-entry/compound/components/Hero/Hero.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/components/Hero/StaticBand.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/components/Hero/SwapBackdrop.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/components/Hero/index.d.ts +1 -0
- package/dist/shared/widgets/amount-entry/compound/components/Hero/index.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/components/Hero/transitions.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/components/Hero/useSwapState.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/components/Hero/utils.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/components/Pills.d.ts +22 -0
- package/dist/shared/widgets/amount-entry/compound/components/Pills.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/context.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/index.d.ts +3 -0
- package/dist/shared/widgets/amount-entry/compound/index.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/types.d.ts +224 -0
- package/dist/shared/widgets/asset-descriptor.d.ts +27 -0
- package/dist/shared/widgets/asset-descriptor.js +1 -0
- package/dist/shared/widgets/asset-picker/compound/AssetPicker.d.ts +51 -0
- package/dist/shared/widgets/asset-picker/compound/AssetPicker.js +1 -0
- package/dist/shared/widgets/asset-picker/compound/AssetPicker.slots.d.ts +11 -0
- package/dist/shared/widgets/asset-picker/compound/AssetPicker.slots.js +1 -0
- package/dist/shared/widgets/asset-picker/compound/AssetPicker.styles.js +1 -0
- package/dist/shared/widgets/asset-picker/compound/components/Asset.d.ts +30 -0
- package/dist/shared/widgets/asset-picker/compound/components/Asset.js +1 -0
- package/dist/shared/widgets/asset-picker/compound/components/Footer.d.ts +16 -0
- package/dist/shared/widgets/asset-picker/compound/components/Footer.js +1 -0
- package/dist/shared/widgets/asset-picker/compound/components/Header.d.ts +19 -0
- package/dist/shared/widgets/asset-picker/compound/components/Header.js +1 -0
- package/dist/shared/widgets/asset-picker/compound/components/List.d.ts +22 -0
- package/dist/shared/widgets/asset-picker/compound/components/List.js +1 -0
- package/dist/shared/widgets/asset-picker/compound/context.js +1 -0
- package/dist/shared/widgets/asset-picker/compound/index.d.ts +3 -0
- package/dist/shared/widgets/asset-picker/compound/index.js +1 -0
- package/dist/shared/widgets/asset-picker/compound/types.d.ts +212 -0
- package/dist/shared/widgets/confirm-transfer/compound/ConfirmTransfer.d.ts +64 -0
- package/dist/shared/widgets/confirm-transfer/compound/ConfirmTransfer.js +1 -0
- package/dist/shared/widgets/confirm-transfer/compound/ConfirmTransfer.slots.d.ts +16 -0
- package/dist/shared/widgets/confirm-transfer/compound/ConfirmTransfer.slots.js +1 -0
- package/dist/shared/widgets/confirm-transfer/compound/ConfirmTransfer.styles.js +1 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/Amounts.d.ts +15 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/Amounts.js +1 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/Breakdown.d.ts +17 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/Breakdown.js +1 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/Disclaimer.d.ts +15 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/Disclaimer.js +1 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/Footer.d.ts +26 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/Footer.js +1 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/Header.d.ts +13 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/Header.js +1 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/Hero.d.ts +16 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/Hero.js +1 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/Meta.d.ts +16 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/Meta.js +1 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/QuoteTimer.js +1 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/splitAmount.js +1 -0
- package/dist/shared/widgets/confirm-transfer/compound/context.js +1 -0
- package/dist/shared/widgets/confirm-transfer/compound/index.d.ts +3 -0
- package/dist/shared/widgets/confirm-transfer/compound/index.js +1 -0
- package/dist/shared/widgets/confirm-transfer/compound/types.d.ts +338 -0
- package/dist/shared/widgets/error-state/compound/ErrorState.d.ts +96 -0
- package/dist/shared/widgets/error-state/compound/ErrorState.js +1 -0
- package/dist/shared/widgets/error-state/compound/ErrorState.slots.d.ts +18 -0
- package/dist/shared/widgets/error-state/compound/ErrorState.slots.js +1 -0
- package/dist/shared/widgets/error-state/compound/ErrorState.styles.js +1 -0
- package/dist/shared/widgets/error-state/compound/components/Actions.d.ts +17 -0
- package/dist/shared/widgets/error-state/compound/components/Actions.js +1 -0
- package/dist/shared/widgets/error-state/compound/components/AssetValue.d.ts +20 -0
- package/dist/shared/widgets/error-state/compound/components/AssetValue.js +1 -0
- package/dist/shared/widgets/error-state/compound/components/Detail.d.ts +14 -0
- package/dist/shared/widgets/error-state/compound/components/Detail.js +1 -0
- package/dist/shared/widgets/error-state/compound/components/Details.d.ts +12 -0
- package/dist/shared/widgets/error-state/compound/components/Details.js +1 -0
- package/dist/shared/widgets/error-state/compound/components/DisclosureChevron.d.ts +11 -0
- package/dist/shared/widgets/error-state/compound/components/DisclosureChevron.js +1 -0
- package/dist/shared/widgets/error-state/compound/components/Header.d.ts +13 -0
- package/dist/shared/widgets/error-state/compound/components/Header.js +1 -0
- package/dist/shared/widgets/error-state/compound/components/HelpInfo.d.ts +10 -0
- package/dist/shared/widgets/error-state/compound/components/HelpInfo.js +1 -0
- package/dist/shared/widgets/error-state/compound/components/Hero.d.ts +9 -0
- package/dist/shared/widgets/error-state/compound/components/Hero.js +1 -0
- package/dist/shared/widgets/error-state/compound/components/MoreDetails.d.ts +18 -0
- package/dist/shared/widgets/error-state/compound/components/MoreDetails.js +1 -0
- package/dist/shared/widgets/error-state/compound/components/Rows.d.ts +57 -0
- package/dist/shared/widgets/error-state/compound/components/Rows.js +1 -0
- package/dist/shared/widgets/error-state/compound/components/StatusValue.d.ts +14 -0
- package/dist/shared/widgets/error-state/compound/components/StatusValue.js +1 -0
- package/dist/shared/widgets/error-state/compound/context.js +1 -0
- package/dist/shared/widgets/error-state/compound/index.d.ts +3 -0
- package/dist/shared/widgets/error-state/compound/index.js +1 -0
- package/dist/shared/widgets/error-state/compound/types.d.ts +291 -0
- package/dist/shared/widgets/processing-state/compound/ProcessingState.d.ts +77 -0
- package/dist/shared/widgets/processing-state/compound/ProcessingState.js +1 -0
- package/dist/shared/widgets/processing-state/compound/ProcessingState.slots.d.ts +15 -0
- package/dist/shared/widgets/processing-state/compound/ProcessingState.slots.js +1 -0
- package/dist/shared/widgets/processing-state/compound/ProcessingState.styles.js +1 -0
- package/dist/shared/widgets/processing-state/compound/components/Actions.d.ts +17 -0
- package/dist/shared/widgets/processing-state/compound/components/Actions.js +1 -0
- package/dist/shared/widgets/processing-state/compound/components/Detail.d.ts +14 -0
- package/dist/shared/widgets/processing-state/compound/components/Detail.js +1 -0
- package/dist/shared/widgets/processing-state/compound/components/Details.d.ts +12 -0
- package/dist/shared/widgets/processing-state/compound/components/Details.js +1 -0
- package/dist/shared/widgets/processing-state/compound/components/Header.d.ts +15 -0
- package/dist/shared/widgets/processing-state/compound/components/Header.js +1 -0
- package/dist/shared/widgets/processing-state/compound/components/Hero.d.ts +16 -0
- package/dist/shared/widgets/processing-state/compound/components/Hero.js +1 -0
- package/dist/shared/widgets/processing-state/compound/components/Rows.d.ts +36 -0
- package/dist/shared/widgets/processing-state/compound/components/Rows.js +1 -0
- package/dist/shared/widgets/processing-state/compound/components/StatusPill.d.ts +13 -0
- package/dist/shared/widgets/processing-state/compound/components/StatusPill.js +1 -0
- package/dist/shared/widgets/processing-state/compound/context.js +1 -0
- package/dist/shared/widgets/processing-state/compound/index.d.ts +3 -0
- package/dist/shared/widgets/processing-state/compound/index.js +1 -0
- package/dist/shared/widgets/processing-state/compound/types.d.ts +216 -0
- package/dist/shared/widgets/success-state/compound/SuccessState.d.ts +105 -0
- package/dist/shared/widgets/success-state/compound/SuccessState.js +1 -0
- package/dist/shared/widgets/success-state/compound/SuccessState.slots.d.ts +21 -0
- package/dist/shared/widgets/success-state/compound/SuccessState.slots.js +1 -0
- package/dist/shared/widgets/success-state/compound/SuccessState.styles.js +1 -0
- package/dist/shared/widgets/success-state/compound/components/Actions.d.ts +18 -0
- package/dist/shared/widgets/success-state/compound/components/Actions.js +1 -0
- package/dist/shared/widgets/success-state/compound/components/AssetValue.d.ts +18 -0
- package/dist/shared/widgets/success-state/compound/components/AssetValue.js +1 -0
- package/dist/shared/widgets/success-state/compound/components/Detail.d.ts +18 -0
- package/dist/shared/widgets/success-state/compound/components/Detail.js +1 -0
- package/dist/shared/widgets/success-state/compound/components/Details.d.ts +16 -0
- package/dist/shared/widgets/success-state/compound/components/Details.js +1 -0
- package/dist/shared/widgets/success-state/compound/components/Header.d.ts +13 -0
- package/dist/shared/widgets/success-state/compound/components/Header.js +1 -0
- package/dist/shared/widgets/success-state/compound/components/Headline.d.ts +16 -0
- package/dist/shared/widgets/success-state/compound/components/Headline.js +1 -0
- package/dist/shared/widgets/success-state/compound/components/Hero.d.ts +10 -0
- package/dist/shared/widgets/success-state/compound/components/Hero.js +1 -0
- package/dist/shared/widgets/success-state/compound/components/MoreDetails.d.ts +19 -0
- package/dist/shared/widgets/success-state/compound/components/MoreDetails.js +1 -0
- package/dist/shared/widgets/success-state/compound/components/RouteValue.d.ts +15 -0
- package/dist/shared/widgets/success-state/compound/components/RouteValue.js +1 -0
- package/dist/shared/widgets/success-state/compound/components/Rows.d.ts +69 -0
- package/dist/shared/widgets/success-state/compound/components/Rows.js +1 -0
- package/dist/shared/widgets/success-state/compound/components/StatusPill.d.ts +13 -0
- package/dist/shared/widgets/success-state/compound/components/StatusPill.js +1 -0
- package/dist/shared/widgets/success-state/compound/context.js +1 -0
- package/dist/shared/widgets/success-state/compound/index.d.ts +3 -0
- package/dist/shared/widgets/success-state/compound/index.js +1 -0
- package/dist/shared/widgets/success-state/compound/types.d.ts +307 -0
- package/dist/storage/adapters.d.ts +29 -0
- package/dist/storage/adapters.js +1 -0
- package/dist/storage/context.d.ts +62 -0
- package/dist/storage/context.js +1 -0
- package/dist/storage/createKitStorage.d.ts +45 -0
- package/dist/storage/createKitStorage.js +1 -0
- package/dist/storage/index.d.ts +4 -0
- package/dist/storage/index.js +1 -0
- package/dist/storage/types.d.ts +26 -0
- package/dist/stridge/StridgeContext.d.ts +29 -0
- package/dist/stridge/StridgeContext.js +1 -0
- package/dist/stridge/StridgeProvider.d.ts +158 -0
- package/dist/stridge/StridgeProvider.js +1 -0
- package/dist/stridge/stubs.js +1 -0
- package/dist/styles/index.css +3494 -0
- package/dist/types.d.ts +15 -0
- package/dist/types.js +1 -0
- package/dist/ui/index.d.ts +48 -0
- package/dist/ui/index.js +1 -0
- package/dist/utils/src/use-copy-to-clipboard.js +1 -0
- package/dist/wallet/index.d.ts +3 -0
- package/dist/wallet/index.js +1 -0
- package/dist/withdraw/compound/index.d.ts +22 -0
- package/dist/withdraw/compound/index.js +1 -0
- package/dist/withdraw/dialog/index.d.ts +2 -0
- package/dist/withdraw/dialog/index.js +1 -0
- package/package.json +156 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { TxRef } from "../../../shared/driver/types.js";
|
|
2
|
+
import { WithdrawalQuotePayload, WithdrawalSettlementFailurePayload, WithdrawalSettlementPendingPayload, WithdrawalSettlementSuccessPayload } from "../driver/payloads.js";
|
|
3
|
+
import { SubmitWithdrawalInput } from "../driver/types.js";
|
|
4
|
+
import { FailureInfo } from "../../../shared/orchestrator/types.js";
|
|
5
|
+
import { WithdrawStateName } from "../orchestrator/types.js";
|
|
6
|
+
import { WithdrawFormEventCallbacks } from "./WithdrawDialogEventsContext.js";
|
|
7
|
+
import { ErrorInfo } from "react";
|
|
8
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
9
|
+
|
|
10
|
+
//#region src/flows/withdraw/dialog/WithdrawDialog.d.ts
|
|
11
|
+
/**
|
|
12
|
+
* Top-level withdraw dialog. Mounts inside `<KitProvider withdraw={…} />` once at the host's
|
|
13
|
+
* app root and binds open state to the controller's `state.name !== "closed"`.
|
|
14
|
+
*
|
|
15
|
+
* Body switch is keyed off the orchestrator's *effective* state (not logical state) so the
|
|
16
|
+
* widget the user was looking at stays mounted through the dialog's close animation.
|
|
17
|
+
*
|
|
18
|
+
* Three top-level callbacks (`onOpened`, `onClosed`, `onStepChanged`) describe the dialog as a
|
|
19
|
+
* stateful component. The grouped `events={{ … }}` prop carries the operational lifecycle —
|
|
20
|
+
* form-level inputs, quote / submit / settlement transitions for the active withdrawal.
|
|
21
|
+
*/
|
|
22
|
+
declare function WithdrawDialog({
|
|
23
|
+
container,
|
|
24
|
+
onError,
|
|
25
|
+
onOpened,
|
|
26
|
+
onClosed,
|
|
27
|
+
onStepChanged,
|
|
28
|
+
events
|
|
29
|
+
}?: WithdrawDialog.Props): _$react_jsx_runtime0.JSX.Element;
|
|
30
|
+
declare namespace WithdrawDialog {
|
|
31
|
+
interface Props {
|
|
32
|
+
/**
|
|
33
|
+
* Element the dialog portals into. Defaults to `document.body` (full-page overlay).
|
|
34
|
+
* Pass a transformed ancestor with `overflow: clip` — e.g. a mobile mockup frame — to
|
|
35
|
+
* scope the dialog's width, height, and backdrop to that rect.
|
|
36
|
+
*/
|
|
37
|
+
container?: HTMLElement | null;
|
|
38
|
+
/** Forwarded to the dialog's internal {@link GatewayKitBoundary} for crash reporting. */
|
|
39
|
+
onError?: (error: Error, errorInfo: ErrorInfo) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Fires once when the dialog transitions from `closed` to any open step. The withdraw
|
|
42
|
+
* flow has no `open({ method })` overload — `onOpened` carries no payload.
|
|
43
|
+
*/
|
|
44
|
+
onOpened?: () => void;
|
|
45
|
+
/** Fires once when the dialog transitions back to `closed`. `atStep` is the last open step. */
|
|
46
|
+
onClosed?: (atStep: WithdrawStateName) => void;
|
|
47
|
+
/** Fires on every logical step transition. */
|
|
48
|
+
onStepChanged?: (event: {
|
|
49
|
+
from: WithdrawStateName;
|
|
50
|
+
to: WithdrawStateName;
|
|
51
|
+
}) => void;
|
|
52
|
+
/**
|
|
53
|
+
* Operational events — user actions, quote / submit / settlement transitions for the
|
|
54
|
+
* active withdrawal. Each callback is optional and fires after the controller has acted
|
|
55
|
+
* (state machine has transitioned, driver entity has settled), so payloads are guaranteed
|
|
56
|
+
* valid for the named event.
|
|
57
|
+
*/
|
|
58
|
+
events?: Events;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Operational lifecycle hooks. Splits cleanly into:
|
|
62
|
+
*
|
|
63
|
+
* - **Form-level inputs** (`onRecipientChanged` / `onAmountChanged` / `onReceiveTokenChanged`
|
|
64
|
+
* / `onReceiveChainChanged`) — fire on every change of the form's local state.
|
|
65
|
+
* - **User actions** (`onWithdrawalConfirmed`) — fire when the user submits the form.
|
|
66
|
+
* - **Quote lifecycle** — track the form's quote entity through `loading → ready / error`.
|
|
67
|
+
* - **Submit lifecycle** — track the wagmi-driven broadcast through wagmi → receipt → terminal
|
|
68
|
+
* verdict.
|
|
69
|
+
* - **Settlement entity** — track the gateway's settlement payload through pending / succeeded /
|
|
70
|
+
* failed.
|
|
71
|
+
*/
|
|
72
|
+
interface Events extends WithdrawFormEventCallbacks {
|
|
73
|
+
/** User submitted the form (the SUBMIT action — wallet prompt is about to fire). */
|
|
74
|
+
onWithdrawalConfirmed?: () => void;
|
|
75
|
+
/** Quote entity reached `ready` with the formatted payload. */
|
|
76
|
+
onQuoteResolved?: (quote: WithdrawalQuotePayload) => void;
|
|
77
|
+
/** Quote entity reached `error`. */
|
|
78
|
+
onQuoteFailed?: (failure: {
|
|
79
|
+
reason: string;
|
|
80
|
+
code?: string;
|
|
81
|
+
}) => void;
|
|
82
|
+
/** Wagmi broadcast completed and the orchestrator transitioned into `inProgress`. */
|
|
83
|
+
onWithdrawalSubmitted?: (event: {
|
|
84
|
+
input: SubmitWithdrawalInput;
|
|
85
|
+
tx: TxRef;
|
|
86
|
+
}) => void;
|
|
87
|
+
/** User declined the wallet signature prompt; orchestrator transitioned into `error`. */
|
|
88
|
+
onSignatureDeclined?: () => void;
|
|
89
|
+
/** Submission failed for a non-rejection reason (network, bad input, etc). */
|
|
90
|
+
onSubmissionFailed?: (failure: FailureInfo) => void;
|
|
91
|
+
/** The driver's `settlement` entity emitted a progressive pending update. */
|
|
92
|
+
onProcessingProgress?: (update: WithdrawalSettlementPendingPayload) => void;
|
|
93
|
+
/** Terminal success — settlement entity reached `ready{kind: "succeeded"}`. */
|
|
94
|
+
onSucceeded?: (result: WithdrawalSettlementSuccessPayload) => void;
|
|
95
|
+
/**
|
|
96
|
+
* Terminal failure — either a settlement-driven failure (driver-emitted classification) or
|
|
97
|
+
* an FSM-derived failure (submission rejection escalated to the global error arm).
|
|
98
|
+
*/
|
|
99
|
+
onFailed?: (failure: WithdrawalSettlementFailurePayload | FailureInfo) => void;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
//#endregion
|
|
103
|
+
export { WithdrawDialog };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useDialogLifecycle as e}from"../../../shared/orchestrator/useDialogLifecycle.js";import"../../../shared/orchestrator/index.js";import{useWithdrawSnapshot as t}from"../driver/context.js";import{useWithdrawEffectiveState as n,useWithdrawState as r}from"../orchestrator/controller.js";import{useWithdraw as i}from"../orchestrator/useWithdraw.js";import"../orchestrator/index.js";import{Dialog as a}from"../../../shared/ui/Dialog/Dialog.js";import"../../../shared/ui/Dialog/index.js";import{StepTransition as o}from"../../../shared/dialog/StepTransition.js";import{GatewayKitBoundary as s}from"../../../shared/error-handling/components/GatewayKitBoundary.js";import"../../../shared/error-handling/index.js";import{WithdrawError as c}from"../widgets/withdraw-error/WithdrawError.js";import{WithdrawDialogEventsProvider as l}from"./WithdrawDialogEventsContext.js";import{WithdrawForm as u}from"../widgets/withdraw-form/WithdrawForm.js";import{WithdrawInProgress as d}from"../widgets/withdraw-in-progress/WithdrawInProgress.js";import{WithdrawSuccess as f}from"../widgets/withdraw-success/WithdrawSuccess.js";import"../../../_internal/withdraw/widgets/index.js";import{useRef as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";function g({container:e,onError:p,onOpened:g,onClosed:v,onStepChanged:y,events:b}={}){let x=r(),S=n(),{close:C}=i(),w=t(),T=x.name!==`closed`;_(x,w.settlement,w.quote,{onOpened:g,onClosed:v,onStepChanged:y,events:b});let E=S.name===`submitting`?`form`:S.name;return m(a,{open:T,onOpenChange:e=>e?void 0:C(),children:m(a.Content,{container:e,children:m(s,{onError:p,onReset:C,children:m(l,{events:b??{},children:h(o,{stateKey:E,children:[S.name===`form`||S.name===`submitting`?m(u,{}):null,S.name===`inProgress`?m(d,{}):null,S.name===`success`?m(f,{}):null,S.name===`error`?m(c,{}):null]})})})})})}function _(t,n,r,i){let a=p(i);a.current=i,e({state:t,settlement:n,quote:r,fireFsm:(e,t)=>v(e,t,a.current),fireSettlement:(e,t)=>y(t,a.current),fireQuote:(e,t)=>{if(t.status===e)return;let n=a.current.events;t.status===`ready`&&n?.onQuoteResolved?.(t.payload),t.status===`error`&&n?.onQuoteFailed?.({reason:t.error.message||`Quote failed.`,...t.error.name?{code:t.error.name}:{}})}})}function v(e,t,n){let{onOpened:r,onClosed:i,onStepChanged:a,events:o}=n,s=e.name===`form`&&!!e.ctx?.notice;if(t.name===`form`&&t.ctx?.notice&&!s&&o?.onSignatureDeclined?.(),e.name!==t.name&&(e.name===`closed`&&t.name!==`closed`&&r?.(),e.name!==`closed`&&t.name===`closed`&&i?.(e.name),a?.({from:e.name,to:t.name}),e.name===`form`&&t.name===`submitting`&&o?.onWithdrawalConfirmed?.(),e.name===`submitting`&&t.name===`inProgress`&&o?.onWithdrawalSubmitted?.({input:t.ctx.input,tx:t.ctx.tx}),t.name===`error`)){let e=t.ctx.failure;e!==void 0&&t.ctx.tx===void 0&&e&&(o?.onSubmissionFailed?.(e),o?.onFailed?.(e))}}function y(e,t){if(e.status!==`ready`&&e.status!==`stale`)return;let n=e.payload,r=t.events;if(r){if(n.kind===`pending`){r.onProcessingProgress?.(n);return}if(n.kind===`succeeded`){r.onSucceeded?.(n);return}n.kind===`failed`&&r.onFailed?.(n)}}export{g as WithdrawDialog};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ReceiveChainPayload, ReceiveTokenOptionPayload } from "../driver/payloads.js";
|
|
2
|
+
import { RequestWithdrawalQuoteInput } from "../driver/types.js";
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
//#region src/flows/withdraw/dialog/WithdrawDialogEventsContext.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Form-level event payload — the parsed amount the user typed, alongside the raw input string.
|
|
7
|
+
* `numeric` is `null` when the input is empty or unparseable; the host can treat that as "user
|
|
8
|
+
* cleared the amount" rather than re-parse the raw string.
|
|
9
|
+
*/
|
|
10
|
+
interface AmountChangedPayload {
|
|
11
|
+
raw: string;
|
|
12
|
+
numeric: number | null;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Form-level callbacks reading off `WithdrawForm`'s local state. Optional — hosts wiring
|
|
16
|
+
* `<WithdrawDialog>` configure them via the `events` prop, hosts using `<WithdrawForm>` directly
|
|
17
|
+
* pass them via the form's `events` prop.
|
|
18
|
+
*/
|
|
19
|
+
interface WithdrawFormEventCallbacks {
|
|
20
|
+
/** Fires on every recipient-input change (no debounce). */
|
|
21
|
+
onRecipientChanged?: (value: string) => void;
|
|
22
|
+
/** Fires on every amount-input change with both the raw string and the parsed numeric value. */
|
|
23
|
+
onAmountChanged?: (payload: AmountChangedPayload) => void;
|
|
24
|
+
/** Fires when the user picks a different receive token in the form's receive-token dropdown. */
|
|
25
|
+
onReceiveTokenChanged?: (token: ReceiveTokenOptionPayload) => void;
|
|
26
|
+
/** Fires when the user picks a different receive chain in the form's receive-chain dropdown. */
|
|
27
|
+
onReceiveChainChanged?: (chain: ReceiveChainPayload) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Fires when the form fires a fresh `requestQuote` (after the 400ms debounce). The input
|
|
30
|
+
* carries everything the driver received so the host can mirror the request shape into
|
|
31
|
+
* analytics or pre-warm host-side caches.
|
|
32
|
+
*/
|
|
33
|
+
onQuoteRequested?: (input: RequestWithdrawalQuoteInput) => void;
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { WithdrawFormEventCallbacks };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{createContext as e,use as t}from"react";import{jsx as n}from"react/jsx-runtime";const r=e({});r.displayName=`WithdrawDialogEventsContext`;function i({events:e,children:t}){return n(r,{value:e,children:t})}function a(){return t(r)}export{i as WithdrawDialogEventsProvider,a as useWithdrawDialogEvents};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { WithdrawDriver, WithdrawSnapshot } from "./types.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/flows/withdraw/driver/context.d.ts
|
|
6
|
+
declare function WithdrawDriverProvider({
|
|
7
|
+
driver,
|
|
8
|
+
children
|
|
9
|
+
}: {
|
|
10
|
+
driver: WithdrawDriver;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}): _$react_jsx_runtime0.JSX.Element;
|
|
13
|
+
/**
|
|
14
|
+
* Read the current withdraw driver snapshot. Throws when called outside `<KitProvider withdraw={…} />`.
|
|
15
|
+
*
|
|
16
|
+
* Wraps `subscribe` / `getSnapshot` in lambdas so the call resolves through the driver instance.
|
|
17
|
+
* Class-based BYO drivers would otherwise lose their `this` binding when React invokes the
|
|
18
|
+
* methods detached from the instance.
|
|
19
|
+
*/
|
|
20
|
+
declare function useWithdrawSnapshot(): WithdrawSnapshot;
|
|
21
|
+
/** Internal — read the raw driver instance (skips React's snapshot subscription). */
|
|
22
|
+
declare function useWithdrawDriverInstance(): WithdrawDriver;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { WithdrawDriverProvider, useWithdrawDriverInstance, useWithdrawSnapshot };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{createContext as e,use as t,useSyncExternalStore as n}from"react";import{jsx as r}from"react/jsx-runtime";const i=e(null);i.displayName=`WithdrawDriverContext`;function a({driver:e,children:t}){return r(i,{value:e,children:t})}function o(){let e=t(i);if(!e)throw Error(`useWithdrawSnapshot must be used inside <KitProvider withdraw={…} />.`);return n(t=>e.subscribe(t),()=>e.getSnapshot(),()=>e.getSnapshot())}function s(){let e=t(i);if(!e)throw Error(`useWithdrawDriverInstance must be used inside <KitProvider withdraw={…} />.`);return e}export{a as WithdrawDriverProvider,s as useWithdrawDriverInstance,o as useWithdrawSnapshot};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { GatewayPollResponse, GatewaySettlementDto, OnchainBalanceResponse, QuoteResponse, SupportedAssetDto, SupportedAssetsResponse } from "@stridge/sdk";
|
|
2
|
+
|
|
3
|
+
//#region src/flows/withdraw/driver/dto.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Per-token row from the gateway's `balance/onchain` proxy. The withdraw driver filters this list
|
|
6
|
+
* down to the configured brand-currency tuple before formatting.
|
|
7
|
+
*/
|
|
8
|
+
type WithdrawableBalanceDto = OnchainBalanceResponse["chains"][number]["tokens"][number];
|
|
9
|
+
/**
|
|
10
|
+
* Full `balance/onchain` response. The driver filters `chains[].tokens[]` to the brand-currency
|
|
11
|
+
* `(networkId, assetSymbol)` tuple at format time.
|
|
12
|
+
*/
|
|
13
|
+
type WithdrawableBalancesResponse = OnchainBalanceResponse;
|
|
14
|
+
/** Per-call `uda/quote` response. Drives the V2 form's "You will receive" + breakdown rows. */
|
|
15
|
+
type WithdrawalQuoteDto = QuoteResponse;
|
|
16
|
+
/** Alias of {@link WithdrawalQuoteDto} surfaced as the response slot for parity with deposit. */
|
|
17
|
+
type WithdrawalQuoteResponse = QuoteResponse;
|
|
18
|
+
/**
|
|
19
|
+
* Single settlement record from `gateway/{owner}`. The withdraw driver matches by source-chain
|
|
20
|
+
* `from.tx_id` (the wagmi-broadcast hash) and routes the matched settlement through
|
|
21
|
+
* `settlementToWithdrawalPayload` to build the payload union.
|
|
22
|
+
*/
|
|
23
|
+
type WithdrawalSettlementDto = GatewaySettlementDto;
|
|
24
|
+
/**
|
|
25
|
+
* Full `gateway/{owner}` poll response. Carries `destination` plus `settlements[]`. Used as the
|
|
26
|
+
* `response` slot on the settlement entity envelope so headless integrators can correlate against
|
|
27
|
+
* the UDA-level destination metadata.
|
|
28
|
+
*/
|
|
29
|
+
type WithdrawalSettlementResponse = GatewayPollResponse;
|
|
30
|
+
/**
|
|
31
|
+
* Per-network entry from `Uda.supportedAssets()`. Surfaced as the `raw` slot on the
|
|
32
|
+
* `receiveOptions` entity so headless integrators can navigate the catalog without re-fetching.
|
|
33
|
+
*/
|
|
34
|
+
type ReceiveOptionDto = SupportedAssetDto;
|
|
35
|
+
/**
|
|
36
|
+
* Full `Uda.supportedAssets()` response. Drives the receive chain + receive token dropdowns on
|
|
37
|
+
* the form.
|
|
38
|
+
*/
|
|
39
|
+
type ReceiveOptionsResponse = SupportedAssetsResponse;
|
|
40
|
+
//#endregion
|
|
41
|
+
export { ReceiveOptionDto, ReceiveOptionsResponse, WithdrawableBalanceDto, WithdrawableBalancesResponse, WithdrawalQuoteDto, WithdrawalQuoteResponse, WithdrawalSettlementDto, WithdrawalSettlementResponse };
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { SettlementFailureKind } from "../../../shared/driver/types.js";
|
|
2
|
+
import { FormattedField } from "../../../shared/format/types.js";
|
|
3
|
+
//#region src/flows/withdraw/driver/payloads.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Per-asset balance available to withdraw — the brand-managed source the cash-out flow draws
|
|
6
|
+
* from. Mirrors the shape of {@link import("#/flows/deposit/driver").BalanceItemPayload} on the
|
|
7
|
+
* deposit side, but the underlying store is the brand's settlement account rather than the
|
|
8
|
+
* connected wallet.
|
|
9
|
+
*/
|
|
10
|
+
interface WithdrawableBalanceItemPayload {
|
|
11
|
+
/** Stridge network id (string-encoded). */
|
|
12
|
+
networkId?: string;
|
|
13
|
+
/** Human-readable network name (e.g. `"Polygon"`). */
|
|
14
|
+
networkName: string;
|
|
15
|
+
/** EIP-155 chain id when applicable. */
|
|
16
|
+
eip155Id?: string;
|
|
17
|
+
/** Resolved chain icon URL. */
|
|
18
|
+
chainLogoUrl?: string;
|
|
19
|
+
/** Token symbol as displayed (e.g. `"USDC"`). */
|
|
20
|
+
symbol: string;
|
|
21
|
+
/** On-chain decimal precision. */
|
|
22
|
+
decimals: number;
|
|
23
|
+
/** ERC-20 contract address. Empty string for native assets. */
|
|
24
|
+
address: string;
|
|
25
|
+
/** Resolved token icon URL. */
|
|
26
|
+
assetLogoUrl?: string;
|
|
27
|
+
/** True for the chain's native gas token. */
|
|
28
|
+
isNative: boolean;
|
|
29
|
+
/** Withdrawable balance in display units (post-decimals). */
|
|
30
|
+
amount: FormattedField<number>;
|
|
31
|
+
/** USD value of `amount` at the most recent price snapshot. */
|
|
32
|
+
amountUsd?: FormattedField<number>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Receive-side asset descriptor surfaced on the quote / settlement payloads — the token + chain
|
|
36
|
+
* the withdraw is settling into. Carries the token glyph metadata the form's "Receive token" /
|
|
37
|
+
* "Receive chain" pickers render.
|
|
38
|
+
*/
|
|
39
|
+
interface WithdrawalReceiveAssetPayload {
|
|
40
|
+
/** Token symbol displayed on the receive pill. */
|
|
41
|
+
symbol: string;
|
|
42
|
+
/** On-chain decimal precision. */
|
|
43
|
+
decimals: number;
|
|
44
|
+
/** ERC-20 contract address on the receive chain. Empty for native. */
|
|
45
|
+
address: string;
|
|
46
|
+
/** True for the chain's native gas token. */
|
|
47
|
+
isNative: boolean;
|
|
48
|
+
/** Resolved token icon URL. */
|
|
49
|
+
assetLogoUrl?: string;
|
|
50
|
+
/** Stridge network id for the receive chain. */
|
|
51
|
+
networkId?: string;
|
|
52
|
+
/** Human-readable network name (e.g. `"Polygon"`). */
|
|
53
|
+
networkName: string;
|
|
54
|
+
/** EIP-155 chain id of the receive chain. */
|
|
55
|
+
eip155Id?: string;
|
|
56
|
+
/** Resolved chain icon URL. */
|
|
57
|
+
chainLogoUrl?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Quote breakdown rows surfaced on the V2 form's expandable breakdown card. Mirrors the deposit
|
|
61
|
+
* flow's breakdown shape so both flows render the same items (selected route, network cost,
|
|
62
|
+
* price impact). Each field is independently optional so the row hides when the gateway didn't
|
|
63
|
+
* surface that detail.
|
|
64
|
+
*/
|
|
65
|
+
interface WithdrawalQuoteBreakdownPayload {
|
|
66
|
+
/**
|
|
67
|
+
* Routing context selected by the backend (provider + scenario). The widget renders
|
|
68
|
+
* `label` directly. Identical shape to deposit's `selectedRoute` so both flows surface the
|
|
69
|
+
* same chrome.
|
|
70
|
+
*/
|
|
71
|
+
selectedRoute?: {
|
|
72
|
+
provider: string;
|
|
73
|
+
scenario: string;
|
|
74
|
+
label: string;
|
|
75
|
+
};
|
|
76
|
+
/** Estimated network cost in USD. */
|
|
77
|
+
networkCost?: FormattedField<number>;
|
|
78
|
+
/** Price impact in percent units (`0.21` means `0.21%`). Only set on same-symbol routes. */
|
|
79
|
+
priceImpact?: FormattedField<number>;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Active withdrawal quote — the formatted result of a `requestWithdrawalQuote` round-trip. Drives
|
|
83
|
+
* the form's "You will receive" summary row and the breakdown card's three metric rows.
|
|
84
|
+
*/
|
|
85
|
+
interface WithdrawalQuotePayload {
|
|
86
|
+
/** Receive-side asset + chain chrome. */
|
|
87
|
+
receiveAsset: WithdrawalReceiveAssetPayload;
|
|
88
|
+
/** Receive amount in display units (after fees / route conversion). */
|
|
89
|
+
receiveAmount: FormattedField<number>;
|
|
90
|
+
/** Receive amount in USD at the most recent price snapshot. */
|
|
91
|
+
receiveAmountUsd?: FormattedField<number>;
|
|
92
|
+
/** Optional breakdown rows (network cost / price impact / max slippage). */
|
|
93
|
+
breakdown?: WithdrawalQuoteBreakdownPayload;
|
|
94
|
+
/**
|
|
95
|
+
* Total seconds the quote window starts at — drives any quote-staleness countdown a future
|
|
96
|
+
* variant might surface. Defaults to `30` when the gateway does not surface a per-quote
|
|
97
|
+
* freshness window.
|
|
98
|
+
*/
|
|
99
|
+
quoteTotalSeconds: number;
|
|
100
|
+
/** Unix-ms timestamp at which the quote expires and the entity transitions to `stale`. */
|
|
101
|
+
expiresAt: number;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Pending variant of the settlement entity — the broadcast has been observed but the settlement
|
|
105
|
+
* has not yet reached a terminal verdict. Drives the V2-5 "Withdrawal in progress" screen.
|
|
106
|
+
*/
|
|
107
|
+
interface WithdrawalSettlementPendingPayload {
|
|
108
|
+
kind: "pending";
|
|
109
|
+
receiveAsset: WithdrawalReceiveAssetPayload;
|
|
110
|
+
receiveAmount: FormattedField<number>;
|
|
111
|
+
/** Recipient address — the destination the user supplied on the form. */
|
|
112
|
+
recipient: FormattedField<string>;
|
|
113
|
+
/** Unix-ms timestamp when the withdrawal was submitted. */
|
|
114
|
+
submittedAt: FormattedField<number>;
|
|
115
|
+
/** Source-chain broadcast tx hash. */
|
|
116
|
+
txHash?: FormattedField<string>;
|
|
117
|
+
/** Block-explorer URL for `txHash.value`. */
|
|
118
|
+
txExplorerUrl?: string;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Succeeded variant — the settlement reached terminal success. Drives the V2-6 "Withdrawal
|
|
122
|
+
* successful" screen.
|
|
123
|
+
*/
|
|
124
|
+
interface WithdrawalSettlementSuccessPayload {
|
|
125
|
+
kind: "succeeded";
|
|
126
|
+
receiveAsset: WithdrawalReceiveAssetPayload;
|
|
127
|
+
receiveAmount: FormattedField<number>;
|
|
128
|
+
recipient: FormattedField<string>;
|
|
129
|
+
submittedAt: FormattedField<number>;
|
|
130
|
+
/** Unix-ms when the settlement reached `completed`. */
|
|
131
|
+
filledAt: FormattedField<number>;
|
|
132
|
+
/** Total time from submit to terminal verdict. */
|
|
133
|
+
totalTime: FormattedField<number>;
|
|
134
|
+
/** Source-chain broadcast tx hash. */
|
|
135
|
+
txHash: FormattedField<string>;
|
|
136
|
+
txExplorerUrl?: string;
|
|
137
|
+
/** Destination-chain settlement tx — populated once the gateway submits the receive leg. */
|
|
138
|
+
completionTx?: {
|
|
139
|
+
hash: FormattedField<string>;
|
|
140
|
+
explorerUrl?: string;
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Failed variant — the settlement reached a terminal failure. The V2 error path reuses the
|
|
145
|
+
* shared `<ErrorState>` compound; the V2-native error design is deferred to a follow-up. Reuses
|
|
146
|
+
* deposit's {@link SettlementFailureKind} taxonomy so the localized headline / reason mapping
|
|
147
|
+
* can stay shared across flows.
|
|
148
|
+
*/
|
|
149
|
+
interface WithdrawalSettlementFailurePayload {
|
|
150
|
+
kind: "failed";
|
|
151
|
+
failureKind: SettlementFailureKind;
|
|
152
|
+
receiveAsset: WithdrawalReceiveAssetPayload;
|
|
153
|
+
receiveAmount: FormattedField<number>;
|
|
154
|
+
recipient: FormattedField<string>;
|
|
155
|
+
submittedAt: FormattedField<number>;
|
|
156
|
+
/** Unix-ms when the settlement reached `failed`. */
|
|
157
|
+
failedAt: FormattedField<number>;
|
|
158
|
+
txHash?: FormattedField<string>;
|
|
159
|
+
txExplorerUrl?: string;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Discriminated union for the withdraw settlement entity. The same envelope drives every state
|
|
163
|
+
* screen that reads settlement data — the discriminator on `kind` selects the variant.
|
|
164
|
+
*/
|
|
165
|
+
type WithdrawalSettlementPayload = WithdrawalSettlementPendingPayload | WithdrawalSettlementSuccessPayload | WithdrawalSettlementFailurePayload;
|
|
166
|
+
/**
|
|
167
|
+
* One token entry in a receive-chain's catalog. Surfaced to the form's "Receive token" dropdown
|
|
168
|
+
* after the user picks a "Receive chain". Includes the chain's native currency (`isNative: true`)
|
|
169
|
+
* alongside the configured ERC-20s, mirroring the transfer-crypto picker's two-tier shape.
|
|
170
|
+
*/
|
|
171
|
+
interface ReceiveTokenOptionPayload {
|
|
172
|
+
/** Token symbol (e.g. `"USDC"`, `"ETH"`). */
|
|
173
|
+
symbol: string;
|
|
174
|
+
/** Display name (e.g. `"USD Coin"`). */
|
|
175
|
+
name: string;
|
|
176
|
+
/** ERC-20 contract address. Empty string for native gas tokens. */
|
|
177
|
+
address: string;
|
|
178
|
+
/** On-chain decimal precision. */
|
|
179
|
+
decimals: number;
|
|
180
|
+
/** True when the row is the chain's native gas token. */
|
|
181
|
+
isNative: boolean;
|
|
182
|
+
/** Resolved token icon URL. */
|
|
183
|
+
assetLogoUrl?: string;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* One receive chain available for routing — the per-network catalog the form's "Receive chain"
|
|
187
|
+
* dropdown renders. Each chain carries its native gas token plus configured ERC-20s.
|
|
188
|
+
*/
|
|
189
|
+
interface ReceiveChainPayload {
|
|
190
|
+
/** Stridge network id (string-encoded, e.g. `"60"`, `"9006"`). */
|
|
191
|
+
networkId: string;
|
|
192
|
+
/** Human-readable network name (e.g. `"Polygon"`). */
|
|
193
|
+
networkName: string;
|
|
194
|
+
/** EIP-155 chain id (numeric). */
|
|
195
|
+
eip155Id: number;
|
|
196
|
+
/** Resolved chain icon URL — derived from the chain's native_currency.logo. */
|
|
197
|
+
chainLogoUrl?: string;
|
|
198
|
+
/**
|
|
199
|
+
* Selectable token rows for this chain. Always non-empty: starts with the chain's native gas
|
|
200
|
+
* token and is followed by every configured ERC-20 the gateway routes to. The form's
|
|
201
|
+
* "Receive token" dropdown narrows to whichever entry the active receive chain supplies.
|
|
202
|
+
*/
|
|
203
|
+
tokens: ReadonlyArray<ReceiveTokenOptionPayload>;
|
|
204
|
+
}
|
|
205
|
+
//#endregion
|
|
206
|
+
export { ReceiveChainPayload, ReceiveTokenOptionPayload, WithdrawableBalanceItemPayload, WithdrawalQuoteBreakdownPayload, WithdrawalQuotePayload, WithdrawalReceiveAssetPayload, WithdrawalSettlementFailurePayload, WithdrawalSettlementPayload, WithdrawalSettlementPendingPayload, WithdrawalSettlementSuccessPayload };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{parseDecimalSafe as e}from"../../../shared/transformers/parseSmallestUnit.js";import{formatTokenAmount as t}from"../../../../shared/format/formatTokenAmount.js";import{formatUsd as n}from"../../../../shared/format/formatUsd.js";function r(r,i){let a=i.assetSymbol.toUpperCase(),o=i.fallbackMeta?.address?.toLowerCase(),s=r.chains.find(e=>e.stridge_network_id===i.networkId),c=s?s.tokens.filter(e=>!e.is_spam&&e.symbol.toUpperCase()===a):[],l=o?c.find(e=>e.token_address.toLowerCase()===o)??c[0]:c[0];if(s&&l){let r=e(l.amount),a=e(l.amount_usd);return[{networkId:s.stridge_network_id,networkName:s.label,eip155Id:String(s.eip155_id),...i.fallbackMeta?.chainLogoUrl?{chainLogoUrl:i.fallbackMeta.chainLogoUrl}:{},symbol:l.symbol,decimals:l.decimals,address:l.token_address,...l.logo?{assetLogoUrl:l.logo}:i.fallbackMeta?.assetLogoUrl?{assetLogoUrl:i.fallbackMeta.assetLogoUrl}:{},isNative:l.is_native,amount:{value:r,formatted:t(r,i.i18n,{compact:!0})},...a>0?{amountUsd:{value:a,formatted:n(a,i.i18n)}}:{}}]}return i.fallbackMeta?[{networkId:i.networkId,networkName:i.fallbackMeta.networkName??i.networkId,...i.fallbackMeta.eip155Id?{eip155Id:i.fallbackMeta.eip155Id}:{},...i.fallbackMeta.chainLogoUrl?{chainLogoUrl:i.fallbackMeta.chainLogoUrl}:{},symbol:i.assetSymbol,decimals:i.fallbackMeta.decimals,address:i.fallbackMeta.address,...i.fallbackMeta.assetLogoUrl?{assetLogoUrl:i.fallbackMeta.assetLogoUrl}:{},isNative:i.fallbackMeta.isNative,amount:{value:0,formatted:t(0,i.i18n,{compact:!0})},amountUsd:{value:0,formatted:n(0,i.i18n)}}]:[]}export{r as balanceToWithdrawableBalancesPayload};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{computeQuoteAttrs as e,formatRouteLabel as t}from"../../../shared/transformers/computeQuoteAttrs.js";import{formatNetworkName as n}from"../../../../shared/format/formatNetworkName.js";import{formatPercent as r}from"../../../../shared/format/formatPercent.js";import{formatTokenAmount as i}from"../../../../shared/format/formatTokenAmount.js";import{formatUsd as a}from"../../../../shared/format/formatUsd.js";function o(o,s){let c=e(o,{sourceAmount:s.sourceAmount,sendDecimals:s.sendDecimals,sendSymbol:s.sendSymbol,receiveDecimals:s.receiveSide.decimals,receiveSymbol:s.receiveSide.symbol,...s.sendPriceUsd===void 0?{}:{sendPriceUsd:s.sendPriceUsd},...s.receivePriceUsd===void 0?{}:{receivePriceUsd:s.receivePriceUsd},now:s.now}),l={};return o.route.provider&&(l.selectedRoute={provider:o.route.provider,scenario:o.route.scenario??``,label:t(o.route.provider,o.route.scenario)}),c.networkCostUsd!==void 0&&(l.networkCost={value:c.networkCostUsd,formatted:a(c.networkCostUsd,s.i18n)}),c.priceImpactPercent!==void 0&&(l.priceImpact={value:c.priceImpactPercent,formatted:r(c.priceImpactPercent,s.i18n)}),{receiveAsset:{symbol:s.receiveSide.symbol,decimals:s.receiveSide.decimals,address:s.receiveSide.address,isNative:s.receiveSide.isNative,...s.receiveSide.assetLogoUrl?{assetLogoUrl:s.receiveSide.assetLogoUrl}:{},...s.receiveSide.networkId?{networkId:s.receiveSide.networkId}:{},networkName:n(s.receiveSide.networkName),eip155Id:String(s.receiveSide.chainId),...s.receiveSide.chainLogoUrl?{chainLogoUrl:s.receiveSide.chainLogoUrl}:{}},receiveAmount:{value:c.receiveAmount,formatted:i(c.receiveAmount,s.i18n,{maxDecimals:s.receiveSide.decimals})},...c.receiveAmountUsd===void 0?{}:{receiveAmountUsd:{value:c.receiveAmountUsd,formatted:a(c.receiveAmountUsd,s.i18n)}},quoteTotalSeconds:30,expiresAt:Math.min(c.expiresAt,s.now+30*1e3),...Object.keys(l).length>0?{breakdown:l}:{}}}export{o as quoteToWithdrawalPayload};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{classifyFailureKind as e,classifySettlementStatus as t}from"../../../shared/transformers/classifySettlementStatus.js";import{parseDecimalSafe as n,parseSmallestUnit as r}from"../../../shared/transformers/parseSmallestUnit.js";import{parseIsoMs as i}from"../../../shared/transformers/parseIsoMs.js";import{formatDurationCompact as a}from"../../../../shared/format/formatDurationCompact.js";import{formatTimestamp as o}from"../../../../shared/format/formatTimestamp.js";import{formatTokenAmount as s}from"../../../../shared/format/formatTokenAmount.js";import{shortenAddress as c}from"../../../../shared/format/shortenAddress.js";function l(e,n,r){let i=t(e.status);return i===`completed`?d(e,n,r):i===`failed`?f(e,n,r):u(e,n,r)}function u(e,t,n){let r=e.from,a=e.to,l=i(r?.confirmed_at)??i(e.created_at)??Date.now(),u=p(t,n),d=m(a,t.destination.asset_decimals)||m(r,r?.asset_decimals??t.destination.asset_decimals),f=t.destination.address,g=r?.tx_id,_=r?.eip155_id===void 0?void 0:Number(r.eip155_id);return{kind:`pending`,receiveAsset:u,receiveAmount:{value:d,formatted:s(d,n.i18n,{maxDecimals:t.destination.asset_decimals})},recipient:{value:f,formatted:c(f)},submittedAt:{value:l,formatted:o(l,n.i18n)},...g?{txHash:{value:g,formatted:c(g)},...h(n,_,g)?{txExplorerUrl:h(n,_,g)}:{}}:{}}}function d(e,t,n){let r=e.from,l=e.to,u=i(r?.confirmed_at)??i(e.created_at)??Date.now(),d=i(l?.settled_at)??i(e.updated_at)??Date.now(),f=Math.max(0,d-u),_=Math.round(f/1e3),v=p(t,n),y=m(l,t.destination.asset_decimals),b=t.destination.address,x=r?.tx_id??``,S=r?.eip155_id===void 0?void 0:Number(r.eip155_id),C=l?.tx_id,w=h(n,g(l?.eip155_id)??g(t.destination.eip155_id),C);return{kind:`succeeded`,receiveAsset:v,receiveAmount:{value:y,formatted:s(y,n.i18n,{maxDecimals:t.destination.asset_decimals})},recipient:{value:b,formatted:c(b)},submittedAt:{value:u,formatted:o(u,n.i18n)},filledAt:{value:d,formatted:o(d,n.i18n)},totalTime:{value:_,formatted:a(f,n.i18n)},txHash:{value:x,formatted:x?c(x):``},...h(n,S,x)?{txExplorerUrl:h(n,S,x)}:{},...C?{completionTx:{hash:{value:C,formatted:c(C)},...w?{explorerUrl:w}:{}}}:{}}}function f(t,n,r){let a=t.from,l=i(a?.confirmed_at)??i(t.created_at)??Date.now(),u=i(t.updated_at)??Date.now(),d=p(n,r),f=n.destination.address,m=a?.tx_id,g=a?.eip155_id===void 0?void 0:Number(a.eip155_id);return{kind:`failed`,failureKind:e(t.error),receiveAsset:d,receiveAmount:{value:0,formatted:s(0,r.i18n)},recipient:{value:f,formatted:c(f)},submittedAt:{value:l,formatted:o(l,r.i18n)},failedAt:{value:u,formatted:o(u,r.i18n)},...m?{txHash:{value:m,formatted:c(m)},...h(r,g,m)?{txExplorerUrl:h(r,g,m)}:{}}:{}}}function p(e,t){let n=t.receiveAssetEnrichment,r=Number(e.destination.eip155_id);return{symbol:e.destination.asset_symbol,decimals:e.destination.asset_decimals,address:e.destination.asset_address,isNative:!e.destination.asset_address,...n?.assetLogoUrl?{assetLogoUrl:n.assetLogoUrl}:{},networkId:e.destination.network_id,networkName:n?.networkName??e.destination.network_name,...Number.isFinite(r)?{eip155Id:e.destination.eip155_id}:{},...n?.chainLogoUrl?{chainLogoUrl:n.chainLogoUrl}:{}}}function m(e,t){if(!e)return 0;if(e.amount){let t=n(e.amount);if(t>0)return t}return e.raw_amount?r(e.raw_amount,t):0}function h(e,t,n){if(!n||t===void 0)return;let r=e.explorers?.[t];if(r)return`${r.replace(/\/+$/,``)}/tx/${n}`}function g(e){if(e==null||e===``)return;let t=Number(e);return Number.isFinite(t)?t:void 0}export{l as settlementToWithdrawalPayload};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{formatNetworkName as e}from"../../../../shared/format/formatNetworkName.js";function t(t,n={}){let r=n.excludedChainIds,i=[];for(let n of t.assets){if(r?.has(n.eip155_id))continue;let t=n.native_currency,a=new Set,o=(e,t)=>`${e.toUpperCase()}@${t.toLowerCase()}`,s=[];if(t?.symbol){let e={symbol:t.symbol,name:t.name??t.symbol,address:``,decimals:typeof t.decimals==`number`?t.decimals:18,isNative:!0,...t.logo?{assetLogoUrl:t.logo}:{}};s.push(e),a.add(o(e.symbol,e.address))}let c=t?.symbol?.toUpperCase();for(let e of n.assets){if(!e.symbol||!e.address||c&&e.symbol.toUpperCase()===c)continue;let t=o(e.symbol,e.address);a.has(t)||(a.add(t),s.push({symbol:e.symbol,name:e.name??e.symbol,address:e.address,decimals:e.decimals,isNative:!1,...e.logo?{assetLogoUrl:e.logo}:{}}))}s.length!==0&&i.push({networkId:n.network_id,networkName:e(n.network_name),eip155Id:n.eip155_id,...t?.logo?{chainLogoUrl:t.logo}:{},tokens:s})}return i.sort((e,t)=>e.eip155Id-t.eip155Id),i}export{t as supportedAssetsToReceiveOptionsPayload};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { Entity, SettlementFailureKind, TxRef } from "../../../shared/driver/types.js";
|
|
2
|
+
import { ReceiveOptionDto, ReceiveOptionsResponse, WithdrawableBalanceDto, WithdrawableBalancesResponse, WithdrawalQuoteDto, WithdrawalQuoteResponse, WithdrawalSettlementDto, WithdrawalSettlementResponse } from "./dto.js";
|
|
3
|
+
import { ReceiveChainPayload, ReceiveTokenOptionPayload, WithdrawableBalanceItemPayload, WithdrawalQuoteBreakdownPayload, WithdrawalQuotePayload, WithdrawalReceiveAssetPayload, WithdrawalSettlementFailurePayload, WithdrawalSettlementPayload, WithdrawalSettlementPendingPayload, WithdrawalSettlementSuccessPayload } from "./payloads.js";
|
|
4
|
+
|
|
5
|
+
//#region src/flows/withdraw/driver/types.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Snapshot of every reactive entity the withdraw driver exposes. Returned by
|
|
8
|
+
* {@link WithdrawDriver.getSnapshot} and consumed by `useSyncExternalStore`. The kit's
|
|
9
|
+
* `useWithdrawSnapshot()` hook returns this shape.
|
|
10
|
+
*
|
|
11
|
+
* Each field is an {@link Entity} envelope — components switch on `status` and read `payload` on
|
|
12
|
+
* the `ready` / `stale` variants.
|
|
13
|
+
*/
|
|
14
|
+
interface WithdrawSnapshot {
|
|
15
|
+
/**
|
|
16
|
+
* Withdrawable balance for the brand-currency tuple the driver was configured with. The
|
|
17
|
+
* V2 form ships single-source-row UX, so this list always has zero or one entry today; the
|
|
18
|
+
* shape stays array-typed so future variants can extend without a contract break.
|
|
19
|
+
*
|
|
20
|
+
* Backed by `sdk.balance.onchain(userAddress)` filtered to the configured `(networkId,
|
|
21
|
+
* assetSymbol)`. An empty wallet position surfaces as a single row with `amount.value === 0`.
|
|
22
|
+
*/
|
|
23
|
+
withdrawableBalances: Entity<ReadonlyArray<WithdrawableBalanceItemPayload>, WithdrawableBalancesResponse, WithdrawableBalancesResponse>;
|
|
24
|
+
/**
|
|
25
|
+
* Per-chain catalog of routable receive destinations. Drives the form's "Receive chain" /
|
|
26
|
+
* "Receive token" pickers. Derived from `Uda.supportedAssets()`.
|
|
27
|
+
*/
|
|
28
|
+
receiveOptions: Entity<ReadonlyArray<ReceiveChainPayload>, ReadonlyArray<ReceiveOptionDto>, ReceiveOptionsResponse>;
|
|
29
|
+
/**
|
|
30
|
+
* Active withdrawal quote. Drives the V2 form's "You will receive" summary row and the
|
|
31
|
+
* breakdown card's three metric rows. Transitions to `stale` on expiry.
|
|
32
|
+
*/
|
|
33
|
+
quote: Entity<WithdrawalQuotePayload, WithdrawalQuoteDto, WithdrawalQuoteResponse>;
|
|
34
|
+
/**
|
|
35
|
+
* Most-recent settlement observed for the active withdraw. The discriminated `kind` on the
|
|
36
|
+
* payload (`pending` / `succeeded` / `failed`) drives whether the in-progress / success /
|
|
37
|
+
* error state screen renders.
|
|
38
|
+
*/
|
|
39
|
+
settlement: Entity<WithdrawalSettlementPayload, WithdrawalSettlementDto, WithdrawalSettlementResponse>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Input to {@link WithdrawDriver.requestQuote}. The form widget builds this from current field
|
|
43
|
+
* values and fires it as the user types (debounced).
|
|
44
|
+
*/
|
|
45
|
+
interface RequestWithdrawalQuoteInput {
|
|
46
|
+
/** Source-side asset symbol the withdraw is drawing from (the brand-managed balance row). */
|
|
47
|
+
sourceAssetSymbol: string;
|
|
48
|
+
/** Source-side chain id (EIP-155). */
|
|
49
|
+
sourceChainId: number;
|
|
50
|
+
/** Send amount in display units. */
|
|
51
|
+
amount: number;
|
|
52
|
+
/** Receive-side token symbol the user picked on the form. */
|
|
53
|
+
receiveTokenSymbol: string;
|
|
54
|
+
/** Receive-side chain id (EIP-155). */
|
|
55
|
+
receiveChainId: number;
|
|
56
|
+
/** Recipient address the user typed (or pasted) into the form. */
|
|
57
|
+
recipientAddress: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Input to {@link WithdrawDriver.submitWithdrawal}. Identical to {@link RequestWithdrawalQuoteInput}
|
|
61
|
+
* — the live driver re-uses the most recent quote for submit, so the same identifying fields
|
|
62
|
+
* scope both calls.
|
|
63
|
+
*/
|
|
64
|
+
type SubmitWithdrawalInput = RequestWithdrawalQuoteInput;
|
|
65
|
+
/**
|
|
66
|
+
* Input to {@link WithdrawDriver.watchSettlement}. Carries the broadcast tx ref so the watcher
|
|
67
|
+
* can scope its poll to the in-flight withdraw.
|
|
68
|
+
*/
|
|
69
|
+
interface WatchWithdrawalSettlementInput {
|
|
70
|
+
tx: TxRef;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Input to {@link WithdrawDriver.watchWithdrawableBalances}. Optional listener — the form's
|
|
74
|
+
* source-side display reflects whatever the driver surfaces (no parameters needed today; the
|
|
75
|
+
* shape is reserved for future filters).
|
|
76
|
+
*/
|
|
77
|
+
type WatchWithdrawableBalancesInput = Record<string, never>;
|
|
78
|
+
/**
|
|
79
|
+
* Withdraw driver contract. Mirrors {@link import("#/flows/deposit/driver").DepositDriver}'s
|
|
80
|
+
* shape (host-supplied source of reactive data + imperative actions) but scoped to the withdraw
|
|
81
|
+
* flow. The driver also implements the `useSyncExternalStore` contract (`subscribe` +
|
|
82
|
+
* `getSnapshot`) so `<KitProvider />` + `useWithdrawSnapshot()` get standard React 18+
|
|
83
|
+
* external-store semantics.
|
|
84
|
+
*
|
|
85
|
+
* Two implementations ship from the kit:
|
|
86
|
+
*
|
|
87
|
+
* - `@stridge/kit/drivers/stridge-mock` — deterministic mock backed by synthetic fixtures. Used
|
|
88
|
+
* by demos, Storybook, tests, and any `<KitProvider />` mount that doesn't need a live gateway.
|
|
89
|
+
* - `@stridge/kit/drivers/stridge` — the live Stridge gateway driver
|
|
90
|
+
* (`createStridgeWithdrawDriver`).
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
*
|
|
94
|
+
* ```tsx
|
|
95
|
+
* import { createStridgeMockWithdrawDriver } from "@stridge/kit/drivers/stridge-mock";
|
|
96
|
+
* import { KitProvider } from "@stridge/kit";
|
|
97
|
+
*
|
|
98
|
+
* const { driver } = createStridgeMockWithdrawDriver();
|
|
99
|
+
*
|
|
100
|
+
* <KitProvider withdraw={driver}>
|
|
101
|
+
* <YourApp />
|
|
102
|
+
* </KitProvider>;
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
interface WithdrawDriver {
|
|
106
|
+
/** Read the current snapshot of every reactive entity (used by `useSyncExternalStore`). */
|
|
107
|
+
getSnapshot(): WithdrawSnapshot;
|
|
108
|
+
/** Subscribe to entity transitions outside React (analytics, headless integrations). */
|
|
109
|
+
subscribe(listener: () => void): () => void;
|
|
110
|
+
/**
|
|
111
|
+
* Fetches a fresh quote for `input` and updates the `quote` entity through its lifecycle
|
|
112
|
+
* (`idle | loading → ready | error`). The `signal` cancels in-flight work.
|
|
113
|
+
*/
|
|
114
|
+
requestQuote(input: RequestWithdrawalQuoteInput, signal: AbortSignal): Promise<void>;
|
|
115
|
+
/**
|
|
116
|
+
* Submits the confirmed withdrawal. Resolves with the broadcast tx ref. The settlement
|
|
117
|
+
* watcher takes over from there to populate the `settlement` entity.
|
|
118
|
+
*/
|
|
119
|
+
submitWithdrawal(input: SubmitWithdrawalInput, signal: AbortSignal): Promise<TxRef>;
|
|
120
|
+
/**
|
|
121
|
+
* Watches the settlement entity through its lifecycle (pending → succeeded / failed). The
|
|
122
|
+
* listener fires on every transition with the new envelope; the FSM consumes these via the
|
|
123
|
+
* snapshot subscribe path.
|
|
124
|
+
*/
|
|
125
|
+
watchSettlement(input: WatchWithdrawalSettlementInput, listener: (entity: WithdrawSnapshot["settlement"]) => void, signal: AbortSignal): void;
|
|
126
|
+
/**
|
|
127
|
+
* Optional balances watcher — when supplied, the driver pushes withdrawable-balance updates
|
|
128
|
+
* into its own snapshot. Hosts that surface a static brand-side balance can omit this.
|
|
129
|
+
*/
|
|
130
|
+
watchWithdrawableBalances?(input: WatchWithdrawableBalancesInput, listener: (entity: WithdrawSnapshot["withdrawableBalances"]) => void, signal: AbortSignal): void;
|
|
131
|
+
}
|
|
132
|
+
//#endregion
|
|
133
|
+
export { RequestWithdrawalQuoteInput, SubmitWithdrawalInput, WatchWithdrawableBalancesInput, WatchWithdrawalSettlementInput, WithdrawDriver, WithdrawSnapshot };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { WithdrawState } from "./types.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
//#region src/flows/withdraw/orchestrator/controller.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Read the **logical** withdraw state — what the reducer says. Transitions to `closed` are
|
|
6
|
+
* surfaced synchronously, so this is the right hook for "is the dialog open?" gating, analytics,
|
|
7
|
+
* and any headless UI that drives off live machine state.
|
|
8
|
+
*/
|
|
9
|
+
declare function useWithdrawState(): WithdrawState;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { useWithdrawState };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useLingui as e}from"../../../shared/i18n/useLingui.js";import"../../../i18n/index.js";import{toFailure as t}from"../../../shared/orchestrator/toFailure.js";import{useDriverSettlementListener as n}from"../../../shared/orchestrator/useDriverSettlementListener.js";import{useEffectiveState as r}from"../../../shared/orchestrator/useEffectiveState.js";import{useSettlementWatcher as i}from"../../../shared/orchestrator/useSettlementWatcher.js";import"../../../shared/orchestrator/index.js";import{useWithdrawDriverInstance as a}from"../driver/context.js";import{initialState as o,reducer as s}from"./reducer.js";import{createContext as c,use as l,useCallback as u,useMemo as d,useReducer as f,useRef as p}from"react";import{jsx as m}from"react/jsx-runtime";const h={id:`ldK3jJ`,message:`Failed to submit withdrawal.`},g={id:`kUFhUv`,message:`Withdrawal failed.`},_=c(null);_.displayName=`WithdrawControllerContext`;function v(){let e=l(_);if(!e)throw Error(`useWithdraw / WithdrawControllerProvider must be used inside <KitProvider withdraw={…} />. Mount KitProvider once at the host's app root with a withdraw driver.`);return e}function y(){return v().state}function b(){return v().effectiveState}function x(){return v().actions}function S({children:e}){let t=a(),[n,c]=f(s,o),l=w(n,c,t);i(t,n.name===`inProgress`?n.ctx.tx:void 0),T(n,c,t);let u=r(n),p=C(c,l);return m(_,{value:d(()=>({state:n,effectiveState:u,dispatch:c,controller:p,actions:l}),[n,u,p,l]),children:e})}function C(e,t){let n=u(()=>{e({type:`OPEN`})},[e]),r=u(()=>{e({type:`CLOSE`})},[e]);return d(()=>({open:n,close:r,actions:t}),[n,r,t])}function w(n,r,i){let a=p(n);a.current=n;let o=p(i);o.current=i;let s=p(r);s.current=r;let{i18n:c}=e(),l=p(c);l.current=c;let f=u(e=>{let n=o.current;s.current({type:`SUBMIT`,input:e});let r=new AbortController,i={sourceAssetSymbol:e.sourceAssetSymbol,sourceChainId:e.sourceChainId,amount:e.amount,receiveTokenSymbol:e.receiveTokenSymbol,receiveChainId:e.receiveChainId,recipientAddress:e.recipientAddress};n.submitWithdrawal(i,r.signal).then(e=>{r.signal.aborted||s.current({type:`SUBMIT_CONFIRMED`,tx:e})}).catch(n=>{r.signal.aborted||s.current({type:`SUBMIT_FAILED`,failure:t(n,l.current._(h)),input:e})})},[]),m=u(()=>{s.current({type:`CLOSE`})},[]),g=u(()=>{s.current({type:`RESET`})},[]),_=u(()=>{s.current({type:`CLEAR_NOTICE`})},[]);return d(()=>({submit:f,close:m,reset:g,clearNotice:_}),[f,m,g,_])}function T(t,r,i){let a=p(t);a.current=t;let{i18n:o}=e(),s=p(o);s.current=o,n(i,(e,t)=>{if(a.current.name===`inProgress`){if(e===`succeeded`){r({type:`SETTLEMENT_SUCCEEDED`});return}if(e===`failed`){let e=t.settlement,n=e.status===`ready`||e.status===`stale`?e.payload:null,i=n&&n.kind===`failed`?{reason:s.current._(g),code:n.failureKind}:void 0;r({type:`SETTLEMENT_FAILED`,...i?{failure:i}:{}})}}})}export{S as WithdrawControllerProvider,v as useControllerContext,x as useWithdrawActions,b as useWithdrawEffectiveState,y as useWithdrawState};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { FailureInfo } from "../../../shared/orchestrator/types.js";
|
|
2
|
+
import { WithdrawActions, WithdrawController, WithdrawEvent, WithdrawState, WithdrawStateName, WithdrawalFormSnapshot } from "./types.js";
|
|
3
|
+
import { useWithdrawState } from "./controller.js";
|
|
4
|
+
import { useWithdraw } from "./useWithdraw.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./controller.js";import"./useWithdraw.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isUserRejectionFailure as e}from"../../../shared/orchestrator/userRejection.js";import"../../../shared/orchestrator/index.js";const t={name:`closed`};function n(e,t){switch(e.name){case`closed`:return r(t);case`form`:return i(e,t);case`submitting`:return a(e,t);case`inProgress`:return o(e,t);case`success`:return s(e,t);case`error`:return c(e,t);default:return l(e)}}function r(e){return e.type===`OPEN`?{name:`form`}:{name:`closed`}}function i(e,t){switch(t.type){case`SUBMIT`:return{name:`submitting`,ctx:{input:t.input}};case`CLEAR_NOTICE`:return e.ctx?.notice?{name:`form`}:e;case`CLOSE`:return{name:`closed`};default:return e}}function a(t,n){switch(n.type){case`SUBMIT_CONFIRMED`:return{name:`inProgress`,ctx:{input:t.ctx.input,tx:n.tx}};case`SUBMIT_FAILED`:return e(n.failure)?{name:`form`,ctx:{notice:n.failure.reason}}:{name:`error`,ctx:{input:n.input,failure:n.failure}};case`CLOSE`:return{name:`closed`};default:return t}}function o(e,t){switch(t.type){case`SETTLEMENT_SUCCEEDED`:return{name:`success`,ctx:{input:e.ctx.input,tx:e.ctx.tx}};case`SETTLEMENT_FAILED`:return{name:`error`,ctx:{input:e.ctx.input,tx:e.ctx.tx,...t.failure?{failure:t.failure}:{}}};case`CLOSE`:return{name:`closed`};default:return e}}function s(e,t){switch(t.type){case`RESET`:return{name:`form`};case`CLOSE`:return{name:`closed`};default:return e}}function c(e,t){switch(t.type){case`RESET`:return{name:`form`};case`CLOSE`:return{name:`closed`};default:return e}}function l(e){throw Error(`Unhandled withdraw state: ${JSON.stringify(e)}`)}export{t as initialState,n as reducer};
|