@volr/react 0.1.53 → 0.1.54

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
@@ -437,19 +437,27 @@ type EvmClient = {
437
437
  sendBatch: SendBatchOverloads;
438
438
  };
439
439
  /**
440
- * Volr client interface
440
+ * EVM namespace with address and chain client factory
441
441
  */
442
- type VolrClient = {
443
- /**
444
- * Get EVM client for a specific chain
445
- * @param chainId - The chain ID to operate on
446
- * @returns EVM client interface
447
- */
448
- evm: (chainId: number) => EvmClient;
442
+ type EvmNamespace = ((chainId: number) => EvmClient) & {
449
443
  /**
450
444
  * User's EVM wallet address
451
445
  */
452
446
  address: `0x${string}` | undefined;
447
+ };
448
+ /**
449
+ * Volr client interface
450
+ */
451
+ type VolrClient = {
452
+ /**
453
+ * EVM namespace - get chain client or access address
454
+ * @example
455
+ * ```ts
456
+ * const address = evm.address;
457
+ * await evm(8453).sendBatch([...]);
458
+ * ```
459
+ */
460
+ evm: EvmNamespace;
453
461
  /**
454
462
  * User's email (if logged in with email)
455
463
  */
@@ -824,4 +832,4 @@ declare function debugTransactionFailure(publicClient: PublicClient, failingWall
824
832
  analysis: string[];
825
833
  }>;
826
834
 
827
- export { type ApiResponse, type AuthRefreshResponseDto, type AuthResult, type BuildCallOptions, type ContractAnalysisResult, DEFAULT_EXPIRES_IN_SEC, DEFAULT_MODE, type DepositAsset$1 as DepositAsset, type DepositConfig, type ERC20BalanceComparison, type Erc20Token$1 as Erc20Token, type EvmClient, type KeyStorageType, type MpcConnectionStep, type NetworkDto, type NetworkInfo, type PasskeyAdapterOptions, type PasskeyEnrollmentStep, type PrfInputDto, type SendBatchOverloads, type SendTxOptions, type SignerType, type SocialProvider, type TransactionDto, type TransactionStatus, type UseMpcConnectionReturn, type UsePasskeyEnrollmentReturn, type UseVolrAuthCallbackOptions, type UseVolrAuthCallbackReturn, type UseVolrLoginReturn, type UserDto, type VolrClient, type VolrConfig, type VolrContextValue, VolrProvider, type VolrUser, type WalletStateComparison, analyzeContractForEIP7702, buildCall, buildCalls, compareERC20Balances, compareWalletStates, createGetNetworkInfo, createPasskeyAdapter, debugTransactionFailure, defaultIdempotencyKey, diagnoseTransactionFailure, getERC20Balance, getWalletState, isEIP7702Delegated, normalizeHex, normalizeHexArray, uploadBlobViaPresign, useDepositListener, useInternalAuth, useMpcConnection, usePasskeyEnrollment, useVolr, useVolrAuthCallback, useVolrContext, useVolrLogin };
835
+ export { type ApiResponse, type AuthRefreshResponseDto, type AuthResult, type BuildCallOptions, type ContractAnalysisResult, DEFAULT_EXPIRES_IN_SEC, DEFAULT_MODE, type DepositAsset$1 as DepositAsset, type DepositConfig, type ERC20BalanceComparison, type Erc20Token$1 as Erc20Token, type EvmClient, type EvmNamespace, type KeyStorageType, type MpcConnectionStep, type NetworkDto, type NetworkInfo, type PasskeyAdapterOptions, type PasskeyEnrollmentStep, type PrfInputDto, type SendBatchOverloads, type SendTxOptions, type SignerType, type SocialProvider, type TransactionDto, type TransactionStatus, type UseMpcConnectionReturn, type UsePasskeyEnrollmentReturn, type UseVolrAuthCallbackOptions, type UseVolrAuthCallbackReturn, type UseVolrLoginReturn, type UserDto, type VolrClient, type VolrConfig, type VolrContextValue, VolrProvider, type VolrUser, type WalletStateComparison, analyzeContractForEIP7702, buildCall, buildCalls, compareERC20Balances, compareWalletStates, createGetNetworkInfo, createPasskeyAdapter, debugTransactionFailure, defaultIdempotencyKey, diagnoseTransactionFailure, getERC20Balance, getWalletState, isEIP7702Delegated, normalizeHex, normalizeHexArray, uploadBlobViaPresign, useDepositListener, useInternalAuth, useMpcConnection, usePasskeyEnrollment, useVolr, useVolrAuthCallback, useVolrContext, useVolrLogin };
package/dist/index.d.ts CHANGED
@@ -437,19 +437,27 @@ type EvmClient = {
437
437
  sendBatch: SendBatchOverloads;
438
438
  };
439
439
  /**
440
- * Volr client interface
440
+ * EVM namespace with address and chain client factory
441
441
  */
442
- type VolrClient = {
443
- /**
444
- * Get EVM client for a specific chain
445
- * @param chainId - The chain ID to operate on
446
- * @returns EVM client interface
447
- */
448
- evm: (chainId: number) => EvmClient;
442
+ type EvmNamespace = ((chainId: number) => EvmClient) & {
449
443
  /**
450
444
  * User's EVM wallet address
451
445
  */
452
446
  address: `0x${string}` | undefined;
447
+ };
448
+ /**
449
+ * Volr client interface
450
+ */
451
+ type VolrClient = {
452
+ /**
453
+ * EVM namespace - get chain client or access address
454
+ * @example
455
+ * ```ts
456
+ * const address = evm.address;
457
+ * await evm(8453).sendBatch([...]);
458
+ * ```
459
+ */
460
+ evm: EvmNamespace;
453
461
  /**
454
462
  * User's email (if logged in with email)
455
463
  */
@@ -824,4 +832,4 @@ declare function debugTransactionFailure(publicClient: PublicClient, failingWall
824
832
  analysis: string[];
825
833
  }>;
826
834
 
827
- export { type ApiResponse, type AuthRefreshResponseDto, type AuthResult, type BuildCallOptions, type ContractAnalysisResult, DEFAULT_EXPIRES_IN_SEC, DEFAULT_MODE, type DepositAsset$1 as DepositAsset, type DepositConfig, type ERC20BalanceComparison, type Erc20Token$1 as Erc20Token, type EvmClient, type KeyStorageType, type MpcConnectionStep, type NetworkDto, type NetworkInfo, type PasskeyAdapterOptions, type PasskeyEnrollmentStep, type PrfInputDto, type SendBatchOverloads, type SendTxOptions, type SignerType, type SocialProvider, type TransactionDto, type TransactionStatus, type UseMpcConnectionReturn, type UsePasskeyEnrollmentReturn, type UseVolrAuthCallbackOptions, type UseVolrAuthCallbackReturn, type UseVolrLoginReturn, type UserDto, type VolrClient, type VolrConfig, type VolrContextValue, VolrProvider, type VolrUser, type WalletStateComparison, analyzeContractForEIP7702, buildCall, buildCalls, compareERC20Balances, compareWalletStates, createGetNetworkInfo, createPasskeyAdapter, debugTransactionFailure, defaultIdempotencyKey, diagnoseTransactionFailure, getERC20Balance, getWalletState, isEIP7702Delegated, normalizeHex, normalizeHexArray, uploadBlobViaPresign, useDepositListener, useInternalAuth, useMpcConnection, usePasskeyEnrollment, useVolr, useVolrAuthCallback, useVolrContext, useVolrLogin };
835
+ export { type ApiResponse, type AuthRefreshResponseDto, type AuthResult, type BuildCallOptions, type ContractAnalysisResult, DEFAULT_EXPIRES_IN_SEC, DEFAULT_MODE, type DepositAsset$1 as DepositAsset, type DepositConfig, type ERC20BalanceComparison, type Erc20Token$1 as Erc20Token, type EvmClient, type EvmNamespace, type KeyStorageType, type MpcConnectionStep, type NetworkDto, type NetworkInfo, type PasskeyAdapterOptions, type PasskeyEnrollmentStep, type PrfInputDto, type SendBatchOverloads, type SendTxOptions, type SignerType, type SocialProvider, type TransactionDto, type TransactionStatus, type UseMpcConnectionReturn, type UsePasskeyEnrollmentReturn, type UseVolrAuthCallbackOptions, type UseVolrAuthCallbackReturn, type UseVolrLoginReturn, type UserDto, type VolrClient, type VolrConfig, type VolrContextValue, VolrProvider, type VolrUser, type WalletStateComparison, analyzeContractForEIP7702, buildCall, buildCalls, compareERC20Balances, compareWalletStates, createGetNetworkInfo, createPasskeyAdapter, debugTransactionFailure, defaultIdempotencyKey, diagnoseTransactionFailure, getERC20Balance, getWalletState, isEIP7702Delegated, normalizeHex, normalizeHexArray, uploadBlobViaPresign, useDepositListener, useInternalAuth, useMpcConnection, usePasskeyEnrollment, useVolr, useVolrAuthCallback, useVolrContext, useVolrLogin };
package/dist/index.js CHANGED
@@ -18369,7 +18369,7 @@ function useVolr() {
18369
18369
  createGetRpcUrl({ client, rpcOverrides: config.rpcOverrides }),
18370
18370
  [client, config.rpcOverrides]
18371
18371
  );
18372
- const evm = useCallback(
18372
+ const evmFactory = useCallback(
18373
18373
  (chainId) => {
18374
18374
  if (chainId === 0) {
18375
18375
  throw new Error("chainId cannot be 0");
@@ -18460,9 +18460,11 @@ function useVolr() {
18460
18460
  },
18461
18461
  [user, config, provider, precheck, relay, getRpcUrl, setProvider, client]
18462
18462
  );
18463
+ const evm = Object.assign(evmFactory, {
18464
+ address: user?.evmAddress
18465
+ });
18463
18466
  return {
18464
18467
  evm,
18465
- address: user?.evmAddress,
18466
18468
  email: user?.email,
18467
18469
  isLoggedIn: user !== null,
18468
18470
  signerType: user?.signerType,