@volr/react 0.1.129 → 0.1.131

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
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
- import { KeyStorageType as KeyStorageType$1, TypedDataInput, WalletProviderPort, PrecheckInput, PrecheckQuote, RelayInput, RelayResult, Call, PasskeyProviderPort, PrfInput } from '@volr/sdk-core';
3
+ import { KeyStorageType as KeyStorageType$1, TypedDataInput, WalletProviderPort, PrecheckInput, PrecheckQuote, RelayInput, RelayResult, Call, SignerPort, ExtendedRPCClient, PasskeyProviderPort, PrfInput } from '@volr/sdk-core';
4
4
  export { AuthorizationTuple, Call, MpcTransport, PrecheckInput, PrecheckQuote, PrfInput, RelayInput, RelayMode, RelayResult, SessionAuth, UploadBlobOptions, createMasterKeyProvider, createMpcProvider, createPasskeyProvider, deriveEvmKey, deriveWrapKey, sealMasterSeed, uploadBlob } from '@volr/sdk-core';
5
5
  import { Address, Abi, PublicClient } from 'viem';
6
6
 
@@ -86,6 +86,14 @@ declare class APIClient {
86
86
  * GET request
87
87
  */
88
88
  get<T>(endpoint: string): Promise<T>;
89
+ /**
90
+ * Internal helper to sanitize Axios errors in test environment so that Vitest
91
+ * can safely structured-clone them between workers.
92
+ *
93
+ * NOTE: This function is exported only for tests. It is a no-op in production
94
+ * builds where NODE_ENV !== 'test'.
95
+ */
96
+ static sanitizeAxiosErrorForTest(error: unknown): void;
89
97
  }
90
98
 
91
99
  /**
@@ -595,6 +603,46 @@ type VolrClient = {
595
603
  */
596
604
  declare function useVolr(): VolrClient;
597
605
 
606
+ /**
607
+ * usePrecheck hook - Precheck transaction batch
608
+ */
609
+
610
+ /**
611
+ * usePrecheck return type
612
+ */
613
+ type UsePrecheckReturn = {
614
+ precheck: (input: PrecheckInput) => Promise<PrecheckQuote>;
615
+ isLoading: boolean;
616
+ error: Error | null;
617
+ };
618
+ /**
619
+ * usePrecheck hook
620
+ */
621
+ declare function usePrecheck(): UsePrecheckReturn;
622
+
623
+ /**
624
+ * useRelay hook - Relay transaction batch
625
+ */
626
+
627
+ /**
628
+ * useRelay return type
629
+ */
630
+ type UseRelayReturn = {
631
+ relay: (input: Omit<RelayInput, "sessionSig" | "authorizationList">, opts?: {
632
+ signer: SignerPort;
633
+ rpcClient?: ExtendedRPCClient;
634
+ idempotencyKey?: string;
635
+ /** Invoker address from precheck - avoids separate API call */
636
+ invokerAddress?: string;
637
+ }) => Promise<RelayResult>;
638
+ isLoading: boolean;
639
+ error: Error | null;
640
+ };
641
+ /**
642
+ * useRelay hook
643
+ */
644
+ declare function useRelay(): UseRelayReturn;
645
+
598
646
  /**
599
647
  * useVolrContext hook - Internal access to Volr context
600
648
  * @internal This hook is for SDK internal use only. Use useVolr instead.
@@ -1301,10 +1349,23 @@ declare class PrfNotSupportedError extends Error {
1301
1349
  readonly code = "PRF_NOT_SUPPORTED";
1302
1350
  constructor(message?: string);
1303
1351
  }
1352
+ /**
1353
+ * Error thrown when WebAuthn authenticator is busy (another request in progress)
1354
+ * This error CAN be retried after a short delay
1355
+ */
1356
+ declare class WebAuthnBusyError extends Error {
1357
+ readonly code = "WEBAUTHN_BUSY";
1358
+ readonly isRetryable = true;
1359
+ constructor(message?: string);
1360
+ }
1304
1361
  /**
1305
1362
  * Check if an error is a user cancellation (should not retry)
1306
1363
  */
1307
1364
  declare function isUserCancelledError(error: unknown): boolean;
1365
+ /**
1366
+ * Check if an error is a WebAuthn busy error (can retry)
1367
+ */
1368
+ declare function isWebAuthnBusyError(error: unknown): boolean;
1308
1369
 
