@stridge/kit 0.1.0-alpha.6 → 0.1.0-alpha.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -6
- package/dist/KitProvider.d.ts +40 -0
- package/dist/KitProvider.js +1 -1
- package/dist/_internal/activity/driver/index.d.ts +3 -0
- package/dist/_internal/activity/driver/index.js +1 -0
- package/dist/_internal/deposit/driver/index.d.ts +3 -3
- package/dist/_internal/drivers/stridge/index.d.ts +4 -2
- package/dist/_internal/drivers/stridge/index.js +1 -1
- package/dist/_internal/drivers/stridge-mock/index.d.ts +4 -2
- package/dist/_internal/drivers/stridge-mock/index.js +1 -1
- package/dist/_internal/withdraw/driver/index.d.ts +2 -2
- package/dist/activity/compound/index.d.ts +19 -0
- package/dist/activity/compound/index.js +1 -0
- package/dist/activity/dialog/index.d.ts +4 -0
- package/dist/activity/dialog/index.js +1 -0
- package/dist/activity/widgets/index.d.ts +5 -0
- package/dist/activity/widgets/index.js +1 -0
- package/dist/deposit/compound/index.d.ts +25 -15
- package/dist/deposit/compound/index.js +1 -1
- package/dist/deposit/dialog/index.d.ts +2 -1
- package/dist/deposit/widgets/index.d.ts +17 -0
- package/dist/deposit/widgets/index.js +1 -0
- package/dist/drivers/stridge/catalog.d.ts +54 -0
- package/dist/drivers/stridge/catalog.js +1 -0
- package/dist/drivers/stridge/createStridgeActivityDriver.d.ts +44 -0
- package/dist/drivers/stridge/createStridgeActivityDriver.js +1 -0
- package/dist/drivers/stridge/createStridgeDepositDriver.d.ts +10 -1
- package/dist/drivers/stridge/createStridgeDepositDriver.js +1 -1
- package/dist/drivers/stridge/createStridgeWithdrawDriver.d.ts +37 -14
- package/dist/drivers/stridge/createStridgeWithdrawDriver.js +1 -1
- package/dist/drivers/stridge/internal/ensureWalletChain.js +1 -0
- package/dist/drivers/stridge/internal/pollOnce.js +1 -1
- package/dist/drivers/stridge/internal/resolveAddEthereumChain.js +1 -0
- package/dist/drivers/stridge/internal/retry.js +1 -0
- package/dist/drivers/stridge/internal/supportedChains.js +1 -0
- package/dist/drivers/stridge/types.d.ts +20 -14
- package/dist/drivers/stridge/types.js +1 -1
- package/dist/drivers/stridge/wagmiSigner.js +1 -1
- package/dist/drivers/stridge-mock/checkoutChannel.d.ts +31 -0
- package/dist/drivers/stridge-mock/checkoutChannel.js +1 -0
- package/dist/drivers/stridge-mock/createStridgeMockActivityDriver.d.ts +44 -0
- package/dist/drivers/stridge-mock/createStridgeMockActivityDriver.js +1 -0
- package/dist/drivers/stridge-mock/createStridgeMockDriver.d.ts +30 -2
- package/dist/drivers/stridge-mock/createStridgeMockDriver.js +1 -1
- package/dist/drivers/stridge-mock/createStridgeMockWithdrawDriver.d.ts +15 -3
- package/dist/drivers/stridge-mock/createStridgeMockWithdrawDriver.js +1 -1
- package/dist/drivers/stridge-mock/fixtures.d.ts +19 -13
- package/dist/drivers/stridge-mock/fixtures.js +1 -1
- package/dist/drivers/stridge-mock/triggers.d.ts +12 -0
- package/dist/events/bus/createBus.d.ts +26 -0
- package/dist/events/bus/createBus.js +1 -0
- package/dist/events/bus/flowIdRegistry.d.ts +17 -0
- package/dist/events/bus/flowIdRegistry.js +1 -0
- package/dist/events/bus/index.js +1 -0
- package/dist/events/bus/metadata.js +1 -0
- package/dist/events/context.js +1 -0
- package/dist/events/emit/index.js +1 -0
- package/dist/events/emit/mapFailure.js +1 -0
- package/dist/events/emit/useActivityEmissions.js +1 -0
- package/dist/events/emit/useDepositEmissions.js +1 -0
- package/dist/events/emit/useKitEmitter.js +1 -0
- package/dist/events/emit/useWithdrawEmissions.js +1 -0
- package/dist/events/hooks/index.d.ts +6 -0
- package/dist/events/hooks/index.js +1 -0
- package/dist/events/hooks/useCurrentFlowId.d.ts +6 -0
- package/dist/events/hooks/useCurrentFlowId.js +1 -0
- package/dist/events/hooks/useStableHandler.js +1 -0
- package/dist/events/hooks/useStridgeEvent.d.ts +9 -0
- package/dist/events/hooks/useStridgeEvent.js +1 -0
- package/dist/events/hooks/useStridgeEventBus.d.ts +34 -0
- package/dist/events/hooks/useStridgeEventBus.js +1 -0
- package/dist/events/hooks/useStridgeEvents.d.ts +7 -0
- package/dist/events/hooks/useStridgeEvents.js +1 -0
- package/dist/events/hooks/useStridgeFlowEvent.d.ts +8 -0
- package/dist/events/hooks/useStridgeFlowEvent.js +1 -0
- package/dist/events/hooks/useStridgeFlowEvents.d.ts +6 -0
- package/dist/events/hooks/useStridgeFlowEvents.js +1 -0
- package/dist/events/index.d.ts +17 -0
- package/dist/events/index.js +1 -0
- package/dist/events/publish.js +1 -0
- package/dist/events/redact.d.ts +34 -0
- package/dist/events/redact.js +1 -0
- package/dist/events/types/activity.d.ts +53 -0
- package/dist/events/types/deposit.d.ts +235 -0
- package/dist/events/types/envelope.d.ts +145 -0
- package/dist/events/types/index.d.ts +32 -0
- package/dist/events/types/kit.d.ts +23 -0
- package/dist/events/types/withdraw.d.ts +150 -0
- package/dist/flows/activity/compound/ActivityFlow.d.ts +46 -0
- package/dist/flows/activity/compound/ActivityFlow.js +1 -0
- package/dist/flows/activity/compound/components/Boundary.d.ts +29 -0
- package/dist/flows/activity/compound/components/Boundary.js +1 -0
- package/dist/flows/activity/compound/components/Steps.d.ts +24 -0
- package/dist/flows/activity/compound/components/Steps.js +1 -0
- package/dist/flows/activity/dialog/ActivityDialog.d.ts +55 -0
- package/dist/flows/activity/dialog/ActivityDialog.js +1 -0
- package/dist/flows/activity/dialog/ActivityFlowBoundary.d.ts +1 -0
- package/dist/flows/activity/dialog/ActivityFlowBoundary.js +1 -0
- package/dist/flows/activity/driver/context.d.ts +38 -0
- package/dist/flows/activity/driver/context.js +1 -0
- package/dist/flows/activity/driver/types.d.ts +58 -0
- package/dist/flows/activity/orchestrator/controller.d.ts +11 -0
- package/dist/flows/activity/orchestrator/controller.js +1 -0
- package/dist/flows/activity/orchestrator/index.d.ts +4 -0
- package/dist/flows/activity/orchestrator/index.js +1 -0
- package/dist/flows/activity/orchestrator/reducer.d.ts +1 -0
- package/dist/flows/activity/orchestrator/reducer.js +1 -0
- package/dist/flows/activity/orchestrator/types.d.ts +71 -0
- package/dist/flows/activity/orchestrator/useActivity.d.ts +94 -0
- package/dist/flows/activity/orchestrator/useActivity.js +1 -0
- package/dist/flows/activity/widgets/ActivityDetail.d.ts +41 -0
- package/dist/flows/activity/widgets/ActivityDetail.js +1 -0
- package/dist/flows/activity/widgets/ActivityList.d.ts +38 -0
- package/dist/flows/activity/widgets/ActivityList.js +1 -0
- package/dist/flows/activity/widgets/useStandaloneActivitySource.js +1 -0
- package/dist/flows/deposit/dialog/DepositBootstrapErrorState.js +1 -1
- package/dist/flows/deposit/dialog/DepositDialog.d.ts +26 -79
- package/dist/flows/deposit/dialog/DepositDialog.js +1 -1
- package/dist/flows/deposit/dialog/WalletRequiredState.js +1 -0
- package/dist/flows/deposit/dialog/WalletRequiredState.styles.js +1 -0
- package/dist/flows/deposit/driver/payloads.d.ts +109 -5
- package/dist/flows/deposit/driver/transformers/balanceToBalancesPayload.d.ts +2 -0
- package/dist/flows/deposit/driver/transformers/balanceToBalancesPayload.js +1 -1
- package/dist/flows/deposit/driver/transformers/index.d.ts +1 -0
- package/dist/flows/deposit/driver/transformers/quoteToPayload.d.ts +2 -0
- package/dist/flows/deposit/driver/transformers/settlementToPayload.d.ts +25 -0
- package/dist/flows/deposit/driver/transformers/settlementToPayload.js +1 -1
- package/dist/flows/deposit/driver/transformers/startToAddressesPayload.d.ts +2 -0
- package/dist/flows/deposit/driver/transformers/startToAddressesPayload.js +1 -1
- package/dist/flows/deposit/driver/transformers/startToBrandPayload.d.ts +1 -0
- package/dist/flows/deposit/driver/transformers/startToTargetPayload.d.ts +2 -0
- package/dist/flows/deposit/driver/transformers/startToTargetPayload.js +1 -1
- package/dist/flows/deposit/driver/transformers/walletAddressToWalletPayload.d.ts +1 -0
- package/dist/flows/deposit/driver/types.d.ts +92 -5
- package/dist/flows/deposit/orchestrator/controller.js +1 -1
- package/dist/flows/deposit/orchestrator/index.d.ts +5 -0
- package/dist/flows/deposit/orchestrator/reducer.d.ts +1 -0
- package/dist/flows/deposit/orchestrator/reducer.js +1 -1
- package/dist/flows/deposit/orchestrator/types.d.ts +276 -12
- package/dist/flows/deposit/orchestrator/useDeposit.d.ts +45 -1
- package/dist/flows/deposit/orchestrator/useDeposit.js +1 -1
- package/dist/flows/deposit/shared/checkoutPopup.js +1 -0
- package/dist/flows/deposit/shared/onramp.js +1 -0
- package/dist/flows/deposit/widgets/activity/DepositActivityDetail.d.ts +40 -0
- package/dist/flows/deposit/widgets/activity/DepositActivityDetail.js +1 -0
- package/dist/flows/deposit/widgets/activity/DepositActivityList.d.ts +38 -0
- package/dist/flows/deposit/widgets/activity/DepositActivityList.js +1 -0
- package/dist/flows/deposit/widgets/activity/index.d.ts +2 -0
- package/dist/flows/deposit/widgets/activity/index.js +1 -0
- package/dist/flows/deposit/widgets/activity/useDepositActivitySource.js +1 -0
- package/dist/flows/deposit/widgets/amount-entry/AmountEntry.d.ts +32 -5
- package/dist/flows/deposit/widgets/amount-entry/AmountEntry.js +1 -1
- package/dist/flows/deposit/widgets/amount-entry/footerIntent.js +1 -0
- package/dist/flows/deposit/widgets/asset-picker/AssetPicker.d.ts +24 -4
- package/dist/flows/deposit/widgets/asset-picker/AssetPicker.js +1 -1
- package/dist/flows/deposit/widgets/confirm-deposit/ConfirmDeposit.d.ts +37 -4
- package/dist/flows/deposit/widgets/confirm-deposit/ConfirmDeposit.js +1 -1
- package/dist/flows/deposit/widgets/deposit/Deposit.d.ts +39 -4
- package/dist/flows/deposit/widgets/deposit/Deposit.js +1 -1
- package/dist/flows/deposit/widgets/deposit/compound/Deposit.d.ts +58 -1
- package/dist/flows/deposit/widgets/deposit/compound/Deposit.js +1 -1
- package/dist/flows/deposit/widgets/deposit/compound/Deposit.slots.d.ts +6 -0
- package/dist/flows/deposit/widgets/deposit/compound/Deposit.slots.js +1 -1
- package/dist/flows/deposit/widgets/deposit/compound/Deposit.styles.js +1 -1
- package/dist/flows/deposit/widgets/deposit/compound/components/Boundary.d.ts +29 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Boundary.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Guards.d.ts +28 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Guards.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Header.d.ts +11 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Header.js +1 -1
- package/dist/flows/deposit/widgets/deposit/compound/components/Method.d.ts +7 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Method.js +1 -1
- package/dist/flows/deposit/widgets/deposit/compound/components/MethodSection.d.ts +40 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/MethodSection.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Methods.d.ts +15 -9
- package/dist/flows/deposit/widgets/deposit/compound/components/Methods.js +1 -1
- package/dist/flows/deposit/widgets/deposit/compound/components/Rail.d.ts +18 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Rail.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/RailPicker.d.ts +43 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/RailPicker.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Steps.d.ts +24 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Steps.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/index.d.ts +2 -1
- package/dist/flows/deposit/widgets/deposit/compound/types.d.ts +106 -4
- package/dist/flows/deposit/widgets/deposit-status-banner/DepositStatusBanner.d.ts +41 -1
- package/dist/flows/deposit/widgets/deposit-status-banner/DepositStatusBanner.js +1 -1
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/DepositStatusBanner.js +1 -1
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Hero.js +1 -1
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/PrimaryAction.js +1 -1
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/types.d.ts +5 -5
- package/dist/flows/deposit/widgets/error-state/ErrorState.d.ts +39 -4
- package/dist/flows/deposit/widgets/error-state/ErrorState.js +1 -1
- package/dist/flows/deposit/widgets/onramp-amount-entry/OnrampAmountEntry.d.ts +64 -0
- package/dist/flows/deposit/widgets/onramp-amount-entry/OnrampAmountEntry.js +1 -0
- package/dist/flows/deposit/widgets/onramp-amount-entry/compound/OnrampAmountEntry.d.ts +62 -0
- package/dist/flows/deposit/widgets/onramp-amount-entry/compound/OnrampAmountEntry.js +1 -0
- package/dist/flows/deposit/widgets/onramp-amount-entry/compound/OnrampAmountEntry.slots.d.ts +14 -0
- package/dist/flows/deposit/widgets/onramp-amount-entry/compound/OnrampAmountEntry.slots.js +1 -0
- package/dist/flows/deposit/widgets/onramp-amount-entry/compound/OnrampAmountEntry.styles.js +1 -0
- package/dist/flows/deposit/widgets/onramp-amount-entry/compound/components/HeroLabel.d.ts +13 -0
- package/dist/flows/deposit/widgets/onramp-amount-entry/compound/components/HeroLabel.js +1 -0
- package/dist/flows/deposit/widgets/onramp-amount-entry/compound/components/ReceiveChip.d.ts +14 -0
- package/dist/flows/deposit/widgets/onramp-amount-entry/compound/components/ReceiveChip.js +1 -0
- package/dist/flows/deposit/widgets/onramp-amount-entry/compound/context.js +1 -0
- package/dist/flows/deposit/widgets/onramp-amount-entry/compound/index.d.ts +3 -0
- package/dist/flows/deposit/widgets/onramp-amount-entry/compound/index.js +1 -0
- package/dist/flows/deposit/widgets/onramp-amount-entry/compound/types.d.ts +29 -0
- package/dist/flows/deposit/widgets/onramp-amount-entry/index.d.ts +1 -0
- package/dist/flows/deposit/widgets/onramp-amount-entry/index.js +1 -0
- package/dist/flows/deposit/widgets/onramp-confirm/OnrampConfirm.d.ts +50 -0
- package/dist/flows/deposit/widgets/onramp-confirm/OnrampConfirm.js +1 -0
- package/dist/flows/deposit/widgets/onramp-confirm/compound/OnrampConfirm.d.ts +42 -0
- package/dist/flows/deposit/widgets/onramp-confirm/compound/OnrampConfirm.js +1 -0
- package/dist/flows/deposit/widgets/onramp-confirm/compound/OnrampConfirm.slots.d.ts +24 -0
- package/dist/flows/deposit/widgets/onramp-confirm/compound/OnrampConfirm.slots.js +1 -0
- package/dist/flows/deposit/widgets/onramp-confirm/compound/OnrampConfirm.styles.js +1 -0
- package/dist/flows/deposit/widgets/onramp-confirm/compound/components/Body.d.ts +16 -0
- package/dist/flows/deposit/widgets/onramp-confirm/compound/components/Body.js +1 -0
- package/dist/flows/deposit/widgets/onramp-confirm/compound/components/Header.d.ts +15 -0
- package/dist/flows/deposit/widgets/onramp-confirm/compound/components/Header.js +1 -0
- package/dist/flows/deposit/widgets/onramp-confirm/compound/components/Summary.d.ts +15 -0
- package/dist/flows/deposit/widgets/onramp-confirm/compound/components/Summary.js +1 -0
- package/dist/flows/deposit/widgets/onramp-confirm/compound/context.d.ts +25 -0
- package/dist/flows/deposit/widgets/onramp-confirm/compound/context.js +1 -0
- package/dist/flows/deposit/widgets/onramp-confirm/compound/index.d.ts +4 -0
- package/dist/flows/deposit/widgets/onramp-confirm/compound/index.js +1 -0
- package/dist/flows/deposit/widgets/onramp-confirm/compound/types.d.ts +62 -0
- package/dist/flows/deposit/widgets/onramp-confirm/index.d.ts +1 -0
- package/dist/flows/deposit/widgets/onramp-confirm/index.js +1 -0
- package/dist/flows/deposit/widgets/onramp-payment-pending/OnrampPaymentPending.d.ts +48 -0
- package/dist/flows/deposit/widgets/onramp-payment-pending/OnrampPaymentPending.js +1 -0
- package/dist/flows/deposit/widgets/onramp-payment-pending/compound/OnrampPaymentPending.d.ts +63 -0
- package/dist/flows/deposit/widgets/onramp-payment-pending/compound/OnrampPaymentPending.js +1 -0
- package/dist/flows/deposit/widgets/onramp-payment-pending/compound/OnrampPaymentPending.slots.d.ts +14 -0
- package/dist/flows/deposit/widgets/onramp-payment-pending/compound/OnrampPaymentPending.slots.js +1 -0
- package/dist/flows/deposit/widgets/onramp-payment-pending/compound/components/ReopenButton.d.ts +11 -0
- package/dist/flows/deposit/widgets/onramp-payment-pending/compound/components/ReopenButton.js +1 -0
- package/dist/flows/deposit/widgets/onramp-payment-pending/compound/context.js +1 -0
- package/dist/flows/deposit/widgets/onramp-payment-pending/compound/index.d.ts +2 -0
- package/dist/flows/deposit/widgets/onramp-payment-pending/compound/index.js +1 -0
- package/dist/flows/deposit/widgets/onramp-payment-pending/index.d.ts +1 -0
- package/dist/flows/deposit/widgets/onramp-payment-pending/index.js +1 -0
- package/dist/flows/deposit/widgets/processing-state/ProcessingState.d.ts +30 -4
- package/dist/flows/deposit/widgets/processing-state/ProcessingState.js +1 -1
- package/dist/flows/deposit/widgets/success-state/SuccessState.d.ts +38 -4
- package/dist/flows/deposit/widgets/success-state/SuccessState.js +1 -1
- package/dist/flows/deposit/widgets/transfer-crypto/TransferCrypto.d.ts +34 -3
- package/dist/flows/deposit/widgets/transfer-crypto/TransferCrypto.js +1 -1
- package/dist/flows/deposit/widgets/transfer-crypto/compound/TransferCrypto.d.ts +1 -1
- package/dist/flows/deposit/widgets/transfer-crypto/compound/TransferCrypto.styles.js +1 -1
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Address.js +1 -1
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Disclosure.d.ts +5 -2
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Disclosure.js +1 -1
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Header.d.ts +6 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Header.js +1 -1
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/QrCode.d.ts +4 -10
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/QrCode.js +1 -1
- package/dist/flows/deposit/widgets/transfer-crypto/compound/types.d.ts +16 -2
- package/dist/flows/shared/transformers/computeQuoteAttrs.d.ts +1 -0
- package/dist/flows/shared/transformers/index.d.ts +1 -0
- package/dist/flows/shared/transformers/pickRelevantSettlement.d.ts +1 -0
- package/dist/flows/shared/transformers/pickRelevantSettlement.js +1 -1
- package/dist/flows/shared/transformers/testnets.js +1 -0
- package/dist/flows/withdraw/bindings/WithdrawBindings.d.ts +92 -0
- package/dist/flows/withdraw/bindings/WithdrawBindings.js +1 -0
- package/dist/flows/withdraw/bindings/index.d.ts +1 -0
- package/dist/flows/withdraw/bindings/index.js +1 -0
- package/dist/flows/withdraw/dialog/WithdrawDialog.d.ts +44 -71
- package/dist/flows/withdraw/dialog/WithdrawDialog.js +1 -1
- package/dist/flows/withdraw/driver/dto.d.ts +8 -7
- package/dist/flows/withdraw/driver/payloads.d.ts +16 -1
- package/dist/flows/withdraw/driver/transformers/settlementToWithdrawalPayload.js +1 -1
- package/dist/flows/withdraw/driver/transformers/supportedAssetsToReceiveOptionsPayload.js +1 -1
- package/dist/flows/withdraw/driver/types.d.ts +77 -14
- package/dist/flows/withdraw/orchestrator/controller.js +1 -1
- package/dist/flows/withdraw/orchestrator/index.d.ts +1 -1
- package/dist/flows/withdraw/orchestrator/reducer.js +1 -1
- package/dist/flows/withdraw/orchestrator/types.d.ts +218 -35
- package/dist/flows/withdraw/orchestrator/useWithdraw.d.ts +36 -1
- package/dist/flows/withdraw/orchestrator/useWithdraw.js +1 -1
- package/dist/flows/withdraw/widgets/activity/WithdrawActivityDetail.d.ts +39 -0
- package/dist/flows/withdraw/widgets/activity/WithdrawActivityDetail.js +1 -0
- package/dist/flows/withdraw/widgets/activity/WithdrawActivityList.d.ts +36 -0
- package/dist/flows/withdraw/widgets/activity/WithdrawActivityList.js +1 -0
- package/dist/flows/withdraw/widgets/activity/index.d.ts +2 -0
- package/dist/flows/withdraw/widgets/activity/index.js +1 -0
- package/dist/flows/withdraw/widgets/activity/useWithdrawActivitySource.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/Withdraw.d.ts +60 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/Withdraw.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/Withdraw.slots.d.ts +13 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/Withdraw.slots.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/components/Boundary.d.ts +29 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/components/Boundary.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/components/Guards.d.ts +25 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/components/Guards.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/components/Steps.d.ts +27 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/components/Steps.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/index.d.ts +3 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/index.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-error/WithdrawError.d.ts +45 -2
- package/dist/flows/withdraw/widgets/withdraw-error/WithdrawError.js +1 -1
- package/dist/flows/withdraw/widgets/withdraw-form/WithdrawForm.d.ts +32 -12
- package/dist/flows/withdraw/widgets/withdraw-form/WithdrawForm.js +1 -1
- package/dist/flows/withdraw/widgets/withdraw-form/compound/WithdrawForm.js +1 -1
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Body.d.ts +7 -6
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Header.d.ts +6 -1
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Header.js +1 -1
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/RecipientField.d.ts +7 -5
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/RecipientField.js +1 -1
- package/dist/flows/withdraw/widgets/withdraw-form/compound/types.d.ts +15 -5
- package/dist/flows/withdraw/widgets/withdraw-form/validation.js +1 -1
- package/dist/flows/withdraw/widgets/withdraw-in-progress/WithdrawInProgress.d.ts +39 -3
- package/dist/flows/withdraw/widgets/withdraw-in-progress/WithdrawInProgress.js +1 -1
- package/dist/flows/withdraw/widgets/withdraw-success/WithdrawSuccess.d.ts +46 -2
- package/dist/flows/withdraw/widgets/withdraw-success/WithdrawSuccess.js +1 -1
- package/dist/format/index.d.ts +2 -1
- package/dist/format/index.js +1 -1
- package/dist/i18n/index.d.ts +5 -4
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/locales/ar.js +1 -1
- package/dist/i18n/locales/es.js +1 -1
- package/dist/i18n/locales/source-keys.d.ts +12 -0
- package/dist/i18n/locales/source-keys.js +0 -0
- package/dist/icons/index.d.ts +5 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +35 -11
- package/dist/index.js +1 -1
- package/dist/package.js +1 -1
- package/dist/scope/KitPortalScope.js +1 -1
- package/dist/scope/KitScope.d.ts +27 -1
- package/dist/scope/KitScope.js +1 -1
- package/dist/scope/context.d.ts +24 -1
- package/dist/scope/index.d.ts +1 -1
- package/dist/shared/attribution/Attribution.js +1 -0
- package/dist/shared/attribution/Attribution.slots.js +1 -0
- package/dist/shared/attribution/Attribution.styles.js +1 -0
- package/dist/shared/attribution/index.js +1 -0
- package/dist/shared/chains/index.d.ts +48 -29
- package/dist/shared/chains/index.js +1 -1
- package/dist/shared/constants/brand-intercom.js +1 -0
- package/dist/shared/cuer/Cuer.js +1 -1
- package/dist/shared/dialog/DialogShell.d.ts +21 -6
- package/dist/shared/dialog/DialogShell.js +1 -1
- package/dist/shared/dialog/Frame.js +1 -1
- package/dist/shared/dialog/LoadingState.js +1 -0
- package/dist/shared/dialog/LoadingState.styles.js +1 -0
- package/dist/shared/dialog/StepTransition.js +1 -1
- package/dist/shared/dialog/useDirectionalChevronTransform.js +1 -1
- package/dist/shared/driver/types.d.ts +4 -3
- package/dist/shared/format/formatSmartRelative.d.ts +25 -0
- package/dist/shared/format/formatSmartRelative.js +1 -0
- package/dist/shared/format/formatUsd.js +1 -1
- package/dist/shared/i18n/KitI18nProvider.d.ts +11 -8
- package/dist/shared/i18n/KitI18nProvider.js +1 -1
- package/dist/shared/i18n/createKitI18n.d.ts +79 -16
- package/dist/shared/i18n/createKitI18n.js +1 -1
- package/dist/shared/i18n/useLingui.d.ts +11 -3
- package/dist/shared/icons/ActivityIcon.d.ts +12 -0
- package/dist/shared/icons/ActivityIcon.js +1 -0
- package/dist/shared/icons/BitcoinIcon.d.ts +14 -0
- package/dist/shared/icons/BitcoinIcon.js +1 -0
- package/dist/shared/icons/CardIcon.d.ts +16 -0
- package/dist/shared/icons/CardIcon.js +1 -0
- package/dist/shared/icons/LogoIcon.d.ts +13 -0
- package/dist/shared/icons/LogoIcon.js +1 -0
- package/dist/shared/merchant-link/MerchantLink.d.ts +1 -0
- package/dist/shared/merchant-link/MerchantLink.js +1 -0
- package/dist/shared/merchant-link/MerchantLinkButton.d.ts +1 -0
- package/dist/shared/merchant-link/MerchantLinkButton.js +1 -0
- package/dist/shared/merchant-link/index.d.ts +1 -0
- package/dist/shared/merchant-link/index.js +1 -0
- package/dist/shared/merchant-link/resolveMerchantLink.js +1 -0
- package/dist/shared/orchestrator/activityOpenInput.d.ts +21 -0
- package/dist/shared/orchestrator/createActivityReducers.js +1 -0
- package/dist/shared/orchestrator/index.d.ts +2 -0
- package/dist/shared/orchestrator/index.js +1 -1
- package/dist/shared/orchestrator/resolveActivityEntry.d.ts +1 -0
- package/dist/shared/orchestrator/resolveActivityEntry.js +1 -0
- package/dist/shared/orchestrator/toFailure.js +1 -1
- package/dist/shared/orchestrator/types.d.ts +8 -0
- package/dist/shared/orchestrator/useOnrampSessionWatcher.js +1 -0
- package/dist/shared/orchestrator/useSettlementWatcher.js +1 -1
- package/dist/shared/presentation/index.js +1 -0
- package/dist/shared/presentation/types.d.ts +30 -0
- package/dist/shared/presentation/types.js +1 -0
- package/dist/shared/presentation/useResolvedSurfaceKind.js +1 -0
- package/dist/shared/primitives/TxHashValue/TxHashValue.js +1 -1
- package/dist/shared/support/SupportConfigContext.d.ts +1 -0
- package/dist/shared/support/SupportConfigContext.js +1 -0
- package/dist/shared/support/SupportLink.d.ts +1 -0
- package/dist/shared/support/SupportLink.js +1 -0
- package/dist/shared/support/SupportSpinner.d.ts +1 -0
- package/dist/shared/support/SupportSpinner.js +1 -0
- package/dist/shared/support/index.d.ts +2 -0
- package/dist/shared/support/index.js +1 -0
- package/dist/shared/support/intercom-loader.d.ts +17 -0
- package/dist/shared/support/intercom-loader.js +1 -0
- package/dist/shared/support/types.d.ts +43 -0
- package/dist/shared/support/useIntercomMerchantContext.d.ts +27 -0
- package/dist/shared/support/useIntercomMerchantContext.js +1 -0
- package/dist/shared/support/useIntercomShutdownOnUnmount.js +1 -0
- package/dist/shared/support/useMerchantContext.d.ts +1 -0
- package/dist/shared/support/useMerchantContext.js +1 -0
- package/dist/shared/support/useSupportTrigger.js +1 -0
- package/dist/shared/terms/TermsConfigContext.d.ts +1 -0
- package/dist/shared/terms/TermsConfigContext.js +1 -0
- package/dist/shared/terms/TermsLink.d.ts +1 -0
- package/dist/shared/terms/TermsLink.js +1 -0
- package/dist/shared/terms/index.d.ts +1 -0
- package/dist/shared/terms/index.js +1 -0
- package/dist/shared/terms/types.d.ts +43 -0
- package/dist/shared/ui/AdaptiveSurface/AdaptiveSurface.d.ts +52 -0
- package/dist/shared/ui/AdaptiveSurface/AdaptiveSurface.js +1 -0
- package/dist/shared/ui/AdaptiveSurface/index.d.ts +2 -0
- package/dist/shared/ui/AdaptiveSurface/index.js +1 -0
- package/dist/shared/ui/Card/Card.d.ts +12 -9
- package/dist/shared/ui/Card/Card.js +1 -1
- package/dist/shared/ui/Card/Card.styles.js +1 -1
- package/dist/shared/ui/Details/Details.d.ts +9 -1
- package/dist/shared/ui/Details/Details.styles.js +1 -1
- package/dist/shared/ui/Dialog/Dialog.d.ts +10 -8
- package/dist/shared/ui/Dialog/Dialog.js +1 -1
- package/dist/shared/ui/Dialog/Dialog.styles.js +1 -1
- package/dist/shared/ui/Drawer/Drawer.d.ts +135 -0
- package/dist/shared/ui/Drawer/Drawer.js +1 -0
- package/dist/shared/ui/Drawer/Drawer.slots.d.ts +19 -0
- package/dist/shared/ui/Drawer/Drawer.slots.js +1 -0
- package/dist/shared/ui/Drawer/Drawer.styles.js +1 -0
- package/dist/shared/ui/Drawer/index.d.ts +2 -0
- package/dist/shared/ui/Drawer/index.js +1 -0
- package/dist/shared/ui/Select/Select.js +1 -1
- package/dist/shared/ui/SelectableTile/SelectableTile.d.ts +21 -8
- package/dist/shared/ui/SelectableTile/SelectableTile.js +1 -1
- package/dist/shared/ui/Steps/Steps.d.ts +52 -0
- package/dist/shared/ui/Steps/Steps.js +1 -0
- package/dist/shared/ui/Steps/Steps.slots.d.ts +7 -0
- package/dist/shared/ui/Steps/Steps.slots.js +1 -0
- package/dist/shared/ui/Steps/Steps.styles.js +1 -0
- package/dist/shared/ui/Steps/index.d.ts +2 -0
- package/dist/shared/ui/Steps/index.js +1 -0
- package/dist/shared/ui/Tabs/Tabs.d.ts +79 -0
- package/dist/shared/ui/Tabs/Tabs.js +1 -0
- package/dist/shared/ui/Tabs/Tabs.slots.d.ts +11 -0
- package/dist/shared/ui/Tabs/Tabs.slots.js +1 -0
- package/dist/shared/ui/Tabs/Tabs.styles.js +1 -0
- package/dist/shared/ui/Tabs/index.d.ts +2 -0
- package/dist/shared/ui/Tabs/index.js +1 -0
- package/dist/shared/ui/WalletRow/WalletRow.d.ts +1 -1
- package/dist/shared/ui/WalletRow/WalletRow.js +1 -1
- package/dist/shared/ui/surfaceContext.d.ts +9 -0
- package/dist/shared/ui/surfaceContext.js +1 -0
- package/dist/shared/utils/assertNever.js +1 -0
- package/dist/shared/utils/logos/types.d.ts +1 -1
- package/dist/shared/utils/useDeepMemo.js +1 -0
- package/dist/shared/wallet/ConnectWalletContext.d.ts +17 -0
- package/dist/shared/wallet/ConnectWalletContext.js +1 -0
- package/dist/shared/widgets/activity/ActivityTrigger.js +1 -0
- package/dist/shared/widgets/activity/ActivityTrigger.styles.js +1 -0
- package/dist/shared/widgets/activity/adapters/settlementToWidgetProps.js +1 -0
- package/dist/shared/widgets/activity/compound/Activity.d.ts +95 -0
- package/dist/shared/widgets/activity/compound/Activity.js +1 -0
- package/dist/shared/widgets/activity/compound/Activity.slots.d.ts +22 -0
- package/dist/shared/widgets/activity/compound/Activity.slots.js +1 -0
- package/dist/shared/widgets/activity/compound/Activity.styles.js +1 -0
- package/dist/shared/widgets/activity/compound/ActivityDetail.d.ts +82 -0
- package/dist/shared/widgets/activity/compound/ActivityDetail.js +1 -0
- package/dist/shared/widgets/activity/compound/Row.slots.d.ts +21 -0
- package/dist/shared/widgets/activity/compound/Row.slots.js +1 -0
- package/dist/shared/widgets/activity/compound/Row.styles.js +1 -0
- package/dist/shared/widgets/activity/compound/components/ActivityHeader.d.ts +39 -0
- package/dist/shared/widgets/activity/compound/components/ActivityHeader.js +1 -0
- package/dist/shared/widgets/activity/compound/components/Empty.d.ts +15 -0
- package/dist/shared/widgets/activity/compound/components/Empty.js +1 -0
- package/dist/shared/widgets/activity/compound/components/ErrorView.d.ts +26 -0
- package/dist/shared/widgets/activity/compound/components/ErrorView.js +1 -0
- package/dist/shared/widgets/activity/compound/components/List.d.ts +23 -0
- package/dist/shared/widgets/activity/compound/components/List.js +1 -0
- package/dist/shared/widgets/activity/compound/components/Row.d.ts +51 -0
- package/dist/shared/widgets/activity/compound/components/Row.js +1 -0
- package/dist/shared/widgets/activity/compound/components/StatusPip.js +1 -0
- package/dist/shared/widgets/activity/compound/context.d.ts +95 -0
- package/dist/shared/widgets/activity/compound/context.js +1 -0
- package/dist/shared/widgets/activity/compound/index.d.ts +8 -0
- package/dist/shared/widgets/activity/compound/index.js +1 -0
- package/dist/shared/widgets/activity/index.js +1 -0
- package/dist/shared/widgets/activity/payloads.d.ts +108 -0
- package/dist/shared/widgets/activity/transformers/activityResponseToPayload.js +1 -0
- package/dist/shared/widgets/activity/transformers/resolveDirection.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/AmountEntry.d.ts +10 -2
- package/dist/shared/widgets/amount-entry/compound/AmountEntry.js +1 -1
- package/dist/shared/widgets/amount-entry/compound/AmountEntry.slots.d.ts +6 -0
- package/dist/shared/widgets/amount-entry/compound/AmountEntry.slots.js +1 -1
- package/dist/shared/widgets/amount-entry/compound/AmountEntry.styles.js +1 -1
- package/dist/shared/widgets/amount-entry/compound/components/Details.d.ts +34 -0
- package/dist/shared/widgets/amount-entry/compound/components/Details.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/components/Footer.d.ts +2 -1
- package/dist/shared/widgets/amount-entry/compound/components/Footer.js +1 -1
- package/dist/shared/widgets/amount-entry/compound/components/Header.d.ts +6 -1
- package/dist/shared/widgets/amount-entry/compound/components/Header.js +1 -1
- package/dist/shared/widgets/amount-entry/compound/components/Hero/Hero.js +1 -1
- package/dist/shared/widgets/amount-entry/compound/components/Hero/SwapBackdrop.js +1 -1
- package/dist/shared/widgets/amount-entry/compound/components/Notice.d.ts +7 -0
- package/dist/shared/widgets/amount-entry/compound/components/Notice.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/index.d.ts +1 -1
- package/dist/shared/widgets/amount-entry/compound/types.d.ts +69 -3
- package/dist/shared/widgets/asset-picker/compound/AssetPicker.d.ts +3 -0
- package/dist/shared/widgets/asset-picker/compound/AssetPicker.js +1 -1
- package/dist/shared/widgets/asset-picker/compound/AssetPicker.slots.d.ts +2 -0
- package/dist/shared/widgets/asset-picker/compound/AssetPicker.slots.js +1 -1
- package/dist/shared/widgets/asset-picker/compound/AssetPicker.styles.js +1 -1
- package/dist/shared/widgets/asset-picker/compound/components/Asset.d.ts +7 -1
- package/dist/shared/widgets/asset-picker/compound/components/Asset.js +1 -1
- package/dist/shared/widgets/asset-picker/compound/components/Empty.d.ts +15 -0
- package/dist/shared/widgets/asset-picker/compound/components/Empty.js +1 -0
- package/dist/shared/widgets/asset-picker/compound/components/Header.d.ts +6 -1
- package/dist/shared/widgets/asset-picker/compound/components/Header.js +1 -1
- package/dist/shared/widgets/asset-picker/compound/types.d.ts +15 -1
- package/dist/shared/widgets/confirm-transfer/compound/ConfirmTransfer.styles.js +1 -1
- package/dist/shared/widgets/confirm-transfer/compound/components/Breakdown.js +1 -1
- package/dist/shared/widgets/confirm-transfer/compound/components/Disclaimer.d.ts +4 -3
- package/dist/shared/widgets/confirm-transfer/compound/components/Disclaimer.js +1 -1
- package/dist/shared/widgets/confirm-transfer/compound/components/QuoteTimer.js +1 -1
- package/dist/shared/widgets/error-state/compound/components/AssetValue.js +1 -1
- package/dist/shared/widgets/error-state/compound/components/HelpInfo.js +1 -1
- package/dist/shared/widgets/error-state/compound/components/MoreDetails.d.ts +1 -1
- package/dist/shared/widgets/error-state/compound/components/MoreDetails.js +1 -1
- package/dist/shared/widgets/error-state/compound/components/StatusValue.js +1 -1
- package/dist/shared/widgets/processing-state/compound/ProcessingState.d.ts +1 -5
- package/dist/shared/widgets/processing-state/compound/ProcessingState.js +1 -1
- package/dist/shared/widgets/processing-state/compound/ProcessingState.slots.d.ts +0 -1
- package/dist/shared/widgets/processing-state/compound/ProcessingState.slots.js +1 -1
- package/dist/shared/widgets/processing-state/compound/ProcessingState.styles.js +1 -1
- package/dist/shared/widgets/processing-state/compound/components/Details.d.ts +6 -1
- package/dist/shared/widgets/processing-state/compound/components/Details.js +1 -1
- package/dist/shared/widgets/processing-state/compound/components/Header.d.ts +4 -3
- package/dist/shared/widgets/processing-state/compound/components/Header.js +1 -1
- package/dist/shared/widgets/processing-state/compound/components/Hero.d.ts +14 -7
- package/dist/shared/widgets/processing-state/compound/components/Hero.js +1 -1
- package/dist/shared/widgets/processing-state/compound/components/Rows.js +1 -1
- package/dist/shared/widgets/processing-state/compound/components/StatusPill.js +1 -1
- package/dist/shared/widgets/processing-state/compound/components/splitAmount.js +1 -0
- package/dist/shared/widgets/processing-state/compound/index.d.ts +1 -1
- package/dist/shared/widgets/processing-state/compound/types.d.ts +11 -29
- package/dist/shared/widgets/success-state/compound/components/Actions.js +1 -1
- package/dist/shared/widgets/success-state/compound/components/AssetValue.js +1 -1
- package/dist/shared/widgets/success-state/compound/components/MoreDetails.d.ts +1 -1
- package/dist/shared/widgets/success-state/compound/components/MoreDetails.js +1 -1
- package/dist/shared/widgets/success-state/compound/components/RouteValue.js +1 -1
- package/dist/shared/widgets/success-state/compound/components/StatusPill.js +1 -1
- package/dist/shared/widgets/success-state/compound/types.d.ts +5 -5
- package/dist/storage/context.d.ts +9 -1
- package/dist/storage/context.js +1 -1
- package/dist/storage/index.d.ts +1 -1
- package/dist/stridge/StridgeProvider.d.ts +177 -35
- package/dist/stridge/StridgeProvider.js +1 -1
- package/dist/stridge/depositOwner.js +1 -0
- package/dist/stridge/optionalWagmi.js +1 -0
- package/dist/stridge/stubs.js +1 -1
- package/dist/styles/index.css +567 -12
- package/dist/types.d.ts +8 -6
- package/dist/ui/index.d.ts +9 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.d.ts +10 -0
- package/dist/version.js +1 -0
- package/dist/withdraw/compound/index.d.ts +11 -8
- package/dist/withdraw/compound/index.js +1 -1
- package/dist/withdraw/dialog/index.d.ts +4 -1
- package/dist/withdraw/widgets/index.d.ts +7 -0
- package/dist/withdraw/widgets/index.js +1 -0
- package/package.json +31 -7
- package/dist/_internal/deposit/widgets/index.d.ts +0 -11
- package/dist/_internal/deposit/widgets/index.js +0 -1
- package/dist/_internal/withdraw/widgets/index.d.ts +0 -5
- package/dist/_internal/withdraw/widgets/index.js +0 -1
- package/dist/flows/withdraw/dialog/WithdrawDialogEventsContext.d.ts +0 -36
- package/dist/flows/withdraw/dialog/WithdrawDialogEventsContext.js +0 -1
- package/dist/shared/widgets/processing-state/compound/components/Actions.d.ts +0 -17
- package/dist/shared/widgets/processing-state/compound/components/Actions.js +0 -1
- package/dist/stridge/StridgeContext.d.ts +0 -29
- package/dist/stridge/StridgeContext.js +0 -1
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { BalanceItemPayload, QuotePayload, SettlementFailurePayload, SettlementPendingPayload, SettlementSuccessPayload } from "../driver/payloads.js";
|
|
3
|
-
import { FailureInfo } from "../../../shared/orchestrator/types.js";
|
|
4
|
-
import { DepositMethod, DepositState, DepositStateName, ResolvedOpenInput } from "../orchestrator/types.js";
|
|
1
|
+
import { Presentation } from "../../../shared/presentation/types.js";
|
|
5
2
|
import { ErrorInfo } from "react";
|
|
6
3
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
7
4
|
|
|
@@ -12,23 +9,23 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
12
9
|
* bound to the controller's `state.name !== "closed"`, so the dialog appears / disappears
|
|
13
10
|
* automatically as descendants call `useDeposit().open()` / `.close()`.
|
|
14
11
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
12
|
+
* The dialog is a pure composition of compound parts — `<Deposit.Boundary>` for crash
|
|
13
|
+
* recovery, `<Deposit.Guards>` for the wallet-required / bootstrap-fatal / bootstrap-loading
|
|
14
|
+
* cascade, `<Deposit.Steps>` for FSM-driven screen routing, and `<DepositStatusBanner />` for
|
|
15
|
+
* the inline settlement banner. Each piece is independently overrideable via the compound
|
|
16
|
+
* surface; this is the canonical shape integrators can copy verbatim.
|
|
18
17
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
18
|
+
* Lifecycle observability is delivered by the unified event bus exported from
|
|
19
|
+
* `@stridge/kit/events`. The dialog itself takes no `on*` callback props — subscribe via
|
|
20
|
+
* `useStridgeFlowEvents` / `useStridgeEvents` (or the single-event variants) anywhere in
|
|
21
|
+
* the provider subtree.
|
|
23
22
|
*/
|
|
24
23
|
declare function DepositDialog({
|
|
25
24
|
container,
|
|
26
|
-
|
|
27
|
-
onClosed,
|
|
28
|
-
onStepChanged,
|
|
25
|
+
metadata,
|
|
29
26
|
onError,
|
|
30
|
-
|
|
31
|
-
}
|
|
27
|
+
presentation
|
|
28
|
+
}?: DepositDialog.Props): _$react_jsx_runtime0.JSX.Element;
|
|
32
29
|
declare namespace DepositDialog {
|
|
33
30
|
interface Props {
|
|
34
31
|
/**
|
|
@@ -37,76 +34,26 @@ declare namespace DepositDialog {
|
|
|
37
34
|
* dialog's width, height, and backdrop to that rect.
|
|
38
35
|
*/
|
|
39
36
|
container?: HTMLElement | null;
|
|
40
|
-
/** Forwarded to the dialog's internal {@link GatewayKitBoundary} for crash reporting. */
|
|
41
|
-
onError?: (error: Error, errorInfo: ErrorInfo) => void;
|
|
42
37
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
38
|
+
* Consumer-attached metadata that rides along on every bus event emitted from this
|
|
39
|
+
* dialog's session. Snapshotted at `deposit.opened` and frozen for the session —
|
|
40
|
+
* mid-flow prop changes are ignored to keep correlation consistent from `opened` to
|
|
41
|
+
* the terminal event. The kit does not validate or normalise the shape.
|
|
45
42
|
*/
|
|
46
|
-
|
|
47
|
-
/** Fires once when the dialog transitions back to `closed`. `atStep` is the last open step. */
|
|
48
|
-
onClosed?: (atStep: DepositStateName) => void;
|
|
49
|
-
/** Fires on every logical step transition. */
|
|
50
|
-
onStepChanged?: (event: {
|
|
51
|
-
from: DepositStateName;
|
|
52
|
-
to: DepositStateName;
|
|
53
|
-
ctx: GatewayContext | null;
|
|
54
|
-
}) => void;
|
|
55
|
-
/** Operational events — user actions, async outcomes, settlement-entity transitions. */
|
|
56
|
-
events?: Events;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Operational lifecycle hooks. Fire after the controller has acted (state machine has
|
|
60
|
-
* transitioned, driver entity has settled), so payloads are guaranteed valid for the named
|
|
61
|
-
* event.
|
|
62
|
-
*/
|
|
63
|
-
interface Events {
|
|
64
|
-
/** User picked a deposit method on the `Deposit` step. */
|
|
65
|
-
onMethodSelected?: (method: DepositMethod) => void;
|
|
66
|
-
/** User confirmed an asset on the `AssetPicker` step. The asset is the driver-shaped balance row. */
|
|
67
|
-
onAssetSelected?: (asset: BalanceItemPayload) => void;
|
|
68
|
-
/** User submitted an amount on the `AmountEntry` step. */
|
|
69
|
-
onAmountSubmitted?: (amount: number) => void;
|
|
70
|
-
/** User confirmed the deposit on the `ConfirmDeposit` step (wallet prompt is about to fire). */
|
|
71
|
-
onDepositConfirmed?: () => void;
|
|
72
|
-
/** User pressed Back on a non-root step. */
|
|
73
|
-
onBackPressed?: (fromStep: DepositStateName) => void;
|
|
74
|
-
/** Orchestrator requested a quote (`confirmDeposit` entered `loading` or `regenerating`). */
|
|
75
|
-
onQuoteRequested?: (input: {
|
|
76
|
-
asset: BalanceItemPayload;
|
|
77
|
-
amount: number;
|
|
78
|
-
}) => void;
|
|
79
|
-
/** Orchestrator received a successful quote — fires when the driver's `quote` entity transitions to `ready`. */
|
|
80
|
-
onQuoteResolved?: (quote: QuotePayload) => void;
|
|
81
|
-
/** Quote fetch failed (FSM `confirmDeposit{phase: failed, recoverFrom: "quote"}`). */
|
|
82
|
-
onQuoteFailed?: (failure: FailureInfo) => void;
|
|
83
|
-
/** A quote silently expired and a regeneration started (no user interaction). */
|
|
84
|
-
onQuoteExpired?: () => void;
|
|
85
|
-
/** Wallet broadcast a deposit tx; the orchestrator transitioned into `processing`. */
|
|
86
|
-
onDepositSubmitted?: (tx: TxRef) => void;
|
|
87
|
-
/** User declined the wallet signature prompt; orchestrator regenerated the quote. */
|
|
88
|
-
onSignatureDeclined?: () => void;
|
|
89
|
-
/** Deposit submission failed for a non-rejection reason. */
|
|
90
|
-
onSubmissionFailed?: (failure: FailureInfo) => void;
|
|
91
|
-
/** The driver's `settlement` entity emitted a progressive pending update. */
|
|
92
|
-
onProcessingProgress?: (update: SettlementPendingPayload) => void;
|
|
93
|
-
/** Terminal success — settlement entity reached `ready{kind: "succeeded"}`. */
|
|
94
|
-
onSucceeded?: (result: SettlementSuccessPayload) => void;
|
|
43
|
+
metadata?: Record<string, unknown>;
|
|
95
44
|
/**
|
|
96
|
-
*
|
|
97
|
-
*
|
|
45
|
+
* Forwarded to the dialog's internal `<Deposit.Boundary>` for crash reporting. The
|
|
46
|
+
* boundary's `onReset` is wired automatically through `useDeposit().close()`.
|
|
98
47
|
*/
|
|
99
|
-
|
|
48
|
+
onError?: (error: Error, errorInfo: ErrorInfo) => void;
|
|
100
49
|
/**
|
|
101
|
-
*
|
|
102
|
-
*
|
|
50
|
+
* Per-dialog surface override. `"auto"` (default) renders a centred dialog on wide
|
|
51
|
+
* containers and a bottom-sheet drawer below the breakpoint; `"dialog"` / `"drawer"`
|
|
52
|
+
* force one surface. Pass `{ mode, breakpoint }` to tune the px threshold (default 600).
|
|
53
|
+
* Wins over the provider's `appearance.presentation`; omit to inherit it.
|
|
103
54
|
*/
|
|
104
|
-
|
|
55
|
+
presentation?: Presentation;
|
|
105
56
|
}
|
|
106
57
|
}
|
|
107
|
-
/** Convenience union — the `ctx` payload on `onStepChanged`. */
|
|
108
|
-
type GatewayContext = Exclude<DepositState, {
|
|
109
|
-
name: "closed";
|
|
110
|
-
}>["ctx"];
|
|
111
58
|
//#endregion
|
|
112
59
|
export { DepositDialog };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useDepositSnapshot as e}from"../driver/context.js";import{
|
|
1
|
+
"use client";import{useDepositSnapshot as e}from"../driver/context.js";import{useControllerContext as t}from"../orchestrator/controller.js";import{useDepositEmissions as n}from"../../../events/emit/useDepositEmissions.js";import"../../../events/emit/index.js";import{useIntercomShutdownOnUnmount as r}from"../../../shared/support/useIntercomShutdownOnUnmount.js";import"../../../shared/support/index.js";import{AdaptiveSurface as i}from"../../../shared/ui/AdaptiveSurface/AdaptiveSurface.js";import"../../../shared/ui/AdaptiveSurface/index.js";import{Deposit as a}from"../widgets/deposit/compound/Deposit.js";import"../widgets/deposit/compound/index.js";import{DepositActivityDetail as o}from"../widgets/activity/DepositActivityDetail.js";import{DepositActivityList as s}from"../widgets/activity/DepositActivityList.js";import"../widgets/activity/index.js";import{AmountEntry as c}from"../widgets/amount-entry/AmountEntry.js";import"../widgets/amount-entry/index.js";import{AssetPicker as l}from"../widgets/asset-picker/AssetPicker.js";import"../widgets/asset-picker/index.js";import{ConfirmDeposit as u}from"../widgets/confirm-deposit/ConfirmDeposit.js";import"../widgets/confirm-deposit/index.js";import{Deposit as d}from"../widgets/deposit/Deposit.js";import"../widgets/deposit/index.js";import{DepositStatusBanner as f}from"../widgets/deposit-status-banner/DepositStatusBanner.js";import"../widgets/deposit-status-banner/index.js";import{ErrorState as p}from"../widgets/error-state/ErrorState.js";import"../widgets/error-state/index.js";import{OnrampAmountEntry as m}from"../widgets/onramp-amount-entry/OnrampAmountEntry.js";import"../widgets/onramp-amount-entry/index.js";import{OnrampConfirm as h}from"../widgets/onramp-confirm/OnrampConfirm.js";import"../widgets/onramp-confirm/index.js";import{OnrampPaymentPending as g}from"../widgets/onramp-payment-pending/OnrampPaymentPending.js";import"../widgets/onramp-payment-pending/index.js";import{ProcessingState as _}from"../widgets/processing-state/ProcessingState.js";import"../widgets/processing-state/index.js";import{SuccessState as v}from"../widgets/success-state/SuccessState.js";import"../widgets/success-state/index.js";import{TransferCrypto as y}from"../widgets/transfer-crypto/TransferCrypto.js";import"../widgets/transfer-crypto/index.js";import{jsx as b,jsxs as x}from"react/jsx-runtime";function S({container:S,metadata:C,onError:w,presentation:T}={}){let{state:E,controller:D}=t(),O=e(),k=E.name!==`closed`;return n({state:E,settlement:O.settlement,quote:O.quote,metadata:C}),r(),b(i,{open:k,onOpenChange:e=>{e||D.close()},container:S,...T?{presentation:T}:{},children:x(a.Boundary,{...w?{onError:w}:{},children:[b(a.Guards,{children:x(a.Steps,{children:[b(a.Step,{name:`deposit`,children:b(d,{})}),b(a.Step,{name:`assetPicker`,children:b(l,{})}),b(a.Step,{name:`amountEntry`,children:b(c,{})}),b(a.Step,{name:`onrampAmountEntry`,children:b(m,{})}),b(a.Step,{name:`onrampConfirm`,children:b(h,{})}),b(a.Step,{name:`onrampPaymentPending`,children:b(g,{})}),b(a.Step,{name:`confirmDeposit`,children:b(u,{})}),b(a.Step,{name:`transferCrypto`,children:b(y,{})}),b(a.Step,{name:`processing`,children:b(_,{})}),b(a.Step,{name:`success`,children:b(v,{})}),b(a.Step,{name:`error`,children:b(p,{})}),b(a.Step,{name:`activityList`,children:b(s,{})}),b(a.Step,{name:`activityDetail`,children:b(o,{})})]})}),b(f,{})]})})}export{S as DepositDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{Trans as e}from"../../../shared/i18n/Trans.js";import"../../../i18n/index.js";import{useDepositActions as t}from"../orchestrator/controller.js";import{WalletIcon as n}from"../../../shared/icons/WalletIcon.js";import"../../../icons/index.js";import{useConnectWallet as r}from"../../../shared/wallet/ConnectWalletContext.js";import{Button as i}from"../../../shared/ui/Button/Button.js";import{Dialog as a}from"../../../shared/ui/Dialog/Dialog.js";import"../../../shared/ui/Dialog/index.js";import{Card as o}from"../../../shared/ui/Card/Card.js";import{text as s}from"../../../shared/ui/Text/Text.js";import"../../../ui/index.js";import{Frame as c}from"../../../shared/dialog/Frame.js";import{styles as l}from"./WalletRequiredState.styles.js";import{jsx as u,jsxs as d}from"react/jsx-runtime";import*as f from"@stylexjs/stylex";function p(){return d(`div`,{"aria-hidden":!0,...f.props(l.heroRing),children:[d(`svg`,{viewBox:`0 0 64 64`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,...f.props(l.heroRingSvg),children:[u(`circle`,{cx:`32`,cy:`32`,r:`28`,strokeWidth:`2`,style:{stroke:`color-mix(in oklab, var(--stridge-kit-info) 55%, transparent)`}}),u(`circle`,{cx:`32`,cy:`32`,r:`20`,style:{fill:`var(--stridge-kit-info)`}})]}),u(n,{style:{color:`var(--stridge-kit-info-foreground)`},...f.props(l.heroRingGlyph)})]})}function m(){let{close:n}=t(),m=r();return d(c,{"data-stridge-slot":`deposit-wallet-required`,"data-testid":`deposit-wallet-required`,...f.props(l.root),children:[d(o.Header,{...f.props(l.header),children:[u(s.span,{size:`base`,fontWeight:`semibold`,leading:`tight`,tracking:`tight`,children:u(e,{id:`5AApJw`,message:`Connect a wallet to continue`})}),u(a.CloseButton,{})]}),u(o.Body,{children:d(`div`,{"data-stridge-slot":`deposit-wallet-required-hero`,...f.props(l.hero),children:[u(p,{}),u(s.span,{size:`lg`,fontWeight:`semibold`,leading:`tight`,tracking:`tight`,align:`center`,...f.props(l.heroHeadline),children:u(e,{id:`BoQOH3`,message:`A wallet is required to deposit`})}),u(s.span,{size:`sm`,leading:`normal`,align:`center`,color:`subdued`,...f.props(l.heroReason),children:u(e,{id:`mF_ucv`,message:`Connect a wallet so the gateway can provision a deposit address and route your transfer.`})})]})}),d(o.Footer,{...f.props(l.footer),children:[m?u(i,{variant:`default`,size:`cta`,onClick:()=>{m.onClick()},"data-stridge-slot":`deposit-wallet-required-connect`,...f.props(l.cta),children:m.label??u(e,{id:`VHOVEJ`,message:`Connect wallet`})}):null,u(i,{variant:m?`ghost`:`default`,size:`cta`,onClick:n,"data-stridge-slot":`deposit-wallet-required-close`,...f.props(l.cta),children:u(e,{id:`yz7wBu`,message:`Close`})})]})]})}export{m as WalletRequiredState};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={root:{"WalletRequiredState__styles.root":`WalletRequiredState__styles.root`,"position-kVAEAm":`x1n2onr6`,"width-kzqmXN":`xh8yej3`,"maxWidth-ks0D6T":`x17fpy1y`,$$css:`@stridge/kit:src/flows/deposit/dialog/WalletRequiredState.styles.ts:25`},header:{"WalletRequiredState__styles.header":`WalletRequiredState__styles.header`,"justifyContent-kjj79g":`x1qughib`,$$css:`@stridge/kit:src/flows/deposit/dialog/WalletRequiredState.styles.ts:34`},hero:{"WalletRequiredState__styles.hero":`WalletRequiredState__styles.hero`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`xdt5ytf`,"alignItems-kGNEyG":`x6s0dn4`,"gap-kOIVth":`x883omv`,"paddingTop-kLKAdn":`x9desvi`,"paddingInline-kg3NbH":`x65v0h`,"paddingBottom-kGO01o":`x1hhzuzn`,"animationName-kKVMdj":`xv305lp`,"animationDuration-k44tkh":`xmprevt x1s1fvk8`,"animationTimingFunction-kyAemX":`xrkt6z0`,"animationFillMode-kWV6AL":`x1u6ievf`,$$css:`@stridge/kit:src/flows/deposit/dialog/WalletRequiredState.styles.ts:42`},heroRing:{"WalletRequiredState__styles.heroRing":`WalletRequiredState__styles.heroRing`,"position-kVAEAm":`x1n2onr6`,"width-kzqmXN":`x1fu8urw`,"height-kZKoxP":`x1peatla`,"flexShrink-kmuXW":`x2lah0s`,$$css:`@stridge/kit:src/flows/deposit/dialog/WalletRequiredState.styles.ts:64`},heroRingSvg:{"WalletRequiredState__styles.heroRingSvg":`WalletRequiredState__styles.heroRingSvg`,"display-k1xSpc":`x1lliihq`,"width-kzqmXN":`xh8yej3`,"height-kZKoxP":`x5yr21d`,$$css:`@stridge/kit:src/flows/deposit/dialog/WalletRequiredState.styles.ts:73`},heroRingGlyph:{"WalletRequiredState__styles.heroRingGlyph":`WalletRequiredState__styles.heroRingGlyph`,"position-kVAEAm":`x10l6tqk`,"insetInlineStart-kLqNvP":`xbudbmw`,"top-k87sOh":`xwa60dl`,"transform-k3aq6I":`x11lhmoz`,"width-kzqmXN":`xgd8bvy`,"height-kZKoxP":`x1fgtraw`,"strokeWidth-kfJifR":`xvlca1e`,$$css:`@stridge/kit:src/flows/deposit/dialog/WalletRequiredState.styles.ts:87`},heroHeadline:{"WalletRequiredState__styles.heroHeadline":`WalletRequiredState__styles.heroHeadline`,"marginTop-keoZOQ":`x1k70j0n`,$$css:`@stridge/kit:src/flows/deposit/dialog/WalletRequiredState.styles.ts:96`},heroReason:{"WalletRequiredState__styles.heroReason":`WalletRequiredState__styles.heroReason`,"maxWidth-ks0D6T":`x1va8c73`,$$css:`@stridge/kit:src/flows/deposit/dialog/WalletRequiredState.styles.ts:99`},footer:{"WalletRequiredState__styles.footer":`WalletRequiredState__styles.footer`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`xdt5ytf`,"alignItems-kGNEyG":`x1qjc9v5`,"gap-kOIVth":`x1a6yh9e`,"paddingTop-kLKAdn":`x109j2v6`,"paddingInline-kg3NbH":`x65v0h`,"paddingBottom-kGO01o":`x1t4gjm`,$$css:`@stridge/kit:src/flows/deposit/dialog/WalletRequiredState.styles.ts:107`},cta:{"WalletRequiredState__styles.cta":`WalletRequiredState__styles.cta`,"width-kzqmXN":`xh8yej3`,"alignSelf-kSGwAc":`xkh2ocl`,$$css:`@stridge/kit:src/flows/deposit/dialog/WalletRequiredState.styles.ts:116`}};export{e as styles};
|
|
@@ -40,6 +40,97 @@ interface WalletPayload {
|
|
|
40
40
|
*/
|
|
41
41
|
balanceTotalUsd?: FormattedField<number>;
|
|
42
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Capability descriptor for the onramp ("Cash") rail. The rail is single-method — the
|
|
45
|
+
* provider's hosted checkout collects the payment instrument — so drivers populate one capability
|
|
46
|
+
* bag with the limit + processing-time the deposit-method picker surfaces on the row's meta line
|
|
47
|
+
* (`"$116,000.00 limit · Instant"`). Both fields are optional so the meta line drops segments
|
|
48
|
+
* gracefully when the driver doesn't surface them yet.
|
|
49
|
+
*/
|
|
50
|
+
interface OnrampMethodCapability {
|
|
51
|
+
/**
|
|
52
|
+
* Maximum deposit, in USD. `value` is the raw ceiling for sorting / range checks; `formatted`
|
|
53
|
+
* is the localized currency string (`"$116,000.00"`). The widget composes the meta segment
|
|
54
|
+
* from the formatted string plus a localized `" limit"` suffix.
|
|
55
|
+
*/
|
|
56
|
+
limit?: FormattedField<number>;
|
|
57
|
+
/**
|
|
58
|
+
* Estimated time from confirmation to credit. `value` is seconds (`0` = instant); `formatted`
|
|
59
|
+
* is the localized display label the widget renders verbatim (`"Instant"`, `"5 min"`, …).
|
|
60
|
+
* Drivers pre-format because the kit's i18n macros do not have driver-thread access.
|
|
61
|
+
*/
|
|
62
|
+
processingTime?: FormattedField<number>;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Onramp-rail capability bag surfaced on `DepositSnapshot.onrampMethods`. The rail is single-method
|
|
66
|
+
* (the hosted-checkout provider collects the payment instrument), so this carries one capability
|
|
67
|
+
* directly rather than a per-method map. The orchestrated `Deposit` widget reads the `limit` +
|
|
68
|
+
* `processingTime` and maps them into the "Cash" row's meta line; the onramp amount-entry
|
|
69
|
+
* reads `limit` for its over-limit / unavailable notices.
|
|
70
|
+
*/
|
|
71
|
+
type OnrampMethodsPayload = OnrampMethodCapability;
|
|
72
|
+
/**
|
|
73
|
+
* Receive-asset descriptor for the onramp rail — the crypto the user ends up with after the fiat
|
|
74
|
+
* purchase settles. Mirrors {@link AssetPayload} plus the `chainId` the kit's `TokenLogo` resolver
|
|
75
|
+
* needs, so the onramp amount-entry / confirm screens render the destination token without reaching
|
|
76
|
+
* into another entity.
|
|
77
|
+
*/
|
|
78
|
+
interface OnrampReceiveAssetPayload extends AssetPayload {
|
|
79
|
+
/** EIP-155 chain id of the receive asset (drives the token-logo resolver). */
|
|
80
|
+
chainId: number;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Formatted onramp-quote result surfaced on `DepositSnapshot.onrampQuote` — the fiat→crypto pricing
|
|
84
|
+
* the onramp amount-entry hero, receive chip, and fee-breakdown rows read. Backed by the SDK's
|
|
85
|
+
* `OnrampQuoteResponse`. Raw numeric `value`s are kept on the {@link FormattedField}s so widgets can
|
|
86
|
+
* re-derive (e.g. net-of-fees) locally.
|
|
87
|
+
*/
|
|
88
|
+
interface OnrampQuotePayload {
|
|
89
|
+
/** Fiat amount the user pays (USD). */
|
|
90
|
+
amountUsd: FormattedField<number>;
|
|
91
|
+
/** Crypto amount the user receives after fees. Drives the Receive chip + hero sub-line. */
|
|
92
|
+
receiveAmount: FormattedField<number>;
|
|
93
|
+
/** The crypto asset the user receives. */
|
|
94
|
+
receiveAsset: OnrampReceiveAssetPayload;
|
|
95
|
+
/** Crypto-per-fiat rate (e.g. USDC per USD). Drives the price row. */
|
|
96
|
+
rate: FormattedField<number>;
|
|
97
|
+
/** Provider processing fee (USD). Omitted when the provider doesn't surface it. */
|
|
98
|
+
processingFeeUsd?: FormattedField<number>;
|
|
99
|
+
/** Network/settlement fee (USD). Omitted when zero / unknown. */
|
|
100
|
+
networkFeeUsd?: FormattedField<number>;
|
|
101
|
+
/** Total fee charged on top of the received crypto (USD). */
|
|
102
|
+
totalFeeUsd: FormattedField<number>;
|
|
103
|
+
/** Resolved hosted-checkout provider name. */
|
|
104
|
+
provider?: string;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Lifecycle state of an onramp checkout session, mirrored 1:1 from the SDK's
|
|
108
|
+
* `OnrampSessionState`. The kit's reducer maps the three terminal values onto its shared
|
|
109
|
+
* `processing` / `success` / `error` screens.
|
|
110
|
+
*/
|
|
111
|
+
type OnrampSessionStateName = "SESSION_PENDING" | "SESSION_COMPLETED" | "SESSION_EXPIRED" | "SESSION_FAILED";
|
|
112
|
+
/**
|
|
113
|
+
* Onramp checkout-session payload surfaced on `DepositSnapshot.onrampSession`. Created by
|
|
114
|
+
* {@link import("./types").DepositDriver.createOnrampSession} and advanced by
|
|
115
|
+
* {@link import("./types").DepositDriver.watchOnrampSession}. The `checkoutUrl` is the provider-hosted
|
|
116
|
+
* page the kit redirects (or pops out) to; `state` drives the redirect → poll → terminal UI.
|
|
117
|
+
*/
|
|
118
|
+
interface OnrampSessionPayload {
|
|
119
|
+
/** Provider session id (UUID). */
|
|
120
|
+
sessionId: string;
|
|
121
|
+
/** Current session state. */
|
|
122
|
+
state: OnrampSessionStateName;
|
|
123
|
+
/** Provider-hosted checkout URL the user completes payment on. Present once the session is created. */
|
|
124
|
+
checkoutUrl?: string;
|
|
125
|
+
/** Provider order id, once allocated. */
|
|
126
|
+
providerOrderId?: string;
|
|
127
|
+
/** Crypto amount the user receives, captured at create time (display units). */
|
|
128
|
+
receiveAmount?: FormattedField<number>;
|
|
129
|
+
/** Failure code when `state === "SESSION_FAILED"` (e.g. `"payment_declined"`). */
|
|
130
|
+
failureCode?: string;
|
|
131
|
+
/** Session/checkout expiry timestamp (Unix-ms). */
|
|
132
|
+
expiresAt?: number;
|
|
133
|
+
}
|
|
43
134
|
/**
|
|
44
135
|
* Brand context surfaced across the kit's chrome — `<DialogShell>` title, `<ConfirmDeposit>`
|
|
45
136
|
* destination row, `<ProcessingState>` header pill, `<SuccessState>` "credited to" line. The host
|
|
@@ -95,7 +186,13 @@ interface AssetPayload {
|
|
|
95
186
|
*/
|
|
96
187
|
interface TargetPayload extends ChainPayload, AssetPayload {
|
|
97
188
|
/** Optional minimum-deposit USD floor surfaced on amount-entry / asset-picker chrome. */
|
|
98
|
-
|
|
189
|
+
minAmountUsd?: FormattedField<number>;
|
|
190
|
+
/**
|
|
191
|
+
* Optional upper USD bound on the deposit amount. When set, the amount-entry treats
|
|
192
|
+
* `min(walletBalanceUsd, maxAmountUsd.value)` as the effective ceiling. Omitted when the
|
|
193
|
+
* host did not configure `flows.deposit.maxAmountUsd`.
|
|
194
|
+
*/
|
|
195
|
+
maxAmountUsd?: FormattedField<number>;
|
|
99
196
|
}
|
|
100
197
|
/**
|
|
101
198
|
* Per-chain deposit address provisioned by `gateway/start`. The kit ships one envelope item per
|
|
@@ -111,9 +208,9 @@ interface AddressItemPayload extends ChainPayload {
|
|
|
111
208
|
* Per-chain minimum-deposit USD floor surfaced next to the chain row in the transfer-crypto
|
|
112
209
|
* picker (`"Min $5"`). Drivers populate this from `supportedAssets`'s per-(chain × asset)
|
|
113
210
|
* floors so the user sees the right number for the chain they're funding from. Optional —
|
|
114
|
-
* the picker falls back to {@link TargetPayload.
|
|
211
|
+
* the picker falls back to {@link TargetPayload.minAmountUsd} when this isn't available.
|
|
115
212
|
*/
|
|
116
|
-
|
|
213
|
+
minAmountUsd?: FormattedField<number>;
|
|
117
214
|
/**
|
|
118
215
|
* Tokens the gateway accepts on this chain (`gateway/start.deposit_addresses[i].accepted_assets`).
|
|
119
216
|
* Drives the transfer-crypto Tokens dropdown — when the user picks a chain, the dropdown
|
|
@@ -140,6 +237,13 @@ interface AcceptedAssetPayload {
|
|
|
140
237
|
assetLogoUrl?: string;
|
|
141
238
|
/** True for the chain's native gas token (synthesized from an empty `address`). */
|
|
142
239
|
isNative: boolean;
|
|
240
|
+
/**
|
|
241
|
+
* Estimated price impact of depositing this asset, as a percentage decimal string
|
|
242
|
+
* (`"0.5"`, `"1.25"`). Joined from the `gateway/assets` catalog by (chain × contract address)
|
|
243
|
+
* — the wire's `accepted_assets` doesn't carry it. Drives the price-impact hint on the
|
|
244
|
+
* transfer-crypto disclosure row. Omitted when the catalog has no estimate for this asset.
|
|
245
|
+
*/
|
|
246
|
+
priceImpact?: string;
|
|
143
247
|
}
|
|
144
248
|
/**
|
|
145
249
|
* Source-side per-asset balance — what the connected wallet holds across supported chains. Drives
|
|
@@ -154,7 +258,7 @@ interface BalanceItemPayload extends ChainPayload, AssetPayload {
|
|
|
154
258
|
priceUsd?: number;
|
|
155
259
|
/**
|
|
156
260
|
* `true` when this row's USD value is below the kit's deposit floor
|
|
157
|
-
* ({@link TargetPayload.
|
|
261
|
+
* ({@link TargetPayload.minAmountUsd}). Drives the muted "Low Balance" badge in the asset
|
|
158
262
|
* picker; the row remains visible so the user knows the asset exists in the wallet.
|
|
159
263
|
*/
|
|
160
264
|
lowBalance?: boolean;
|
|
@@ -339,4 +443,4 @@ interface SettlementFailurePayload {
|
|
|
339
443
|
*/
|
|
340
444
|
type SettlementPayload = SettlementPendingPayload | SettlementSuccessPayload | SettlementFailurePayload;
|
|
341
445
|
//#endregion
|
|
342
|
-
export { AcceptedAssetPayload, AddressItemPayload, AssetPayload, BalanceItemPayload, BrandPayload, ChainPayload, QuoteBreakdownPayload, QuotePayload, QuoteRoutePayload, SettlementFailurePayload, SettlementPayload, SettlementPendingPayload, SettlementSuccessPayload, SourceWalletPayload, TargetPayload, WalletInfo, WalletPayload };
|
|
446
|
+
export { AcceptedAssetPayload, AddressItemPayload, AssetPayload, BalanceItemPayload, BrandPayload, ChainPayload, OnrampMethodCapability, OnrampMethodsPayload, OnrampQuotePayload, OnrampReceiveAssetPayload, OnrampSessionPayload, OnrampSessionStateName, QuoteBreakdownPayload, QuotePayload, QuoteRoutePayload, SettlementFailurePayload, SettlementPayload, SettlementPendingPayload, SettlementSuccessPayload, SourceWalletPayload, TargetPayload, WalletInfo, WalletPayload };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseDecimalSafe as e}from"../../../shared/transformers/parseSmallestUnit.js";import{formatTokenAmount as t}from"../../../../shared/format/formatTokenAmount.js";import{formatUsd as n}from"../../../../shared/format/formatUsd.js";function r(e){let t=new Set,n=new Set;for(let r of e.assets){let e=String(r.eip155_id);t.add(e);for(let t of r.assets)t.address&&n.add(`${e}:${t.address.toLowerCase()}`)}return{nativeChains:t,tokens:n}}function i(e,t){let n=t.routable!==void 0&&(t.routable.nativeChains.size>0||t.routable.tokens.size>0),r=[];for(let i of e.chains)for(let e of i.tokens)e.is_spam||n&&t.routable&&!o(i.eip155_id,e,t.routable)||r.push(a(i.label,i.eip155_id,i.stridge_network_id,e,t));return r.sort(s),r}function a(r,i,a,o,s){let c=e(o.amount),l=e(o.amount_usd),u=e(o.usd_price),d=s.resolveTokenIcon?.({chainId:i,tokenAddress:o.token_address,symbol:o.symbol,isNative:o.is_native})??s.logos?.(i,o.token_address,o.is_native)??o.logo??void 0,f=s.
|
|
1
|
+
import{parseDecimalSafe as e}from"../../../shared/transformers/parseSmallestUnit.js";import{formatTokenAmount as t}from"../../../../shared/format/formatTokenAmount.js";import{formatUsd as n}from"../../../../shared/format/formatUsd.js";function r(e){let t=new Set,n=new Set;for(let r of e.assets){let e=String(r.eip155_id);t.add(e);for(let t of r.assets)t.address&&n.add(`${e}:${t.address.toLowerCase()}`)}return{nativeChains:t,tokens:n}}function i(e,t){let n=t.routable!==void 0&&(t.routable.nativeChains.size>0||t.routable.tokens.size>0),r=[];for(let i of e.chains)for(let e of i.tokens)e.is_spam||n&&t.routable&&!o(i.eip155_id,e,t.routable)||r.push(a(i.label,i.eip155_id,i.stridge_network_id,e,t));return r.sort(s),r}function a(r,i,a,o,s){let c=e(o.amount),l=e(o.amount_usd),u=e(o.usd_price),d=s.resolveTokenIcon?.({chainId:i,tokenAddress:o.token_address,symbol:o.symbol,isNative:o.is_native})??s.logos?.(i,o.token_address,o.is_native)??o.logo??void 0,f=s.minAmountUsd!==void 0&&s.minAmountUsd>0&&l<s.minAmountUsd;return{networkId:a,networkName:r,eip155Id:String(i),symbol:o.symbol,decimals:o.decimals,address:o.token_address||`0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee`,isNative:o.is_native,...d?{assetLogoUrl:d}:{},amount:{value:c,formatted:t(c,s.i18n,{compact:!0})},...l>0?{amountUsd:{value:l,formatted:n(l,s.i18n)}}:{},...u>0?{priceUsd:u}:{},...f?{lowBalance:!0,disabled:!0}:{}}}function o(e,t,n){let r=String(e);return t.is_native?n.nativeChains.has(r):t.token_address?n.tokens.has(`${r}:${t.token_address.toLowerCase()}`):!1}function s(e,t){return(t.amountUsd?.value??0)-(e.amountUsd?.value??0)}export{i as balanceToBalancesPayload,r as buildRoutableAllowlist};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { SettlementPayloadContext } from "./settlementToPayload.js";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { I18n } from "@lingui/core";
|
|
2
|
+
import { GatewaySettlementDto, GatewayUdaDto } from "@stridge/sdk";
|
|
3
|
+
|
|
4
|
+
//#region src/flows/deposit/driver/transformers/settlementToPayload.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Inputs the {@link settlementToPayload} transformer needs from the driver. The driver carries
|
|
7
|
+
* connected-wallet metadata and explorer info; the transformer composes the per-leg URLs and
|
|
8
|
+
* shortened address forms that the widget renders.
|
|
9
|
+
*/
|
|
10
|
+
interface SettlementPayloadContext {
|
|
11
|
+
/** Lingui i18n instance — drives every formatter call. */
|
|
12
|
+
i18n: I18n;
|
|
13
|
+
/** Connected wallet's source-side metadata — name + address (full hex). */
|
|
14
|
+
sourceWallet: {
|
|
15
|
+
name?: string;
|
|
16
|
+
address: string;
|
|
17
|
+
explorerUrl?: string;
|
|
18
|
+
};
|
|
19
|
+
/** Per-EIP-155 block-explorer base URLs (e.g. `{ 1: "https://etherscan.io" }`). */
|
|
20
|
+
explorers?: Record<number, string>;
|
|
21
|
+
/** Optional brand label rendered in place of the destination address (`gateway/start.metadata.brand_name`). */
|
|
22
|
+
brandName?: string;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { SettlementPayloadContext };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{classifyFailureKind as e,classifySettlementStatus as t}from"../../../shared/transformers/classifySettlementStatus.js";import{parseDecimalSafe as n,parseSmallestUnit as r}from"../../../shared/transformers/parseSmallestUnit.js";import{parseIsoMs as i}from"../../../shared/transformers/parseIsoMs.js";import"../../../shared/transformers/pickRelevantSettlement.js";import{formatDurationCompact as a}from"../../../../shared/format/formatDurationCompact.js";import{formatTimestamp as o}from"../../../../shared/format/formatTimestamp.js";import{formatTokenAmount as s}from"../../../../shared/format/formatTokenAmount.js";import{shortenAddress as c}from"../../../../shared/format/shortenAddress.js";function l(e,n,r){let i=t(e.status);return i===`completed`?d(e,n,r):i===`failed`?f(e,n,r):u(e,n,r)}function u(e,t,n){let r=e.from,a=i(r?.confirmed_at)??i(e.created_at),l=i(r?.confirmed_at)??i(e.created_at)??Date.now(),u=m(e.to,t.destination.asset_decimals);return{kind:`pending`,sourceWallet:p(n),creditedAsset:{symbol:t.destination.asset_symbol,decimals:t.destination.asset_decimals,address:t.destination.asset_address??``,isNative:!t.destination.asset_address},creditedTo:n.brandName??t.destination.address,...r?.tx_id?{txHash:{value:r.tx_id,formatted:c(r.tx_id)},...h(r,n,r.tx_id)?{txExplorerUrl:h(r,n,r.tx_id)}:{}}:{},...a===void 0?{}:{detectedAt:{value:a,formatted:o(a,n.i18n)}},submittedAt:{value:l,formatted:o(l,n.i18n)},receiveAmount:{value:u,formatted:s(u,n.i18n,{maxDecimals:t.destination.asset_decimals})}}}function d(e,t,n){let r=e.from,l=e.to,u=i(r?.confirmed_at)??i(e.created_at)??Date.now(),d=i(l?.settled_at)??i(e.updated_at)??Date.now(),f=Math.max(0,d-u),_=m(l,t.destination.asset_decimals),v=t.destination.address;return{kind:`succeeded`,sourceWallet:p(n),destination:{...n.brandName?{name:n.brandName}:{},address:{value:v,formatted:c(v)}},creditedAsset:{symbol:t.destination.asset_symbol,decimals:t.destination.asset_decimals,address:t.destination.asset_address??``,isNative:!t.destination.asset_address},receiveAmount:{value:_,formatted:s(_,n.i18n,{maxDecimals:t.destination.asset_decimals})},routeHops:g(e),totalTime:{value:f,formatted:a(f,n.i18n)},...r?.tx_id?{depositTx:{hash:{value:r.tx_id,formatted:c(r.tx_id)},...h(r,n,r.tx_id)?{explorerUrl:h(r,n,r.tx_id)}:{}}}:{depositTx:{hash:{value:``,formatted:``}}},...l?.tx_id?{completionTx:{hash:{value:l.tx_id,formatted:c(l.tx_id)},...h(l,n,l.tx_id)?{explorerUrl:h(l,n,l.tx_id)}:{}}}:{},submittedAt:{value:u,formatted:o(u,n.i18n)},filledAt:{value:d,formatted:o(d,n.i18n)}}}function f(t,n,r){let a=t.from,l=i(a?.confirmed_at)??i(t.created_at)??Date.now(),u=i(t.updated_at)??Date.now(),d=a?.tx_id??``,f=n.destination.address;return{kind:`failed`,failureKind:e(t.error),sourceWallet:p(r),destination:{...r.brandName?{name:r.brandName}:{},address:{value:f,formatted:c(f)}},creditedAsset:{symbol:n.destination.asset_symbol,decimals:n.destination.asset_decimals,address:n.destination.asset_address??``,isNative:!n.destination.asset_address},receiveAmount:{value:0,formatted:s(0,r.i18n)},txHash:{value:d,formatted:d?c(d):``},...h(a,r,d)?{txExplorerUrl:h(a,r,d)}:{},submittedAt:{value:l,formatted:o(l,r.i18n)},failedAt:{value:u,formatted:o(u,r.i18n)}}}function p(e){return{...e.sourceWallet.name?{name:e.sourceWallet.name}:{},address:{value:e.sourceWallet.address,formatted:c(e.sourceWallet.address)},...e.sourceWallet.explorerUrl?{explorerUrl:e.sourceWallet.explorerUrl}:{}}}function m(e,t){if(!e)return 0;if(e.amount){let t=n(e.amount);if(t>0)return t}return e.raw_amount?r(e.raw_amount,t):0}function h(e,t,n){if(!e||!n)return;let r=e.eip155_id===void 0?void 0:Number(e.eip155_id);if(r===void 0||!t.explorers)return;let i=t.explorers[r];if(i)return`${i.replace(/\/+$/,``)}/tx/${n}`}function g(e){let t=e.from,n=e.to,r=e.route?.provider??``,i=[];return t?.eip155_id!==void 0&&i.push({provider:r,chainId:Number(t.eip155_id)}),n?.eip155_id!==void 0&&n.eip155_id!==t?.eip155_id&&i.push({provider:r,chainId:Number(n.eip155_id)}),i}export{l as settlementToPayload};
|
|
1
|
+
import{classifyFailureKind as e,classifySettlementStatus as t}from"../../../shared/transformers/classifySettlementStatus.js";import{parseDecimalSafe as n,parseSmallestUnit as r}from"../../../shared/transformers/parseSmallestUnit.js";import{parseIsoMs as i}from"../../../shared/transformers/parseIsoMs.js";import"../../../shared/transformers/pickRelevantSettlement.js";import{formatDurationCompact as a}from"../../../../shared/format/formatDurationCompact.js";import{formatTimestamp as o}from"../../../../shared/format/formatTimestamp.js";import{formatTokenAmount as s}from"../../../../shared/format/formatTokenAmount.js";import{shortenAddress as c}from"../../../../shared/format/shortenAddress.js";function l(e,n,r){let i=t(e.status);return i===`completed`?d(e,n,r):i===`failed`?f(e,n,r):u(e,n,r)}function u(e,t,n){let r=e.from,a=i(r?.confirmed_at)??i(e.created_at),l=i(r?.confirmed_at)??i(e.created_at)??Date.now(),u=m(e.to,t.destination.asset_decimals);return{kind:`pending`,sourceWallet:p(n),creditedAsset:{symbol:t.destination.asset_symbol,decimals:t.destination.asset_decimals,address:t.destination.asset_address??``,isNative:!t.destination.asset_address},creditedTo:n.brandName??c(t.destination.address),...r?.tx_id?{txHash:{value:r.tx_id,formatted:c(r.tx_id)},...h(r,n,r.tx_id)?{txExplorerUrl:h(r,n,r.tx_id)}:{}}:{},...a===void 0?{}:{detectedAt:{value:a,formatted:o(a,n.i18n)}},submittedAt:{value:l,formatted:o(l,n.i18n)},receiveAmount:{value:u,formatted:s(u,n.i18n,{maxDecimals:t.destination.asset_decimals})}}}function d(e,t,n){let r=e.from,l=e.to,u=i(r?.confirmed_at)??i(e.created_at)??Date.now(),d=i(l?.settled_at)??i(e.updated_at)??Date.now(),f=Math.max(0,d-u),_=m(l,t.destination.asset_decimals),v=t.destination.address;return{kind:`succeeded`,sourceWallet:p(n),destination:{...n.brandName?{name:n.brandName}:{},address:{value:v,formatted:c(v)}},creditedAsset:{symbol:t.destination.asset_symbol,decimals:t.destination.asset_decimals,address:t.destination.asset_address??``,isNative:!t.destination.asset_address},receiveAmount:{value:_,formatted:s(_,n.i18n,{maxDecimals:t.destination.asset_decimals})},routeHops:g(e),totalTime:{value:f,formatted:a(f,n.i18n)},...r?.tx_id?{depositTx:{hash:{value:r.tx_id,formatted:c(r.tx_id)},...h(r,n,r.tx_id)?{explorerUrl:h(r,n,r.tx_id)}:{}}}:{depositTx:{hash:{value:``,formatted:``}}},...l?.tx_id?{completionTx:{hash:{value:l.tx_id,formatted:c(l.tx_id)},...h(l,n,l.tx_id)?{explorerUrl:h(l,n,l.tx_id)}:{}}}:{},submittedAt:{value:u,formatted:o(u,n.i18n)},filledAt:{value:d,formatted:o(d,n.i18n)}}}function f(t,n,r){let a=t.from,l=i(a?.confirmed_at)??i(t.created_at)??Date.now(),u=i(t.updated_at)??Date.now(),d=a?.tx_id??``,f=n.destination.address;return{kind:`failed`,failureKind:e(t.error),sourceWallet:p(r),destination:{...r.brandName?{name:r.brandName}:{},address:{value:f,formatted:c(f)}},creditedAsset:{symbol:n.destination.asset_symbol,decimals:n.destination.asset_decimals,address:n.destination.asset_address??``,isNative:!n.destination.asset_address},receiveAmount:{value:0,formatted:s(0,r.i18n)},txHash:{value:d,formatted:d?c(d):``},...h(a,r,d)?{txExplorerUrl:h(a,r,d)}:{},submittedAt:{value:l,formatted:o(l,r.i18n)},failedAt:{value:u,formatted:o(u,r.i18n)}}}function p(e){return{...e.sourceWallet.name?{name:e.sourceWallet.name}:{},address:{value:e.sourceWallet.address,formatted:c(e.sourceWallet.address)},...e.sourceWallet.explorerUrl?{explorerUrl:e.sourceWallet.explorerUrl}:{}}}function m(e,t){if(!e)return 0;if(e.amount){let t=n(e.amount);if(t>0)return t}return e.raw_amount?r(e.raw_amount,t):0}function h(e,t,n){if(!e||!n)return;let r=e.eip155_id===void 0?void 0:Number(e.eip155_id);if(r===void 0||!t.explorers)return;let i=t.explorers[r];if(i)return`${i.replace(/\/+$/,``)}/tx/${n}`}function g(e){let t=e.from,n=e.to,r=e.route?.provider??``,i=[];return t?.eip155_id!==void 0&&i.push({provider:r,chainId:Number(t.eip155_id)}),n?.eip155_id!==void 0&&n.eip155_id!==t?.eip155_id&&i.push({provider:r,chainId:Number(n.eip155_id)}),i}export{l as settlementToPayload};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{KNOWN_TESTNET_EIP155_IDS as e}from"../../../shared/transformers/testnets.js";import{formatNetworkName as t}from"../../../../shared/format/formatNetworkName.js";import{formatUsd as n}from"../../../../shared/format/formatUsd.js";import{shortenAddress as r}from"../../../../shared/format/shortenAddress.js";function i(i,o={}){let s=o.includeTestnets??!1;return i.flatMap(i=>{let c=String(i.eip155_id??``),l=Number(c);if(!s&&Number.isFinite(l)&&e.has(l))return[];let u=o.explorers?.[l],d=o.i18n&&c?o.minAmountUsdByEip155Id?.[c]:void 0,f=a(i.accepted_assets,c?o.nativeAssetByEip155Id?.[c]:void 0,c?o.priceImpactByEip155Id?.[c]:void 0);return[{networkName:t(i.network_name??``),...c?{eip155Id:c}:{},...o.chainLogos?.[c]?{chainLogoUrl:o.chainLogos[c]}:{},address:{value:i.address,formatted:r(i.address)},...u?{explorerUrl:`${u.replace(/\/+$/,``)}/address/${i.address}`}:{},...d!==void 0&&o.i18n?{minAmountUsd:{value:d,formatted:n(d,o.i18n)}}:{},...f.length>0?{acceptedAssets:f}:{}}]})}function a(e,t,n){let r=Array.isArray(e)?e.map(e=>o(e,n)):[];if(!t)return r;let i=r.findIndex(e=>e.symbol.toUpperCase()===t.symbol.toUpperCase());if(i>=0){let e=r[i];return e&&!e.priceImpact&&t.priceImpact&&(r[i]={...e,priceImpact:t.priceImpact}),r}return[t,...r]}function o(e,t){let n=e.logo,r=!e.address,i=e.address?t?.[e.address.toLowerCase()]:void 0;return{symbol:e.symbol,address:e.address,decimals:e.decimals,...typeof n==`string`&&n.length>0?{assetLogoUrl:n}:{},isNative:r,...i?{priceImpact:i}:{}}}export{i as startToAddressesPayload};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { GatewayStartResponse } from "@stridge/sdk";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{formatNetworkName as e}from"../../../../shared/format/formatNetworkName.js";import{formatUsd as t}from"../../../../shared/format/formatUsd.js";function n(n,r){let i=n.assets.find(e=>String(e.network_id)===r.networkId);if(!i)return;let a=i.assets.find(e=>e.symbol.toUpperCase()===r.assetSymbol.toUpperCase());if(!a)return;let o=i.native_currency?.logo;return{networkId:r.networkId,networkName:e(i.network_name),eip155Id:String(i.eip155_id),...o?{chainLogoUrl:o}:{},symbol:a.symbol,decimals:a.decimals,address:a.address??``,isNative:!a.address,...a.logo?{assetLogoUrl:a.logo}:{},...r.
|
|
1
|
+
import{formatNetworkName as e}from"../../../../shared/format/formatNetworkName.js";import{formatUsd as t}from"../../../../shared/format/formatUsd.js";function n(n,r){let i=n.assets.find(e=>String(e.network_id)===r.networkId);if(!i)return;let a=i.assets.find(e=>e.symbol.toUpperCase()===r.assetSymbol.toUpperCase());if(!a)return;let o=i.native_currency?.logo;return{networkId:r.networkId,networkName:e(i.network_name),eip155Id:String(i.eip155_id),...o?{chainLogoUrl:o}:{},symbol:a.symbol,decimals:a.decimals,address:a.address??``,isNative:!a.address,...a.logo?{assetLogoUrl:a.logo}:{},...r.minAmountUsd===void 0?{}:{minAmountUsd:{value:r.minAmountUsd,formatted:t(r.minAmountUsd,r.i18n)}},...r.maxAmountUsd===void 0?{}:{maxAmountUsd:{value:r.maxAmountUsd,formatted:t(r.maxAmountUsd,r.i18n)}}}}export{n as startToTargetPayload};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Entity, SettlementFailureKind, TxRef } from "../../../shared/driver/types.js";
|
|
2
|
-
import { AcceptedAssetPayload, AddressItemPayload, AssetPayload, BalanceItemPayload, BrandPayload, ChainPayload, QuoteBreakdownPayload, QuotePayload, QuoteRoutePayload, SettlementFailurePayload, SettlementPayload, SettlementPendingPayload, SettlementSuccessPayload, SourceWalletPayload, TargetPayload, WalletInfo, WalletPayload } from "./payloads.js";
|
|
3
|
-
import { DepositAddressDto,
|
|
2
|
+
import { AcceptedAssetPayload, AddressItemPayload, AssetPayload, BalanceItemPayload, BrandPayload, ChainPayload, OnrampMethodCapability, OnrampMethodsPayload, OnrampQuotePayload, OnrampReceiveAssetPayload, OnrampSessionPayload, OnrampSessionStateName, QuoteBreakdownPayload, QuotePayload, QuoteRoutePayload, SettlementFailurePayload, SettlementPayload, SettlementPendingPayload, SettlementSuccessPayload, SourceWalletPayload, TargetPayload, WalletInfo, WalletPayload } from "./payloads.js";
|
|
3
|
+
import { DepositAddressDto, GatewaySettlementDto, GatewayStartResponse, GatewayUdaDto, OnchainBalanceResponse, OnrampQuoteResponse, OnrampSessionResponse, QuoteResponse, SupportedAssetDto, SupportedAssetsResponse } from "@stridge/sdk";
|
|
4
4
|
|
|
5
5
|
//#region src/flows/deposit/driver/types.d.ts
|
|
6
6
|
/**
|
|
@@ -39,7 +39,7 @@ interface DepositSnapshot {
|
|
|
39
39
|
* the payload (`pending` / `succeeded` / `failed`) drives whether `<ProcessingState>`,
|
|
40
40
|
* `<SuccessState>`, or `<ErrorState>` is shown.
|
|
41
41
|
*/
|
|
42
|
-
settlement: Entity<SettlementPayload, GatewaySettlementDto,
|
|
42
|
+
settlement: Entity<SettlementPayload, GatewaySettlementDto, GatewayUdaDto>;
|
|
43
43
|
/**
|
|
44
44
|
* Connected-wallet identity. `idle` when no wallet is connected; `ready` once the host has
|
|
45
45
|
* supplied an address. The `payload.address.formatted` field is the canonical
|
|
@@ -47,6 +47,27 @@ interface DepositSnapshot {
|
|
|
47
47
|
* settlement (deposit-method tile, amount-entry source pill, banner disconnected-state copy).
|
|
48
48
|
*/
|
|
49
49
|
wallet: Entity<WalletPayload, WalletInfo, WalletInfo>;
|
|
50
|
+
/**
|
|
51
|
+
* Onramp-rail capability bag — the limit + processing time surfaced on the "Cash"
|
|
52
|
+
* method row's meta line and read by the onramp amount-entry for its over-limit / unavailable
|
|
53
|
+
* notices. Optional so BYO drivers shipped before the onramp rail existed keep type-checking
|
|
54
|
+
* against the contract; readers null-coalesce a missing entity to `idle`, which means "no
|
|
55
|
+
* onramp backend wired up yet". The live stridge driver leaves this `idle` until the rail is
|
|
56
|
+
* exercised; the mock driver seeds a fixture today.
|
|
57
|
+
*/
|
|
58
|
+
onrampMethods?: Entity<OnrampMethodsPayload, OnrampMethodsPayload, OnrampMethodsPayload>;
|
|
59
|
+
/**
|
|
60
|
+
* Formatted fiat→crypto onramp quote backing the onramp amount-entry hero / receive chip / fee
|
|
61
|
+
* rows. Optional (same back-compat rationale as {@link onrampMethods}); `idle` until
|
|
62
|
+
* {@link DepositDriver.requestOnrampQuote} runs. Backed by the SDK's `OnrampQuoteResponse`.
|
|
63
|
+
*/
|
|
64
|
+
onrampQuote?: Entity<OnrampQuotePayload, OnrampQuoteResponse, OnrampQuoteResponse>;
|
|
65
|
+
/**
|
|
66
|
+
* The active onramp checkout session — carries the provider-hosted `checkoutUrl` and the
|
|
67
|
+
* session state the kit polls to a terminal verdict. Optional; `idle` until
|
|
68
|
+
* {@link DepositDriver.createOnrampSession} runs. Backed by the SDK's `OnrampSessionResponse`.
|
|
69
|
+
*/
|
|
70
|
+
onrampSession?: Entity<OnrampSessionPayload, OnrampSessionResponse, OnrampSessionResponse>;
|
|
50
71
|
}
|
|
51
72
|
/**
|
|
52
73
|
* Input to {@link DepositDriver.requestQuote}.
|
|
@@ -80,6 +101,29 @@ interface SubmitDepositInput {
|
|
|
80
101
|
/** Send amount in display units. */
|
|
81
102
|
amount: number;
|
|
82
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* Input to {@link DepositDriver.requestOnrampQuote}. The fiat side is all the backend needs — the
|
|
106
|
+
* receive crypto is derived from the tenant's deposit preferences. The onramp rail is single-method
|
|
107
|
+
* (the provider's hosted checkout collects the payment instrument), so there is no method selector.
|
|
108
|
+
*/
|
|
109
|
+
interface RequestOnrampQuoteInput {
|
|
110
|
+
/** Fiat amount the user wants to spend (display units, e.g. dollars). */
|
|
111
|
+
amount: number;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Input to {@link DepositDriver.createOnrampSession}. Binds the priced amount to a provider checkout.
|
|
115
|
+
*/
|
|
116
|
+
interface CreateOnrampSessionInput {
|
|
117
|
+
/** Fiat amount to charge (display units). */
|
|
118
|
+
amount: number;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Input to {@link DepositDriver.watchOnrampSession}. Scopes the poll to a single created session.
|
|
122
|
+
*/
|
|
123
|
+
interface WatchOnrampSessionInput {
|
|
124
|
+
/** The session id returned by {@link DepositDriver.createOnrampSession}. */
|
|
125
|
+
sessionId: string;
|
|
126
|
+
}
|
|
83
127
|
/**
|
|
84
128
|
* Input to {@link DepositDriver.watchSourceTx}. Path B — kit waits for an inbound transfer to the
|
|
85
129
|
* deposit address.
|
|
@@ -107,7 +151,7 @@ type FetchActiveSettlementInput = Record<string, never>;
|
|
|
107
151
|
interface SettlementSnapshot {
|
|
108
152
|
payload: SettlementPayload;
|
|
109
153
|
raw: GatewaySettlementDto;
|
|
110
|
-
response:
|
|
154
|
+
response: GatewayUdaDto;
|
|
111
155
|
}
|
|
112
156
|
/**
|
|
113
157
|
* Unified driver contract. A `DepositDriver` is the single host-supplied source of both reactive
|
|
@@ -139,6 +183,17 @@ interface DepositDriver {
|
|
|
139
183
|
getSnapshot(): DepositSnapshot;
|
|
140
184
|
/** Lets you subscribe to entity transitions outside React (analytics, headless integrations). */
|
|
141
185
|
subscribe(listener: () => void): () => void;
|
|
186
|
+
/**
|
|
187
|
+
* Idempotent bootstrap trigger. The kit calls this from `useDeposit().open()` and the
|
|
188
|
+
* headless `usePrefetchDeposit()` hook. First call kicks off any deferred network work
|
|
189
|
+
* (`gateway/start`, `supportedAssets`, the initial `balance/onchain` fetch); subsequent
|
|
190
|
+
* calls are no-ops while bootstrap is in flight or completed.
|
|
191
|
+
*
|
|
192
|
+
* BYO drivers that bootstrap eagerly can implement this as a no-op — the contract is "after
|
|
193
|
+
* `arm()` returns, the driver's entities are either already populated or will populate as
|
|
194
|
+
* soon as the first network round-trips land".
|
|
195
|
+
*/
|
|
196
|
+
arm(): void;
|
|
142
197
|
/**
|
|
143
198
|
* Fetches a fresh quote for `input` and updates the `quote` entity through its lifecycle
|
|
144
199
|
* (`idle | loading → ready | error`). The optional `signal` cancels in-flight work.
|
|
@@ -154,6 +209,19 @@ interface DepositDriver {
|
|
|
154
209
|
* — when omitted, the asset-picker hides its USD-balance overlay.
|
|
155
210
|
*/
|
|
156
211
|
watchBalances?(input: Record<string, never>, listener: (entity: DepositSnapshot["balances"]) => void, signal: AbortSignal): void;
|
|
212
|
+
/**
|
|
213
|
+
* Invalidate any cached `balances` and force the driver to fetch fresh on its next tick. The
|
|
214
|
+
* orchestrator calls this after `submitDeposit` resolves and on every `settlement` kind
|
|
215
|
+
* transition (`pending` / `succeeded` / `failed`) so the user never advances on stale
|
|
216
|
+
* source-chain balance numbers — the `balance/onchain` SWR window otherwise hides the
|
|
217
|
+
* just-sent funds until it elapses.
|
|
218
|
+
*
|
|
219
|
+
* Drivers that do not cache balances (no SWR layer, no in-memory snapshot) can omit this; the
|
|
220
|
+
* kit calls it via optional chaining. When implemented, drivers should both invalidate the
|
|
221
|
+
* cache stamp and kick off an immediate refetch so `useDepositSnapshot().balances` reflects
|
|
222
|
+
* post-deposit reality without waiting for the next scheduled watcher tick.
|
|
223
|
+
*/
|
|
224
|
+
invalidateBalances?(): void;
|
|
157
225
|
/**
|
|
158
226
|
* Path B watcher — observes the deposit address until an inbound source-chain tx is detected,
|
|
159
227
|
* then fires the listener with the {@link TxRef}. Optional — when omitted, the orchestrator
|
|
@@ -172,6 +240,25 @@ interface DepositDriver {
|
|
|
172
240
|
* method picker.
|
|
173
241
|
*/
|
|
174
242
|
fetchActiveSettlement?(input: FetchActiveSettlementInput, signal: AbortSignal): Promise<SettlementSnapshot | null>;
|
|
243
|
+
/**
|
|
244
|
+
* Onramp rail — fetches a fiat→crypto quote and updates the `onrampQuote` entity through its
|
|
245
|
+
* lifecycle (`idle | loading → ready | error`). Optional: drivers without an onramp backend
|
|
246
|
+
* omit it, and the onramp amount-entry falls back to its empty-quote surface. Mirrors
|
|
247
|
+
* {@link requestQuote} for the fiat side.
|
|
248
|
+
*/
|
|
249
|
+
requestOnrampQuote?(input: RequestOnrampQuoteInput, signal: AbortSignal): Promise<void>;
|
|
250
|
+
/**
|
|
251
|
+
* Onramp rail — binds the priced amount to a provider checkout session, populates the
|
|
252
|
+
* `onrampSession` entity, and resolves with the created session (carrying `checkoutUrl`). The kit
|
|
253
|
+
* opens `checkoutUrl` in a new tab, then calls {@link watchOnrampSession} to poll. Optional.
|
|
254
|
+
*/
|
|
255
|
+
createOnrampSession?(input: CreateOnrampSessionInput, signal: AbortSignal): Promise<OnrampSessionPayload>;
|
|
256
|
+
/**
|
|
257
|
+
* Onramp rail — polls a created session until it reaches a terminal state, firing the listener on
|
|
258
|
+
* every transition (the kit maps `SESSION_COMPLETED` / `SESSION_EXPIRED` / `SESSION_FAILED` onto
|
|
259
|
+
* its shared success / error screens). Mirrors {@link watchSettlement}. Optional.
|
|
260
|
+
*/
|
|
261
|
+
watchOnrampSession?(input: WatchOnrampSessionInput, listener: (entity: DepositSnapshot["onrampSession"]) => void, signal: AbortSignal): void;
|
|
175
262
|
}
|
|
176
263
|
//#endregion
|
|
177
|
-
export { DepositDriver, DepositSnapshot, FetchActiveSettlementInput, RequestQuoteInput, SettlementSnapshot, SubmitDepositInput, WatchSettlementInput, WatchSourceTxInput };
|
|
264
|
+
export { CreateOnrampSessionInput, DepositDriver, DepositSnapshot, FetchActiveSettlementInput, RequestOnrampQuoteInput, RequestQuoteInput, SettlementSnapshot, SubmitDepositInput, WatchOnrampSessionInput, WatchSettlementInput, WatchSourceTxInput };
|