viem 0.0.1-alpha.27 → 0.0.1-alpha.29
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/chain-4d46a747.d.ts +543 -0
- package/dist/{chain-b0cfb141.d.ts → chain-c7c44165.d.ts} +1 -1
- package/dist/chains.d.ts +5 -3
- package/dist/chains.js +46 -46
- package/dist/chains.mjs +1 -1
- package/dist/{chunk-JY7JGKSA.js → chunk-4VQKZYE2.js} +219 -157
- package/dist/chunk-4VQKZYE2.js.map +1 -0
- package/dist/{chunk-2DSFM32P.js → chunk-CKYH337I.js} +15 -15
- package/dist/{chunk-2DSFM32P.js.map → chunk-CKYH337I.js.map} +1 -1
- package/dist/{chunk-W7KWIGWO.js → chunk-EYORBAD4.js} +45 -44
- package/dist/chunk-EYORBAD4.js.map +1 -0
- package/dist/{chunk-LF6P33WQ.mjs → chunk-HPUQL3IM.mjs} +3 -3
- package/dist/chunk-HPUQL3IM.mjs.map +1 -0
- package/dist/chunk-OJ7H3CQF.js +265 -0
- package/dist/chunk-OJ7H3CQF.js.map +1 -0
- package/dist/chunk-Q67VUTW3.mjs +210 -0
- package/dist/chunk-Q67VUTW3.mjs.map +1 -0
- package/dist/{chunk-AKGXRZDN.mjs → chunk-RR4MGS6O.mjs} +27 -26
- package/dist/chunk-RR4MGS6O.mjs.map +1 -0
- package/dist/chunk-S252SZEL.mjs +265 -0
- package/dist/chunk-S252SZEL.mjs.map +1 -0
- package/dist/chunk-SEIPUKZE.js +210 -0
- package/dist/chunk-SEIPUKZE.js.map +1 -0
- package/dist/{chunk-BJJH7RYH.mjs → chunk-TQC7KZ24.mjs} +164 -102
- package/dist/chunk-TQC7KZ24.mjs.map +1 -0
- package/dist/contract.d.ts +12 -128
- package/dist/contract.js +6 -4
- package/dist/contract.mjs +5 -3
- package/dist/{createClient-6689596e.d.ts → createClient-5d5c14d6.d.ts} +5 -3
- package/dist/createPublicClient-2b4afeac.d.ts +629 -0
- package/dist/{eip1193-617a05ae.d.ts → eip1193-f09a55af.d.ts} +2 -2
- package/dist/ens.d.ts +10 -68
- package/dist/ens.js +5 -199
- package/dist/ens.js.map +1 -1
- package/dist/ens.mjs +7 -201
- package/dist/ens.mjs.map +1 -1
- package/dist/formatAbiItem-d231fef2.d.ts +14 -0
- package/dist/{getAbiItem-d2e8bd76.d.ts → getAbiItem-0e085959.d.ts} +15 -15
- package/dist/index.d.ts +22 -13
- package/dist/index.js +368 -26
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +358 -16
- package/dist/index.mjs.map +1 -1
- package/dist/namehash-88f4639d.d.ts +22 -0
- package/dist/parseGwei-4d0b0d73.d.ts +344 -0
- package/dist/public.d.ts +11 -334
- package/dist/public.js +5 -3
- package/dist/public.mjs +4 -2
- package/dist/test-b9208949.d.ts +213 -0
- package/dist/test.d.ts +8 -149
- package/dist/test.js +20 -222
- package/dist/test.js.map +1 -1
- package/dist/test.mjs +30 -232
- package/dist/test.mjs.map +1 -1
- package/dist/{transactionReceipt-44dbf122.d.ts → transactionReceipt-84fc92e1.d.ts} +1 -1
- package/dist/{transactionRequest-f437b4ba.d.ts → transactionRequest-44c539b4.d.ts} +1 -1
- package/dist/utils/index.d.ts +12 -238
- package/dist/utils/index.js +2 -2
- package/dist/utils/index.mjs +1 -1
- package/dist/wallet-9b1c6905.d.ts +104 -0
- package/dist/wallet.d.ts +7 -41
- package/dist/wallet.js +3 -3
- package/dist/wallet.mjs +2 -2
- package/dist/window.d.ts +4 -2
- package/package.json +1 -1
- package/dist/call-3476b8ee.d.ts +0 -22
- package/dist/chain-42de87e5.d.ts +0 -359
- package/dist/chunk-AKGXRZDN.mjs.map +0 -1
- package/dist/chunk-BJJH7RYH.mjs.map +0 -1
- package/dist/chunk-JY7JGKSA.js.map +0 -1
- package/dist/chunk-LF6P33WQ.mjs.map +0 -1
- package/dist/chunk-W7KWIGWO.js.map +0 -1
- package/dist/contract-9dd2f98b.d.ts +0 -166
- package/dist/createPublicClient-fd558574.d.ts +0 -19
- package/dist/createTestClient-bc1d9028.d.ts +0 -34
- package/dist/createWalletClient-4df88244.d.ts +0 -30
- package/dist/decodeErrorResult-ac835649.d.ts +0 -16
- package/dist/readContract-c460f23a.d.ts +0 -10
- package/dist/rpc-8c10fc98.d.ts +0 -119
- package/dist/sendTransaction-7ce442c0.d.ts +0 -12
- package/dist/watchEvent-569c9976.d.ts +0 -41
@@ -1,6 +1,5 @@
|
|
1
1
|
import { AbiParameter, Narrow, Abi, AbiParametersToPrimitiveTypes } from 'abitype';
|
2
|
-
import { H as Hex,
|
3
|
-
import { b as ExtractEventNameFromAbi, d as ExtractEventArgsFromTopics, e as ExtractFunctionNameFromAbi, f as ExtractArgsFromAbi, E as ExtractResultFromAbi, a as ExtractConstructorArgsFromAbi, g as ExtractErrorNameFromAbi, h as ExtractErrorArgsFromAbi, c as ExtractEventArgsFromAbi, A as AbiItem, i as ExtractNameFromAbi } from './contract-9dd2f98b.js';
|
2
|
+
import { H as Hex, c as AbiItem, a5 as LogTopic, _ as ExtractEventNameFromAbi, a6 as ExtractEventArgsFromTopics, a7 as ExtractFunctionNameFromAbi, a8 as ExtractArgsFromAbi, V as ExtractResultFromAbi, a3 as ExtractConstructorArgsFromAbi, a9 as ExtractErrorNameFromAbi, aa as ExtractErrorArgsFromAbi, a0 as ExtractEventArgsFromAbi, ab as ExtractNameFromAbi } from './chain-4d46a747.js';
|
4
3
|
import * as abitype_dist_abi_78346466 from 'abitype/dist/abi-78346466';
|
5
4
|
|
6
5
|
type DecodeAbiArgs<TParams extends readonly AbiParameter[] | readonly unknown[] = readonly AbiParameter[]> = {
|
@@ -9,6 +8,17 @@ type DecodeAbiArgs<TParams extends readonly AbiParameter[] | readonly unknown[]
|
|
9
8
|
};
|
10
9
|
declare function decodeAbi<TParams extends readonly AbiParameter[] | readonly unknown[]>({ data, params }: DecodeAbiArgs<TParams>): readonly unknown[] | undefined;
|
11
10
|
|
11
|
+
type DecodeErrorResultArgs = {
|
12
|
+
abi?: Abi;
|
13
|
+
data: Hex;
|
14
|
+
};
|
15
|
+
type DecodeErrorResultResponse = {
|
16
|
+
abiItem: AbiItem;
|
17
|
+
errorName: string;
|
18
|
+
args?: readonly unknown[];
|
19
|
+
};
|
20
|
+
declare function decodeErrorResult({ abi, data, }: DecodeErrorResultArgs): DecodeErrorResultResponse;
|
21
|
+
|
12
22
|
type DecodeEventLogArgs<TAbi extends Abi | readonly unknown[] = Abi, TEventName extends string = string, TTopics extends LogTopic[] = LogTopic[], TData extends Hex | undefined = undefined> = {
|
13
23
|
abi: Narrow<TAbi>;
|
14
24
|
data?: TData;
|
@@ -60,8 +70,9 @@ declare function encodeErrorResult<TAbi extends Abi | readonly unknown[], TError
|
|
60
70
|
|
61
71
|
type EncodeEventTopicsArgs<TAbi extends Abi | readonly unknown[] = Abi, TEventName extends string = string> = {
|
62
72
|
abi: Narrow<TAbi>;
|
73
|
+
args?: ExtractEventArgsFromAbi<TAbi, TEventName>;
|
63
74
|
eventName: ExtractEventNameFromAbi<TAbi, TEventName>;
|
64
|
-
}
|
75
|
+
};
|
65
76
|
declare function encodeEventTopics<TAbi extends Abi | readonly unknown[], TEventName extends string>({ abi, eventName, args }: EncodeEventTopicsArgs<TAbi, TEventName>): `0x${string}`[];
|
66
77
|
|
67
78
|
type EncodeFunctionDataArgs<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = {
|
@@ -77,21 +88,10 @@ type EncodeFunctionResultArgs<TAbi extends Abi | readonly unknown[] = Abi, TFunc
|
|
77
88
|
};
|
78
89
|
declare function encodeFunctionResult<TAbi extends Abi | readonly unknown[], TFunctionName extends string>({ abi, functionName, result, }: EncodeFunctionResultArgs<TAbi, TFunctionName>): `0x${string}`;
|
79
90
|
|
80
|
-
declare function formatAbiItemWithArgs({ abiItem, args, includeFunctionName, includeName, }: {
|
81
|
-
abiItem: AbiItem;
|
82
|
-
args: readonly unknown[];
|
83
|
-
includeFunctionName?: boolean;
|
84
|
-
includeName?: boolean;
|
85
|
-
}): string | undefined;
|
86
|
-
|
87
|
-
declare function formatAbiItem(abiItem: AbiItem, { includeName }?: {
|
88
|
-
includeName?: boolean;
|
89
|
-
}): string;
|
90
|
-
|
91
91
|
type GetAbiItemArgs<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = any> = {
|
92
92
|
abi: Narrow<TAbi>;
|
93
93
|
name: ExtractNameFromAbi<TAbi, TFunctionName>;
|
94
94
|
} & Partial<ExtractArgsFromAbi<TAbi, TFunctionName>>;
|
95
95
|
declare function getAbiItem<TAbi extends Abi | readonly unknown[], TFunctionName extends string>({ abi, args, name }: GetAbiItemArgs<TAbi, TFunctionName>): abitype_dist_abi_78346466.o | abitype_dist_abi_78346466.q | abitype_dist_abi_78346466.p | undefined;
|
96
96
|
|
97
|
-
export { DecodeAbiArgs as D, EncodeAbiArgs as E, GetAbiItemArgs as G,
|
97
|
+
export { DecodeAbiArgs as D, EncodeAbiArgs as E, GetAbiItemArgs as G, DecodeErrorResultArgs as a, DecodeErrorResultResponse as b, DecodeEventLogArgs as c, DecodeEventLogResponse as d, DecodeFunctionDataArgs as e, DecodeFunctionResultArgs as f, DecodeFunctionResultResponse as g, EncodeDeployDataArgs as h, EncodeErrorResultArgs as i, EncodeEventTopicsArgs as j, EncodeFunctionDataArgs as k, EncodeFunctionResultArgs as l, decodeAbi as m, decodeErrorResult as n, decodeEventLog as o, decodeFunctionData as p, decodeFunctionResult as q, encodeAbi as r, encodeDeployData as s, encodeErrorResult as t, encodeEventTopics as u, encodeFunctionData as v, encodeFunctionResult as w, getAbiItem as x };
|
package/dist/index.d.ts
CHANGED
@@ -1,18 +1,23 @@
|
|
1
|
-
import { T as TransportConfig, a as Transport, B as BaseRpcRequests } from './createClient-
|
2
|
-
export { C as Client, b as ClientConfig, a as Transport, T as TransportConfig, c as createClient, d as createTransport } from './createClient-
|
1
|
+
import { T as TransportConfig, a as Transport, B as BaseRpcRequests } from './createClient-5d5c14d6.js';
|
2
|
+
export { C as Client, b as ClientConfig, a as Transport, T as TransportConfig, c as createClient, d as createTransport } from './createClient-5d5c14d6.js';
|
3
3
|
import WebSocket from 'isomorphic-ws';
|
4
|
-
import { H as Hex,
|
5
|
-
export { c as AccessList, A as Address,
|
6
|
-
import { B as BaseError, R as RpcResponse } from './
|
7
|
-
export { B as BaseError, C as ContractFunctionExecutionError, a as ContractFunctionRevertedError, b as ContractFunctionZeroDataError } from './
|
8
|
-
export { P as PublicClient, a as PublicClientConfig, c as createPublicClient } from './createPublicClient-
|
9
|
-
export { T as TestClient, a as TestClientConfig, c as createTestClient } from './
|
10
|
-
export { W as WalletClient, a as WalletClientConfig, c as createWalletClient } from './
|
11
|
-
export {
|
12
|
-
|
4
|
+
import { H as Hex, a as Hash, B as ByteArray, b as BlockTag } from './chain-4d46a747.js';
|
5
|
+
export { c as AbiItem, d as AccessList, A as Address, e as Block, f as BlockIdentifier, g as BlockNumber, b as BlockTag, B as ByteArray, C as Chain, h as ContractConfig, J as ExtractFormatter, F as FeeHistory, i as FeeValues, j as FeeValuesEIP1559, k as FeeValuesLegacy, K as Formatted, M as FormattedTransaction, a as Hash, H as Hex, L as Log, R as RpcBlock, l as RpcBlockIdentifier, m as RpcBlockNumber, n as RpcFeeHistory, o as RpcFeeValues, p as RpcLog, q as RpcTransaction, r as RpcTransactionReceipt, s as RpcTransactionRequest, t as RpcUncle, z as Transaction, D as TransactionBase, E as TransactionEIP1559, G as TransactionEIP2930, N as TransactionFormatter, I as TransactionLegacy, T as TransactionReceipt, u as TransactionRequest, v as TransactionRequestBase, w as TransactionRequestEIP1559, x as TransactionRequestEIP2930, y as TransactionRequestLegacy, U as Uncle, O as defineTransaction, P as formatTransaction, Q as transactionType } from './chain-4d46a747.js';
|
6
|
+
import { B as BaseError, R as RpcResponse } from './parseGwei-4d0b0d73.js';
|
7
|
+
export { B as BaseError, C as ContractFunctionExecutionError, a as ContractFunctionRevertedError, b as ContractFunctionZeroDataError, G as GetContractAddressOptions, c as GetCreate2AddressOptions, d as GetCreateAddressOptions, T as ToRlpResponse, e as boolToBytes, f as boolToHex, g as bytesToBigint, h as bytesToBool, i as bytesToHex, j as bytesToNumber, k as bytesToString, l as etherUnits, m as formatEther, n as formatGwei, o as formatUnit, p as fromBytes, q as fromHex, r as fromRlp, s as getAddress, t as getContractAddress, u as getContractError, v as getCreate2Address, w as getCreateAddress, x as getEventSignature, y as getFunctionSignature, z as gweiUnits, A as hexToBigInt, D as hexToBool, E as hexToBytes, F as hexToNumber, H as hexToString, I as isAddress, J as isAddressEqual, K as isBytes, L as isHex, M as keccak256, N as numberToBytes, O as numberToHex, P as pad, Q as padBytes, S as padHex, U as parseEther, V as parseGwei, W as parseUnit, X as size, Y as slice, Z as sliceBytes, _ as sliceHex, $ as stringToBytes, a0 as stringToHex, a1 as stringify, a2 as toBytes, a3 as toHex, a4 as toRlp, a5 as trim, a6 as weiUnits } from './parseGwei-4d0b0d73.js';
|
8
|
+
export { P as PublicClient, a as PublicClientConfig, c as createPublicClient } from './createPublicClient-2b4afeac.js';
|
9
|
+
export { T as TestClient, a as TestClientConfig, c as createTestClient } from './test-b9208949.js';
|
10
|
+
export { W as WalletClient, a as WalletClientConfig, c as createWalletClient } from './wallet-9b1c6905.js';
|
11
|
+
export { l as labelhash, n as namehash } from './namehash-88f4639d.js';
|
12
|
+
export { D as DecodeAbiArgs, a as DecodeErrorResultArgs, b as DecodeErrorResultResponse, c as DecodeEventLogArgs, d as DecodeEventLogResponse, e as DecodeFunctionDataArgs, f as DecodeFunctionResultArgs, g as DecodeFunctionResultResponse, E as EncodeAbiArgs, h as EncodeDeployDataArgs, i as EncodeErrorResultArgs, j as EncodeEventTopicsArgs, k as EncodeFunctionDataArgs, l as EncodeFunctionResultArgs, G as GetAbiItemArgs, m as decodeAbi, n as decodeErrorResult, o as decodeEventLog, p as decodeFunctionData, q as decodeFunctionResult, r as encodeAbi, s as encodeDeployData, t as encodeErrorResult, u as encodeEventTopics, v as encodeFunctionData, w as encodeFunctionResult, x as getAbiItem } from './getAbiItem-0e085959.js';
|
13
|
+
export { d as defineChain } from './chain-c7c44165.js';
|
14
|
+
export { B as BlockFormatter, F as FormattedBlock, a as FormattedTransactionReceipt, T as TransactionReceiptFormatter, d as defineBlock, b as defineTransactionReceipt, f as formatBlock } from './transactionReceipt-84fc92e1.js';
|
15
|
+
export { F as FormattedTransactionRequest, T as TransactionRequestFormatter, d as defineTransactionRequest, f as formatTransactionRequest } from './transactionRequest-44c539b4.js';
|
16
|
+
import './eip1193-f09a55af.js';
|
13
17
|
import '@wagmi/chains';
|
14
18
|
import 'abitype';
|
15
|
-
import '
|
19
|
+
import 'ethers@6/types/providers';
|
20
|
+
import 'abitype/dist/abi-78346466';
|
16
21
|
|
17
22
|
declare class AbiConstructorNotFoundError extends BaseError {
|
18
23
|
name: string;
|
@@ -111,7 +116,7 @@ declare class InvalidDefinitionTypeError extends BaseError {
|
|
111
116
|
declare class InvalidAddressError extends BaseError {
|
112
117
|
name: string;
|
113
118
|
constructor({ address }: {
|
114
|
-
address:
|
119
|
+
address: string;
|
115
120
|
});
|
116
121
|
}
|
117
122
|
|
@@ -378,6 +383,8 @@ type HttpTransportConfig = {
|
|
378
383
|
retryCount?: TransportConfig['retryCount'];
|
379
384
|
/** The base delay (in ms) between retries. */
|
380
385
|
retryDelay?: TransportConfig['retryDelay'];
|
386
|
+
/** The timeout (in ms) for the HTTP request. Default: 10_000 */
|
387
|
+
timeout?: TransportConfig['timeout'];
|
381
388
|
};
|
382
389
|
type HttpTransport = Transport<'http', {
|
383
390
|
url?: string;
|
@@ -415,6 +422,8 @@ type WebSocketTransportConfig = {
|
|
415
422
|
retryCount?: TransportConfig['retryCount'];
|
416
423
|
/** The base delay (in ms) between retries. */
|
417
424
|
retryDelay?: TransportConfig['retryDelay'];
|
425
|
+
/** The timeout (in ms) for async WebSocket requests. Default: 10_000 */
|
426
|
+
timeout?: TransportConfig['timeout'];
|
418
427
|
};
|
419
428
|
type WebSocketTransport = Transport<'webSocket', {
|
420
429
|
getSocket(): Promise<WebSocket>;
|