1309
1370
  /**
1310
1371
  * Platform compatibility check utilities
@@ -1630,4 +1691,4 @@ declare function useEIP6963(): UseEIP6963Return;
1630
1691
  */
1631
1692
  declare function detectWalletConnector(provider: any, providerInfo: EIP6963ProviderInfo | null): string;
1632
1693
 
1633
- export { type ApiResponse, type AuthRefreshResponseDto, type AuthResult, type BrandingData, type BuildCallOptions, type ContractAnalysisResult, DEFAULT_EXPIRES_IN_SEC, DEFAULT_MODE, type DecryptEntropyParams, 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, decryptEntropyForMigration, 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 };
1694
+ export { type ApiResponse, type AuthRefreshResponseDto, type AuthResult, type BrandingData, type BuildCallOptions, type ContractAnalysisResult, DEFAULT_EXPIRES_IN_SEC, DEFAULT_MODE, type DecryptEntropyParams, 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, WebAuthnBusyError, type WithdrawParams, analyzeContractForEIP7702, buildCall, buildCalls, checkPrfCompatibility, checkPrfExtensionAvailable, checkPrfSupport, compareERC20Balances, compareWalletStates, completeMigration, createGetNetworkInfo, createPasskeyAdapter, debugTransactionFailure, decryptEntropyForMigration, defaultIdempotencyKey, detectWalletConnector, diagnoseTransactionFailure, getBrowserVersion, getERC20Balance, getIOSVersion, getPasskeyAuthGuidance, getPlatformHint, getUserCredentials, getWalletState, isEIP7702Delegated, isInAppBrowser, isUserCancelledError, isWebAuthnBusyError, listenForSeedRequests, normalizeHex, normalizeHexArray, openMigrationPopup, requestMigration, requestSeedFromOpener, sendSeedToPopup, uploadBlobViaPresign, useDepositListener, useEIP6963, useInternalAuth, useMpcConnection, usePasskeyEnrollment, usePrecheck, useRelay, useUserBalances, useVolr, useVolrAuthCallback, useVolrContext, useVolrLogin, useVolrPaymentApi, useWithdraw };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
- import { KeyStorageType as KeyStorageType$1, TypedDataInput, WalletProviderPort, PrecheckInput, PrecheckQuote, RelayInput, RelayResult, Call, PasskeyProviderPort, PrfInput } from '@volr/sdk-core';
3
+ import { KeyStorageType as KeyStorageType$1, TypedDataInput, WalletProviderPort, PrecheckInput, PrecheckQuote, RelayInput, RelayResult, Call, SignerPort, ExtendedRPCClient, PasskeyProviderPort, PrfInput } from '@volr/sdk-core';
4
4
  export { AuthorizationTuple, Call, MpcTransport, PrecheckInput, PrecheckQuote, PrfInput, RelayInput, RelayMode, RelayResult, SessionAuth, UploadBlobOptions, createMasterKeyProvider, createMpcProvider, createPasskeyProvider, deriveEvmKey, deriveWrapKey, sealMasterSeed, uploadBlob } from '@volr/sdk-core';
5
5
  import { Address, Abi, PublicClient } from 'viem';
6
6
 
@@ -86,6 +86,14 @@ declare class APIClient {
86
86
  * GET request
87
87
  */
88
88
  get<T>(endpoint: string): Promise<T>;
89
+ /**
90
+ * Internal helper to sanitize Axios errors in test environment so that Vitest
91
+ * can safely structured-clone them between workers.
92
+ *
93
+ * NOTE: This function is exported only for tests. It is a no-op in production
94
+ * builds where NODE_ENV !== 'test'.
95
+ */
96
+ static sanitizeAxiosErrorForTest(error: unknown): void;
89
97
  }
90
98
 
91
99
  /**
@@ -595,6 +603,46 @@ type VolrClient = {
595
603
  */
596
604
  declare function useVolr(): VolrClient;
597
605
 
