@swype-org/react-sdk 0.1.112 → 0.1.115

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.d.cts CHANGED
@@ -26,8 +26,12 @@ 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;
33
+ /** Remaining One-Tap allowance in USD for this token on this chain, or null when not configured. */
34
+ remainingAllowance?: number | null;
31
35
  }
32
36
  /** Full wallet with chain, balance, and token sources */
33
37
  interface Wallet {
@@ -78,6 +82,8 @@ interface AuthorizationSessionDetail {
78
82
  id: string;
79
83
  status: string;
80
84
  uri: string;
85
+ selectedTokenAddress?: string;
86
+ selectedChainId?: number;
81
87
  actions: AuthorizationAction[];
82
88
  }
83
89
  /** Monetary amount */
@@ -202,7 +208,7 @@ interface UserConfig {
202
208
  /** Theme mode */
203
209
  type ThemeMode = 'light' | 'dark';
204
210
  /** Steps in the payment flow */
205
- type PaymentStep = 'login' | 'otp-verify' | 'create-passkey' | 'verify-passkey' | 'wallet-picker' | 'open-wallet' | 'setup-status' | 'setup' | 'confirm-sign' | 'deposit' | 'low-balance' | 'processing' | 'select-source' | 'success';
211
+ 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
212
  /** User-selected advanced settings for chain/asset override */
207
213
  interface AdvancedSettings {
208
214
  /** Override asset (e.g. 'USDC', 'USDT'). Null = let backend decide. */
@@ -310,7 +316,10 @@ interface CreateAccountParams {
310
316
  nickname?: string;
311
317
  }
312
318
  declare function createAccount(apiBaseUrl: string, token: string, params: CreateAccountParams): Promise<Account>;
313
- declare function createAccountAuthorizationSession(apiBaseUrl: string, token: string, accountId: string, credentialId: string): Promise<{
319
+ declare function createAccountAuthorizationSession(apiBaseUrl: string, token: string, accountId: string, credentialId: string, options?: {
320
+ tokenAddress?: string;
321
+ chainId?: number;
322
+ }): Promise<{
314
323
  id: string;
315
324
  status: string;
316
325
  uri: string;
@@ -775,4 +784,17 @@ interface AdvancedSourceScreenProps {
775
784
  }
776
785
  declare function AdvancedSourceScreen({ choices, selectedChainName, selectedTokenSymbol, onSelectSource, onBack, }: AdvancedSourceScreenProps): react_jsx_runtime.JSX.Element;
777
786
 
778
- 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, 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 };
787
+ interface TokenPickerScreenProps {
788
+ account: Account;
789
+ chains: Array<{
790
+ id: string;
791
+ name: string;
792
+ commonId: number | null;
793
+ }>;
794
+ onSelectAuthorized: (walletId: string, tokenSymbol: string) => void;
795
+ onAuthorizeToken: (walletId: string, tokenAddress: string, chainId: number, tokenSymbol: string) => void;
796
+ onBack: () => void;
797
+ }
798
+ declare function TokenPickerScreen({ account, chains, onSelectAuthorized, onAuthorizeToken, onBack, }: TokenPickerScreenProps): react_jsx_runtime.JSX.Element;
799
+
800
+ 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,8 +26,12 @@ 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;
33
+ /** Remaining One-Tap allowance in USD for this token on this chain, or null when not configured. */
34
+ remainingAllowance?: number | null;
31
35
  }
32
36
  /** Full wallet with chain, balance, and token sources */
33
37
  interface Wallet {
@@ -78,6 +82,8 @@ interface AuthorizationSessionDetail {
78
82
  id: string;
79
83
  status: string;
80
84
  uri: string;
85
+ selectedTokenAddress?: string;
86
+ selectedChainId?: number;
81
87
  actions: AuthorizationAction[];
82
88
  }
83
89
  /** Monetary amount */
@@ -202,7 +208,7 @@ interface UserConfig {
202
208
  /** Theme mode */
203
209
  type ThemeMode = 'light' | 'dark';
204
210
  /** Steps in the payment flow */
205
- type PaymentStep = 'login' | 'otp-verify' | 'create-passkey' | 'verify-passkey' | 'wallet-picker' | 'open-wallet' | 'setup-status' | 'setup' | 'confirm-sign' | 'deposit' | 'low-balance' | 'processing' | 'select-source' | 'success';
211
+ 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
212
  /** User-selected advanced settings for chain/asset override */
207
213
  interface AdvancedSettings {
208
214
  /** Override asset (e.g. 'USDC', 'USDT'). Null = let backend decide. */
@@ -310,7 +316,10 @@ interface CreateAccountParams {
310
316
  nickname?: string;
311
317
  }
312
318
  declare function createAccount(apiBaseUrl: string, token: string, params: CreateAccountParams): Promise<Account>;
313
- declare function createAccountAuthorizationSession(apiBaseUrl: string, token: string, accountId: string, credentialId: string): Promise<{
319
+ declare function createAccountAuthorizationSession(apiBaseUrl: string, token: string, accountId: string, credentialId: string, options?: {
320
+ tokenAddress?: string;
321
+ chainId?: number;
322
+ }): Promise<{
314
323
  id: string;
315
324
  status: string;
316
325
  uri: string;
@@ -775,4 +784,17 @@ interface AdvancedSourceScreenProps {
775
784
  }
776
785
  declare function AdvancedSourceScreen({ choices, selectedChainName, selectedTokenSymbol, onSelectSource, onBack, }: AdvancedSourceScreenProps): react_jsx_runtime.JSX.Element;
777
786
 
778
- 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, 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 };
787
+ interface TokenPickerScreenProps {
788
+ account: Account;
789
+ chains: Array<{
790
+ id: string;
791
+ name: string;
792
+ commonId: number | null;
793
+ }>;
794
+ onSelectAuthorized: (walletId: string, tokenSymbol: string) => void;
795
+ onAuthorizeToken: (walletId: string, tokenAddress: string, chainId: number, tokenSymbol: string) => void;
796
+ onBack: () => void;
797
+ }
798
+ declare function TokenPickerScreen({ account, chains, onSelectAuthorized, onAuthorizeToken, onBack, }: TokenPickerScreenProps): react_jsx_runtime.JSX.Element;
799
+
800
+ 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 };