viem 0.0.1-alpha.17 → 0.0.1-alpha.18
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/chains.js +5 -5
- package/dist/chains.mjs +1 -1
- package/dist/{chunk-WQFS6KDQ.mjs → chunk-3E5WSIQU.mjs} +2 -2
- package/dist/{chunk-WQFS6KDQ.mjs.map → chunk-3E5WSIQU.mjs.map} +0 -0
- package/dist/{chunk-KCXMY4FZ.js → chunk-3EXLRM3B.js} +12 -12
- package/dist/{chunk-KCXMY4FZ.js.map → chunk-3EXLRM3B.js.map} +0 -0
- package/dist/{chunk-XEGTPY6M.js → chunk-6CXRXH25.js} +2 -2
- package/dist/{chunk-XEGTPY6M.js.map → chunk-6CXRXH25.js.map} +0 -0
- package/dist/{chunk-EVOCIEHK.js → chunk-A4HJ47I6.js} +90 -55
- package/dist/chunk-A4HJ47I6.js.map +1 -0
- package/dist/{chunk-EOY65E5E.js → chunk-BW2LPGYJ.js} +13 -13
- package/dist/chunk-BW2LPGYJ.js.map +1 -0
- package/dist/{chunk-KQI5IRRL.mjs → chunk-NSPSPOUF.mjs} +2 -2
- package/dist/{chunk-KQI5IRRL.mjs.map → chunk-NSPSPOUF.mjs.map} +0 -0
- package/dist/{chunk-KWHCOWNW.mjs → chunk-OGQGNULX.mjs} +38 -3
- package/dist/chunk-OGQGNULX.mjs.map +1 -0
- package/dist/{chunk-HF44N2P3.mjs → chunk-TO7QJO5X.mjs} +2 -2
- package/dist/{chunk-HF44N2P3.mjs.map → chunk-TO7QJO5X.mjs.map} +0 -0
- package/dist/{chunk-BL2ZZ7UN.js → chunk-XQZRYOPA.js} +14 -14
- package/dist/{chunk-BL2ZZ7UN.js.map → chunk-XQZRYOPA.js.map} +0 -0
- package/dist/{chunk-JNAHFK7Z.mjs → chunk-Y3PSHZGB.mjs} +2 -2
- package/dist/{chunk-JNAHFK7Z.mjs.map → chunk-Y3PSHZGB.mjs.map} +1 -1
- package/dist/clients/index.js +3 -3
- package/dist/clients/index.mjs +2 -2
- package/dist/index.d.ts +15 -6
- package/dist/index.js +8 -6
- package/dist/index.mjs +7 -5
- package/dist/{parseGwei-e6f49667.d.ts → parseGwei-dbd12305.d.ts} +1 -1
- package/dist/public.d.ts +2 -2
- package/dist/public.js +4 -4
- package/dist/public.mjs +3 -3
- package/dist/test.js +3 -3
- package/dist/test.mjs +2 -2
- package/dist/{transactionReceipt-86c1094c.d.ts → transactionReceipt-aed524b4.d.ts} +1 -1
- package/dist/utils/index.d.ts +3 -3
- package/dist/utils/index.js +2 -2
- package/dist/utils/index.mjs +1 -1
- package/dist/wallet.js +3 -3
- package/dist/wallet.mjs +2 -2
- package/dist/{watchPendingTransactions-2563071e.d.ts → watchPendingTransactions-7cbbef80.d.ts} +1 -1
- package/package.json +1 -1
- package/src/actions/index.test.ts +1 -0
- package/src/actions/index.ts +3 -0
- package/src/actions/public/index.test.ts +1 -0
- package/src/actions/public/index.ts +6 -1
- package/src/actions/public/readContract.test.ts +128 -0
- package/src/actions/public/readContract.ts +87 -0
- package/src/actions/public/simulateContract.ts +1 -5
- package/src/actions/wallet/writeContract.ts +0 -5
- package/src/index.test.ts +1 -0
- package/src/index.ts +3 -0
- package/dist/chunk-EOY65E5E.js.map +0 -1
- package/dist/chunk-EVOCIEHK.js.map +0 -1
- package/dist/chunk-KWHCOWNW.mjs.map +0 -1
package/dist/chains.js
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
|
5
5
|
|
6
|
-
var
|
6
|
+
var _chunk6CXRXH25js = require('./chunk-6CXRXH25.js');
|
7
7
|
|
8
8
|
// src/chains.ts
|
9
9
|
|
@@ -48,13 +48,13 @@ function defineFormatter({
|
|
48
48
|
};
|
49
49
|
};
|
50
50
|
}
|
51
|
-
var defineBlock = defineFormatter({ format:
|
52
|
-
var defineTransaction = defineFormatter({ format:
|
51
|
+
var defineBlock = defineFormatter({ format: _chunk6CXRXH25js.formatBlock });
|
52
|
+
var defineTransaction = defineFormatter({ format: _chunk6CXRXH25js.formatTransaction });
|
53
53
|
var defineTransactionRequest = defineFormatter({
|
54
|
-
format:
|
54
|
+
format: _chunk6CXRXH25js.formatTransactionRequest
|
55
55
|
});
|
56
56
|
var defineTransactionReceipt = defineFormatter({
|
57
|
-
format:
|
57
|
+
format: _chunk6CXRXH25js.formatTransactionReceipt
|
58
58
|
});
|
59
59
|
var arbitrumGoerli = defineChain(_chains.arbitrumGoerli);
|
60
60
|
var arbitrum = defineChain(_chains.arbitrum);
|
package/dist/chains.mjs
CHANGED
@@ -2,7 +2,7 @@ import {
|
|
2
2
|
formatTransactionRequest,
|
3
3
|
hexToNumber,
|
4
4
|
numberToHex
|
5
|
-
} from "./chunk-
|
5
|
+
} from "./chunk-NSPSPOUF.mjs";
|
6
6
|
|
7
7
|
// src/actions/test/dropTransaction.ts
|
8
8
|
async function dropTransaction(client, { hash }) {
|
@@ -253,4 +253,4 @@ export {
|
|
253
253
|
snapshot,
|
254
254
|
stopImpersonatingAccount
|
255
255
|
};
|
256
|
-
//# sourceMappingURL=chunk-
|
256
|
+
//# sourceMappingURL=chunk-3E5WSIQU.mjs.map
|
File without changes
|
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
|
5
5
|
|
6
|
-
var
|
6
|
+
var _chunk6CXRXH25js = require('./chunk-6CXRXH25.js');
|
7
7
|
|
8
8
|
// src/clients/transports/createTransport.ts
|
9
9
|
function createTransport(config, value) {
|
@@ -60,13 +60,13 @@ function http(url, { key = "http", name = "HTTP JSON-RPC" } = {}) {
|
|
60
60
|
return ({ chain }) => {
|
61
61
|
const url_ = url || _optionalChain([chain, 'optionalAccess', _ => _.rpcUrls, 'access', _2 => _2.default, 'access', _3 => _3.http, 'access', _4 => _4[0]]);
|
62
62
|
if (!url_)
|
63
|
-
throw new (0,
|
63
|
+
throw new (0, _chunk6CXRXH25js.UrlRequiredError)();
|
64
64
|
return createTransport(
|
65
65
|
{
|
66
66
|
key,
|
67
67
|
name,
|
68
68
|
async request({ method, params }) {
|
69
|
-
const { result } = await
|
69
|
+
const { result } = await _chunk6CXRXH25js.rpc.http(url_, {
|
70
70
|
body: {
|
71
71
|
method,
|
72
72
|
params
|
@@ -91,14 +91,14 @@ function webSocket(url, {
|
|
91
91
|
return ({ chain }) => {
|
92
92
|
const url_ = url || _optionalChain([chain, 'optionalAccess', _5 => _5.rpcUrls, 'access', _6 => _6.default, 'access', _7 => _7.webSocket, 'optionalAccess', _8 => _8[0]]);
|
93
93
|
if (!url_)
|
94
|
-
throw new (0,
|
94
|
+
throw new (0, _chunk6CXRXH25js.UrlRequiredError)();
|
95
95
|
return createTransport(
|
96
96
|
{
|
97
97
|
key,
|
98
98
|
name,
|
99
99
|
async request({ method, params }) {
|
100
|
-
const socket = await
|
101
|
-
const { result } = await
|
100
|
+
const socket = await _chunk6CXRXH25js.getSocket.call(void 0, url_);
|
101
|
+
const { result } = await _chunk6CXRXH25js.rpc.webSocketAsync(socket, {
|
102
102
|
body: { method, params }
|
103
103
|
});
|
104
104
|
return result;
|
@@ -107,12 +107,12 @@ function webSocket(url, {
|
|
107
107
|
},
|
108
108
|
{
|
109
109
|
getSocket() {
|
110
|
-
return
|
110
|
+
return _chunk6CXRXH25js.getSocket.call(void 0, url_);
|
111
111
|
},
|
112
112
|
async subscribe({ params, onData, onError }) {
|
113
|
-
const socket = await
|
113
|
+
const socket = await _chunk6CXRXH25js.getSocket.call(void 0, url_);
|
114
114
|
const { result: subscriptionId } = await new Promise(
|
115
|
-
(resolve, reject) =>
|
115
|
+
(resolve, reject) => _chunk6CXRXH25js.rpc.webSocket(socket, {
|
116
116
|
body: {
|
117
117
|
method: "eth_subscribe",
|
118
118
|
params
|
@@ -134,7 +134,7 @@ function webSocket(url, {
|
|
134
134
|
subscriptionId,
|
135
135
|
async unsubscribe() {
|
136
136
|
return new Promise(
|
137
|
-
(resolve, reject) =>
|
137
|
+
(resolve, reject) => _chunk6CXRXH25js.rpc.webSocket(socket, {
|
138
138
|
body: {
|
139
139
|
method: "eth_unsubscribe",
|
140
140
|
params: [subscriptionId]
|
@@ -181,7 +181,7 @@ function createClient({
|
|
181
181
|
key,
|
182
182
|
name,
|
183
183
|
pollingInterval,
|
184
|
-
request:
|
184
|
+
request: _chunk6CXRXH25js.buildRequest.call(void 0, config.request),
|
185
185
|
transport: { ...config, ...value },
|
186
186
|
type,
|
187
187
|
uid: uid()
|
@@ -256,4 +256,4 @@ function createWalletClient({
|
|
256
256
|
|
257
257
|
|
258
258
|
exports.createTransport = createTransport; exports.custom = custom; exports.fallback = fallback; exports.http = http; exports.webSocket = webSocket; exports.createClient = createClient; exports.createPublicClient = createPublicClient; exports.createTestClient = createTestClient; exports.createWalletClient = createWalletClient;
|
259
|
-
//# sourceMappingURL=chunk-
|
259
|
+
//# sourceMappingURL=chunk-3EXLRM3B.js.map
|
File without changes
|
@@ -9,7 +9,7 @@ var __publicField = (obj, key, value) => {
|
|
9
9
|
var package_default = {
|
10
10
|
name: "viem",
|
11
11
|
description: "TypeScript Interface for Ethereum",
|
12
|
-
version: "0.0.1-alpha.
|
12
|
+
version: "0.0.1-alpha.18",
|
13
13
|
scripts: {
|
14
14
|
anvil: "source .env && anvil --fork-url $VITE_ANVIL_FORK_URL --fork-block-number $VITE_ANVIL_BLOCK_NUMBER --block-time $VITE_ANVIL_BLOCK_TIME",
|
15
15
|
bench: "vitest bench --no-threads",
|
@@ -2642,4 +2642,4 @@ function parseGwei(ether, unit = "wei") {
|
|
2642
2642
|
|
2643
2643
|
|
2644
2644
|
exports.stringify = stringify; exports.BaseError = BaseError; exports.AbiConstructorNotFoundError = AbiConstructorNotFoundError; exports.AbiConstructorParamsNotFoundError = AbiConstructorParamsNotFoundError; exports.AbiDecodingDataSizeInvalidError = AbiDecodingDataSizeInvalidError; exports.AbiEncodingArrayLengthMismatchError = AbiEncodingArrayLengthMismatchError; exports.AbiEncodingLengthMismatchError = AbiEncodingLengthMismatchError; exports.AbiErrorInputsNotFoundError = AbiErrorInputsNotFoundError; exports.AbiErrorNotFoundError = AbiErrorNotFoundError; exports.AbiErrorSignatureNotFoundError = AbiErrorSignatureNotFoundError; exports.AbiEventNotFoundError = AbiEventNotFoundError; exports.AbiFunctionNotFoundError = AbiFunctionNotFoundError; exports.AbiFunctionOutputsNotFoundError = AbiFunctionOutputsNotFoundError; exports.AbiFunctionSignatureNotFoundError = AbiFunctionSignatureNotFoundError; exports.InvalidAbiEncodingTypeError = InvalidAbiEncodingTypeError; exports.InvalidAbiDecodingTypeError = InvalidAbiDecodingTypeError; exports.InvalidArrayError = InvalidArrayError; exports.InvalidDefinitionTypeError = InvalidDefinitionTypeError; exports.InvalidAddressError = InvalidAddressError; exports.BlockNotFoundError = BlockNotFoundError; exports.SizeExceedsPaddingSizeError = SizeExceedsPaddingSizeError; exports.DataLengthTooLongError = DataLengthTooLongError; exports.DataLengthTooShortError = DataLengthTooShortError; exports.InvalidBytesBooleanError = InvalidBytesBooleanError; exports.InvalidHexBooleanError = InvalidHexBooleanError; exports.InvalidHexValueError = InvalidHexValueError; exports.OffsetOutOfBoundsError = OffsetOutOfBoundsError; exports.FilterTypeNotSupportedError = FilterTypeNotSupportedError; exports.RequestError = RequestError; exports.RpcRequestError = RpcRequestError; exports.ParseRpcError = ParseRpcError; exports.InvalidRequestRpcError = InvalidRequestRpcError; exports.MethodNotFoundRpcError = MethodNotFoundRpcError; exports.InvalidParamsRpcError = InvalidParamsRpcError; exports.InternalRpcError = InternalRpcError; exports.InvalidInputRpcError = InvalidInputRpcError; exports.ResourceNotFoundRpcError = ResourceNotFoundRpcError; exports.ResourceUnavailableRpcError = ResourceUnavailableRpcError; exports.TransactionRejectedRpcError = TransactionRejectedRpcError; exports.MethodNotSupportedRpcError = MethodNotSupportedRpcError; exports.LimitExceededRpcError = LimitExceededRpcError; exports.JsonRpcVersionUnsupportedError = JsonRpcVersionUnsupportedError; exports.UnknownRpcError = UnknownRpcError; exports.isBytes = isBytes; exports.isHex = isHex; exports.pad = pad; exports.padHex = padHex; exports.padBytes = padBytes; exports.trim = trim; exports.size = size; exports.slice = slice; exports.sliceBytes = sliceBytes; exports.sliceHex = sliceHex; exports.boolToHex = boolToHex; exports.bytesToHex = bytesToHex; exports.encodeHex = encodeHex; exports.numberToHex = numberToHex; exports.stringToHex = stringToHex; exports.boolToBytes = boolToBytes; exports.encodeBytes = encodeBytes; exports.hexToBytes = hexToBytes; exports.numberToBytes = numberToBytes; exports.stringToBytes = stringToBytes; exports.encodeRlp = encodeRlp; exports.decodeHex = decodeHex; exports.hexToBigInt = hexToBigInt; exports.hexToBool = hexToBool; exports.hexToNumber = hexToNumber; exports.hexToString = hexToString; exports.decodeBytes = decodeBytes; exports.bytesToBigint = bytesToBigint; exports.bytesToBool = bytesToBool; exports.bytesToNumber = bytesToNumber; exports.bytesToString = bytesToString; exports.decodeRlp = decodeRlp; exports.extractFunctionParts = extractFunctionParts; exports.extractFunctionName = extractFunctionName; exports.extractFunctionParams = extractFunctionParams; exports.extractFunctionType = extractFunctionType; exports.getContractError = getContractError; exports.keccak256 = keccak256; exports.getEventSignature = getEventSignature; exports.getFunctionSignature = getFunctionSignature; exports.checksumAddress = checksumAddress; exports.getAddress = getAddress; exports.getContractAddress = getContractAddress; exports.getCreateAddress = getCreateAddress; exports.getCreate2Address = getCreate2Address; exports.isAddress = isAddress; exports.isAddressEqual = isAddressEqual; exports.encodeAbi = encodeAbi; exports.decodeAbi = decodeAbi; exports.formatAbiItemWithParams = formatAbiItemWithParams; exports.decodeErrorResult = decodeErrorResult; exports.decodeFunctionData = decodeFunctionData; exports.decodeFunctionResult = decodeFunctionResult; exports.encodeDeployData = encodeDeployData; exports.getAbiItem = getAbiItem; exports.encodeErrorResult = encodeErrorResult; exports.encodeEventTopics = encodeEventTopics; exports.encodeFunctionData = encodeFunctionData; exports.encodeFunctionResult = encodeFunctionResult; exports.formatAbiItemWithArgs = formatAbiItemWithArgs; exports.buildRequest = buildRequest; exports.etherUnits = etherUnits; exports.gweiUnits = gweiUnits; exports.weiUnits = weiUnits; exports.transactionType = transactionType; exports.formatTransaction = formatTransaction; exports.formatBlock = formatBlock; exports.extract = extract; exports.formatFeeHistory = formatFeeHistory; exports.format = format3; exports.formatLog = formatLog; exports.formatTransactionReceipt = formatTransactionReceipt; exports.formatTransactionRequest = formatTransactionRequest; exports.getCache = getCache; exports.withCache = withCache; exports.wait = wait; exports.getSocket = getSocket; exports.rpc = rpc; exports.formatUnit = formatUnit; exports.formatEther = formatEther; exports.formatGwei = formatGwei; exports.parseUnit = parseUnit; exports.parseEther = parseEther; exports.parseGwei = parseGwei; exports.HttpRequestError = HttpRequestError; exports.WebSocketRequestError = WebSocketRequestError; exports.RpcError = RpcError; exports.TimeoutError = TimeoutError; exports.InvalidGasArgumentsError = InvalidGasArgumentsError; exports.TransactionNotFoundError = TransactionNotFoundError; exports.TransactionReceiptNotFoundError = TransactionReceiptNotFoundError; exports.WaitForTransactionReceiptTimeoutError = WaitForTransactionReceiptTimeoutError; exports.UrlRequiredError = UrlRequiredError;
|
2645
|
-
//# sourceMappingURL=chunk-
|
2645
|
+
//# sourceMappingURL=chunk-6CXRXH25.js.map
|
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
2
2
|
|
3
|
-
var
|
3
|
+
var _chunkBW2LPGYJjs = require('./chunk-BW2LPGYJ.js');
|
4
4
|
|
5
5
|
|
6
6
|
|
@@ -25,7 +25,7 @@ var _chunkEOY65E5Ejs = require('./chunk-EOY65E5E.js');
|
|
25
25
|
|
26
26
|
|
27
27
|
|
28
|
-
var
|
28
|
+
var _chunk6CXRXH25js = require('./chunk-6CXRXH25.js');
|
29
29
|
|
30
30
|
// src/actions/public/call.ts
|
31
31
|
async function call(client, {
|
@@ -45,10 +45,10 @@ async function call(client, {
|
|
45
45
|
...rest
|
46
46
|
}) {
|
47
47
|
if (maxFeePerGas !== void 0 && maxPriorityFeePerGas !== void 0 && maxFeePerGas < maxPriorityFeePerGas)
|
48
|
-
throw new (0,
|
49
|
-
const blockNumberHex = blockNumber ?
|
48
|
+
throw new (0, _chunk6CXRXH25js.InvalidGasArgumentsError)();
|
49
|
+
const blockNumberHex = blockNumber ? _chunk6CXRXH25js.numberToHex.call(void 0, blockNumber) : void 0;
|
50
50
|
const formatter = _optionalChain([chain, 'optionalAccess', _ => _.formatters, 'optionalAccess', _2 => _2.transactionRequest]);
|
51
|
-
const request_ =
|
51
|
+
const request_ = _chunk6CXRXH25js.format.call(void 0,
|
52
52
|
{
|
53
53
|
from,
|
54
54
|
accessList,
|
@@ -60,10 +60,10 @@ async function call(client, {
|
|
60
60
|
nonce,
|
61
61
|
to,
|
62
62
|
value,
|
63
|
-
...
|
63
|
+
..._chunk6CXRXH25js.extract.call(void 0, rest, { formatter })
|
64
64
|
},
|
65
65
|
{
|
66
|
-
formatter: formatter ||
|
66
|
+
formatter: formatter || _chunk6CXRXH25js.formatTransactionRequest
|
67
67
|
}
|
68
68
|
);
|
69
69
|
const response = await client.request({
|
@@ -83,7 +83,7 @@ async function simulateContract(client, {
|
|
83
83
|
functionName,
|
84
84
|
...callRequest
|
85
85
|
}) {
|
86
|
-
const calldata =
|
86
|
+
const calldata = _chunk6CXRXH25js.encodeFunctionData.call(void 0, {
|
87
87
|
abi,
|
88
88
|
args,
|
89
89
|
functionName
|
@@ -94,7 +94,7 @@ async function simulateContract(client, {
|
|
94
94
|
to: address,
|
95
95
|
...callRequest
|
96
96
|
});
|
97
|
-
const result =
|
97
|
+
const result = _chunk6CXRXH25js.decodeFunctionResult.call(void 0, {
|
98
98
|
abi,
|
99
99
|
functionName,
|
100
100
|
data: data || "0x"
|
@@ -110,7 +110,7 @@ async function simulateContract(client, {
|
|
110
110
|
}
|
111
111
|
};
|
112
112
|
} catch (err) {
|
113
|
-
throw
|
113
|
+
throw _chunk6CXRXH25js.getContractError.call(void 0, err, {
|
114
114
|
abi,
|
115
115
|
address,
|
116
116
|
args,
|
@@ -138,12 +138,12 @@ async function createBlockFilter(client) {
|
|
138
138
|
|
139
139
|
// src/actions/public/deployContract.ts
|
140
140
|
function deployContract(walletClient, { abi, args, bytecode, ...request }) {
|
141
|
-
const calldata =
|
141
|
+
const calldata = _chunk6CXRXH25js.encodeDeployData.call(void 0, {
|
142
142
|
abi,
|
143
143
|
args,
|
144
144
|
bytecode
|
145
145
|
});
|
146
|
-
return
|
146
|
+
return _chunkBW2LPGYJjs.sendTransaction.call(void 0, walletClient, {
|
147
147
|
...request,
|
148
148
|
data: calldata
|
149
149
|
});
|
@@ -162,16 +162,16 @@ async function estimateGas(client, {
|
|
162
162
|
to,
|
163
163
|
value
|
164
164
|
}) {
|
165
|
-
const blockNumberHex = blockNumber ?
|
165
|
+
const blockNumberHex = blockNumber ? _chunk6CXRXH25js.numberToHex.call(void 0, blockNumber) : void 0;
|
166
166
|
const parameters = {
|
167
167
|
data,
|
168
168
|
from,
|
169
|
-
gas: gas ?
|
170
|
-
gasPrice: gasPrice ?
|
171
|
-
maxFeePerGas: maxFeePerGas ?
|
172
|
-
maxPriorityFeePerGas: maxPriorityFeePerGas ?
|
169
|
+
gas: gas ? _chunk6CXRXH25js.numberToHex.call(void 0, gas) : void 0,
|
170
|
+
gasPrice: gasPrice ? _chunk6CXRXH25js.numberToHex.call(void 0, gasPrice) : void 0,
|
171
|
+
maxFeePerGas: maxFeePerGas ? _chunk6CXRXH25js.numberToHex.call(void 0, maxFeePerGas) : void 0,
|
172
|
+
maxPriorityFeePerGas: maxPriorityFeePerGas ? _chunk6CXRXH25js.numberToHex.call(void 0, maxPriorityFeePerGas) : void 0,
|
173
173
|
to,
|
174
|
-
value: value ?
|
174
|
+
value: value ? _chunk6CXRXH25js.numberToHex.call(void 0, value) : void 0
|
175
175
|
};
|
176
176
|
const balance = await client.request({
|
177
177
|
method: "eth_estimateGas",
|
@@ -182,7 +182,7 @@ async function estimateGas(client, {
|
|
182
182
|
|
183
183
|
// src/actions/public/getBalance.ts
|
184
184
|
async function getBalance(client, { address, blockNumber, blockTag = "latest" }) {
|
185
|
-
const blockNumberHex = blockNumber ?
|
185
|
+
const blockNumberHex = blockNumber ? _chunk6CXRXH25js.numberToHex.call(void 0, blockNumber) : void 0;
|
186
186
|
const balance = await client.request({
|
187
187
|
method: "eth_getBalance",
|
188
188
|
params: [address, blockNumberHex || blockTag]
|
@@ -197,7 +197,7 @@ async function getBlock(client, {
|
|
197
197
|
blockTag = "latest",
|
198
198
|
includeTransactions = false
|
199
199
|
} = {}) {
|
200
|
-
const blockNumberHex = blockNumber !== void 0 ?
|
200
|
+
const blockNumberHex = blockNumber !== void 0 ? _chunk6CXRXH25js.numberToHex.call(void 0, blockNumber) : void 0;
|
201
201
|
let block = null;
|
202
202
|
if (blockHash) {
|
203
203
|
block = await client.request({
|
@@ -211,19 +211,19 @@ async function getBlock(client, {
|
|
211
211
|
});
|
212
212
|
}
|
213
213
|
if (!block)
|
214
|
-
throw new (0,
|
215
|
-
return
|
216
|
-
formatter: _optionalChain([client, 'access', _3 => _3.chain, 'optionalAccess', _4 => _4.formatters, 'optionalAccess', _5 => _5.block]) ||
|
214
|
+
throw new (0, _chunk6CXRXH25js.BlockNotFoundError)({ blockHash, blockNumber });
|
215
|
+
return _chunk6CXRXH25js.format.call(void 0, block, {
|
216
|
+
formatter: _optionalChain([client, 'access', _3 => _3.chain, 'optionalAccess', _4 => _4.formatters, 'optionalAccess', _5 => _5.block]) || _chunk6CXRXH25js.formatBlock
|
217
217
|
});
|
218
218
|
}
|
219
219
|
|
220
220
|
// src/actions/public/getBlockNumber.ts
|
221
221
|
var cacheKey = (id) => `blockNumber.${id}`;
|
222
222
|
function getBlockNumberCache(id) {
|
223
|
-
return
|
223
|
+
return _chunk6CXRXH25js.getCache.call(void 0, cacheKey(id));
|
224
224
|
}
|
225
225
|
async function getBlockNumber(client, { maxAge = client.pollingInterval } = {}) {
|
226
|
-
const blockNumberHex = await
|
226
|
+
const blockNumberHex = await _chunk6CXRXH25js.withCache.call(void 0,
|
227
227
|
() => client.request({
|
228
228
|
method: "eth_blockNumber"
|
229
229
|
}),
|
@@ -238,7 +238,7 @@ async function getBlockTransactionCount(client, {
|
|
238
238
|
blockNumber,
|
239
239
|
blockTag = "latest"
|
240
240
|
} = {}) {
|
241
|
-
const blockNumberHex = blockNumber !== void 0 ?
|
241
|
+
const blockNumberHex = blockNumber !== void 0 ? _chunk6CXRXH25js.numberToHex.call(void 0, blockNumber) : void 0;
|
242
242
|
let count = null;
|
243
243
|
if (blockHash) {
|
244
244
|
count = await client.request({
|
@@ -251,12 +251,12 @@ async function getBlockTransactionCount(client, {
|
|
251
251
|
params: [blockNumberHex || blockTag]
|
252
252
|
});
|
253
253
|
}
|
254
|
-
return
|
254
|
+
return _chunk6CXRXH25js.hexToNumber.call(void 0, count);
|
255
255
|
}
|
256
256
|
|
257
257
|
// src/actions/public/getBytecode.ts
|
258
258
|
async function getBytecode(client, { address, blockNumber, blockTag = "latest" }) {
|
259
|
-
const blockNumberHex = blockNumber !== void 0 ?
|
259
|
+
const blockNumberHex = blockNumber !== void 0 ? _chunk6CXRXH25js.numberToHex.call(void 0, blockNumber) : void 0;
|
260
260
|
const hex = await client.request({
|
261
261
|
method: "eth_getCode",
|
262
262
|
params: [address, blockNumberHex || blockTag]
|
@@ -269,7 +269,7 @@ async function getBytecode(client, { address, blockNumber, blockTag = "latest" }
|
|
269
269
|
// src/actions/public/getChainId.ts
|
270
270
|
async function getChainId(client) {
|
271
271
|
const chainIdHex = await client.request({ method: "eth_chainId" });
|
272
|
-
return
|
272
|
+
return _chunk6CXRXH25js.hexToNumber.call(void 0, chainIdHex);
|
273
273
|
}
|
274
274
|
|
275
275
|
// src/actions/public/getFeeHistory.ts
|
@@ -279,16 +279,16 @@ async function getFeeHistory(client, {
|
|
279
279
|
blockTag = "latest",
|
280
280
|
rewardPercentiles
|
281
281
|
}) {
|
282
|
-
const blockNumberHex = blockNumber ?
|
282
|
+
const blockNumberHex = blockNumber ? _chunk6CXRXH25js.numberToHex.call(void 0, blockNumber) : void 0;
|
283
283
|
const feeHistory = await client.request({
|
284
284
|
method: "eth_feeHistory",
|
285
285
|
params: [
|
286
|
-
|
286
|
+
_chunk6CXRXH25js.numberToHex.call(void 0, blockCount),
|
287
287
|
blockNumberHex || blockTag,
|
288
288
|
rewardPercentiles
|
289
289
|
]
|
290
290
|
});
|
291
|
-
return
|
291
|
+
return _chunk6CXRXH25js.formatFeeHistory.call(void 0, feeHistory);
|
292
292
|
}
|
293
293
|
|
294
294
|
// src/actions/public/getFilterChanges.ts
|
@@ -298,7 +298,7 @@ async function getFilterChanges(client, { filter }) {
|
|
298
298
|
params: [filter.id]
|
299
299
|
});
|
300
300
|
return logs.map(
|
301
|
-
(log) => typeof log === "string" ? log :
|
301
|
+
(log) => typeof log === "string" ? log : _chunk6CXRXH25js.formatLog.call(void 0, log)
|
302
302
|
);
|
303
303
|
}
|
304
304
|
|
@@ -308,7 +308,7 @@ async function getFilterLogs(client, { filter }) {
|
|
308
308
|
method: "eth_getFilterLogs",
|
309
309
|
params: [filter.id]
|
310
310
|
});
|
311
|
-
return logs.map(
|
311
|
+
return logs.map(_chunk6CXRXH25js.formatLog);
|
312
312
|
}
|
313
313
|
|
314
314
|
// src/actions/public/getGasPrice.ts
|
@@ -324,7 +324,7 @@ function buildFilterTopics({
|
|
324
324
|
event,
|
325
325
|
args: _args
|
326
326
|
}) {
|
327
|
-
const signature =
|
327
|
+
const signature = _chunk6CXRXH25js.getEventSignature.call(void 0, event);
|
328
328
|
return [signature];
|
329
329
|
}
|
330
330
|
|
@@ -354,13 +354,13 @@ async function getLogs(client, {
|
|
354
354
|
{
|
355
355
|
address,
|
356
356
|
topics,
|
357
|
-
fromBlock: typeof fromBlock === "bigint" ?
|
358
|
-
toBlock: typeof toBlock === "bigint" ?
|
357
|
+
fromBlock: typeof fromBlock === "bigint" ? _chunk6CXRXH25js.numberToHex.call(void 0, fromBlock) : fromBlock,
|
358
|
+
toBlock: typeof toBlock === "bigint" ? _chunk6CXRXH25js.numberToHex.call(void 0, toBlock) : toBlock
|
359
359
|
}
|
360
360
|
]
|
361
361
|
});
|
362
362
|
}
|
363
|
-
return logs.map(
|
363
|
+
return logs.map(_chunk6CXRXH25js.formatLog);
|
364
364
|
}
|
365
365
|
|
366
366
|
// src/actions/public/getTransaction.ts
|
@@ -371,7 +371,7 @@ async function getTransaction(client, {
|
|
371
371
|
hash,
|
372
372
|
index
|
373
373
|
}) {
|
374
|
-
const blockNumberHex = blockNumber !== void 0 ?
|
374
|
+
const blockNumberHex = blockNumber !== void 0 ? _chunk6CXRXH25js.numberToHex.call(void 0, blockNumber) : void 0;
|
375
375
|
let transaction = null;
|
376
376
|
if (hash) {
|
377
377
|
transaction = await client.request({
|
@@ -381,24 +381,24 @@ async function getTransaction(client, {
|
|
381
381
|
} else if (blockHash) {
|
382
382
|
transaction = await client.request({
|
383
383
|
method: "eth_getTransactionByBlockHashAndIndex",
|
384
|
-
params: [blockHash,
|
384
|
+
params: [blockHash, _chunk6CXRXH25js.numberToHex.call(void 0, index)]
|
385
385
|
});
|
386
386
|
} else if (blockNumberHex || blockTag) {
|
387
387
|
transaction = await client.request({
|
388
388
|
method: "eth_getTransactionByBlockNumberAndIndex",
|
389
|
-
params: [blockNumberHex || blockTag,
|
389
|
+
params: [blockNumberHex || blockTag, _chunk6CXRXH25js.numberToHex.call(void 0, index)]
|
390
390
|
});
|
391
391
|
}
|
392
392
|
if (!transaction)
|
393
|
-
throw new (0,
|
393
|
+
throw new (0, _chunk6CXRXH25js.TransactionNotFoundError)({
|
394
394
|
blockHash,
|
395
395
|
blockNumber,
|
396
396
|
blockTag,
|
397
397
|
hash,
|
398
398
|
index
|
399
399
|
});
|
400
|
-
return
|
401
|
-
formatter: _optionalChain([client, 'access', _6 => _6.chain, 'optionalAccess', _7 => _7.formatters, 'optionalAccess', _8 => _8.transaction]) ||
|
400
|
+
return _chunk6CXRXH25js.format.call(void 0, transaction, {
|
401
|
+
formatter: _optionalChain([client, 'access', _6 => _6.chain, 'optionalAccess', _7 => _7.formatters, 'optionalAccess', _8 => _8.transaction]) || _chunk6CXRXH25js.formatTransaction
|
402
402
|
});
|
403
403
|
}
|
404
404
|
|
@@ -418,9 +418,9 @@ async function getTransactionConfirmations(client, { hash, transactionReceipt })
|
|
418
418
|
async function getTransactionCount(client, { address, blockTag = "latest", blockNumber }) {
|
419
419
|
const count = await client.request({
|
420
420
|
method: "eth_getTransactionCount",
|
421
|
-
params: [address, blockNumber ?
|
421
|
+
params: [address, blockNumber ? _chunk6CXRXH25js.numberToHex.call(void 0, blockNumber) : blockTag]
|
422
422
|
});
|
423
|
-
return
|
423
|
+
return _chunk6CXRXH25js.hexToNumber.call(void 0, count);
|
424
424
|
}
|
425
425
|
|
426
426
|
// src/actions/public/getTransactionReceipt.ts
|
@@ -430,12 +430,46 @@ async function getTransactionReceipt(client, { hash }) {
|
|
430
430
|
params: [hash]
|
431
431
|
});
|
432
432
|
if (!receipt)
|
433
|
-
throw new (0,
|
434
|
-
return
|
435
|
-
formatter: _optionalChain([client, 'access', _11 => _11.chain, 'optionalAccess', _12 => _12.formatters, 'optionalAccess', _13 => _13.transactionReceipt]) ||
|
433
|
+
throw new (0, _chunk6CXRXH25js.TransactionReceiptNotFoundError)({ hash });
|
434
|
+
return _chunk6CXRXH25js.format.call(void 0, receipt, {
|
435
|
+
formatter: _optionalChain([client, 'access', _11 => _11.chain, 'optionalAccess', _12 => _12.formatters, 'optionalAccess', _13 => _13.transactionReceipt]) || _chunk6CXRXH25js.formatTransactionReceipt
|
436
436
|
});
|
437
437
|
}
|
438
438
|
|
439
|
+
// src/actions/public/readContract.ts
|
440
|
+
async function readContract(client, {
|
441
|
+
abi,
|
442
|
+
address,
|
443
|
+
args,
|
444
|
+
functionName,
|
445
|
+
...callRequest
|
446
|
+
}) {
|
447
|
+
const calldata = _chunk6CXRXH25js.encodeFunctionData.call(void 0, {
|
448
|
+
abi,
|
449
|
+
args,
|
450
|
+
functionName
|
451
|
+
});
|
452
|
+
try {
|
453
|
+
const { data } = await call(client, {
|
454
|
+
data: calldata,
|
455
|
+
to: address,
|
456
|
+
...callRequest
|
457
|
+
});
|
458
|
+
return _chunk6CXRXH25js.decodeFunctionResult.call(void 0, {
|
459
|
+
abi,
|
460
|
+
functionName,
|
461
|
+
data: data || "0x"
|
462
|
+
});
|
463
|
+
} catch (err) {
|
464
|
+
throw _chunk6CXRXH25js.getContractError.call(void 0, err, {
|
465
|
+
abi,
|
466
|
+
address,
|
467
|
+
args,
|
468
|
+
functionName
|
469
|
+
});
|
470
|
+
}
|
471
|
+
}
|
472
|
+
|
439
473
|
// src/actions/public/uninstallFilter.ts
|
440
474
|
async function uninstallFilter(client, { filter }) {
|
441
475
|
return client.request({
|
@@ -495,12 +529,12 @@ function poll(fn, { emitOnBegin, initialWaitTime, interval }) {
|
|
495
529
|
if (emitOnBegin)
|
496
530
|
data = await fn({ unpoll: unwatch });
|
497
531
|
const initialWait = await _asyncNullishCoalesce(await _optionalChain([initialWaitTime, 'optionalCall', _17 => _17(data)]), async () => ( interval));
|
498
|
-
await
|
532
|
+
await _chunk6CXRXH25js.wait.call(void 0, initialWait);
|
499
533
|
const poll2 = async () => {
|
500
534
|
if (!active)
|
501
535
|
return;
|
502
536
|
await fn({ unpoll: unwatch });
|
503
|
-
await
|
537
|
+
await _chunk6CXRXH25js.wait.call(void 0, interval);
|
504
538
|
poll2();
|
505
539
|
};
|
506
540
|
poll2();
|
@@ -681,7 +715,7 @@ async function waitForTransactionReceipt(client, {
|
|
681
715
|
return new Promise((resolve, reject) => {
|
682
716
|
if (timeout)
|
683
717
|
setTimeout(
|
684
|
-
() => reject(new (0,
|
718
|
+
() => reject(new (0, _chunk6CXRXH25js.WaitForTransactionReceiptTimeoutError)({ hash })),
|
685
719
|
timeout
|
686
720
|
);
|
687
721
|
const unobserve = observe(
|
@@ -711,7 +745,7 @@ async function waitForTransactionReceipt(client, {
|
|
711
745
|
return;
|
712
746
|
done(() => emit.resolve(receipt));
|
713
747
|
} catch (err) {
|
714
|
-
if (transaction && (err instanceof
|
748
|
+
if (transaction && (err instanceof _chunk6CXRXH25js.TransactionNotFoundError || err instanceof _chunk6CXRXH25js.TransactionReceiptNotFoundError)) {
|
715
749
|
replacedTransaction = transaction;
|
716
750
|
const block = await getBlock(client, {
|
717
751
|
blockNumber,
|
@@ -782,5 +816,6 @@ async function waitForTransactionReceipt(client, {
|
|
782
816
|
|
783
817
|
|
784
818
|
|
785
|
-
|
786
|
-
|
819
|
+
|
820
|
+
exports.call = call; exports.simulateContract = simulateContract; exports.createPendingTransactionFilter = createPendingTransactionFilter; exports.createBlockFilter = createBlockFilter; exports.deployContract = deployContract; exports.estimateGas = estimateGas; exports.getBalance = getBalance; exports.getBlock = getBlock; exports.getBlockNumberCache = getBlockNumberCache; exports.getBlockNumber = getBlockNumber; exports.getBlockTransactionCount = getBlockTransactionCount; exports.getBytecode = getBytecode; exports.getChainId = getChainId; exports.getFeeHistory = getFeeHistory; exports.getFilterChanges = getFilterChanges; exports.getFilterLogs = getFilterLogs; exports.getGasPrice = getGasPrice; exports.getLogs = getLogs; exports.getTransaction = getTransaction; exports.getTransactionConfirmations = getTransactionConfirmations; exports.getTransactionCount = getTransactionCount; exports.getTransactionReceipt = getTransactionReceipt; exports.readContract = readContract; exports.uninstallFilter = uninstallFilter; exports.waitForTransactionReceipt = waitForTransactionReceipt; exports.watchBlockNumber = watchBlockNumber; exports.watchBlocks = watchBlocks; exports.watchPendingTransactions = watchPendingTransactions;
|
821
|
+
//# sourceMappingURL=chunk-A4HJ47I6.js.map
|