viem 0.2.0-canary.20230316T042447 → 0.2.0-jxom-local-accounts.20230321T210352
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/abi.d.ts +3 -3
- package/dist/abi.js +2 -2
- package/dist/abi.mjs +1 -1
- package/dist/{chain-1b53ef88.d.ts → chain-75b0942e.d.ts} +53 -48
- package/dist/{chain-ec8c485d.d.ts → chain-f8db473f.d.ts} +1 -1
- package/dist/chains.d.ts +3 -3
- package/dist/chains.js +63 -63
- package/dist/chains.mjs +1 -1
- package/dist/{chunk-A5BRAPQQ.js → chunk-FHJTO6BQ.js} +1480 -1162
- package/dist/chunk-FHJTO6BQ.js.map +1 -0
- package/dist/{chunk-PLALZ2GD.mjs → chunk-IXGTN6B7.mjs} +2 -2
- package/dist/chunk-IXGTN6B7.mjs.map +1 -0
- package/dist/{chunk-GZ67J32T.js → chunk-K66BKQUH.js} +19 -19
- package/dist/{chunk-GZ67J32T.js.map → chunk-K66BKQUH.js.map} +1 -1
- package/dist/{chunk-ISLCPEI2.mjs → chunk-PB263D6W.mjs} +1768 -1450
- package/dist/chunk-PB263D6W.mjs.map +1 -0
- package/dist/contract.d.ts +8 -7
- package/dist/contract.js +2 -2
- package/dist/contract.mjs +1 -1
- package/dist/{createClient-a28317a9.d.ts → createClient-f87255c1.d.ts} +6 -6
- package/dist/{createPublicClient-75540130.d.ts → createPublicClient-62c74ebc.d.ts} +160 -206
- package/dist/{eip1193-4f4e240c.d.ts → eip1193-ae706fd8.d.ts} +1 -1
- package/dist/{encodeFunctionResult-1f324375.d.ts → encodeFunctionResult-4792a6a3.d.ts} +1 -1
- package/dist/{encodePacked-d5d5264a.d.ts → encodePacked-3fcdd54b.d.ts} +1 -1
- package/dist/ens.d.ts +5 -4
- package/dist/ens.js +3 -3
- package/dist/ens.mjs +2 -2
- package/dist/ethers.d.ts +4 -6
- package/dist/ethers.js +5 -5
- package/dist/ethers.js.map +1 -1
- package/dist/ethers.mjs +5 -5
- package/dist/ethers.mjs.map +1 -1
- package/dist/{formatAbiItem-15e8817d.d.ts → formatAbiItem-765ebc53.d.ts} +1 -1
- package/dist/{getAbiItem-3e809ff9.d.ts → getAbiItem-693e6e1b.d.ts} +1 -1
- package/dist/index.d.ts +14 -13
- package/dist/index.js +99 -91
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -5
- package/dist/index.mjs.map +1 -1
- package/dist/{parseGwei-6fff7cbe.d.ts → parseGwei-7efc43fc.d.ts} +46 -10
- package/dist/public.d.ts +5 -4
- package/dist/public.js +2 -2
- package/dist/public.mjs +1 -1
- package/dist/{test-2bd23d7e.d.ts → test-98c0b642.d.ts} +33 -32
- package/dist/test.d.ts +10 -10
- package/dist/test.js +2 -2
- package/dist/test.mjs +1 -1
- package/dist/typedData-0514bb3c.d.ts +76 -0
- package/dist/utils/index.d.ts +28 -18
- package/dist/utils/index.js +8 -2
- package/dist/utils/index.mjs +11 -5
- package/dist/wallet.d.ts +5 -4
- package/dist/wallet.js +2 -2
- package/dist/wallet.mjs +1 -1
- package/dist/window.d.ts +2 -2
- package/package.json +3 -1
- package/dist/chunk-A5BRAPQQ.js.map +0 -1
- package/dist/chunk-ISLCPEI2.mjs.map +0 -1
- package/dist/chunk-PLALZ2GD.mjs.map +0 -1
@@ -1,11 +1,10 @@
|
|
1
|
-
import { Address, Abi } from 'abitype';
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
1
|
+
import { Address, Abi, TypedData } from 'abitype';
|
2
|
+
import { B as ByteArray, H as Hex, C as Chain, a as Hash, f as BlockTag, ab as EventDefinition } from './chain-75b0942e.js';
|
3
|
+
import { C as CallParameters, E as EstimateGasParameters, S as SendTransactionParameters } from './createPublicClient-62c74ebc.js';
|
4
|
+
import { A as Account, T as TypedDataDefinition } from './typedData-0514bb3c.js';
|
5
|
+
import { a as DecodeErrorResultReturnType } from './encodeFunctionResult-4792a6a3.js';
|
5
6
|
import WebSocket from 'isomorphic-ws';
|
6
7
|
|
7
|
-
declare function getAccount(account: Address | Omit<LocalAccount, 'type'>): Account;
|
8
|
-
|
9
8
|
declare function getAddress(address: string): Address;
|
10
9
|
|
11
10
|
type GetCreateAddressOptions = {
|
@@ -194,6 +193,7 @@ declare function fromRlp<TTo extends 'bytes' | 'hex'>(value: ByteArray | Hex, to
|
|
194
193
|
|
195
194
|
type BaseErrorParameters = {
|
196
195
|
docsPath?: string;
|
196
|
+
docsSlug?: string;
|
197
197
|
metaMessages?: string[];
|
198
198
|
} & ({
|
199
199
|
cause?: never;
|
@@ -214,7 +214,7 @@ declare class BaseError extends Error {
|
|
214
214
|
declare class CallExecutionError extends BaseError {
|
215
215
|
cause: BaseError;
|
216
216
|
name: string;
|
217
|
-
constructor(cause: BaseError, { account, docsPath, chain, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, }: CallParameters & {
|
217
|
+
constructor(cause: BaseError, { account: account_, docsPath, chain, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, }: CallParameters & {
|
218
218
|
chain?: Chain;
|
219
219
|
docsPath?: string;
|
220
220
|
});
|
@@ -267,7 +267,8 @@ declare class RawContractError extends BaseError {
|
|
267
267
|
declare class EstimateGasExecutionError extends BaseError {
|
268
268
|
cause: BaseError;
|
269
269
|
name: string;
|
270
|
-
constructor(cause: BaseError, { account, docsPath, chain, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, }: EstimateGasParameters & {
|
270
|
+
constructor(cause: BaseError, { account, docsPath, chain, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, }: Omit<EstimateGasParameters<any, any>, 'account'> & {
|
271
|
+
account?: Account;
|
271
272
|
chain?: Chain;
|
272
273
|
docsPath?: string;
|
273
274
|
});
|
@@ -380,7 +381,9 @@ declare class UnknownNodeError extends BaseError {
|
|
380
381
|
declare class TransactionExecutionError extends BaseError {
|
381
382
|
cause: BaseError;
|
382
383
|
name: string;
|
383
|
-
constructor(cause: BaseError, { account, docsPath, chain, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, }: SendTransactionParameters & {
|
384
|
+
constructor(cause: BaseError, { account, docsPath, chain, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, }: Omit<SendTransactionParameters, 'account' | 'chain'> & {
|
385
|
+
account: Account;
|
386
|
+
chain?: Chain;
|
384
387
|
docsPath?: string;
|
385
388
|
});
|
386
389
|
}
|
@@ -489,6 +492,14 @@ type To = 'hex' | 'bytes';
|
|
489
492
|
type HashMessage<TTo extends To> = (TTo extends 'bytes' ? ByteArray : never) | (TTo extends 'hex' ? Hex : never);
|
490
493
|
declare function hashMessage<TTo extends To = 'hex'>(message: string, to_?: TTo): HashMessage<TTo>;
|
491
494
|
|
495
|
+
type HashTypedDataParameters<TTypedData extends TypedData | {
|
496
|
+
[key: string]: unknown;
|
497
|
+
} = TypedData, TPrimaryType extends string = string> = TypedDataDefinition<TTypedData, TPrimaryType>;
|
498
|
+
type HashTypedDataReturnType = Hex;
|
499
|
+
declare function hashTypedData<TTypedData extends TypedData | {
|
500
|
+
[key: string]: unknown;
|
501
|
+
}, TPrimaryType extends string = string>({ domain: domain_, message, primaryType, types: types_, }: HashTypedDataParameters<TTypedData, TPrimaryType>): HashTypedDataReturnType;
|
502
|
+
|
492
503
|
type RecoverAddressParameters = {
|
493
504
|
hash: Hex | ByteArray;
|
494
505
|
signature: Hex | ByteArray;
|
@@ -503,6 +514,16 @@ type RecoverMessageAddressParameters = {
|
|
503
514
|
type RecoverMessageAddressReturnType = Address;
|
504
515
|
declare function recoverMessageAddress({ message, signature, }: RecoverMessageAddressParameters): RecoverMessageAddressReturnType;
|
505
516
|
|
517
|
+
type RecoverTypedDataAddressParameters<TTypedData extends TypedData | {
|
518
|
+
[key: string]: unknown;
|
519
|
+
} = TypedData, TPrimaryType extends string = string> = TypedDataDefinition<TTypedData, TPrimaryType> & {
|
520
|
+
signature: Hex | ByteArray;
|
521
|
+
};
|
522
|
+
type RecoverTypedDataAddressReturnType = Address;
|
523
|
+
declare function recoverTypedDataAddress<TTypedData extends TypedData | {
|
524
|
+
[key: string]: unknown;
|
525
|
+
}, TPrimaryType extends string = string>({ domain, message, primaryType, signature, types, }: RecoverTypedDataAddressParameters<TTypedData, TPrimaryType>): RecoverTypedDataAddressReturnType;
|
526
|
+
|
506
527
|
type VerifyMessageParameters = {
|
507
528
|
address: Address;
|
508
529
|
message: string;
|
@@ -511,8 +532,23 @@ type VerifyMessageParameters = {
|
|
511
532
|
type VerifyMessageReturnType = boolean;
|
512
533
|
declare function verifyMessage({ address, message, signature, }: VerifyMessageParameters): VerifyMessageReturnType;
|
513
534
|
|
535
|
+
type VerifyTypedDataParameters<TTypedData extends TypedData | {
|
536
|
+
[key: string]: unknown;
|
537
|
+
} = TypedData, TPrimaryType extends string = string> = TypedDataDefinition<TTypedData, TPrimaryType> & {
|
538
|
+
address: Address;
|
539
|
+
signature: Hex | ByteArray;
|
540
|
+
};
|
541
|
+
type VerifyTypedDataReturnType = boolean;
|
542
|
+
declare function verifyTypedData<TTypedData extends TypedData | {
|
543
|
+
[key: string]: unknown;
|
544
|
+
}, TPrimaryType extends string = string>({ address, domain, message, primaryType, signature, types, }: VerifyTypedDataParameters<TTypedData, TPrimaryType>): VerifyTypedDataReturnType;
|
545
|
+
|
514
546
|
declare const stringify: typeof JSON.stringify;
|
515
547
|
|
548
|
+
declare function validateTypedData<TTypedData extends TypedData | {
|
549
|
+
[key: string]: unknown;
|
550
|
+
}, TPrimaryType extends string = string>({ domain, message, primaryType, types: types_, }: TypedDataDefinition<TTypedData, TPrimaryType>): void;
|
551
|
+
|
516
552
|
declare function formatEther(wei: bigint, unit?: 'wei' | 'gwei'): string;
|
517
553
|
|
518
554
|
declare function formatGwei(wei: bigint, unit?: 'wei'): string;
|
@@ -525,4 +561,4 @@ declare function parseEther(ether: `${number}`, unit?: 'wei' | 'gwei'): bigint;
|
|
525
561
|
|
526
562
|
declare function parseGwei(ether: `${number}`, unit?: 'wei'): bigint;
|
527
563
|
|
528
|
-
export {
|
564
|
+
export { formatUnits as $, VerifyTypedDataParameters as A, BaseError as B, CallExecutionError as C, VerifyTypedDataReturnType as D, EstimateGasExecutionError as E, FeeCapTooHighError as F, GetContractAddressOptions as G, HttpOptions as H, InsufficientFundsError as I, boolToBytes as J, boolToHex as K, bytesToBigint as L, bytesToBool as M, NonceMaxValueError as N, bytesToHex as O, bytesToNumber as P, bytesToString as Q, RpcResponse as R, concat as S, TipAboveFeeCapError as T, UnknownNodeError as U, VerifyMessageParameters as V, WaitForTransactionReceiptTimeoutError as W, concatBytes as X, concatHex as Y, formatEther as Z, formatGwei as _, ContractFunctionExecutionError as a, fromBytes as a0, fromHex as a1, fromRlp as a2, getAddress as a3, getContractAddress as a4, getContractError as a5, getCreate2Address as a6, getCreateAddress as a7, getEventSelector as a8, getFunctionSelector as a9, stringToBytes as aA, stringToHex as aB, stringify as aC, toBytes as aD, toHex as aE, toRlp as aF, trim as aG, validateTypedData as aH, verifyMessage as aI, Socket as aJ, getSocket as aK, rpc as aL, recoverTypedDataAddress as aM, verifyTypedData as aN, hashMessage as aa, hashTypedData as ab, hexToBigInt as ac, hexToBool as ad, hexToBytes as ae, hexToNumber as af, hexToString as ag, isAddress as ah, isAddressEqual as ai, isBytes as aj, isHex as ak, keccak256 as al, numberToBytes as am, numberToHex as an, pad as ao, padBytes as ap, padHex as aq, parseEther as ar, parseGwei as as, parseUnits as at, recoverAddress as au, recoverMessageAddress as av, size as aw, slice as ax, sliceBytes as ay, sliceHex as az, ContractFunctionRevertedError as b, ContractFunctionZeroDataError as c, ExecutionRevertedError as d, FeeCapTooLowError as e, IntrinsicGasTooHighError as f, IntrinsicGasTooLowError as g, NonceTooHighError as h, NonceTooLowError as i, RawContractError as j, TransactionExecutionError as k, TransactionTypeNotSupportedError as l, TransactionNotFoundError as m, TransactionReceiptNotFoundError as n, GetCreate2AddressOptions as o, GetCreateAddressOptions as p, HashTypedDataParameters as q, HashTypedDataReturnType as r, RecoverAddressParameters as s, RecoverAddressReturnType as t, RecoverMessageAddressParameters as u, RecoverMessageAddressReturnType as v, RecoverTypedDataAddressParameters as w, RecoverTypedDataAddressReturnType as x, ToRlpReturnType as y, VerifyMessageReturnType as z };
|
package/dist/public.d.ts
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
export { C as CallParameters,
|
2
|
-
import './eip1193-
|
1
|
+
export { C as CallParameters, ar as CallReturnType, as as CreateBlockFilterReturnType, at as CreateEventFilterParameters, au as CreateEventFilterReturnType, av as CreatePendingTransactionFilterReturnType, E as EstimateGasParameters, aw as EstimateGasReturnType, ax as GetBalanceParameters, ay as GetBalanceReturnType, aA as GetBlockNumberParameters, aB as GetBlockNumberReturnType, az as GetBlockParameters, aC as GetBlockReturnType, aD as GetBlockTransactionCountParameters, aE as GetBlockTransactionCountReturnType, G as GetBytecodeParameters, q as GetBytecodeReturnType, aF as GetFeeHistoryParameters, aG as GetFeeHistoryReturnType, aH as GetFilterChangesParameters, aI as GetFilterChangesReturnType, aJ as GetFilterLogsParameters, aK as GetFilterLogsReturnType, aL as GetGasPriceReturnType, aN as GetTransactionConfirmationsParameters, aO as GetTransactionConfirmationsReturnType, aP as GetTransactionCountParameters, aQ as GetTransactionCountReturnType, aM as GetTransactionParameters, aR as GetTransactionReceiptParameters, aS as GetTransactionReceiptReturnType, aT as GetTransactionReturnType, aU as OnBlock, aV as OnBlockNumberFn, aW as OnBlockNumberParameter, aX as OnBlockParameter, O as OnLogsFn, u as OnLogsParameter, aY as OnTransactionsFn, aZ as OnTransactionsParameter, a_ as ReplacementReason, a$ as ReplacementReturnType, b0 as UninstallFilterParameters, b1 as UninstallFilterReturnType, b2 as WaitForTransactionReceiptParameters, b3 as WaitForTransactionReceiptReturnType, b4 as WatchBlockNumberParameters, b5 as WatchBlocksParameters, b6 as WatchPendingTransactionsParameters, a1 as call, a2 as createBlockFilter, a3 as createEventFilter, a4 as createPendingTransactionFilter, a5 as estimateGas, a6 as getBalance, a7 as getBlock, a8 as getBlockNumber, a9 as getBlockNumberCache, aa as getBlockTransactionCount, D as getBytecode, ab as getChainId, ac as getFeeHistory, ad as getFilterChanges, ae as getFilterLogs, ag as getGasPrice, af as getLogs, ah as getTransaction, ai as getTransactionConfirmations, aj as getTransactionCount, ak as getTransactionReceipt, al as uninstallFilter, am as waitForTransactionReceipt, an as watchBlockNumber, ao as watchBlocks, ap as watchEvent, aq as watchPendingTransactions } from './createPublicClient-62c74ebc.js';
|
2
|
+
import './eip1193-ae706fd8.js';
|
3
3
|
import 'abitype';
|
4
|
-
import './chain-
|
4
|
+
import './chain-75b0942e.js';
|
5
5
|
import '@wagmi/chains';
|
6
|
-
import './createClient-
|
6
|
+
import './createClient-f87255c1.js';
|
7
|
+
import './typedData-0514bb3c.js';
|
package/dist/public.js
CHANGED
@@ -26,7 +26,7 @@
|
|
26
26
|
|
27
27
|
|
28
28
|
|
29
|
-
var
|
29
|
+
var _chunkFHJTO6BQjs = require('./chunk-FHJTO6BQ.js');
|
30
30
|
|
31
31
|
|
32
32
|
|
@@ -55,5 +55,5 @@ var _chunkA5BRAPQQjs = require('./chunk-A5BRAPQQ.js');
|
|
55
55
|
|
56
56
|
|
57
57
|
|
58
|
-
exports.call =
|
58
|
+
exports.call = _chunkFHJTO6BQjs.call; exports.createBlockFilter = _chunkFHJTO6BQjs.createBlockFilter; exports.createEventFilter = _chunkFHJTO6BQjs.createEventFilter; exports.createPendingTransactionFilter = _chunkFHJTO6BQjs.createPendingTransactionFilter; exports.estimateGas = _chunkFHJTO6BQjs.estimateGas; exports.getBalance = _chunkFHJTO6BQjs.getBalance; exports.getBlock = _chunkFHJTO6BQjs.getBlock; exports.getBlockNumber = _chunkFHJTO6BQjs.getBlockNumber; exports.getBlockNumberCache = _chunkFHJTO6BQjs.getBlockNumberCache; exports.getBlockTransactionCount = _chunkFHJTO6BQjs.getBlockTransactionCount; exports.getBytecode = _chunkFHJTO6BQjs.getBytecode; exports.getChainId = _chunkFHJTO6BQjs.getChainId; exports.getFeeHistory = _chunkFHJTO6BQjs.getFeeHistory; exports.getFilterChanges = _chunkFHJTO6BQjs.getFilterChanges; exports.getFilterLogs = _chunkFHJTO6BQjs.getFilterLogs; exports.getGasPrice = _chunkFHJTO6BQjs.getGasPrice; exports.getLogs = _chunkFHJTO6BQjs.getLogs; exports.getTransaction = _chunkFHJTO6BQjs.getTransaction; exports.getTransactionConfirmations = _chunkFHJTO6BQjs.getTransactionConfirmations; exports.getTransactionCount = _chunkFHJTO6BQjs.getTransactionCount; exports.getTransactionReceipt = _chunkFHJTO6BQjs.getTransactionReceipt; exports.uninstallFilter = _chunkFHJTO6BQjs.uninstallFilter; exports.waitForTransactionReceipt = _chunkFHJTO6BQjs.waitForTransactionReceipt; exports.watchBlockNumber = _chunkFHJTO6BQjs.watchBlockNumber; exports.watchBlocks = _chunkFHJTO6BQjs.watchBlocks; exports.watchEvent = _chunkFHJTO6BQjs.watchEvent; exports.watchPendingTransactions = _chunkFHJTO6BQjs.watchPendingTransactions;
|
59
59
|
//# sourceMappingURL=public.js.map
|
package/dist/public.mjs
CHANGED
@@ -1,46 +1,46 @@
|
|
1
|
-
import { a as Hash, y as RpcTransaction,
|
2
|
-
import { a as Transport, b as ClientConfig, C as Client } from './createClient-
|
3
|
-
import { T as TestRequests } from './eip1193-
|
1
|
+
import { a as Hash, y as RpcTransaction, aa as Quantity, I as TransactionRequest, H as Hex, C as Chain } from './chain-75b0942e.js';
|
2
|
+
import { a as Transport, b as ClientConfig, C as Client } from './createClient-f87255c1.js';
|
3
|
+
import { T as TestRequests } from './eip1193-ae706fd8.js';
|
4
4
|
import { Address } from 'abitype';
|
5
5
|
|
6
6
|
type DropTransactionParameters = {
|
7
7
|
/** The hash of the transaction to drop. */
|
8
8
|
hash: Hash;
|
9
9
|
};
|
10
|
-
declare function dropTransaction(client:
|
10
|
+
declare function dropTransaction(client: TestClientArg, { hash }: DropTransactionParameters): Promise<void>;
|
11
11
|
|
12
12
|
type GetAutomineReturnType = boolean;
|
13
|
-
declare function getAutomine(client:
|
13
|
+
declare function getAutomine(client: TestClientArg): Promise<GetAutomineReturnType>;
|
14
14
|
|
15
15
|
type GetTxpoolContentReturnType = {
|
16
16
|
pending: Record<Address, Record<string, RpcTransaction>>;
|
17
17
|
queued: Record<Address, Record<string, RpcTransaction>>;
|
18
18
|
};
|
19
|
-
declare function getTxpoolContent(client:
|
19
|
+
declare function getTxpoolContent(client: TestClientArg): Promise<GetTxpoolContentReturnType>;
|
20
20
|
|
21
21
|
type GetTxpoolStatusReturnType = {
|
22
22
|
pending: number;
|
23
23
|
queued: number;
|
24
24
|
};
|
25
|
-
declare function getTxpoolStatus(client:
|
25
|
+
declare function getTxpoolStatus(client: TestClientArg): Promise<GetTxpoolStatusReturnType>;
|
26
26
|
|
27
27
|
type ImpersonateAccountParameters = {
|
28
28
|
/** The account to impersonate. */
|
29
29
|
address: Address;
|
30
30
|
};
|
31
|
-
declare function impersonateAccount(client:
|
31
|
+
declare function impersonateAccount(client: TestClientArg, { address }: ImpersonateAccountParameters): Promise<void>;
|
32
32
|
|
33
33
|
type IncreaseTimeParameters = {
|
34
34
|
/** The amount of seconds to jump forward in time. */
|
35
35
|
seconds: number;
|
36
36
|
};
|
37
|
-
declare function increaseTime(client:
|
37
|
+
declare function increaseTime(client: TestClientArg, { seconds }: IncreaseTimeParameters): Promise<`0x${string}`>;
|
38
38
|
|
39
39
|
type InspectTxpoolReturnType = {
|
40
40
|
pending: Record<Address, Record<string, string>>;
|
41
41
|
queued: Record<Address, Record<string, string>>;
|
42
42
|
};
|
43
|
-
declare function inspectTxpool(client:
|
43
|
+
declare function inspectTxpool(client: TestClientArg): Promise<InspectTxpoolReturnType>;
|
44
44
|
|
45
45
|
type MineParameters = {
|
46
46
|
/** Number of blocks to mine. */
|
@@ -48,7 +48,7 @@ type MineParameters = {
|
|
48
48
|
/** Interval between each block in seconds. */
|
49
49
|
interval?: number;
|
50
50
|
};
|
51
|
-
declare function mine(client:
|
51
|
+
declare function mine(client: TestClientArg, { blocks, interval }: MineParameters): Promise<void>;
|
52
52
|
|
53
53
|
type ResetParameters = {
|
54
54
|
/** The block number to reset from. */
|
@@ -56,17 +56,17 @@ type ResetParameters = {
|
|
56
56
|
/** The JSON RPC URL. */
|
57
57
|
jsonRpcUrl?: string;
|
58
58
|
};
|
59
|
-
declare function reset(client:
|
59
|
+
declare function reset(client: TestClientArg, { blockNumber, jsonRpcUrl }?: ResetParameters): Promise<void>;
|
60
60
|
|
61
61
|
type RevertParameters = {
|
62
62
|
/** The snapshot ID to revert to. */
|
63
63
|
id: Quantity;
|
64
64
|
};
|
65
|
-
declare function revert(client:
|
65
|
+
declare function revert(client: TestClientArg, { id }: RevertParameters): Promise<void>;
|
66
66
|
|
67
67
|
type SendUnsignedTransactionParameters = TransactionRequest;
|
68
68
|
type SendUnsignedTransactionReturnType = Hash;
|
69
|
-
declare function sendUnsignedTransaction(client:
|
69
|
+
declare function sendUnsignedTransaction(client: TestClientArg, request: SendUnsignedTransactionParameters): Promise<SendUnsignedTransactionReturnType>;
|
70
70
|
|
71
71
|
type SetBalanceParameters = {
|
72
72
|
/** The account address. */
|
@@ -74,19 +74,19 @@ type SetBalanceParameters = {
|
|
74
74
|
/** Amount (in wei) to set */
|
75
75
|
value: bigint;
|
76
76
|
};
|
77
|
-
declare function setBalance(client:
|
77
|
+
declare function setBalance(client: TestClientArg, { address, value }: SetBalanceParameters): Promise<void>;
|
78
78
|
|
79
79
|
type SetBlockGasLimitParameters = {
|
80
80
|
/** Gas limit (in wei). */
|
81
81
|
gasLimit: bigint;
|
82
82
|
};
|
83
|
-
declare function setBlockGasLimit(client:
|
83
|
+
declare function setBlockGasLimit(client: TestClientArg, { gasLimit }: SetBlockGasLimitParameters): Promise<void>;
|
84
84
|
|
85
85
|
type SetBlockTimestampIntervalParameters = {
|
86
86
|
/** The interval (in seconds). */
|
87
87
|
interval: number;
|
88
88
|
};
|
89
|
-
declare function setBlockTimestampInterval(client:
|
89
|
+
declare function setBlockTimestampInterval(client: TestClientArg, { interval }: SetBlockTimestampIntervalParameters): Promise<void>;
|
90
90
|
|
91
91
|
type SetCodeParameters = {
|
92
92
|
/** The account address. */
|
@@ -94,37 +94,37 @@ type SetCodeParameters = {
|
|
94
94
|
/** The bytecode to set */
|
95
95
|
bytecode: Hex;
|
96
96
|
};
|
97
|
-
declare function setCode(client:
|
97
|
+
declare function setCode(client: TestClientArg, { address, bytecode }: SetCodeParameters): Promise<void>;
|
98
98
|
|
99
99
|
type SetCoinbaseParameters = {
|
100
100
|
/** The coinbase address. */
|
101
101
|
address: Address;
|
102
102
|
};
|
103
|
-
declare function setCoinbase(client:
|
103
|
+
declare function setCoinbase(client: TestClientArg, { address }: SetCoinbaseParameters): Promise<void>;
|
104
104
|
|
105
105
|
type SetIntervalMiningParameters = {
|
106
106
|
/** The mining interval. */
|
107
107
|
interval: number;
|
108
108
|
};
|
109
|
-
declare function setIntervalMining(client:
|
109
|
+
declare function setIntervalMining(client: TestClientArg, { interval }: SetIntervalMiningParameters): Promise<void>;
|
110
110
|
|
111
111
|
type SetMinGasPriceParameters = {
|
112
112
|
/** The gas price. */
|
113
113
|
gasPrice: bigint;
|
114
114
|
};
|
115
|
-
declare function setMinGasPrice(client:
|
115
|
+
declare function setMinGasPrice(client: TestClientArg, { gasPrice }: SetMinGasPriceParameters): Promise<void>;
|
116
116
|
|
117
117
|
type SetNextBlockBaseFeePerGasParameters = {
|
118
118
|
/** Base fee per gas (in wei). */
|
119
119
|
baseFeePerGas: bigint;
|
120
120
|
};
|
121
|
-
declare function setNextBlockBaseFeePerGas(client:
|
121
|
+
declare function setNextBlockBaseFeePerGas(client: TestClientArg, { baseFeePerGas }: SetNextBlockBaseFeePerGasParameters): Promise<void>;
|
122
122
|
|
123
123
|
type SetNextBlockTimestampParameters = {
|
124
124
|
/** The timestamp (in seconds). */
|
125
125
|
timestamp: bigint;
|
126
126
|
};
|
127
|
-
declare function setNextBlockTimestamp(client:
|
127
|
+
declare function setNextBlockTimestamp(client: TestClientArg, { timestamp }: SetNextBlockTimestampParameters): Promise<void>;
|
128
128
|
|
129
129
|
type SetNonceParameters = {
|
130
130
|
/** The account address. */
|
@@ -132,7 +132,7 @@ type SetNonceParameters = {
|
|
132
132
|
/** The nonce to set. */
|
133
133
|
nonce: number;
|
134
134
|
};
|
135
|
-
declare function setNonce(client:
|
135
|
+
declare function setNonce(client: TestClientArg, { address, nonce }: SetNonceParameters): Promise<void>;
|
136
136
|
|
137
137
|
type SetStorageAtParameters = {
|
138
138
|
/** The account address. */
|
@@ -142,16 +142,16 @@ type SetStorageAtParameters = {
|
|
142
142
|
/** The value to store as a 32 byte hex string. */
|
143
143
|
value: Hex;
|
144
144
|
};
|
145
|
-
declare function setStorageAt(client:
|
145
|
+
declare function setStorageAt(client: TestClientArg, { address, index, value }: SetStorageAtParameters): Promise<void>;
|
146
146
|
|
147
147
|
type StopImpersonatingAccountParameters = {
|
148
148
|
/** The account to impersonate. */
|
149
149
|
address: Address;
|
150
150
|
};
|
151
|
-
declare function stopImpersonatingAccount(client:
|
151
|
+
declare function stopImpersonatingAccount(client: TestClientArg, { address }: StopImpersonatingAccountParameters): Promise<void>;
|
152
152
|
|
153
153
|
type TestClientModes = 'anvil' | 'hardhat';
|
154
|
-
type TestClientConfig<TTransport extends Transport = Transport, TChain extends Chain = Chain, TMode extends TestClientModes = TestClientModes> = {
|
154
|
+
type TestClientConfig<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain, TMode extends TestClientModes = TestClientModes> = {
|
155
155
|
chain?: ClientConfig<TTransport, TChain>['chain'];
|
156
156
|
/** The key of the client. */
|
157
157
|
key?: ClientConfig['key'];
|
@@ -163,15 +163,16 @@ type TestClientConfig<TTransport extends Transport = Transport, TChain extends C
|
|
163
163
|
pollingInterval?: ClientConfig['pollingInterval'];
|
164
164
|
transport: ClientConfig<TTransport, TChain>['transport'];
|
165
165
|
};
|
166
|
-
type TestClient<TTransport extends Transport = Transport, TChain extends Chain = Chain, TMode extends TestClientModes = TestClientModes, TIncludeActions extends boolean = true> = Client<TTransport, TChain, TestRequests<TMode>> & {
|
166
|
+
type TestClient<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain, TMode extends TestClientModes = TestClientModes, TIncludeActions extends boolean = true> = Client<TTransport, TChain, TestRequests<TMode>> & {
|
167
167
|
mode: TMode;
|
168
|
-
} & (TIncludeActions extends true ? TestActions
|
168
|
+
} & (TIncludeActions extends true ? TestActions : {});
|
169
|
+
type TestClientArg<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TMode extends TestClientModes = TestClientModes, TIncludeActions extends boolean = boolean> = TestClient<TTransport, TChain, TMode, TIncludeActions>;
|
169
170
|
/**
|
170
171
|
* @description Creates a test client with a given transport.
|
171
172
|
*/
|
172
|
-
declare function createTestClient<TTransport extends Transport, TChain extends Chain, TMode extends TestClientModes>({ chain, key, name, mode, pollingInterval, transport, }: TestClientConfig<TTransport, TChain, TMode>): TestClient<TTransport, TChain, TMode, true>;
|
173
|
+
declare function createTestClient<TTransport extends Transport, TChain extends Chain | undefined, TMode extends TestClientModes>({ chain, key, name, mode, pollingInterval, transport, }: TestClientConfig<TTransport, TChain, TMode>): TestClient<TTransport, TChain, TMode, true>;
|
173
174
|
|
174
|
-
type TestActions
|
175
|
+
type TestActions = {
|
175
176
|
dropTransaction: (args: DropTransactionParameters) => Promise<void>;
|
176
177
|
getAutomine: () => Promise<GetAutomineReturnType>;
|
177
178
|
getTxpoolContent: () => Promise<GetTxpoolContentReturnType>;
|
@@ -202,4 +203,4 @@ type TestActions<TChain extends Chain = Chain> = {
|
|
202
203
|
stopImpersonatingAccount: (args: StopImpersonatingAccountParameters) => Promise<void>;
|
203
204
|
};
|
204
205
|
|
205
|
-
export {
|
206
|
+
export { IncreaseTimeParameters as A, RevertParameters as B, SendUnsignedTransactionReturnType as C, DropTransactionParameters as D, SetBalanceParameters as E, SetBlockGasLimitParameters as F, SetBlockTimestampIntervalParameters as G, SetCodeParameters as H, ImpersonateAccountParameters as I, SetCoinbaseParameters as J, SetIntervalMiningParameters as K, SetMinGasPriceParameters as L, MineParameters as M, SetNextBlockBaseFeePerGasParameters as N, SetNextBlockTimestampParameters as O, SetNonceParameters as P, SetStorageAtParameters as Q, ResetParameters as R, SendUnsignedTransactionParameters as S, TestClient as T, StopImpersonatingAccountParameters as U, TestClientConfig as a, TestClientArg as b, createTestClient as c, dropTransaction as d, getTxpoolContent as e, getTxpoolStatus as f, getAutomine as g, increaseTime as h, impersonateAccount as i, inspectTxpool as j, revert as k, setBalance as l, mine as m, setBlockGasLimit as n, setBlockTimestampInterval as o, setCode as p, setCoinbase as q, reset as r, sendUnsignedTransaction as s, setIntervalMining as t, setMinGasPrice as u, setNextBlockBaseFeePerGas as v, setNextBlockTimestamp as w, setNonce as x, setStorageAt as y, stopImpersonatingAccount as z };
|
package/dist/test.d.ts
CHANGED
@@ -1,19 +1,19 @@
|
|
1
|
-
import {
|
2
|
-
export { D as DropTransactionParameters, I as ImpersonateAccountParameters,
|
3
|
-
import './chain-
|
1
|
+
import { b as TestClientArg } from './test-98c0b642.js';
|
2
|
+
export { D as DropTransactionParameters, I as ImpersonateAccountParameters, A as IncreaseTimeParameters, M as MineParameters, R as ResetParameters, B as RevertParameters, S as SendUnsignedTransactionParameters, C as SendUnsignedTransactionReturnType, E as SetBalanceParameters, F as SetBlockGasLimitParameters, G as SetBlockTimestampIntervalParameters, H as SetCodeParameters, J as SetCoinbaseParameters, K as SetIntervalMiningParameters, L as SetMinGasPriceParameters, N as SetNextBlockBaseFeePerGasParameters, O as SetNextBlockTimestampParameters, P as SetNonceParameters, Q as SetStorageAtParameters, U as StopImpersonatingAccountParameters, d as dropTransaction, g as getAutomine, e as getTxpoolContent, f as getTxpoolStatus, i as impersonateAccount, h as increaseTime, j as inspectTxpool, m as mine, r as reset, k as revert, s as sendUnsignedTransaction, l as setBalance, n as setBlockGasLimit, o as setBlockTimestampInterval, p as setCode, q as setCoinbase, t as setIntervalMining, u as setMinGasPrice, v as setNextBlockBaseFeePerGas, w as setNextBlockTimestamp, x as setNonce, y as setStorageAt, z as stopImpersonatingAccount } from './test-98c0b642.js';
|
3
|
+
import './chain-75b0942e.js';
|
4
4
|
import '@wagmi/chains';
|
5
5
|
import 'abitype';
|
6
|
-
import './createClient-
|
7
|
-
import './eip1193-
|
6
|
+
import './createClient-f87255c1.js';
|
7
|
+
import './eip1193-ae706fd8.js';
|
8
8
|
|
9
|
-
declare function removeBlockTimestampInterval(client:
|
9
|
+
declare function removeBlockTimestampInterval(client: TestClientArg): Promise<void>;
|
10
10
|
|
11
|
-
declare function setAutomine(client:
|
11
|
+
declare function setAutomine(client: TestClientArg, enabled: boolean): Promise<void>;
|
12
12
|
|
13
|
-
declare function setLoggingEnabled(client:
|
13
|
+
declare function setLoggingEnabled(client: TestClientArg, enabled: boolean): Promise<void>;
|
14
14
|
|
15
|
-
declare function setRpcUrl(client:
|
15
|
+
declare function setRpcUrl(client: TestClientArg, jsonRpcUrl: string): Promise<void>;
|
16
16
|
|
17
|
-
declare function snapshot(client:
|
17
|
+
declare function snapshot(client: TestClientArg): Promise<`0x${string}`>;
|
18
18
|
|
19
19
|
export { removeBlockTimestampInterval, setAutomine, setLoggingEnabled, setRpcUrl, snapshot };
|
package/dist/test.js
CHANGED
@@ -27,7 +27,7 @@
|
|
27
27
|
|
28
28
|
|
29
29
|
|
30
|
-
var
|
30
|
+
var _chunkFHJTO6BQjs = require('./chunk-FHJTO6BQ.js');
|
31
31
|
|
32
32
|
|
33
33
|
|
@@ -57,5 +57,5 @@ var _chunkA5BRAPQQjs = require('./chunk-A5BRAPQQ.js');
|
|
57
57
|
|
58
58
|
|
59
59
|
|
60
|
-
exports.dropTransaction =
|
60
|
+
exports.dropTransaction = _chunkFHJTO6BQjs.dropTransaction; exports.getAutomine = _chunkFHJTO6BQjs.getAutomine; exports.getTxpoolContent = _chunkFHJTO6BQjs.getTxpoolContent; exports.getTxpoolStatus = _chunkFHJTO6BQjs.getTxpoolStatus; exports.impersonateAccount = _chunkFHJTO6BQjs.impersonateAccount; exports.increaseTime = _chunkFHJTO6BQjs.increaseTime; exports.inspectTxpool = _chunkFHJTO6BQjs.inspectTxpool; exports.mine = _chunkFHJTO6BQjs.mine; exports.removeBlockTimestampInterval = _chunkFHJTO6BQjs.removeBlockTimestampInterval; exports.reset = _chunkFHJTO6BQjs.reset; exports.revert = _chunkFHJTO6BQjs.revert; exports.sendUnsignedTransaction = _chunkFHJTO6BQjs.sendUnsignedTransaction; exports.setAutomine = _chunkFHJTO6BQjs.setAutomine; exports.setBalance = _chunkFHJTO6BQjs.setBalance; exports.setBlockGasLimit = _chunkFHJTO6BQjs.setBlockGasLimit; exports.setBlockTimestampInterval = _chunkFHJTO6BQjs.setBlockTimestampInterval; exports.setCode = _chunkFHJTO6BQjs.setCode; exports.setCoinbase = _chunkFHJTO6BQjs.setCoinbase; exports.setIntervalMining = _chunkFHJTO6BQjs.setIntervalMining; exports.setLoggingEnabled = _chunkFHJTO6BQjs.setLoggingEnabled; exports.setMinGasPrice = _chunkFHJTO6BQjs.setMinGasPrice; exports.setNextBlockBaseFeePerGas = _chunkFHJTO6BQjs.setNextBlockBaseFeePerGas; exports.setNextBlockTimestamp = _chunkFHJTO6BQjs.setNextBlockTimestamp; exports.setNonce = _chunkFHJTO6BQjs.setNonce; exports.setRpcUrl = _chunkFHJTO6BQjs.setRpcUrl; exports.setStorageAt = _chunkFHJTO6BQjs.setStorageAt; exports.snapshot = _chunkFHJTO6BQjs.snapshot; exports.stopImpersonatingAccount = _chunkFHJTO6BQjs.stopImpersonatingAccount;
|
61
61
|
//# sourceMappingURL=test.js.map
|
package/dist/test.mjs
CHANGED
@@ -0,0 +1,76 @@
|
|
1
|
+
import { Address, TypedData, TypedDataToPrimitiveTypes, TypedDataDomain, Narrow } from 'abitype';
|
2
|
+
import { H as Hex, a as Hash, I as TransactionRequest } from './chain-75b0942e.js';
|
3
|
+
|
4
|
+
type Account = JsonRpcAccount | LocalAccount;
|
5
|
+
type CustomSource = {
|
6
|
+
address: Address;
|
7
|
+
signMessage: ({ message }: {
|
8
|
+
message: string;
|
9
|
+
}) => Promise<Hash>;
|
10
|
+
signTransaction: (transaction: Omit<TransactionRequest, 'from'> & {
|
11
|
+
chainId: number;
|
12
|
+
from: Address;
|
13
|
+
}) => Promise<Hash>;
|
14
|
+
signTypedData: <TTypedData extends TypedData | {
|
15
|
+
[key: string]: unknown;
|
16
|
+
}, TPrimaryType extends string = string>(typedData: TypedDataDefinition<TTypedData, TPrimaryType>) => Promise<Hash>;
|
17
|
+
};
|
18
|
+
type JsonRpcAccount = {
|
19
|
+
address: Address;
|
20
|
+
type: 'json-rpc';
|
21
|
+
};
|
22
|
+
type LocalAccount<TSource = 'custom'> = CustomSource & {
|
23
|
+
address: Address;
|
24
|
+
publicKey: Hex;
|
25
|
+
getPrivateKey(): Hex;
|
26
|
+
source: TSource;
|
27
|
+
type: 'local';
|
28
|
+
};
|
29
|
+
|
30
|
+
type TypedDataDefinition<TTypedData extends TypedData | {
|
31
|
+
[key: string]: unknown;
|
32
|
+
} = TypedData, TPrimaryType extends string = string> = {
|
33
|
+
primaryType: GetTypedDataPrimaryType<TTypedData, TPrimaryType>;
|
34
|
+
} & GetTypedDataMessage<TTypedData, TPrimaryType> & GetTypedDataTypes<TTypedData, TPrimaryType> & GetTypedDataDomain<TTypedData, TPrimaryType>;
|
35
|
+
type GetTypedDataDomain<TTypedData extends TypedData | {
|
36
|
+
[key: string]: unknown;
|
37
|
+
} = TypedData, TPrimaryType extends string = string, TSchema = TTypedData extends TypedData ? TypedDataToPrimitiveTypes<TTypedData> : {
|
38
|
+
[key: string]: any;
|
39
|
+
}, TDomain = TSchema extends {
|
40
|
+
EIP712Domain: infer Domain;
|
41
|
+
} ? Domain : TypedDataDomain> = TPrimaryType extends 'EIP712Domain' ? {
|
42
|
+
domain: TDomain;
|
43
|
+
} : {
|
44
|
+
domain?: TDomain;
|
45
|
+
};
|
46
|
+
type GetTypedDataMessage<TTypedData extends TypedData | {
|
47
|
+
[key: string]: unknown;
|
48
|
+
} = TypedData, TPrimaryType extends string = string, TSchema = TTypedData extends TypedData ? TypedDataToPrimitiveTypes<TTypedData> : {
|
49
|
+
[key: string]: any;
|
50
|
+
}, TMessage = TSchema[TPrimaryType extends keyof TSchema ? TPrimaryType : keyof TSchema]> = TPrimaryType extends 'EIP712Domain' ? {} : {
|
51
|
+
[key: string]: any;
|
52
|
+
} extends TMessage ? {
|
53
|
+
/**
|
54
|
+
* Data to sign
|
55
|
+
*
|
56
|
+
* Use a [const assertion](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html#const-assertions) on {@link types} for type inference.
|
57
|
+
*/
|
58
|
+
message: {
|
59
|
+
[key: string]: unknown;
|
60
|
+
};
|
61
|
+
} : {
|
62
|
+
/** Data to sign */
|
63
|
+
message: TMessage;
|
64
|
+
};
|
65
|
+
type GetTypedDataPrimaryType<TTypedData extends TypedData | {
|
66
|
+
[key: string]: unknown;
|
67
|
+
} = TypedData, TPrimaryType extends string = string> = TTypedData extends TypedData ? keyof TTypedData extends infer AbiFunctionNames ? AbiFunctionNames | (TPrimaryType extends AbiFunctionNames ? TPrimaryType : never) | (TypedData extends TTypedData ? string : never) | 'EIP712Domain' : never : TPrimaryType;
|
68
|
+
type GetTypedDataTypes<TTypedData extends TypedData | {
|
69
|
+
[key: string]: unknown;
|
70
|
+
} = TypedData, TPrimaryType extends string = string> = TPrimaryType extends 'EIP712Domain' ? {
|
71
|
+
types?: Narrow<TTypedData>;
|
72
|
+
} : {
|
73
|
+
types: Narrow<TTypedData>;
|
74
|
+
};
|
75
|
+
|
76
|
+
export { Account as A, JsonRpcAccount as J, LocalAccount as L, TypedDataDefinition as T };
|