viem 0.0.1-alpha.2 → 0.0.1-alpha.3
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/actions/index.d.ts +5 -6
- package/dist/actions/index.js +3 -2
- package/dist/chains.d.ts +2 -2
- package/dist/chains.js +2 -1
- package/dist/{chunk-3EOU525X.js → chunk-SRDTRROA.js} +61 -893
- package/dist/{chunk-YQRTXQ2G.js → chunk-TLEMV4T3.js} +2 -15
- package/dist/chunk-WZITKXV3.js +996 -0
- package/dist/{chunk-4HNVS7AM.js → chunk-YZEQFYZ3.js} +149 -200
- package/dist/clients/index.d.ts +5 -6
- package/dist/clients/index.js +2 -4
- package/dist/{createWalletClient-915223f3.d.ts → createWalletClient-15ad1601.d.ts} +1 -1
- package/dist/{eip1193-8f7c22ce.d.ts → eip1193-8b4d90ce.d.ts} +1 -1
- package/dist/index.d.ts +281 -9
- package/dist/index.js +75 -23
- package/dist/{parseGwei-fd7a0f7d.d.ts → parseGwei-0f85e8ca.d.ts} +12 -112
- package/dist/{rpc-655c0ba4.d.ts → rpc-15b85963.d.ts} +1 -1
- package/dist/{rpc-3c0e3985.d.ts → rpc-26932bae.d.ts} +1 -38
- package/dist/{transactionRequest-ade896ac.d.ts → transactionRequest-f538ea86.d.ts} +1 -1
- package/dist/utils/index.d.ts +7 -6
- package/dist/utils/index.js +9 -39
- package/dist/{watchAsset-04ab8db5.d.ts → watchAsset-0c9d01e2.d.ts} +5 -16
- package/dist/{webSocket-c6e0d26f.d.ts → webSocket-b55b0951.d.ts} +4 -9
- package/dist/window.d.ts +2 -2
- package/package.json +1 -1
- package/dist/BaseError-7688f84e.d.ts +0 -18
@@ -1,4 +1,4 @@
|
|
1
|
-
import { O as OptionalNullable,
|
1
|
+
import { O as OptionalNullable, d as Block, R as RpcBlock, D as Transaction, q as RpcTransaction, T as TransactionReceipt, s as RpcTransactionRequest, v as TransactionRequest } from './rpc-15b85963.js';
|
2
2
|
import { Chain, Formatter, Formatters } from './chains.js';
|
3
3
|
|
4
4
|
type ExtractFormatter<TChain extends Chain, TKey extends keyof NonNullable<TChain['formatters']>, TFallbackFormatter extends Formatter = Formatter> = NonNullable<TChain['formatters']>[TKey] extends NonNullable<unknown> ? NonNullable<TChain['formatters']>[TKey] : TFallbackFormatter;
|
package/dist/utils/index.d.ts
CHANGED
@@ -1,12 +1,13 @@
|
|
1
|
-
export {
|
2
|
-
export { B as
|
3
|
-
export {
|
4
|
-
export { H as HttpRequestError, R as RpcError, T as TimeoutError, r as rpc } from '../rpc-3c0e3985.js';
|
1
|
+
export { E as EncodeRlpResponse, G as GetContractAddressOptions, b as GetCreate2AddressOptions, a as GetCreateAddressOptions, e as boolToBytes, f as boolToHex, g as bytesToBigint, h as bytesToBool, c as bytesToHex, i as bytesToNumber, d as bytesToString, j as decodeAbi, k as decodeBytes, l as decodeFunctionData, m as decodeHex, n as decodeRlp, o as encodeAbi, p as encodeBytes, q as encodeFunctionData, r as encodeHex, s as encodeRlp, z as formatEther, S as formatGwei, T as formatUnit, t as getAddress, u as getContractAddress, w as getCreate2Address, v as getCreateAddress, x as getEventSignature, y as getFunctionSignature, F as hexToBigInt, H as hexToBool, I as hexToBytes, U as hexToNumber, J as hexToString, A as isAddress, B as isAddressEqual, C as isBytes, D as isHex, K as keccak256, L as numberToBytes, V as numberToHex, M as pad, N as padBytes, O as padHex, P as parseEther, Q as parseGwei, R as parseUnit, W as size, X as slice, Y as sliceBytes, Z as sliceHex, _ as stringToBytes, $ as stringToHex, a0 as trim } from '../parseGwei-0f85e8ca.js';
|
2
|
+
export { B as BlockFormatter, E as ExtractFormatter, e as Formatted, F as FormattedBlock, a as FormattedTransaction, h as FormattedTransactionReceipt, b as FormattedTransactionRequest, g as TransactionFormatter, i as TransactionReceiptFormatter, T as TransactionRequestFormatter, j as format, f as formatBlock, c as formatTransaction, d as formatTransactionRequest } from '../transactionRequest-f538ea86.js';
|
3
|
+
export { r as rpc } from '../rpc-26932bae.js';
|
5
4
|
import 'abitype';
|
6
|
-
import '../rpc-
|
5
|
+
import '../rpc-15b85963.js';
|
7
6
|
import '../chains.js';
|
8
7
|
import '@wagmi/chains';
|
9
8
|
|
9
|
+
declare function buildRequest<TRequest extends (args: any) => Promise<any>>(request: TRequest): TRequest;
|
10
|
+
|
10
11
|
declare function extractFunctionName(def: string): string | undefined;
|
11
12
|
declare function extractFunctionParams(def: string): {
|
12
13
|
indexed?: boolean | undefined;
|
@@ -15,4 +16,4 @@ declare function extractFunctionParams(def: string): {
|
|
15
16
|
}[] | undefined;
|
16
17
|
declare function extractFunctionType(def: string): string | undefined;
|
17
18
|
|
18
|
-
export { extractFunctionName, extractFunctionParams, extractFunctionType };
|
19
|
+
export { buildRequest, extractFunctionName, extractFunctionParams, extractFunctionType };
|
package/dist/utils/index.js
CHANGED
@@ -1,24 +1,6 @@
|
|
1
1
|
import {
|
2
|
-
BaseError,
|
3
|
-
HttpRequestError,
|
4
|
-
InternalRpcError,
|
5
|
-
InvalidInputRpcError,
|
6
|
-
InvalidParamsRpcError,
|
7
|
-
InvalidRequestRpcError,
|
8
|
-
JsonRpcVersionUnsupportedError,
|
9
|
-
LimitExceededRpcError,
|
10
|
-
MethodNotFoundRpcError,
|
11
|
-
MethodNotSupportedRpcError,
|
12
|
-
ParseRpcError,
|
13
|
-
ResourceNotFoundRpcError,
|
14
|
-
ResourceUnavailableRpcError,
|
15
|
-
RpcError,
|
16
|
-
RpcRequestError,
|
17
|
-
TimeoutError,
|
18
|
-
TransactionRejectedRpcError,
|
19
2
|
boolToBytes,
|
20
3
|
boolToHex,
|
21
|
-
buildRequest,
|
22
4
|
bytesToBigint,
|
23
5
|
bytesToBool,
|
24
6
|
bytesToHex,
|
@@ -26,11 +8,12 @@ import {
|
|
26
8
|
bytesToString,
|
27
9
|
decodeAbi,
|
28
10
|
decodeBytes,
|
11
|
+
decodeFunctionData,
|
29
12
|
decodeHex,
|
30
13
|
decodeRlp,
|
31
14
|
encodeAbi,
|
32
15
|
encodeBytes,
|
33
|
-
|
16
|
+
encodeFunctionData,
|
34
17
|
encodeHex,
|
35
18
|
encodeRlp,
|
36
19
|
extractFunctionName,
|
@@ -67,7 +50,6 @@ import {
|
|
67
50
|
parseEther,
|
68
51
|
parseGwei,
|
69
52
|
parseUnit,
|
70
|
-
rpc,
|
71
53
|
size,
|
72
54
|
slice,
|
73
55
|
sliceBytes,
|
@@ -75,25 +57,12 @@ import {
|
|
75
57
|
stringToBytes,
|
76
58
|
stringToHex,
|
77
59
|
trim
|
78
|
-
} from "../chunk-
|
60
|
+
} from "../chunk-SRDTRROA.js";
|
61
|
+
import {
|
62
|
+
buildRequest,
|
63
|
+
rpc
|
64
|
+
} from "../chunk-WZITKXV3.js";
|
79
65
|
export {
|
80
|
-
BaseError,
|
81
|
-
HttpRequestError,
|
82
|
-
InternalRpcError,
|
83
|
-
InvalidInputRpcError,
|
84
|
-
InvalidParamsRpcError,
|
85
|
-
InvalidRequestRpcError,
|
86
|
-
JsonRpcVersionUnsupportedError,
|
87
|
-
LimitExceededRpcError,
|
88
|
-
MethodNotFoundRpcError,
|
89
|
-
MethodNotSupportedRpcError,
|
90
|
-
ParseRpcError,
|
91
|
-
ResourceNotFoundRpcError,
|
92
|
-
ResourceUnavailableRpcError,
|
93
|
-
RpcError,
|
94
|
-
RpcRequestError,
|
95
|
-
TimeoutError,
|
96
|
-
TransactionRejectedRpcError,
|
97
66
|
boolToBytes,
|
98
67
|
boolToHex,
|
99
68
|
buildRequest,
|
@@ -104,11 +73,12 @@ export {
|
|
104
73
|
bytesToString,
|
105
74
|
decodeAbi,
|
106
75
|
decodeBytes,
|
76
|
+
decodeFunctionData,
|
107
77
|
decodeHex,
|
108
78
|
decodeRlp,
|
109
79
|
encodeAbi,
|
110
80
|
encodeBytes,
|
111
|
-
|
81
|
+
encodeFunctionData,
|
112
82
|
encodeHex,
|
113
83
|
encodeRlp,
|
114
84
|
extractFunctionName,
|
@@ -1,9 +1,8 @@
|
|
1
1
|
import { Chain, Formatter } from './chains.js';
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
import { W as WalletPermission, a as WatchAssetParams } from './eip1193-8f7c22ce.js';
|
2
|
+
import { a as Hex, b as BlockTag, M as MergeIntersectionProperties, v as TransactionRequest, K as EstimateGasParameters, A as Address, H as Hash, F as FeeHistory, L as Log, r as RpcTransactionReceipt, T as TransactionReceipt, N as TransactionType, D as Transaction, q as RpcTransaction, Q as Quantity, B as ByteArray } from './rpc-15b85963.js';
|
3
|
+
import { P as PublicClient, T as TestClient, W as WalletClient } from './createWalletClient-15ad1601.js';
|
4
|
+
import { T as TransactionRequestFormatter, e as Formatted, F as FormattedBlock, B as BlockFormatter, a as FormattedTransaction, g as TransactionFormatter, h as FormattedTransactionReceipt, i as TransactionReceiptFormatter, E as ExtractFormatter } from './transactionRequest-f538ea86.js';
|
5
|
+
import { W as WalletPermission, a as WatchAssetParams } from './eip1193-8b4d90ce.js';
|
7
6
|
|
8
7
|
type FilterType = 'transaction' | 'block' | 'event';
|
9
8
|
type Filter<TFilterType extends FilterType = 'event'> = {
|
@@ -275,12 +274,6 @@ type WaitForTransactionReceiptArgs<TChain extends Chain = Chain> = {
|
|
275
274
|
timeout?: number;
|
276
275
|
};
|
277
276
|
declare function waitForTransactionReceipt<TChain extends Chain>(client: PublicClient<any, TChain>, { confirmations, hash, onReplaced, pollingInterval, timeout, }: WaitForTransactionReceiptArgs<TChain>): Promise<WaitForTransactionReceiptResponse<TChain>>;
|
278
|
-
declare class WaitForTransactionReceiptTimeoutError extends BaseError {
|
279
|
-
name: string;
|
280
|
-
constructor({ hash }: {
|
281
|
-
hash: Hash;
|
282
|
-
});
|
283
|
-
}
|
284
277
|
|
285
278
|
type OnBlockNumberResponse = GetBlockNumberResponse;
|
286
279
|
type OnBlockNumber = (blockNumber: OnBlockNumberResponse, prevBlockNumber: OnBlockNumberResponse | undefined) => void;
|
@@ -509,10 +502,6 @@ type SendTransactionArgs<TChain extends Chain = Chain> = FormattedTransactionReq
|
|
509
502
|
};
|
510
503
|
type SendTransactionResponse = Hash;
|
511
504
|
declare function sendTransaction<TChain extends Chain>(client: WalletClient, { chain, from, accessList, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, ...rest }: SendTransactionArgs<TChain>): Promise<SendTransactionResponse>;
|
512
|
-
declare class InvalidGasArgumentsError extends BaseError {
|
513
|
-
name: string;
|
514
|
-
constructor();
|
515
|
-
}
|
516
505
|
|
517
506
|
type SignMessageArgs = {
|
518
507
|
from: Address;
|
@@ -530,4 +519,4 @@ type WatchAssetArgs = WatchAssetParams;
|
|
530
519
|
type WatchAssetResponse = boolean;
|
531
520
|
declare function watchAsset(client: WalletClient, params: WatchAssetParams): Promise<WatchAssetResponse>;
|
532
521
|
|
533
|
-
export { SetBlockTimestampIntervalArgs as $, GetTransactionReceiptResponse as A, IncreaseTimeArgs as B, CallArgs as C, DropTransactionArgs as D, EstimateGasArgs as E, OnBlockNumber as F, GetBalanceArgs as G, OnBlockNumberResponse as H, ImpersonateAccountArgs as I, OnBlockResponse as J, OnTransactions as K, OnTransactionsResponse as L, MineArgs as M, RequestPermissionsResponse as N, OnBlock as O, RevertArgs as P, SendTransactionResponse as Q, ResetArgs as R, SendTransactionArgs as S, SendUnsignedTransactionArgs as T, SendUnsignedTransactionResponse as U, SetBalanceArgs as V, SetBlockGasLimitArgs as W, SetCodeArgs as X, SetCoinbaseArgs as Y, SetIntervalMiningArgs as Z, SetMinGasPriceArgs as _, CallResponse as a, setNonce as a$, SetNextBlockTimestampArgs as a0, SetNextBlockBaseFeePerGasArgs as a1, SetNonceArgs as a2, SetStorageAtArgs as a3, SignMessageArgs as a4, SignMessageResponse as a5, StopImpersonatingAccountArgs as a6, SwitchChainArgs as a7, UninstallFilterArgs as a8, UninstallFilterResponse as a9, getTransactionConfirmations as aA, getTransactionCount as aB, getTransactionReceipt as aC, getTxpoolContent as aD, getTxpoolStatus as aE, impersonateAccount as aF, increaseTime as aG, inspectTxpool as aH, mine as aI, removeBlockTimestampInterval as aJ, reset as aK, requestAccounts as aL, requestPermissions as aM, revert as aN, sendTransaction as aO, sendUnsignedTransaction as aP, setAutomine as aQ, setBalance as aR, setBlockGasLimit as aS, setBlockTimestampInterval as aT, setCode as aU, setCoinbase as aV, setIntervalMining as aW, setLoggingEnabled as aX, setMinGasPrice as aY, setNextBlockBaseFeePerGas as aZ, setNextBlockTimestamp as a_, WaitForTransactionReceiptArgs as aa, WaitForTransactionReceiptResponse as ab, WatchAssetArgs as ac, WatchAssetResponse as ad, WatchBlockNumberArgs as ae, WatchBlocksArgs as af, WatchPendingTransactionsArgs as ag, addChain as ah, call as ai, createBlockFilter as aj, createPendingTransactionFilter as ak, estimateGas as al, dropTransaction as am, getAccounts as an, getAutomine as ao, getBalance as ap, getBlock as aq, getBlockNumber as ar, getBlockTransactionCount as as, getChainId as at, getFeeHistory as au, getFilterChanges as av, getFilterLogs as aw, getGasPrice as ax, getPermissions as ay, getTransaction as az, CreateBlockFilterResponse as b, setStorageAt as b0, signMessage as b1, snapshot as b2, stopImpersonatingAccount as b3, switchChain as b4, uninstallFilter as b5, waitForTransactionReceipt as b6, watchAsset as b7, watchBlockNumber as b8, watchBlocks as b9, watchPendingTransactions as ba, getBlockNumberCache as bb, ReplacementReason as bc, ReplacementResponse as bd,
|
522
|
+
export { SetBlockTimestampIntervalArgs as $, GetTransactionReceiptResponse as A, IncreaseTimeArgs as B, CallArgs as C, DropTransactionArgs as D, EstimateGasArgs as E, OnBlockNumber as F, GetBalanceArgs as G, OnBlockNumberResponse as H, ImpersonateAccountArgs as I, OnBlockResponse as J, OnTransactions as K, OnTransactionsResponse as L, MineArgs as M, RequestPermissionsResponse as N, OnBlock as O, RevertArgs as P, SendTransactionResponse as Q, ResetArgs as R, SendTransactionArgs as S, SendUnsignedTransactionArgs as T, SendUnsignedTransactionResponse as U, SetBalanceArgs as V, SetBlockGasLimitArgs as W, SetCodeArgs as X, SetCoinbaseArgs as Y, SetIntervalMiningArgs as Z, SetMinGasPriceArgs as _, CallResponse as a, setNonce as a$, SetNextBlockTimestampArgs as a0, SetNextBlockBaseFeePerGasArgs as a1, SetNonceArgs as a2, SetStorageAtArgs as a3, SignMessageArgs as a4, SignMessageResponse as a5, StopImpersonatingAccountArgs as a6, SwitchChainArgs as a7, UninstallFilterArgs as a8, UninstallFilterResponse as a9, getTransactionConfirmations as aA, getTransactionCount as aB, getTransactionReceipt as aC, getTxpoolContent as aD, getTxpoolStatus as aE, impersonateAccount as aF, increaseTime as aG, inspectTxpool as aH, mine as aI, removeBlockTimestampInterval as aJ, reset as aK, requestAccounts as aL, requestPermissions as aM, revert as aN, sendTransaction as aO, sendUnsignedTransaction as aP, setAutomine as aQ, setBalance as aR, setBlockGasLimit as aS, setBlockTimestampInterval as aT, setCode as aU, setCoinbase as aV, setIntervalMining as aW, setLoggingEnabled as aX, setMinGasPrice as aY, setNextBlockBaseFeePerGas as aZ, setNextBlockTimestamp as a_, WaitForTransactionReceiptArgs as aa, WaitForTransactionReceiptResponse as ab, WatchAssetArgs as ac, WatchAssetResponse as ad, WatchBlockNumberArgs as ae, WatchBlocksArgs as af, WatchPendingTransactionsArgs as ag, addChain as ah, call as ai, createBlockFilter as aj, createPendingTransactionFilter as ak, estimateGas as al, dropTransaction as am, getAccounts as an, getAutomine as ao, getBalance as ap, getBlock as aq, getBlockNumber as ar, getBlockTransactionCount as as, getChainId as at, getFeeHistory as au, getFilterChanges as av, getFilterLogs as aw, getGasPrice as ax, getPermissions as ay, getTransaction as az, CreateBlockFilterResponse as b, setStorageAt as b0, signMessage as b1, snapshot as b2, stopImpersonatingAccount as b3, switchChain as b4, uninstallFilter as b5, waitForTransactionReceipt as b6, watchAsset as b7, watchBlockNumber as b8, watchBlocks as b9, watchPendingTransactions as ba, getBlockNumberCache as bb, ReplacementReason as bc, ReplacementResponse as bd, FormattedTransactionRequest as be, CreatePendingTransactionFilterResponse as c, EstimateGasResponse as d, GetBalanceResponse as e, GetBlockArgs as f, GetBlockNumberArgs as g, GetBlockNumberResponse as h, GetBlockResponse as i, GetBlockTransactionCountArgs as j, GetBlockTransactionCountResponse as k, GetFeeHistoryArgs as l, GetFeeHistoryResponse as m, GetFilterChangesArgs as n, GetFilterChangesResponse as o, GetFilterLogsArgs as p, GetFilterLogsResponse as q, GetGasPriceResponse as r, GetPermissionsResponse as s, GetTransactionArgs as t, GetTransactionConfirmationsArgs as u, GetTransactionConfirmationsResponse as v, GetTransactionCountArgs as w, GetTransactionCountResponse as x, GetTransactionResponse as y, GetTransactionReceiptArgs as z };
|
@@ -1,11 +1,6 @@
|
|
1
|
-
import { B as
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import { a as RpcResponse } from './rpc-3c0e3985.js';
|
5
|
-
|
6
|
-
declare class UrlRequiredError extends BaseError {
|
7
|
-
constructor();
|
8
|
-
}
|
1
|
+
import { e as TransportConfig, d as Transport, B as BaseRpcRequests } from './createWalletClient-15ad1601.js';
|
2
|
+
import { H as Hash } from './rpc-15b85963.js';
|
3
|
+
import { R as RpcResponse } from './rpc-26932bae.js';
|
9
4
|
|
10
5
|
type EthereumProvider = {
|
11
6
|
request: BaseRpcRequests['request'];
|
@@ -85,4 +80,4 @@ declare function webSocket(
|
|
85
80
|
/** URL of the JSON-RPC API. Defaults to the chain's public RPC URL. */
|
86
81
|
url?: string, { key, name, }?: WebSocketTransportConfig): WebSocketTransport;
|
87
82
|
|
88
|
-
export { CustomTransport as C, FallbackTransport as F, HttpTransport as H,
|
83
|
+
export { CustomTransport as C, FallbackTransport as F, HttpTransport as H, WebSocketTransport as W, CustomTransportConfig as a, FallbackTransportConfig as b, HttpTransportConfig as c, WebSocketTransportConfig as d, custom as e, fallback as f, http as h, webSocket as w };
|
package/dist/window.d.ts
CHANGED
package/package.json
CHANGED
@@ -1,18 +0,0 @@
|
|
1
|
-
type BaseErrorArgs = {
|
2
|
-
docsPath?: string;
|
3
|
-
} & ({
|
4
|
-
cause?: never;
|
5
|
-
details?: string;
|
6
|
-
} | {
|
7
|
-
cause: BaseError | Error;
|
8
|
-
details?: never;
|
9
|
-
});
|
10
|
-
declare class BaseError extends Error {
|
11
|
-
humanMessage: string;
|
12
|
-
details: string;
|
13
|
-
docsPath?: string;
|
14
|
-
name: string;
|
15
|
-
constructor(humanMessage: string, args?: BaseErrorArgs);
|
16
|
-
}
|
17
|
-
|
18
|
-
export { BaseError as B };
|