606
+ /**
607
+ * usePrecheck hook - Precheck transaction batch
608
+ */
609
+
610
+ /**
611
+ * usePrecheck return type
612
+ */
613
+ type UsePrecheckReturn = {
614
+ precheck: (input: PrecheckInput) => Promise<PrecheckQuote>;
615
+ isLoading: boolean;
616
+ error: Error | null;
617
+ };
618
+ /**
619
+ * usePrecheck hook
620
+ */
621
+ declare function usePrecheck(): UsePrecheckReturn;
622
+
623
+ /**
624
+ * useRelay hook - Relay transaction batch
625
+ */
626
+
627
+ /**
628
+ * useRelay return type
629
+ */
630
+ type UseRelayReturn = {
631
+ relay: (input: Omit<RelayInput, "sessionSig" | "authorizationList">, opts?: {
632
+ signer: SignerPort;
633
+ rpcClient?: ExtendedRPCClient;
634
+ idempotencyKey?: string;
635
+ /** Invoker address from precheck - avoids separate API call */
636
+ invokerAddress?: string;
637
+ }) => Promise<RelayResult>;
638
+ isLoading: boolean;
639
+ error: Error | null;
640
+ };
641
+ /**
642
+ * useRelay hook
643
+ */
644
+ declare function useRelay(): UseRelayReturn;
645
+
598
646
  /**
599
647
  * useVolrContext hook - Internal access to Volr context
600
648
  * @internal This hook is for SDK internal use only. Use useVolr instead.
@@ -1301,10 +1349,23 @@ declare class PrfNotSupportedError extends Error {
1301
1349
  readonly code = "PRF_NOT_SUPPORTED";
1302
1350
  constructor(message?: string);
1303
1351
  }
1352
+ /**
1353
+ * Error thrown when WebAuthn authenticator is busy (another request in progress)
1354
+ * This error CAN be retried after a short delay
1355
+ */
1356
+ declare class WebAuthnBusyError extends Error {
1357
+ readonly code = "WEBAUTHN_BUSY";
1358
+ readonly isRetryable = true;
1359
+ constructor(message?: string);
1360
+ }
1304
1361
  /**
1305
1362
  * Check if an error is a user cancellation (should not retry)
1306
1363
  */
1307
1364
  declare function isUserCancelledError(error: unknown): boolean;
1365
+ /**
1366
+ * Check if an error is a WebAuthn busy error (can retry)
1367
+ */
1368
+ declare function isWebAuthnBusyError(error: unknown): boolean;
1308
1369
 
1309
1370
  /**
1310
1371
  * Platform compatibility check utilities
@@ -1630,4 +1691,4 @@ declare function useEIP6963(): UseEIP6963Return;
1630
1691
  */
1631
1692
  declare function detectWalletConnector(provider: any, providerInfo: EIP6963ProviderInfo | null): string;
1632
1693
 
1633
- export { type ApiResponse, type AuthRefreshResponseDto, type AuthResult, type BrandingData, type BuildCallOptions, type ContractAnalysisResult, DEFAULT_EXPIRES_IN_SEC, DEFAULT_MODE, type DecryptEntropyParams, 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, decryptEntropyForMigration, 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 };
1694
+ export { type ApiResponse, type AuthRefreshResponseDto, type AuthResult, type BrandingData, type BuildCallOptions, type ContractAnalysisResult, DEFAULT_EXPIRES_IN_SEC, DEFAULT_MODE, type DecryptEntropyParams, 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, WebAuthnBusyError, type WithdrawParams, analyzeContractForEIP7702, buildCall, buildCalls, checkPrfCompatibility, checkPrfExtensionAvailable, checkPrfSupport, compareERC20Balances, compareWalletStates, completeMigration, createGetNetworkInfo, createPasskeyAdapter, debugTransactionFailure, decryptEntropyForMigration, defaultIdempotencyKey, detectWalletConnector, diagnoseTransactionFailure, getBrowserVersion, getERC20Balance, getIOSVersion, getPasskeyAuthGuidance, getPlatformHint, getUserCredentials, getWalletState, isEIP7702Delegated, isInAppBrowser, isUserCancelledError, isWebAuthnBusyError, listenForSeedRequests, normalizeHex, normalizeHexArray, openMigrationPopup, requestMigration, requestSeedFromOpener, sendSeedToPopup, uploadBlobViaPresign, useDepositListener, useEIP6963, useInternalAuth, useMpcConnection, usePasskeyEnrollment, usePrecheck, useRelay, useUserBalances, useVolr, useVolrAuthCallback, useVolrContext, useVolrLogin, useVolrPaymentApi, useWithdraw };