@volr/react 0.1.120 → 0.1.122

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
@@ -105,6 +105,24 @@ interface PrfInputDto {
105
105
  credentialId: string;
106
106
  salt?: Uint8Array;
107
107
  }
108
+ /**
109
+ * Passkey registered on a specific domain
110
+ * Used for cross-domain migration detection
111
+ */
112
+ interface RegisteredPasskeyDto {
113
+ /** WebAuthn rpId (domain where passkey was registered) */
114
+ rpId: string;
115
+ /** Credential ID */
116
+ credentialId: string;
117
+ /** Blob URL for encrypted seed */
118
+ blobUrl: string;
119
+ /** PRF input for key derivation */
120
+ prfInput: PrfInputDto;
121
+ /** Platform where passkey was created (iOS, macOS, Windows, etc.) */
122
+ platform: string | null;
123
+ /** Timestamp when passkey was created */
124
+ createdAt: string;
125
+ }
108
126
  /**
109
127
  * User DTO
110
128
  * User information received from the backend
@@ -123,6 +141,8 @@ interface UserDto {
123
141
  blobUrl?: string;
124
142
  prfInput?: PrfInputDto;
125
143
  credentialId?: string;
144
+ /** All passkeys registered by this user across different domains */
145
+ registeredPasskeys?: RegisteredPasskeyDto[];
126
146
  }
127
147
  /**
128
148
  * Auth Refresh Response DTO
@@ -230,6 +250,8 @@ interface VolrUser {
230
250
  blobUrl?: string;
231
251
  prfInput?: PrfInputDto;
232
252
  credentialId?: string;
253
+ /** All passkeys registered by this user across different domains */
254
+ registeredPasskeys?: RegisteredPasskeyDto[];
233
255
  }
234
256
  /**
235
257
  * Volr configuration
@@ -1577,4 +1599,4 @@ declare function useEIP6963(): UseEIP6963Return;
1577
1599
  */
1578
1600
  declare function detectWalletConnector(provider: any, providerInfo: EIP6963ProviderInfo | null): string;
1579
1601
 
