@swype-org/react-sdk 0.1.110 → 0.1.114
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 +596 -56
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -3
- package/dist/index.d.ts +23 -3
- package/dist/index.js +596 -57
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -26,6 +26,8 @@ interface WalletToken {
|
|
|
26
26
|
/** A token source within a wallet (e.g. USDC on a specific chain) */
|
|
27
27
|
interface WalletSource {
|
|
28
28
|
id: string;
|
|
29
|
+
/** On-chain ERC-20 contract address (e.g. 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913) */
|
|
30
|
+
address: string;
|
|
29
31
|
token: WalletToken;
|
|
30
32
|
balance: TokenBalance;
|
|
31
33
|
}
|
|
@@ -78,6 +80,8 @@ interface AuthorizationSessionDetail {
|
|
|
78
80
|
id: string;
|
|
79
81
|
status: string;
|
|
80
82
|
uri: string;
|
|
83
|
+
selectedTokenAddress?: string;
|
|
84
|
+
selectedChainId?: number;
|
|
81
85
|
actions: AuthorizationAction[];
|
|
82
86
|
}
|
|
83
87
|
/** Monetary amount */
|
|
@@ -202,7 +206,7 @@ interface UserConfig {
|
|
|
202
206
|
/** Theme mode */
|
|
203
207
|
type ThemeMode = 'light' | 'dark';
|
|
204
208
|
/** Steps in the payment flow */
|
|
205
|
-
type PaymentStep = 'login' | 'otp-verify' | 'create-passkey' | 'verify-passkey' | 'wallet-picker' | 'open-wallet' | 'confirm-sign' | 'deposit' | 'low-balance' | 'processing' | 'select-source' | 'success';
|
|
209
|
+
type PaymentStep = 'login' | 'otp-verify' | 'create-passkey' | 'verify-passkey' | 'wallet-picker' | 'open-wallet' | 'setup-status' | 'setup' | 'confirm-sign' | 'deposit' | 'low-balance' | 'processing' | 'select-source' | 'token-picker' | 'success';
|
|
206
210
|
/** User-selected advanced settings for chain/asset override */
|
|
207
211
|
interface AdvancedSettings {
|
|
208
212
|
/** Override asset (e.g. 'USDC', 'USDT'). Null = let backend decide. */
|
|
@@ -310,7 +314,10 @@ interface CreateAccountParams {
|
|
|
310
314
|
nickname?: string;
|
|
311
315
|
}
|
|
312
316
|
declare function createAccount(apiBaseUrl: string, token: string, params: CreateAccountParams): Promise<Account>;
|
|
313
|
-
declare function createAccountAuthorizationSession(apiBaseUrl: string, token: string, accountId: string, credentialId: string
|
|
317
|
+
declare function createAccountAuthorizationSession(apiBaseUrl: string, token: string, accountId: string, credentialId: string, options?: {
|
|
318
|
+
tokenAddress?: string;
|
|
319
|
+
chainId?: number;
|
|
320
|
+
}): Promise<{
|
|
314
321
|
id: string;
|
|
315
322
|
status: string;
|
|
316
323
|
uri: string;
|
|
@@ -775,4 +782,17 @@ interface AdvancedSourceScreenProps {
|
|
|
775
782
|
}
|
|
776
783
|
declare function AdvancedSourceScreen({ choices, selectedChainName, selectedTokenSymbol, onSelectSource, onBack, }: AdvancedSourceScreenProps): react_jsx_runtime.JSX.Element;
|
|
777
784
|
|
|
778
|
-
|
|
785
|
+
interface TokenPickerScreenProps {
|
|
786
|
+
account: Account;
|
|
787
|
+
chains: Array<{
|
|
788
|
+
id: string;
|
|
789
|
+
name: string;
|
|
790
|
+
commonId: number | null;
|
|
791
|
+
}>;
|
|
792
|
+
onSelectAuthorized: (walletId: string, tokenSymbol: string) => void;
|
|
793
|
+
onAuthorizeToken: (walletId: string, tokenAddress: string, chainId: number, tokenSymbol: string) => void;
|
|
794
|
+
onBack: () => void;
|
|
795
|
+
}
|
|
796
|
+
declare function TokenPickerScreen({ account, chains, onSelectAuthorized, onAuthorizeToken, onBack, }: TokenPickerScreenProps): react_jsx_runtime.JSX.Element;
|
|
797
|
+
|
|
798
|
+
export { type Account, type ActionExecutionResult, type AdvancedSettings, AdvancedSourceScreen, type Amount, type AuthorizationAction, type AuthorizationSession, type AuthorizationSessionDetail, type Chain, CreatePasskeyScreen, type Destination, type ErrorResponse, IconCircle, InfoBanner, 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, SwypeLoadingScreen, SwypePayment, type SwypePaymentProps, SwypeProvider, type SwypeProviderProps, type ThemeMode, type ThemeTokens, type TokenBalance, TokenPickerScreen, type Transfer, type TransferDestination, type UserConfig, type Wallet, type WalletSource, type WalletToken, buildPasskeyPopupOptions, createPasskeyCredential, createPasskeyViaPopup, darkTheme, deviceHasPasskey, findDevicePasskey, findDevicePasskeyViaPopup, getTheme, lightTheme, resolvePasskeyRpId, api as swypeApi, useAuthorizationExecutor, useSwypeConfig, useSwypeDepositAmount, useTransferPolling, useTransferSigning };
|
package/dist/index.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ interface WalletToken {
|
|
|
26
26
|
/** A token source within a wallet (e.g. USDC on a specific chain) */
|
|
27
27
|
interface WalletSource {
|
|
28
28
|
id: string;
|
|
29
|
+
/** On-chain ERC-20 contract address (e.g. 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913) */
|
|
30
|
+
address: string;
|
|
29
31
|
token: WalletToken;
|
|
30
32
|
balance: TokenBalance;
|
|
31
33
|
}
|
|
@@ -78,6 +80,8 @@ interface AuthorizationSessionDetail {
|
|
|
78
80
|
id: string;
|
|
79
81
|
status: string;
|
|
80
82
|
uri: string;
|
|
83
|
+
selectedTokenAddress?: string;
|
|
84
|
+
selectedChainId?: number;
|
|
81
85
|
actions: AuthorizationAction[];
|
|
82
86
|
}
|
|
83
87
|
/** Monetary amount */
|
|
@@ -202,7 +206,7 @@ interface UserConfig {
|
|
|
202
206
|
/** Theme mode */
|
|
203
207
|
type ThemeMode = 'light' | 'dark';
|
|
204
208
|
/** Steps in the payment flow */
|
|
205
|
-
type PaymentStep = 'login' | 'otp-verify' | 'create-passkey' | 'verify-passkey' | 'wallet-picker' | 'open-wallet' | 'confirm-sign' | 'deposit' | 'low-balance' | 'processing' | 'select-source' | 'success';
|
|
209
|
+
type PaymentStep = 'login' | 'otp-verify' | 'create-passkey' | 'verify-passkey' | 'wallet-picker' | 'open-wallet' | 'setup-status' | 'setup' | 'confirm-sign' | 'deposit' | 'low-balance' | 'processing' | 'select-source' | 'token-picker' | 'success';
|
|
206
210
|
/** User-selected advanced settings for chain/asset override */
|
|
207
211
|
interface AdvancedSettings {
|
|
208
212
|
/** Override asset (e.g. 'USDC', 'USDT'). Null = let backend decide. */
|
|
@@ -310,7 +314,10 @@ interface CreateAccountParams {
|
|
|
310
314
|
nickname?: string;
|
|
311
315
|
}
|
|
312
316
|
declare function createAccount(apiBaseUrl: string, token: string, params: CreateAccountParams): Promise<Account>;
|
|
313
|
-
declare function createAccountAuthorizationSession(apiBaseUrl: string, token: string, accountId: string, credentialId: string
|
|
317
|
+
declare function createAccountAuthorizationSession(apiBaseUrl: string, token: string, accountId: string, credentialId: string, options?: {
|
|
318
|
+
tokenAddress?: string;
|
|
319
|
+
chainId?: number;
|
|
320
|
+
}): Promise<{
|
|
314
321
|
id: string;
|
|
315
322
|
status: string;
|
|
316
323
|
uri: string;
|
|
@@ -775,4 +782,17 @@ interface AdvancedSourceScreenProps {
|
|
|
775
782
|
}
|
|
776
783
|
declare function AdvancedSourceScreen({ choices, selectedChainName, selectedTokenSymbol, onSelectSource, onBack, }: AdvancedSourceScreenProps): react_jsx_runtime.JSX.Element;
|
|
777
784
|
|
|
778
|
-
|
|
785
|
+
interface TokenPickerScreenProps {
|
|
786
|
+
account: Account;
|
|
787
|
+
chains: Array<{
|
|
788
|
+
id: string;
|
|
789
|
+
name: string;
|
|
790
|
+
commonId: number | null;
|
|
791
|
+
}>;
|
|
792
|
+
onSelectAuthorized: (walletId: string, tokenSymbol: string) => void;
|
|
793
|
+
onAuthorizeToken: (walletId: string, tokenAddress: string, chainId: number, tokenSymbol: string) => void;
|
|
794
|
+
onBack: () => void;
|
|
795
|
+
}
|
|
796
|
+
declare function TokenPickerScreen({ account, chains, onSelectAuthorized, onAuthorizeToken, onBack, }: TokenPickerScreenProps): react_jsx_runtime.JSX.Element;
|
|
797
|
+
|
|
798
|
+
export { type Account, type ActionExecutionResult, type AdvancedSettings, AdvancedSourceScreen, type Amount, type AuthorizationAction, type AuthorizationSession, type AuthorizationSessionDetail, type Chain, CreatePasskeyScreen, type Destination, type ErrorResponse, IconCircle, InfoBanner, 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, SwypeLoadingScreen, SwypePayment, type SwypePaymentProps, SwypeProvider, type SwypeProviderProps, type ThemeMode, type ThemeTokens, type TokenBalance, TokenPickerScreen, type Transfer, type TransferDestination, type UserConfig, type Wallet, type WalletSource, type WalletToken, buildPasskeyPopupOptions, createPasskeyCredential, createPasskeyViaPopup, darkTheme, deviceHasPasskey, findDevicePasskey, findDevicePasskeyViaPopup, getTheme, lightTheme, resolvePasskeyRpId, api as swypeApi, useAuthorizationExecutor, useSwypeConfig, useSwypeDepositAmount, useTransferPolling, useTransferSigning };
|