@volr/react 0.1.9 → 0.1.11
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 +17743 -1135
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +49 -14
- package/dist/index.d.ts +49 -14
- package/dist/index.js +17717 -1128
- package/dist/index.js.map +1 -1
- package/package.json +3 -4
package/dist/index.d.cts
CHANGED
|
@@ -2,7 +2,8 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { KeyStorageType as KeyStorageType$1, WalletProviderPort, PrecheckInput, PrecheckQuote, RelayInput, RelayResult, SignerPort, ExtendedRPCClient, Call, PasskeyProviderPort } 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
|
-
import {
|
|
5
|
+
import { PublicClient } from './clients/createPublicClient.js';
|
|
6
|
+
import { Address, Abi } from '../abi.js';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* API client with automatic token refresh
|
|
@@ -418,22 +419,56 @@ type SendBatchOverloads = {
|
|
|
418
419
|
from?: `0x${string}`;
|
|
419
420
|
}): Promise<RelayResult>;
|
|
420
421
|
};
|
|
422
|
+
/**
|
|
423
|
+
* EVM chain operations interface
|
|
424
|
+
*/
|
|
425
|
+
type EvmChainOperations = {
|
|
426
|
+
/**
|
|
427
|
+
* Read data from a smart contract
|
|
428
|
+
* @example
|
|
429
|
+
* ```ts
|
|
430
|
+
* const balance = await evm(1).readContract({
|
|
431
|
+
* address: tokenAddress,
|
|
432
|
+
* abi: erc20Abi,
|
|
433
|
+
* functionName: 'balanceOf',
|
|
434
|
+
* args: [userAddress],
|
|
435
|
+
* });
|
|
436
|
+
* ```
|
|
437
|
+
*/
|
|
438
|
+
readContract: <TAbi extends readonly unknown[], TFunctionName extends string, TReturnType = Awaited<ReturnType<PublicClient['readContract']>>>(args: Parameters<PublicClient['readContract']>[0] & {
|
|
439
|
+
abi: TAbi;
|
|
440
|
+
functionName: TFunctionName;
|
|
441
|
+
}) => Promise<TReturnType>;
|
|
442
|
+
/**
|
|
443
|
+
* Send a single transaction
|
|
444
|
+
* @example
|
|
445
|
+
* ```ts
|
|
446
|
+
* const result = await evm(1).sendTransaction(
|
|
447
|
+
* { to: '0x...', data: '0x...', value: 0n },
|
|
448
|
+
* { policyId: '0x...' }
|
|
449
|
+
* );
|
|
450
|
+
* ```
|
|
451
|
+
*/
|
|
452
|
+
sendTransaction: (tx: {
|
|
453
|
+
to: `0x${string}`;
|
|
454
|
+
data: `0x${string}`;
|
|
455
|
+
value?: bigint;
|
|
456
|
+
}, opts: SendTxOptions) => Promise<RelayResult>;
|
|
457
|
+
/**
|
|
458
|
+
* Send a batch of transactions
|
|
459
|
+
*/
|
|
460
|
+
sendBatch: SendBatchOverloads;
|
|
461
|
+
};
|
|
421
462
|
/**
|
|
422
463
|
* useVolrWallet hook return type
|
|
423
464
|
*/
|
|
424
465
|
type UseVolrWalletReturn = {
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
to: `0x${string}`;
|
|
432
|
-
data: `0x${string}`;
|
|
433
|
-
value?: bigint;
|
|
434
|
-
}, opts: SendTxOptions) => Promise<RelayResult>;
|
|
435
|
-
sendBatch: SendBatchOverloads;
|
|
436
|
-
};
|
|
466
|
+
/**
|
|
467
|
+
* Get EVM chain operations for a specific chain
|
|
468
|
+
* @param chainId - The chain ID to operate on
|
|
469
|
+
* @returns EVM chain operations interface
|
|
470
|
+
*/
|
|
471
|
+
evm: (chainId: number) => EvmChainOperations;
|
|
437
472
|
};
|
|
438
473
|
/**
|
|
439
474
|
* useVolrWallet hook - Developer-friendly facade
|
|
@@ -642,4 +677,4 @@ declare function normalizeHex(value: `0x${string}` | string): `0x${string}`;
|
|
|
642
677
|
*/
|
|
643
678
|
declare function normalizeHexArray(values: (`0x${string}` | string)[]): `0x${string}`[];
|
|
644
679
|
|
|
645
|
-
export { type ApiResponse, type AuthRefreshResponseDto, type AuthResult, type BuildCallOptions, DEFAULT_EXPIRES_IN_SEC, DEFAULT_MODE, type DepositAsset$1 as DepositAsset, type DepositConfig, type Erc20Token$1 as Erc20Token, type KeyStorageType, type MpcConnectionStep, type NetworkDto, type NetworkInfo, type PasskeyAdapterOptions, type PasskeyEnrollmentStep, type PrfInputDto, 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, buildCall, buildCalls, createGetNetworkInfo, createPasskeyAdapter, defaultIdempotencyKey, normalizeHex, normalizeHexArray, uploadBlobViaPresign, useDepositListener, useInternalAuth, useMpcConnection, usePasskeyEnrollment, usePrecheck, useRelay, useVolr, useVolrAuthCallback, useVolrLogin, useVolrWallet };
|
|
680
|
+
export { type ApiResponse, type AuthRefreshResponseDto, type AuthResult, type BuildCallOptions, DEFAULT_EXPIRES_IN_SEC, DEFAULT_MODE, type DepositAsset$1 as DepositAsset, type DepositConfig, type Erc20Token$1 as Erc20Token, type EvmChainOperations, 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, buildCall, buildCalls, createGetNetworkInfo, createPasskeyAdapter, defaultIdempotencyKey, normalizeHex, normalizeHexArray, uploadBlobViaPresign, useDepositListener, useInternalAuth, useMpcConnection, usePasskeyEnrollment, usePrecheck, useRelay, useVolr, useVolrAuthCallback, useVolrLogin, useVolrWallet };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { KeyStorageType as KeyStorageType$1, WalletProviderPort, PrecheckInput, PrecheckQuote, RelayInput, RelayResult, SignerPort, ExtendedRPCClient, Call, PasskeyProviderPort } 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
|
-
import {
|
|
5
|
+
import { PublicClient } from './clients/createPublicClient.js';
|
|
6
|
+
import { Address, Abi } from '../abi.js';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* API client with automatic token refresh
|
|
@@ -418,22 +419,56 @@ type SendBatchOverloads = {
|
|
|
418
419
|
from?: `0x${string}`;
|
|
419
420
|
}): Promise<RelayResult>;
|
|
420
421
|
};
|
|
422
|
+
/**
|
|
423
|
+
* EVM chain operations interface
|
|
424
|
+
*/
|
|
425
|
+
type EvmChainOperations = {
|
|
426
|
+
/**
|
|
427
|
+
* Read data from a smart contract
|
|
428
|
+
* @example
|
|
429
|
+
* ```ts
|
|
430
|
+
* const balance = await evm(1).readContract({
|
|
431
|
+
* address: tokenAddress,
|
|
432
|
+
* abi: erc20Abi,
|
|
433
|
+
* functionName: 'balanceOf',
|
|
434
|
+
* args: [userAddress],
|
|
435
|
+
* });
|
|
436
|
+
* ```
|
|
437
|
+
*/
|
|
438
|
+
readContract: <TAbi extends readonly unknown[], TFunctionName extends string, TReturnType = Awaited<ReturnType<PublicClient['readContract']>>>(args: Parameters<PublicClient['readContract']>[0] & {
|
|
439
|
+
abi: TAbi;
|
|
440
|
+
functionName: TFunctionName;
|
|
441
|
+
}) => Promise<TReturnType>;
|
|
442
|
+
/**
|
|
443
|
+
* Send a single transaction
|
|
444
|
+
* @example
|
|
445
|
+
* ```ts
|
|
446
|
+
* const result = await evm(1).sendTransaction(
|
|
447
|
+
* { to: '0x...', data: '0x...', value: 0n },
|
|
448
|
+
* { policyId: '0x...' }
|
|
449
|
+
* );
|
|
450
|
+
* ```
|
|
451
|
+
*/
|
|
452
|
+
sendTransaction: (tx: {
|
|
453
|
+
to: `0x${string}`;
|
|
454
|
+
data: `0x${string}`;
|
|
455
|
+
value?: bigint;
|
|
456
|
+
}, opts: SendTxOptions) => Promise<RelayResult>;
|
|
457
|
+
/**
|
|
458
|
+
* Send a batch of transactions
|
|
459
|
+
*/
|
|
460
|
+
sendBatch: SendBatchOverloads;
|
|
461
|
+
};
|
|
421
462
|
/**
|
|
422
463
|
* useVolrWallet hook return type
|
|
423
464
|
*/
|
|
424
465
|
type UseVolrWalletReturn = {
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
to: `0x${string}`;
|
|
432
|
-
data: `0x${string}`;
|
|
433
|
-
value?: bigint;
|
|
434
|
-
}, opts: SendTxOptions) => Promise<RelayResult>;
|
|
435
|
-
sendBatch: SendBatchOverloads;
|
|
436
|
-
};
|
|
466
|
+
/**
|
|
467
|
+
* Get EVM chain operations for a specific chain
|
|
468
|
+
* @param chainId - The chain ID to operate on
|
|
469
|
+
* @returns EVM chain operations interface
|
|
470
|
+
*/
|
|
471
|
+
evm: (chainId: number) => EvmChainOperations;
|
|
437
472
|
};
|
|
438
473
|
/**
|
|
439
474
|
* useVolrWallet hook - Developer-friendly facade
|
|
@@ -642,4 +677,4 @@ declare function normalizeHex(value: `0x${string}` | string): `0x${string}`;
|
|
|
642
677
|
*/
|
|
643
678
|
declare function normalizeHexArray(values: (`0x${string}` | string)[]): `0x${string}`[];
|
|
644
679
|
|
|
645
|
-
export { type ApiResponse, type AuthRefreshResponseDto, type AuthResult, type BuildCallOptions, DEFAULT_EXPIRES_IN_SEC, DEFAULT_MODE, type DepositAsset$1 as DepositAsset, type DepositConfig, type Erc20Token$1 as Erc20Token, type KeyStorageType, type MpcConnectionStep, type NetworkDto, type NetworkInfo, type PasskeyAdapterOptions, type PasskeyEnrollmentStep, type PrfInputDto, 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, buildCall, buildCalls, createGetNetworkInfo, createPasskeyAdapter, defaultIdempotencyKey, normalizeHex, normalizeHexArray, uploadBlobViaPresign, useDepositListener, useInternalAuth, useMpcConnection, usePasskeyEnrollment, usePrecheck, useRelay, useVolr, useVolrAuthCallback, useVolrLogin, useVolrWallet };
|
|
680
|
+
export { type ApiResponse, type AuthRefreshResponseDto, type AuthResult, type BuildCallOptions, DEFAULT_EXPIRES_IN_SEC, DEFAULT_MODE, type DepositAsset$1 as DepositAsset, type DepositConfig, type Erc20Token$1 as Erc20Token, type EvmChainOperations, 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, buildCall, buildCalls, createGetNetworkInfo, createPasskeyAdapter, defaultIdempotencyKey, normalizeHex, normalizeHexArray, uploadBlobViaPresign, useDepositListener, useInternalAuth, useMpcConnection, usePasskeyEnrollment, usePrecheck, useRelay, useVolr, useVolrAuthCallback, useVolrLogin, useVolrWallet };
|