1580
- export { type ApiResponse, type AuthRefreshResponseDto, type AuthResult, type BrandingData, type BuildCallOptions, type ContractAnalysisResult, DEFAULT_EXPIRES_IN_SEC, DEFAULT_MODE, type DepositAsset$1 as DepositAsset, type DepositConfig, type EIP6963AnnounceProviderEvent, type EIP6963ProviderDetail, type EIP6963ProviderInfo, type ERC20BalanceComparison, type Erc20Token$1 as Erc20Token, type EvmChainClient, type EvmClient, type EvmNamespace, type KeyStorageType, type MigrationCompleteParams, type MigrationCompleteResult, type MigrationError, type MigrationMessage, type MigrationRequestParams, type MigrationRequestResult, type MigrationSeedRequest, type MigrationSeedResponse, type MpcConnectionStep, type NetworkDto, type NetworkInfo, type OnSignRequest, type PasskeyAdapterOptions, type PasskeyEnrollmentStep, PasskeyNotFoundError, type PayOptions, type PaymentContext, type PaymentError, type PaymentHandle, type PaymentHandlers, type PaymentHistoryOptions, type PaymentHistoryResult, type PaymentItem, type PaymentResult, type PaymentStatus, type PaymentToken, type PlatformCheckResult, type PrfCompatibilityResult, type PrfInputDto, PrfNotSupportedError, type SendBatchOverloads, type SendTxOptions, type SignRequest, type SignerType, type SiweSession, type SiweSessionStatus, type SocialProvider, type TokenBalance, type TransactionDto, type TransactionStatus, type UseEIP6963Return, type UseMpcConnectionReturn, type UsePasskeyEnrollmentReturn, type UseUserBalancesReturn, type UseVolrAuthCallbackOptions, type UseVolrAuthCallbackReturn, type UseVolrLoginReturn, type UseVolrPaymentApiReturn, type UseWithdrawReturn, UserCancelledError, type UserDto, type VolrClient, type VolrConfig, type VolrContextValue, VolrProvider, type VolrUser, type WalletDisplayInfo, type WalletStateComparison, type WithdrawParams, analyzeContractForEIP7702, buildCall, buildCalls, checkPrfCompatibility, checkPrfExtensionAvailable, checkPrfSupport, compareERC20Balances, compareWalletStates, completeMigration, createGetNetworkInfo, createPasskeyAdapter, debugTransactionFailure, defaultIdempotencyKey, detectWalletConnector, diagnoseTransactionFailure, getBrowserVersion, getERC20Balance, getIOSVersion, getPasskeyAuthGuidance, getPlatformHint, getUserCredentials, getWalletState, isEIP7702Delegated, isInAppBrowser, isUserCancelledError, listenForSeedRequests, normalizeHex, normalizeHexArray, openMigrationPopup, requestMigration, requestSeedFromOpener, sendSeedToPopup, uploadBlobViaPresign, useDepositListener, useEIP6963, useInternalAuth, useMpcConnection, usePasskeyEnrollment, useUserBalances, useVolr, useVolrAuthCallback, useVolrContext, useVolrLogin, useVolrPaymentApi, useWithdraw };
1602
+ export { type ApiResponse, type AuthRefreshResponseDto, type AuthResult, type BrandingData, type BuildCallOptions, type ContractAnalysisResult, DEFAULT_EXPIRES_IN_SEC, DEFAULT_MODE, type DepositAsset$1 as DepositAsset, type DepositConfig, type EIP6963AnnounceProviderEvent, type EIP6963ProviderDetail, type EIP6963ProviderInfo, type ERC20BalanceComparison, type Erc20Token$1 as Erc20Token, type EvmChainClient, type EvmClient, type EvmNamespace, type KeyStorageType, type MigrationCompleteParams, type MigrationCompleteResult, type MigrationError, type MigrationMessage, type MigrationRequestParams, type MigrationRequestResult, type MigrationSeedRequest, type MigrationSeedResponse, type MpcConnectionStep, type NetworkDto, type NetworkInfo, type OnSignRequest, type PasskeyAdapterOptions, type PasskeyEnrollmentStep, PasskeyNotFoundError, type PayOptions, type PaymentContext, type PaymentError, type PaymentHandle, type PaymentHandlers, type PaymentHistoryOptions, type PaymentHistoryResult, type PaymentItem, type PaymentResult, type PaymentStatus, type PaymentToken, type PlatformCheckResult, type PrfCompatibilityResult, type PrfInputDto, PrfNotSupportedError, type RegisteredPasskeyDto, type SendBatchOverloads, type SendTxOptions, type SignRequest, type SignerType, type SiweSession, type SiweSessionStatus, type SocialProvider, type TokenBalance, type TransactionDto, type TransactionStatus, type UseEIP6963Return, type UseMpcConnectionReturn, type UsePasskeyEnrollmentReturn, type UseUserBalancesReturn, type UseVolrAuthCallbackOptions, type UseVolrAuthCallbackReturn, type UseVolrLoginReturn, type UseVolrPaymentApiReturn, type UseWithdrawReturn, UserCancelledError, type UserDto, type VolrClient, type VolrConfig, type VolrContextValue, VolrProvider, type VolrUser, type WalletDisplayInfo, type WalletStateComparison, type WithdrawParams, analyzeContractForEIP7702, buildCall, buildCalls, checkPrfCompatibility, checkPrfExtensionAvailable, checkPrfSupport, compareERC20Balances, compareWalletStates, completeMigration, createGetNetworkInfo, createPasskeyAdapter, debugTransactionFailure, defaultIdempotencyKey, detectWalletConnector, diagnoseTransactionFailure, getBrowserVersion, getERC20Balance, getIOSVersion, getPasskeyAuthGuidance, getPlatformHint, getUserCredentials, getWalletState, isEIP7702Delegated, isInAppBrowser, isUserCancelledError, listenForSeedRequests, normalizeHex, normalizeHexArray, openMigrationPopup, requestMigration, requestSeedFromOpener, sendSeedToPopup, uploadBlobViaPresign, useDepositListener, useEIP6963, useInternalAuth, useMpcConnection, usePasskeyEnrollment, useUserBalances, useVolr, useVolrAuthCallback, useVolrContext, useVolrLogin, useVolrPaymentApi, useWithdraw };
package/dist/index.d.ts CHANGED
@@ -105,6 +105,24 @@ interface PrfInputDto {
105
105
  credentialId: string;
106
106
  salt?: Uint8Array;
107
107
  }
