@volr/react 0.1.47 → 0.1.49
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 +1 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +20 -23
- package/dist/index.d.ts +20 -23
- package/dist/index.js +1 -11
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -410,46 +410,43 @@ type SendBatchOverloads = {
|
|
|
410
410
|
/**
|
|
411
411
|
* Send a batch of pre-built Call objects
|
|
412
412
|
* @param calls - Array of Call objects with target, data, value, gasLimit
|
|
413
|
-
* @param opts -
|
|
413
|
+
* @param opts - Optional transaction options including expiresInSec, from
|
|
414
414
|
* @example
|
|
415
415
|
* ```ts
|
|
416
416
|
* const calls: Call[] = [
|
|
417
417
|
* { target: '0x...', data: '0x...', value: 0n, gasLimit: 100000n }
|
|
418
418
|
* ];
|
|
419
|
-
* await evm(chainId).sendBatch(calls
|
|
419
|
+
* await evm(chainId).sendBatch(calls);
|
|
420
420
|
* ```
|
|
421
421
|
*/
|
|
422
|
-
(calls: Call[], opts
|
|
422
|
+
(calls: Call[], opts?: SendTxOptions & {
|
|
423
423
|
from?: `0x${string}`;
|
|
424
424
|
}): Promise<RelayResult>;
|
|
425
425
|
/**
|
|
426
426
|
* Send a batch by providing BuildCallOptions - calls will be built internally
|
|
427
427
|
* @param calls - Array of BuildCallOptions with target, abi, functionName, args
|
|
428
|
-
* @param opts -
|
|
428
|
+
* @param opts - Optional transaction options including expiresInSec, from
|
|
429
429
|
* @example
|
|
430
430
|
* ```ts
|
|
431
|
-
* await evm(chainId).sendBatch(
|
|
432
|
-
*
|
|
433
|
-
*
|
|
434
|
-
*
|
|
435
|
-
*
|
|
436
|
-
*
|
|
437
|
-
*
|
|
438
|
-
*
|
|
439
|
-
*
|
|
440
|
-
* ],
|
|
441
|
-
* { policyId: '0x...' }
|
|
442
|
-
* );
|
|
431
|
+
* await evm(chainId).sendBatch([
|
|
432
|
+
* {
|
|
433
|
+
* target: tokenAddress,
|
|
434
|
+
* abi: erc20Abi,
|
|
435
|
+
* functionName: 'transfer',
|
|
436
|
+
* args: [recipient, amount],
|
|
437
|
+
* gasLimit: 100000n,
|
|
438
|
+
* }
|
|
439
|
+
* ]);
|
|
443
440
|
* ```
|
|
444
441
|
*/
|
|
445
|
-
(calls: BuildCallOptions[], opts
|
|
442
|
+
(calls: BuildCallOptions[], opts?: SendTxOptions & {
|
|
446
443
|
from?: `0x${string}`;
|
|
447
444
|
}): Promise<RelayResult>;
|
|
448
445
|
};
|
|
449
446
|
/**
|
|
450
|
-
* EVM
|
|
447
|
+
* EVM client interface
|
|
451
448
|
*/
|
|
452
|
-
type
|
|
449
|
+
type EvmClient = {
|
|
453
450
|
/**
|
|
454
451
|
* Read data from a smart contract
|
|
455
452
|
* @example
|
|
@@ -491,11 +488,11 @@ type EvmChainOperations = {
|
|
|
491
488
|
*/
|
|
492
489
|
type UseVolrWalletReturn = {
|
|
493
490
|
/**
|
|
494
|
-
* Get EVM
|
|
491
|
+
* Get EVM client for a specific chain
|
|
495
492
|
* @param chainId - The chain ID to operate on
|
|
496
|
-
* @returns EVM
|
|
493
|
+
* @returns EVM client interface
|
|
497
494
|
*/
|
|
498
|
-
evm: (chainId: number) =>
|
|
495
|
+
evm: (chainId: number) => EvmClient;
|
|
499
496
|
};
|
|
500
497
|
/**
|
|
501
498
|
* useVolrWallet hook - Developer-friendly facade
|
|
@@ -835,4 +832,4 @@ declare function debugTransactionFailure(publicClient: PublicClient, failingWall
|
|
|
835
832
|
analysis: string[];
|
|
836
833
|
}>;
|
|
837
834
|
|
|
838
|
-
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
|
|
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 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 UsePrecheckReturn, type UseRelayReturn, type UseVolrAuthCallbackOptions, type UseVolrAuthCallbackReturn, type UseVolrLoginReturn, type UseVolrWalletReturn, type UserDto, 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, usePrecheck, useRelay, useVolr, useVolrAuthCallback, useVolrLogin, useVolrWallet };
|
package/dist/index.d.ts
CHANGED
|
@@ -410,46 +410,43 @@ type SendBatchOverloads = {
|
|
|
410
410
|
/**
|
|
411
411
|
* Send a batch of pre-built Call objects
|
|
412
412
|
* @param calls - Array of Call objects with target, data, value, gasLimit
|
|
413
|
-
* @param opts -
|
|
413
|
+
* @param opts - Optional transaction options including expiresInSec, from
|
|
414
414
|
* @example
|
|
415
415
|
* ```ts
|
|
416
416
|
* const calls: Call[] = [
|
|
417
417
|
* { target: '0x...', data: '0x...', value: 0n, gasLimit: 100000n }
|
|
418
418
|
* ];
|
|
419
|
-
* await evm(chainId).sendBatch(calls
|
|
419
|
+
* await evm(chainId).sendBatch(calls);
|
|
420
420
|
* ```
|
|
421
421
|
*/
|
|
422
|
-
(calls: Call[], opts
|
|
422
|
+
(calls: Call[], opts?: SendTxOptions & {
|
|
423
423
|
from?: `0x${string}`;
|
|
424
424
|
}): Promise<RelayResult>;
|
|
425
425
|
/**
|
|
426
426
|
* Send a batch by providing BuildCallOptions - calls will be built internally
|
|
427
427
|
* @param calls - Array of BuildCallOptions with target, abi, functionName, args
|
|
428
|
-
* @param opts -
|
|
428
|
+
* @param opts - Optional transaction options including expiresInSec, from
|
|
429
429
|
* @example
|
|
430
430
|
* ```ts
|
|
431
|
-
* await evm(chainId).sendBatch(
|
|
432
|
-
*
|
|
433
|
-
*
|
|
434
|
-
*
|
|
435
|
-
*
|
|
436
|
-
*
|
|
437
|
-
*
|
|
438
|
-
*
|
|
439
|
-
*
|
|
440
|
-
* ],
|
|
441
|
-
* { policyId: '0x...' }
|
|
442
|
-
* );
|
|
431
|
+
* await evm(chainId).sendBatch([
|
|
432
|
+
* {
|
|
433
|
+
* target: tokenAddress,
|
|
434
|
+
* abi: erc20Abi,
|
|
435
|
+
* functionName: 'transfer',
|
|
436
|
+
* args: [recipient, amount],
|
|
437
|
+
* gasLimit: 100000n,
|
|
438
|
+
* }
|
|
439
|
+
* ]);
|
|
443
440
|
* ```
|
|
444
441
|
*/
|
|
445
|
-
(calls: BuildCallOptions[], opts
|
|
442
|
+
(calls: BuildCallOptions[], opts?: SendTxOptions & {
|
|
446
443
|
from?: `0x${string}`;
|
|
447
444
|
}): Promise<RelayResult>;
|
|
448
445
|
};
|
|
449
446
|
/**
|
|
450
|
-
* EVM
|
|
447
|
+
* EVM client interface
|
|
451
448
|
*/
|
|
452
|
-
type
|
|
449
|
+
type EvmClient = {
|
|
453
450
|
/**
|
|
454
451
|
* Read data from a smart contract
|
|
455
452
|
* @example
|
|
@@ -491,11 +488,11 @@ type EvmChainOperations = {
|
|
|
491
488
|
*/
|
|
492
489
|
type UseVolrWalletReturn = {
|
|
493
490
|
/**
|
|
494
|
-
* Get EVM
|
|
491
|
+
* Get EVM client for a specific chain
|
|
495
492
|
* @param chainId - The chain ID to operate on
|
|
496
|
-
* @returns EVM
|
|
493
|
+
* @returns EVM client interface
|
|
497
494
|
*/
|
|
498
|
-
evm: (chainId: number) =>
|
|
495
|
+
evm: (chainId: number) => EvmClient;
|
|
499
496
|
};
|
|
500
497
|
/**
|
|
501
498
|
* useVolrWallet hook - Developer-friendly facade
|
|
@@ -835,4 +832,4 @@ declare function debugTransactionFailure(publicClient: PublicClient, failingWall
|
|
|
835
832
|
analysis: string[];
|
|
836
833
|
}>;
|
|
837
834
|
|
|
838
|
-
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
|
|
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 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 UsePrecheckReturn, type UseRelayReturn, type UseVolrAuthCallbackOptions, type UseVolrAuthCallbackReturn, type UseVolrLoginReturn, type UseVolrWalletReturn, type UserDto, 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, usePrecheck, useRelay, useVolr, useVolrAuthCallback, useVolrLogin, useVolrWallet };
|
package/dist/index.js
CHANGED
|
@@ -18378,14 +18378,11 @@ function useVolrWallet() {
|
|
|
18378
18378
|
let extendedRpcClient = null;
|
|
18379
18379
|
const ensureRpcClient = async () => {
|
|
18380
18380
|
if (!publicClient) {
|
|
18381
|
-
console.log("[ensureRpcClient] Getting RPC URL for chainId:", chainId);
|
|
18382
18381
|
const rpcUrl = await getRpcUrl(chainId);
|
|
18383
|
-
console.log("[ensureRpcClient] Got RPC URL:", rpcUrl);
|
|
18384
18382
|
publicClient = createPublicClient({
|
|
18385
18383
|
transport: http(rpcUrl)
|
|
18386
18384
|
});
|
|
18387
18385
|
extendedRpcClient = createExtendedRPCClient(publicClient);
|
|
18388
|
-
console.log("[ensureRpcClient] Public client created");
|
|
18389
18386
|
}
|
|
18390
18387
|
return { publicClient, extendedRpcClient };
|
|
18391
18388
|
};
|
|
@@ -18425,13 +18422,9 @@ function useVolrWallet() {
|
|
|
18425
18422
|
}
|
|
18426
18423
|
});
|
|
18427
18424
|
},
|
|
18428
|
-
sendBatch: (async (calls, opts) => {
|
|
18429
|
-
console.log("[sendBatch] Starting sendBatch...", { chainId, callsCount: calls.length });
|
|
18430
|
-
console.log("[sendBatch] Ensuring RPC client...");
|
|
18425
|
+
sendBatch: (async (calls, opts = {}) => {
|
|
18431
18426
|
const { publicClient: publicClient2, extendedRpcClient: rpcClient } = await ensureRpcClient();
|
|
18432
|
-
console.log("[sendBatch] RPC client ready");
|
|
18433
18427
|
const from14 = opts.from ?? user?.evmAddress;
|
|
18434
|
-
console.log("[sendBatch] From address:", from14);
|
|
18435
18428
|
if (!from14) {
|
|
18436
18429
|
throw new Error(
|
|
18437
18430
|
"from address is required. Provide it in opts.from or set user.evmAddress in VolrProvider. If you haven't set up a wallet provider yet, please complete the onboarding flow."
|
|
@@ -18440,10 +18433,7 @@ function useVolrWallet() {
|
|
|
18440
18433
|
const isCallArray = (calls2) => {
|
|
18441
18434
|
return Array.isArray(calls2) && calls2.length > 0 && "data" in calls2[0] && !("abi" in calls2[0]);
|
|
18442
18435
|
};
|
|
18443
|
-
console.log("[sendBatch] Building calls...");
|
|
18444
18436
|
const builtCalls = isCallArray(calls) ? calls : buildCalls(calls);
|
|
18445
|
-
console.log("[sendBatch] Calls built:", builtCalls.length);
|
|
18446
|
-
console.log("[sendBatch] Calling sendCalls...");
|
|
18447
18437
|
return sendCalls({
|
|
18448
18438
|
chainId,
|
|
18449
18439
|
from: getAddress(from14),
|