@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,77 @@
|
|
|
1
|
+
//#region src/drivers/stridge/rpc.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Internal Stridge driver RPC.
|
|
4
|
+
*
|
|
5
|
+
* Stridge nodes are used here ONLY for receipt polling of the tx the driver itself just
|
|
6
|
+
* broadcast. They are deliberately not exposed as a public helper / wagmi transport — host apps
|
|
7
|
+
* own their own wagmi config and generic RPC traffic. This boundary keeps Stridge from
|
|
8
|
+
* accidentally absorbing 200k+ unrelated requests/day from a host's full app.
|
|
9
|
+
*
|
|
10
|
+
* Future backend work will replace this browser-direct call with a payment-intent-scoped RPC
|
|
11
|
+
* token + per-intent rate limit; the current scope only addresses accidental abuse from global
|
|
12
|
+
* host traffic.
|
|
13
|
+
*
|
|
14
|
+
* Implementation note: HTTP + JSON-RPC mechanics ride on viem's `http()` transport and `Client`.
|
|
15
|
+
* We don't use viem's `waitForTransactionReceipt` — it doesn't accept an `AbortSignal` and would
|
|
16
|
+
* keep the underlying `watchBlockNumber` observer running after the caller stops awaiting. The
|
|
17
|
+
* tight abort semantics matter here (the kit cancels the wait when the dialog closes), so we
|
|
18
|
+
* keep our own poll loop on top of viem's typed actions.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Subdomain slug for the Stridge nodes proxy. The proxy exposes every chain at two equivalent
|
|
22
|
+
* subdomains — both route through the same provider list with identical failover behavior. See
|
|
23
|
+
* `stridge-foundation/nodes-proxy`:
|
|
24
|
+
*
|
|
25
|
+
* - **number** — the EIP-155 chain id (`1`, `56`, `137`, `42161`, `8453`, `11155111`, …).
|
|
26
|
+
* Use this for EVM chains, where `chain_type === "EVM"` in the supportedAssets catalog.
|
|
27
|
+
* - **string** — the proxy's chain-name slug (`"eth"`, `"solana"`, `"bsc"`, …). Required for
|
|
28
|
+
* chains without an EIP-155 id (e.g. Solana — `chain_type === "SOL"`).
|
|
29
|
+
*
|
|
30
|
+
* The Stridge driver passes the EIP-155 id today (every supported flow is EVM). A future
|
|
31
|
+
* non-EVM driver passes the catalog's `network_symbol` instead.
|
|
32
|
+
*/
|
|
33
|
+
type StridgeChainSlug = number | string;
|
|
34
|
+
interface StridgeRpcConfig {
|
|
35
|
+
/**
|
|
36
|
+
* Optional advanced override for tests / self-hosted proxy. Defaults to
|
|
37
|
+
* `https://${chain}.nodes.stridge.com`. Must contain the literal `${chain}` placeholder,
|
|
38
|
+
* which is replaced with the EIP-155 id (numeric form) or the chain-name slug (string form).
|
|
39
|
+
*
|
|
40
|
+
* Not a general host wagmi transport — only consumed by the Stridge driver's own payment-tx
|
|
41
|
+
* receipt polling.
|
|
42
|
+
*/
|
|
43
|
+
template?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Per-request fetch timeout in ms. Defaults to {@link DEFAULT_TIMEOUT_MS}. Each poll iteration
|
|
46
|
+
* uses this independently — `waitForTransactionReceipt` keeps retrying until the caller's
|
|
47
|
+
* `signal` aborts.
|
|
48
|
+
*/
|
|
49
|
+
timeoutMs?: number;
|
|
50
|
+
}
|
|
51
|
+
interface StridgeRpcWaitInput {
|
|
52
|
+
/** EIP-155 id for EVM chains, or chain-name slug for non-EVM (see {@link StridgeChainSlug}). */
|
|
53
|
+
chain: StridgeChainSlug;
|
|
54
|
+
hash: `0x${string}`;
|
|
55
|
+
/** Confirmations to wait on before resolving. Defaults to 1. */
|
|
56
|
+
confirmations?: number;
|
|
57
|
+
/** Polling cadence between `eth_getTransactionReceipt` calls. Defaults to 1000ms. */
|
|
58
|
+
pollingIntervalMs?: number;
|
|
59
|
+
signal: AbortSignal;
|
|
60
|
+
}
|
|
61
|
+
interface StridgeRpc {
|
|
62
|
+
/**
|
|
63
|
+
* Poll Stridge nodes via JSON-RPC until the broadcast tx is mined to the requested
|
|
64
|
+
* confirmation depth. Resolves with the receipt's `transactionHash` (captures wallet
|
|
65
|
+
* replacements like speed-ups / cancels where the mined hash diverges from the broadcast hash).
|
|
66
|
+
*/
|
|
67
|
+
waitForTransactionReceipt(input: StridgeRpcWaitInput): Promise<`0x${string}`>;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Build the Stridge driver's RPC client. Internal — surfaced via
|
|
71
|
+
* {@link import("./types").StridgeDriverConfig.rpc} for tests / advanced injection only. Not a
|
|
72
|
+
* general-purpose wagmi transport; the driver scopes Stridge nodes to receipt polling for txs it
|
|
73
|
+
* itself broadcast.
|
|
74
|
+
*/
|
|
75
|
+
declare function createStridgeRpc(config?: StridgeRpcConfig): StridgeRpc;
|
|
76
|
+
//#endregion
|
|
77
|
+
export { StridgeChainSlug, StridgeRpc, StridgeRpcConfig, StridgeRpcWaitInput, createStridgeRpc };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createClient as e,hexToNumber as t,http as n}from"viem";import{getTransactionReceipt as r}from"viem/actions";const i="${chain}";function a(t={}){let i=t.template,a=t.timeoutMs??1e4,l=new Map;function f(t){let r=c(t,i),o=l.get(r);return o||(o=e({transport:n(r,{timeout:a,retryCount:0})}),l.set(r,o)),o}return{async waitForTransactionReceipt(e){let{chain:t,hash:n,signal:i}=e,a=e.confirmations??1,c=e.pollingIntervalMs??1e3,l=f(t);for(u(i);;){let e=null;try{e=await r(l,{hash:n})}catch(e){if(!s(e))throw e}if(e){if(a<=1)return e.transactionHash??n;let t=await o(l),r=e.blockNumber;if((t>=r?t-r+1n:0n)>=BigInt(a))return e.transactionHash??n}await d(c,i)}}}}async function o(e){let n=await e.request({method:`eth_blockNumber`});return BigInt(t(n))}function s(e){return e instanceof Error&&e.name===`TransactionReceiptNotFoundError`}function c(e,t){let n=l(e);if(t!==void 0){if(!t.includes(i))throw Error(`Stridge RPC: template must contain the literal "${i}" placeholder.`);return t.replace(i,n)}return`https://${n}.nodes.stridge.com`}function l(e){if(typeof e==`number`){if(!Number.isInteger(e)||e<=0)throw Error(`Stridge RPC: numeric chain id must be a positive integer (got ${e}).`);return String(e)}if(typeof e!=`string`||!/^[a-z0-9][a-z0-9-]*$/.test(e))throw Error(`Stridge RPC: chain name slug must be lowercase letters, digits, or dashes (got ${JSON.stringify(e)}).`);return e}function u(e){if(e.aborted)throw new DOMException(`Aborted`,`AbortError`)}function d(e,t){return new Promise((n,r)=>{if(t.aborted){r(new DOMException(`Aborted`,`AbortError`));return}let i=setTimeout(()=>{t.removeEventListener(`abort`,a),n()},e),a=()=>{clearTimeout(i),t.removeEventListener(`abort`,a),r(new DOMException(`Aborted`,`AbortError`))};t.addEventListener(`abort`,a,{once:!0})})}export{a as createStridgeRpc};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { ConfirmTransferToken } from "../../shared/widgets/confirm-transfer/compound/types.js";
|
|
2
|
+
import { StridgeRpc } from "./rpc.js";
|
|
3
|
+
import * as _$react from "react";
|
|
4
|
+
import { Config } from "wagmi";
|
|
5
|
+
|
|
6
|
+
//#region src/drivers/stridge/types.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Token metadata passed to {@link StridgeDriverConfig.resolveTokenIcon}.
|
|
9
|
+
*/
|
|
10
|
+
interface StridgeTokenIconResolverEntry {
|
|
11
|
+
chainId: number;
|
|
12
|
+
tokenAddress: string;
|
|
13
|
+
symbol: string;
|
|
14
|
+
isNative: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Optional polling cadence overrides for Stridge subscriptions.
|
|
18
|
+
*/
|
|
19
|
+
interface StridgePollIntervals {
|
|
20
|
+
/** While the kit is in `transferCrypto` waiting for the first deposit. Defaults to `2000`. */
|
|
21
|
+
detectionMs?: number;
|
|
22
|
+
/** While the kit is in `processing` and the settlement is not yet terminal. Defaults to `2000`. */
|
|
23
|
+
processingMs?: number;
|
|
24
|
+
/** Once the settlement has reached `completed` or `failed`. Defaults to `10_000`. */
|
|
25
|
+
terminalMs?: number;
|
|
26
|
+
/** Source-balance refresh cadence. Defaults to `60_000`. */
|
|
27
|
+
balancesMs?: number;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* API host the driver targets. `"production"` (default) routes through `api.stridge.com`;
|
|
31
|
+
* `"staging"` routes through `api.stridge.dev`. The kit accepts these friendly names so hosts
|
|
32
|
+
* never have to thread the SDK's internal `"prod" | "dev"` terminology through their config.
|
|
33
|
+
*/
|
|
34
|
+
type StridgeEnvironment = "production" | "staging";
|
|
35
|
+
/** Default {@link StridgeEnvironment} when {@link StridgeDriverConfig.environment} is omitted. */
|
|
36
|
+
declare const STRIDGE_DEFAULT_ENVIRONMENT = "production";
|
|
37
|
+
/**
|
|
38
|
+
* Default low-balance / amount-entry floor in USD used when {@link StridgeDriverConfig.minDepositUsd}
|
|
39
|
+
* is omitted. Hosts can override per project (some perp DEXes want a higher floor than $3).
|
|
40
|
+
*/
|
|
41
|
+
declare const STRIDGE_DEFAULT_MIN_DEPOSIT_USD = 3;
|
|
42
|
+
/**
|
|
43
|
+
* Settlement destination for `gateway/start`. Mirrors the wire shape so hosts don't have to reach
|
|
44
|
+
* for the SDK's `GatewayStartRequest.destination` type — every field corresponds 1:1.
|
|
45
|
+
*/
|
|
46
|
+
interface StridgeDriverDestination {
|
|
47
|
+
/** Stridge network id (string-encoded). E.g. `"60"` for Ethereum mainnet, `"9006"` for BSC. */
|
|
48
|
+
network_id: string;
|
|
49
|
+
/** Destination asset symbol (e.g. `"USDC"`, `"USDT"`). */
|
|
50
|
+
asset_symbol: string;
|
|
51
|
+
/**
|
|
52
|
+
* Settlement recipient address. Defaults to {@link StridgeDriverConfig.userAddress} (same-owner
|
|
53
|
+
* pattern — the gateway enforces this server-side for projects without a destination override).
|
|
54
|
+
* Pass an explicit value when the host routes settlements to a different account than the
|
|
55
|
+
* connected wallet.
|
|
56
|
+
*/
|
|
57
|
+
to_address?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Configuration accepted by {@link createStridgeDriver}.
|
|
61
|
+
*/
|
|
62
|
+
interface StridgeDriverConfig {
|
|
63
|
+
/** Connected wallet EOA. Threaded as `gateway/start.owner` and (by default) as the settlement recipient. */
|
|
64
|
+
userAddress: string;
|
|
65
|
+
/**
|
|
66
|
+
* Stridge project key — sent as `X-Gateway-Key` by the SDK's HttpClient.
|
|
67
|
+
* Pull from your workspace dashboard (Developer → Gateway Kit → Connection).
|
|
68
|
+
*/
|
|
69
|
+
projectKey: string;
|
|
70
|
+
/**
|
|
71
|
+
* Which Stridge API host to target. Defaults to {@link STRIDGE_DEFAULT_ENVIRONMENT}
|
|
72
|
+
* (`"production"` → `api.stridge.com`). Pass `"staging"` to route through `api.stridge.dev`
|
|
73
|
+
* for integration testing — note that staging gateway keys won't authenticate against
|
|
74
|
+
* production and vice versa.
|
|
75
|
+
*/
|
|
76
|
+
environment?: StridgeEnvironment;
|
|
77
|
+
/**
|
|
78
|
+
* Settle destination for the wallet flow's `gateway/start` payload. The kit was hardcoded to
|
|
79
|
+
* `USDC` on Ethereum at first; making this required at the config layer lets each host pick
|
|
80
|
+
* its own pair (e.g. BSC USDC for a BSC-native merchant) without forking the driver.
|
|
81
|
+
*/
|
|
82
|
+
destination: StridgeDriverDestination;
|
|
83
|
+
/**
|
|
84
|
+
* Low-balance / amount-entry USD floor. Drives the asset-picker's "Low balance" pill and the
|
|
85
|
+
* amount-entry hero's `min` / `initialAmount` (via {@link toKitTarget}). Defaults to
|
|
86
|
+
* {@link STRIDGE_DEFAULT_MIN_DEPOSIT_USD} when omitted.
|
|
87
|
+
*/
|
|
88
|
+
minDepositUsd?: number;
|
|
89
|
+
/**
|
|
90
|
+
* Optional metadata persisted on the UDA at `gateway/start` time. Echoed back on
|
|
91
|
+
* `gateway/{owner}` and webhook payloads. Treat as untrusted display data.
|
|
92
|
+
*/
|
|
93
|
+
metadata?: Record<string, unknown>;
|
|
94
|
+
/**
|
|
95
|
+
* Per-chain block-explorer base URL keyed by EIP-155 id. The driver appends `/tx/{hash}` to the
|
|
96
|
+
* matching entry when building `TxRef.explorerUrl`. Hosts typically derive this map from `viem`
|
|
97
|
+
* chain definitions; the driver itself doesn't bundle one.
|
|
98
|
+
*/
|
|
99
|
+
explorers?: Record<number, string>;
|
|
100
|
+
/**
|
|
101
|
+
* Optional icon resolver for source assets. Returning `undefined` falls back to upstream logos.
|
|
102
|
+
*/
|
|
103
|
+
resolveTokenIcon?: (entry: StridgeTokenIconResolverEntry) => string | undefined;
|
|
104
|
+
/** Polling cadence overrides. */
|
|
105
|
+
pollIntervals?: StridgePollIntervals;
|
|
106
|
+
/**
|
|
107
|
+
* Wagmi config used to sign and broadcast transfers. Receipt polling is intentionally NOT
|
|
108
|
+
* routed through this — the driver uses an internal Stridge RPC client (see `rpc.ts`) so
|
|
109
|
+
* deposits don't depend on the host's wagmi public client (which falls
|
|
110
|
+
* through to viem's hard-coded public defaults — unreliable for live tx flow).
|
|
111
|
+
*/
|
|
112
|
+
wagmiConfig: Config;
|
|
113
|
+
/**
|
|
114
|
+
* Advanced escape hatch: inject a custom Stridge RPC client (e.g. for tests or a self-hosted
|
|
115
|
+
* proxy). Defaults to a client that targets `https://${chainId}.nodes.stridge.com`.
|
|
116
|
+
*
|
|
117
|
+
* This is driver-internal RPC — NOT a general-purpose host wagmi transport. Stridge nodes are
|
|
118
|
+
* scoped to receipt polling for the tx the driver itself just submitted; do not use this
|
|
119
|
+
* hatch to fan out arbitrary host-app reads.
|
|
120
|
+
*/
|
|
121
|
+
rpc?: StridgeRpc;
|
|
122
|
+
/**
|
|
123
|
+
* Block confirmations to wait on before the kit treats the broadcast tx as mined. Defaults to `1`,
|
|
124
|
+
* which is appropriate for almost every chain the gateway supports. Forwarded to the Stridge
|
|
125
|
+
* RPC client.
|
|
126
|
+
*/
|
|
127
|
+
receiptConfirmations?: number;
|
|
128
|
+
/**
|
|
129
|
+
* Receipt polling interval in milliseconds while waiting for mining. Forwarded to the Stridge
|
|
130
|
+
* RPC client.
|
|
131
|
+
*/
|
|
132
|
+
receiptPollingIntervalMs?: number;
|
|
133
|
+
/**
|
|
134
|
+
* Optional display overrides for confirm-deposit labels and icons.
|
|
135
|
+
*/
|
|
136
|
+
confirmDisplay?: {
|
|
137
|
+
sourceLabel?: string;
|
|
138
|
+
sourceIcon?: _$react.ReactNode;
|
|
139
|
+
destinationLabel?: string;
|
|
140
|
+
destinationIcon?: _$react.ReactNode;
|
|
141
|
+
receiveToken?: ConfirmTransferToken;
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
//#endregion
|
|
145
|
+
export { STRIDGE_DEFAULT_ENVIRONMENT, STRIDGE_DEFAULT_MIN_DEPOSIT_USD, StridgeDriverConfig, StridgeDriverDestination, StridgeEnvironment, StridgePollIntervals, StridgeTokenIconResolverEntry };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=`production`,t=3;export{e as STRIDGE_DEFAULT_ENVIRONMENT,t as STRIDGE_DEFAULT_MIN_DEPOSIT_USD};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{numberToHex as e}from"viem";import{getAccount as t,getConnectorClient as n,switchChain as r}from"wagmi/actions";function i(i){return{async signAndBroadcastStep(o,s){a(s);let c=t(i.wagmiConfig);if(!c.address)throw Error(`Connect a wallet to sign and submit the deposit.`);c.chainId!==o.chainId&&await r(i.wagmiConfig,{chainId:o.chainId}),a(s);let l=o.from??c.address;if(!l)throw Error(`Stridge driver: no connected wallet address available to broadcast the deposit tx.`);return await(await n(i.wagmiConfig,{chainId:o.chainId})).request({method:`eth_sendTransaction`,params:[{from:l,to:o.to,data:o.data,value:e(o.value),chainId:e(o.chainId)}]})}}}function a(e){if(e.aborted)throw new DOMException(`Aborted`,`AbortError`)}export{i as createWagmiSigner};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { WalletInfo } from "../../flows/deposit/driver/payloads.js";
|
|
2
|
+
import { DepositDriver, DepositSnapshot } from "../../flows/deposit/driver/types.js";
|
|
3
|
+
import { MockAssetSelection } from "./fixtures.js";
|
|
4
|
+
import { MockTriggers } from "./triggers.js";
|
|
5
|
+
import { I18n } from "@lingui/core";
|
|
6
|
+
|
|
7
|
+
//#region src/drivers/stridge-mock/createStridgeMockDriver.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* Per-call latency budgets the mock driver imposes to mirror production cadence — a quote
|
|
10
|
+
* round-trip feels like ~1.4s, the wallet signature loop runs ~4s, the source-chain detection
|
|
11
|
+
* lands ~4s after submit, and the terminal settlement verdict resolves ~3s after pending. Hosts
|
|
12
|
+
* can override individual fields when scripting tests / Storybook scenarios that need
|
|
13
|
+
* tighter / longer windows.
|
|
14
|
+
*/
|
|
15
|
+
interface MockDriverLatency {
|
|
16
|
+
/** `requestQuote` resolves after this many ms. */
|
|
17
|
+
quote?: number;
|
|
18
|
+
/** `submitDeposit` (signature loop) resolves after this many ms. */
|
|
19
|
+
submit?: number;
|
|
20
|
+
/** Time between `submitDeposit` returning and the settlement entity flipping to `pending`. */
|
|
21
|
+
processingPendingDelay?: number;
|
|
22
|
+
/** Time between `pending` and the terminal verdict (`succeeded` / `failed`). */
|
|
23
|
+
processingTerminal?: number;
|
|
24
|
+
/** Path B — `watchSourceTx` listener fires after this many ms. */
|
|
25
|
+
transferDetected?: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Configuration for {@link createStridgeMockDriver}. Every field is optional — calling the
|
|
29
|
+
* factory with no arguments produces a fully seeded driver against the bundled captured-production
|
|
30
|
+
* fixtures.
|
|
31
|
+
*/
|
|
32
|
+
interface CreateStridgeMockDriverInput {
|
|
33
|
+
/**
|
|
34
|
+
* Stable `I18n` ref-getter. The driver re-runs transformers on read so locale flips don't
|
|
35
|
+
* re-bootstrap. When omitted, falls back to the kit's English-only {@link defaultI18n}
|
|
36
|
+
* — useful for tests that don't mount a `<KitProvider>`.
|
|
37
|
+
*/
|
|
38
|
+
getI18n?: () => I18n;
|
|
39
|
+
/** Connected wallet info. When omitted, defaults to {@link DEFAULT_WALLET_INFO}. */
|
|
40
|
+
wallet?: WalletInfo;
|
|
41
|
+
/** Optional minimum-deposit USD floor surfaced on `target.payload.minDepositUsd`. */
|
|
42
|
+
minDepositUsd?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Settlement-destination override — a `{ chain, symbol }` selector resolved against the
|
|
45
|
+
* mock's bundled catalog ({@link SAMPLE_DEPOSIT_CHAINS} via {@link resolveMockAsset}). Drives
|
|
46
|
+
* `target` / `quote.receiveAsset` / `settlement.creditedAsset` so the dialog renders against
|
|
47
|
+
* the chosen destination instead of the default USDC-on-BSC fixture. Unknown combinations
|
|
48
|
+
* fall back to USDC on BSC so the picker can never crash the playground.
|
|
49
|
+
*/
|
|
50
|
+
asset?: MockAssetSelection;
|
|
51
|
+
/**
|
|
52
|
+
* Initial entity-store overrides. Merged per-key with a shallow spread — keys present here
|
|
53
|
+
* replace the bundled-fixture entity wholesale, so each value must be a complete
|
|
54
|
+
* {@link Entity} envelope (or one of the empty `{ status: "idle" | "loading" }` variants).
|
|
55
|
+
* Omitted keys keep the bundled fixture. Used by canvas cards / Storybook to seed a static
|
|
56
|
+
* state.
|
|
57
|
+
*/
|
|
58
|
+
initialState?: Partial<DepositSnapshot>;
|
|
59
|
+
/**
|
|
60
|
+
* Per-call latency overrides — demos / Storybook scenarios that need tighter (or longer)
|
|
61
|
+
* windows can tweak individual fields. Defaults match production-feel cadence; tests should
|
|
62
|
+
* pass `{ quote: 0, submit: 0, … }` so the FSM walks through deterministically without
|
|
63
|
+
* `vi.useFakeTimers`.
|
|
64
|
+
*/
|
|
65
|
+
latency?: MockDriverLatency;
|
|
66
|
+
/**
|
|
67
|
+
* Terminal verdict the driver auto-transitions to after the user submits a deposit. Defaults
|
|
68
|
+
* to `"succeeded"` so the happy path runs end-to-end. Set `"failed"` to exercise the failure
|
|
69
|
+
* branch, or `"none"` to leave the settlement in `pending` (callers drive terminals via
|
|
70
|
+
* `triggers` instead).
|
|
71
|
+
*/
|
|
72
|
+
autoSettleTo?: "succeeded" | "failed" | "none";
|
|
73
|
+
/**
|
|
74
|
+
* When set, calling `triggers.triggerSettlementPending()` schedules a follow-up
|
|
75
|
+
* `triggers.triggerSettlementSuccess()` after this many ms — keeps the prototype loop short
|
|
76
|
+
* for the canvas / headless trigger panels. Defaults to 3500. Pass `null` to disable (tests
|
|
77
|
+
* that want to inspect the pending state in isolation should opt out).
|
|
78
|
+
*/
|
|
79
|
+
pendingTriggerToSuccessMs?: number | null;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Result of {@link createStridgeMockDriver}. The `driver` value satisfies {@link DepositDriver} and is
|
|
83
|
+
* the only argument `<KitProvider deposit={…} />` cares about. The `triggers` value is mock-only —
|
|
84
|
+
* the canvas-mode panel and Storybook control surfaces use it to mutate entity state without
|
|
85
|
+
* driving the full happy path.
|
|
86
|
+
*/
|
|
87
|
+
interface MockDriverHandle {
|
|
88
|
+
driver: DepositDriver;
|
|
89
|
+
triggers: MockTriggers;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Build a programmatic {@link DepositDriver} backed by deterministic in-memory state. Used by demos,
|
|
93
|
+
* tests, Storybook, and any `<KitProvider />` mount that doesn't have a Stridge gateway key
|
|
94
|
+
* available. Realistic captured-production fixtures pre-seed every entity so widgets render
|
|
95
|
+
* straight away — no orchestrated walk-through required to populate the dialog.
|
|
96
|
+
*
|
|
97
|
+
* The factory's two return values separate the contract surface from the mock-specific
|
|
98
|
+
* affordances:
|
|
99
|
+
*
|
|
100
|
+
* - `driver` — a clean {@link DepositDriver}. Pass to `<KitProvider />`. Production code never sees
|
|
101
|
+
* anything else.
|
|
102
|
+
* - `triggers` — mock-only {@link MockTriggers}. Pass to canvas / Storybook panels; never to
|
|
103
|
+
* `<KitProvider />`.
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
*
|
|
107
|
+
* ```tsx
|
|
108
|
+
* import { createStridgeMockDriver } from "@stridge/kit/drivers/stridge-mock";
|
|
109
|
+
*
|
|
110
|
+
* const { driver, triggers } = createStridgeMockDriver({ getI18n: () => i18n });
|
|
111
|
+
*
|
|
112
|
+
* <KitProvider deposit={driver}>
|
|
113
|
+
* <DepositDialog />
|
|
114
|
+
* <DemoTriggerPanel triggers={triggers} />
|
|
115
|
+
* </KitProvider>;
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
declare function createStridgeMockDriver(input?: CreateStridgeMockDriverInput): MockDriverHandle;
|
|
119
|
+
//#endregion
|
|
120
|
+
export { CreateStridgeMockDriverInput, MockDriverHandle, createStridgeMockDriver };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defaultI18n as e}from"../../shared/i18n/defaultI18n.js";import{shortenAddress as t}from"../../shared/format/shortenAddress.js";import{createEntityStore as n}from"./store.js";import{DEFAULT_BRAND_PAYLOAD as r,DEFAULT_WALLET_INFO as i,STUB_DEPOSIT_ADDRESSES_RAW as a,STUB_GATEWAY_POLL_RESPONSE as o,STUB_GATEWAY_SETTLEMENT_DTO as s,STUB_GATEWAY_START_RESPONSE as c,STUB_ONCHAIN_BALANCE_RESPONSE as l,STUB_QUOTE_RESPONSE as u,STUB_SUPPORTED_ASSETS_RESPONSE as d,buildDefaultAddressesPayload as f,buildDefaultBalances as p,buildDefaultFailurePayload as m,buildDefaultPendingPayload as h,buildDefaultQuotePayload as g,buildDefaultSuccessPayload as _,buildDefaultTargetPayload as v,buildDefaultTargetRaw as y,buildDefaultWalletPayload as b,resolveMockAsset as x}from"./fixtures.js";const S={quote:1400,submit:4e3,processingPendingDelay:1500,processingTerminal:3e3,transferDetected:4e3};function C(r={}){let a=r.getI18n??(()=>e),c=r.wallet??i,l=x(r.asset),d=n(w(a(),c,r.minDepositUsd,l,r.initialState)),f={...S,...r.latency??{}},p=r.autoSettleTo??`succeeded`,v=r.pendingTriggerToSuccessMs===void 0?3500:r.pendingTriggerToSuccessMs,y=new Set,b=new Set,C=new Set,E=!1,D,O;function k(){D!==void 0&&(clearTimeout(D),D=void 0),O!==void 0&&(clearTimeout(O),O=void 0),E=!1}function A(){if(E)return;E=!0;let e=a();D=setTimeout(()=>{D=void 0;let t={status:`ready`,payload:h(e,l),raw:s,response:o};d.update({settlement:t});for(let e of y)e(t);O=setTimeout(()=>{if(O=void 0,p===`succeeded`){let t={status:`ready`,payload:_(e,l),raw:s,response:o};d.update({settlement:t});for(let e of y)e(t)}else if(p===`failed`){let t={status:`ready`,payload:m(e,void 0,l),raw:s,response:o};d.update({settlement:t});for(let e of y)e(t)}E=!1},f.processingTerminal)},f.processingPendingDelay)}let j={getSnapshot(){return d.getSnapshot()},subscribe(e){return d.subscribe(e)},async requestQuote(e,t){d.update({quote:{status:`loading`}}),await T(f.quote,t);let n=a(),r=Date.now()+3e4;d.update({quote:{status:`ready`,payload:g(n,r,l),raw:u,response:u}})},async submitDeposit(e,t){return await T(f.submit,t),p!==`none`&&A(),{hash:`0x1d72b900dd9b4f9fb0e11c14978d9cbbff7b47db0b820911839aad7081f6b72a`,explorerUrl:`https://etherscan.io/tx/0x1d72b900dd9b4f9fb0e11c14978d9cbbff7b47db0b820911839aad7081f6b72a`}},watchBalances(e,t,n){C.add(t);let r=d.getSnapshot().balances;queueMicrotask(()=>{n.aborted||t(r)}),n.addEventListener(`abort`,()=>C.delete(t),{once:!0})},watchSourceTx(e,t,n){b.add(t);let r=setTimeout(()=>{n.aborted||t({hash:`0x1d72b900dd9b4f9fb0e11c14978d9cbbff7b47db0b820911839aad7081f6b72a`,explorerUrl:`https://etherscan.io/tx/0x1d72b900dd9b4f9fb0e11c14978d9cbbff7b47db0b820911839aad7081f6b72a`})},f.transferDetected);n.addEventListener(`abort`,()=>{clearTimeout(r),b.delete(t)},{once:!0})},watchSettlement(e,t,n){y.add(t);let r=d.getSnapshot().settlement;queueMicrotask(()=>{n.aborted||t(r)}),n.addEventListener(`abort`,()=>y.delete(t),{once:!0})},async fetchActiveSettlement(e,t){let n=d.getSnapshot().settlement;return n.status!==`ready`||n.payload.kind!==`pending`?null:{payload:n.payload,raw:n.raw,response:n.response}}},M=0,N=null;function P(){N!==null&&(clearTimeout(N),N=null)}function F(e){M+=1;let n=`0x${M.toString(16).padStart(8,`0`)}${e.value.length>10?e.value.slice(10):`0`.repeat(56)}`;return{value:n,formatted:t(n)}}function I(e,t){if(e)return e.replace(/(\/tx\/|\/address\/)(0x[0-9a-fA-F]+)/,(e,n)=>`${n}${t}`)}let L={triggerSettlementPending(e){let t=h(a(),l),n=t.txHash?F(t.txHash):void 0,r=n?I(t.txExplorerUrl,n.value):void 0,i={status:`ready`,payload:{...t,...n?{txHash:n}:{},...r?{txExplorerUrl:r}:{},...e},raw:s,response:o};P(),d.update({settlement:i});for(let e of y)e(i);v!==null&&v>=0&&(N=setTimeout(()=>{N=null,L.triggerSettlementSuccess()},v))},triggerSettlementSuccess(e){P();let t=_(a(),l),n=F(t.depositTx.hash),r=I(t.depositTx.explorerUrl,n.value),i={status:`ready`,payload:{...t,depositTx:{...t.depositTx,hash:n,...r?{explorerUrl:r}:{}},...e},raw:s,response:o};d.update({settlement:i});for(let e of y)e(i)},triggerSettlementFailure(e,t){P();let n=m(a(),e,l),r=F(n.txHash),i=I(n.txExplorerUrl,r.value),c={status:`ready`,payload:{...n,txHash:r,...i?{txExplorerUrl:i}:{},...t},raw:s,response:o};d.update({settlement:c});for(let e of y)e(c)},triggerQuoteFailure(e){d.update({quote:{status:`error`,error:e}})},reset(){P(),k(),d.replace(w(a(),c,r.minDepositUsd,l,r.initialState))}};return{driver:j,triggers:L}}function w(e,t,n,i,o){let s={brand:{status:`ready`,payload:r,raw:c.metadata,response:c},target:{status:`ready`,payload:v(e,n,i),raw:y(i),response:d},addresses:{status:`ready`,payload:f(e,n),raw:a,response:c},balances:{status:`ready`,payload:p(e),raw:l,response:l},quote:{status:`idle`},settlement:{status:`idle`},wallet:{status:`ready`,payload:b(e,t),raw:t,response:t}};return o?{...s,...o}:s}function T(e,t){return new Promise((n,r)=>{if(t.aborted){r(E());return}let i=setTimeout(()=>{t.removeEventListener(`abort`,a),n()},e),a=()=>{clearTimeout(i),r(E())};t.addEventListener(`abort`,a,{once:!0})})}function E(){if(typeof DOMException==`function`)return new DOMException(`Aborted`,`AbortError`);let e=Error(`Aborted`);return e.name=`AbortError`,e}export{C as createStridgeMockDriver};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { SettlementFailureKind } from "../../shared/driver/types.js";
|
|
2
|
+
import { WithdrawableBalanceItemPayload, WithdrawalQuotePayload, WithdrawalSettlementFailurePayload, WithdrawalSettlementPendingPayload, WithdrawalSettlementSuccessPayload } from "../../flows/withdraw/driver/payloads.js";
|
|
3
|
+
import { WithdrawDriver, WithdrawSnapshot } from "../../flows/withdraw/driver/types.js";
|
|
4
|
+
import { MockAsset, MockAssetSelection } from "./fixtures.js";
|
|
5
|
+
import { I18n } from "@lingui/core";
|
|
6
|
+
|
|
7
|
+
//#region src/drivers/stridge-mock/createStridgeMockWithdrawDriver.d.ts
|
|
8
|
+
declare const DEFAULT_LATENCY: {
|
|
9
|
+
/** `requestQuote` resolves after this many ms. */quote: number; /** `submitWithdrawal` resolves after this many ms. */
|
|
10
|
+
submit: number; /** Time between `submitWithdrawal` returning and the settlement entity flipping to `pending`. */
|
|
11
|
+
processingPendingDelay: number; /** Time between `pending` and the terminal verdict. */
|
|
12
|
+
processingTerminal: number;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Bundled fixture: a single withdrawable USDC@BSC row matching the V2 mock + apps/demo currency.
|
|
16
|
+
* Hosts that need richer balances pass them through `initialState.withdrawableBalances`.
|
|
17
|
+
*/
|
|
18
|
+
declare function buildDefaultWithdrawableBalances(asset?: MockAsset): ReadonlyArray<WithdrawableBalanceItemPayload>;
|
|
19
|
+
/**
|
|
20
|
+
* Bundled fixture: a static withdrawal quote shaped to the V2 mockup numbers ($0.00 network
|
|
21
|
+
* cost, 0.00% price impact). Mirrors deposit's confirm-deposit breakdown chrome — same items.
|
|
22
|
+
*/
|
|
23
|
+
declare function buildDefaultWithdrawalQuotePayload(amount?: number, asset?: MockAsset): WithdrawalQuotePayload;
|
|
24
|
+
/**
|
|
25
|
+
* Bundled fixture: a pending settlement keyed off the V2 mockup recipient + tx hash. The
|
|
26
|
+
* `i18n` argument drives `formatTimestamp` so the row reads the same locale-aware short form
|
|
27
|
+
* deposit's mock uses (`May 7, 18:54`) instead of an ISO blob.
|
|
28
|
+
*/
|
|
29
|
+
declare function buildDefaultWithdrawalPendingPayload(i18n?: I18n, amount?: number, recipient?: string, txHashValue?: string, asset?: MockAsset): WithdrawalSettlementPendingPayload;
|
|
30
|
+
/** Bundled fixture: a succeeded settlement matching V2-6 (14 seconds total time). */
|
|
31
|
+
declare function buildDefaultWithdrawalSuccessPayload(i18n?: I18n, amount?: number, recipient?: string, totalTimeSeconds?: number, txHashValue?: string, asset?: MockAsset, completionTxValue?: string): WithdrawalSettlementSuccessPayload;
|
|
32
|
+
/** Bundled fixture: a failed settlement of the requested kind. */
|
|
33
|
+
declare function buildDefaultWithdrawalFailurePayload(i18n?: I18n, failureKind?: SettlementFailureKind, amount?: number, recipient?: string, txHashValue?: string, asset?: MockAsset): WithdrawalSettlementFailurePayload;
|
|
34
|
+
/**
|
|
35
|
+
* Imperative trigger surface returned alongside the {@link WithdrawDriver} from
|
|
36
|
+
* {@link createStridgeMockWithdrawDriver}. Mock-specific affordances live here so the kit's
|
|
37
|
+
* `WithdrawDriver` interface stays untouched by demo / canvas-tile concerns.
|
|
38
|
+
*/
|
|
39
|
+
interface MockWithdrawTriggers {
|
|
40
|
+
/** Flip `settlement` to `pending`. Drives the V2-5 in-progress screen. */
|
|
41
|
+
triggerWithdrawalInProgress(partial?: Partial<WithdrawalSettlementPendingPayload>): void;
|
|
42
|
+
/** Flip `settlement` to `succeeded`. Drives the V2-6 success screen. */
|
|
43
|
+
triggerWithdrawalSuccess(partial?: Partial<WithdrawalSettlementSuccessPayload>): void;
|
|
44
|
+
/** Flip `settlement` to `failed`. Drives the temporary error screen. */
|
|
45
|
+
triggerWithdrawalFailed(failureKind: SettlementFailureKind, partial?: Partial<WithdrawalSettlementFailurePayload>): void;
|
|
46
|
+
/** Flip `quote` to `error`. */
|
|
47
|
+
triggerQuoteFailure(error: Error): void;
|
|
48
|
+
/** Restore the snapshot the factory was constructed with. Cancels any auto-settle timers. */
|
|
49
|
+
reset(): void;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Return value of {@link createStridgeMockWithdrawDriver} — the driver itself plus the mock
|
|
53
|
+
* trigger surface for canvas tiles / Storybook controls / tests.
|
|
54
|
+
*/
|
|
55
|
+
interface MockWithdrawDriverHandle {
|
|
56
|
+
driver: WithdrawDriver;
|
|
57
|
+
triggers: MockWithdrawTriggers;
|
|
58
|
+
}
|
|
59
|
+
interface CreateStridgeMockWithdrawDriverInput {
|
|
60
|
+
/**
|
|
61
|
+
* Initial entity-store overrides. Merged per-key — keys present here replace the bundled
|
|
62
|
+
* fixture wholesale, so each value must be a complete {@link Entity} envelope (or one of
|
|
63
|
+
* the empty `{ status: "idle" | "loading" }` variants). Omitted keys keep the bundled
|
|
64
|
+
* fixture (one withdrawable USDC@BSC row, the default receive-options catalog, idle quote,
|
|
65
|
+
* idle settlement). Used by canvas cards / Storybook to seed a static state.
|
|
66
|
+
*/
|
|
67
|
+
initialState?: Partial<WithdrawSnapshot>;
|
|
68
|
+
/**
|
|
69
|
+
* Per-call latency overrides. Defaults match production-feel cadence; tests should pass
|
|
70
|
+
* `{ quote: 0, submit: 0, … }` so the FSM walks through deterministically without
|
|
71
|
+
* `vi.useFakeTimers`.
|
|
72
|
+
*/
|
|
73
|
+
latency?: Partial<typeof DEFAULT_LATENCY>;
|
|
74
|
+
/**
|
|
75
|
+
* Terminal verdict the driver auto-transitions to after the user submits. Defaults to
|
|
76
|
+
* `"succeeded"` so the happy path runs end-to-end. Set `"failed"` to exercise the failure
|
|
77
|
+
* branch, or `"none"` to leave the settlement in `pending` and let `triggers` drive
|
|
78
|
+
* terminals.
|
|
79
|
+
*/
|
|
80
|
+
autoSettleTo?: "succeeded" | "failed" | "none";
|
|
81
|
+
/**
|
|
82
|
+
* Demo affordance — when a canvas tile fires `triggers.triggerWithdrawalInProgress()`,
|
|
83
|
+
* schedule an automatic `triggerWithdrawalSuccess()` this many ms later. Pass `null` to
|
|
84
|
+
* disable. Defaults to {@link DEFAULT_PENDING_TRIGGER_TO_SUCCESS_MS}.
|
|
85
|
+
*/
|
|
86
|
+
pendingTriggerToSuccessMs?: number | null;
|
|
87
|
+
/**
|
|
88
|
+
* Ref-getter for the active `I18n` instance. Read at payload-build time so timestamp /
|
|
89
|
+
* duration formatting (`formatTimestamp`, `formatDurationCompact`) tracks locale flips
|
|
90
|
+
* without re-bootstrapping the driver. Defaults to the kit's English-only `defaultI18n`.
|
|
91
|
+
*/
|
|
92
|
+
getI18n?: () => I18n;
|
|
93
|
+
/**
|
|
94
|
+
* Settlement asset override — same shape as the deposit factory's `asset` field. Drives the
|
|
95
|
+
* withdrawable-balance row, the quote receive-side, and every settlement banner so the
|
|
96
|
+
* picker's `(chain, symbol)` is reflected end-to-end. Unknown combinations fall back to USDC
|
|
97
|
+
* on BSC via {@link resolveMockAsset}.
|
|
98
|
+
*/
|
|
99
|
+
asset?: MockAssetSelection;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Deterministic in-memory {@link WithdrawDriver} backed by the V2 mockup fixtures. Used by
|
|
103
|
+
* canvas tiles, Storybook, tests, and any `<KitProvider />` mount that doesn't have a Stridge
|
|
104
|
+
* gateway. Returns the driver alongside the imperative trigger surface for canvas-only
|
|
105
|
+
* affordances.
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```tsx
|
|
109
|
+
* import { createStridgeMockWithdrawDriver } from "@stridge/kit/drivers/stridge-mock";
|
|
110
|
+
*
|
|
111
|
+
* const { driver, triggers } = createStridgeMockWithdrawDriver();
|
|
112
|
+
* <KitProvider withdraw={driver}>...</KitProvider>;
|
|
113
|
+
* triggers.triggerWithdrawalInProgress();
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
declare function createStridgeMockWithdrawDriver(input?: CreateStridgeMockWithdrawDriverInput): MockWithdrawDriverHandle;
|
|
117
|
+
//#endregion
|
|
118
|
+
export { CreateStridgeMockWithdrawDriverInput, MockWithdrawDriverHandle, MockWithdrawTriggers, buildDefaultWithdrawableBalances, buildDefaultWithdrawalFailurePayload, buildDefaultWithdrawalPendingPayload, buildDefaultWithdrawalQuotePayload, buildDefaultWithdrawalSuccessPayload, createStridgeMockWithdrawDriver };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{defaultI18n as e}from"../../shared/i18n/defaultI18n.js";import{formatDurationCompact as t}from"../../shared/format/formatDurationCompact.js";import{formatTimestamp as n}from"../../shared/format/formatTimestamp.js";import{shortenAddress as r}from"../../shared/format/shortenAddress.js";import{supportedAssetsToReceiveOptionsPayload as i}from"../../flows/withdraw/driver/transformers/supportedAssetsToReceiveOptionsPayload.js";import{DEFAULT_MOCK_ASSET as a,buildDefaultSupportedAssetsResponse as o,resolveMockAsset as s}from"./fixtures.js";const c=`0x32995Fb47918BD37133dB46F21c5Ed906140Dd41`,l=`0xd41f5e9e5b1c2c4d8e7a0bf3a9e6c1d2b8f5d4c3e2a1b0c9d8e7f6a5b4c3d2e1`;function u(e){return{symbol:e.symbol,decimals:e.decimals,address:e.address,isNative:e.isNative,assetLogoUrl:e.assetLogoUrl,networkName:e.networkName,eip155Id:e.eip155IdString,networkId:e.networkId,chainLogoUrl:e.chainLogoUrl}}function d(e){return`${e.explorerBase}/tx/`}const f={quote:1400,submit:4e3,processingPendingDelay:1500,processingTerminal:3e3},p=u(a),m=4.00613;function h(e=a){let t=u(e);return[{networkId:t.networkId,networkName:t.networkName,eip155Id:t.eip155Id,...t.chainLogoUrl?{chainLogoUrl:t.chainLogoUrl}:{},symbol:t.symbol,decimals:t.decimals,address:t.address,...t.assetLogoUrl?{assetLogoUrl:t.assetLogoUrl}:{},isNative:t.isNative,amount:{value:4.01,formatted:`4.01`},amountUsd:{value:4.01,formatted:`$4.01`}}]}function g(e=m,t=a){let n=D(e);return{receiveAsset:u(t),receiveAmount:{value:e,formatted:n},receiveAmountUsd:{value:e,formatted:`$${e.toFixed(2)}`},breakdown:{selectedRoute:{provider:`mock`,scenario:`same_chain_same_token`,label:`Mock · same chain same token`},networkCost:{value:0,formatted:`$0.00`},priceImpact:{value:0,formatted:`0.00%`}},quoteTotalSeconds:30,expiresAt:Date.now()+3e4}}function _(t=e,i=m,o=c,s=l,f=a){let p=Date.now();return{kind:`pending`,receiveAsset:u(f),receiveAmount:{value:i,formatted:D(i)},recipient:{value:o,formatted:r(o)},submittedAt:{value:p,formatted:n(p,t)},txHash:{value:s,formatted:r(s)},txExplorerUrl:`${d(f)}${s}`}}function v(i=e,o=m,s=c,f=14,p=l,h=a,g=`0xa17b4c9e2d68f0a5c3b91e7f4d52a86b09c1d7e3f8a4b2c5d6e9f0a1b2c3d4e5`){let _=Date.now(),v=f*1e3,y=_-v;return{kind:`succeeded`,receiveAsset:u(h),receiveAmount:{value:o,formatted:D(o)},recipient:{value:s,formatted:r(s)},submittedAt:{value:y,formatted:n(y,i)},filledAt:{value:_,formatted:n(_,i)},totalTime:{value:f,formatted:t(v,i)},txHash:{value:p,formatted:r(p)},txExplorerUrl:`${d(h)}${p}`,completionTx:{hash:{value:g,formatted:r(g)},explorerUrl:`${d(h)}${g}`}}}function y(t=e,i=`unknown`,o=m,s=c,f=l,p=a){let h=Date.now(),g=h-5e3;return{kind:`failed`,failureKind:i,receiveAsset:u(p),receiveAmount:{value:o,formatted:D(o)},recipient:{value:s,formatted:r(s)},submittedAt:{value:g,formatted:n(g,t)},failedAt:{value:h,formatted:n(h,t)},txHash:{value:f,formatted:r(f)},txExplorerUrl:`${d(p)}${f}`}}function b(t={}){let n={...f,...t.latency},r=t.autoSettleTo??`succeeded`,a=t.pendingTriggerToSuccessMs===void 0?3500:t.pendingTriggerToSuccessMs,p=t.getI18n??(()=>e),b=s(t.asset),S=u(b),D=d(b),O=h(b),k=x(O),A=o(),j=i(A),M={withdrawableBalances:t.initialState?.withdrawableBalances??{status:`ready`,payload:O,raw:k,response:k},receiveOptions:t.initialState?.receiveOptions??{status:`ready`,payload:j,raw:A.assets,response:A},quote:t.initialState?.quote??{status:`idle`},settlement:t.initialState?.settlement??{status:`idle`}},N=M,P=new Set,F=new Set,I=new Set,L=new Set,R=()=>{for(let e of P)e()},z=e=>{if(N={...N,...e},R(),e.settlement)for(let e of F)e(N.settlement);if(e.withdrawableBalances)for(let e of I)e(N.withdrawableBalances)},B=(e,t)=>{let n=setTimeout(()=>{L.delete(n),e()},t);L.add(n)},V=null,H=!1,U=0;function W(){return U+=1,`0x${U.toString(16).padStart(8,`0`)}${l.slice(10)}`}let G={getSnapshot:()=>N,subscribe(e){return P.add(e),()=>{P.delete(e)}},async requestQuote(e,t){z({quote:{status:`loading`}}),await E(n.quote,t);let r=g(e.amount,b),i=C(r,e.amount,S);z({quote:{status:`ready`,payload:r,raw:i,response:i}})},async submitWithdrawal(e,t){await E(n.submit,t),V={amount:e.amount,recipient:e.recipientAddress};let r=W(),i={hash:r,explorerUrl:`${D}${r}`};return K(e.amount,e.recipientAddress,r,t),i},watchSettlement(e,t,n){F.add(t);let r=N.settlement;queueMicrotask(()=>{n.aborted||t(r)}),n.addEventListener(`abort`,()=>F.delete(t),{once:!0})},watchWithdrawableBalances(e,t,n){I.add(t);let r=N.withdrawableBalances;queueMicrotask(()=>{n.aborted||t(r)}),n.addEventListener(`abort`,()=>I.delete(t),{once:!0})}};function K(e,t,i,a){H||(H=!0,B(()=>{if(a.aborted){H=!1;return}let o=_(p(),e,t,i,b),s=w(o,S);if(z({settlement:{status:`ready`,payload:o,raw:s,response:T(s,o)}}),r===`none`){H=!1;return}B(()=>{if(H=!1,a.aborted)return;let n=r===`succeeded`?v(p(),e,t,14,i,b):y(p(),`unknown`,e,t,i,b),o=w(n,S);z({settlement:{status:`ready`,payload:n,raw:o,response:T(o,n)}})},n.processingTerminal)},n.processingPendingDelay))}let q={triggerWithdrawalInProgress(e){let{amount:t,recipient:n}=J(),r={..._(p(),t,n,W(),b),...e},i=w(r,S);z({settlement:{status:`ready`,payload:r,raw:i,response:T(i,r)}}),a!==null&&B(()=>q.triggerWithdrawalSuccess(),a)},triggerWithdrawalSuccess(e){let{amount:t,recipient:n}=J(),r={...v(p(),t,n,14,W(),b),...e},i=w(r,S);z({settlement:{status:`ready`,payload:r,raw:i,response:T(i,r)}})},triggerWithdrawalFailed(e,t){let{amount:n,recipient:r}=J(),i={...y(p(),e,n,r,W(),b),...t},a=w(i,S);z({settlement:{status:`ready`,payload:i,raw:a,response:T(a,i)}})},triggerQuoteFailure(e){z({quote:{status:`error`,error:e}})},reset(){for(let e of L)clearTimeout(e);L.clear(),H=!1,V=null,U=0,N=M,R()}};function J(){return{amount:V?.amount??m,recipient:V?.recipient??c}}return{driver:G,triggers:q}}function x(e){let t=e.reduce((e,t)=>e+(t.amountUsd?.value??0),0);return{wallet_address:`0xMockWallet000000000000000000000000000000`,fetched_at:new Date(0).toISOString(),total_usd:t.toFixed(2),chains:e.map(e=>({eip155_id:e.eip155Id?Number(e.eip155Id):0,stridge_network_id:e.networkId??``,network_name:e.networkName.toLowerCase(),label:e.networkName,scanner_url:``,native_symbol:``,subtotal_usd:(e.amountUsd?.value??0).toFixed(2),tokens:[{token_address:e.address,symbol:e.symbol,name:e.symbol,decimals:e.decimals,logo:e.assetLogoUrl??``,is_native:e.isNative,is_spam:!1,raw_amount:S(e.amount.value,e.decimals).toString(),amount:e.amount.value.toString(),amount_usd:(e.amountUsd?.value??0).toFixed(2),usd_price:e.amount.value>0?((e.amountUsd?.value??0)/e.amount.value).toFixed(6):`0`,price_change_24h_pct:`0`}]}))}}function S(e,t){if(!Number.isFinite(e)||e<0)return 0n;let[n,r=``]=e.toFixed(t).split(`.`),i=r.padEnd(t,`0`).slice(0,t);return BigInt((n??`0`)+i)}function C(e,t,n=p){let r=S(e.receiveAmount.value,e.receiveAsset.decimals).toString(),i=S(t,n.decimals).toString(),a=t>0?(e.receiveAmount.value/t).toFixed(6):`1`;return{from:{network_id:Number(n.eip155Id??56),asset_address:n.address,amount:i},to:{network_id:Number(e.receiveAsset.eip155Id??56),asset_address:e.receiveAsset.address,amount:r},exchange_rate:a,fees:{total_fee:`0`},route:{provider:`mock`,scenario:`same_chain_same_token`,estimated_time_seconds:30},expires_at:new Date(e.expiresAt).toISOString()}}function w(e,t=p){let n=new Date(e.submittedAt.value).toISOString(),r=e.kind===`succeeded`?`completed`:e.kind===`failed`?`failed`:`routing`,i=e.kind===`succeeded`?e.filledAt.value:e.kind===`failed`?e.failedAt.value:e.submittedAt.value,a={tx_id:(e.kind===`succeeded`?e.txHash.value:e.txHash?.value)??``,asset_symbol:t.symbol,asset_address:t.address,eip155_id:t.eip155Id??`56`,network_id:t.networkId??`9006`,network_name:t.networkName.toLowerCase(),raw_amount:S(e.receiveAmount.value,t.decimals).toString(),amount:e.receiveAmount.value.toString(),confirmed_at:n},o={address:e.recipient.value,asset_address:e.receiveAsset.address,asset_symbol:e.receiveAsset.symbol,eip155_id:e.receiveAsset.eip155Id??``,network_id:e.receiveAsset.networkId??``,network_name:e.receiveAsset.networkName.toLowerCase(),raw_amount:S(e.receiveAmount.value,e.receiveAsset.decimals).toString(),amount:e.receiveAmount.value.toString(),...e.kind===`succeeded`?{settled_at:new Date(e.filledAt.value).toISOString(),...e.completionTx?{tx_id:e.completionTx.hash.value}:{}}:{}};return{id:`mock-settlement-${e.recipient.value}-${a.tx_id}`,status:r,created_at:n,updated_at:new Date(i).toISOString(),events:[],fees:{raw_amount:`0`},from:a,to:o,route:{provider:`mock`,scenario:`withdraw_v1`},...e.kind===`failed`?{error:e.failureKind}:{}}}function T(e,t){let n=t.kind!==`pending`;return{owner:`0xMockOwner`,uda_id:`mock-uda`,created_at:e.created_at,updated_at:e.updated_at,is_terminal:n,status:t.kind===`succeeded`?`completed`:t.kind===`failed`?`failed`:`to_pending`,destination:{address:t.recipient.value,asset_address:t.receiveAsset.address,asset_decimals:t.receiveAsset.decimals,asset_symbol:t.receiveAsset.symbol,eip155_id:t.receiveAsset.eip155Id??``,network_id:t.receiveAsset.networkId??``,network_name:t.receiveAsset.networkName},settlements:[e]}}function E(e,t){return new Promise((n,r)=>{if(t.aborted){r(new DOMException(`Aborted`,`AbortError`));return}let i=setTimeout(()=>{t.removeEventListener(`abort`,a),n()},e),a=()=>{clearTimeout(i),t.removeEventListener(`abort`,a),r(new DOMException(`Aborted`,`AbortError`))};t.addEventListener(`abort`,a)})}function D(e){return Number.isInteger(e)?e.toFixed(2):e.toFixed(5)}export{h as buildDefaultWithdrawableBalances,y as buildDefaultWithdrawalFailurePayload,_ as buildDefaultWithdrawalPendingPayload,g as buildDefaultWithdrawalQuotePayload,v as buildDefaultWithdrawalSuccessPayload,b as createStridgeMockWithdrawDriver};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { SettlementFailureKind } from "../../shared/driver/types.js";
|
|
2
|
+
import { AddressItemPayload, BalanceItemPayload, BrandPayload, QuotePayload, SettlementFailurePayload, SettlementPayload, SettlementPendingPayload, SettlementSuccessPayload, TargetPayload, WalletInfo, WalletPayload } from "../../flows/deposit/driver/payloads.js";
|
|
3
|
+
import { I18n } from "@lingui/core";
|
|
4
|
+
import { DepositAddressDto, GatewayPollResponse, GatewaySettlementDto, GatewayStartResponse, OnchainBalanceResponse, QuoteResponse, SupportedAssetDto, SupportedAssetsResponse } from "@stridge/sdk";
|
|
5
|
+
|
|
6
|
+
//#region src/drivers/stridge-mock/fixtures.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Default {@link WalletInfo} the mock seeds the `wallet` entity with — the captured production
|
|
9
|
+
* EOA. Hosts override via `createStridgeMockDriver({ wallet })` when they want a different
|
|
10
|
+
* `…<last 4>` value or a disconnected mode.
|
|
11
|
+
*/
|
|
12
|
+
declare const DEFAULT_WALLET_INFO: WalletInfo;
|
|
13
|
+
/**
|
|
14
|
+
* Default brand metadata the mock seeds the `brand` entity with.
|
|
15
|
+
*/
|
|
16
|
+
declare const DEFAULT_BRAND_PAYLOAD: BrandPayload;
|
|
17
|
+
/**
|
|
18
|
+
* Resolved destination-asset record the mock driver seeds every entity from. Hosts that need
|
|
19
|
+
* to demo a non-default `(chain, symbol)` pass {@link MockAssetSelection} through the factory;
|
|
20
|
+
* the driver resolves it once via {@link resolveMockAsset} and threads this shape into every
|
|
21
|
+
* builder, so target / quote / settlement payloads all stay coherent against the same asset.
|
|
22
|
+
*/
|
|
23
|
+
interface MockAsset {
|
|
24
|
+
/** Stridge network id (e.g. `"9006"` for BSC, `"60"` for Ethereum). */
|
|
25
|
+
networkId: string;
|
|
26
|
+
/** Friendly chain name as it appears in payloads (e.g. `"BSC"`, `"Ethereum"`). */
|
|
27
|
+
networkName: string;
|
|
28
|
+
/** EIP-155 id as a string (matches `TargetPayload.eip155Id`'s wire shape). */
|
|
29
|
+
eip155IdString: string;
|
|
30
|
+
/** EIP-155 id as a number (matches `SupportedAssetDto.eip155_id` + `routeHops[].chainId`). */
|
|
31
|
+
eip155IdNumber: number;
|
|
32
|
+
chainLogoUrl: string;
|
|
33
|
+
/** Block explorer base URL for the chain (e.g. `"https://bscscan.com"`). */
|
|
34
|
+
explorerBase: string;
|
|
35
|
+
symbol: string;
|
|
36
|
+
decimals: number;
|
|
37
|
+
/** Contract address; `""` for native assets. */
|
|
38
|
+
address: string;
|
|
39
|
+
assetLogoUrl: string;
|
|
40
|
+
isNative: boolean;
|
|
41
|
+
/** The chain's native gas asset (BNB on BSC, ETH on Ethereum/Arbitrum, POL on Polygon, …). */
|
|
42
|
+
nativeSymbol: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Selector accepted by {@link resolveMockAsset}. `chain` is the gateway's `network_name`
|
|
46
|
+
* (case-insensitive, e.g. `"bsc"` / `"BSC"`), `symbol` the asset ticker (`"USDC"`).
|
|
47
|
+
*/
|
|
48
|
+
interface MockAssetSelection {
|
|
49
|
+
chain: string;
|
|
50
|
+
symbol: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Legacy export kept for unchanged consumers — same shape as
|
|
54
|
+
* {@link buildDefaultTargetRaw}() with no asset override.
|
|
55
|
+
*/
|
|
56
|
+
declare const DEFAULT_TARGET_RAW: SupportedAssetDto;
|
|
57
|
+
declare function buildDefaultTargetPayload(i18n: I18n, minDepositUsd?: number, asset?: MockAsset): TargetPayload;
|
|
58
|
+
/**
|
|
59
|
+
* Build the bundled deposit-address fixtures. When `minDepositUsd` is set, every row carries a
|
|
60
|
+
* formatted per-chain `minDepositUsd` so the transfer-crypto picker renders `Min $X` next to the
|
|
61
|
+
* Chains label and on each option row — the same display the captured-production payload showed.
|
|
62
|
+
*/
|
|
63
|
+
declare function buildDefaultAddressesPayload(i18n: I18n, minDepositUsd?: number): ReadonlyArray<AddressItemPayload>;
|
|
64
|
+
/**
|
|
65
|
+
* Static-i18n form of {@link buildDefaultAddressesPayload} — kept for callers that pre-import the
|
|
66
|
+
* canonical mock list without a live `I18n` handle. Excludes per-row `minDepositUsd`; callers that
|
|
67
|
+
* want it must use the builder.
|
|
68
|
+
*/
|
|
69
|
+
declare const DEFAULT_ADDRESSES_PAYLOAD: ReadonlyArray<AddressItemPayload>;
|
|
70
|
+
/**
|
|
71
|
+
* Default source-side balance list — derived from the captured `/v1/balance/onchain/{wallet}`
|
|
72
|
+
* response for `0xCA8779…685c` against the production UDA, filtered through routability +
|
|
73
|
+
* spam-drop + the kit's `minDepositUsd` floor (rows whose `amountUsd` is below the floor ride in
|
|
74
|
+
* as `lowBalance + disabled` so the picker dims them out instead of dropping them).
|
|
75
|
+
*
|
|
76
|
+
* Captured snapshot (chain × token, after routability filter):
|
|
77
|
+
* - BSC USDC 42.806 ($42.81) — routable, top of the picker.
|
|
78
|
+
* - BSC BNB 0.0167 ($10.86) — routable native.
|
|
79
|
+
* - ETH BNB 0.0145 ($9.84) — wrapped BNB ERC-20.
|
|
80
|
+
* - ETH USDT 0.7575 ($0.76) — sub-floor.
|
|
81
|
+
* - BSC USDT 0.5952 ($0.60) — sub-floor.
|
|
82
|
+
* - ETH ETH 0.000167 ($0.39) — sub-floor native.
|
|
83
|
+
* - ETH USDC 0.10408 ($0.10) — sub-floor.
|
|
84
|
+
*/
|
|
85
|
+
declare function buildDefaultBalances(i18n: I18n): ReadonlyArray<BalanceItemPayload>;
|
|
86
|
+
/**
|
|
87
|
+
* Default quote payload. Captured production scenario: 5 USDC on Ethereum routed to the
|
|
88
|
+
* destination asset (USDC on BSC by default) via LIFI cross-chain. Total time around 28m on
|
|
89
|
+
* the wire — same number {@link DEFAULT_SUCCESS_PAYLOAD} uses for `totalTime`. Pass `asset` to
|
|
90
|
+
* retarget the receive side at a different `(chain, symbol)` while keeping the same numeric
|
|
91
|
+
* route shape.
|
|
92
|
+
*/
|
|
93
|
+
declare function buildDefaultQuotePayload(i18n: I18n, expiresAt: number, asset?: MockAsset): QuotePayload;
|
|
94
|
+
/**
|
|
95
|
+
* Pending settlement seed — captured production source-chain detection, no terminal verdict
|
|
96
|
+
* yet. The `creditedAsset` reflects `asset` so the in-progress banner shows the picker's
|
|
97
|
+
* destination tuple. Source-chain links stay on Etherscan since the captured scenario routes
|
|
98
|
+
* USDC@Ethereum into the chosen destination.
|
|
99
|
+
*/
|
|
100
|
+
declare function buildDefaultPendingPayload(i18n: I18n, asset?: MockAsset): SettlementPendingPayload;
|
|
101
|
+
/**
|
|
102
|
+
* Successful settlement seed — captured production record `a9e7f2fc-…`. 5 USDC Ethereum →
|
|
103
|
+
* 4.983615 USDC BSC via LIFI cross-chain, settled in 28m 5s.
|
|
104
|
+
*/
|
|
105
|
+
declare function buildDefaultSuccessPayload(i18n: I18n, asset?: MockAsset): SettlementSuccessPayload;
|
|
106
|
+
/**
|
|
107
|
+
* Failed settlement seed — sibling failure record (`3552b865-…`) from the same capture.
|
|
108
|
+
* Cross-chain LIFI route reverted on the destination tx with `execution reverted`.
|
|
109
|
+
*/
|
|
110
|
+
declare function buildDefaultFailurePayload(i18n: I18n, failureKind?: SettlementFailureKind, asset?: MockAsset): SettlementFailurePayload;
|
|
111
|
+
/**
|
|
112
|
+
* Re-export for {@link WalletPayload} default. Constructed inline rather than via the transformer
|
|
113
|
+
* so the fixture stays self-contained — driver authors don't need to import a transformer to seed
|
|
114
|
+
* the wallet entity. Includes a pre-aggregated `balanceTotalUsd` derived from the bundled balance
|
|
115
|
+
* fixtures so the deposit-method picker's wallet tile renders the canonical `$24.50 · Instant`
|
|
116
|
+
* meta line straight from the seed (the live driver re-stamps this whenever its own balances
|
|
117
|
+
* poll lands).
|
|
118
|
+
*/
|
|
119
|
+
declare function buildDefaultWalletPayload(i18n: I18n, wallet?: WalletInfo): WalletPayload;
|
|
120
|
+
/**
|
|
121
|
+
* Build a {@link SettlementPayload} of the requested kind off the bundled fixtures. Drivers and
|
|
122
|
+
* triggers compose this when seeding `settlement` to a specific terminal state.
|
|
123
|
+
*/
|
|
124
|
+
declare function buildSettlementPayload(i18n: I18n, kind: "pending" | "succeeded", asset?: MockAsset): SettlementPayload;
|
|
125
|
+
declare function buildSettlementPayload(i18n: I18n, kind: "failed", failureKind?: SettlementFailureKind, asset?: MockAsset): SettlementPayload;
|
|
126
|
+
//#endregion
|
|
127
|
+
export { DEFAULT_ADDRESSES_PAYLOAD, DEFAULT_BRAND_PAYLOAD, DEFAULT_TARGET_RAW, DEFAULT_WALLET_INFO, MockAsset, MockAssetSelection, buildDefaultAddressesPayload, buildDefaultBalances, buildDefaultFailurePayload, buildDefaultPendingPayload, buildDefaultQuotePayload, buildDefaultSuccessPayload, buildDefaultTargetPayload, buildDefaultWalletPayload, buildSettlementPayload };
|