108
+ /**
109
+ * Passkey registered on a specific domain
110
+ * Used for cross-domain migration detection
111
+ */
112
+ interface RegisteredPasskeyDto {
113
+ /** WebAuthn rpId (domain where passkey was registered) */
114
+ rpId: string;
115
+ /** Credential ID */
116
+ credentialId: string;
117
+ /** Blob URL for encrypted seed */
118
+ blobUrl: string;
119
+ /** PRF input for key derivation */
120
+ prfInput: PrfInputDto;
121
+ /** Platform where passkey was created (iOS, macOS, Windows, etc.) */
122
+ platform: string | null;
123
+ /** Timestamp when passkey was created */
124
+ createdAt: string;
125
+ }
108
126
  /**
109
127
  * User DTO
110
128
  * User information received from the backend
@@ -123,6 +141,8 @@ interface UserDto {
123
141
  blobUrl?: string;
124
142
  prfInput?: PrfInputDto;
125
143
  credentialId?: string;
144
+ /** All passkeys registered by this user across different domains */
145
+ registeredPasskeys?: RegisteredPasskeyDto[];
126
146
  }
127
147
  /**
128
148
  * Auth Refresh Response DTO
@@ -230,6 +250,8 @@ interface VolrUser {
230
250
  blobUrl?: string;
231
251
  prfInput?: PrfInputDto;
232
252
  credentialId?: string;
253
+ /** All passkeys registered by this user across different domains */
254
+ registeredPasskeys?: RegisteredPasskeyDto[];
233
255
  }
234
256
  /**
235
257
  * Volr configuration
@@ -1577,4 +1599,4 @@ declare function useEIP6963(): UseEIP6963Return;
1577
1599
  */
1578
1600
  declare function detectWalletConnector(provider: any, providerInfo: EIP6963ProviderInfo | null): string;
1579
1601
 
