@swype-org/react-sdk 0.1.56 → 0.1.63
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/dist/index.cjs +421 -59
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +38 -5
- package/dist/index.d.ts +38 -5
- package/dist/index.js +420 -60
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -199,7 +199,7 @@ interface UserConfig {
|
|
|
199
199
|
/** Theme mode */
|
|
200
200
|
type ThemeMode = 'light' | 'dark';
|
|
201
201
|
/** Steps in the payment flow */
|
|
202
|
-
type PaymentStep = 'login' | 'otp-verify' | 'create-passkey' | 'wallet-picker' | 'open-wallet' | 'deposit' | 'low-balance' | 'processing' | 'select-source' | 'success';
|
|
202
|
+
type PaymentStep = 'login' | 'otp-verify' | 'create-passkey' | 'wallet-picker' | 'open-wallet' | 'confirm-sign' | 'deposit' | 'low-balance' | 'processing' | 'select-source' | 'success';
|
|
203
203
|
/** User-selected advanced settings for chain/asset override */
|
|
204
204
|
interface AdvancedSettings {
|
|
205
205
|
/** Override asset (e.g. 'USDC', 'USDT'). Null = let backend decide. */
|
|
@@ -622,6 +622,18 @@ interface SpinnerProps {
|
|
|
622
622
|
}
|
|
623
623
|
declare function Spinner({ size, label }: SpinnerProps): react_jsx_runtime.JSX.Element;
|
|
624
624
|
|
|
625
|
+
interface CreatePasskeyScreenProps {
|
|
626
|
+
onCreatePasskey: () => void;
|
|
627
|
+
onBack?: () => void;
|
|
628
|
+
creating: boolean;
|
|
629
|
+
error: string | null;
|
|
630
|
+
/** When true, direct passkey creation failed (Safari iframe restriction). */
|
|
631
|
+
popupFallback?: boolean;
|
|
632
|
+
/** Opens a pop-up window on the Swype domain for passkey registration. */
|
|
633
|
+
onCreatePasskeyViaPopup?: () => void;
|
|
634
|
+
}
|
|
635
|
+
declare function CreatePasskeyScreen({ onCreatePasskey, onBack, creating, error, popupFallback, onCreatePasskeyViaPopup, }: CreatePasskeyScreenProps): react_jsx_runtime.JSX.Element;
|
|
636
|
+
|
|
625
637
|
interface SetupScreenProps {
|
|
626
638
|
availableBalance: number;
|
|
627
639
|
/** Number of tokens/chains available */
|
|
@@ -631,12 +643,16 @@ interface SetupScreenProps {
|
|
|
631
643
|
onSetupOneTap: (limit: number) => void;
|
|
632
644
|
onBack: () => void;
|
|
633
645
|
onLogout: () => void;
|
|
646
|
+
/** Navigate to the advanced source picker. */
|
|
647
|
+
onAdvanced?: () => void;
|
|
648
|
+
/** Human-readable label for the currently selected source (e.g. "USDC on Base"). */
|
|
649
|
+
selectedSourceLabel?: string;
|
|
634
650
|
loading?: boolean;
|
|
635
651
|
error: string | null;
|
|
636
652
|
}
|
|
637
|
-
declare function SetupScreen({ availableBalance, tokenCount, sourceName, onSetupOneTap, onBack, onLogout, loading, error, }: SetupScreenProps): react_jsx_runtime.JSX.Element;
|
|
653
|
+
declare function SetupScreen({ availableBalance, tokenCount, sourceName, onSetupOneTap, onBack, onLogout, onAdvanced, selectedSourceLabel, loading, error, }: SetupScreenProps): react_jsx_runtime.JSX.Element;
|
|
638
654
|
|
|
639
|
-
interface ChainChoice {
|
|
655
|
+
interface ChainChoice$1 {
|
|
640
656
|
chainName: string;
|
|
641
657
|
balance: number;
|
|
642
658
|
tokens: {
|
|
@@ -645,7 +661,7 @@ interface ChainChoice {
|
|
|
645
661
|
}[];
|
|
646
662
|
}
|
|
647
663
|
interface SelectSourceScreenProps {
|
|
648
|
-
choices: ChainChoice[];
|
|
664
|
+
choices: ChainChoice$1[];
|
|
649
665
|
selectedChainName: string;
|
|
650
666
|
selectedTokenSymbol: string;
|
|
651
667
|
recommended: {
|
|
@@ -659,4 +675,21 @@ interface SelectSourceScreenProps {
|
|
|
659
675
|
}
|
|
660
676
|
declare function SelectSourceScreen({ choices, selectedChainName, selectedTokenSymbol, recommended, onChainChange, onTokenChange, onConfirm, onLogout, }: SelectSourceScreenProps): react_jsx_runtime.JSX.Element;
|
|
661
677
|
|
|
662
|
-
|
|
678
|
+
interface ChainChoice {
|
|
679
|
+
chainName: string;
|
|
680
|
+
balance: number;
|
|
681
|
+
tokens: {
|
|
682
|
+
tokenSymbol: string;
|
|
683
|
+
balance: number;
|
|
684
|
+
}[];
|
|
685
|
+
}
|
|
686
|
+
interface AdvancedSourceScreenProps {
|
|
687
|
+
choices: ChainChoice[];
|
|
688
|
+
selectedChainName: string;
|
|
689
|
+
selectedTokenSymbol: string;
|
|
690
|
+
onSelectSource: (chainName: string, tokenSymbol: string) => void;
|
|
691
|
+
onBack: () => void;
|
|
692
|
+
}
|
|
693
|
+
declare function AdvancedSourceScreen({ choices, selectedChainName, selectedTokenSymbol, onSelectSource, onBack, }: AdvancedSourceScreenProps): react_jsx_runtime.JSX.Element;
|
|
694
|
+
|
|
695
|
+
export { type Account, type ActionExecutionResult, type AdvancedSettings, AdvancedSourceScreen, type Amount, type AuthorizationAction, type AuthorizationSession, type AuthorizationSessionDetail, type Chain, CreatePasskeyScreen, type Destination, type ErrorResponse, IconCircle, type ListResponse, type MerchantAuthorization, type MerchantPublicKey, OutlineButton, PasskeyIframeBlockedError, type PaymentStep, PoweredByFooter, PrimaryButton, type Provider, ScreenHeader, ScreenLayout, SelectSourceScreen, SettingsMenu, SetupScreen, type SourceOption, type SourceSelection, type SourceType, Spinner, type StepItem, StepList, SwypePayment, type SwypePaymentProps, SwypeProvider, type SwypeProviderProps, type ThemeMode, type ThemeTokens, type TokenBalance, type Transfer, type TransferDestination, type UserConfig, type Wallet, type WalletSource, type WalletToken, buildPasskeyPopupOptions, createPasskeyCredential, createPasskeyViaPopup, darkTheme, deviceHasPasskey, findDevicePasskey, getTheme, lightTheme, api as swypeApi, useAuthorizationExecutor, useSwypeConfig, useSwypeDepositAmount, useTransferPolling, useTransferSigning };
|
package/dist/index.d.ts
CHANGED
|
@@ -199,7 +199,7 @@ interface UserConfig {
|
|
|
199
199
|
/** Theme mode */
|
|
200
200
|
type ThemeMode = 'light' | 'dark';
|
|
201
201
|
/** Steps in the payment flow */
|
|
202
|
-
type PaymentStep = 'login' | 'otp-verify' | 'create-passkey' | 'wallet-picker' | 'open-wallet' | 'deposit' | 'low-balance' | 'processing' | 'select-source' | 'success';
|
|
202
|
+
type PaymentStep = 'login' | 'otp-verify' | 'create-passkey' | 'wallet-picker' | 'open-wallet' | 'confirm-sign' | 'deposit' | 'low-balance' | 'processing' | 'select-source' | 'success';
|
|
203
203
|
/** User-selected advanced settings for chain/asset override */
|
|
204
204
|
interface AdvancedSettings {
|
|
205
205
|
/** Override asset (e.g. 'USDC', 'USDT'). Null = let backend decide. */
|
|
@@ -622,6 +622,18 @@ interface SpinnerProps {
|
|
|
622
622
|
}
|
|
623
623
|
declare function Spinner({ size, label }: SpinnerProps): react_jsx_runtime.JSX.Element;
|
|
624
624
|
|
|
625
|
+
interface CreatePasskeyScreenProps {
|
|
626
|
+
onCreatePasskey: () => void;
|
|
627
|
+
onBack?: () => void;
|
|
628
|
+
creating: boolean;
|
|
629
|
+
error: string | null;
|
|
630
|
+
/** When true, direct passkey creation failed (Safari iframe restriction). */
|
|
631
|
+
popupFallback?: boolean;
|
|
632
|
+
/** Opens a pop-up window on the Swype domain for passkey registration. */
|
|
633
|
+
onCreatePasskeyViaPopup?: () => void;
|
|
634
|
+
}
|
|
635
|
+
declare function CreatePasskeyScreen({ onCreatePasskey, onBack, creating, error, popupFallback, onCreatePasskeyViaPopup, }: CreatePasskeyScreenProps): react_jsx_runtime.JSX.Element;
|
|
636
|
+
|
|
625
637
|
interface SetupScreenProps {
|
|
626
638
|
availableBalance: number;
|
|
627
639
|
/** Number of tokens/chains available */
|
|
@@ -631,12 +643,16 @@ interface SetupScreenProps {
|
|
|
631
643
|
onSetupOneTap: (limit: number) => void;
|
|
632
644
|
onBack: () => void;
|
|
633
645
|
onLogout: () => void;
|
|
646
|
+
/** Navigate to the advanced source picker. */
|
|
647
|
+
onAdvanced?: () => void;
|
|
648
|
+
/** Human-readable label for the currently selected source (e.g. "USDC on Base"). */
|
|
649
|
+
selectedSourceLabel?: string;
|
|
634
650
|
loading?: boolean;
|
|
635
651
|
error: string | null;
|
|
636
652
|
}
|
|
637
|
-
declare function SetupScreen({ availableBalance, tokenCount, sourceName, onSetupOneTap, onBack, onLogout, loading, error, }: SetupScreenProps): react_jsx_runtime.JSX.Element;
|
|
653
|
+
declare function SetupScreen({ availableBalance, tokenCount, sourceName, onSetupOneTap, onBack, onLogout, onAdvanced, selectedSourceLabel, loading, error, }: SetupScreenProps): react_jsx_runtime.JSX.Element;
|
|
638
654
|
|
|
639
|
-
interface ChainChoice {
|
|
655
|
+
interface ChainChoice$1 {
|
|
640
656
|
chainName: string;
|
|
641
657
|
balance: number;
|
|
642
658
|
tokens: {
|
|
@@ -645,7 +661,7 @@ interface ChainChoice {
|
|
|
645
661
|
}[];
|
|
646
662
|
}
|
|
647
663
|
interface SelectSourceScreenProps {
|
|
648
|
-
choices: ChainChoice[];
|
|
664
|
+
choices: ChainChoice$1[];
|
|
649
665
|
selectedChainName: string;
|
|
650
666
|
selectedTokenSymbol: string;
|
|
651
667
|
recommended: {
|
|
@@ -659,4 +675,21 @@ interface SelectSourceScreenProps {
|
|
|
659
675
|
}
|
|
660
676
|
declare function SelectSourceScreen({ choices, selectedChainName, selectedTokenSymbol, recommended, onChainChange, onTokenChange, onConfirm, onLogout, }: SelectSourceScreenProps): react_jsx_runtime.JSX.Element;
|
|
661
677
|
|
|
662
|
-
|
|
678
|
+
interface ChainChoice {
|
|
679
|
+
chainName: string;
|
|
680
|
+
balance: number;
|
|
681
|
+
tokens: {
|
|
682
|
+
tokenSymbol: string;
|
|
683
|
+
balance: number;
|
|
684
|
+
}[];
|
|
685
|
+
}
|
|
686
|
+
interface AdvancedSourceScreenProps {
|
|
687
|
+
choices: ChainChoice[];
|
|
688
|
+
selectedChainName: string;
|
|
689
|
+
selectedTokenSymbol: string;
|
|
690
|
+
onSelectSource: (chainName: string, tokenSymbol: string) => void;
|
|
691
|
+
onBack: () => void;
|
|
692
|
+
}
|
|
693
|
+
declare function AdvancedSourceScreen({ choices, selectedChainName, selectedTokenSymbol, onSelectSource, onBack, }: AdvancedSourceScreenProps): react_jsx_runtime.JSX.Element;
|
|
694
|
+
|
|
695
|
+
export { type Account, type ActionExecutionResult, type AdvancedSettings, AdvancedSourceScreen, type Amount, type AuthorizationAction, type AuthorizationSession, type AuthorizationSessionDetail, type Chain, CreatePasskeyScreen, type Destination, type ErrorResponse, IconCircle, type ListResponse, type MerchantAuthorization, type MerchantPublicKey, OutlineButton, PasskeyIframeBlockedError, type PaymentStep, PoweredByFooter, PrimaryButton, type Provider, ScreenHeader, ScreenLayout, SelectSourceScreen, SettingsMenu, SetupScreen, type SourceOption, type SourceSelection, type SourceType, Spinner, type StepItem, StepList, SwypePayment, type SwypePaymentProps, SwypeProvider, type SwypeProviderProps, type ThemeMode, type ThemeTokens, type TokenBalance, type Transfer, type TransferDestination, type UserConfig, type Wallet, type WalletSource, type WalletToken, buildPasskeyPopupOptions, createPasskeyCredential, createPasskeyViaPopup, darkTheme, deviceHasPasskey, findDevicePasskey, getTheme, lightTheme, api as swypeApi, useAuthorizationExecutor, useSwypeConfig, useSwypeDepositAmount, useTransferPolling, useTransferSigning };
|