viem 0.0.1-alpha.1 → 0.0.1-alpha.2
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.js +2 -2
- package/dist/chains.d.ts +2 -2
- package/dist/chains.js +1 -1
- package/dist/{chunk-Z6LRV6XI.js → chunk-3EOU525X.js} +71 -3
- package/dist/{chunk-LLYFXUSV.js → chunk-4HNVS7AM.js} +1 -1
- package/dist/{chunk-OQTFTQTO.js → chunk-YQRTXQ2G.js} +43 -49
- package/dist/clients/index.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -3
- package/dist/{parseGwei-bbc055e4.d.ts → parseGwei-fd7a0f7d.d.ts} +26 -4
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +3 -1
- package/package.json +1 -1
package/dist/actions/index.js
CHANGED
package/dist/chains.d.ts
CHANGED
@@ -24,7 +24,7 @@ declare const defineBlock: <TFormat extends Formatter<Partial<RpcBlock>, Partial
|
|
24
24
|
}) => Block<bigint, Transaction<bigint, number>> & ReturnType<TFormat> & { [K in TExclude[number]]: never; };
|
25
25
|
declare const defineTransaction: <TFormat extends Formatter<Partial<RpcTransaction>, Partial<Transaction<bigint, number>> & {
|
26
26
|
[key: string]: unknown;
|
27
|
-
}>, TExclude extends ("type" | "value" | "blockHash" | "blockNumber" | "from" | "
|
27
|
+
}>, TExclude extends ("gas" | "type" | "value" | "blockHash" | "blockNumber" | "from" | "hash" | "input" | "nonce" | "r" | "s" | "to" | "transactionIndex" | "v" | "gasPrice" | "maxFeePerGas" | "maxPriorityFeePerGas" | "accessList")[] = []>({ exclude, format: formatOverride, }: {
|
28
28
|
exclude?: TExclude | undefined;
|
29
29
|
format?: TFormat | undefined;
|
30
30
|
}) => (data: Partial<RpcTransaction> & {
|
@@ -32,7 +32,7 @@ declare const defineTransaction: <TFormat extends Formatter<Partial<RpcTransacti
|
|
32
32
|
}) => Transaction<bigint, number> & ReturnType<TFormat> & { [K in TExclude[number]]: never; };
|
33
33
|
declare const defineTransactionRequest: <TFormat extends Formatter<Partial<TransactionRequest<bigint, number>>, Partial<RpcTransactionRequest> & {
|
34
34
|
[key: string]: unknown;
|
35
|
-
}>, TExclude extends ("
|
35
|
+
}>, TExclude extends ("gas" | "data" | "value" | "from" | "nonce" | "to" | "gasPrice" | "maxFeePerGas" | "maxPriorityFeePerGas" | "accessList")[] = []>({ exclude, format: formatOverride, }: {
|
36
36
|
exclude?: TExclude | undefined;
|
37
37
|
format?: TFormat | undefined;
|
38
38
|
}) => (data: Partial<TransactionRequest<bigint, number>> & {
|
package/dist/chains.js
CHANGED
@@ -9,7 +9,7 @@ var __publicField = (obj, key, value) => {
|
|
9
9
|
var package_default = {
|
10
10
|
name: "viem",
|
11
11
|
description: "TypeScript (& JavaScript) Interface for Ethereum",
|
12
|
-
version: "0.0.1-alpha.
|
12
|
+
version: "0.0.1-alpha.2",
|
13
13
|
scripts: {
|
14
14
|
anvil: "source .env && anvil --fork-url $ANVIL_FORK_URL --fork-block-number $VITE_ANVIL_BLOCK_NUMBER --block-time $VITE_ANVIL_BLOCK_TIME",
|
15
15
|
bench: "vitest bench --no-threads",
|
@@ -665,7 +665,7 @@ function hashFunction(def) {
|
|
665
665
|
var getEventSignature = (event) => hashFunction(event);
|
666
666
|
|
667
667
|
// src/utils/hash/getFunctionSignature.ts
|
668
|
-
var getFunctionSignature = (fn) => hashFunction(fn)
|
668
|
+
var getFunctionSignature = (fn) => slice(hashFunction(fn), 0, 4);
|
669
669
|
|
670
670
|
// src/utils/address/getAddress.ts
|
671
671
|
var addressRegex = /^(0x)?[a-fA-F0-9]{40}$/;
|
@@ -754,7 +754,10 @@ function encodeAbi({
|
|
754
754
|
givenLength: values.length
|
755
755
|
});
|
756
756
|
const preparedParams = prepareParams({ params, values });
|
757
|
-
|
757
|
+
const data = encodeParams(preparedParams);
|
758
|
+
if (data.length === 0)
|
759
|
+
return void 0;
|
760
|
+
return data;
|
758
761
|
}
|
759
762
|
function prepareParams({
|
760
763
|
params,
|
@@ -1182,6 +1185,70 @@ var InvalidAbiDecodingTypeError = class extends BaseError {
|
|
1182
1185
|
}
|
1183
1186
|
};
|
1184
1187
|
|
1188
|
+
// src/utils/abi/getDefinition.ts
|
1189
|
+
function getDefinition(description) {
|
1190
|
+
if (description.type !== "function" && description.type !== "event" && description.type !== "error")
|
1191
|
+
throw new InvalidDefinitionTypeError(description.type);
|
1192
|
+
return `${description.name}(${getParams(description.inputs)})`;
|
1193
|
+
}
|
1194
|
+
function getParams(params) {
|
1195
|
+
if (!params)
|
1196
|
+
return "";
|
1197
|
+
return params.map(getParam).join(",");
|
1198
|
+
}
|
1199
|
+
function getParam(param) {
|
1200
|
+
if (param.type.startsWith("tuple")) {
|
1201
|
+
return `(${getParams(
|
1202
|
+
param.components
|
1203
|
+
)})${param.type.slice("tuple".length)}`;
|
1204
|
+
}
|
1205
|
+
return param.type;
|
1206
|
+
}
|
1207
|
+
var InvalidDefinitionTypeError = class extends BaseError {
|
1208
|
+
constructor(type) {
|
1209
|
+
super(
|
1210
|
+
[
|
1211
|
+
`"${type}" is not a valid definition type.`,
|
1212
|
+
'Valid types: "function", "event", "error"'
|
1213
|
+
].join("\n"),
|
1214
|
+
{
|
1215
|
+
docsPath: "/docs/contract/getDefinition"
|
1216
|
+
}
|
1217
|
+
);
|
1218
|
+
}
|
1219
|
+
};
|
1220
|
+
|
1221
|
+
// src/utils/abi/encodeFunctionParams.ts
|
1222
|
+
function encodeFunctionParams({
|
1223
|
+
abi,
|
1224
|
+
args,
|
1225
|
+
functionName
|
1226
|
+
}) {
|
1227
|
+
const description = abi.find((x) => "name" in x && x.name === functionName);
|
1228
|
+
if (!description)
|
1229
|
+
throw new AbiFunctionNotFoundError(functionName);
|
1230
|
+
const definition = getDefinition(description);
|
1231
|
+
const signature = getFunctionSignature(definition);
|
1232
|
+
const data = "inputs" in description && description.inputs ? encodeAbi({
|
1233
|
+
params: description.inputs,
|
1234
|
+
values: args ?? []
|
1235
|
+
}) : void 0;
|
1236
|
+
return concatHex([signature, data ?? "0x"]);
|
1237
|
+
}
|
1238
|
+
var AbiFunctionNotFoundError = class extends BaseError {
|
1239
|
+
constructor(functionName) {
|
1240
|
+
super(
|
1241
|
+
[
|
1242
|
+
`Function "${functionName}" not found on ABI.`,
|
1243
|
+
"Make sure you are using the correct ABI and that the function exists on it."
|
1244
|
+
].join("\n"),
|
1245
|
+
{
|
1246
|
+
docsPath: "/docs/contract/encodeFunctionParams"
|
1247
|
+
}
|
1248
|
+
);
|
1249
|
+
}
|
1250
|
+
};
|
1251
|
+
|
1185
1252
|
// src/utils/buildRequest.ts
|
1186
1253
|
function buildRequest(request) {
|
1187
1254
|
return async (args) => {
|
@@ -1936,6 +2003,7 @@ export {
|
|
1936
2003
|
isAddressEqual,
|
1937
2004
|
encodeAbi,
|
1938
2005
|
decodeAbi,
|
2006
|
+
encodeFunctionParams,
|
1939
2007
|
buildRequest,
|
1940
2008
|
RpcRequestError,
|
1941
2009
|
ParseRpcError,
|
@@ -3,7 +3,7 @@ import {
|
|
3
3
|
buildRequest,
|
4
4
|
getSocket,
|
5
5
|
rpc
|
6
|
-
} from "./chunk-
|
6
|
+
} from "./chunk-3EOU525X.js";
|
7
7
|
|
8
8
|
// src/clients/transports/createTransport.ts
|
9
9
|
function createTransport(config, value) {
|
@@ -37,36 +37,34 @@ function custom(provider, { key = "custom", name = "Custom Provider" } = {}) {
|
|
37
37
|
|
38
38
|
// src/clients/transports/fallback.ts
|
39
39
|
function fallback(transports, { key = "fallback", name = "Fallback" } = {}) {
|
40
|
-
return ({ chain }) =>
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
async
|
46
|
-
const
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
return fetch();
|
60
|
-
},
|
61
|
-
type: "fallback"
|
40
|
+
return ({ chain }) => createTransport(
|
41
|
+
{
|
42
|
+
key,
|
43
|
+
name,
|
44
|
+
async request({ method, params }) {
|
45
|
+
const fetch = async (i = 0) => {
|
46
|
+
const transport = transports[i]({ chain });
|
47
|
+
try {
|
48
|
+
return await transport.config.request({
|
49
|
+
method,
|
50
|
+
params
|
51
|
+
});
|
52
|
+
} catch (err) {
|
53
|
+
if (i < transports.length - 1)
|
54
|
+
return fetch(i + 1);
|
55
|
+
throw err;
|
56
|
+
}
|
57
|
+
};
|
58
|
+
return fetch();
|
62
59
|
},
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
60
|
+
type: "fallback"
|
61
|
+
},
|
62
|
+
{
|
63
|
+
transports: transports.map(
|
64
|
+
(fn) => fn({ chain })
|
65
|
+
)
|
66
|
+
}
|
67
|
+
);
|
70
68
|
}
|
71
69
|
|
72
70
|
// src/clients/transports/http.ts
|
@@ -211,16 +209,14 @@ function createPublicClient({
|
|
211
209
|
pollingInterval
|
212
210
|
}) {
|
213
211
|
chain;
|
214
|
-
return {
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
})
|
223
|
-
};
|
212
|
+
return createClient({
|
213
|
+
chain,
|
214
|
+
key,
|
215
|
+
name,
|
216
|
+
pollingInterval,
|
217
|
+
transport,
|
218
|
+
type: "publicClient"
|
219
|
+
});
|
224
220
|
}
|
225
221
|
|
226
222
|
// src/clients/createTestClient.ts
|
@@ -252,15 +248,13 @@ function createWalletClient({
|
|
252
248
|
name = "Wallet Client",
|
253
249
|
pollingInterval
|
254
250
|
}) {
|
255
|
-
return {
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
})
|
263
|
-
};
|
251
|
+
return createClient({
|
252
|
+
key,
|
253
|
+
name,
|
254
|
+
pollingInterval,
|
255
|
+
transport,
|
256
|
+
type: "walletClient"
|
257
|
+
});
|
264
258
|
}
|
265
259
|
|
266
260
|
export {
|
package/dist/clients/index.js
CHANGED
package/dist/index.d.ts
CHANGED
@@ -2,7 +2,7 @@ export { C as CallArgs, a as CallResponse, b as CreateBlockFilterResponse, c as
|
|
2
2
|
export { C as Client, a as ClientConfig, P as PublicClient, b as PublicClientConfig, T as TestClient, c as TestClientConfig, d as Transport, e as TransportConfig, W as WalletClient, f as WalletClientConfig, g as createClient, h as createPublicClient, i as createTestClient, j as createTransport, k as createWalletClient } from './createWalletClient-915223f3.js';
|
3
3
|
export { C as CustomTransport, a as CustomTransportConfig, F as FallbackTransport, b as FallbackTransportConfig, H as HttpTransport, c as HttpTransportConfig, U as UrlRequiredError, W as WebSocketTransport, d as WebSocketTransportConfig, e as custom, f as fallback, h as http, w as webSocket } from './webSocket-c6e0d26f.js';
|
4
4
|
export { a as AccessList, A as Address, B as Block, b as BlockIdentifier, c as BlockNumber, d as BlockTag, f as ByteArray, F as FeeHistory, h as FeeValues, i as FeeValuesEIP1559, j as FeeValuesLegacy, k 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, u as RpcUncle, D as Transaction, E as TransactionBase, G as TransactionEIP1559, I as TransactionEIP2930, J as TransactionLegacy, T as TransactionReceipt, v as TransactionRequest, x as TransactionRequestBase, y as TransactionRequestEIP1559, z as TransactionRequestEIP2930, C as TransactionRequestLegacy, U as Uncle, e as etherUnits, g as gweiUnits, t as transactionType, w as weiUnits } from './rpc-655c0ba4.js';
|
5
|
-
export { A as AbiDecodingDataSizeInvalidError, a as AbiEncodingArrayLengthMismatchError, b as AbiEncodingLengthMismatchError, E as EncodeRlpResponse, G as GetContractAddressOptions, d as GetCreate2AddressOptions, c as GetCreateAddressOptions, g as InternalRpcError, I as InvalidAbiDecodingTypeError, e as InvalidAbiEncodingTypeError, f as InvalidArrayError, h as InvalidInputRpcError, i as InvalidParamsRpcError, j as InvalidRequestRpcError, J as JsonRpcVersionUnsupportedError, L as LimitExceededRpcError, M as MethodNotFoundRpcError, k as MethodNotSupportedRpcError, P as ParseRpcError, R as ResourceNotFoundRpcError, l as ResourceUnavailableRpcError, m as RpcRequestError, T as TransactionRejectedRpcError, p as boolToBytes, q as boolToHex, r as bytesToBigint, s as bytesToBool, n as bytesToHex, t as bytesToNumber, o as bytesToString, u as decodeAbi, v as decodeBytes, w as decodeHex, x as decodeRlp, y as encodeAbi, z as encodeBytes, B as
|
5
|
+
export { A as AbiDecodingDataSizeInvalidError, a as AbiEncodingArrayLengthMismatchError, b as AbiEncodingLengthMismatchError, E as EncodeRlpResponse, G as GetContractAddressOptions, d as GetCreate2AddressOptions, c as GetCreateAddressOptions, g as InternalRpcError, I as InvalidAbiDecodingTypeError, e as InvalidAbiEncodingTypeError, f as InvalidArrayError, h as InvalidInputRpcError, i as InvalidParamsRpcError, j as InvalidRequestRpcError, J as JsonRpcVersionUnsupportedError, L as LimitExceededRpcError, M as MethodNotFoundRpcError, k as MethodNotSupportedRpcError, P as ParseRpcError, R as ResourceNotFoundRpcError, l as ResourceUnavailableRpcError, m as RpcRequestError, T as TransactionRejectedRpcError, p as boolToBytes, q as boolToHex, r as bytesToBigint, s as bytesToBool, n as bytesToHex, t as bytesToNumber, o as bytesToString, u as decodeAbi, v as decodeBytes, w as decodeHex, x as decodeRlp, y as encodeAbi, z as encodeBytes, B as encodeFunctionParams, C as encodeHex, D as encodeRlp, S as formatEther, a8 as formatGwei, a9 as formatUnit, F as getAddress, H as getContractAddress, N as getCreate2Address, K as getCreateAddress, O as getEventSignature, Q as getFunctionSignature, Y as hexToBigInt, Z as hexToBool, _ as hexToBytes, aa as hexToNumber, $ as hexToString, U as isAddress, V as isAddressEqual, W as isBytes, X as isHex, a0 as keccak256, a1 as numberToBytes, ab as numberToHex, a2 as pad, a3 as padBytes, a4 as padHex, a5 as parseEther, a6 as parseGwei, a7 as parseUnit, ac as size, ad as slice, ae as sliceBytes, af as sliceHex, ag as stringToBytes, ah as stringToHex, ai as trim } from './parseGwei-fd7a0f7d.js';
|
6
6
|
export { B as BaseError } from './BaseError-7688f84e.js';
|
7
7
|
export { F as FormattedBlock, a as FormattedTransaction, b as FormattedTransactionRequest, f as formatBlock, c as formatTransaction, d as formatTransactionRequest } from './transactionRequest-ade896ac.js';
|
8
8
|
export { H as HttpRequestError, R as RpcError, T as TimeoutError } from './rpc-3c0e3985.js';
|
package/dist/index.js
CHANGED
@@ -57,7 +57,7 @@ import {
|
|
57
57
|
watchBlockNumber,
|
58
58
|
watchBlocks,
|
59
59
|
watchPendingTransactions
|
60
|
-
} from "./chunk-
|
60
|
+
} from "./chunk-4HNVS7AM.js";
|
61
61
|
import {
|
62
62
|
UrlRequiredError,
|
63
63
|
createClient,
|
@@ -69,7 +69,7 @@ import {
|
|
69
69
|
fallback,
|
70
70
|
http,
|
71
71
|
webSocket
|
72
|
-
} from "./chunk-
|
72
|
+
} from "./chunk-YQRTXQ2G.js";
|
73
73
|
import {
|
74
74
|
BaseError,
|
75
75
|
HttpRequestError,
|
@@ -101,6 +101,7 @@ import {
|
|
101
101
|
decodeRlp,
|
102
102
|
encodeAbi,
|
103
103
|
encodeBytes,
|
104
|
+
encodeFunctionParams,
|
104
105
|
encodeHex,
|
105
106
|
encodeRlp,
|
106
107
|
etherUnits,
|
@@ -144,7 +145,7 @@ import {
|
|
144
145
|
transactionType,
|
145
146
|
trim,
|
146
147
|
weiUnits
|
147
|
-
} from "./chunk-
|
148
|
+
} from "./chunk-3EOU525X.js";
|
148
149
|
export {
|
149
150
|
BaseError,
|
150
151
|
HttpRequestError,
|
@@ -188,6 +189,7 @@ export {
|
|
188
189
|
dropTransaction,
|
189
190
|
encodeAbi,
|
190
191
|
encodeBytes,
|
192
|
+
encodeFunctionParams,
|
191
193
|
encodeHex,
|
192
194
|
encodeRlp,
|
193
195
|
estimateGas,
|
@@ -1,8 +1,25 @@
|
|
1
|
-
import {
|
1
|
+
import { Abi, AbiFunction, ExtractAbiFunction, AbiParametersToPrimitiveTypes, AbiParameter, ExtractAbiFunctionNames } from 'abitype';
|
2
2
|
import { H as Hex, A as Address, f as ByteArray } from './rpc-655c0ba4.js';
|
3
3
|
import { B as BaseError } from './BaseError-7688f84e.js';
|
4
4
|
import { R as RpcError } from './rpc-3c0e3985.js';
|
5
5
|
|
6
|
+
type ExtractArgsFromAbi<TAbi extends Abi | readonly unknown[], TFunctionName extends string, TAbiFunction extends AbiFunction & {
|
7
|
+
type: 'function';
|
8
|
+
} = TAbi extends Abi ? ExtractAbiFunction<TAbi, TFunctionName> : AbiFunction & {
|
9
|
+
type: 'function';
|
10
|
+
}, TArgs = AbiParametersToPrimitiveTypes<TAbiFunction['inputs']>, FailedToParseArgs = ([TArgs] extends [never] ? true : false) | (readonly unknown[] extends TArgs ? true : false)> = true extends FailedToParseArgs ? {
|
11
|
+
/**
|
12
|
+
* Arguments to pass contract method
|
13
|
+
*
|
14
|
+
* Use a [const assertion](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html#const-assertions) on {@link abi} for type inference.
|
15
|
+
*/
|
16
|
+
args?: readonly unknown[];
|
17
|
+
} : TArgs extends readonly [] ? {
|
18
|
+
args?: never;
|
19
|
+
} : {
|
20
|
+
/** Arguments to pass contract method */ args: TArgs;
|
21
|
+
};
|
22
|
+
|
6
23
|
declare function decodeAbi<TParams extends readonly AbiParameter[]>({ data, params, }: {
|
7
24
|
data: Hex;
|
8
25
|
params: TParams;
|
@@ -22,7 +39,7 @@ declare class InvalidAbiDecodingTypeError extends BaseError {
|
|
22
39
|
declare function encodeAbi<TParams extends readonly AbiParameter[]>({ params, values, }: {
|
23
40
|
params: TParams;
|
24
41
|
values: AbiParametersToPrimitiveTypes<TParams>;
|
25
|
-
}): `0x${string}
|
42
|
+
}): `0x${string}` | undefined;
|
26
43
|
declare class AbiEncodingArrayLengthMismatchError extends BaseError {
|
27
44
|
name: string;
|
28
45
|
constructor({ expectedLength, givenLength, type, }: {
|
@@ -47,6 +64,11 @@ declare class InvalidArrayError extends BaseError {
|
|
47
64
|
constructor(value: unknown);
|
48
65
|
}
|
49
66
|
|
67
|
+
declare function encodeFunctionParams<TAbi extends Abi = Abi, TFunctionName extends ExtractAbiFunctionNames<TAbi> = any>({ abi, args, functionName, }: {
|
68
|
+
abi: TAbi;
|
69
|
+
functionName: TFunctionName;
|
70
|
+
} & ExtractArgsFromAbi<TAbi, TFunctionName>): `0x${string}`;
|
71
|
+
|
50
72
|
declare function getAddress(address: Address): `0x${string}`;
|
51
73
|
|
52
74
|
type GetCreateAddressOptions = {
|
@@ -305,7 +327,7 @@ declare function decodeRlp<TTo extends 'bytes' | 'hex'>(value: ByteArray | Hex,
|
|
305
327
|
|
306
328
|
declare const getEventSignature: (event: `${string}(${string})`) => `0x${string}`;
|
307
329
|
|
308
|
-
declare const getFunctionSignature: (fn: string) => string
|
330
|
+
declare const getFunctionSignature: (fn: string) => `0x${string}`;
|
309
331
|
|
310
332
|
type To = 'hex' | 'bytes';
|
311
333
|
type Keccak256Hash<TTo extends To> = TTo extends 'bytes' ? ByteArray : TTo extends 'hex' ? Hex : never;
|
@@ -323,4 +345,4 @@ declare function parseEther(ether: `${number}`, unit?: 'wei' | 'gwei'): bigint;
|
|
323
345
|
|
324
346
|
declare function parseGwei(ether: `${number}`, unit?: 'wei'): bigint;
|
325
347
|
|
326
|
-
export {
|
348
|
+
export { hexToString as $, AbiDecodingDataSizeInvalidError as A, encodeFunctionParams as B, encodeHex as C, encodeRlp as D, EncodeRlpResponse as E, getAddress as F, GetContractAddressOptions as G, getContractAddress as H, InvalidAbiDecodingTypeError as I, JsonRpcVersionUnsupportedError as J, getCreateAddress as K, LimitExceededRpcError as L, MethodNotFoundRpcError as M, getCreate2Address as N, getEventSignature as O, ParseRpcError as P, getFunctionSignature as Q, ResourceNotFoundRpcError as R, formatEther as S, TransactionRejectedRpcError as T, isAddress as U, isAddressEqual as V, isBytes as W, isHex as X, hexToBigInt as Y, hexToBool as Z, hexToBytes as _, AbiEncodingArrayLengthMismatchError as a, keccak256 as a0, numberToBytes as a1, pad as a2, padBytes as a3, padHex as a4, parseEther as a5, parseGwei as a6, parseUnit as a7, formatGwei as a8, formatUnit as a9, hexToNumber as aa, numberToHex as ab, size as ac, slice as ad, sliceBytes as ae, sliceHex as af, stringToBytes as ag, stringToHex as ah, trim as ai, buildRequest as aj, AbiEncodingLengthMismatchError as b, GetCreateAddressOptions as c, GetCreate2AddressOptions as d, InvalidAbiEncodingTypeError as e, InvalidArrayError as f, InternalRpcError as g, InvalidInputRpcError as h, InvalidParamsRpcError as i, InvalidRequestRpcError as j, MethodNotSupportedRpcError as k, ResourceUnavailableRpcError as l, RpcRequestError as m, bytesToHex as n, bytesToString as o, boolToBytes as p, boolToHex as q, bytesToBigint as r, bytesToBool as s, bytesToNumber as t, decodeAbi as u, decodeBytes as v, decodeHex as w, decodeRlp as x, encodeAbi as y, encodeBytes as z };
|
package/dist/utils/index.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
export { A as AbiDecodingDataSizeInvalidError, a as AbiEncodingArrayLengthMismatchError, b as AbiEncodingLengthMismatchError, E as EncodeRlpResponse, G as GetContractAddressOptions, d as GetCreate2AddressOptions, c as GetCreateAddressOptions, g as InternalRpcError, I as InvalidAbiDecodingTypeError, e as InvalidAbiEncodingTypeError, f as InvalidArrayError, h as InvalidInputRpcError, i as InvalidParamsRpcError, j as InvalidRequestRpcError, J as JsonRpcVersionUnsupportedError, L as LimitExceededRpcError, M as MethodNotFoundRpcError, k as MethodNotSupportedRpcError, P as ParseRpcError, R as ResourceNotFoundRpcError, l as ResourceUnavailableRpcError, m as RpcRequestError, T as TransactionRejectedRpcError, p as boolToBytes, q as boolToHex,
|
1
|
+
export { A as AbiDecodingDataSizeInvalidError, a as AbiEncodingArrayLengthMismatchError, b as AbiEncodingLengthMismatchError, E as EncodeRlpResponse, G as GetContractAddressOptions, d as GetCreate2AddressOptions, c as GetCreateAddressOptions, g as InternalRpcError, I as InvalidAbiDecodingTypeError, e as InvalidAbiEncodingTypeError, f as InvalidArrayError, h as InvalidInputRpcError, i as InvalidParamsRpcError, j as InvalidRequestRpcError, J as JsonRpcVersionUnsupportedError, L as LimitExceededRpcError, M as MethodNotFoundRpcError, k as MethodNotSupportedRpcError, P as ParseRpcError, R as ResourceNotFoundRpcError, l as ResourceUnavailableRpcError, m as RpcRequestError, T as TransactionRejectedRpcError, p as boolToBytes, q as boolToHex, aj as buildRequest, r as bytesToBigint, s as bytesToBool, n as bytesToHex, t as bytesToNumber, o as bytesToString, u as decodeAbi, v as decodeBytes, w as decodeHex, x as decodeRlp, y as encodeAbi, z as encodeBytes, B as encodeFunctionParams, C as encodeHex, D as encodeRlp, S as formatEther, a8 as formatGwei, a9 as formatUnit, F as getAddress, H as getContractAddress, N as getCreate2Address, K as getCreateAddress, O as getEventSignature, Q as getFunctionSignature, Y as hexToBigInt, Z as hexToBool, _ as hexToBytes, aa as hexToNumber, $ as hexToString, U as isAddress, V as isAddressEqual, W as isBytes, X as isHex, a0 as keccak256, a1 as numberToBytes, ab as numberToHex, a2 as pad, a3 as padBytes, a4 as padHex, a5 as parseEther, a6 as parseGwei, a7 as parseUnit, ac as size, ad as slice, ae as sliceBytes, af as sliceHex, ag as stringToBytes, ah as stringToHex, ai as trim } from '../parseGwei-fd7a0f7d.js';
|
2
2
|
export { B as BaseError } from '../BaseError-7688f84e.js';
|
3
3
|
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-ade896ac.js';
|
4
4
|
export { H as HttpRequestError, R as RpcError, T as TimeoutError, r as rpc } from '../rpc-3c0e3985.js';
|
package/dist/utils/index.js
CHANGED
@@ -30,6 +30,7 @@ import {
|
|
30
30
|
decodeRlp,
|
31
31
|
encodeAbi,
|
32
32
|
encodeBytes,
|
33
|
+
encodeFunctionParams,
|
33
34
|
encodeHex,
|
34
35
|
encodeRlp,
|
35
36
|
extractFunctionName,
|
@@ -74,7 +75,7 @@ import {
|
|
74
75
|
stringToBytes,
|
75
76
|
stringToHex,
|
76
77
|
trim
|
77
|
-
} from "../chunk-
|
78
|
+
} from "../chunk-3EOU525X.js";
|
78
79
|
export {
|
79
80
|
BaseError,
|
80
81
|
HttpRequestError,
|
@@ -107,6 +108,7 @@ export {
|
|
107
108
|
decodeRlp,
|
108
109
|
encodeAbi,
|
109
110
|
encodeBytes,
|
111
|
+
encodeFunctionParams,
|
110
112
|
encodeHex,
|
111
113
|
encodeRlp,
|
112
114
|
extractFunctionName,
|