1580
- export { type ApiResponse, type AuthRefreshResponseDto, type AuthResult, type BrandingData, type BuildCallOptions, type ContractAnalysisResult, DEFAULT_EXPIRES_IN_SEC, DEFAULT_MODE, type DepositAsset$1 as DepositAsset, type DepositConfig, type EIP6963AnnounceProviderEvent, type EIP6963ProviderDetail, type EIP6963ProviderInfo, type ERC20BalanceComparison, type Erc20Token$1 as Erc20Token, type EvmChainClient, type EvmClient, type EvmNamespace, type KeyStorageType, type MigrationCompleteParams, type MigrationCompleteResult, type MigrationError, type MigrationMessage, type MigrationRequestParams, type MigrationRequestResult, type MigrationSeedRequest, type MigrationSeedResponse, type MpcConnectionStep, type NetworkDto, type NetworkInfo, type OnSignRequest, type PasskeyAdapterOptions, type PasskeyEnrollmentStep, PasskeyNotFoundError, type PayOptions, type PaymentContext, type PaymentError, type PaymentHandle, type PaymentHandlers, type PaymentHistoryOptions, type PaymentHistoryResult, type PaymentItem, type PaymentResult, type PaymentStatus, type PaymentToken, type PlatformCheckResult, type PrfCompatibilityResult, type PrfInputDto, PrfNotSupportedError, type SendBatchOverloads, type SendTxOptions, type SignRequest, type SignerType, type SiweSession, type SiweSessionStatus, type SocialProvider, type TokenBalance, type TransactionDto, type TransactionStatus, type UseEIP6963Return, type UseMpcConnectionReturn, type UsePasskeyEnrollmentReturn, type UseUserBalancesReturn, type UseVolrAuthCallbackOptions, type UseVolrAuthCallbackReturn, type UseVolrLoginReturn, type UseVolrPaymentApiReturn, type UseWithdrawReturn, UserCancelledError, type UserDto, type VolrClient, type VolrConfig, type VolrContextValue, VolrProvider, type VolrUser, type WalletDisplayInfo, type WalletStateComparison, type WithdrawParams, analyzeContractForEIP7702, buildCall, buildCalls, checkPrfCompatibility, checkPrfExtensionAvailable, checkPrfSupport, compareERC20Balances, compareWalletStates, completeMigration, createGetNetworkInfo, createPasskeyAdapter, debugTransactionFailure, defaultIdempotencyKey, detectWalletConnector, diagnoseTransactionFailure, getBrowserVersion, getERC20Balance, getIOSVersion, getPasskeyAuthGuidance, getPlatformHint, getUserCredentials, getWalletState, isEIP7702Delegated, isInAppBrowser, isUserCancelledError, listenForSeedRequests, normalizeHex, normalizeHexArray, openMigrationPopup, requestMigration, requestSeedFromOpener, sendSeedToPopup, uploadBlobViaPresign, useDepositListener, useEIP6963, useInternalAuth, useMpcConnection, usePasskeyEnrollment, useUserBalances, useVolr, useVolrAuthCallback, useVolrContext, useVolrLogin, useVolrPaymentApi, useWithdraw };
1602
+ export { type ApiResponse, type AuthRefreshResponseDto, type AuthResult, type BrandingData, type BuildCallOptions, type ContractAnalysisResult, DEFAULT_EXPIRES_IN_SEC, DEFAULT_MODE, type DepositAsset$1 as DepositAsset, type DepositConfig, type EIP6963AnnounceProviderEvent, type EIP6963ProviderDetail, type EIP6963ProviderInfo, type ERC20BalanceComparison, type Erc20Token$1 as Erc20Token, type EvmChainClient, type EvmClient, type EvmNamespace, type KeyStorageType, type MigrationCompleteParams, type MigrationCompleteResult, type MigrationError, type MigrationMessage, type MigrationRequestParams, type MigrationRequestResult, type MigrationSeedRequest, type MigrationSeedResponse, type MpcConnectionStep, type NetworkDto, type NetworkInfo, type OnSignRequest, type PasskeyAdapterOptions, type PasskeyEnrollmentStep, PasskeyNotFoundError, type PayOptions, type PaymentContext, type PaymentError, type PaymentHandle, type PaymentHandlers, type PaymentHistoryOptions, type PaymentHistoryResult, type PaymentItem, type PaymentResult, type PaymentStatus, type PaymentToken, type PlatformCheckResult, type PrfCompatibilityResult, type PrfInputDto, PrfNotSupportedError, type RegisteredPasskeyDto, type SendBatchOverloads, type SendTxOptions, type SignRequest, type SignerType, type SiweSession, type SiweSessionStatus, type SocialProvider, type TokenBalance, type TransactionDto, type TransactionStatus, type UseEIP6963Return, type UseMpcConnectionReturn, type UsePasskeyEnrollmentReturn, type UseUserBalancesReturn, type UseVolrAuthCallbackOptions, type UseVolrAuthCallbackReturn, type UseVolrLoginReturn, type UseVolrPaymentApiReturn, type UseWithdrawReturn, UserCancelledError, type UserDto, type VolrClient, type VolrConfig, type VolrContextValue, VolrProvider, type VolrUser, type WalletDisplayInfo, type WalletStateComparison, type WithdrawParams, analyzeContractForEIP7702, buildCall, buildCalls, checkPrfCompatibility, checkPrfExtensionAvailable, checkPrfSupport, compareERC20Balances, compareWalletStates, completeMigration, createGetNetworkInfo, createPasskeyAdapter, debugTransactionFailure, defaultIdempotencyKey, detectWalletConnector, diagnoseTransactionFailure, getBrowserVersion, getERC20Balance, getIOSVersion, getPasskeyAuthGuidance, getPlatformHint, getUserCredentials, getWalletState, isEIP7702Delegated, isInAppBrowser, isUserCancelledError, listenForSeedRequests, normalizeHex, normalizeHexArray, openMigrationPopup, requestMigration, requestSeedFromOpener, sendSeedToPopup, uploadBlobViaPresign, useDepositListener, useEIP6963, useInternalAuth, useMpcConnection, usePasskeyEnrollment, useUserBalances, useVolr, useVolrAuthCallback, useVolrContext, useVolrLogin, useVolrPaymentApi, useWithdraw };
package/dist/index.js CHANGED
@@ -18452,12 +18452,22 @@ async function resolveSigner(input) {
18452
18452
  return { signer, activeProvider: provider };
18453
18453
  }
