@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
|
@@ -58,7 +58,7 @@ interface TransferCryptoChain extends TransferCryptoAsset {
|
|
|
58
58
|
*/
|
|
59
59
|
raw?: SupportedAssetDto;
|
|
60
60
|
/**
|
|
61
|
-
* Full `
|
|
61
|
+
* Full `Gateway.assets()` response that produced the network entry.
|
|
62
62
|
*/
|
|
63
63
|
responseRaw?: SupportedAssetsResponse;
|
|
64
64
|
}
|
|
@@ -67,13 +67,19 @@ interface TransferCryptoChain extends TransferCryptoAsset {
|
|
|
67
67
|
* pins to the first-encountered chain's entry; per-chain context lives on `chainsByToken`.
|
|
68
68
|
*/
|
|
69
69
|
interface TransferCryptoToken extends TransferCryptoAsset {
|
|
70
|
+
/**
|
|
71
|
+
* Estimated price impact of depositing this token, as a percentage decimal string
|
|
72
|
+
* (e.g. `"0.5"`). Surfaced on the disclosure row next to the processing-time hint. Omit when
|
|
73
|
+
* the gateway has no estimate — the row then shows the processing-time hint alone.
|
|
74
|
+
*/
|
|
75
|
+
priceImpact?: string;
|
|
70
76
|
/**
|
|
71
77
|
* Source token DTO from the pinned chain — `AssetDto` for ERC-20s, `NativeCurrencyDto` for
|
|
72
78
|
* chain-natives. Reflects the first chain the symbol was encountered on; integrators reading
|
|
73
79
|
* per-chain `raw` walk `chainsByToken[symbol]`.
|
|
74
80
|
*/
|
|
75
81
|
raw?: AssetDto | NativeCurrencyDto;
|
|
76
|
-
/** Full `
|
|
82
|
+
/** Full `Gateway.assets()` response that produced the token entry. */
|
|
77
83
|
responseRaw?: SupportedAssetsResponse;
|
|
78
84
|
}
|
|
79
85
|
/**
|
|
@@ -182,6 +188,14 @@ interface TransferCryptoDisclosureProps {
|
|
|
182
188
|
* override per route.
|
|
183
189
|
*/
|
|
184
190
|
processingTime?: string;
|
|
191
|
+
/**
|
|
192
|
+
* Price-impact percentage surfaced on the trigger next to the
|
|
193
|
+
* processing-time hint (e.g. `"0.5"` renders `"0.5% price impact"`).
|
|
194
|
+
* Defaults to the active token's `priceImpact`; pass to override per
|
|
195
|
+
* route. When neither is set the trigger shows the processing-time
|
|
196
|
+
* hint alone.
|
|
197
|
+
*/
|
|
198
|
+
priceImpact?: string;
|
|
185
199
|
}
|
|
186
200
|
//#endregion
|
|
187
201
|
export { TransferCryptoAsset, TransferCryptoBodyProps, TransferCryptoChain, TransferCryptoDialogProps, TransferCryptoDisclosureProps, TransferCryptoHeaderProps, TransferCryptoProps, TransferCryptoToken };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { QuoteResponse } from "@stridge/sdk";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { GatewaySettlementDto, GatewayUdaDto } from "@stridge/sdk";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e,t={}){let n=e.settlements??[],r=t.txHash?.toLowerCase()
|
|
1
|
+
function e(e,t={}){let n=e.settlements??[],r=t.txHash?.toLowerCase();if(r){let e=n.filter(e=>e.from?.tx_id?.toLowerCase()===r);return e.length===0?void 0:[...e].sort((e,t)=>(t.updated_at??``).localeCompare(e.updated_at??``))[0]}let i=t.bestMatch;if(i){let t=i.destination.recipientAddress.toLowerCase(),r=i.destination.tokenSymbol.toLowerCase(),a=new Date(i.submittedAt).toISOString(),o=i.sourceAmountBaseUnits,s=n.filter(n=>{let s=n.created_at??``;if(s&&s<a)return!1;let c=e.destination;return!(Number(c.eip155_id)!==i.destination.chainId||(c.asset_symbol??``).toLowerCase()!==r||(c.address??``).toLowerCase()!==t||o!==void 0&&n.from?.raw_amount!==o)});return s.length===0?void 0:[...s].sort((e,t)=>(t.updated_at??``).localeCompare(e.updated_at??``))[0]}let a=t.sinceIso??``,o=n.filter(e=>(e.created_at??``)>=a);if(o.length!==0)return[...o].sort((e,t)=>(t.updated_at??``).localeCompare(e.updated_at??``))[0]}export{e as pickRelevantSettlement};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=new Set([11155111,5,80001,80002,84532,421614,11155420,97]);export{e as KNOWN_TESTNET_EIP155_IDS};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { WithdrawSubmitCallback } from "../orchestrator/types.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
//#region src/flows/withdraw/bindings/WithdrawBindings.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Withdrawable balance the host surfaces to the withdraw form. Two accepted forms:
|
|
6
|
+
*
|
|
7
|
+
* - `number` — bare amount in display units (kit infers symbol from the provider-level
|
|
8
|
+
* `asset.symbol`; USD value is derived for known stablecoins or hidden otherwise).
|
|
9
|
+
* - `{ amount, amountUsd? }` — explicit amount plus optional pre-computed USD value.
|
|
10
|
+
*
|
|
11
|
+
* `undefined` represents the loading state — the kit renders a skeleton / em-dashes instead
|
|
12
|
+
* of a value.
|
|
13
|
+
*/
|
|
14
|
+
type WithdrawBalanceInput = number | {
|
|
15
|
+
amount: number;
|
|
16
|
+
amountUsd?: number;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Trusted-recipient prefill chip surfaced next to the recipient address input. The kit no
|
|
20
|
+
* longer auto-derives a chip from `wagmi.address` — that misled users on embedded-wallet
|
|
21
|
+
* integrations, where `wagmi.address` is the integration's generated wallet rather than the
|
|
22
|
+
* user's primary self-custodial wallet. Hosts that have a verified, user-trusted address (a
|
|
23
|
+
* saved wallet on the user's profile, a KYC-bound payout destination, a whitelisted withdrawal
|
|
24
|
+
* address) pass it via {@link useWithdrawBindings} (or the `<WithdrawDialog>` prop of the same
|
|
25
|
+
* name); the chip's `aria-label` reads off `label` so the affordance is unambiguous about which
|
|
26
|
+
* address the user is filling with.
|
|
27
|
+
*/
|
|
28
|
+
interface WithdrawSuggestedRecipient {
|
|
29
|
+
/** Address that fills the recipient input when the chip is clicked. */
|
|
30
|
+
address: string;
|
|
31
|
+
/**
|
|
32
|
+
* Short human label for the chip — used as the accessible name (`aria-label`) so screen
|
|
33
|
+
* readers and click targets describe the saved address concretely (e.g. `"Saved wallet"`,
|
|
34
|
+
* `"Your verified address"`). When omitted, the chip falls back to a generic kit-default.
|
|
35
|
+
*/
|
|
36
|
+
label?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Receive-side chain id this address belongs to (EIP-155 numeric). When set, the chip is
|
|
39
|
+
* surfaced only while the form's selected receive chain matches — prevents the user from
|
|
40
|
+
* one-click-filling an Ethereum address while routing to BSC, etc. When omitted, the chip
|
|
41
|
+
* is surfaced unconditionally and address-chain compatibility is the integrator's concern.
|
|
42
|
+
*/
|
|
43
|
+
chainId?: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Render-time inputs the host supplies to the withdraw flow. Whoever renders the withdraw UI —
|
|
47
|
+
* the kit's `<WithdrawDialog>` or a fully custom headless surface — publishes these via
|
|
48
|
+
* {@link useWithdrawBindings}. Form widgets read the display values reactively; the orchestrator's
|
|
49
|
+
* submit action reads `onSubmit` at submit time to fire the host's callback.
|
|
50
|
+
*/
|
|
51
|
+
interface WithdrawBindings {
|
|
52
|
+
/** Host-supplied source-side balance the form renders. */
|
|
53
|
+
balance?: WithdrawBalanceInput;
|
|
54
|
+
/**
|
|
55
|
+
* Host-supplied submit handler. Fired when the user submits the form (after the kit has
|
|
56
|
+
* prepared a fresh UDA target). The host calls the supplied actions to advance the FSM at
|
|
57
|
+
* the points its backend reaches the matching state.
|
|
58
|
+
*/
|
|
59
|
+
onSubmit?: WithdrawSubmitCallback;
|
|
60
|
+
/**
|
|
61
|
+
* Trusted recipient address surfaced as a prefill chip on the recipient field. See
|
|
62
|
+
* {@link WithdrawSuggestedRecipient}.
|
|
63
|
+
*/
|
|
64
|
+
suggestedRecipient?: WithdrawSuggestedRecipient;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Publish the host's render-time withdraw inputs (`balance`, `onSubmit`, `suggestedRecipient`)
|
|
68
|
+
* into the kit's withdraw scope. Call it once from whatever component renders the withdraw UI:
|
|
69
|
+
*
|
|
70
|
+
* - The kit's `<WithdrawDialog>` calls it internally with its render-time props.
|
|
71
|
+
* - A **headless** host that renders fully custom withdraw UI from `useWithdraw()` /
|
|
72
|
+
* `useWithdrawState()` / `useWithdrawSnapshot()` calls it directly — it's the supported way
|
|
73
|
+
* to wire `onSubmit` (and the optional display inputs) without mounting the dialog.
|
|
74
|
+
*
|
|
75
|
+
* Writes synchronously to the bridge ref during render so the controller's submit action always
|
|
76
|
+
* reads the latest `onSubmit`; a deferred `setState` updates the reactive state read by display
|
|
77
|
+
* widgets. Clears the bridge on unmount.
|
|
78
|
+
*
|
|
79
|
+
* @example Headless usage
|
|
80
|
+
* ```tsx
|
|
81
|
+
* useWithdrawBindings({
|
|
82
|
+
* balance: walletBalance,
|
|
83
|
+
* onSubmit: async (input, actions) => {
|
|
84
|
+
* const txHash = await backend.broadcastWithdrawal(input.depositTarget);
|
|
85
|
+
* actions.beginProcessing({ hash: txHash });
|
|
86
|
+
* },
|
|
87
|
+
* });
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
declare function useWithdrawBindings(bindings: WithdrawBindings): void;
|
|
91
|
+
//#endregion
|
|
92
|
+
export { WithdrawBalanceInput, WithdrawBindings, WithdrawSuggestedRecipient, useWithdrawBindings };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{createContext as e,use as t,useEffect as n,useMemo as r,useRef as i,useState as a}from"react";import{jsx as o}from"react/jsx-runtime";const s=e(null);s.displayName=`WithdrawBindingsContext`;function c({children:e}){let[t,n]=a({}),c=i({});return o(s,{value:r(()=>({bindings:t,setBindings:n,ref:c}),[t]),children:e})}function l(){return t(s)?.bindings??{}}function u(){let e=t(s),n=i({});return e?.ref??n}function d(e){let r=t(s),a=e.balance,o=e.onSubmit,c=e.suggestedRecipient;r&&(r.ref.current={...a===void 0?{}:{balance:a},...o?{onSubmit:o}:{},...c?{suggestedRecipient:c}:{}});let l=i(r?.setBindings);l.current=r?.setBindings;let u=i(r?.ref);u.current=r?.ref,n(()=>{let e=l.current;if(e)return e({...a===void 0?{}:{balance:a},...o?{onSubmit:o}:{},...c?{suggestedRecipient:c}:{}}),()=>{let e=l.current,t=u.current;t&&(t.current={}),e&&e({})}},[a,o,c])}export{c as WithdrawBindingsProvider,d as useWithdrawBindings,u as useWithdrawBindingsRef,l as useWithdrawBindingsValue};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { WithdrawBalanceInput, WithdrawBindings, WithdrawSuggestedRecipient, useWithdrawBindings } from "./WithdrawBindings.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./WithdrawBindings.js";
|
|
@@ -1,102 +1,75 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { FailureInfo } from "../../../shared/orchestrator/types.js";
|
|
5
|
-
import { WithdrawStateName } from "../orchestrator/types.js";
|
|
6
|
-
import { WithdrawFormEventCallbacks } from "./WithdrawDialogEventsContext.js";
|
|
1
|
+
import { Presentation } from "../../../shared/presentation/types.js";
|
|
2
|
+
import { WithdrawSubmitCallback } from "../orchestrator/types.js";
|
|
3
|
+
import { WithdrawBalanceInput, WithdrawSuggestedRecipient } from "../bindings/WithdrawBindings.js";
|
|
7
4
|
import { ErrorInfo } from "react";
|
|
8
5
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
9
6
|
|
|
10
7
|
//#region src/flows/withdraw/dialog/WithdrawDialog.d.ts
|
|
11
8
|
/**
|
|
12
|
-
* Top-level withdraw dialog. Mounts inside `<
|
|
13
|
-
*
|
|
9
|
+
* Top-level withdraw dialog. Mounts inside `<StridgeProvider>` and binds open state to the
|
|
10
|
+
* controller's `state.name !== "closed"`.
|
|
14
11
|
*
|
|
15
12
|
* Body switch is keyed off the orchestrator's *effective* state (not logical state) so the
|
|
16
13
|
* widget the user was looking at stays mounted through the dialog's close animation.
|
|
17
14
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
15
|
+
* Lifecycle observability is delivered by the unified event bus exported from
|
|
16
|
+
* `@stridge/kit/events`. The dialog takes no `on*` callback props; subscribe via
|
|
17
|
+
* `useStridgeFlowEvents` / `useStridgeEvents` for analytics or behavioural reactions.
|
|
18
|
+
* `onSubmit` is the host contract — its return value drives the FSM, distinct from any bus
|
|
19
|
+
* event.
|
|
21
20
|
*/
|
|
22
21
|
declare function WithdrawDialog({
|
|
23
22
|
container,
|
|
23
|
+
metadata,
|
|
24
24
|
onError,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
balance,
|
|
26
|
+
onSubmit,
|
|
27
|
+
suggestedRecipient,
|
|
28
|
+
presentation
|
|
29
29
|
}?: WithdrawDialog.Props): _$react_jsx_runtime0.JSX.Element;
|
|
30
30
|
declare namespace WithdrawDialog {
|
|
31
31
|
interface Props {
|
|
32
32
|
/**
|
|
33
33
|
* Element the dialog portals into. Defaults to `document.body` (full-page overlay).
|
|
34
|
-
* Pass a transformed ancestor with `overflow: clip` — e.g. a mobile mockup frame — to
|
|
35
|
-
* scope the dialog's width, height, and backdrop to that rect.
|
|
36
34
|
*/
|
|
37
35
|
container?: HTMLElement | null;
|
|
36
|
+
/**
|
|
37
|
+
* Consumer-attached metadata that rides along on every bus event emitted from this
|
|
38
|
+
* dialog's session. Snapshotted at `withdraw.opened` and frozen for the session.
|
|
39
|
+
*/
|
|
40
|
+
metadata?: Record<string, unknown>;
|
|
38
41
|
/** Forwarded to the dialog's internal {@link GatewayKitBoundary} for crash reporting. */
|
|
39
42
|
onError?: (error: Error, errorInfo: ErrorInfo) => void;
|
|
40
43
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
44
|
+
* Withdrawable balance to display in the form. Either a bare amount in display units
|
|
45
|
+
* (kit short-circuits USD to $1 for known stablecoins) or `{ amount, amountUsd? }`
|
|
46
|
+
* with an explicit pre-computed USD value. Pass `undefined` while loading; the form
|
|
47
|
+
* renders a skeleton until a value arrives.
|
|
43
48
|
*/
|
|
44
|
-
|
|
45
|
-
/** Fires once when the dialog transitions back to `closed`. `atStep` is the last open step. */
|
|
46
|
-
onClosed?: (atStep: WithdrawStateName) => void;
|
|
47
|
-
/** Fires on every logical step transition. */
|
|
48
|
-
onStepChanged?: (event: {
|
|
49
|
-
from: WithdrawStateName;
|
|
50
|
-
to: WithdrawStateName;
|
|
51
|
-
}) => void;
|
|
49
|
+
balance?: WithdrawBalanceInput;
|
|
52
50
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
51
|
+
* Submit handler — fires once the kit has prepared a fresh UDA target for the
|
|
52
|
+
* withdrawal. The host's backend is responsible for broadcasting a transfer of the
|
|
53
|
+
* brand currency to that UDA; the kit hands a `WithdrawSubmitActions` handle the host
|
|
54
|
+
* calls (`beginProcessing` / `setTxHash` / `succeed` / `fail` / `decline`) to advance
|
|
55
|
+
* the FSM. Required when the dialog is used — a missing callback lands the user on
|
|
56
|
+
* the error screen instead of an infinite spinner. This is a contract, not a bus
|
|
57
|
+
* event: return value drives the FSM.
|
|
57
58
|
*/
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
* - **User actions** (`onWithdrawalConfirmed`) — fire when the user submits the form.
|
|
66
|
-
* - **Quote lifecycle** — track the form's quote entity through `loading → ready / error`.
|
|
67
|
-
* - **Submit lifecycle** — track the wagmi-driven broadcast through wagmi → receipt → terminal
|
|
68
|
-
* verdict.
|
|
69
|
-
* - **Settlement entity** — track the gateway's settlement payload through pending / succeeded /
|
|
70
|
-
* failed.
|
|
71
|
-
*/
|
|
72
|
-
interface Events extends WithdrawFormEventCallbacks {
|
|
73
|
-
/** User submitted the form (the SUBMIT action — wallet prompt is about to fire). */
|
|
74
|
-
onWithdrawalConfirmed?: () => void;
|
|
75
|
-
/** Quote entity reached `ready` with the formatted payload. */
|
|
76
|
-
onQuoteResolved?: (quote: WithdrawalQuotePayload) => void;
|
|
77
|
-
/** Quote entity reached `error`. */
|
|
78
|
-
onQuoteFailed?: (failure: {
|
|
79
|
-
reason: string;
|
|
80
|
-
code?: string;
|
|
81
|
-
}) => void;
|
|
82
|
-
/** Wagmi broadcast completed and the orchestrator transitioned into `inProgress`. */
|
|
83
|
-
onWithdrawalSubmitted?: (event: {
|
|
84
|
-
input: SubmitWithdrawalInput;
|
|
85
|
-
tx: TxRef;
|
|
86
|
-
}) => void;
|
|
87
|
-
/** User declined the wallet signature prompt; orchestrator transitioned into `error`. */
|
|
88
|
-
onSignatureDeclined?: () => void;
|
|
89
|
-
/** Submission failed for a non-rejection reason (network, bad input, etc). */
|
|
90
|
-
onSubmissionFailed?: (failure: FailureInfo) => void;
|
|
91
|
-
/** The driver's `settlement` entity emitted a progressive pending update. */
|
|
92
|
-
onProcessingProgress?: (update: WithdrawalSettlementPendingPayload) => void;
|
|
93
|
-
/** Terminal success — settlement entity reached `ready{kind: "succeeded"}`. */
|
|
94
|
-
onSucceeded?: (result: WithdrawalSettlementSuccessPayload) => void;
|
|
59
|
+
onSubmit?: WithdrawSubmitCallback;
|
|
60
|
+
/**
|
|
61
|
+
* Trusted recipient address surfaced as a one-click prefill chip next to the
|
|
62
|
+
* recipient input. The kit no longer auto-derives this from `wagmi.address`. Pass an
|
|
63
|
+
* explicit address you trust the user wants to fill with. Omit to hide the chip.
|
|
64
|
+
*/
|
|
65
|
+
suggestedRecipient?: WithdrawSuggestedRecipient;
|
|
95
66
|
/**
|
|
96
|
-
*
|
|
97
|
-
*
|
|
67
|
+
* Per-dialog surface override. `"auto"` (default) renders a centred dialog on wide
|
|
68
|
+
* containers and a bottom-sheet drawer below the breakpoint; `"dialog"` / `"drawer"`
|
|
69
|
+
* force one surface. Pass `{ mode, breakpoint }` to tune the px threshold (default 600).
|
|
70
|
+
* Wins over the provider's `appearance.presentation`; omit to inherit it.
|
|
98
71
|
*/
|
|
99
|
-
|
|
72
|
+
presentation?: Presentation;
|
|
100
73
|
}
|
|
101
74
|
}
|
|
102
75
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{useWithdrawBindings as e}from"../bindings/WithdrawBindings.js";import"../bindings/index.js";import{useWithdrawSnapshot as t}from"../driver/context.js";import{useWithdrawState as n}from"../orchestrator/controller.js";import{useWithdraw as r}from"../orchestrator/useWithdraw.js";import"../orchestrator/index.js";import{useWithdrawEmissions as i}from"../../../events/emit/useWithdrawEmissions.js";import"../../../events/emit/index.js";import{useIntercomShutdownOnUnmount as a}from"../../../shared/support/useIntercomShutdownOnUnmount.js";import"../../../shared/support/index.js";import{AdaptiveSurface as o}from"../../../shared/ui/AdaptiveSurface/AdaptiveSurface.js";import"../../../shared/ui/AdaptiveSurface/index.js";import{Withdraw as s}from"../widgets/withdraw/compound/Withdraw.js";import"../../../withdraw/compound/index.js";import{WithdrawActivityDetail as c}from"../widgets/activity/WithdrawActivityDetail.js";import{WithdrawActivityList as l}from"../widgets/activity/WithdrawActivityList.js";import{WithdrawError as u}from"../widgets/withdraw-error/WithdrawError.js";import{WithdrawForm as d}from"../widgets/withdraw-form/WithdrawForm.js";import{WithdrawInProgress as f}from"../widgets/withdraw-in-progress/WithdrawInProgress.js";import{WithdrawSuccess as p}from"../widgets/withdraw-success/WithdrawSuccess.js";import"../../../withdraw/widgets/index.js";import{jsx as m,jsxs as h}from"react/jsx-runtime";function g({container:g,metadata:_,onError:v,balance:y,onSubmit:b,suggestedRecipient:x,presentation:S}={}){let C=n(),{close:w}=r(),T=t(),E=C.name!==`closed`;return i({state:C,settlement:T.settlement,quote:T.quote,metadata:_}),a(),e({...y===void 0?{}:{balance:y},...b?{onSubmit:b}:{},...x?{suggestedRecipient:x}:{}}),m(o,{open:E,onOpenChange:e=>e?void 0:w(),container:g,...S?{presentation:S}:{},children:m(s.Boundary,{...v?{onError:v}:{},children:m(s.Guards,{children:h(s.Steps,{children:[m(s.Step,{name:`form`,children:m(d,{})}),m(s.Step,{name:`inProgress`,children:m(f,{})}),m(s.Step,{name:`success`,children:m(p,{})}),m(s.Step,{name:`error`,children:m(u,{})}),m(s.Step,{name:`activityList`,children:m(l,{})}),m(s.Step,{name:`activityDetail`,children:m(c,{})})]})})})})}export{g as WithdrawDialog};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GatewaySettlementDto, GatewayUdaDto, OnchainBalanceResponse, QuoteResponse, SupportedAssetDto, SupportedAssetsResponse } from "@stridge/sdk";
|
|
2
2
|
|
|
3
3
|
//#region src/flows/withdraw/driver/dto.d.ts
|
|
4
4
|
/**
|
|
@@ -22,18 +22,19 @@ type WithdrawalQuoteResponse = QuoteResponse;
|
|
|
22
22
|
*/
|
|
23
23
|
type WithdrawalSettlementDto = GatewaySettlementDto;
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
26
|
-
* `response` slot on the settlement entity envelope so headless integrators can correlate
|
|
27
|
-
* the UDA-level destination metadata.
|
|
25
|
+
* Per-UDA view from `gateway/{owner}`. Carries the UDA's `destination` plus `settlements[]`. Used
|
|
26
|
+
* as the `response` slot on the settlement entity envelope so headless integrators can correlate
|
|
27
|
+
* against the UDA-level destination metadata. The kit's `pollOnce` boundary picks the matching
|
|
28
|
+
* UDA out of the gateway's multi-UDA envelope before this type is observed downstream.
|
|
28
29
|
*/
|
|
29
|
-
type WithdrawalSettlementResponse =
|
|
30
|
+
type WithdrawalSettlementResponse = GatewayUdaDto;
|
|
30
31
|
/**
|
|
31
|
-
* Per-network entry from `
|
|
32
|
+
* Per-network entry from `Gateway.assets()`. Surfaced as the `raw` slot on the
|
|
32
33
|
* `receiveOptions` entity so headless integrators can navigate the catalog without re-fetching.
|
|
33
34
|
*/
|
|
34
35
|
type ReceiveOptionDto = SupportedAssetDto;
|
|
35
36
|
/**
|
|
36
|
-
* Full `
|
|
37
|
+
* Full `Gateway.assets()` response. Drives the receive chain + receive token dropdowns on
|
|
37
38
|
* the form.
|
|
38
39
|
*/
|
|
39
40
|
type ReceiveOptionsResponse = SupportedAssetsResponse;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { SettlementFailureKind } from "../../../shared/driver/types.js";
|
|
2
2
|
import { FormattedField } from "../../../shared/format/types.js";
|
|
3
|
+
import { ChainType } from "../../../shared/chains/index.js";
|
|
4
|
+
|
|
3
5
|
//#region src/flows/withdraw/driver/payloads.d.ts
|
|
4
6
|
/**
|
|
5
7
|
* Per-asset balance available to withdraw — the brand-managed source the cash-out flow draws
|
|
@@ -108,6 +110,12 @@ interface WithdrawalSettlementPendingPayload {
|
|
|
108
110
|
kind: "pending";
|
|
109
111
|
receiveAsset: WithdrawalReceiveAssetPayload;
|
|
110
112
|
receiveAmount: FormattedField<number>;
|
|
113
|
+
/**
|
|
114
|
+
* USD value of `receiveAmount` at the settlement leg's price snapshot. Sourced from the
|
|
115
|
+
* gateway leg's `amount_usd` (`to` preferred, `from` fallback). Omitted when neither leg
|
|
116
|
+
* carries a priced amount — the in-progress hero then falls back to the quote's USD figure.
|
|
117
|
+
*/
|
|
118
|
+
receiveAmountUsd?: FormattedField<number>;
|
|
111
119
|
/** Recipient address — the destination the user supplied on the form. */
|
|
112
120
|
recipient: FormattedField<string>;
|
|
113
121
|
/** Unix-ms timestamp when the withdrawal was submitted. */
|
|
@@ -191,8 +199,15 @@ interface ReceiveChainPayload {
|
|
|
191
199
|
networkId: string;
|
|
192
200
|
/** Human-readable network name (e.g. `"Polygon"`). */
|
|
193
201
|
networkName: string;
|
|
194
|
-
/** EIP-155 chain id (numeric). */
|
|
202
|
+
/** EIP-155 chain id (numeric). Only meaningful when `chainType === "evm"`. */
|
|
195
203
|
eip155Id: number;
|
|
204
|
+
/**
|
|
205
|
+
* Chain family this network belongs to — driver-populated from the gateway's `chain_type`
|
|
206
|
+
* tag. The withdraw form drives recipient-address validation off this so a non-EVM receive
|
|
207
|
+
* chain accepts its own address shape instead of the EVM `0x…` form. Drivers that can't
|
|
208
|
+
* determine the family tag it `"unknown"`, which keeps the address gate permissive.
|
|
209
|
+
*/
|
|
210
|
+
chainType: ChainType;
|
|
196
211
|
/** Resolved chain icon URL — derived from the chain's native_currency.logo. */
|
|
197
212
|
chainLogoUrl?: string;
|
|
198
213
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{classifyFailureKind as e,classifySettlementStatus as t}from"../../../shared/transformers/classifySettlementStatus.js";import{parseDecimalSafe as n,parseSmallestUnit as r}from"../../../shared/transformers/parseSmallestUnit.js";import{parseIsoMs as i}from"../../../shared/transformers/parseIsoMs.js";import{formatDurationCompact as a}from"../../../../shared/format/formatDurationCompact.js";import{formatTimestamp as o}from"../../../../shared/format/formatTimestamp.js";import{formatTokenAmount as s}from"../../../../shared/format/formatTokenAmount.js";import{
|
|
1
|
+
import{classifyFailureKind as e,classifySettlementStatus as t}from"../../../shared/transformers/classifySettlementStatus.js";import{parseDecimalSafe as n,parseSmallestUnit as r}from"../../../shared/transformers/parseSmallestUnit.js";import{parseIsoMs as i}from"../../../shared/transformers/parseIsoMs.js";import{formatDurationCompact as a}from"../../../../shared/format/formatDurationCompact.js";import{formatTimestamp as o}from"../../../../shared/format/formatTimestamp.js";import{formatTokenAmount as s}from"../../../../shared/format/formatTokenAmount.js";import{formatUsd as c}from"../../../../shared/format/formatUsd.js";import{shortenAddress as l}from"../../../../shared/format/shortenAddress.js";function u(e,n,r){let i=t(e.status);return i===`completed`?f(e,n,r):i===`failed`?p(e,n,r):d(e,n,r)}function d(e,t,r){let a=e.from,u=e.to,d=i(a?.confirmed_at)??i(e.created_at)??Date.now(),f=m(t,r),p=g(u,t,r),v=h(u,p),y=n(u?.amount_usd)||n(a?.amount_usd),b=t.destination.address,x=a?.tx_id,S=a?.eip155_id===void 0?void 0:Number(a.eip155_id);return{kind:`pending`,receiveAsset:f,receiveAmount:{value:v,formatted:s(v,r.i18n,{maxDecimals:p})},...y>0?{receiveAmountUsd:{value:y,formatted:c(y,r.i18n)}}:{},recipient:{value:b,formatted:l(b)},submittedAt:{value:d,formatted:o(d,r.i18n)},...x?{txHash:{value:x,formatted:l(x)},..._(r,S,x)?{txExplorerUrl:_(r,S,x)}:{}}:{}}}function f(e,t,n){let r=e.from,c=e.to,u=i(r?.confirmed_at)??i(e.created_at)??Date.now(),d=i(c?.settled_at)??i(e.updated_at)??Date.now(),f=Math.max(0,d-u),p=Math.round(f/1e3),y=m(t,n),b=g(c,t,n),x=h(c,b),S=t.destination.address,C=r?.tx_id??``,w=r?.eip155_id===void 0?void 0:Number(r.eip155_id),T=c?.tx_id,E=_(n,v(c?.eip155_id)??v(t.destination.eip155_id),T);return{kind:`succeeded`,receiveAsset:y,receiveAmount:{value:x,formatted:s(x,n.i18n,{maxDecimals:b})},recipient:{value:S,formatted:l(S)},submittedAt:{value:u,formatted:o(u,n.i18n)},filledAt:{value:d,formatted:o(d,n.i18n)},totalTime:{value:p,formatted:a(f,n.i18n)},txHash:{value:C,formatted:C?l(C):``},..._(n,w,C)?{txExplorerUrl:_(n,w,C)}:{},...T?{completionTx:{hash:{value:T,formatted:l(T)},...E?{explorerUrl:E}:{}}}:{}}}function p(t,n,r){let a=t.from,c=i(a?.confirmed_at)??i(t.created_at)??Date.now(),u=i(t.updated_at)??Date.now(),d=m(n,r),f=n.destination.address,p=a?.tx_id,h=a?.eip155_id===void 0?void 0:Number(a.eip155_id);return{kind:`failed`,failureKind:e(t.error),receiveAsset:d,receiveAmount:{value:0,formatted:s(0,r.i18n)},recipient:{value:f,formatted:l(f)},submittedAt:{value:c,formatted:o(c,r.i18n)},failedAt:{value:u,formatted:o(u,r.i18n)},...p?{txHash:{value:p,formatted:l(p)},..._(r,h,p)?{txExplorerUrl:_(r,h,p)}:{}}:{}}}function m(e,t){let n=t.receiveAssetEnrichment,r=Number(e.destination.eip155_id);return{symbol:e.destination.asset_symbol,decimals:e.destination.asset_decimals,address:e.destination.asset_address,isNative:!e.destination.asset_address,...n?.assetLogoUrl?{assetLogoUrl:n.assetLogoUrl}:{},networkId:e.destination.network_id,networkName:n?.networkName??e.destination.network_name,...Number.isFinite(r)?{eip155Id:e.destination.eip155_id}:{},...n?.chainLogoUrl?{chainLogoUrl:n.chainLogoUrl}:{}}}function h(e,t){if(!e)return 0;if(e.amount){let t=n(e.amount);if(t>0)return t}return e.raw_amount?r(e.raw_amount,t):0}function g(e,t,n){return n.receiveAssetDecimals??e?.asset_decimals??t.destination.asset_decimals}function _(e,t,n){if(!n||t===void 0)return;let r=e.explorers?.[t];if(r)return`${r.replace(/\/+$/,``)}/tx/${n}`}function v(e){if(e==null||e===``)return;let t=Number(e);return Number.isFinite(t)?t:void 0}export{u as settlementToWithdrawalPayload};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{toChainType as e}from"../../../../shared/chains/index.js";import{formatNetworkName as t}from"../../../../shared/format/formatNetworkName.js";function n(n,r={}){let i=r.excludedChainIds,a=[];for(let r of n.assets){if(i?.has(r.eip155_id))continue;let n=r.native_currency,o=new Set,s=(e,t)=>`${e.toUpperCase()}@${t.toLowerCase()}`,c=[];if(n?.symbol){let e={symbol:n.symbol,name:n.name??n.symbol,address:``,decimals:typeof n.decimals==`number`?n.decimals:18,isNative:!0,...n.logo?{assetLogoUrl:n.logo}:{}};c.push(e),o.add(s(e.symbol,e.address))}let l=n?.symbol?.toUpperCase();for(let e of r.assets){if(!e.symbol||!e.address||l&&e.symbol.toUpperCase()===l)continue;let t=s(e.symbol,e.address);o.has(t)||(o.add(t),c.push({symbol:e.symbol,name:e.name??e.symbol,address:e.address,decimals:e.decimals,isNative:!1,...e.logo?{assetLogoUrl:e.logo}:{}}))}c.length!==0&&a.push({networkId:r.network_id,networkName:t(r.network_name),eip155Id:r.eip155_id,chainType:e(r.chain_type),...n?.logo?{chainLogoUrl:n.logo}:{},tokens:c})}return a.sort((e,t)=>e.eip155Id-t.eip155Id),a}export{n as supportedAssetsToReceiveOptionsPayload};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Entity, SettlementFailureKind, TxRef } from "../../../shared/driver/types.js";
|
|
2
|
+
import { FormattedField } from "../../../shared/format/types.js";
|
|
2
3
|
import { ReceiveOptionDto, ReceiveOptionsResponse, WithdrawableBalanceDto, WithdrawableBalancesResponse, WithdrawalQuoteDto, WithdrawalQuoteResponse, WithdrawalSettlementDto, WithdrawalSettlementResponse } from "./dto.js";
|
|
3
4
|
import { ReceiveChainPayload, ReceiveTokenOptionPayload, WithdrawableBalanceItemPayload, WithdrawalQuoteBreakdownPayload, WithdrawalQuotePayload, WithdrawalReceiveAssetPayload, WithdrawalSettlementFailurePayload, WithdrawalSettlementPayload, WithdrawalSettlementPendingPayload, WithdrawalSettlementSuccessPayload } from "./payloads.js";
|
|
4
5
|
|
|
@@ -8,8 +9,9 @@ import { ReceiveChainPayload, ReceiveTokenOptionPayload, WithdrawableBalanceItem
|
|
|
8
9
|
* {@link WithdrawDriver.getSnapshot} and consumed by `useSyncExternalStore`. The kit's
|
|
9
10
|
* `useWithdrawSnapshot()` hook returns this shape.
|
|
10
11
|
*
|
|
11
|
-
*
|
|
12
|
-
* the `ready` / `stale` variants.
|
|
12
|
+
* Most fields are {@link Entity} envelopes — components switch on `status` and read `payload` on
|
|
13
|
+
* the `ready` / `stale` variants. The optional `minAmountUsd` / `maxAmountUsd` carry static
|
|
14
|
+
* config-derived USD bounds (set once at driver construction) and stay outside the entity model.
|
|
13
15
|
*/
|
|
14
16
|
interface WithdrawSnapshot {
|
|
15
17
|
/**
|
|
@@ -23,7 +25,7 @@ interface WithdrawSnapshot {
|
|
|
23
25
|
withdrawableBalances: Entity<ReadonlyArray<WithdrawableBalanceItemPayload>, WithdrawableBalancesResponse, WithdrawableBalancesResponse>;
|
|
24
26
|
/**
|
|
25
27
|
* Per-chain catalog of routable receive destinations. Drives the form's "Receive chain" /
|
|
26
|
-
* "Receive token" pickers. Derived from `
|
|
28
|
+
* "Receive token" pickers. Derived from `Gateway.assets()`.
|
|
27
29
|
*/
|
|
28
30
|
receiveOptions: Entity<ReadonlyArray<ReceiveChainPayload>, ReadonlyArray<ReceiveOptionDto>, ReceiveOptionsResponse>;
|
|
29
31
|
/**
|
|
@@ -37,6 +39,18 @@ interface WithdrawSnapshot {
|
|
|
37
39
|
* error state screen renders.
|
|
38
40
|
*/
|
|
39
41
|
settlement: Entity<WithdrawalSettlementPayload, WithdrawalSettlementDto, WithdrawalSettlementResponse>;
|
|
42
|
+
/**
|
|
43
|
+
* Optional lower USD bound on the withdraw amount. The withdraw form blocks submit with a
|
|
44
|
+
* localized "Min $X" CTA when the typed amount sits below `value`. Set from
|
|
45
|
+
* `<StridgeProvider flows.withdraw.minAmountUsd>` and constant across the driver's lifetime.
|
|
46
|
+
*/
|
|
47
|
+
minAmountUsd?: FormattedField<number>;
|
|
48
|
+
/**
|
|
49
|
+
* Optional upper USD bound on the withdraw amount. The withdraw form blocks submit with a
|
|
50
|
+
* localized "Max $X" CTA when the typed amount sits above `value`. Set from
|
|
51
|
+
* `<StridgeProvider flows.withdraw.maxAmountUsd>` and constant across the driver's lifetime.
|
|
52
|
+
*/
|
|
53
|
+
maxAmountUsd?: FormattedField<number>;
|
|
40
54
|
}
|
|
41
55
|
/**
|
|
42
56
|
* Input to {@link WithdrawDriver.requestQuote}. The form widget builds this from current field
|
|
@@ -57,17 +71,57 @@ interface RequestWithdrawalQuoteInput {
|
|
|
57
71
|
recipientAddress: string;
|
|
58
72
|
}
|
|
59
73
|
/**
|
|
60
|
-
* Input to {@link WithdrawDriver.
|
|
61
|
-
* — the live driver re-uses the most recent quote for
|
|
62
|
-
* scope both calls.
|
|
74
|
+
* Input to {@link WithdrawDriver.prepareWithdrawal}. Identical to {@link RequestWithdrawalQuoteInput}
|
|
75
|
+
* — the live driver re-uses the most recent quote shape for the gateway/start call, so the same
|
|
76
|
+
* identifying fields scope both calls.
|
|
63
77
|
*/
|
|
64
|
-
type
|
|
78
|
+
type PrepareWithdrawalInput = RequestWithdrawalQuoteInput;
|
|
65
79
|
/**
|
|
66
|
-
*
|
|
67
|
-
*
|
|
80
|
+
* Result of {@link WithdrawDriver.prepareWithdrawal}. Carries everything the host's `onSubmit`
|
|
81
|
+
* callback needs to broadcast a transfer to the Stridge UDA on the brand-currency chain — the
|
|
82
|
+
* UDA address, the chain, the token, the amount — plus the Stridge correlation fields the host
|
|
83
|
+
* may want to mirror into their own backend logs.
|
|
84
|
+
*/
|
|
85
|
+
interface WithdrawPreparation {
|
|
86
|
+
/**
|
|
87
|
+
* Where the host should send brand-currency funds. The kit has already provisioned a UDA
|
|
88
|
+
* (via `gateway/start`); the host's job is to broadcast a single on-chain transfer of
|
|
89
|
+
* `amount` of `tokenSymbol` from their treasury / custodial wallet to `address` on `chainId`.
|
|
90
|
+
* Stridge takes over from there to bridge into the user's chosen recipient/chain/token.
|
|
91
|
+
*/
|
|
92
|
+
depositTarget: {
|
|
93
|
+
/** UDA deposit address on the brand-currency chain. */address: string; /** EIP-155 chain id of the brand-currency network. */
|
|
94
|
+
chainId: number; /** Brand-currency token symbol (e.g. `"USDC"`). */
|
|
95
|
+
tokenSymbol: string; /** ERC-20 contract address of the brand currency. Empty string for native gas tokens. */
|
|
96
|
+
tokenAddress: string; /** On-chain decimal precision (e.g. `6` for USDC on Ethereum, `18` for ETH). */
|
|
97
|
+
tokenDecimals: number; /** `true` when the brand currency is the chain's native gas token. */
|
|
98
|
+
isNative: boolean; /** Exact amount to transfer, in display units (kit-managed decimals already factored in). */
|
|
99
|
+
amount: number;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Stridge correlation slot the host can pass through to their own backend / logs. `owner`
|
|
103
|
+
* is the same value the kit threaded into `gateway/start.owner` for this UDA.
|
|
104
|
+
*/
|
|
105
|
+
correlation: {
|
|
106
|
+
owner: string;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Input to {@link WithdrawDriver.watchSettlement}. `tx` is optional — when the host has
|
|
111
|
+
* surfaced a broadcast tx hash via the orchestrator's `setTxHash` action, the watcher anchors
|
|
112
|
+
* to it for precise matching. When omitted, the watcher falls back to a best-match heuristic
|
|
113
|
+
* (destination tuple + amount tolerance + submit-time window) so the kit can find the relevant
|
|
114
|
+
* settlement even if the host never surfaces a tx hash.
|
|
68
115
|
*/
|
|
69
116
|
interface WatchWithdrawalSettlementInput {
|
|
70
|
-
tx
|
|
117
|
+
tx?: TxRef;
|
|
118
|
+
/**
|
|
119
|
+
* Form snapshot at submit time. The driver uses this in best-match mode to filter
|
|
120
|
+
* `gateway/{owner}` to settlements whose destination matches the user's selection.
|
|
121
|
+
*/
|
|
122
|
+
form: RequestWithdrawalQuoteInput;
|
|
123
|
+
/** Unix-ms timestamp the host called `beginProcessing` — the start of the matching window. */
|
|
124
|
+
submittedAt: number;
|
|
71
125
|
}
|
|
72
126
|
/**
|
|
73
127
|
* Input to {@link WithdrawDriver.watchWithdrawableBalances}. Optional listener — the form's
|
|
@@ -107,16 +161,25 @@ interface WithdrawDriver {
|
|
|
107
161
|
getSnapshot(): WithdrawSnapshot;
|
|
108
162
|
/** Subscribe to entity transitions outside React (analytics, headless integrations). */
|
|
109
163
|
subscribe(listener: () => void): () => void;
|
|
164
|
+
/**
|
|
165
|
+
* Idempotent bootstrap trigger. The kit calls this from `useWithdraw().open()` and the
|
|
166
|
+
* headless `usePrefetchWithdraw()` hook. First call kicks off any deferred network work
|
|
167
|
+
* (e.g. `supportedAssets` + the initial `balance/onchain` fetch); subsequent calls are
|
|
168
|
+
* no-ops while bootstrap is in flight or completed.
|
|
169
|
+
*/
|
|
170
|
+
arm(): void;
|
|
110
171
|
/**
|
|
111
172
|
* Fetches a fresh quote for `input` and updates the `quote` entity through its lifecycle
|
|
112
173
|
* (`idle | loading → ready | error`). The `signal` cancels in-flight work.
|
|
113
174
|
*/
|
|
114
175
|
requestQuote(input: RequestWithdrawalQuoteInput, signal: AbortSignal): Promise<void>;
|
|
115
176
|
/**
|
|
116
|
-
*
|
|
117
|
-
*
|
|
177
|
+
* Provisions a fresh UDA for this withdrawal (via `gateway/start`) and returns the deposit
|
|
178
|
+
* target + Stridge correlation slot for the host's `onSubmit` callback to act on. The kit
|
|
179
|
+
* never signs the withdraw transfer itself — the host's backend (treasury wallet, custodial
|
|
180
|
+
* signer, hot-wallet service) does. See {@link WithdrawPreparation}.
|
|
118
181
|
*/
|
|
119
|
-
|
|
182
|
+
prepareWithdrawal(input: PrepareWithdrawalInput, signal: AbortSignal): Promise<WithdrawPreparation>;
|
|
120
183
|
/**
|
|
121
184
|
* Watches the settlement entity through its lifecycle (pending → succeeded / failed). The
|
|
122
185
|
* listener fires on every transition with the new envelope; the FSM consumes these via the
|
|
@@ -130,4 +193,4 @@ interface WithdrawDriver {
|
|
|
130
193
|
watchWithdrawableBalances?(input: WatchWithdrawableBalancesInput, listener: (entity: WithdrawSnapshot["withdrawableBalances"]) => void, signal: AbortSignal): void;
|
|
131
194
|
}
|
|
132
195
|
//#endregion
|
|
133
|
-
export {
|
|
196
|
+
export { PrepareWithdrawalInput, RequestWithdrawalQuoteInput, WatchWithdrawableBalancesInput, WatchWithdrawalSettlementInput, WithdrawDriver, WithdrawPreparation, WithdrawSnapshot };
|