@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
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useLingui as e}from"../../../../i18n/useLingui.js";import"../../../../../i18n/index.js";import{text as t}from"../../../../ui/Text/Text.js";import{TokenLogo as n}from"../../../../ui/TokenLogo/TokenLogo.js";import"../../../../ui/TokenLogo/index.js";import"../../../../../ui/index.js";import{
|
|
1
|
+
"use client";import{useLingui as e}from"../../../../i18n/useLingui.js";import"../../../../../i18n/index.js";import{text as t}from"../../../../ui/Text/Text.js";import{TokenLogo as n}from"../../../../ui/TokenLogo/TokenLogo.js";import"../../../../ui/TokenLogo/index.js";import"../../../../../ui/index.js";import{PROCESSING_STATE_SLOTS as r}from"../ProcessingState.slots.js";import{useProcessingStateContext as i}from"../context.js";import{styles as a}from"../ProcessingState.styles.js";import{splitAmount as o}from"./splitAmount.js";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";import*as u from"@stylexjs/stylex";function d(){let d=i(`ProcessingState.Hero`),{_:f}=e(),p=d.creditedTo??d.creditedAsset.symbol,m={symbol:d.creditedAsset.symbol,...d.creditedAsset.chainId===void 0?{}:{chainId:d.creditedAsset.chainId},...d.creditedAsset.address===void 0?{}:{address:d.creditedAsset.address},...d.creditedAsset.isNative===void 0?{}:{isNative:d.creditedAsset.isNative},...d.creditedAsset.logoUrl===void 0?{}:{logoUrl:d.creditedAsset.logoUrl}},h=d.amountUsd?o(d.amountUsd):void 0;return l(`div`,{"data-stridge-slot":r.hero,...u.props(a.hero),children:[c(t.span,{size:`caption`,fontWeight:`semibold`,leading:`tight`,tracking:`widest`,transform:`uppercase`,align:`center`,color:`tertiary`,children:f({id:`zYD5xm`,message:`Crediting`})}),h?l(s,{children:[l(`div`,{dir:`ltr`,...u.props(a.heroAmountRow),children:[h.glyph?c(t.span,{size:`2xl`,fontWeight:`semibold`,leading:`none`,tracking:`tight`,children:h.glyph}):null,c(t.span,{size:`4xl`,fontWeight:`semibold`,leading:`none`,tracking:`tight`,children:h.digits})]}),l(`div`,{dir:`ltr`,...u.props(a.heroSubLine),children:[c(n,{size:18,...m,hideChainBadge:!0,...u.props(a.heroSubLineIcon)}),c(t.span,{size:`sm`,fontWeight:`medium`,leading:`tight`,tracking:`tight`,color:`subdued`,children:d.loading?d.creditedAsset.symbol:`${d.amount} ${d.creditedAsset.symbol}`})]})]}):l(`div`,{dir:`ltr`,...u.props(a.heroAmountRow),children:[c(n,{size:30,...m,hideChainBadge:!0,...u.props(a.heroAmountIcon)}),d.loading?null:c(t.span,{size:`4xl`,fontWeight:`semibold`,leading:`none`,tracking:`tight`,children:d.amount}),c(t.span,{size:d.loading?`4xl`:`xl`,fontWeight:`semibold`,leading:`none`,tracking:`tight`,children:d.creditedAsset.symbol})]}),c(t.span,{size:`meta`,fontWeight:`medium`,leading:`tight`,align:`center`,color:`subdued`,children:p})]})}export{d as ProcessingStateHero};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useLingui as e}from"../../../../i18n/useLingui.js";import"../../../../../i18n/index.js";import{TxHashValue as t}from"../../../../primitives/TxHashValue/TxHashValue.js";import"../../../../primitives/TxHashValue/index.js";import{WalletValue as n}from"../../../../primitives/WalletValue/WalletValue.js";import"../../../../primitives/WalletValue/index.js";import{
|
|
1
|
+
"use client";import{useLingui as e}from"../../../../i18n/useLingui.js";import"../../../../../i18n/index.js";import{TxHashValue as t}from"../../../../primitives/TxHashValue/TxHashValue.js";import"../../../../primitives/TxHashValue/index.js";import{WalletValue as n}from"../../../../primitives/WalletValue/WalletValue.js";import"../../../../primitives/WalletValue/index.js";import{ProcessingStateDetail as r}from"./Detail.js";import{useProcessingStateContext as i}from"../context.js";import{jsx as a}from"react/jsx-runtime";function o({label:t}={}){let o=i(`ProcessingState.SourceRow`),{_:s}=e();if(!o.sourceWallet)return null;let{name:c,address:l,explorerUrl:u}=o.sourceWallet;return a(r,{label:t??s({id:`wdxz7K`,message:`Source`}),value:a(n,{name:c??s({id:`sb9Y58`,message:`Wallet`}),address:l,...u?{explorerUrl:u}:{},density:`compact`,hideIcon:!0})})}function s({label:n}={}){let o=i(`ProcessingState.SourceTxRow`),{_:s}=e();return o.sourceTx?.hash?a(r,{label:n??s({id:`yrvWai`,message:`Source tx`}),value:a(t,{hash:o.sourceTx.hash,...o.sourceTx.explorerUrl?{explorerUrl:o.sourceTx.explorerUrl}:{}})}):null}function c({label:t}={}){let n=i(`ProcessingState.SubmittedAtRow`),{_:o}=e();return n.submittedAt===void 0?null:a(r,{label:t??o({id:`TT0aVH`,message:`Order submitted`}),value:n.submittedAt})}function l({label:t}={}){let n=i(`ProcessingState.DetectedAtRow`),{_:o}=e();return n.detectedAt===void 0?null:a(r,{label:t??o({id:`mvYQx_`,message:`Detected`}),value:n.detectedAt})}export{l as ProcessingStateDetectedAtRow,o as ProcessingStateSourceRow,s as ProcessingStateSourceTxRow,c as ProcessingStateSubmittedAtRow};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useLingui as e}from"../../../../i18n/useLingui.js";import"../../../../../i18n/index.js";import{text as t}from"../../../../ui/Text/Text.js";import"../../../../../ui/index.js";import{
|
|
1
|
+
"use client";import{useLingui as e}from"../../../../i18n/useLingui.js";import"../../../../../i18n/index.js";import{text as t}from"../../../../ui/Text/Text.js";import"../../../../../ui/index.js";import{PROCESSING_STATE_SLOTS as n}from"../ProcessingState.slots.js";import{useProcessingStateContext as r}from"../context.js";import{styles as i}from"../ProcessingState.styles.js";import{jsx as a,jsxs as o}from"react/jsx-runtime";import*as s from"@stylexjs/stylex";const c=[i.statusPillDotDelay0,i.statusPillDotDelay1,i.statusPillDotDelay2,i.statusPillDotDelay3,i.statusPillDotDelay4,i.statusPillDotDelay5],l=[{cx:3,cy:3},{cx:11,cy:3},{cx:3,cy:9},{cx:11,cy:9},{cx:3,cy:15},{cx:11,cy:15}];function u({label:u}={}){let d=r(`ProcessingState.StatusPill`),{_:f}=e(),p=u??d.statusPillLabel??f({id:`0lHlRj`,message:`In transit`});return a(`div`,{"data-stridge-slot":n.statusPillWrap,...s.props(i.statusPillWrap),children:o(`div`,{"data-stridge-slot":n.statusPill,...s.props(i.statusPill),children:[a(`svg`,{"aria-hidden":!0,viewBox:`0 0 14 18`,xmlns:`http://www.w3.org/2000/svg`,fill:`currentColor`,...s.props(i.statusPillIcon),children:l.map((e,t)=>a(`circle`,{cx:e.cx,cy:e.cy,r:`1.6`,...s.props(i.statusPillDot,c[t])},`dot-${e.cx}-${e.cy}`))}),a(t.span,{size:`sm`,fontWeight:`medium`,leading:`tight`,children:p})]})})}export{u as ProcessingStateStatusPill};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){let t=e.charAt(0);return!t||/[0-9<]/.test(t)?{glyph:``,digits:e}:{glyph:t,digits:e.slice(1)}}export{e as splitAmount};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ProcessingStateAsset, ProcessingStateBodyProps, ProcessingStateDetailProps, ProcessingStateDetailsProps, ProcessingStateDialogProps, ProcessingStateHeaderProps, ProcessingStateHeroProps, ProcessingStateProps, ProcessingStateRowProps, ProcessingStateSourceWallet, ProcessingStateStatusPillProps, ProcessingStateTxRef } from "./types.js";
|
|
2
2
|
import { ProcessingState } from "./ProcessingState.js";
|
|
3
3
|
import { PROCESSING_STATE_SLOTS, ProcessingStateSlot } from "./ProcessingState.slots.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DialogShellControls } from "../../../dialog/DialogShell.js";
|
|
2
2
|
import { AssetDescriptor } from "../../asset-descriptor.js";
|
|
3
3
|
import { ComponentProps, ReactNode } from "react";
|
|
4
|
-
import { DestinationDto,
|
|
4
|
+
import { DestinationDto, GatewayUdaDto } from "@stridge/sdk";
|
|
5
5
|
|
|
6
6
|
//#region src/shared/widgets/processing-state/compound/types.d.ts
|
|
7
7
|
/**
|
|
@@ -15,9 +15,10 @@ interface ProcessingStateAsset extends AssetDescriptor {
|
|
|
15
15
|
*/
|
|
16
16
|
raw?: DestinationDto;
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Per-UDA view picked from `gateway/{owner}`. Carries the UDA's `destination` and
|
|
19
|
+
* `settlements[]`. Headless integrators correlate the matched settlement against this slot.
|
|
19
20
|
*/
|
|
20
|
-
responseRaw?:
|
|
21
|
+
responseRaw?: GatewayUdaDto;
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
23
24
|
* Source-wallet payload backing the predefined `Source` row.
|
|
@@ -58,6 +59,12 @@ type ProcessingStateDialogProps = ProcessingStateProps & DialogShellControls;
|
|
|
58
59
|
interface ProcessingStateProps {
|
|
59
60
|
/** Pre-formatted hero amount string (e.g. `"1.99580"`). Pure layout — no widget-side format. */
|
|
60
61
|
amount: string;
|
|
62
|
+
/**
|
|
63
|
+
* Optional pre-formatted USD hero figure (e.g. `"$4.01"`, `"< $0.01"`). When set, the Hero
|
|
64
|
+
* promotes it to the primary line and demotes `amount` + `creditedAsset.symbol` to a subline.
|
|
65
|
+
* When omitted, the Hero renders the token amount as the primary line (default).
|
|
66
|
+
*/
|
|
67
|
+
amountUsd?: string;
|
|
61
68
|
/**
|
|
62
69
|
* The asset that's crediting. Drives the Hero icon, the Hero amount-line symbol, and the default destination
|
|
63
70
|
* caption.
|
|
@@ -107,15 +114,6 @@ interface ProcessingStateProps {
|
|
|
107
114
|
* inside `<ProcessingState.DetectedAtRow />`.
|
|
108
115
|
*/
|
|
109
116
|
detectedAt?: string;
|
|
110
|
-
/**
|
|
111
|
-
* Click handler routed to {@link ProcessingState.Actions}.
|
|
112
|
-
*/
|
|
113
|
-
onClose?: () => void;
|
|
114
|
-
/**
|
|
115
|
-
* Optional override for the Actions CTA label. Defaults to
|
|
116
|
-
* `"Close — we'll notify you"`.
|
|
117
|
-
*/
|
|
118
|
-
closeLabel?: string;
|
|
119
117
|
/**
|
|
120
118
|
* Compound parts; see `ProcessingState.Header`, `ProcessingState.Hero`, etc.
|
|
121
119
|
*/
|
|
@@ -196,21 +194,5 @@ interface ProcessingStateRowProps {
|
|
|
196
194
|
/** Override the row label. */
|
|
197
195
|
label?: string;
|
|
198
196
|
}
|
|
199
|
-
/**
|
|
200
|
-
* Props for `ProcessingState.Actions`.
|
|
201
|
-
*/
|
|
202
|
-
interface ProcessingStateActionsProps {
|
|
203
|
-
/**
|
|
204
|
-
* Optional override for the CTA click handler. Defaults to the
|
|
205
|
-
* `onClose` set on the {@link ProcessingState} root.
|
|
206
|
-
*/
|
|
207
|
-
onClose?: () => void;
|
|
208
|
-
/**
|
|
209
|
-
* Optional override for the CTA label. Defaults to the `closeLabel`
|
|
210
|
-
* set on the {@link ProcessingState} root, falling back to
|
|
211
|
-
* `"Close — we'll notify you"`.
|
|
212
|
-
*/
|
|
213
|
-
closeLabel?: string;
|
|
214
|
-
}
|
|
215
197
|
//#endregion
|
|
216
|
-
export {
|
|
198
|
+
export { ProcessingStateAsset, ProcessingStateBodyProps, ProcessingStateDetailProps, ProcessingStateDetailsProps, ProcessingStateDialogProps, ProcessingStateHeaderProps, ProcessingStateHeroProps, ProcessingStateProps, ProcessingStateRowProps, ProcessingStateSourceWallet, ProcessingStateStatusPillProps, ProcessingStateTxRef };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useLingui as e}from"../../../../i18n/useLingui.js";import"../../../../../i18n/index.js";import{
|
|
1
|
+
"use client";import{useLingui as e}from"../../../../i18n/useLingui.js";import"../../../../../i18n/index.js";import{ExternalLink as t}from"../../../../ui/ExternalLink/ExternalLink.js";import"../../../../ui/ExternalLink/index.js";import{ExternalLinkIcon as n}from"../../../../icons/ExternalLinkIcon.js";import"../../../../../icons/index.js";import{Button as r}from"../../../../ui/Button/Button.js";import"../../../../ui/Button/index.js";import{text as i}from"../../../../ui/Text/Text.js";import"../../../../../ui/index.js";import{useSuccessStateContext as a}from"../context.js";import{SUCCESS_STATE_SLOTS as o}from"../SuccessState.slots.js";import{styles as s}from"../SuccessState.styles.js";import{jsx as c,jsxs as l}from"react/jsx-runtime";import*as u from"@stylexjs/stylex";function d({onDone:d,onClose:f,doneLabel:p,closeLabel:m}={}){let h=a(`SuccessState.Actions`),{_:g}=e(),_=d??h.onDone,v=f??h.onClose,y=typeof _==`function`,b=typeof v==`function`,x=p??h.doneLabel??g({id:`DPfwMq`,message:`Done`}),S=m??h.closeLabel??g({id:`yz7wBu`,message:`Close`});return l(`div`,{"data-stridge-slot":o.actions,...u.props(s.actions),children:[l(`div`,{...u.props(s.actionRow,b&&s.actionRowPair),children:[b?c(r,{size:`cta`,variant:`secondary`,onClick:v,...u.props(s.closeButton,s.doneButtonInteractive),children:c(i.span,{size:`callout`,fontWeight:`semibold`,leading:`tight`,tracking:`tight`,color:`inherit`,children:S})}):null,c(r,{size:`cta`,onClick:y?_:void 0,...u.props(s.doneButton,y?s.doneButtonInteractive:s.doneButtonInert),children:c(i.span,{size:`callout`,fontWeight:`semibold`,leading:`tight`,tracking:`tight`,color:`inherit`,children:x})})]}),h.explorer?c(t,{href:h.explorer.url,suffix:c(n,{"aria-hidden":!0}),...u.props(s.explorerLink),children:c(i.span,{size:`meta`,fontWeight:`medium`,leading:`tight`,color:`inherit`,children:h.explorer.label??g({id:`Sjplg3`,message:`View on Explorer`})})}):null]})}export{d as SuccessStateActions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{text as e}from"../../../../ui/Text/Text.js";import{TokenLogo as t}from"../../../../ui/TokenLogo/TokenLogo.js";import"../../../../ui/TokenLogo/index.js";import"../../../../../ui/index.js";import{SUCCESS_STATE_SLOTS as n}from"../SuccessState.slots.js";import{styles as r}from"../SuccessState.styles.js";import{jsx as i,jsxs as a}from"react/jsx-runtime";import*as o from"@stylexjs/stylex";function s({amount:s,symbol:c,chainId:l,address:u,isNative:d,logoUrl:f}){return a(`span`,{"data-stridge-slot":n.assetValue,...o.props(r.assetValue),children:[i(t,{size:`md`,symbol:c,...l===void 0?{}:{chainId:l},...u===void 0?{}:{address:u},...d===void 0?{}:{isNative:d},...f===void 0?{}:{logoUrl:f},hideChainBadge:!0}),i(e.span,{size:`
|
|
1
|
+
"use client";import{text as e}from"../../../../ui/Text/Text.js";import{TokenLogo as t}from"../../../../ui/TokenLogo/TokenLogo.js";import"../../../../ui/TokenLogo/index.js";import"../../../../../ui/index.js";import{SUCCESS_STATE_SLOTS as n}from"../SuccessState.slots.js";import{styles as r}from"../SuccessState.styles.js";import{jsx as i,jsxs as a}from"react/jsx-runtime";import*as o from"@stylexjs/stylex";function s({amount:s,symbol:c,chainId:l,address:u,isNative:d,logoUrl:f}){return a(`span`,{"data-stridge-slot":n.assetValue,...o.props(r.assetValue),children:[i(t,{size:`md`,symbol:c,...l===void 0?{}:{chainId:l},...u===void 0?{}:{address:u},...d===void 0?{}:{isNative:d},...f===void 0?{}:{logoUrl:f},hideChainBadge:!0}),i(e.span,{size:`xs`,fontWeight:`semibold`,leading:`tight`,children:s}),i(e.span,{size:`xs`,fontWeight:`medium`,leading:`tight`,color:`subdued`,children:c})]})}export{s as SuccessStateAssetValue};
|
|
@@ -14,6 +14,6 @@ declare function SuccessStateMoreDetails({
|
|
|
14
14
|
open: openProp,
|
|
15
15
|
onOpenChange,
|
|
16
16
|
children
|
|
17
|
-
}: SuccessStateMoreDetailsProps): _$react_jsx_runtime0.JSX.Element;
|
|
17
|
+
}: SuccessStateMoreDetailsProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { SuccessStateMoreDetails };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useLingui as e}from"../../../../i18n/useLingui.js";import"../../../../../i18n/index.js";import{ChevronRightIcon as t}from"../../../../icons/ChevronRightIcon.js";import"../../../../../icons/index.js";import{Collapsible as n}from"../../../../ui/Collapsible/Collapsible.js";import"../../../../ui/Collapsible/index.js";import{Details as r}from"../../../../ui/Details/Details.js";import"../../../../ui/Details/index.js";import{useDirectionalChevronTransform as i}from"../../../../dialog/useDirectionalChevronTransform.js";import{
|
|
1
|
+
"use client";import{useLingui as e}from"../../../../i18n/useLingui.js";import"../../../../../i18n/index.js";import{ChevronRightIcon as t}from"../../../../icons/ChevronRightIcon.js";import"../../../../../icons/index.js";import{Collapsible as n}from"../../../../ui/Collapsible/Collapsible.js";import"../../../../ui/Collapsible/index.js";import{Details as r}from"../../../../ui/Details/Details.js";import"../../../../ui/Details/index.js";import{useDirectionalChevronTransform as i}from"../../../../dialog/useDirectionalChevronTransform.js";import{useSuccessStateContext as a}from"../context.js";import{SUCCESS_STATE_SLOTS as o}from"../SuccessState.slots.js";import{styles as s}from"../SuccessState.styles.js";import{useCallback as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import*as f from"@stylexjs/stylex";function p({label:p,defaultOpen:m=!1,open:h,onOpenChange:g,children:_}){let v=a(`SuccessState.MoreDetails`),{_:y}=e();if(!v.depositTx&&!v.completionTx&&v.submittedAt===void 0&&v.filledAt===void 0)return null;let b=p??y({id:`LEbOpR`,message:`More details`}),x=typeof h==`boolean`,[S,C]=l(m),w=x?h:S,T=c(e=>{x||C(e),g?.(e)},[x,g]),E=f.props(s.moreDetailsTrigger,w?null:s.moreDetailsTriggerClosed),D=f.props(s.moreDetailsChevron),O=i(w);return d(n,{open:w,onOpenChange:T,children:[u(n.Trigger,{nativeButton:!1,render:u(r.Row,{"data-stridge-slot":o.moreDetailsTrigger,label:b,className:E.className,style:E.style,children:u(t,{"aria-hidden":!0,className:D.className,style:{...D.style,transform:O}})})}),u(n.Panel,{children:_})]})}export{p as SuccessStateMoreDetails};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{ArrowRightIcon as e}from"../../../../icons/ArrowRightIcon.js";import"../../../../../icons/index.js";import{text as t}from"../../../../ui/Text/Text.js";import"../../../../../ui/index.js";import{SUCCESS_STATE_SLOTS as n}from"../SuccessState.slots.js";import{styles as r}from"../SuccessState.styles.js";import{Fragment as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";import*as s from"@stylexjs/stylex";function c({hops:c}){return a(`span`,{"data-stridge-slot":n.routeValue,...s.props(r.routeValue),children:c.map((n,c)=>o(i,{children:[c>0?a(e,{"aria-hidden":!0,...s.props(r.routeArrow)}):null,a(t.span,{size:`
|
|
1
|
+
"use client";import{ArrowRightIcon as e}from"../../../../icons/ArrowRightIcon.js";import"../../../../../icons/index.js";import{text as t}from"../../../../ui/Text/Text.js";import"../../../../../ui/index.js";import{SUCCESS_STATE_SLOTS as n}from"../SuccessState.slots.js";import{styles as r}from"../SuccessState.styles.js";import{Fragment as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";import*as s from"@stylexjs/stylex";function c({hops:c}){return a(`span`,{"data-stridge-slot":n.routeValue,...s.props(r.routeValue),children:c.map((n,c)=>o(i,{children:[c>0?a(e,{"aria-hidden":!0,...s.props(r.routeArrow)}):null,a(t.span,{size:`xs`,fontWeight:`semibold`,leading:`tight`,children:n})]},`${n}-${c}`))})}export{c as SuccessStateRouteValue};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useLingui as e}from"../../../../i18n/useLingui.js";import"../../../../../i18n/index.js";import{text as t}from"../../../../ui/Text/Text.js";import"../../../../../ui/index.js";import{SUCCESS_STATE_SLOTS as n}from"../SuccessState.slots.js";import{jsx as r}from"react/jsx-runtime";function i({children:i}){let{_:a}=e(),o=i??a({id:`olEUh2`,message:`Successful`});return r(t.span,{"data-stridge-slot":n.statusPill,size:`
|
|
1
|
+
"use client";import{useLingui as e}from"../../../../i18n/useLingui.js";import"../../../../../i18n/index.js";import{text as t}from"../../../../ui/Text/Text.js";import"../../../../../ui/index.js";import{SUCCESS_STATE_SLOTS as n}from"../SuccessState.slots.js";import{jsx as r}from"react/jsx-runtime";function i({children:i}){let{_:a}=e(),o=i??a({id:`olEUh2`,message:`Successful`});return r(t.span,{"data-stridge-slot":n.statusPill,size:`xs`,fontWeight:`semibold`,leading:`tight`,tracking:`tight`,color:`success`,children:o})}export{i as SuccessStateStatusPill};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DialogShellControls } from "../../../dialog/DialogShell.js";
|
|
2
2
|
import { AssetDescriptor } from "../../asset-descriptor.js";
|
|
3
3
|
import { ComponentProps, ReactNode } from "react";
|
|
4
|
-
import { DestinationDto, GatewayLegFromDto, GatewayLegToDto,
|
|
4
|
+
import { DestinationDto, GatewayLegFromDto, GatewayLegToDto, GatewayUdaDto } from "@stridge/sdk";
|
|
5
5
|
|
|
6
6
|
//#region src/shared/widgets/success-state/compound/types.d.ts
|
|
7
7
|
/**
|
|
@@ -15,9 +15,9 @@ interface SuccessStateAsset extends AssetDescriptor {
|
|
|
15
15
|
*/
|
|
16
16
|
raw?: DestinationDto;
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Per-UDA view picked from `gateway/{owner}` that produced the destination metadata.
|
|
19
19
|
*/
|
|
20
|
-
responseRaw?:
|
|
20
|
+
responseRaw?: GatewayUdaDto;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Config for the secondary "View on …" link rendered inside the Actions
|
|
@@ -50,9 +50,9 @@ interface SuccessStateTxRef {
|
|
|
50
50
|
*/
|
|
51
51
|
raw?: GatewayLegFromDto | GatewayLegToDto;
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
53
|
+
* Per-UDA view picked from `gateway/{owner}` that produced the leg.
|
|
54
54
|
*/
|
|
55
|
-
responseRaw?:
|
|
55
|
+
responseRaw?: GatewayUdaDto;
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
58
|
* Public props accepted by the {@link SuccessState} root.
|
|
@@ -49,6 +49,14 @@ declare function KitStorageProvider({
|
|
|
49
49
|
* Throws when no `<KitProvider />` / `<KitStorageProvider />` is mounted above the caller.
|
|
50
50
|
*/
|
|
51
51
|
declare function useKitStorage(): KitStorage;
|
|
52
|
+
/**
|
|
53
|
+
* Soft variant of {@link useKitStorage} — returns `null` when no `<KitProvider />` /
|
|
54
|
+
* `<KitStorageProvider />` is mounted above the caller. Mirrors the
|
|
55
|
+
* `useOptionalWagmi` precedent used by the kit's wagmi-optional posture: kit widgets
|
|
56
|
+
* mounted outside `<KitProvider />` (e.g. standalone `<Deposit />` in a host's own provider
|
|
57
|
+
* tree) should degrade gracefully rather than throw on a missing storage provider.
|
|
58
|
+
*/
|
|
59
|
+
declare function useOptionalKitStorage(): KitStorage | null;
|
|
52
60
|
/**
|
|
53
61
|
* Reactively read the value at `key` from the kit's storage. Re-renders the calling component
|
|
54
62
|
* whenever any kit-storage mutation lands on this `key`. Pass `null` for "no key yet" — the
|
|
@@ -59,4 +67,4 @@ declare function useKitStorage(): KitStorage;
|
|
|
59
67
|
*/
|
|
60
68
|
declare function useKitStorageValue(key: string | null): string | null;
|
|
61
69
|
//#endregion
|
|
62
|
-
export { DEFAULT_KIT_STORAGE_NAMESPACE, KitStorageProvider, useKitStorage, useKitStorageValue };
|
|
70
|
+
export { DEFAULT_KIT_STORAGE_NAMESPACE, KitStorageProvider, useKitStorage, useKitStorageValue, useOptionalKitStorage };
|
package/dist/storage/context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{resolveStorageAdapter as e}from"./adapters.js";import{createKitStorage as t}from"./createKitStorage.js";import{createContext as n,use as r,useMemo as i,useSyncExternalStore as a}from"react";import{jsx as o}from"react/jsx-runtime";const s=`stridge-kit:storage:v1`,c=n(null);c.displayName=`KitStorageContext`;function l({storage:n=`session`,namespace:r=s,children:a}){let l=i(()=>t(e(n),r),[n,r]);return o(c.Provider,{value:l,children:a})}function u(){let e=r(c);if(e===null)throw Error(`useKitStorage must be used inside a <KitProvider /> or <KitStorageProvider />.`);return e}function d(e){let t=u();return a(t.subscribe,()=>e===null?null:t.get(e),()=>null)}export{s as DEFAULT_KIT_STORAGE_NAMESPACE,l as KitStorageProvider,u as useKitStorage,d as
|
|
1
|
+
"use client";import{resolveStorageAdapter as e}from"./adapters.js";import{createKitStorage as t}from"./createKitStorage.js";import{createContext as n,use as r,useMemo as i,useSyncExternalStore as a}from"react";import{jsx as o}from"react/jsx-runtime";const s=`stridge-kit:storage:v1`,c=n(null);c.displayName=`KitStorageContext`;function l({storage:n=`session`,namespace:r=s,children:a}){let l=i(()=>t(e(n),r),[n,r]);return o(c.Provider,{value:l,children:a})}function u(){let e=r(c);if(e===null)throw Error(`useKitStorage must be used inside a <KitProvider /> or <KitStorageProvider />.`);return e}function d(){return r(c)}function f(e){let t=u();return a(t.subscribe,()=>e===null?null:t.get(e),()=>null)}export{s as DEFAULT_KIT_STORAGE_NAMESPACE,l as KitStorageProvider,u as useKitStorage,f as useKitStorageValue,d as useOptionalKitStorage};
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { KitStorageAdapter, KitStoragePersistence } from "./types.js";
|
|
2
2
|
import { createLocalStorageAdapter, createMemoryStorageAdapter, createSessionStorageAdapter, resolveStorageAdapter } from "./adapters.js";
|
|
3
3
|
import { KitStorage, createKitStorage } from "./createKitStorage.js";
|
|
4
|
-
import { DEFAULT_KIT_STORAGE_NAMESPACE, KitStorageProvider, useKitStorage, useKitStorageValue } from "./context.js";
|
|
4
|
+
import { DEFAULT_KIT_STORAGE_NAMESPACE, KitStorageProvider, useKitStorage, useKitStorageValue, useOptionalKitStorage } from "./context.js";
|
|
@@ -1,47 +1,116 @@
|
|
|
1
|
+
import { DepositMethodConfig, DepositMethodsConfig } from "../flows/deposit/orchestrator/types.js";
|
|
2
|
+
import { Presentation } from "../shared/presentation/types.js";
|
|
1
3
|
import { KitI18nConfig } from "../shared/i18n/createKitI18n.js";
|
|
4
|
+
import { SupportConfig } from "../shared/support/types.js";
|
|
5
|
+
import { TermsConfig } from "../shared/terms/types.js";
|
|
2
6
|
import { StridgeEnvironment } from "../drivers/stridge/types.js";
|
|
3
|
-
import {
|
|
7
|
+
import { ConnectWalletConfig } from "../shared/wallet/ConnectWalletContext.js";
|
|
8
|
+
import { Address } from "viem";
|
|
4
9
|
import { ReactNode } from "react";
|
|
5
10
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
11
|
|
|
7
12
|
//#region src/stridge/StridgeProvider.d.ts
|
|
8
13
|
/**
|
|
9
|
-
* Settlement-asset tuple. `
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
14
|
+
* Settlement-asset tuple. `networkId` is the Stridge network id — the wire value the gateway
|
|
15
|
+
* routes against, read straight off `Gateway.assets()` (`"9006"` for BSC, `"195"` for
|
|
16
|
+
* Tron, …). The kit forwards it to `gateway/start` verbatim; it does not ship a chain catalog,
|
|
17
|
+
* so any network the backend lists works without a kit release. `symbol` is the asset symbol
|
|
18
|
+
* on that network (e.g. `"USDC"`).
|
|
13
19
|
*
|
|
14
20
|
* The same `asset` drives both flows:
|
|
15
21
|
*
|
|
16
|
-
* - **Deposit** settles to this `(
|
|
17
|
-
* - **Withdraw** sources from this `(
|
|
22
|
+
* - **Deposit** settles to this `(networkId, symbol)` at the connected wallet (same-owner pattern).
|
|
23
|
+
* - **Withdraw** sources from this `(networkId, symbol)` of the user's on-chain balance.
|
|
18
24
|
*/
|
|
19
25
|
interface StridgeAsset {
|
|
20
|
-
|
|
26
|
+
networkId: string;
|
|
21
27
|
symbol: string;
|
|
22
28
|
}
|
|
23
29
|
/**
|
|
24
|
-
*
|
|
30
|
+
* Settlement destination for the deposit flow. The kit does not infer a destination from any
|
|
31
|
+
* connected wagmi wallet — businesses pass the treasury / settlement address where deposited
|
|
32
|
+
* funds should land.
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* If the gateway-kit admin config has "Same-owner only" enabled (default), `address` must
|
|
36
|
+
* equal the deposit owner. Turn the toggle off — and optionally pair it with a destination
|
|
37
|
+
* whitelist — to route funds to an address that differs from the owner.
|
|
38
|
+
*/
|
|
39
|
+
interface StridgeDepositDestination {
|
|
40
|
+
address: Address;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Stridge `gateway/start.owner` identifier for a single flow. Scopes UDA provisioning and the
|
|
44
|
+
* proactive `gateway/{owner}` settlement poll. The kit treats the address as opaque — businesses
|
|
45
|
+
* pick whatever per-customer (real EOA, derived per-user EOA) or shared (treasury) granularity
|
|
46
|
+
* fits their model.
|
|
47
|
+
*/
|
|
48
|
+
interface StridgeFlowOwner {
|
|
49
|
+
address: Address;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Per-flow deposit tuning.
|
|
25
53
|
*/
|
|
26
54
|
interface StridgeDepositFlowConfig {
|
|
55
|
+
/** Settlement destination address — where settled brand-currency funds land at completion. */
|
|
56
|
+
destination: StridgeDepositDestination;
|
|
27
57
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
58
|
+
* Owner used as `gateway/start.owner` for deposit UDAs. Optional — falls back to the
|
|
59
|
+
* connected wagmi wallet address, then to `dev.userAddressOverride`.
|
|
30
60
|
*/
|
|
31
|
-
|
|
61
|
+
owner?: StridgeFlowOwner;
|
|
62
|
+
/**
|
|
63
|
+
* Lower USD bound on the deposit amount. Drives the asset-picker's "Low Balance" pill,
|
|
64
|
+
* prefills the amount-entry hero, and gates the confirm CTA.
|
|
65
|
+
*/
|
|
66
|
+
minAmountUsd?: number;
|
|
67
|
+
/**
|
|
68
|
+
* Upper USD bound on the deposit amount. When set, the effective ceiling is
|
|
69
|
+
* `min(walletBalanceUsd, maxAmountUsd)`.
|
|
70
|
+
*/
|
|
71
|
+
maxAmountUsd?: number;
|
|
32
72
|
/**
|
|
33
73
|
* Metadata persisted on the UDA at `gateway/start` time. Echoed back on `gateway/{owner}`
|
|
34
|
-
* and webhook payloads.
|
|
74
|
+
* and webhook payloads.
|
|
35
75
|
*/
|
|
36
76
|
metadata?: Record<string, unknown>;
|
|
77
|
+
/**
|
|
78
|
+
* Per-method host disable lever for the deposit-method picker. Disabled tiles stay in the
|
|
79
|
+
* picker (preserves "I can see my options" UX), render natively disabled, and show
|
|
80
|
+
* `disabledHint` inline as the tile's meta line.
|
|
81
|
+
*/
|
|
82
|
+
methods?: StridgeDepositMethodsConfig;
|
|
37
83
|
}
|
|
38
84
|
/**
|
|
39
|
-
*
|
|
85
|
+
* Host-supplied disable lever for a single payment method on the deposit-method picker.
|
|
86
|
+
*/
|
|
87
|
+
type StridgeDepositMethodConfig = DepositMethodConfig;
|
|
88
|
+
/**
|
|
89
|
+
* Per-method host configuration for the deposit picker. Omitting a method keeps default behavior.
|
|
90
|
+
*/
|
|
91
|
+
type StridgeDepositMethodsConfig = DepositMethodsConfig;
|
|
92
|
+
/**
|
|
93
|
+
* Per-flow withdraw tuning.
|
|
40
94
|
*/
|
|
41
95
|
interface StridgeWithdrawFlowConfig {
|
|
42
96
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
97
|
+
* Owner used as `gateway/start.owner` for every withdraw UDA the flow provisions. Required —
|
|
98
|
+
* the withdraw flow has no wagmi fallback because the business (not the end-user) is the
|
|
99
|
+
* party broadcasting the source-chain tx to the UDA.
|
|
100
|
+
*/
|
|
101
|
+
owner: StridgeFlowOwner;
|
|
102
|
+
/**
|
|
103
|
+
* Lower USD bound on the withdraw amount. When set, the form blocks submit with a localized
|
|
104
|
+
* "Min $X" CTA while the typed amount sits below the floor.
|
|
105
|
+
*/
|
|
106
|
+
minAmountUsd?: number;
|
|
107
|
+
/**
|
|
108
|
+
* Upper USD bound on the withdraw amount. When set, the form blocks submit with a localized
|
|
109
|
+
* "Max $X" CTA while the typed amount sits above the cap.
|
|
110
|
+
*/
|
|
111
|
+
maxAmountUsd?: number;
|
|
112
|
+
/**
|
|
113
|
+
* Metadata persisted on every UDA the withdraw flow provisions.
|
|
45
114
|
*/
|
|
46
115
|
metadata?: Record<string, unknown>;
|
|
47
116
|
}
|
|
@@ -56,30 +125,77 @@ interface StridgeAppearance {
|
|
|
56
125
|
accent?: string;
|
|
57
126
|
/** Border-radius preset. `"sharp" | "subtle" | "rounded" | "pill"`. */
|
|
58
127
|
radius?: "sharp" | "subtle" | "rounded" | "pill";
|
|
128
|
+
/** Text direction the kit's primitives render with. */
|
|
129
|
+
direction?: "ltr" | "rtl";
|
|
59
130
|
/**
|
|
60
|
-
*
|
|
61
|
-
* (`"rtl"` for Arabic, Hebrew, Persian, Urdu) when omitted.
|
|
131
|
+
* Controls the "Powered by Stridge" attribution row inside every gateway widget frame.
|
|
62
132
|
*/
|
|
63
|
-
|
|
133
|
+
attribution?: "visible" | "hidden";
|
|
134
|
+
/**
|
|
135
|
+
* How gateway dialogs present themselves. `"auto"` (default) renders a centred dialog on wide
|
|
136
|
+
* containers and a bottom-sheet drawer below the breakpoint; `"dialog"` / `"drawer"` force one
|
|
137
|
+
* surface. Pass `{ mode, breakpoint }` to tune the px threshold (default 600). Measured against
|
|
138
|
+
* the dialog's containing block (its portal `container`, else the viewport).
|
|
139
|
+
*/
|
|
140
|
+
presentation?: Presentation;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Development / preview-only knobs. Grouped under a single `dev` prop so production integrations
|
|
144
|
+
* never reach for these accidentally.
|
|
145
|
+
*/
|
|
146
|
+
interface StridgeDevConfig {
|
|
147
|
+
/**
|
|
148
|
+
* Address-only override used when no wagmi account is connected. Lets demos, sample apps,
|
|
149
|
+
* and read-only previews bootstrap the kit against a pasted EOA without firing up a wallet.
|
|
150
|
+
* The wagmi-connected account always wins — the override only fills in when `useAccount()`
|
|
151
|
+
* returns no address.
|
|
152
|
+
*/
|
|
153
|
+
userAddressOverride?: Address;
|
|
154
|
+
/**
|
|
155
|
+
* Unlock the cash payment rail (Card / Apple Pay / Google Pay). The cash flow is currently
|
|
156
|
+
* UI-only with no backend, so the rail is fused off for every integration by default and this
|
|
157
|
+
* knob is the only switch that surfaces it. Reserved for Stridge's own demo / preview surfaces
|
|
158
|
+
* while cash bakes — production integrations should not flip it. The
|
|
159
|
+
* `flows.deposit.methods.cashRail.enabled` opt-in is still required *in addition* to this gate;
|
|
160
|
+
* this knob will be removed (and the rail governed by the opt-in alone) once the cash backend
|
|
161
|
+
* ships.
|
|
162
|
+
*/
|
|
163
|
+
cashRail?: boolean;
|
|
64
164
|
}
|
|
65
165
|
/**
|
|
66
|
-
* Persistence configuration for the kit's per-tab state (settlement banner acks, future
|
|
67
|
-
*
|
|
166
|
+
* Persistence configuration for the kit's per-tab state (settlement banner acks, future kit-wide
|
|
167
|
+
* features).
|
|
68
168
|
*/
|
|
69
169
|
interface StridgeStorageConfig {
|
|
70
170
|
/**
|
|
71
171
|
* Storage backend. `"session"` (default — `sessionStorage`, forgotten on tab close),
|
|
72
|
-
* `"local"` (`localStorage`, survives restarts), or `"memory"` (in-process only
|
|
73
|
-
* tests).
|
|
172
|
+
* `"local"` (`localStorage`, survives restarts), or `"memory"` (in-process only).
|
|
74
173
|
*/
|
|
75
174
|
driver?: "session" | "local" | "memory";
|
|
76
175
|
/**
|
|
77
|
-
* Prefix every key the kit writes under.
|
|
78
|
-
* page sharing a backend should pick distinct namespaces to keep state isolated. Defaults
|
|
79
|
-
* to `stridge-kit:storage:v1`.
|
|
176
|
+
* Prefix every key the kit writes under. Defaults to `stridge-kit:storage:v1`.
|
|
80
177
|
*/
|
|
81
178
|
namespace?: string;
|
|
82
179
|
}
|
|
180
|
+
/**
|
|
181
|
+
* Eager-bootstrap opt-in. Set on `<StridgeProvider prefetch={…}>` to fire the driver `arm()`
|
|
182
|
+
* at mount instead of waiting for `useDeposit().open()` / `usePrefetchDeposit()` (or the
|
|
183
|
+
* activity equivalents) to do it. Two shapes:
|
|
184
|
+
*
|
|
185
|
+
* - `true` — arm every enabled flow at mount, including the activity driver.
|
|
186
|
+
* - `("deposit" | "withdraw" | "activity")[]` — arm only the listed surfaces. Activity may be
|
|
187
|
+
* listed alone (for hosts that mount only `<ActivityDialog>` — a `deposit` or `withdraw` flow
|
|
188
|
+
* is still configured so the activity owner resolves) or paired with a flow. Listing
|
|
189
|
+
* `"deposit"` or `"withdraw"` implicitly arms `"activity"` too — the activity surface is
|
|
190
|
+
* cross-flow content and any per-flow prefetch implies its envelope is wanted.
|
|
191
|
+
*
|
|
192
|
+
* Default is unset (no eager arm). Reach for this only when the host KNOWS the dialog will
|
|
193
|
+
* open (e.g. a checkout page whose entire purpose is the gateway widget). The default trade —
|
|
194
|
+
* pay bootstrap cost when the user actually opens the dialog — is the right call for every
|
|
195
|
+
* other integration; flipping the prop "just to be safe" re-creates the eager-load problem at
|
|
196
|
+
* a different layer.
|
|
197
|
+
*/
|
|
198
|
+
type StridgePrefetchConfig = true | ReadonlyArray<"deposit" | "withdraw" | "activity">;
|
|
83
199
|
declare namespace StridgeProvider {
|
|
84
200
|
interface Props {
|
|
85
201
|
/**
|
|
@@ -90,13 +206,11 @@ declare namespace StridgeProvider {
|
|
|
90
206
|
/**
|
|
91
207
|
* Which Stridge API host the kit talks to. Defaults to `"production"`
|
|
92
208
|
* (`api.stridge.com`). Pass `"staging"` (`api.stridge.dev`) for integration testing.
|
|
93
|
-
* Note that gateway keys are environment-scoped — a staging key won't authenticate
|
|
94
|
-
* against production and vice versa.
|
|
95
209
|
*/
|
|
96
210
|
environment?: StridgeEnvironment;
|
|
97
211
|
/**
|
|
98
|
-
* Settlement asset — the single source of truth for which `(
|
|
99
|
-
* operates in.
|
|
212
|
+
* Settlement asset — the single source of truth for which `(networkId, symbol)` the
|
|
213
|
+
* gateway operates in.
|
|
100
214
|
*/
|
|
101
215
|
asset: StridgeAsset;
|
|
102
216
|
/**
|
|
@@ -113,6 +227,34 @@ declare namespace StridgeProvider {
|
|
|
113
227
|
i18n?: KitI18nConfig;
|
|
114
228
|
/** Persistence configuration for kit-internal state. */
|
|
115
229
|
storage?: StridgeStorageConfig;
|
|
230
|
+
/**
|
|
231
|
+
* Development / preview-only knobs. Grouped under `dev` so production integrations
|
|
232
|
+
* never reach for them accidentally.
|
|
233
|
+
*/
|
|
234
|
+
dev?: StridgeDevConfig;
|
|
235
|
+
/**
|
|
236
|
+
* Customer-support entry point configuration.
|
|
237
|
+
*
|
|
238
|
+
* Omit to use Stridge Intercom. Provide `url`, `onOpen`, or both to use merchant-owned
|
|
239
|
+
* support and opt out of Stridge messenger globals.
|
|
240
|
+
*/
|
|
241
|
+
support?: SupportConfig;
|
|
242
|
+
/**
|
|
243
|
+
* Terms link configuration. Omit to point the kit's terms links at Stridge's terms page.
|
|
244
|
+
*/
|
|
245
|
+
terms?: TermsConfig;
|
|
246
|
+
/**
|
|
247
|
+
* Eager-bootstrap opt-in. See {@link StridgePrefetchConfig}.
|
|
248
|
+
*/
|
|
249
|
+
prefetch?: StridgePrefetchConfig;
|
|
250
|
+
/**
|
|
251
|
+
* Host-supplied "Connect a wallet" CTA. Rendered by the dialog's wallet-required state
|
|
252
|
+
* when the deposit flow is enabled but no owner can be resolved (no `flows.deposit.owner`,
|
|
253
|
+
* no wagmi connection, no `dev.userAddressOverride`). Omit to show the prompt without an
|
|
254
|
+
* actionable button — useful when the host surfaces the connect affordance elsewhere on
|
|
255
|
+
* the page.
|
|
256
|
+
*/
|
|
257
|
+
connectWallet?: ConnectWalletConfig;
|
|
116
258
|
/** Optional className applied to the kit's scope root `<div>`. */
|
|
117
259
|
className?: string;
|
|
118
260
|
children?: ReactNode;
|
|
@@ -127,16 +269,21 @@ declare namespace StridgeProvider {
|
|
|
127
269
|
* from the per-flow `/dialog` subpaths anywhere inside; open them with `useDeposit().open()` /
|
|
128
270
|
* `useWithdraw().open()`.
|
|
129
271
|
*
|
|
272
|
+
* Bootstrap is lazy — no Stridge requests fire at provider mount. The driver instances stay
|
|
273
|
+
* idle until the user opens a dialog or the headless `usePrefetchDeposit()` /
|
|
274
|
+
* `usePrefetchWithdraw()` hook is called. Pass `prefetch` to opt into eager bootstrap when the
|
|
275
|
+
* host knows the dialog will open (rare).
|
|
276
|
+
*
|
|
130
277
|
* @example
|
|
131
278
|
* ```tsx
|
|
132
|
-
* import { StridgeProvider
|
|
279
|
+
* import { StridgeProvider } from "@stridge/kit";
|
|
133
280
|
* import { DepositDialog } from "@stridge/kit/deposit/dialog";
|
|
134
281
|
*
|
|
135
282
|
* <StridgeProvider
|
|
136
283
|
* gatewayKey={process.env.NEXT_PUBLIC_STRIDGE_GATEWAY_KEY!}
|
|
137
|
-
* asset={{
|
|
138
|
-
* flows={{ deposit: {} }}
|
|
139
|
-
*
|
|
284
|
+
* asset={{ networkId: "9006", symbol: "USDC" }}
|
|
285
|
+
* flows={{ deposit: { destination: { address: treasury } } }}
|
|
286
|
+
* connectWallet={{ onClick: openConnectModal }}
|
|
140
287
|
* >
|
|
141
288
|
* <YourApp />
|
|
142
289
|
* <DepositDialog />
|
|
@@ -151,8 +298,13 @@ declare function StridgeProvider({
|
|
|
151
298
|
appearance,
|
|
152
299
|
i18n,
|
|
153
300
|
storage,
|
|
301
|
+
dev,
|
|
302
|
+
support,
|
|
303
|
+
terms,
|
|
304
|
+
prefetch,
|
|
305
|
+
connectWallet,
|
|
154
306
|
className,
|
|
155
307
|
children
|
|
156
308
|
}: StridgeProvider.Props): _$react_jsx_runtime0.JSX.Element;
|
|
157
309
|
//#endregion
|
|
158
|
-
export { StridgeAppearance, StridgeAsset, StridgeDepositFlowConfig, StridgeProvider, StridgeStorageConfig, StridgeWithdrawFlowConfig };
|
|
310
|
+
export { StridgeAppearance, StridgeAsset, StridgeDepositDestination, StridgeDepositFlowConfig, StridgeDepositMethodConfig, StridgeDepositMethodsConfig, StridgeFlowOwner, StridgePrefetchConfig, StridgeProvider, StridgeStorageConfig, StridgeWithdrawFlowConfig };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{StridgeEventsContext as e}from"../events/context.js";import{createKitI18n as t}from"../shared/i18n/createKitI18n.js";import"../i18n/index.js";import{createStridgeCatalog as n}from"../drivers/stridge/catalog.js";import{createStridgeActivityDriver as r}from"../drivers/stridge/createStridgeActivityDriver.js";import{createStridgeDepositDriver as i}from"../drivers/stridge/createStridgeDepositDriver.js";import{createStridgeWithdrawDriver as a}from"../drivers/stridge/createStridgeWithdrawDriver.js";import"../_internal/drivers/stridge/index.js";import{createBus as ee}from"../events/bus/createBus.js";import{createFlowIdRegistry as te}from"../events/bus/flowIdRegistry.js";import{createMetadataStore as o}from"../events/bus/metadata.js";import"../events/bus/index.js";import{KitProvider as s}from"../KitProvider.js";import{resolveMerchantLink as c}from"../shared/merchant-link/resolveMerchantLink.js";import"../shared/merchant-link/index.js";import{useIntercomMerchantContext as l}from"../shared/support/useIntercomMerchantContext.js";import{useMerchantContext as u}from"../shared/support/useMerchantContext.js";import"../shared/support/index.js";import{useDeepMemo as d}from"../shared/utils/useDeepMemo.js";import{ConnectWalletContext as f}from"../shared/wallet/ConnectWalletContext.js";import{DepositOwnerContext as p}from"./depositOwner.js";import{useOptionalWagmi as m}from"./optionalWagmi.js";import{createStubDepositDriver as h,createStubWithdrawDriver as g}from"./stubs.js";import{useEffect as ne,useMemo as _,useRef as v}from"react";import{jsx as y}from"react/jsx-runtime";function b({gatewayKey:b,environment:x,asset:S,flows:C,appearance:w,i18n:T,storage:E,dev:D,support:O,terms:k,prefetch:A,connectWallet:j,className:re,children:ie}){if(!C.deposit&&!C.withdraw)throw Error("<StridgeProvider /> requires at least one of `flows.deposit` or `flows.withdraw`.");if(!S)throw Error("<StridgeProvider /> requires `asset: { networkId, symbol }`.");let{config:M,address:N}=m(),P=_(()=>t(T??{}),[T?.locale,T?.messages]),F=v(P);F.current=P;let I=d(S),L=d(C.deposit),R=d(C.withdraw),z=I.networkId,B=I.symbol,V=L?.owner?.address??N??D?.userAddressOverride,H=R?.owner.address,U=_(()=>n({projectKey:b,...x?{environment:x}:{}}),[b,x]),W=_(()=>{if(!(!L||!V))return i({userAddress:V,projectKey:b,destination:{network_id:z,asset_symbol:B,to_address:L.destination.address},wagmiConfig:M,catalog:U,getI18n:()=>F.current,...x?{environment:x}:{},...L.minAmountUsd===void 0?{}:{minAmountUsd:L.minAmountUsd},...L.maxAmountUsd===void 0?{}:{maxAmountUsd:L.maxAmountUsd},...L.metadata?{metadata:L.metadata}:{}})},[L,V,b,x,z,B,M,U]),G=_(()=>h(),[]),K=L?W??G:void 0,q=_(()=>{if(!(!R||!H))return a({userAddress:H,projectKey:b,currency:{networkId:z,assetSymbol:B},wagmiConfig:M,catalog:U,getI18n:()=>F.current,...x?{environment:x}:{},...R.minAmountUsd===void 0?{}:{minAmountUsd:R.minAmountUsd},...R.maxAmountUsd===void 0?{}:{maxAmountUsd:R.maxAmountUsd},...R.metadata?{metadata:R.metadata}:{}})},[R,H,b,x,z,B,M,U]),J=_(()=>g(),[]),Y=R?q??J:void 0,X=(L?V:void 0)??(R?H:void 0),Z=_(()=>{if(X)return r({userAddress:X,projectKey:b,catalog:U,...x?{environment:x}:{}})},[X,b,x,U]);ne(()=>{if(!A)return;let e=A===!0||A.includes(`deposit`),t=A===!0||A.includes(`withdraw`),n=A===!0||A.includes(`activity`)||e||t;e&&W?.arm(),t&&q?.arm(),n&&Z?.arm()},[A,W,q,Z]);let ae=_(()=>L?{resolved:V!==void 0}:null,[L,V]),oe=_(()=>j?{onClick:j.onClick,...j.label===void 0?{}:{label:j.label}}:null,[j?.onClick,j?.label]),Q=V??H,$=u({gatewayKey:b,environment:x??`production`,assetChain:z,assetSymbol:B,...Q?{userAddress:Q}:{},...W?{depositDriver:W}:{}});return l(c(O?{url:O.url,onSelect:O.onOpen}:void 0).kind===`default`?$:null),y(e,{value:_(()=>({bus:ee(),flowIds:te(),metadata:o()}),[]),children:y(f,{value:oe,children:y(p,{value:ae,children:y(s,{theme:w?.theme,accent:w?.accent,radius:w?.radius,direction:w?.direction,attribution:w?.attribution,presentation:w?.presentation,i18n:T,storage:E?.driver,storageNamespace:E?.namespace,className:re,support:O,merchantContext:$,terms:k,...K?{deposit:K}:{},...L?.methods?{depositMethods:L.methods}:{},...Y?{withdraw:Y}:{},...Z?{activity:Z}:{},...D?.cashRail?{dev:{cashRail:!0}}:{},children:ie})})})})}export{b as StridgeProvider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{createContext as e,use as t}from"react";const n=e(null);n.displayName=`DepositOwnerContext`;function r(){return t(n)}export{n as DepositOwnerContext,r as useDepositOwnerContext};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{use as e,useCallback as t,useSyncExternalStore as n}from"react";import{getAccount as r,watchAccount as i}from"wagmi/actions";import{WagmiContext as a}from"wagmi";function o(){let o=e(a);return{config:o,address:n(t(e=>o?i(o,{onChange:()=>e()}):()=>{},[o]),t(()=>{if(o)return r(o).address},[o]),()=>void 0)}}export{o as useOptionalWagmi};
|
package/dist/stridge/stubs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=Object.freeze({status:`idle`}),t=Object.freeze({brand:e,target:e,addresses:e,balances:e,quote:e,settlement:e,wallet:e}),n=Object.freeze({withdrawableBalances:e,receiveOptions:e,quote:e,settlement:e}),r=()=>{};function i(){if(typeof DOMException==`function`)return new DOMException(`Aborted`,`AbortError`);let e=Error(`Aborted`);return e.name=`AbortError`,e}function a(e){return new Promise((t,n)=>{if(e.aborted){n(i());return}e.addEventListener(`abort`,()=>n(i()),{once:!0})})}function o(){return{getSnapshot:()=>t,subscribe:()=>r,requestQuote:(e,t)=>a(t),submitDeposit:(e,t)=>a(t),watchSettlement:()=>{},fetchActiveSettlement:async()=>null}}function s(){return{getSnapshot:()=>n,subscribe:()=>r,requestQuote:(e,t)=>a(t),
|
|
1
|
+
const e=Object.freeze({status:`idle`}),t=Object.freeze({brand:e,target:e,addresses:e,balances:e,quote:e,settlement:e,wallet:e,cashMethods:e,activity:e}),n=Object.freeze({withdrawableBalances:e,receiveOptions:e,quote:e,settlement:e,activity:e}),r=()=>{};function i(){if(typeof DOMException==`function`)return new DOMException(`Aborted`,`AbortError`);let e=Error(`Aborted`);return e.name=`AbortError`,e}function a(e){return new Promise((t,n)=>{if(e.aborted){n(i());return}e.addEventListener(`abort`,()=>n(i()),{once:!0})})}function o(){return{getSnapshot:()=>t,subscribe:()=>r,arm:()=>{},requestQuote:(e,t)=>a(t),submitDeposit:(e,t)=>a(t),watchSettlement:()=>{},fetchActiveSettlement:async()=>null}}function s(){return{getSnapshot:()=>n,subscribe:()=>r,arm:()=>{},requestQuote:(e,t)=>a(t),prepareWithdrawal:(e,t)=>a(t),watchSettlement:()=>{}}}export{o as createStubDepositDriver,s as createStubWithdrawDriver};
|