18454
18454
  if (user?.keyStorageType === "passkey" && user.blobUrl && user.prfInput && user.id) {
18455
+ const currentRpId = typeof window !== "undefined" ? window.location.hostname : "localhost";
18456
+ const domainPasskey = user.registeredPasskeys?.find((p) => p.rpId === currentRpId) ?? null;
18457
+ if (user.registeredPasskeys?.length && !domainPasskey) {
18458
+ throw new Error(
18459
+ `PASSKEY_DOMAIN_MISMATCH: No passkey registered for rpId=${currentRpId}`
18460
+ );
18461
+ }
18462
+ const blobUrl = domainPasskey?.blobUrl ?? user.blobUrl;
18463
+ const prfInput = domainPasskey?.prfInput ?? user.prfInput;
18464
+ const credentialId = domainPasskey?.credentialId ?? user.credentialId;
18455
18465
  const { provider: restoredProvider } = await restorePasskey({
18456
18466
  client,
18457
18467
  userId: user.id,
18458
- blobUrl: user.blobUrl,
18459
- prfInput: user.prfInput,
18460
- credentialId: user.credentialId
18468
+ blobUrl,
18469
+ prfInput,
18470
+ credentialId
18461
18471
  });
18462
18472
  await setProvider(restoredProvider);
18463
18473
  try {
@@ -18762,11 +18772,24 @@ function useVolr() {
18762
18772
  "No wallet provider available. Please complete passkey enrollment first."
18763
18773
  );
18764
18774
  }
18765
- if (!user.blobUrl || !user.prfInput || !user.id) {
18775
+ if (!user.id) {
18766
18776
  throw new Error(
18767
18777
  "Missing passkey data. Please re-enroll your passkey."
18768
18778
  );
18769
18779
  }
18780
+ const currentRpId = typeof window !== "undefined" ? window.location.hostname : "localhost";
18781
+ const domainPasskey = user.registeredPasskeys?.find((p) => p.rpId === currentRpId) ?? null;
18782
+ const blobUrl = domainPasskey?.blobUrl ?? user.blobUrl;
18783
+ const prfInput = domainPasskey?.prfInput ?? user.prfInput;
18784
+ const credentialId = domainPasskey?.credentialId ?? user.credentialId;
18785
+ if (user.registeredPasskeys?.length && !domainPasskey) {
18786
+ throw new Error(
18787
+ `PASSKEY_DOMAIN_MISMATCH: No passkey registered for rpId=${currentRpId}`
18788
+ );
18789
+ }
18790
+ if (!blobUrl || !prfInput) {
18791
+ throw new Error("Missing passkey data. Please re-enroll your passkey.");
18792
+ }
18770
18793
  if (restoringRef.current) {
18771
18794
  return restoringRef.current;
18772
18795
  }
@@ -18774,9 +18797,9 @@ function useVolr() {
18774
18797
  restoringRef.current = restorePasskey({
18775
18798
  client: apiClient,
18776
18799
  userId: user.id,
18777
- blobUrl: user.blobUrl,
18778
- prfInput: user.prfInput,
18779
- credentialId: user.credentialId
18800
+ blobUrl,
18801
+ prfInput,
18802
+ credentialId
18780
18803
  }).then(async ({ provider: restoredProvider }) => {
18781
18804
  await setProvider(restoredProvider);
18782
18805
  console.log("[useVolr] Passkey provider restored successfully");
@@ -18971,7 +18994,8 @@ function useVolrLogin() {
18971
18994
  lastWalletChainId: u.lastWalletChainId ?? void 0,
18972
18995
  blobUrl: u.blobUrl ?? void 0,
18973
18996
  prfInput: u.prfInput ?? void 0,
18974
- credentialId: u.credentialId ?? void 0
18997
+ credentialId: u.credentialId ?? void 0,
18998
+ registeredPasskeys: u.registeredPasskeys ?? void 0
18975
18999
  };
18976
19000
  }, []);
18977
19001
  const apiBaseUrl = resolveApiBaseUrl(config);
@@ -19188,7 +19212,8 @@ function useVolrAuthCallback(options = {}) {
19188
19212
  lastWalletChainId: u.lastWalletChainId ?? void 0,
19189
19213
  blobUrl: u.blobUrl ?? void 0,
19190
19214
  prfInput: u.prfInput ?? void 0,
19191
- credentialId: u.credentialId ?? void 0
19215
+ credentialId: u.credentialId ?? void 0,
19216
+ registeredPasskeys: u.registeredPasskeys ?? void 0
19192
19217
  };
19193
19218
  }, []);
19194
19219
  useEffect(() => {