@swype-org/react-sdk 0.1.28 → 0.1.29
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 +365 -66
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +85 -68
- package/dist/index.d.ts +85 -68
- package/dist/index.js +367 -68
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -162,6 +162,18 @@ interface Destination {
|
|
|
162
162
|
symbol: string;
|
|
163
163
|
};
|
|
164
164
|
}
|
|
165
|
+
/** Merchant-signed authorization envelope required for transfer creation. */
|
|
166
|
+
interface MerchantAuthorization {
|
|
167
|
+
merchantId: string;
|
|
168
|
+
payload: string;
|
|
169
|
+
signature: string;
|
|
170
|
+
}
|
|
171
|
+
/** Public key metadata used to verify merchant-signed payment links. */
|
|
172
|
+
interface MerchantPublicKey {
|
|
173
|
+
merchantId: string;
|
|
174
|
+
algorithm: string;
|
|
175
|
+
publicKey: string;
|
|
176
|
+
}
|
|
165
177
|
/** List response wrapper */
|
|
166
178
|
interface ListResponse<T> {
|
|
167
179
|
items: T[];
|
|
@@ -274,6 +286,75 @@ declare function useSwypeDepositAmount(): {
|
|
|
274
286
|
setAmount: (amount: number | null) => void;
|
|
275
287
|
};
|
|
276
288
|
|
|
289
|
+
declare function fetchProviders(apiBaseUrl: string, token: string): Promise<Provider[]>;
|
|
290
|
+
declare function fetchChains(apiBaseUrl: string, token: string): Promise<Chain[]>;
|
|
291
|
+
declare function fetchAccounts(apiBaseUrl: string, token: string, credentialId: string): Promise<Account[]>;
|
|
292
|
+
interface CreateTransferParams {
|
|
293
|
+
/** Caller-supplied UUID v4 for idempotency. If omitted, a random UUID is generated. */
|
|
294
|
+
id?: string;
|
|
295
|
+
credentialId: string;
|
|
296
|
+
merchantAuthorization?: MerchantAuthorization;
|
|
297
|
+
sourceType: SourceType;
|
|
298
|
+
sourceId: string;
|
|
299
|
+
destination: Destination;
|
|
300
|
+
amount: number;
|
|
301
|
+
currency?: string;
|
|
302
|
+
}
|
|
303
|
+
declare function createTransfer(apiBaseUrl: string, token: string, params: CreateTransferParams): Promise<Transfer>;
|
|
304
|
+
declare function fetchMerchantPublicKey(apiBaseUrl: string, merchantId: string): Promise<MerchantPublicKey>;
|
|
305
|
+
declare function fetchTransfer(apiBaseUrl: string, token: string, transferId: string, authorizationSessionToken?: string): Promise<Transfer>;
|
|
306
|
+
/**
|
|
307
|
+
* Submit a passkey-signed UserOperation for a transfer.
|
|
308
|
+
* PATCH /v1/transfers/{transferId}
|
|
309
|
+
*/
|
|
310
|
+
declare function signTransfer(apiBaseUrl: string, token: string, transferId: string, signedUserOp: Record<string, unknown>, authorizationSessionToken?: string): Promise<Transfer>;
|
|
311
|
+
declare function fetchAuthorizationSession(apiBaseUrl: string, sessionId: string): Promise<AuthorizationSessionDetail>;
|
|
312
|
+
/**
|
|
313
|
+
* Registers a WebAuthn passkey for the authenticated user.
|
|
314
|
+
* POST /v1/users/config/passkey
|
|
315
|
+
*/
|
|
316
|
+
declare function registerPasskey(apiBaseUrl: string, token: string, credentialId: string, publicKey: string): Promise<void>;
|
|
317
|
+
/**
|
|
318
|
+
* Fetches the authenticated user's config, including passkey status.
|
|
319
|
+
* GET /v1/users/config
|
|
320
|
+
*/
|
|
321
|
+
declare function fetchUserConfig(apiBaseUrl: string, token: string): Promise<{
|
|
322
|
+
id: string;
|
|
323
|
+
config: UserConfig;
|
|
324
|
+
}>;
|
|
325
|
+
declare function updateUserConfig(apiBaseUrl: string, token: string, config: {
|
|
326
|
+
defaultAllowance: number;
|
|
327
|
+
}): Promise<void>;
|
|
328
|
+
/**
|
|
329
|
+
* Updates the user's default allowance, authenticated by session ID.
|
|
330
|
+
* PATCH /v1/authorization-sessions/{id}/user-config
|
|
331
|
+
*
|
|
332
|
+
* This does not require a bearer token — the session ID itself serves
|
|
333
|
+
* as proof of authorization.
|
|
334
|
+
*/
|
|
335
|
+
declare function updateUserConfigBySession(apiBaseUrl: string, sessionId: string, config: {
|
|
336
|
+
defaultAllowance: number;
|
|
337
|
+
}): Promise<void>;
|
|
338
|
+
declare function reportActionCompletion(apiBaseUrl: string, actionId: string, result: Record<string, unknown>): Promise<AuthorizationSessionDetail>;
|
|
339
|
+
|
|
340
|
+
type api_CreateTransferParams = CreateTransferParams;
|
|
341
|
+
declare const api_createTransfer: typeof createTransfer;
|
|
342
|
+
declare const api_fetchAccounts: typeof fetchAccounts;
|
|
343
|
+
declare const api_fetchAuthorizationSession: typeof fetchAuthorizationSession;
|
|
344
|
+
declare const api_fetchChains: typeof fetchChains;
|
|
345
|
+
declare const api_fetchMerchantPublicKey: typeof fetchMerchantPublicKey;
|
|
346
|
+
declare const api_fetchProviders: typeof fetchProviders;
|
|
347
|
+
declare const api_fetchTransfer: typeof fetchTransfer;
|
|
348
|
+
declare const api_fetchUserConfig: typeof fetchUserConfig;
|
|
349
|
+
declare const api_registerPasskey: typeof registerPasskey;
|
|
350
|
+
declare const api_reportActionCompletion: typeof reportActionCompletion;
|
|
351
|
+
declare const api_signTransfer: typeof signTransfer;
|
|
352
|
+
declare const api_updateUserConfig: typeof updateUserConfig;
|
|
353
|
+
declare const api_updateUserConfigBySession: typeof updateUserConfigBySession;
|
|
354
|
+
declare namespace api {
|
|
355
|
+
export { type api_CreateTransferParams as CreateTransferParams, api_createTransfer as createTransfer, api_fetchAccounts as fetchAccounts, api_fetchAuthorizationSession as fetchAuthorizationSession, api_fetchChains as fetchChains, api_fetchMerchantPublicKey as fetchMerchantPublicKey, 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 };
|
|
356
|
+
}
|
|
357
|
+
|
|
277
358
|
interface SwypePaymentProps {
|
|
278
359
|
/**
|
|
279
360
|
* Where the funds go -- controlled by the host app (merchant).
|
|
@@ -305,8 +386,10 @@ interface SwypePaymentProps {
|
|
|
305
386
|
* flow without creating duplicate transfers.
|
|
306
387
|
*/
|
|
307
388
|
idempotencyKey?: string;
|
|
389
|
+
/** Merchant-signed transfer authorization envelope required by the API. */
|
|
390
|
+
merchantAuthorization?: CreateTransferParams['merchantAuthorization'];
|
|
308
391
|
}
|
|
309
|
-
declare function SwypePayment({ destination, onComplete, onError, useWalletConnector, idempotencyKey, }: SwypePaymentProps): react_jsx_runtime.JSX.Element | null;
|
|
392
|
+
declare function SwypePayment({ destination, onComplete, onError, useWalletConnector, idempotencyKey, merchantAuthorization, }: SwypePaymentProps): react_jsx_runtime.JSX.Element | null;
|
|
310
393
|
|
|
311
394
|
type AccessTokenGetter = () => Promise<string | null | undefined>;
|
|
312
395
|
/**
|
|
@@ -420,70 +503,4 @@ interface UseTransferSigningOptions {
|
|
|
420
503
|
*/
|
|
421
504
|
declare function useTransferSigning(pollIntervalMs?: number, options?: UseTransferSigningOptions): UseTransferSigningResult;
|
|
422
505
|
|
|
423
|
-
|
|
424
|
-
declare function fetchChains(apiBaseUrl: string, token: string): Promise<Chain[]>;
|
|
425
|
-
declare function fetchAccounts(apiBaseUrl: string, token: string, credentialId: string): Promise<Account[]>;
|
|
426
|
-
interface CreateTransferParams {
|
|
427
|
-
/** Caller-supplied UUID v4 for idempotency. If omitted, a random UUID is generated. */
|
|
428
|
-
id?: string;
|
|
429
|
-
credentialId: string;
|
|
430
|
-
sourceType: SourceType;
|
|
431
|
-
sourceId: string;
|
|
432
|
-
destination: Destination;
|
|
433
|
-
amount: number;
|
|
434
|
-
currency?: string;
|
|
435
|
-
}
|
|
436
|
-
declare function createTransfer(apiBaseUrl: string, token: string, params: CreateTransferParams): Promise<Transfer>;
|
|
437
|
-
declare function fetchTransfer(apiBaseUrl: string, token: string, transferId: string, authorizationSessionToken?: string): Promise<Transfer>;
|
|
438
|
-
/**
|
|
439
|
-
* Submit a passkey-signed UserOperation for a transfer.
|
|
440
|
-
* PATCH /v1/transfers/{transferId}
|
|
441
|
-
*/
|
|
442
|
-
declare function signTransfer(apiBaseUrl: string, token: string, transferId: string, signedUserOp: Record<string, unknown>, authorizationSessionToken?: string): Promise<Transfer>;
|
|
443
|
-
declare function fetchAuthorizationSession(apiBaseUrl: string, sessionId: string): Promise<AuthorizationSessionDetail>;
|
|
444
|
-
/**
|
|
445
|
-
* Registers a WebAuthn passkey for the authenticated user.
|
|
446
|
-
* POST /v1/users/config/passkey
|
|
447
|
-
*/
|
|
448
|
-
declare function registerPasskey(apiBaseUrl: string, token: string, credentialId: string, publicKey: string): Promise<void>;
|
|
449
|
-
/**
|
|
450
|
-
* Fetches the authenticated user's config, including passkey status.
|
|
451
|
-
* GET /v1/users/config
|
|
452
|
-
*/
|
|
453
|
-
declare function fetchUserConfig(apiBaseUrl: string, token: string): Promise<{
|
|
454
|
-
id: string;
|
|
455
|
-
config: UserConfig;
|
|
456
|
-
}>;
|
|
457
|
-
declare function updateUserConfig(apiBaseUrl: string, token: string, config: {
|
|
458
|
-
defaultAllowance: number;
|
|
459
|
-
}): Promise<void>;
|
|
460
|
-
/**
|
|
461
|
-
* Updates the user's default allowance, authenticated by session ID.
|
|
462
|
-
* PATCH /v1/authorization-sessions/{id}/user-config
|
|
463
|
-
*
|
|
464
|
-
* This does not require a bearer token — the session ID itself serves
|
|
465
|
-
* as proof of authorization.
|
|
466
|
-
*/
|
|
467
|
-
declare function updateUserConfigBySession(apiBaseUrl: string, sessionId: string, config: {
|
|
468
|
-
defaultAllowance: number;
|
|
469
|
-
}): Promise<void>;
|
|
470
|
-
declare function reportActionCompletion(apiBaseUrl: string, actionId: string, result: Record<string, unknown>): Promise<AuthorizationSessionDetail>;
|
|
471
|
-
|
|
472
|
-
type api_CreateTransferParams = CreateTransferParams;
|
|
473
|
-
declare const api_createTransfer: typeof createTransfer;
|
|
474
|
-
declare const api_fetchAccounts: typeof fetchAccounts;
|
|
475
|
-
declare const api_fetchAuthorizationSession: typeof fetchAuthorizationSession;
|
|
476
|
-
declare const api_fetchChains: typeof fetchChains;
|
|
477
|
-
declare const api_fetchProviders: typeof fetchProviders;
|
|
478
|
-
declare const api_fetchTransfer: typeof fetchTransfer;
|
|
479
|
-
declare const api_fetchUserConfig: typeof fetchUserConfig;
|
|
480
|
-
declare const api_registerPasskey: typeof registerPasskey;
|
|
481
|
-
declare const api_reportActionCompletion: typeof reportActionCompletion;
|
|
482
|
-
declare const api_signTransfer: typeof signTransfer;
|
|
483
|
-
declare const api_updateUserConfig: typeof updateUserConfig;
|
|
484
|
-
declare const api_updateUserConfigBySession: typeof updateUserConfigBySession;
|
|
485
|
-
declare namespace api {
|
|
486
|
-
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 };
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
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, deviceHasPasskey, findDevicePasskey, getTheme, lightTheme, api as swypeApi, useAuthorizationExecutor, useSwypeConfig, useSwypeDepositAmount, useTransferPolling, useTransferSigning };
|
|
506
|
+
export { type Account, type ActionExecutionResult, type AdvancedSettings, type Amount, type AuthorizationAction, type AuthorizationSession, type AuthorizationSessionDetail, type Chain, type Destination, type ErrorResponse, type ListResponse, type MerchantAuthorization, type MerchantPublicKey, 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, deviceHasPasskey, findDevicePasskey, getTheme, lightTheme, api as swypeApi, useAuthorizationExecutor, useSwypeConfig, useSwypeDepositAmount, useTransferPolling, useTransferSigning };
|
package/dist/index.d.ts
CHANGED
|
@@ -162,6 +162,18 @@ interface Destination {
|
|
|
162
162
|
symbol: string;
|
|
163
163
|
};
|
|
164
164
|
}
|
|
165
|
+
/** Merchant-signed authorization envelope required for transfer creation. */
|
|
166
|
+
interface MerchantAuthorization {
|
|
167
|
+
merchantId: string;
|
|
168
|
+
payload: string;
|
|
169
|
+
signature: string;
|
|
170
|
+
}
|
|
171
|
+
/** Public key metadata used to verify merchant-signed payment links. */
|
|
172
|
+
interface MerchantPublicKey {
|
|
173
|
+
merchantId: string;
|
|
174
|
+
algorithm: string;
|
|
175
|
+
publicKey: string;
|
|
176
|
+
}
|
|
165
177
|
/** List response wrapper */
|
|
166
178
|
interface ListResponse<T> {
|
|
167
179
|
items: T[];
|
|
@@ -274,6 +286,75 @@ declare function useSwypeDepositAmount(): {
|
|
|
274
286
|
setAmount: (amount: number | null) => void;
|
|
275
287
|
};
|
|
276
288
|
|
|
289
|
+
declare function fetchProviders(apiBaseUrl: string, token: string): Promise<Provider[]>;
|
|
290
|
+
declare function fetchChains(apiBaseUrl: string, token: string): Promise<Chain[]>;
|
|
291
|
+
declare function fetchAccounts(apiBaseUrl: string, token: string, credentialId: string): Promise<Account[]>;
|
|
292
|
+
interface CreateTransferParams {
|
|
293
|
+
/** Caller-supplied UUID v4 for idempotency. If omitted, a random UUID is generated. */
|
|
294
|
+
id?: string;
|
|
295
|
+
credentialId: string;
|
|
296
|
+
merchantAuthorization?: MerchantAuthorization;
|
|
297
|
+
sourceType: SourceType;
|
|
298
|
+
sourceId: string;
|
|
299
|
+
destination: Destination;
|
|
300
|
+
amount: number;
|
|
301
|
+
currency?: string;
|
|
302
|
+
}
|
|
303
|
+
declare function createTransfer(apiBaseUrl: string, token: string, params: CreateTransferParams): Promise<Transfer>;
|
|
304
|
+
declare function fetchMerchantPublicKey(apiBaseUrl: string, merchantId: string): Promise<MerchantPublicKey>;
|
|
305
|
+
declare function fetchTransfer(apiBaseUrl: string, token: string, transferId: string, authorizationSessionToken?: string): Promise<Transfer>;
|
|
306
|
+
/**
|
|
307
|
+
* Submit a passkey-signed UserOperation for a transfer.
|
|
308
|
+
* PATCH /v1/transfers/{transferId}
|
|
309
|
+
*/
|
|
310
|
+
declare function signTransfer(apiBaseUrl: string, token: string, transferId: string, signedUserOp: Record<string, unknown>, authorizationSessionToken?: string): Promise<Transfer>;
|
|
311
|
+
declare function fetchAuthorizationSession(apiBaseUrl: string, sessionId: string): Promise<AuthorizationSessionDetail>;
|
|
312
|
+
/**
|
|
313
|
+
* Registers a WebAuthn passkey for the authenticated user.
|
|
314
|
+
* POST /v1/users/config/passkey
|
|
315
|
+
*/
|
|
316
|
+
declare function registerPasskey(apiBaseUrl: string, token: string, credentialId: string, publicKey: string): Promise<void>;
|
|
317
|
+
/**
|
|
318
|
+
* Fetches the authenticated user's config, including passkey status.
|
|
319
|
+
* GET /v1/users/config
|
|
320
|
+
*/
|
|
321
|
+
declare function fetchUserConfig(apiBaseUrl: string, token: string): Promise<{
|
|
322
|
+
id: string;
|
|
323
|
+
config: UserConfig;
|
|
324
|
+
}>;
|
|
325
|
+
declare function updateUserConfig(apiBaseUrl: string, token: string, config: {
|
|
326
|
+
defaultAllowance: number;
|
|
327
|
+
}): Promise<void>;
|
|
328
|
+
/**
|
|
329
|
+
* Updates the user's default allowance, authenticated by session ID.
|
|
330
|
+
* PATCH /v1/authorization-sessions/{id}/user-config
|
|
331
|
+
*
|
|
332
|
+
* This does not require a bearer token — the session ID itself serves
|
|
333
|
+
* as proof of authorization.
|
|
334
|
+
*/
|
|
335
|
+
declare function updateUserConfigBySession(apiBaseUrl: string, sessionId: string, config: {
|
|
336
|
+
defaultAllowance: number;
|
|
337
|
+
}): Promise<void>;
|
|
338
|
+
declare function reportActionCompletion(apiBaseUrl: string, actionId: string, result: Record<string, unknown>): Promise<AuthorizationSessionDetail>;
|
|
339
|
+
|
|
340
|
+
type api_CreateTransferParams = CreateTransferParams;
|
|
341
|
+
declare const api_createTransfer: typeof createTransfer;
|
|
342
|
+
declare const api_fetchAccounts: typeof fetchAccounts;
|
|
343
|
+
declare const api_fetchAuthorizationSession: typeof fetchAuthorizationSession;
|
|
344
|
+
declare const api_fetchChains: typeof fetchChains;
|
|
345
|
+
declare const api_fetchMerchantPublicKey: typeof fetchMerchantPublicKey;
|
|
346
|
+
declare const api_fetchProviders: typeof fetchProviders;
|
|
347
|
+
declare const api_fetchTransfer: typeof fetchTransfer;
|
|
348
|
+
declare const api_fetchUserConfig: typeof fetchUserConfig;
|
|
349
|
+
declare const api_registerPasskey: typeof registerPasskey;
|
|
350
|
+
declare const api_reportActionCompletion: typeof reportActionCompletion;
|
|
351
|
+
declare const api_signTransfer: typeof signTransfer;
|
|
352
|
+
declare const api_updateUserConfig: typeof updateUserConfig;
|
|
353
|
+
declare const api_updateUserConfigBySession: typeof updateUserConfigBySession;
|
|
354
|
+
declare namespace api {
|
|
355
|
+
export { type api_CreateTransferParams as CreateTransferParams, api_createTransfer as createTransfer, api_fetchAccounts as fetchAccounts, api_fetchAuthorizationSession as fetchAuthorizationSession, api_fetchChains as fetchChains, api_fetchMerchantPublicKey as fetchMerchantPublicKey, 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 };
|
|
356
|
+
}
|
|
357
|
+
|
|
277
358
|
interface SwypePaymentProps {
|
|
278
359
|
/**
|
|
279
360
|
* Where the funds go -- controlled by the host app (merchant).
|
|
@@ -305,8 +386,10 @@ interface SwypePaymentProps {
|
|
|
305
386
|
* flow without creating duplicate transfers.
|
|
306
387
|
*/
|
|
307
388
|
idempotencyKey?: string;
|
|
389
|
+
/** Merchant-signed transfer authorization envelope required by the API. */
|
|
390
|
+
merchantAuthorization?: CreateTransferParams['merchantAuthorization'];
|
|
308
391
|
}
|
|
309
|
-
declare function SwypePayment({ destination, onComplete, onError, useWalletConnector, idempotencyKey, }: SwypePaymentProps): react_jsx_runtime.JSX.Element | null;
|
|
392
|
+
declare function SwypePayment({ destination, onComplete, onError, useWalletConnector, idempotencyKey, merchantAuthorization, }: SwypePaymentProps): react_jsx_runtime.JSX.Element | null;
|
|
310
393
|
|
|
311
394
|
type AccessTokenGetter = () => Promise<string | null | undefined>;
|
|
312
395
|
/**
|
|
@@ -420,70 +503,4 @@ interface UseTransferSigningOptions {
|
|
|
420
503
|
*/
|
|
421
504
|
declare function useTransferSigning(pollIntervalMs?: number, options?: UseTransferSigningOptions): UseTransferSigningResult;
|
|
422
505
|
|
|
423
|
-
|
|
424
|
-
declare function fetchChains(apiBaseUrl: string, token: string): Promise<Chain[]>;
|
|
425
|
-
declare function fetchAccounts(apiBaseUrl: string, token: string, credentialId: string): Promise<Account[]>;
|
|
426
|
-
interface CreateTransferParams {
|
|
427
|
-
/** Caller-supplied UUID v4 for idempotency. If omitted, a random UUID is generated. */
|
|
428
|
-
id?: string;
|
|
429
|
-
credentialId: string;
|
|
430
|
-
sourceType: SourceType;
|
|
431
|
-
sourceId: string;
|
|
432
|
-
destination: Destination;
|
|
433
|
-
amount: number;
|
|
434
|
-
currency?: string;
|
|
435
|
-
}
|
|
436
|
-
declare function createTransfer(apiBaseUrl: string, token: string, params: CreateTransferParams): Promise<Transfer>;
|
|
437
|
-
declare function fetchTransfer(apiBaseUrl: string, token: string, transferId: string, authorizationSessionToken?: string): Promise<Transfer>;
|
|
438
|
-
/**
|
|
439
|
-
* Submit a passkey-signed UserOperation for a transfer.
|
|
440
|
-
* PATCH /v1/transfers/{transferId}
|
|
441
|
-
*/
|
|
442
|
-
declare function signTransfer(apiBaseUrl: string, token: string, transferId: string, signedUserOp: Record<string, unknown>, authorizationSessionToken?: string): Promise<Transfer>;
|
|
443
|
-
declare function fetchAuthorizationSession(apiBaseUrl: string, sessionId: string): Promise<AuthorizationSessionDetail>;
|
|
444
|
-
/**
|
|
445
|
-
* Registers a WebAuthn passkey for the authenticated user.
|
|
446
|
-
* POST /v1/users/config/passkey
|
|
447
|
-
*/
|
|
448
|
-
declare function registerPasskey(apiBaseUrl: string, token: string, credentialId: string, publicKey: string): Promise<void>;
|
|
449
|
-
/**
|
|
450
|
-
* Fetches the authenticated user's config, including passkey status.
|
|
451
|
-
* GET /v1/users/config
|
|
452
|
-
*/
|
|
453
|
-
declare function fetchUserConfig(apiBaseUrl: string, token: string): Promise<{
|
|
454
|
-
id: string;
|
|
455
|
-
config: UserConfig;
|
|
456
|
-
}>;
|
|
457
|
-
declare function updateUserConfig(apiBaseUrl: string, token: string, config: {
|
|
458
|
-
defaultAllowance: number;
|
|
459
|
-
}): Promise<void>;
|
|
460
|
-
/**
|
|
461
|
-
* Updates the user's default allowance, authenticated by session ID.
|
|
462
|
-
* PATCH /v1/authorization-sessions/{id}/user-config
|
|
463
|
-
*
|
|
464
|
-
* This does not require a bearer token — the session ID itself serves
|
|
465
|
-
* as proof of authorization.
|
|
466
|
-
*/
|
|
467
|
-
declare function updateUserConfigBySession(apiBaseUrl: string, sessionId: string, config: {
|
|
468
|
-
defaultAllowance: number;
|
|
469
|
-
}): Promise<void>;
|
|
470
|
-
declare function reportActionCompletion(apiBaseUrl: string, actionId: string, result: Record<string, unknown>): Promise<AuthorizationSessionDetail>;
|
|
471
|
-
|
|
472
|
-
type api_CreateTransferParams = CreateTransferParams;
|
|
473
|
-
declare const api_createTransfer: typeof createTransfer;
|
|
474
|
-
declare const api_fetchAccounts: typeof fetchAccounts;
|
|
475
|
-
declare const api_fetchAuthorizationSession: typeof fetchAuthorizationSession;
|
|
476
|
-
declare const api_fetchChains: typeof fetchChains;
|
|
477
|
-
declare const api_fetchProviders: typeof fetchProviders;
|
|
478
|
-
declare const api_fetchTransfer: typeof fetchTransfer;
|
|
479
|
-
declare const api_fetchUserConfig: typeof fetchUserConfig;
|
|
480
|
-
declare const api_registerPasskey: typeof registerPasskey;
|
|
481
|
-
declare const api_reportActionCompletion: typeof reportActionCompletion;
|
|
482
|
-
declare const api_signTransfer: typeof signTransfer;
|
|
483
|
-
declare const api_updateUserConfig: typeof updateUserConfig;
|
|
484
|
-
declare const api_updateUserConfigBySession: typeof updateUserConfigBySession;
|
|
485
|
-
declare namespace api {
|
|
486
|
-
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 };
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
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, deviceHasPasskey, findDevicePasskey, getTheme, lightTheme, api as swypeApi, useAuthorizationExecutor, useSwypeConfig, useSwypeDepositAmount, useTransferPolling, useTransferSigning };
|
|
506
|
+
export { type Account, type ActionExecutionResult, type AdvancedSettings, type Amount, type AuthorizationAction, type AuthorizationSession, type AuthorizationSessionDetail, type Chain, type Destination, type ErrorResponse, type ListResponse, type MerchantAuthorization, type MerchantPublicKey, 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, deviceHasPasskey, findDevicePasskey, getTheme, lightTheme, api as swypeApi, useAuthorizationExecutor, useSwypeConfig, useSwypeDepositAmount, useTransferPolling, useTransferSigning };
|