@swype-org/react-sdk 0.1.3 → 0.1.5
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 +824 -614
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +95 -15
- package/dist/index.d.ts +95 -15
- package/dist/index.js +823 -616
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -38,7 +38,7 @@ interface Wallet {
|
|
|
38
38
|
id: string;
|
|
39
39
|
name: string;
|
|
40
40
|
};
|
|
41
|
-
/** The smart account type (e.g. 'metamask'), if
|
|
41
|
+
/** The smart account type (e.g. 'metamask'), if a smart account has been created. */
|
|
42
42
|
smartAccountType?: string | null;
|
|
43
43
|
createDate: string;
|
|
44
44
|
updateDate: string;
|
|
@@ -94,6 +94,8 @@ interface TransferSignPayload {
|
|
|
94
94
|
userOp: Record<string, unknown>;
|
|
95
95
|
/** ERC-4337 UserOp hash — used as the WebAuthn challenge for on-chain verification. */
|
|
96
96
|
userOpHash: string;
|
|
97
|
+
/** WebAuthn credential ID bound to the smart account validator. */
|
|
98
|
+
passkeyCredentialId: string;
|
|
97
99
|
bridgeRelayAddress: string;
|
|
98
100
|
tokenSymbol: string;
|
|
99
101
|
chainName: string;
|
|
@@ -137,6 +139,15 @@ interface ActionExecutionResult {
|
|
|
137
139
|
}
|
|
138
140
|
/** Source type discriminator for transfer creation */
|
|
139
141
|
type SourceType = 'providerId' | 'accountId' | 'walletId' | 'tokenId';
|
|
142
|
+
/** A chain+token option from the SELECT_SOURCE action metadata. */
|
|
143
|
+
interface SourceOption {
|
|
144
|
+
chainName: string;
|
|
145
|
+
chainId: string;
|
|
146
|
+
tokenSymbol: string;
|
|
147
|
+
tokenAddress: string;
|
|
148
|
+
decimals: number;
|
|
149
|
+
rawBalance: string;
|
|
150
|
+
}
|
|
140
151
|
/** User's chain+token selection for the SELECT_SOURCE action. */
|
|
141
152
|
interface SourceSelection {
|
|
142
153
|
chainName: string;
|
|
@@ -157,11 +168,16 @@ interface ListResponse<T> {
|
|
|
157
168
|
/** User configuration preferences */
|
|
158
169
|
interface UserConfig {
|
|
159
170
|
defaultAllowance?: number;
|
|
171
|
+
/** Registered WebAuthn passkey credential, or null if none registered */
|
|
172
|
+
passkey?: {
|
|
173
|
+
credentialId: string;
|
|
174
|
+
publicKey: string;
|
|
175
|
+
} | null;
|
|
160
176
|
}
|
|
161
177
|
/** Theme mode */
|
|
162
178
|
type ThemeMode = 'light' | 'dark';
|
|
163
179
|
/** Steps in the payment flow */
|
|
164
|
-
type PaymentStep = 'login' | 'enter-amount' | 'ready' | 'processing' | 'complete';
|
|
180
|
+
type PaymentStep = 'login' | 'register-passkey' | 'enter-amount' | 'ready' | 'processing' | 'complete';
|
|
165
181
|
/** User-selected advanced settings for chain/asset override */
|
|
166
182
|
interface AdvancedSettings {
|
|
167
183
|
/** Override asset (e.g. 'USDC', 'USDT'). Null = let backend decide. */
|
|
@@ -267,6 +283,19 @@ interface SwypePaymentProps {
|
|
|
267
283
|
}
|
|
268
284
|
declare function SwypePayment({ destination, onComplete, onError, }: SwypePaymentProps): react_jsx_runtime.JSX.Element | null;
|
|
269
285
|
|
|
286
|
+
type AccessTokenGetter = () => Promise<string | null | undefined>;
|
|
287
|
+
/**
|
|
288
|
+
* Creates a WebAuthn passkey credential.
|
|
289
|
+
* Used for upfront passkey registration before the authorization flow.
|
|
290
|
+
*
|
|
291
|
+
* @param userIdentifier - A string used to identify the user in the
|
|
292
|
+
* WebAuthn ceremony (e.g. wallet address or Privy user ID).
|
|
293
|
+
* @returns The base64-encoded credentialId and publicKey.
|
|
294
|
+
*/
|
|
295
|
+
declare function createPasskeyCredential(userIdentifier: string): Promise<{
|
|
296
|
+
credentialId: string;
|
|
297
|
+
publicKey: string;
|
|
298
|
+
}>;
|
|
270
299
|
interface UseTransferPollingResult {
|
|
271
300
|
transfer: Transfer | null;
|
|
272
301
|
error: string | null;
|
|
@@ -289,24 +318,60 @@ interface UseAuthorizationExecutorResult {
|
|
|
289
318
|
pendingSelectSource: AuthorizationAction | null;
|
|
290
319
|
/** Call this from the UI to provide the user's chain+token choice. */
|
|
291
320
|
resolveSelectSource: (selection: SourceSelection) => void;
|
|
321
|
+
/** Execute authorization by session id. */
|
|
322
|
+
executeSessionById: (sessionId: string) => Promise<void>;
|
|
292
323
|
executeSession: (transfer: Transfer) => Promise<void>;
|
|
293
324
|
}
|
|
325
|
+
interface UseAuthorizationExecutorOptions {
|
|
326
|
+
/** Optional API base URL override when used outside SwypeProvider. */
|
|
327
|
+
apiBaseUrl?: string;
|
|
328
|
+
}
|
|
294
329
|
/**
|
|
295
330
|
* Executes the full authorization flow for a transfer's first session:
|
|
296
|
-
* fetches the session, walks through PENDING actions
|
|
297
|
-
*
|
|
298
|
-
*
|
|
299
|
-
*
|
|
331
|
+
* fetches the session, walks through PENDING actions, reports each
|
|
332
|
+
* completion to the server, and chains new actions that appear.
|
|
333
|
+
*
|
|
334
|
+
* Supported action types:
|
|
335
|
+
* - OPEN_PROVIDER — connect the user's wallet
|
|
336
|
+
* - SELECT_SOURCE — pause for user chain+token selection
|
|
337
|
+
* - SWITCH_CHAIN — switch the wallet to the required chain
|
|
338
|
+
* - CREATE_SMART_ACCOUNT — server-side smart account deployment
|
|
339
|
+
* - APPROVE_PERMIT2 — ERC-20 approve(permit2, maxUint256) from EOA
|
|
340
|
+
* - SIGN_PERMIT2 — EIP-712 Permit2 allowance signature from EOA
|
|
300
341
|
*
|
|
301
342
|
* Transfer signing (passkey) is handled separately via
|
|
302
343
|
* `useTransferSigning()` after the authorization flow completes.
|
|
344
|
+
*/
|
|
345
|
+
declare function useAuthorizationExecutor(options?: UseAuthorizationExecutorOptions): UseAuthorizationExecutorResult;
|
|
346
|
+
interface UseTransferSigningResult {
|
|
347
|
+
signing: boolean;
|
|
348
|
+
signPayload: TransferSignPayload | null;
|
|
349
|
+
error: string | null;
|
|
350
|
+
/**
|
|
351
|
+
* Starts the signing flow:
|
|
352
|
+
* 1. Polls GET /v1/transfers/{id} until signPayload is present
|
|
353
|
+
* 2. Triggers WebAuthn passkey prompt
|
|
354
|
+
* 3. Submits signed UserOp via PATCH /v1/transfers/{id}
|
|
355
|
+
*/
|
|
356
|
+
signTransfer: (transferId: string) => Promise<Transfer>;
|
|
357
|
+
}
|
|
358
|
+
interface UseTransferSigningOptions {
|
|
359
|
+
/** Optional API base URL override when used outside SwypeProvider. */
|
|
360
|
+
apiBaseUrl?: string;
|
|
361
|
+
/** Optional access-token getter override (e.g. deeplink query token). */
|
|
362
|
+
getAccessToken?: AccessTokenGetter;
|
|
363
|
+
/** Optional authorization-session token for session-authenticated transfer signing. */
|
|
364
|
+
authorizationSessionToken?: string;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Post-authorization transfer signing hook.
|
|
303
368
|
*
|
|
304
|
-
*
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
*
|
|
369
|
+
* After the auth session completes and the transfer reaches AUTHORIZED,
|
|
370
|
+
* the backend prepares a signPayload containing the unsigned UserOp.
|
|
371
|
+
* This hook polls for it, prompts the user's passkey via WebAuthn, and
|
|
372
|
+
* submits the signed UserOp back to the API.
|
|
308
373
|
*/
|
|
309
|
-
declare function
|
|
374
|
+
declare function useTransferSigning(pollIntervalMs?: number, options?: UseTransferSigningOptions): UseTransferSigningResult;
|
|
310
375
|
|
|
311
376
|
declare function fetchProviders(apiBaseUrl: string, token: string): Promise<Provider[]>;
|
|
312
377
|
declare function fetchChains(apiBaseUrl: string, token: string): Promise<Chain[]>;
|
|
@@ -319,13 +384,26 @@ interface CreateTransferParams {
|
|
|
319
384
|
currency?: string;
|
|
320
385
|
}
|
|
321
386
|
declare function createTransfer(apiBaseUrl: string, token: string, params: CreateTransferParams): Promise<Transfer>;
|
|
322
|
-
declare function fetchTransfer(apiBaseUrl: string, token: string, transferId: string): Promise<Transfer>;
|
|
387
|
+
declare function fetchTransfer(apiBaseUrl: string, token: string, transferId: string, authorizationSessionToken?: string): Promise<Transfer>;
|
|
323
388
|
/**
|
|
324
389
|
* Submit a passkey-signed UserOperation for a transfer.
|
|
325
390
|
* PATCH /v1/transfers/{transferId}
|
|
326
391
|
*/
|
|
327
|
-
declare function signTransfer(apiBaseUrl: string, token: string, transferId: string, signedUserOp: Record<string, unknown
|
|
392
|
+
declare function signTransfer(apiBaseUrl: string, token: string, transferId: string, signedUserOp: Record<string, unknown>, authorizationSessionToken?: string): Promise<Transfer>;
|
|
328
393
|
declare function fetchAuthorizationSession(apiBaseUrl: string, sessionId: string): Promise<AuthorizationSessionDetail>;
|
|
394
|
+
/**
|
|
395
|
+
* Registers a WebAuthn passkey for the authenticated user.
|
|
396
|
+
* POST /v1/users/config/passkey
|
|
397
|
+
*/
|
|
398
|
+
declare function registerPasskey(apiBaseUrl: string, token: string, credentialId: string, publicKey: string): Promise<void>;
|
|
399
|
+
/**
|
|
400
|
+
* Fetches the authenticated user's config, including passkey status.
|
|
401
|
+
* GET /v1/users/config
|
|
402
|
+
*/
|
|
403
|
+
declare function fetchUserConfig(apiBaseUrl: string, token: string): Promise<{
|
|
404
|
+
id: string;
|
|
405
|
+
config: UserConfig;
|
|
406
|
+
}>;
|
|
329
407
|
declare function updateUserConfig(apiBaseUrl: string, token: string, config: {
|
|
330
408
|
defaultAllowance: number;
|
|
331
409
|
}): Promise<void>;
|
|
@@ -348,12 +426,14 @@ declare const api_fetchAuthorizationSession: typeof fetchAuthorizationSession;
|
|
|
348
426
|
declare const api_fetchChains: typeof fetchChains;
|
|
349
427
|
declare const api_fetchProviders: typeof fetchProviders;
|
|
350
428
|
declare const api_fetchTransfer: typeof fetchTransfer;
|
|
429
|
+
declare const api_fetchUserConfig: typeof fetchUserConfig;
|
|
430
|
+
declare const api_registerPasskey: typeof registerPasskey;
|
|
351
431
|
declare const api_reportActionCompletion: typeof reportActionCompletion;
|
|
352
432
|
declare const api_signTransfer: typeof signTransfer;
|
|
353
433
|
declare const api_updateUserConfig: typeof updateUserConfig;
|
|
354
434
|
declare const api_updateUserConfigBySession: typeof updateUserConfigBySession;
|
|
355
435
|
declare namespace api {
|
|
356
|
-
export { type api_CreateTransferParams as CreateTransferParams, api_createTransfer as createTransfer, api_fetchAccounts as fetchAccounts, api_fetchAuthorizationSession as fetchAuthorizationSession, api_fetchChains as fetchChains, api_fetchProviders as fetchProviders, api_fetchTransfer as fetchTransfer, api_reportActionCompletion as reportActionCompletion, api_signTransfer as signTransfer, api_updateUserConfig as updateUserConfig, api_updateUserConfigBySession as updateUserConfigBySession };
|
|
436
|
+
export { type api_CreateTransferParams as CreateTransferParams, api_createTransfer as createTransfer, api_fetchAccounts as fetchAccounts, api_fetchAuthorizationSession as fetchAuthorizationSession, api_fetchChains as fetchChains, api_fetchProviders as fetchProviders, api_fetchTransfer as fetchTransfer, api_fetchUserConfig as fetchUserConfig, api_registerPasskey as registerPasskey, api_reportActionCompletion as reportActionCompletion, api_signTransfer as signTransfer, api_updateUserConfig as updateUserConfig, api_updateUserConfigBySession as updateUserConfigBySession };
|
|
357
437
|
}
|
|
358
438
|
|
|
359
|
-
export { type Account, type ActionExecutionResult, type AdvancedSettings, type Amount, type AuthorizationAction, type AuthorizationSession, type AuthorizationSessionDetail, type Chain, type Destination, type ErrorResponse, type ListResponse, type PaymentStep, type Provider, type SourceType, SwypePayment, type SwypePaymentProps, SwypeProvider, type SwypeProviderProps, type ThemeMode, type ThemeTokens, type TokenBalance, type Transfer, type TransferDestination, type UserConfig, type Wallet, type WalletSource, type WalletToken, darkTheme, getTheme, lightTheme, api as swypeApi, useAuthorizationExecutor, useSwypeConfig, useSwypeDepositAmount, useTransferPolling };
|
|
439
|
+
export { type Account, type ActionExecutionResult, type AdvancedSettings, type Amount, type AuthorizationAction, type AuthorizationSession, type AuthorizationSessionDetail, type Chain, type Destination, type ErrorResponse, type ListResponse, type PaymentStep, type Provider, type SourceOption, type SourceSelection, type SourceType, SwypePayment, type SwypePaymentProps, SwypeProvider, type SwypeProviderProps, type ThemeMode, type ThemeTokens, type TokenBalance, type Transfer, type TransferDestination, type UserConfig, type Wallet, type WalletSource, type WalletToken, createPasskeyCredential, darkTheme, getTheme, lightTheme, api as swypeApi, useAuthorizationExecutor, useSwypeConfig, useSwypeDepositAmount, useTransferPolling, useTransferSigning };
|
package/dist/index.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ interface Wallet {
|
|
|
38
38
|
id: string;
|
|
39
39
|
name: string;
|
|
40
40
|
};
|
|
41
|
-
/** The smart account type (e.g. 'metamask'), if
|
|
41
|
+
/** The smart account type (e.g. 'metamask'), if a smart account has been created. */
|
|
42
42
|
smartAccountType?: string | null;
|
|
43
43
|
createDate: string;
|
|
44
44
|
updateDate: string;
|
|
@@ -94,6 +94,8 @@ interface TransferSignPayload {
|
|
|
94
94
|
userOp: Record<string, unknown>;
|
|
95
95
|
/** ERC-4337 UserOp hash — used as the WebAuthn challenge for on-chain verification. */
|
|
96
96
|
userOpHash: string;
|
|
97
|
+
/** WebAuthn credential ID bound to the smart account validator. */
|
|
98
|
+
passkeyCredentialId: string;
|
|
97
99
|
bridgeRelayAddress: string;
|
|
98
100
|
tokenSymbol: string;
|
|
99
101
|
chainName: string;
|
|
@@ -137,6 +139,15 @@ interface ActionExecutionResult {
|
|
|
137
139
|
}
|
|
138
140
|
/** Source type discriminator for transfer creation */
|
|
139
141
|
type SourceType = 'providerId' | 'accountId' | 'walletId' | 'tokenId';
|
|
142
|
+
/** A chain+token option from the SELECT_SOURCE action metadata. */
|
|
143
|
+
interface SourceOption {
|
|
144
|
+
chainName: string;
|
|
145
|
+
chainId: string;
|
|
146
|
+
tokenSymbol: string;
|
|
147
|
+
tokenAddress: string;
|
|
148
|
+
decimals: number;
|
|
149
|
+
rawBalance: string;
|
|
150
|
+
}
|
|
140
151
|
/** User's chain+token selection for the SELECT_SOURCE action. */
|
|
141
152
|
interface SourceSelection {
|
|
142
153
|
chainName: string;
|
|
@@ -157,11 +168,16 @@ interface ListResponse<T> {
|
|
|
157
168
|
/** User configuration preferences */
|
|
158
169
|
interface UserConfig {
|
|
159
170
|
defaultAllowance?: number;
|
|
171
|
+
/** Registered WebAuthn passkey credential, or null if none registered */
|
|
172
|
+
passkey?: {
|
|
173
|
+
credentialId: string;
|
|
174
|
+
publicKey: string;
|
|
175
|
+
} | null;
|
|
160
176
|
}
|
|
161
177
|
/** Theme mode */
|
|
162
178
|
type ThemeMode = 'light' | 'dark';
|
|
163
179
|
/** Steps in the payment flow */
|
|
164
|
-
type PaymentStep = 'login' | 'enter-amount' | 'ready' | 'processing' | 'complete';
|
|
180
|
+
type PaymentStep = 'login' | 'register-passkey' | 'enter-amount' | 'ready' | 'processing' | 'complete';
|
|
165
181
|
/** User-selected advanced settings for chain/asset override */
|
|
166
182
|
interface AdvancedSettings {
|
|
167
183
|
/** Override asset (e.g. 'USDC', 'USDT'). Null = let backend decide. */
|
|
@@ -267,6 +283,19 @@ interface SwypePaymentProps {
|
|
|
267
283
|
}
|
|
268
284
|
declare function SwypePayment({ destination, onComplete, onError, }: SwypePaymentProps): react_jsx_runtime.JSX.Element | null;
|
|
269
285
|
|
|
286
|
+
type AccessTokenGetter = () => Promise<string | null | undefined>;
|
|
287
|
+
/**
|
|
288
|
+
* Creates a WebAuthn passkey credential.
|
|
289
|
+
* Used for upfront passkey registration before the authorization flow.
|
|
290
|
+
*
|
|
291
|
+
* @param userIdentifier - A string used to identify the user in the
|
|
292
|
+
* WebAuthn ceremony (e.g. wallet address or Privy user ID).
|
|
293
|
+
* @returns The base64-encoded credentialId and publicKey.
|
|
294
|
+
*/
|
|
295
|
+
declare function createPasskeyCredential(userIdentifier: string): Promise<{
|
|
296
|
+
credentialId: string;
|
|
297
|
+
publicKey: string;
|
|
298
|
+
}>;
|
|
270
299
|
interface UseTransferPollingResult {
|
|
271
300
|
transfer: Transfer | null;
|
|
272
301
|
error: string | null;
|
|
@@ -289,24 +318,60 @@ interface UseAuthorizationExecutorResult {
|
|
|
289
318
|
pendingSelectSource: AuthorizationAction | null;
|
|
290
319
|
/** Call this from the UI to provide the user's chain+token choice. */
|
|
291
320
|
resolveSelectSource: (selection: SourceSelection) => void;
|
|
321
|
+
/** Execute authorization by session id. */
|
|
322
|
+
executeSessionById: (sessionId: string) => Promise<void>;
|
|
292
323
|
executeSession: (transfer: Transfer) => Promise<void>;
|
|
293
324
|
}
|
|
325
|
+
interface UseAuthorizationExecutorOptions {
|
|
326
|
+
/** Optional API base URL override when used outside SwypeProvider. */
|
|
327
|
+
apiBaseUrl?: string;
|
|
328
|
+
}
|
|
294
329
|
/**
|
|
295
330
|
* Executes the full authorization flow for a transfer's first session:
|
|
296
|
-
* fetches the session, walks through PENDING actions
|
|
297
|
-
*
|
|
298
|
-
*
|
|
299
|
-
*
|
|
331
|
+
* fetches the session, walks through PENDING actions, reports each
|
|
332
|
+
* completion to the server, and chains new actions that appear.
|
|
333
|
+
*
|
|
334
|
+
* Supported action types:
|
|
335
|
+
* - OPEN_PROVIDER — connect the user's wallet
|
|
336
|
+
* - SELECT_SOURCE — pause for user chain+token selection
|
|
337
|
+
* - SWITCH_CHAIN — switch the wallet to the required chain
|
|
338
|
+
* - CREATE_SMART_ACCOUNT — server-side smart account deployment
|
|
339
|
+
* - APPROVE_PERMIT2 — ERC-20 approve(permit2, maxUint256) from EOA
|
|
340
|
+
* - SIGN_PERMIT2 — EIP-712 Permit2 allowance signature from EOA
|
|
300
341
|
*
|
|
301
342
|
* Transfer signing (passkey) is handled separately via
|
|
302
343
|
* `useTransferSigning()` after the authorization flow completes.
|
|
344
|
+
*/
|
|
345
|
+
declare function useAuthorizationExecutor(options?: UseAuthorizationExecutorOptions): UseAuthorizationExecutorResult;
|
|
346
|
+
interface UseTransferSigningResult {
|
|
347
|
+
signing: boolean;
|
|
348
|
+
signPayload: TransferSignPayload | null;
|
|
349
|
+
error: string | null;
|
|
350
|
+
/**
|
|
351
|
+
* Starts the signing flow:
|
|
352
|
+
* 1. Polls GET /v1/transfers/{id} until signPayload is present
|
|
353
|
+
* 2. Triggers WebAuthn passkey prompt
|
|
354
|
+
* 3. Submits signed UserOp via PATCH /v1/transfers/{id}
|
|
355
|
+
*/
|
|
356
|
+
signTransfer: (transferId: string) => Promise<Transfer>;
|
|
357
|
+
}
|
|
358
|
+
interface UseTransferSigningOptions {
|
|
359
|
+
/** Optional API base URL override when used outside SwypeProvider. */
|
|
360
|
+
apiBaseUrl?: string;
|
|
361
|
+
/** Optional access-token getter override (e.g. deeplink query token). */
|
|
362
|
+
getAccessToken?: AccessTokenGetter;
|
|
363
|
+
/** Optional authorization-session token for session-authenticated transfer signing. */
|
|
364
|
+
authorizationSessionToken?: string;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Post-authorization transfer signing hook.
|
|
303
368
|
*
|
|
304
|
-
*
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
*
|
|
369
|
+
* After the auth session completes and the transfer reaches AUTHORIZED,
|
|
370
|
+
* the backend prepares a signPayload containing the unsigned UserOp.
|
|
371
|
+
* This hook polls for it, prompts the user's passkey via WebAuthn, and
|
|
372
|
+
* submits the signed UserOp back to the API.
|
|
308
373
|
*/
|
|
309
|
-
declare function
|
|
374
|
+
declare function useTransferSigning(pollIntervalMs?: number, options?: UseTransferSigningOptions): UseTransferSigningResult;
|
|
310
375
|
|
|
311
376
|
declare function fetchProviders(apiBaseUrl: string, token: string): Promise<Provider[]>;
|
|
312
377
|
declare function fetchChains(apiBaseUrl: string, token: string): Promise<Chain[]>;
|
|
@@ -319,13 +384,26 @@ interface CreateTransferParams {
|
|
|
319
384
|
currency?: string;
|
|
320
385
|
}
|
|
321
386
|
declare function createTransfer(apiBaseUrl: string, token: string, params: CreateTransferParams): Promise<Transfer>;
|
|
322
|
-
declare function fetchTransfer(apiBaseUrl: string, token: string, transferId: string): Promise<Transfer>;
|
|
387
|
+
declare function fetchTransfer(apiBaseUrl: string, token: string, transferId: string, authorizationSessionToken?: string): Promise<Transfer>;
|
|
323
388
|
/**
|
|
324
389
|
* Submit a passkey-signed UserOperation for a transfer.
|
|
325
390
|
* PATCH /v1/transfers/{transferId}
|
|
326
391
|
*/
|
|
327
|
-
declare function signTransfer(apiBaseUrl: string, token: string, transferId: string, signedUserOp: Record<string, unknown
|
|
392
|
+
declare function signTransfer(apiBaseUrl: string, token: string, transferId: string, signedUserOp: Record<string, unknown>, authorizationSessionToken?: string): Promise<Transfer>;
|
|
328
393
|
declare function fetchAuthorizationSession(apiBaseUrl: string, sessionId: string): Promise<AuthorizationSessionDetail>;
|
|
394
|
+
/**
|
|
395
|
+
* Registers a WebAuthn passkey for the authenticated user.
|
|
396
|
+
* POST /v1/users/config/passkey
|
|
397
|
+
*/
|
|
398
|
+
declare function registerPasskey(apiBaseUrl: string, token: string, credentialId: string, publicKey: string): Promise<void>;
|
|
399
|
+
/**
|
|
400
|
+
* Fetches the authenticated user's config, including passkey status.
|
|
401
|
+
* GET /v1/users/config
|
|
402
|
+
*/
|
|
403
|
+
declare function fetchUserConfig(apiBaseUrl: string, token: string): Promise<{
|
|
404
|
+
id: string;
|
|
405
|
+
config: UserConfig;
|
|
406
|
+
}>;
|
|
329
407
|
declare function updateUserConfig(apiBaseUrl: string, token: string, config: {
|
|
330
408
|
defaultAllowance: number;
|
|
331
409
|
}): Promise<void>;
|
|
@@ -348,12 +426,14 @@ declare const api_fetchAuthorizationSession: typeof fetchAuthorizationSession;
|
|
|
348
426
|
declare const api_fetchChains: typeof fetchChains;
|
|
349
427
|
declare const api_fetchProviders: typeof fetchProviders;
|
|
350
428
|
declare const api_fetchTransfer: typeof fetchTransfer;
|
|
429
|
+
declare const api_fetchUserConfig: typeof fetchUserConfig;
|
|
430
|
+
declare const api_registerPasskey: typeof registerPasskey;
|
|
351
431
|
declare const api_reportActionCompletion: typeof reportActionCompletion;
|
|
352
432
|
declare const api_signTransfer: typeof signTransfer;
|
|
353
433
|
declare const api_updateUserConfig: typeof updateUserConfig;
|
|
354
434
|
declare const api_updateUserConfigBySession: typeof updateUserConfigBySession;
|
|
355
435
|
declare namespace api {
|
|
356
|
-
export { type api_CreateTransferParams as CreateTransferParams, api_createTransfer as createTransfer, api_fetchAccounts as fetchAccounts, api_fetchAuthorizationSession as fetchAuthorizationSession, api_fetchChains as fetchChains, api_fetchProviders as fetchProviders, api_fetchTransfer as fetchTransfer, api_reportActionCompletion as reportActionCompletion, api_signTransfer as signTransfer, api_updateUserConfig as updateUserConfig, api_updateUserConfigBySession as updateUserConfigBySession };
|
|
436
|
+
export { type api_CreateTransferParams as CreateTransferParams, api_createTransfer as createTransfer, api_fetchAccounts as fetchAccounts, api_fetchAuthorizationSession as fetchAuthorizationSession, api_fetchChains as fetchChains, api_fetchProviders as fetchProviders, api_fetchTransfer as fetchTransfer, api_fetchUserConfig as fetchUserConfig, api_registerPasskey as registerPasskey, api_reportActionCompletion as reportActionCompletion, api_signTransfer as signTransfer, api_updateUserConfig as updateUserConfig, api_updateUserConfigBySession as updateUserConfigBySession };
|
|
357
437
|
}
|
|
358
438
|
|
|
359
|
-
export { type Account, type ActionExecutionResult, type AdvancedSettings, type Amount, type AuthorizationAction, type AuthorizationSession, type AuthorizationSessionDetail, type Chain, type Destination, type ErrorResponse, type ListResponse, type PaymentStep, type Provider, type SourceType, SwypePayment, type SwypePaymentProps, SwypeProvider, type SwypeProviderProps, type ThemeMode, type ThemeTokens, type TokenBalance, type Transfer, type TransferDestination, type UserConfig, type Wallet, type WalletSource, type WalletToken, darkTheme, getTheme, lightTheme, api as swypeApi, useAuthorizationExecutor, useSwypeConfig, useSwypeDepositAmount, useTransferPolling };
|
|
439
|
+
export { type Account, type ActionExecutionResult, type AdvancedSettings, type Amount, type AuthorizationAction, type AuthorizationSession, type AuthorizationSessionDetail, type Chain, type Destination, type ErrorResponse, type ListResponse, type PaymentStep, type Provider, type SourceOption, type SourceSelection, type SourceType, SwypePayment, type SwypePaymentProps, SwypeProvider, type SwypeProviderProps, type ThemeMode, type ThemeTokens, type TokenBalance, type Transfer, type TransferDestination, type UserConfig, type Wallet, type WalletSource, type WalletToken, createPasskeyCredential, darkTheme, getTheme, lightTheme, api as swypeApi, useAuthorizationExecutor, useSwypeConfig, useSwypeDepositAmount, useTransferPolling, useTransferSigning };
|