@stridge/kit 0.1.0-alpha.6 → 0.1.0-alpha.60
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 +61 -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 +2 -2
- 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 +2 -1
- 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 +22 -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 +16 -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/createStridgeMockActivityDriver.d.ts +44 -0
- package/dist/drivers/stridge-mock/createStridgeMockActivityDriver.js +1 -0
- package/dist/drivers/stridge-mock/createStridgeMockDriver.d.ts +2 -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 +14 -12
- package/dist/drivers/stridge-mock/fixtures.js +1 -1
- 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/bindings/DepositBindings.d.ts +87 -0
- package/dist/flows/deposit/bindings/DepositBindings.js +1 -0
- package/dist/flows/deposit/bindings/index.d.ts +1 -0
- package/dist/flows/deposit/bindings/index.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 +52 -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 +37 -4
- 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 +228 -7
- package/dist/flows/deposit/orchestrator/useDeposit.d.ts +45 -1
- package/dist/flows/deposit/orchestrator/useDeposit.js +1 -1
- package/dist/flows/deposit/shared/cash.d.ts +20 -0
- package/dist/flows/deposit/shared/cash.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/cash-amount-entry/CashAmountEntry.d.ts +71 -0
- package/dist/flows/deposit/widgets/cash-amount-entry/CashAmountEntry.js +1 -0
- package/dist/flows/deposit/widgets/cash-amount-entry/compound/CashAmountEntry.d.ts +69 -0
- package/dist/flows/deposit/widgets/cash-amount-entry/compound/CashAmountEntry.js +1 -0
- package/dist/flows/deposit/widgets/cash-amount-entry/compound/CashAmountEntry.slots.d.ts +16 -0
- package/dist/flows/deposit/widgets/cash-amount-entry/compound/CashAmountEntry.slots.js +1 -0
- package/dist/flows/deposit/widgets/cash-amount-entry/compound/CashAmountEntry.styles.js +1 -0
- package/dist/flows/deposit/widgets/cash-amount-entry/compound/components/HeroLabel.d.ts +13 -0
- package/dist/flows/deposit/widgets/cash-amount-entry/compound/components/HeroLabel.js +1 -0
- package/dist/flows/deposit/widgets/cash-amount-entry/compound/components/MethodChip.d.ts +18 -0
- package/dist/flows/deposit/widgets/cash-amount-entry/compound/components/MethodChip.js +1 -0
- package/dist/flows/deposit/widgets/cash-amount-entry/compound/components/ReceiveChip.d.ts +14 -0
- package/dist/flows/deposit/widgets/cash-amount-entry/compound/components/ReceiveChip.js +1 -0
- package/dist/flows/deposit/widgets/cash-amount-entry/compound/context.js +1 -0
- package/dist/flows/deposit/widgets/cash-amount-entry/compound/index.d.ts +3 -0
- package/dist/flows/deposit/widgets/cash-amount-entry/compound/index.js +1 -0
- package/dist/flows/deposit/widgets/cash-amount-entry/compound/types.d.ts +42 -0
- package/dist/flows/deposit/widgets/cash-amount-entry/index.d.ts +1 -0
- package/dist/flows/deposit/widgets/cash-amount-entry/index.js +1 -0
- package/dist/flows/deposit/widgets/cash-confirm/CashConfirm.d.ts +63 -0
- package/dist/flows/deposit/widgets/cash-confirm/CashConfirm.js +1 -0
- package/dist/flows/deposit/widgets/cash-confirm/compound/CashConfirm.d.ts +54 -0
- package/dist/flows/deposit/widgets/cash-confirm/compound/CashConfirm.js +1 -0
- package/dist/flows/deposit/widgets/cash-confirm/compound/CashConfirm.slots.d.ts +33 -0
- package/dist/flows/deposit/widgets/cash-confirm/compound/CashConfirm.slots.js +1 -0
- package/dist/flows/deposit/widgets/cash-confirm/compound/CashConfirm.styles.js +1 -0
- package/dist/flows/deposit/widgets/cash-confirm/compound/cashConfirmDimensions.js +1 -0
- package/dist/flows/deposit/widgets/cash-confirm/compound/components/ApplePayBody.d.ts +15 -0
- package/dist/flows/deposit/widgets/cash-confirm/compound/components/ApplePayBody.js +1 -0
- package/dist/flows/deposit/widgets/cash-confirm/compound/components/Body.d.ts +22 -0
- package/dist/flows/deposit/widgets/cash-confirm/compound/components/Body.js +1 -0
- package/dist/flows/deposit/widgets/cash-confirm/compound/components/BodyLabel.js +1 -0
- package/dist/flows/deposit/widgets/cash-confirm/compound/components/CardBody.d.ts +16 -0
- package/dist/flows/deposit/widgets/cash-confirm/compound/components/CardBody.js +1 -0
- package/dist/flows/deposit/widgets/cash-confirm/compound/components/CardInputRow.icons.js +1 -0
- package/dist/flows/deposit/widgets/cash-confirm/compound/components/CardInputRow.js +1 -0
- package/dist/flows/deposit/widgets/cash-confirm/compound/components/CardInputRow.keys.js +1 -0
- package/dist/flows/deposit/widgets/cash-confirm/compound/components/CardInputRow.state.js +1 -0
- package/dist/flows/deposit/widgets/cash-confirm/compound/components/CardInputRow.styles.js +1 -0
- package/dist/flows/deposit/widgets/cash-confirm/compound/components/GooglePayBody.d.ts +16 -0
- package/dist/flows/deposit/widgets/cash-confirm/compound/components/GooglePayBody.js +1 -0
- package/dist/flows/deposit/widgets/cash-confirm/compound/components/Header.d.ts +21 -0
- package/dist/flows/deposit/widgets/cash-confirm/compound/components/Header.js +1 -0
- package/dist/flows/deposit/widgets/cash-confirm/compound/components/Summary.d.ts +17 -0
- package/dist/flows/deposit/widgets/cash-confirm/compound/components/Summary.js +1 -0
- package/dist/flows/deposit/widgets/cash-confirm/compound/components/cardFormat.js +1 -0
- package/dist/flows/deposit/widgets/cash-confirm/compound/context.js +1 -0
- package/dist/flows/deposit/widgets/cash-confirm/compound/index.d.ts +3 -0
- package/dist/flows/deposit/widgets/cash-confirm/compound/index.js +1 -0
- package/dist/flows/deposit/widgets/cash-confirm/compound/types.d.ts +66 -0
- package/dist/flows/deposit/widgets/cash-confirm/index.d.ts +1 -0
- package/dist/flows/deposit/widgets/cash-confirm/index.js +1 -0
- package/dist/flows/deposit/widgets/cash-confirm/mocks.js +1 -0
- 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 +16 -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/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 +12 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +36 -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/AmexIcon.d.ts +14 -0
- package/dist/shared/icons/AmexIcon.js +1 -0
- package/dist/shared/icons/ApplePayIcon.d.ts +15 -0
- package/dist/shared/icons/ApplePayIcon.js +1 -0
- package/dist/shared/icons/BitcoinIcon.d.ts +17 -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/CashIcon.d.ts +16 -0
- package/dist/shared/icons/CashIcon.js +1 -0
- package/dist/shared/icons/DiscoverIcon.d.ts +14 -0
- package/dist/shared/icons/DiscoverIcon.js +1 -0
- package/dist/shared/icons/GooglePayIcon.d.ts +15 -0
- package/dist/shared/icons/GooglePayIcon.js +1 -0
- package/dist/shared/icons/LogoIcon.d.ts +13 -0
- package/dist/shared/icons/LogoIcon.js +1 -0
- package/dist/shared/icons/MastercardIcon.d.ts +16 -0
- package/dist/shared/icons/MastercardIcon.js +1 -0
- package/dist/shared/icons/VisaIcon.d.ts +15 -0
- package/dist/shared/icons/VisaIcon.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/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 +63 -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 +187 -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 +607 -12
- package/dist/types.d.ts +7 -5
- 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
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ErrorInfo, ReactNode } from "react";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/flows/activity/compound/components/Boundary.d.ts
|
|
5
|
+
interface Props {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Replaces the kit's default crash fallback. Compose `GatewayKitErrorCard` parts to keep
|
|
9
|
+
* kit styling, or render your own JSX for a fully custom recovery surface.
|
|
10
|
+
*/
|
|
11
|
+
fallback?: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Fires once per caught render error. Pipe to your analytics or error-reporting pipeline
|
|
14
|
+
* (Sentry, Datadog, etc.) — the boundary itself only logs to `console.error` in development.
|
|
15
|
+
*/
|
|
16
|
+
onError?: (error: Error, errorInfo: ErrorInfo) => void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Error-boundary part for the standalone activity flow. Wraps children with the kit's
|
|
20
|
+
* `GatewayKitBoundary` and pipes the recovery action through `useActivity().close()` so a crash
|
|
21
|
+
* returns the user to a clean state. Mirrors `<Deposit.Boundary>` / `<Withdraw.Boundary>`.
|
|
22
|
+
*/
|
|
23
|
+
declare function ActivityBoundary({
|
|
24
|
+
children,
|
|
25
|
+
fallback,
|
|
26
|
+
onError
|
|
27
|
+
}: Props): _$react_jsx_runtime0.JSX.Element;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { ActivityBoundary, Props };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useActivityActions as e}from"../../orchestrator/controller.js";import"../../orchestrator/index.js";import{GatewayKitBoundary as t}from"../../../../shared/error-handling/components/GatewayKitBoundary.js";import"../../../../shared/error-handling/index.js";import{jsx as n}from"react/jsx-runtime";function r({children:r,fallback:i,onError:a}){let{close:o}=e();return n(t,{...a?{onError:a}:{},...i===void 0?{}:{fallback:i},onReset:o,children:r})}export{r as ActivityBoundary};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/flows/activity/compound/components/Steps.d.ts
|
|
5
|
+
interface ActivityStepsProps {
|
|
6
|
+
/**
|
|
7
|
+
* When true, the matched step renders without the kit's animated `StepTransition` wrapper.
|
|
8
|
+
* Forwarded to the underlying `Steps` primitive.
|
|
9
|
+
*/
|
|
10
|
+
plain?: boolean;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Activity-bound slot-routing parent. Reads the standalone activity FSM's *effective* state
|
|
15
|
+
* name and renders only the `<ActivityFlow.Step name="…" />` child whose name matches. Reading
|
|
16
|
+
* effective (rather than logical) state keeps the matched step mounted while the enclosing
|
|
17
|
+
* dialog plays its exit animation — see `StepTransition.tsx` for the rationale.
|
|
18
|
+
*/
|
|
19
|
+
declare function ActivitySteps({
|
|
20
|
+
plain,
|
|
21
|
+
children
|
|
22
|
+
}: ActivityStepsProps): _$react_jsx_runtime0.JSX.Element;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { ActivitySteps, type ActivityStepsProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useActivityEffectiveState as e}from"../../orchestrator/controller.js";import"../../orchestrator/index.js";import{Steps as t}from"../../../../shared/ui/Steps/Steps.js";import"../../../../shared/ui/Steps/index.js";import{jsx as n}from"react/jsx-runtime";function r({plain:r,children:i}){return n(t,{activeStep:e().name,...r===void 0?{}:{plain:r},children:i})}export{r as ActivitySteps};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Presentation } from "../../../shared/presentation/types.js";
|
|
2
|
+
import { ErrorInfo } from "react";
|
|
3
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/flows/activity/dialog/ActivityDialog.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Standalone activity dialog. Mount inside `<KitProvider activity={…}>` (or `<StridgeProvider>`
|
|
8
|
+
* with any flow enabled) wherever the integrator wants the dialog to live in the React tree
|
|
9
|
+
* (typically once at the layout root). Open state is bound to the controller's
|
|
10
|
+
* `state.name !== "closed"`, so the dialog appears / disappears automatically as descendants
|
|
11
|
+
* call `useActivity().open()` / `.close()`.
|
|
12
|
+
*
|
|
13
|
+
* The dialog is a pure composition of the shared dialog primitive + the standalone activity
|
|
14
|
+
* widgets. Each `<Step>` body is the per-FSM-state orchestrated widget; `useStandaloneActivitySource()`
|
|
15
|
+
* fires once per matched step (via `<Steps>`, which only mounts the active child) and the
|
|
16
|
+
* shared `<ActivitySourceProvider>` scope is owned by the matched widget itself.
|
|
17
|
+
*/
|
|
18
|
+
declare function ActivityDialog({
|
|
19
|
+
container,
|
|
20
|
+
onError,
|
|
21
|
+
presentation,
|
|
22
|
+
metadata
|
|
23
|
+
}?: ActivityDialog.Props): _$react_jsx_runtime0.JSX.Element;
|
|
24
|
+
declare namespace ActivityDialog {
|
|
25
|
+
interface Props {
|
|
26
|
+
/**
|
|
27
|
+
* Element the dialog portals into. Defaults to `document.body` (full-page overlay).
|
|
28
|
+
* Pass a transformed ancestor with `overflow: clip` — e.g. a mobile mockup frame — to
|
|
29
|
+
* scope the dialog's width, height, and backdrop to that rect.
|
|
30
|
+
*/
|
|
31
|
+
container?: HTMLElement | null;
|
|
32
|
+
/**
|
|
33
|
+
* Fires once per caught render error inside the dialog. Pipe to your analytics or
|
|
34
|
+
* error-reporting pipeline. The dialog's internal `<ActivityFlow.Boundary>` recovers via
|
|
35
|
+
* `useActivity().close()`.
|
|
36
|
+
*/
|
|
37
|
+
onError?: (error: Error, errorInfo: ErrorInfo) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Consumer-attached metadata that rides along on every bus event emitted from this
|
|
40
|
+
* dialog's session. Snapshotted at `activity.opened` and frozen for the session — mid-flow
|
|
41
|
+
* prop changes are ignored to keep correlation consistent. The kit does not validate or
|
|
42
|
+
* normalise the shape. See `@stridge/kit/events`.
|
|
43
|
+
*/
|
|
44
|
+
metadata?: Record<string, unknown>;
|
|
45
|
+
/**
|
|
46
|
+
* Per-dialog surface override. `"auto"` (default) renders a centred dialog on wide
|
|
47
|
+
* containers and a bottom-sheet drawer below the breakpoint; `"dialog"` / `"drawer"`
|
|
48
|
+
* force one surface. Pass `{ mode, breakpoint }` to tune the px threshold (default 600).
|
|
49
|
+
* Wins over the provider's `appearance.presentation`; omit to inherit it.
|
|
50
|
+
*/
|
|
51
|
+
presentation?: Presentation;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
export { ActivityDialog };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useActivityControllerContext as e}from"../orchestrator/controller.js";import"../orchestrator/index.js";import{useActivityEmissions as t}from"../../../events/emit/useActivityEmissions.js";import"../../../events/emit/index.js";import{useIntercomShutdownOnUnmount as n}from"../../../shared/support/useIntercomShutdownOnUnmount.js";import"../../../shared/support/index.js";import{AdaptiveSurface as r}from"../../../shared/ui/AdaptiveSurface/AdaptiveSurface.js";import"../../../shared/ui/AdaptiveSurface/index.js";import{ActivityFlow as i}from"../compound/ActivityFlow.js";import"../../../activity/compound/index.js";import{ActivityDetail as a}from"../widgets/ActivityDetail.js";import{ActivityList as o}from"../widgets/ActivityList.js";import"../../../activity/widgets/index.js";import{jsx as s,jsxs as c}from"react/jsx-runtime";function l({container:l,onError:u,presentation:d,metadata:f}={}){let{state:p,controller:m}=e(),h=p.name!==`closed`;return t({state:p,metadata:f}),n(),s(r,{open:h,onOpenChange:e=>{e||m.close()},container:l,...d?{presentation:d}:{},children:s(i.Boundary,{...u?{onError:u}:{},children:c(i.Steps,{children:[s(i.Step,{name:`activityList`,children:s(o,{})}),s(i.Step,{name:`activityDetail`,children:s(a,{})})]})})})}export{l as ActivityDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { ActivityBoundary, Props } from "../compound/components/Boundary.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../compound/components/Boundary.js";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ActivityDriver, ActivitySnapshot } from "./types.js";
|
|
2
|
+
import * as _$react from "react";
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/flows/activity/driver/context.d.ts
|
|
7
|
+
declare const ActivityDriverContext: _$react.Context<ActivityDriver | null>;
|
|
8
|
+
interface ActivityDriverProviderProps {
|
|
9
|
+
driver: ActivityDriver;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Publishes a {@link ActivityDriver} into kit context. Mounted internally by `<KitProvider />`
|
|
14
|
+
* when `activity` is supplied; tests can mount it directly to drive the standalone activity flow
|
|
15
|
+
* or the per-flow adapter hooks against a mock driver.
|
|
16
|
+
*/
|
|
17
|
+
declare function ActivityDriverProvider({
|
|
18
|
+
driver,
|
|
19
|
+
children
|
|
20
|
+
}: ActivityDriverProviderProps): _$react_jsx_runtime0.JSX.Element;
|
|
21
|
+
/**
|
|
22
|
+
* Reads the active {@link ActivityDriver}. Throws when called outside `<ActivityDriverProvider>` /
|
|
23
|
+
* `<KitProvider activity={…}>` — mirrors the per-flow `useDepositDriverInstance` contract.
|
|
24
|
+
*/
|
|
25
|
+
declare function useActivityDriverInstance(): ActivityDriver;
|
|
26
|
+
/**
|
|
27
|
+
* Optional-read variant. Returns `null` when no driver is mounted — used by the per-flow header
|
|
28
|
+
* activity icons to hide gracefully when the host opted out of activity.
|
|
29
|
+
*/
|
|
30
|
+
declare function useOptionalActivityDriverInstance(): ActivityDriver | null;
|
|
31
|
+
/**
|
|
32
|
+
* Subscribes the calling component to driver transitions and returns the live
|
|
33
|
+
* {@link ActivitySnapshot}. Mirrors `useDepositSnapshot` — class-based BYO drivers keep their
|
|
34
|
+
* `this` binding because the call resolves through the driver instance.
|
|
35
|
+
*/
|
|
36
|
+
declare function useActivitySnapshot(): ActivitySnapshot;
|
|
37
|
+
//#endregion
|
|
38
|
+
export { ActivityDriverContext, ActivityDriverProvider, useActivityDriverInstance, useActivitySnapshot, useOptionalActivityDriverInstance };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{createContext as e,use as t,useCallback as n,useSyncExternalStore as r}from"react";import{jsx as i}from"react/jsx-runtime";const a=e(null);a.displayName=`ActivityDriverContext`;function o({driver:e,children:t}){return i(a,{value:e,children:t})}function s(){let e=t(a);if(!e)throw Error("useActivity / useActivityDriverInstance must be used inside a `<KitProvider activity={…}>` (or a `<StridgeProvider>` with a flow enabled).");return e}function c(){return t(a)}function l(){let e=s();return r(t=>e.subscribe(t),()=>e.getSnapshot(),()=>e.getSnapshot())}function u(){let e=c(),t=n(t=>e?.subscribe(t)??(()=>void 0),[e]),i=n(()=>e?.getSnapshot()??null,[e]);return r(t,i,i)}export{a as ActivityDriverContext,o as ActivityDriverProvider,s as useActivityDriverInstance,l as useActivitySnapshot,c as useOptionalActivityDriverInstance,u as useOptionalActivitySnapshot};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Entity } from "../../../shared/driver/types.js";
|
|
2
|
+
import { ActivityPayload } from "../../../shared/widgets/activity/payloads.js";
|
|
3
|
+
import { GatewayPollResponse, GatewayUdaDto } from "@stridge/sdk";
|
|
4
|
+
|
|
5
|
+
//#region src/flows/activity/driver/types.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Slim snapshot exposed by the standalone activity driver. Mirrors the `activity` slot per-flow
|
|
8
|
+
* drivers used to carry on their own snapshot before the consolidation — keeping the shape
|
|
9
|
+
* identical lets the per-flow adapter hooks read from this driver without restructuring their
|
|
10
|
+
* `ActivitySourceValue` build.
|
|
11
|
+
*/
|
|
12
|
+
interface ActivitySnapshot {
|
|
13
|
+
activity: Entity<ActivityPayload, ReadonlyArray<GatewayUdaDto>, GatewayPollResponse>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Standalone activity driver contract. The data slice is intentionally slimmer than
|
|
17
|
+
* {@link import("#/flows/deposit/driver").DepositDriver} / {@link import("#/flows/withdraw/driver").WithdrawDriver}
|
|
18
|
+
* — the driver only owns owner-scoped recent-settlements polling, no submission paths.
|
|
19
|
+
*
|
|
20
|
+
* Required methods (`arm`, `watchActivity`, `refreshActivity`) are mandatory because they are the
|
|
21
|
+
* driver's entire purpose — the kit's in-flow activity widgets and the standalone dialog both
|
|
22
|
+
* depend on a polling source being live. {@link invalidateActivity} is optional, mirroring the
|
|
23
|
+
* pattern on per-flow `invalidateBalances?` — drivers that want to opt out of cross-driver
|
|
24
|
+
* invalidation (e.g. tests, custom integrations) can skip implementing it.
|
|
25
|
+
*/
|
|
26
|
+
interface ActivityDriver {
|
|
27
|
+
/**
|
|
28
|
+
* Idempotent priming hook. Live driver kicks off the shared `Gateway.assets()` catalog fetch
|
|
29
|
+
* on first call; the mock no-ops because fixtures are immutable. `<KitProvider>` arms the
|
|
30
|
+
* driver lazily from the controller's `open()` path and from the in-flow watcher mount.
|
|
31
|
+
*/
|
|
32
|
+
arm(): void;
|
|
33
|
+
/**
|
|
34
|
+
* Recurring `gateway/{owner}` poll. Honors the abort signal — the controller's `inActivity`
|
|
35
|
+
* effect tears down the watcher when the dialog closes. Cadence is adaptive on the live
|
|
36
|
+
* driver (fast while pending rows exist, slow once every row is terminal) and constant on
|
|
37
|
+
* the mock.
|
|
38
|
+
*/
|
|
39
|
+
watchActivity(signal: AbortSignal): void;
|
|
40
|
+
/**
|
|
41
|
+
* One-shot owner-scoped activity fetch. The standalone source adapter calls this from
|
|
42
|
+
* pull-to-refresh; the per-flow adapters call it on settlement-completion signals.
|
|
43
|
+
*/
|
|
44
|
+
refreshActivity(signal: AbortSignal): void;
|
|
45
|
+
/**
|
|
46
|
+
* Optional revalidation hook fired by per-flow drivers when they observe a relevant
|
|
47
|
+
* transition (settlement succeeded, withdraw submitted). Implementations should bump the
|
|
48
|
+
* `activity` entity into `loading` or `stale` and trigger an immediate refetch. Mirrors the
|
|
49
|
+
* `invalidateBalances?` lifecycle slot on the per-flow drivers.
|
|
50
|
+
*/
|
|
51
|
+
invalidateActivity?(): void;
|
|
52
|
+
/** Returns the current snapshot. Cheap (no copy) when no mutation has occurred since the last call. */
|
|
53
|
+
getSnapshot(): ActivitySnapshot;
|
|
54
|
+
/** Registers a listener fired on every mutation. Returns the unsubscribe function. */
|
|
55
|
+
subscribe(listener: () => void): () => void;
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
export { ActivityDriver, ActivitySnapshot };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ActivityState } from "./types.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
//#region src/flows/activity/orchestrator/controller.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Read the **logical** activity state — what the reducer says. Transitions to `closed` are
|
|
6
|
+
* surfaced synchronously, so this is the right hook for "is the dialog open?" gating, analytics,
|
|
7
|
+
* and any headless UI that drives off live machine state.
|
|
8
|
+
*/
|
|
9
|
+
declare function useActivityState(): ActivityState;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { useActivityState };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useActivityDriverInstance as e}from"../driver/context.js";import{resolveActivityEntry as t}from"../../../shared/orchestrator/resolveActivityEntry.js";import{useEffectiveState as n}from"../../../shared/orchestrator/useEffectiveState.js";import"../../../shared/orchestrator/index.js";import{initialState as r,reducer as i}from"./reducer.js";import{createContext as a,use as o,useCallback as s,useEffect as c,useMemo as l,useReducer as u,useRef as d}from"react";import{jsx as f}from"react/jsx-runtime";const p=a(null);p.displayName=`ActivityControllerContext`;function m(){let e=o(p);if(!e)throw Error("useActivity must be used inside `<KitProvider activity={…}>` (or `<StridgeProvider>` with a flow enabled). Mount the provider once at the host's app root.");return e}function h(){return o(p)}function g(){return m().state}function _(){return m().effectiveState}function v(){return m().actions}function y({children:t}){let a=e(),[o,s]=u(i,r),c=x(s);S(o,a);let d=n(o),m=b(s,a,c);return f(p,{value:l(()=>({state:o,effectiveState:d,dispatch:s,controller:m,actions:c}),[o,d,m,c]),children:t})}function b(e,n,r){let i=d(n);i.current=n;let a=s(n=>(i.current.arm(),n?(e({type:`OPEN`,input:t(i.current.getSnapshot().activity,n)}),!0):(e({type:`OPEN`}),!0)),[e]),o=s(()=>{e({type:`CLOSE`})},[e]);return l(()=>({open:a,close:o,actions:r}),[a,o,r])}function x(e){let t=d(e);t.current=e;let n=s(e=>{t.current({type:`SELECT_SETTLEMENT`,settlementId:e})},[]),r=s(()=>{t.current({type:`BACK`})},[]),i=s(()=>{t.current({type:`CLOSE`})},[]);return l(()=>({selectSettlement:n,back:r,close:i}),[n,r,i])}function S(e,t){let n=e.name!==`closed`;c(()=>{if(!n)return;let e=new AbortController;return t.watchActivity(e.signal),()=>e.abort()},[n,t])}export{y as ActivityControllerProvider,v as useActivityActions,m as useActivityControllerContext,_ as useActivityEffectiveState,g as useActivityState,h as useOptionalActivityControllerContext};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ActivityOpenInput } from "../../../shared/orchestrator/activityOpenInput.js";
|
|
2
|
+
import { ActivityActions, ActivityController, ActivityState, ActivityStateName } from "./types.js";
|
|
3
|
+
import { useActivityState } from "./controller.js";
|
|
4
|
+
import { useActivity, useOptionalActivity, useOptionalPrefetchActivity, usePrefetchActivity } from "./useActivity.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./reducer.js";import"./controller.js";import"./useActivity.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createActivityReducers as e}from"../../../shared/orchestrator/createActivityReducers.js";import"../../../shared/orchestrator/index.js";const t={name:`closed`},{reduceFromActivityList:n,reduceFromActivityDetail:r}=e({activityList:()=>({name:`activityList`,ctx:{backTarget:void 0}}),activityDetail:(e,t,n)=>({name:`activityDetail`,ctx:{settlementId:e,viaList:n,backTarget:void 0}}),closed:()=>({name:`closed`}),restoreFromBackTarget:()=>({name:`closed`})});function i(e,t){if(t.type===`OPEN`&&e.name!==`closed`)return o(e,t);switch(e.name){case`closed`:return a(t);case`activityList`:return n(e,t);case`activityDetail`:return r(e,t);default:return s(e)}}function a(e){if(e.type!==`OPEN`)return{name:`closed`};let t=e.input;return!t||t.kind===`list`?{name:`activityList`,ctx:{backTarget:void 0}}:{name:`activityDetail`,ctx:{settlementId:t.settlementId,viaList:!1,backTarget:void 0}}}function o(e,t){if(t.type!==`OPEN`)return e;let n=t.input;return!n||n.kind===`list`?e.name===`activityList`?e:{name:`activityList`,ctx:{backTarget:void 0}}:{name:`activityDetail`,ctx:{settlementId:n.settlementId,viaList:!1,backTarget:void 0}}}function s(e){throw Error(`Unhandled activity state: ${JSON.stringify(e)}`)}export{t as initialState,i as reducer};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ActivityOpenInput } from "../../../shared/orchestrator/activityOpenInput.js";
|
|
2
|
+
//#region src/flows/activity/orchestrator/types.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Standalone activity FSM state. Minimal — `closed | activityList | activityDetail`. No
|
|
5
|
+
* `backTarget` carrying because the flow has no source step to restore; `viaList` mirrors the
|
|
6
|
+
* per-flow invariant so BACK from a tap-through detail returns to the list and BACK from a
|
|
7
|
+
* direct-entry detail collapses to `closed`.
|
|
8
|
+
*
|
|
9
|
+
* The vestigial `backTarget: void` slot is required (not optional) so the factory's
|
|
10
|
+
* `TState & { ctx: { backTarget: TBackTarget } }` intersection narrows cleanly when
|
|
11
|
+
* `TBackTarget = void`. At runtime the field is omitted; TypeScript treats `void` ≡ `undefined`
|
|
12
|
+
* for property types.
|
|
13
|
+
*/
|
|
14
|
+
type ActivityState = {
|
|
15
|
+
name: "closed";
|
|
16
|
+
} | {
|
|
17
|
+
name: "activityList";
|
|
18
|
+
ctx: {
|
|
19
|
+
backTarget: void;
|
|
20
|
+
};
|
|
21
|
+
} | {
|
|
22
|
+
name: "activityDetail";
|
|
23
|
+
ctx: {
|
|
24
|
+
settlementId: string;
|
|
25
|
+
viaList: boolean;
|
|
26
|
+
backTarget: void;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
/** Public state-name discriminator. Mirrors `DepositStateName` / `WithdrawStateName`. */
|
|
30
|
+
type ActivityStateName = ActivityState["name"];
|
|
31
|
+
/**
|
|
32
|
+
* Imperative controller returned by `useActivity()`. Stable across re-renders.
|
|
33
|
+
*/
|
|
34
|
+
interface ActivityController {
|
|
35
|
+
/**
|
|
36
|
+
* Open the activity dialog.
|
|
37
|
+
*
|
|
38
|
+
* - `open()` → `activityList`; `BACK` closes the dialog.
|
|
39
|
+
* - `open({ settlementId })` → `activityDetail` when the id resolves against the driver's
|
|
40
|
+
* `activity` entity, otherwise falls through to `activityList`. `BACK` closes the dialog.
|
|
41
|
+
* - `open({ txHash })` → same fall-through semantics, but matched against
|
|
42
|
+
* `from.tx_id` in the raw UDA envelope.
|
|
43
|
+
*
|
|
44
|
+
* Returns `true` — the activity surface is always reachable (read-only, method-agnostic);
|
|
45
|
+
* the boolean is preserved for symmetry with `useDeposit().open()` / `useWithdraw().open()`.
|
|
46
|
+
*/
|
|
47
|
+
open(input?: ActivityOpenInput): boolean;
|
|
48
|
+
/** Close the activity dialog. Idempotent. */
|
|
49
|
+
close(): void;
|
|
50
|
+
/**
|
|
51
|
+
* Action dispatchers — fire the same FSM transitions the kit's compound widgets fire. Use
|
|
52
|
+
* these when building fully-custom headless UI; the dialog and compound layers wire them up
|
|
53
|
+
* automatically.
|
|
54
|
+
*/
|
|
55
|
+
actions: ActivityActions;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Imperative actions consumed by widgets. Read with `useActivityActions()` and dispatch into
|
|
59
|
+
* the standalone activity FSM directly — there's no host-supplied transitions handler in
|
|
60
|
+
* between.
|
|
61
|
+
*/
|
|
62
|
+
interface ActivityActions {
|
|
63
|
+
/** Open the detail view for a settlement listed on the activity surface. Legal only from `activityList`. */
|
|
64
|
+
selectSettlement(settlementId: string): void;
|
|
65
|
+
/** BACK chevron — collapses one navigation level (list-from-detail-via-list, or closed otherwise). */
|
|
66
|
+
back(): void;
|
|
67
|
+
/** Dialog close (X / overlay click). */
|
|
68
|
+
close(): void;
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
export { ActivityActions, ActivityController, ActivityState, ActivityStateName };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { ActivityController } from "./types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/flows/activity/orchestrator/useActivity.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Imperative handle to the orchestrated activity flow. Use to open / close the activity dialog from
|
|
6
|
+
* anywhere in the host app, with optional direct-entry into a settlement detail by `settlementId`
|
|
7
|
+
* or `txHash`.
|
|
8
|
+
*
|
|
9
|
+
* Mount `<KitProvider activity={…} />` once at the host's app root first (or use `<StridgeProvider>`
|
|
10
|
+
* with any flow enabled, which auto-derives the activity driver) — the hook throws when called
|
|
11
|
+
* outside.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* import { useActivity } from "@stridge/kit";
|
|
16
|
+
*
|
|
17
|
+
* function ActivityButton() {
|
|
18
|
+
* const { open } = useActivity();
|
|
19
|
+
* return <button onClick={() => open()}>Activity</button>;
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* // Direct-entry into a settlement detail. Resolution misses fall through to `activityList` —
|
|
26
|
+
* // the click never silently no-ops.
|
|
27
|
+
* open({ settlementId });
|
|
28
|
+
* open({ txHash });
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
declare function useActivity(): ActivityController;
|
|
32
|
+
/**
|
|
33
|
+
* Non-throwing variant of {@link useActivity} — returns `null` when called outside a
|
|
34
|
+
* `<KitProvider activity={…} />`. Lets hosts mount `<StridgeProvider />` conditionally (e.g. only
|
|
35
|
+
* after a wallet is connected) without descendants crashing the moment they render before the
|
|
36
|
+
* provider exists.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```tsx
|
|
40
|
+
* const activity = useOptionalActivity();
|
|
41
|
+
* return (
|
|
42
|
+
* <button onClick={() => activity?.open()} disabled={!activity}>
|
|
43
|
+
* Activity
|
|
44
|
+
* </button>
|
|
45
|
+
* );
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
declare function useOptionalActivity(): ActivityController | null;
|
|
49
|
+
/**
|
|
50
|
+
* Headless prefetch handle for the activity driver. Returns a stable function that arms the
|
|
51
|
+
* driver — kicks off the deferred `Gateway.assets()` catalog fetch alongside the initial
|
|
52
|
+
* `gateway/{owner}` envelope GET. Calling it before the user opens the dialog warms the cache so
|
|
53
|
+
* the subsequent `useActivity().open()` lands on a populated payload without a perceptible
|
|
54
|
+
* loading window.
|
|
55
|
+
*
|
|
56
|
+
* Fire-and-forget: returns `void`. Observe the live snapshot via `useActivitySnapshot()` if
|
|
57
|
+
* needed.
|
|
58
|
+
*
|
|
59
|
+
* ```tsx
|
|
60
|
+
* const activity = useActivity();
|
|
61
|
+
* const prefetchActivity = usePrefetchActivity();
|
|
62
|
+
* <button onMouseEnter={prefetchActivity} onClick={() => activity.open()}>Activity</button>;
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* Idempotent — subsequent calls are no-ops while the driver is already armed.
|
|
66
|
+
*/
|
|
67
|
+
declare function usePrefetchActivity(): () => void;
|
|
68
|
+
/**
|
|
69
|
+
* Non-throwing variant of {@link usePrefetchActivity} — returns a stable function that no-ops when
|
|
70
|
+
* called outside a `<KitProvider activity={…}>`. Lets hosts mount `<StridgeProvider />`
|
|
71
|
+
* conditionally (e.g. only after a wallet is connected) without descendants crashing the moment
|
|
72
|
+
* they render before the provider exists.
|
|
73
|
+
*
|
|
74
|
+
* Symmetric with {@link useOptionalActivity}; pair them when wiring conditional-mount hosts:
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```tsx
|
|
78
|
+
* const activity = useOptionalActivity();
|
|
79
|
+
* const prefetchActivity = useOptionalPrefetchActivity();
|
|
80
|
+
* return (
|
|
81
|
+
* <button
|
|
82
|
+
* onMouseEnter={prefetchActivity}
|
|
83
|
+
* onFocus={prefetchActivity}
|
|
84
|
+
* onClick={() => activity?.open({ settlementId })}
|
|
85
|
+
* disabled={!activity}
|
|
86
|
+
* >
|
|
87
|
+
* View receipt
|
|
88
|
+
* </button>
|
|
89
|
+
* );
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
declare function useOptionalPrefetchActivity(): () => void;
|
|
93
|
+
//#endregion
|
|
94
|
+
export { useActivity, useOptionalActivity, useOptionalPrefetchActivity, usePrefetchActivity };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useActivityDriverInstance as e,useOptionalActivityDriverInstance as t}from"../driver/context.js";import{useActivityControllerContext as n,useOptionalActivityControllerContext as r}from"./controller.js";import{useCallback as i}from"react";function a(){return n().controller}function o(){return r()?.controller??null}function s(){let t=e();return i(()=>{t.arm()},[t])}function c(){let e=t();return i(()=>{e?.arm()},[e])}export{a as useActivity,o as useOptionalActivity,c as useOptionalPrefetchActivity,s as usePrefetchActivity};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/flows/activity/widgets/ActivityDetail.d.ts
|
|
5
|
+
interface ActivityDetailOwnProps {
|
|
6
|
+
/**
|
|
7
|
+
* Optional custom composition forwarded to the underlying `<ActivityDetail>`
|
|
8
|
+
* compound. Defaults to mounting all three per-kind parts; each gates internally on the
|
|
9
|
+
* resolved payload's `kind`.
|
|
10
|
+
*/
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Orchestrated activity detail wrapper for the standalone activity dialog. Mounts the
|
|
15
|
+
* cross-flow `<ActivityDetail>` compound and exposes per-kind parts (`Processing`,
|
|
16
|
+
* `Succeeded`, `Failed`) as namespace members. Renders `null` while the FSM is not on
|
|
17
|
+
* `activityDetail`.
|
|
18
|
+
*/
|
|
19
|
+
declare function ActivityDetail({
|
|
20
|
+
children
|
|
21
|
+
}: ActivityDetailOwnProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
22
|
+
declare namespace ActivityDetail {
|
|
23
|
+
type Props = ActivityDetailOwnProps;
|
|
24
|
+
const Processing: ({
|
|
25
|
+
children
|
|
26
|
+
}: {
|
|
27
|
+
children?: ReactNode;
|
|
28
|
+
}) => _$react_jsx_runtime0.JSX.Element | null;
|
|
29
|
+
const Succeeded: ({
|
|
30
|
+
children
|
|
31
|
+
}: {
|
|
32
|
+
children?: ReactNode;
|
|
33
|
+
}) => _$react_jsx_runtime0.JSX.Element | null;
|
|
34
|
+
const Failed: ({
|
|
35
|
+
children
|
|
36
|
+
}: {
|
|
37
|
+
children?: ReactNode;
|
|
38
|
+
}) => _$react_jsx_runtime0.JSX.Element | null;
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
export { ActivityDetail };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{ActivitySourceProvider as e}from"../../../shared/widgets/activity/compound/context.js";import{ActivityDetail as t}from"../../../shared/widgets/activity/compound/ActivityDetail.js";import"../../../shared/widgets/activity/compound/index.js";import{useStandaloneActivitySource as n}from"./useStandaloneActivitySource.js";import{jsx as r}from"react/jsx-runtime";function i({children:i}){let{sourceValue:a,step:o}=n();return o!==`activityDetail`||!a?null:r(e,{value:a,children:r(t,{children:i})})}(function(e){e.Processing=t.Processing,e.Succeeded=t.Succeeded,e.Failed=t.Failed})(i||={});export{i as ActivityDetail};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ActivityHeader, ActivityListHeader } from "../../../shared/widgets/activity/compound/components/ActivityHeader.js";
|
|
2
|
+
import { ActivityEmpty } from "../../../shared/widgets/activity/compound/components/Empty.js";
|
|
3
|
+
import { ActivityErrorView } from "../../../shared/widgets/activity/compound/components/ErrorView.js";
|
|
4
|
+
import { ActivityList as ActivityList$1 } from "../../../shared/widgets/activity/compound/components/List.js";
|
|
5
|
+
import { ActivityRow } from "../../../shared/widgets/activity/compound/components/Row.js";
|
|
6
|
+
import { ComponentProps, ReactNode } from "react";
|
|
7
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
8
|
+
|
|
9
|
+
//#region src/flows/activity/widgets/ActivityList.d.ts
|
|
10
|
+
interface ActivityListOwnProps {
|
|
11
|
+
/**
|
|
12
|
+
* Optional custom composition forwarded to the underlying `<Activity>` compound.
|
|
13
|
+
* Defaults to the compound's `<Header /> + <List />` shape.
|
|
14
|
+
*/
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Orchestrated activity list wrapper for the standalone activity dialog. Bridges the activity
|
|
19
|
+
* flow's snapshot + actions + FSM state into the cross-flow `<Activity>` compound's source
|
|
20
|
+
* value. Renders `null` while the FSM is not on `activityList` — the dialog's step router only
|
|
21
|
+
* matches the active step, but the no-op guard keeps the component safe to mount in custom
|
|
22
|
+
* dialog compositions that skip the step router.
|
|
23
|
+
*/
|
|
24
|
+
declare function ActivityList({
|
|
25
|
+
children,
|
|
26
|
+
...props
|
|
27
|
+
}: ComponentProps<"div"> & ActivityListOwnProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
28
|
+
declare namespace ActivityList {
|
|
29
|
+
type Props = ComponentProps<"div"> & ActivityListOwnProps;
|
|
30
|
+
const Header: typeof ActivityHeader;
|
|
31
|
+
const ListHeader: typeof ActivityListHeader;
|
|
32
|
+
const List: typeof ActivityList$1;
|
|
33
|
+
const Row: typeof ActivityRow;
|
|
34
|
+
const Empty: typeof ActivityEmpty;
|
|
35
|
+
const ErrorView: typeof ActivityErrorView;
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { ActivityList };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{ActivitySourceProvider as e}from"../../../shared/widgets/activity/compound/context.js";import{Activity as t}from"../../../shared/widgets/activity/compound/Activity.js";import"../../../shared/widgets/activity/compound/index.js";import{useStandaloneActivitySource as n}from"./useStandaloneActivitySource.js";import{jsx as r}from"react/jsx-runtime";function i({children:i,...a}){let{sourceValue:o,step:s}=n();return s!==`activityList`||!o?null:r(e,{value:o,children:r(t,{...a,children:i})})}(function(e){e.Header=t.Header,e.ListHeader=t.ListHeader,e.List=t.List,e.Row=t.Row,e.Empty=t.Empty,e.ErrorView=t.ErrorView})(i||={});export{i as ActivityList};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useActivityDriverInstance as e,useActivitySnapshot as t}from"../driver/context.js";import{useLingui as n}from"../../../shared/i18n/useLingui.js";import"../../../i18n/index.js";import{useActivityActions as r,useActivityEffectiveState as i}from"../orchestrator/controller.js";import{useActivity as a}from"../orchestrator/useActivity.js";import"../orchestrator/index.js";import{defaultBlockExplorers as o}from"../../../shared/utils/explorers.js";import{useCallback as s,useMemo as c}from"react";function l(){let l=t(),u=e(),d=r(),f=a(),p=i(),{i18n:m}=n(),h=s(e=>{u.refreshActivity(e)},[u]),g=s(()=>{f.open()},[f]),_=p.name===`activityList`||p.name===`activityDetail`,v=p.name===`activityDetail`?p.ctx.settlementId:void 0,y=p.name===`activityDetail`&&p.ctx.viaList;return{sourceValue:c(()=>{if(!_)return null;let e=l.activity.status===`ready`||l.activity.status===`stale`?l.activity.response.owner:`0x0000000000000000000000000000000000000000`,t=l.activity.status===`ready`||l.activity.status===`stale`?l.activity.payload.brandName:void 0,n={i18n:m,sourceWallet:{name:`Wallet`,address:e},explorers:o(),...t?{brandName:t}:{}};return{entity:l.activity,refresh:h,selectSettlement:d.selectSettlement,...y?{back:d.back}:{},onLookupMiss:g,...v===void 0?{}:{settlementId:v},settlementContext:n}},[l,d,_,v,m,h,y,g]),settlementId:v,step:p.name===`activityList`?`activityList`:p.name===`activityDetail`?`activityDetail`:`other`}}export{l as useStandaloneActivitySource};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/flows/deposit/bindings/DepositBindings.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Detected card-brand union. Matches the IIN-range coverage of the cash deposit's
|
|
5
|
+
* `CardInputRow`: Visa / Mastercard / Amex / Discover, plus `"unknown"` for any prefix outside
|
|
6
|
+
* those ranges. Exposed here (rather than alongside the widget-local masking helpers) so the
|
|
7
|
+
* public `tokenizeCard` binding can talk about it without a deep widget import.
|
|
8
|
+
*/
|
|
9
|
+
type CardBrand = "visa" | "mastercard" | "amex" | "discover" | "unknown";
|
|
10
|
+
/**
|
|
11
|
+
* Raw card data the kit hands to the host's tokenize binding when the user submits the cash
|
|
12
|
+
* deposit's card form. PAN / CVC are raw digit strings (no masking); `exp` is the formatted
|
|
13
|
+
* `MM/YY` value the user typed; `brand` is the IIN-range detection from `CardInputRow`.
|
|
14
|
+
*
|
|
15
|
+
* This struct is the host's only direct contact with cardholder data — once `tokenizeCard`
|
|
16
|
+
* resolves, the host exchanges it for an opaque token (Stripe.js / Adyen / Spreedly / similar)
|
|
17
|
+
* and the kit no longer holds the raw PAN.
|
|
18
|
+
*/
|
|
19
|
+
interface CardData {
|
|
20
|
+
/** Raw digits with no separators (16 for Visa/MC/Discover, 15 for Amex). */
|
|
21
|
+
pan: string;
|
|
22
|
+
/** Formatted `MM/YY` value. Validated upstream by `isValidExp` before submit. */
|
|
23
|
+
exp: string;
|
|
24
|
+
/** Raw digits (3 for Visa/MC/Discover, 4 for Amex). */
|
|
25
|
+
cvc: string;
|
|
26
|
+
/** Detected brand at submit time. */
|
|
27
|
+
brand: CardBrand;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Discriminated result of a tokenize attempt. Success carries the opaque token the host's PSP
|
|
31
|
+
* returned; failure carries a host-supplied reason string the form surfaces inline.
|
|
32
|
+
*/
|
|
33
|
+
type TokenizationResult = {
|
|
34
|
+
ok: true;
|
|
35
|
+
token: string;
|
|
36
|
+
} | {
|
|
37
|
+
ok: false;
|
|
38
|
+
reason: string;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Render-time inputs the host supplies to the deposit flow. Today this is just the optional
|
|
42
|
+
* `tokenizeCard` callback — when undefined, callers compose with {@link DEFAULT_TOKENIZE_CARD}
|
|
43
|
+
* so the editable form stays observable end-to-end without any host wiring. Future per-method
|
|
44
|
+
* slots (`applePayMerchantSession`, `googlePayPaymentData`) will land on the same context.
|
|
45
|
+
*/
|
|
46
|
+
interface DepositBindings {
|
|
47
|
+
/**
|
|
48
|
+
* Optional host-supplied tokenize handler. Fired when the user submits a valid card form.
|
|
49
|
+
* Host wires this to its PSP's tokenization JS — `stripe.createPaymentMethod`,
|
|
50
|
+
* `adyenWebComponents.createToken`, `spreedlyExpress.createToken`, etc. Resolves to a
|
|
51
|
+
* discriminated result the form surfaces inline.
|
|
52
|
+
*
|
|
53
|
+
* When undefined, callers fall through to {@link DEFAULT_TOKENIZE_CARD} — keeps the demo
|
|
54
|
+
* path interactive without forcing every host to ship a tokenizer just to render the form.
|
|
55
|
+
*/
|
|
56
|
+
tokenizeCard?: (data: CardData) => Promise<TokenizationResult>;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Publish the host's render-time deposit inputs (just `tokenizeCard` today) into the kit's
|
|
60
|
+
* deposit scope. Call it once from whatever component renders the deposit UI:
|
|
61
|
+
*
|
|
62
|
+
* - The kit's `<DepositDialog>` calls it internally when the host passes its bindings prop.
|
|
63
|
+
* - A **headless** host that renders fully custom deposit UI calls it directly — it's the
|
|
64
|
+
* supported way to wire `tokenizeCard` without mounting the dialog.
|
|
65
|
+
*
|
|
66
|
+
* Publishes via `useLayoutEffect` so the bridge ref and reactive state are committed before the
|
|
67
|
+
* next browser paint — the form's submit handler reads `ctx.ref.current.tokenizeCard` at fire
|
|
68
|
+
* time and always sees the latest value. Cleanup blanks both on unmount.
|
|
69
|
+
*
|
|
70
|
+
* React 19 StrictMode runs the layout effect mount → cleanup → mount sequence, so the cleanup
|
|
71
|
+
* blanking the ref is fine: the immediate re-mount restores the bound `tokenizeCard` before any
|
|
72
|
+
* paint, so no user interaction can observe the empty window.
|
|
73
|
+
*
|
|
74
|
+
* @example Headless usage
|
|
75
|
+
* ```tsx
|
|
76
|
+
* useDepositBindings({
|
|
77
|
+
* tokenizeCard: async (card) => {
|
|
78
|
+
* const result = await stripe.createPaymentMethod({ type: "card", card });
|
|
79
|
+
* if (result.error) return { ok: false, reason: result.error.message ?? "Tokenization failed" };
|
|
80
|
+
* return { ok: true, token: result.paymentMethod.id };
|
|
81
|
+
* },
|
|
82
|
+
* });
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
declare function useDepositBindings(bindings: DepositBindings): void;
|
|
86
|
+
//#endregion
|
|
87
|
+
export { CardBrand, CardData, DepositBindings, TokenizationResult, useDepositBindings };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{createContext as e,use as t,useLayoutEffect as n,useMemo as r,useRef as i,useState as a}from"react";import{jsx as o}from"react/jsx-runtime";async function s(e){return await new Promise(e=>setTimeout(e,800)),{ok:!0,token:`kit-mock-token`}}const c=e(null);c.displayName=`DepositBindingsControlContext`;const l=e(null);l.displayName=`DepositBindingsValueContext`;function u({children:e}){let[t,n]=a({}),s=i({});return o(c,{value:r(()=>({setBindings:n,ref:s}),[]),children:o(l,{value:t,children:e})})}function d(){let e=t(c),n=i({});return e?.ref??n}function f(e){let r=t(c),a=e.tokenizeCard,o=i(r?.setBindings);o.current=r?.setBindings;let s=i(r?.ref);s.current=r?.ref,n(()=>{let e=o.current,t=s.current;if(!e||!t)return;let n={...a?{tokenizeCard:a}:{}};return t.current=n,e(n),()=>{let e=o.current,t=s.current;t&&(t.current={}),e&&e({})}},[a])}export{s as DEFAULT_TOKENIZE_CARD,u as DepositBindingsProvider,f as useDepositBindings,d as useDepositBindingsRef};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { CardBrand, CardData, DepositBindings, TokenizationResult, useDepositBindings } from "./DepositBindings.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./DepositBindings.js";
|