@swype-org/react-sdk 0.1.230 → 0.1.237
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 +1322 -973
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +65 -45
- package/dist/index.d.ts +65 -45
- package/dist/index.js +1322 -973
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -350,6 +350,7 @@ declare function fetchTransfer(apiBaseUrl: string, token: string, transferId: st
|
|
|
350
350
|
*/
|
|
351
351
|
declare function signTransfer(apiBaseUrl: string, token: string, transferId: string, signedUserOp: Record<string, unknown>, authorizationSessionToken?: string): Promise<Transfer>;
|
|
352
352
|
declare function fetchAuthorizationSession(apiBaseUrl: string, sessionId: string): Promise<AuthorizationSessionDetail>;
|
|
353
|
+
declare function fetchAuthorizationSessionByToken(apiBaseUrl: string, token: string): Promise<AuthorizationSessionDetail>;
|
|
353
354
|
/**
|
|
354
355
|
* Registers a WebAuthn passkey for the authenticated user.
|
|
355
356
|
* POST /v1/users/config/passkey
|
|
@@ -374,11 +375,12 @@ declare function updateUserConfig(apiBaseUrl: string, token: string, config: {
|
|
|
374
375
|
defaultAllowance: number;
|
|
375
376
|
}): Promise<void>;
|
|
376
377
|
/**
|
|
377
|
-
* Updates
|
|
378
|
+
* Updates default allowance for the authorization session.
|
|
378
379
|
* PATCH /v1/authorization-sessions/{id}/user-config
|
|
379
380
|
*
|
|
380
|
-
*
|
|
381
|
-
*
|
|
381
|
+
* No bearer token — the session ID is the credential. When the session has no
|
|
382
|
+
* linked user yet (e.g. guest account setup), config is stored on the session
|
|
383
|
+
* and used as the account allowance until the user is claimed.
|
|
382
384
|
*/
|
|
383
385
|
declare function updateUserConfigBySession(apiBaseUrl: string, sessionId: string, config: {
|
|
384
386
|
defaultAllowance: number;
|
|
@@ -462,6 +464,7 @@ declare function setAccountOwner(apiBaseUrl: string, accessToken: string, accoun
|
|
|
462
464
|
}): Promise<{
|
|
463
465
|
accountId: string;
|
|
464
466
|
smartAccountAddress: string;
|
|
467
|
+
userOpHash: string;
|
|
465
468
|
}>;
|
|
466
469
|
declare function reportActionCompletion(apiBaseUrl: string, actionId: string, result: Record<string, unknown>): Promise<AuthorizationSessionDetail>;
|
|
467
470
|
|
|
@@ -478,6 +481,7 @@ declare const api_createTransfer: typeof createTransfer;
|
|
|
478
481
|
declare const api_fetchAccount: typeof fetchAccount;
|
|
479
482
|
declare const api_fetchAccounts: typeof fetchAccounts;
|
|
480
483
|
declare const api_fetchAuthorizationSession: typeof fetchAuthorizationSession;
|
|
484
|
+
declare const api_fetchAuthorizationSessionByToken: typeof fetchAuthorizationSessionByToken;
|
|
481
485
|
declare const api_fetchChains: typeof fetchChains;
|
|
482
486
|
declare const api_fetchGuestAccount: typeof fetchGuestAccount;
|
|
483
487
|
declare const api_fetchGuestTransferBalances: typeof fetchGuestTransferBalances;
|
|
@@ -497,7 +501,7 @@ declare const api_signTransfer: typeof signTransfer;
|
|
|
497
501
|
declare const api_updateUserConfig: typeof updateUserConfig;
|
|
498
502
|
declare const api_updateUserConfigBySession: typeof updateUserConfigBySession;
|
|
499
503
|
declare namespace api {
|
|
500
|
-
export { type api_CreateAccountParams as CreateAccountParams, type api_CreateGuestTransferParams as CreateGuestTransferParams, type api_CreateTransferParams as CreateTransferParams, type api_GuestBalanceOption as GuestBalanceOption, type api_GuestTransferResult as GuestTransferResult, api_createAccount as createAccount, api_createAccountAuthorizationSession as createAccountAuthorizationSession, api_createGuestAccount as createGuestAccount, api_createGuestTransfer as createGuestTransfer, api_createTransfer as createTransfer, api_fetchAccount as fetchAccount, api_fetchAccounts as fetchAccounts, api_fetchAuthorizationSession as fetchAuthorizationSession, api_fetchChains as fetchChains, api_fetchGuestAccount as fetchGuestAccount, api_fetchGuestTransferBalances as fetchGuestTransferBalances, api_fetchMerchantPublicKey as fetchMerchantPublicKey, api_fetchProviders as fetchProviders, api_fetchTransfer as fetchTransfer, api_fetchUserConfig as fetchUserConfig, api_getGuestTransfer as getGuestTransfer, api_getTransferByGuestToken as getTransferByGuestToken, api_registerPasskey as registerPasskey, api_reportActionCompletion as reportActionCompletion, api_reportPasskeyActivity as reportPasskeyActivity, api_setAccountOwner as setAccountOwner, api_setTransferSender as setTransferSender, api_signGuestTransfer as signGuestTransfer, api_signTransfer as signTransfer, api_updateUserConfig as updateUserConfig, api_updateUserConfigBySession as updateUserConfigBySession };
|
|
504
|
+
export { type api_CreateAccountParams as CreateAccountParams, type api_CreateGuestTransferParams as CreateGuestTransferParams, type api_CreateTransferParams as CreateTransferParams, type api_GuestBalanceOption as GuestBalanceOption, type api_GuestTransferResult as GuestTransferResult, api_createAccount as createAccount, api_createAccountAuthorizationSession as createAccountAuthorizationSession, api_createGuestAccount as createGuestAccount, api_createGuestTransfer as createGuestTransfer, api_createTransfer as createTransfer, api_fetchAccount as fetchAccount, api_fetchAccounts as fetchAccounts, api_fetchAuthorizationSession as fetchAuthorizationSession, api_fetchAuthorizationSessionByToken as fetchAuthorizationSessionByToken, api_fetchChains as fetchChains, api_fetchGuestAccount as fetchGuestAccount, api_fetchGuestTransferBalances as fetchGuestTransferBalances, api_fetchMerchantPublicKey as fetchMerchantPublicKey, api_fetchProviders as fetchProviders, api_fetchTransfer as fetchTransfer, api_fetchUserConfig as fetchUserConfig, api_getGuestTransfer as getGuestTransfer, api_getTransferByGuestToken as getTransferByGuestToken, api_registerPasskey as registerPasskey, api_reportActionCompletion as reportActionCompletion, api_reportPasskeyActivity as reportPasskeyActivity, api_setAccountOwner as setAccountOwner, api_setTransferSender as setTransferSender, api_signGuestTransfer as signGuestTransfer, api_signTransfer as signTransfer, api_updateUserConfig as updateUserConfig, api_updateUserConfigBySession as updateUserConfigBySession };
|
|
501
505
|
}
|
|
502
506
|
|
|
503
507
|
interface BlinkPaymentProps {
|
|
@@ -603,19 +607,7 @@ interface PasskeyVerifyPopupOptions {
|
|
|
603
607
|
*/
|
|
604
608
|
declare function findDevicePasskeyViaPopup(options: PasskeyVerifyPopupOptions): Promise<string | null>;
|
|
605
609
|
|
|
606
|
-
type AccessTokenGetter = () => Promise<string | null | undefined>;
|
|
607
610
|
declare function resolvePasskeyRpId(): string;
|
|
608
|
-
/**
|
|
609
|
-
* Creates a WebAuthn passkey credential.
|
|
610
|
-
* Used for upfront passkey registration before the authorization flow.
|
|
611
|
-
*
|
|
612
|
-
* @param params.userId - Globally unique user identifier (e.g. Privy DID).
|
|
613
|
-
* Used as the WebAuthn `user.id` handle so each user gets a distinct
|
|
614
|
-
* credential slot on the authenticator.
|
|
615
|
-
* @param params.displayName - Human-readable label shown in the OS passkey
|
|
616
|
-
* prompt (e.g. the user's email address or name).
|
|
617
|
-
* @returns The base64-encoded credentialId and publicKey.
|
|
618
|
-
*/
|
|
619
611
|
declare function createPasskeyCredential(params: {
|
|
620
612
|
userId: string;
|
|
621
613
|
displayName: string;
|
|
@@ -653,6 +645,7 @@ declare function deviceHasPasskey(credentialId: string): Promise<boolean>;
|
|
|
653
645
|
* @returns The matching credential ID, or `null` if none are on this device.
|
|
654
646
|
*/
|
|
655
647
|
declare function findDevicePasskey(credentialIds: string[]): Promise<string | null>;
|
|
648
|
+
|
|
656
649
|
interface UseTransferPollingResult {
|
|
657
650
|
transfer: Transfer | null;
|
|
658
651
|
error: string | null;
|
|
@@ -665,6 +658,7 @@ interface UseTransferPollingResult {
|
|
|
665
658
|
* COMPLETED or FAILED.
|
|
666
659
|
*/
|
|
667
660
|
declare function useTransferPolling(intervalMs?: number): UseTransferPollingResult;
|
|
661
|
+
|
|
668
662
|
interface UseAuthorizationExecutorResult {
|
|
669
663
|
executing: boolean;
|
|
670
664
|
results: ActionExecutionResult[];
|
|
@@ -704,6 +698,8 @@ interface UseAuthorizationExecutorOptions {
|
|
|
704
698
|
* `useTransferSigning()` after the authorization flow completes.
|
|
705
699
|
*/
|
|
706
700
|
declare function useAuthorizationExecutor(options?: UseAuthorizationExecutorOptions): UseAuthorizationExecutorResult;
|
|
701
|
+
|
|
702
|
+
type AccessTokenGetter = () => Promise<string | null | undefined>;
|
|
707
703
|
interface UseTransferSigningResult {
|
|
708
704
|
signing: boolean;
|
|
709
705
|
signPayload: TransferSignPayload | null;
|
|
@@ -833,35 +829,59 @@ interface NormalizedAuthIdentifier {
|
|
|
833
829
|
}
|
|
834
830
|
|
|
835
831
|
type ScreenName = 'loading' | 'login' | 'otp-verify' | 'create-passkey' | 'verify-passkey' | 'success' | 'processing' | 'confirm-sign' | 'select-source' | 'setup' | 'open-wallet' | 'setup-status' | 'guest-token-picker' | 'wallet-picker' | 'token-picker' | 'deposit';
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
832
|
+
interface MobileFlowState {
|
|
833
|
+
deeplinkUri: string;
|
|
834
|
+
providerId: string | null;
|
|
835
|
+
}
|
|
836
|
+
type PaymentPhase = {
|
|
837
|
+
step: 'initializing';
|
|
838
|
+
} | {
|
|
839
|
+
step: 'login';
|
|
840
|
+
} | {
|
|
841
|
+
step: 'otp-verify';
|
|
842
|
+
target: NormalizedAuthIdentifier;
|
|
843
|
+
} | {
|
|
844
|
+
step: 'passkey-create';
|
|
845
|
+
popupFallback: boolean;
|
|
846
|
+
} | {
|
|
847
|
+
step: 'passkey-verify';
|
|
848
|
+
} | {
|
|
849
|
+
step: 'data-loading';
|
|
850
|
+
} | {
|
|
851
|
+
step: 'wallet-picker';
|
|
852
|
+
reason: 'link' | 'switch' | 'entry' | 'guest-entry';
|
|
853
|
+
} | {
|
|
854
|
+
step: 'wallet-setup';
|
|
855
|
+
mobile: MobileFlowState | null;
|
|
856
|
+
accountId: string | null;
|
|
857
|
+
} | {
|
|
858
|
+
step: 'select-source';
|
|
859
|
+
action: AuthorizationAction;
|
|
856
860
|
isDesktop: boolean;
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
861
|
+
} | {
|
|
862
|
+
step: 'one-tap-setup';
|
|
863
|
+
action: AuthorizationAction | null;
|
|
864
|
+
} | {
|
|
865
|
+
step: 'guest-token-picker';
|
|
866
|
+
} | {
|
|
867
|
+
step: 'token-picker';
|
|
868
|
+
} | {
|
|
869
|
+
step: 'deposit';
|
|
870
|
+
} | {
|
|
871
|
+
step: 'processing';
|
|
872
|
+
transfer: Transfer | null;
|
|
873
|
+
} | {
|
|
874
|
+
step: 'confirm-sign';
|
|
875
|
+
transfer: Transfer;
|
|
876
|
+
} | {
|
|
877
|
+
step: 'completed';
|
|
878
|
+
transfer: Transfer;
|
|
879
|
+
} | {
|
|
880
|
+
step: 'failed';
|
|
881
|
+
transfer: Transfer;
|
|
882
|
+
error: string;
|
|
883
|
+
};
|
|
884
|
+
declare function screenForPhase(phase: PaymentPhase): ScreenName;
|
|
865
885
|
|
|
866
886
|
interface SetupScreenProps {
|
|
867
887
|
availableBalance: number;
|
|
@@ -955,4 +975,4 @@ declare const BLINK_LOGO: string;
|
|
|
955
975
|
/** @deprecated Use BLINK_LOGO instead. Kept for backward compatibility. */
|
|
956
976
|
declare const BLINK_MASCOT: string;
|
|
957
977
|
|
|
958
|
-
export { type Account, type ActionExecutionResult, type AdvancedSettings, AdvancedSourceScreen, type Amount, type AuthorizationAction, type AuthorizationSession, type AuthorizationSessionDetail, BLINK_LOGO, BLINK_MASCOT, BlinkLoadingScreen, BlinkPayment, type BlinkPaymentProps, BlinkProvider, type BlinkProviderProps, type Chain, type Destination, type ErrorResponse, type FlowPhase, FlowPhaseProvider, IconCircle, InfoBanner, type ListResponse, type MerchantAuthorization, type MerchantPublicKey, OutlineButton, PasskeyIframeBlockedError, PasskeyScreen, PoweredByFooter, PrimaryButton, type Provider,
|
|
978
|
+
export { type Account, type ActionExecutionResult, type AdvancedSettings, AdvancedSourceScreen, type Amount, type AuthorizationAction, type AuthorizationSession, type AuthorizationSessionDetail, BLINK_LOGO, BLINK_MASCOT, BlinkLoadingScreen, BlinkPayment, type BlinkPaymentProps, BlinkProvider, type BlinkProviderProps, type Chain, type Destination, type ErrorResponse, type FlowPhase, FlowPhaseProvider, IconCircle, InfoBanner, type ListResponse, type MerchantAuthorization, type MerchantPublicKey, type MobileFlowState, OutlineButton, PasskeyIframeBlockedError, PasskeyScreen, type PaymentPhase, PoweredByFooter, PrimaryButton, type Provider, ScreenHeader, ScreenLayout, type ScreenName, SelectSourceScreen, SettingsMenu, SetupScreen, type SourceOption, type SourceSelection, type SourceType, Spinner, type StepItem, StepList, type ThemeMode, type ThemeTokens, type TokenBalance, TokenPickerScreen, type Transfer, type TransferDestination, type UserConfig, type Wallet, type WalletSource, type WalletToken, api as blinkApi, buildPasskeyPopupOptions, createPasskeyCredential, createPasskeyViaPopup, darkTheme, deviceHasPasskey, findDevicePasskey, findDevicePasskeyViaPopup, getTheme, lightTheme, resolvePasskeyRpId, screenForPhase, useAuthorizationExecutor, useBlinkConfig, useBlinkDepositAmount, useTransferPolling, useTransferSigning };
|
package/dist/index.d.ts
CHANGED
|
@@ -350,6 +350,7 @@ declare function fetchTransfer(apiBaseUrl: string, token: string, transferId: st
|
|
|
350
350
|
*/
|
|
351
351
|
declare function signTransfer(apiBaseUrl: string, token: string, transferId: string, signedUserOp: Record<string, unknown>, authorizationSessionToken?: string): Promise<Transfer>;
|
|
352
352
|
declare function fetchAuthorizationSession(apiBaseUrl: string, sessionId: string): Promise<AuthorizationSessionDetail>;
|
|
353
|
+
declare function fetchAuthorizationSessionByToken(apiBaseUrl: string, token: string): Promise<AuthorizationSessionDetail>;
|
|
353
354
|
/**
|
|
354
355
|
* Registers a WebAuthn passkey for the authenticated user.
|
|
355
356
|
* POST /v1/users/config/passkey
|
|
@@ -374,11 +375,12 @@ declare function updateUserConfig(apiBaseUrl: string, token: string, config: {
|
|
|
374
375
|
defaultAllowance: number;
|
|
375
376
|
}): Promise<void>;
|
|
376
377
|
/**
|
|
377
|
-
* Updates
|
|
378
|
+
* Updates default allowance for the authorization session.
|
|
378
379
|
* PATCH /v1/authorization-sessions/{id}/user-config
|
|
379
380
|
*
|
|
380
|
-
*
|
|
381
|
-
*
|
|
381
|
+
* No bearer token — the session ID is the credential. When the session has no
|
|
382
|
+
* linked user yet (e.g. guest account setup), config is stored on the session
|
|
383
|
+
* and used as the account allowance until the user is claimed.
|
|
382
384
|
*/
|
|
383
385
|
declare function updateUserConfigBySession(apiBaseUrl: string, sessionId: string, config: {
|
|
384
386
|
defaultAllowance: number;
|
|
@@ -462,6 +464,7 @@ declare function setAccountOwner(apiBaseUrl: string, accessToken: string, accoun
|
|
|
462
464
|
}): Promise<{
|
|
463
465
|
accountId: string;
|
|
464
466
|
smartAccountAddress: string;
|
|
467
|
+
userOpHash: string;
|
|
465
468
|
}>;
|
|
466
469
|
declare function reportActionCompletion(apiBaseUrl: string, actionId: string, result: Record<string, unknown>): Promise<AuthorizationSessionDetail>;
|
|
467
470
|
|
|
@@ -478,6 +481,7 @@ declare const api_createTransfer: typeof createTransfer;
|
|
|
478
481
|
declare const api_fetchAccount: typeof fetchAccount;
|
|
479
482
|
declare const api_fetchAccounts: typeof fetchAccounts;
|
|
480
483
|
declare const api_fetchAuthorizationSession: typeof fetchAuthorizationSession;
|
|
484
|
+
declare const api_fetchAuthorizationSessionByToken: typeof fetchAuthorizationSessionByToken;
|
|
481
485
|
declare const api_fetchChains: typeof fetchChains;
|
|
482
486
|
declare const api_fetchGuestAccount: typeof fetchGuestAccount;
|
|
483
487
|
declare const api_fetchGuestTransferBalances: typeof fetchGuestTransferBalances;
|
|
@@ -497,7 +501,7 @@ declare const api_signTransfer: typeof signTransfer;
|
|
|
497
501
|
declare const api_updateUserConfig: typeof updateUserConfig;
|
|
498
502
|
declare const api_updateUserConfigBySession: typeof updateUserConfigBySession;
|
|
499
503
|
declare namespace api {
|
|
500
|
-
export { type api_CreateAccountParams as CreateAccountParams, type api_CreateGuestTransferParams as CreateGuestTransferParams, type api_CreateTransferParams as CreateTransferParams, type api_GuestBalanceOption as GuestBalanceOption, type api_GuestTransferResult as GuestTransferResult, api_createAccount as createAccount, api_createAccountAuthorizationSession as createAccountAuthorizationSession, api_createGuestAccount as createGuestAccount, api_createGuestTransfer as createGuestTransfer, api_createTransfer as createTransfer, api_fetchAccount as fetchAccount, api_fetchAccounts as fetchAccounts, api_fetchAuthorizationSession as fetchAuthorizationSession, api_fetchChains as fetchChains, api_fetchGuestAccount as fetchGuestAccount, api_fetchGuestTransferBalances as fetchGuestTransferBalances, api_fetchMerchantPublicKey as fetchMerchantPublicKey, api_fetchProviders as fetchProviders, api_fetchTransfer as fetchTransfer, api_fetchUserConfig as fetchUserConfig, api_getGuestTransfer as getGuestTransfer, api_getTransferByGuestToken as getTransferByGuestToken, api_registerPasskey as registerPasskey, api_reportActionCompletion as reportActionCompletion, api_reportPasskeyActivity as reportPasskeyActivity, api_setAccountOwner as setAccountOwner, api_setTransferSender as setTransferSender, api_signGuestTransfer as signGuestTransfer, api_signTransfer as signTransfer, api_updateUserConfig as updateUserConfig, api_updateUserConfigBySession as updateUserConfigBySession };
|
|
504
|
+
export { type api_CreateAccountParams as CreateAccountParams, type api_CreateGuestTransferParams as CreateGuestTransferParams, type api_CreateTransferParams as CreateTransferParams, type api_GuestBalanceOption as GuestBalanceOption, type api_GuestTransferResult as GuestTransferResult, api_createAccount as createAccount, api_createAccountAuthorizationSession as createAccountAuthorizationSession, api_createGuestAccount as createGuestAccount, api_createGuestTransfer as createGuestTransfer, api_createTransfer as createTransfer, api_fetchAccount as fetchAccount, api_fetchAccounts as fetchAccounts, api_fetchAuthorizationSession as fetchAuthorizationSession, api_fetchAuthorizationSessionByToken as fetchAuthorizationSessionByToken, api_fetchChains as fetchChains, api_fetchGuestAccount as fetchGuestAccount, api_fetchGuestTransferBalances as fetchGuestTransferBalances, api_fetchMerchantPublicKey as fetchMerchantPublicKey, api_fetchProviders as fetchProviders, api_fetchTransfer as fetchTransfer, api_fetchUserConfig as fetchUserConfig, api_getGuestTransfer as getGuestTransfer, api_getTransferByGuestToken as getTransferByGuestToken, api_registerPasskey as registerPasskey, api_reportActionCompletion as reportActionCompletion, api_reportPasskeyActivity as reportPasskeyActivity, api_setAccountOwner as setAccountOwner, api_setTransferSender as setTransferSender, api_signGuestTransfer as signGuestTransfer, api_signTransfer as signTransfer, api_updateUserConfig as updateUserConfig, api_updateUserConfigBySession as updateUserConfigBySession };
|
|
501
505
|
}
|
|
502
506
|
|
|
503
507
|
interface BlinkPaymentProps {
|
|
@@ -603,19 +607,7 @@ interface PasskeyVerifyPopupOptions {
|
|
|
603
607
|
*/
|
|
604
608
|
declare function findDevicePasskeyViaPopup(options: PasskeyVerifyPopupOptions): Promise<string | null>;
|
|
605
609
|
|
|
606
|
-
type AccessTokenGetter = () => Promise<string | null | undefined>;
|
|
607
610
|
declare function resolvePasskeyRpId(): string;
|
|
608
|
-
/**
|
|
609
|
-
* Creates a WebAuthn passkey credential.
|
|
610
|
-
* Used for upfront passkey registration before the authorization flow.
|
|
611
|
-
*
|
|
612
|
-
* @param params.userId - Globally unique user identifier (e.g. Privy DID).
|
|
613
|
-
* Used as the WebAuthn `user.id` handle so each user gets a distinct
|
|
614
|
-
* credential slot on the authenticator.
|
|
615
|
-
* @param params.displayName - Human-readable label shown in the OS passkey
|
|
616
|
-
* prompt (e.g. the user's email address or name).
|
|
617
|
-
* @returns The base64-encoded credentialId and publicKey.
|
|
618
|
-
*/
|
|
619
611
|
declare function createPasskeyCredential(params: {
|
|
620
612
|
userId: string;
|
|
621
613
|
displayName: string;
|
|
@@ -653,6 +645,7 @@ declare function deviceHasPasskey(credentialId: string): Promise<boolean>;
|
|
|
653
645
|
* @returns The matching credential ID, or `null` if none are on this device.
|
|
654
646
|
*/
|
|
655
647
|
declare function findDevicePasskey(credentialIds: string[]): Promise<string | null>;
|
|
648
|
+
|
|
656
649
|
interface UseTransferPollingResult {
|
|
657
650
|
transfer: Transfer | null;
|
|
658
651
|
error: string | null;
|
|
@@ -665,6 +658,7 @@ interface UseTransferPollingResult {
|
|
|
665
658
|
* COMPLETED or FAILED.
|
|
666
659
|
*/
|
|
667
660
|
declare function useTransferPolling(intervalMs?: number): UseTransferPollingResult;
|
|
661
|
+
|
|
668
662
|
interface UseAuthorizationExecutorResult {
|
|
669
663
|
executing: boolean;
|
|
670
664
|
results: ActionExecutionResult[];
|
|
@@ -704,6 +698,8 @@ interface UseAuthorizationExecutorOptions {
|
|
|
704
698
|
* `useTransferSigning()` after the authorization flow completes.
|
|
705
699
|
*/
|
|
706
700
|
declare function useAuthorizationExecutor(options?: UseAuthorizationExecutorOptions): UseAuthorizationExecutorResult;
|
|
701
|
+
|
|
702
|
+
type AccessTokenGetter = () => Promise<string | null | undefined>;
|
|
707
703
|
interface UseTransferSigningResult {
|
|
708
704
|
signing: boolean;
|
|
709
705
|
signPayload: TransferSignPayload | null;
|
|
@@ -833,35 +829,59 @@ interface NormalizedAuthIdentifier {
|
|
|
833
829
|
}
|
|
834
830
|
|
|
835
831
|
type ScreenName = 'loading' | 'login' | 'otp-verify' | 'create-passkey' | 'verify-passkey' | 'success' | 'processing' | 'confirm-sign' | 'select-source' | 'setup' | 'open-wallet' | 'setup-status' | 'guest-token-picker' | 'wallet-picker' | 'token-picker' | 'deposit';
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
832
|
+
interface MobileFlowState {
|
|
833
|
+
deeplinkUri: string;
|
|
834
|
+
providerId: string | null;
|
|
835
|
+
}
|
|
836
|
+
type PaymentPhase = {
|
|
837
|
+
step: 'initializing';
|
|
838
|
+
} | {
|
|
839
|
+
step: 'login';
|
|
840
|
+
} | {
|
|
841
|
+
step: 'otp-verify';
|
|
842
|
+
target: NormalizedAuthIdentifier;
|
|
843
|
+
} | {
|
|
844
|
+
step: 'passkey-create';
|
|
845
|
+
popupFallback: boolean;
|
|
846
|
+
} | {
|
|
847
|
+
step: 'passkey-verify';
|
|
848
|
+
} | {
|
|
849
|
+
step: 'data-loading';
|
|
850
|
+
} | {
|
|
851
|
+
step: 'wallet-picker';
|
|
852
|
+
reason: 'link' | 'switch' | 'entry' | 'guest-entry';
|
|
853
|
+
} | {
|
|
854
|
+
step: 'wallet-setup';
|
|
855
|
+
mobile: MobileFlowState | null;
|
|
856
|
+
accountId: string | null;
|
|
857
|
+
} | {
|
|
858
|
+
step: 'select-source';
|
|
859
|
+
action: AuthorizationAction;
|
|
856
860
|
isDesktop: boolean;
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
861
|
+
} | {
|
|
862
|
+
step: 'one-tap-setup';
|
|
863
|
+
action: AuthorizationAction | null;
|
|
864
|
+
} | {
|
|
865
|
+
step: 'guest-token-picker';
|
|
866
|
+
} | {
|
|
867
|
+
step: 'token-picker';
|
|
868
|
+
} | {
|
|
869
|
+
step: 'deposit';
|
|
870
|
+
} | {
|
|
871
|
+
step: 'processing';
|
|
872
|
+
transfer: Transfer | null;
|
|
873
|
+
} | {
|
|
874
|
+
step: 'confirm-sign';
|
|
875
|
+
transfer: Transfer;
|
|
876
|
+
} | {
|
|
877
|
+
step: 'completed';
|
|
878
|
+
transfer: Transfer;
|
|
879
|
+
} | {
|
|
880
|
+
step: 'failed';
|
|
881
|
+
transfer: Transfer;
|
|
882
|
+
error: string;
|
|
883
|
+
};
|
|
884
|
+
declare function screenForPhase(phase: PaymentPhase): ScreenName;
|
|
865
885
|
|
|
866
886
|
interface SetupScreenProps {
|
|
867
887
|
availableBalance: number;
|
|
@@ -955,4 +975,4 @@ declare const BLINK_LOGO: string;
|
|
|
955
975
|
/** @deprecated Use BLINK_LOGO instead. Kept for backward compatibility. */
|
|
956
976
|
declare const BLINK_MASCOT: string;
|
|
957
977
|
|
|
958
|
-
export { type Account, type ActionExecutionResult, type AdvancedSettings, AdvancedSourceScreen, type Amount, type AuthorizationAction, type AuthorizationSession, type AuthorizationSessionDetail, BLINK_LOGO, BLINK_MASCOT, BlinkLoadingScreen, BlinkPayment, type BlinkPaymentProps, BlinkProvider, type BlinkProviderProps, type Chain, type Destination, type ErrorResponse, type FlowPhase, FlowPhaseProvider, IconCircle, InfoBanner, type ListResponse, type MerchantAuthorization, type MerchantPublicKey, OutlineButton, PasskeyIframeBlockedError, PasskeyScreen, PoweredByFooter, PrimaryButton, type Provider,
|
|
978
|
+
export { type Account, type ActionExecutionResult, type AdvancedSettings, AdvancedSourceScreen, type Amount, type AuthorizationAction, type AuthorizationSession, type AuthorizationSessionDetail, BLINK_LOGO, BLINK_MASCOT, BlinkLoadingScreen, BlinkPayment, type BlinkPaymentProps, BlinkProvider, type BlinkProviderProps, type Chain, type Destination, type ErrorResponse, type FlowPhase, FlowPhaseProvider, IconCircle, InfoBanner, type ListResponse, type MerchantAuthorization, type MerchantPublicKey, type MobileFlowState, OutlineButton, PasskeyIframeBlockedError, PasskeyScreen, type PaymentPhase, PoweredByFooter, PrimaryButton, type Provider, ScreenHeader, ScreenLayout, type ScreenName, SelectSourceScreen, SettingsMenu, SetupScreen, type SourceOption, type SourceSelection, type SourceType, Spinner, type StepItem, StepList, type ThemeMode, type ThemeTokens, type TokenBalance, TokenPickerScreen, type Transfer, type TransferDestination, type UserConfig, type Wallet, type WalletSource, type WalletToken, api as blinkApi, buildPasskeyPopupOptions, createPasskeyCredential, createPasskeyViaPopup, darkTheme, deviceHasPasskey, findDevicePasskey, findDevicePasskeyViaPopup, getTheme, lightTheme, resolvePasskeyRpId, screenForPhase, useAuthorizationExecutor, useBlinkConfig, useBlinkDepositAmount, useTransferPolling, useTransferSigning };
|