viem 2.58.4 → 2.58.6
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/CHANGELOG.md +28 -0
- package/_cjs/account-abstraction/actions/bundler/prepareUserOperation.js +6 -1
- package/_cjs/account-abstraction/actions/bundler/prepareUserOperation.js.map +1 -1
- package/_cjs/account-abstraction/errors/bundler.js +38 -228
- package/_cjs/account-abstraction/errors/bundler.js.map +1 -1
- package/_cjs/account-abstraction/errors/userOperation.js +1 -6
- package/_cjs/account-abstraction/errors/userOperation.js.map +1 -1
- package/_cjs/account-abstraction/utils/formatters/userOperation.js +11 -1
- package/_cjs/account-abstraction/utils/formatters/userOperation.js.map +1 -1
- package/_cjs/actions/public/estimateContractGas.js +7 -1
- package/_cjs/actions/public/estimateContractGas.js.map +1 -1
- package/_cjs/actions/public/simulateBlocks.js +6 -1
- package/_cjs/actions/public/simulateBlocks.js.map +1 -1
- package/_cjs/actions/public/simulateContract.js +7 -1
- package/_cjs/actions/public/simulateContract.js.map +1 -1
- package/_cjs/actions/wallet/sendCalls.js +8 -1
- package/_cjs/actions/wallet/sendCalls.js.map +1 -1
- package/_cjs/actions/wallet/sendTransaction.js +8 -2
- package/_cjs/actions/wallet/sendTransaction.js.map +1 -1
- package/_cjs/actions/wallet/sendTransactionSync.js +8 -2
- package/_cjs/actions/wallet/sendTransactionSync.js.map +1 -1
- package/_cjs/chains/definitions/sevenChain.js +26 -0
- package/_cjs/chains/definitions/sevenChain.js.map +1 -0
- package/_cjs/chains/index.js +7 -5
- package/_cjs/chains/index.js.map +1 -1
- package/_cjs/constants/abis.js +17 -1
- package/_cjs/constants/abis.js.map +1 -1
- package/_cjs/errors/abi.js +9 -54
- package/_cjs/errors/abi.js.map +1 -1
- package/_cjs/errors/base.js +6 -36
- package/_cjs/errors/base.js.map +1 -1
- package/_cjs/errors/calls.js +1 -6
- package/_cjs/errors/calls.js.map +1 -1
- package/_cjs/errors/contract.js +14 -84
- package/_cjs/errors/contract.js.map +1 -1
- package/_cjs/errors/estimateGas.js +1 -6
- package/_cjs/errors/estimateGas.js.map +1 -1
- package/_cjs/errors/node.js +12 -72
- package/_cjs/errors/node.js.map +1 -1
- package/_cjs/errors/request.js +14 -84
- package/_cjs/errors/request.js.map +1 -1
- package/_cjs/errors/rpc.js +29 -174
- package/_cjs/errors/rpc.js.map +1 -1
- package/_cjs/errors/transaction.js +5 -30
- package/_cjs/errors/transaction.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/experimental/erc7811/actions/getAssets.js +6 -1
- package/_cjs/experimental/erc7811/actions/getAssets.js.map +1 -1
- package/_cjs/tempo/Account.js +1 -6
- package/_cjs/tempo/Account.js.map +1 -1
- package/_cjs/tempo/Gateway.js +6 -36
- package/_cjs/tempo/Gateway.js.map +1 -1
- package/_cjs/tempo/actions/accessKey.js +17 -102
- package/_cjs/tempo/actions/accessKey.js.map +1 -1
- package/_cjs/tempo/actions/amm.js +5 -30
- package/_cjs/tempo/actions/amm.js.map +1 -1
- package/_cjs/tempo/actions/channel.js +10 -60
- package/_cjs/tempo/actions/channel.js.map +1 -1
- package/_cjs/tempo/actions/dex.js +29 -174
- package/_cjs/tempo/actions/dex.js.map +1 -1
- package/_cjs/tempo/actions/earn/deployment.js +3 -18
- package/_cjs/tempo/actions/earn/deployment.js.map +1 -1
- package/_cjs/tempo/actions/fee.js +3 -18
- package/_cjs/tempo/actions/fee.js.map +1 -1
- package/_cjs/tempo/actions/nonce.js +3 -18
- package/_cjs/tempo/actions/nonce.js.map +1 -1
- package/_cjs/tempo/actions/policy.js +1 -6
- package/_cjs/tempo/actions/policy.js.map +1 -1
- package/_cjs/tempo/actions/simulate.js +6 -1
- package/_cjs/tempo/actions/simulate.js.map +1 -1
- package/_cjs/tempo/actions/token.js +25 -150
- package/_cjs/tempo/actions/token.js.map +1 -1
- package/_cjs/tempo/errors.js +5 -30
- package/_cjs/tempo/errors.js.map +1 -1
- package/_cjs/types/eip1193.js +3 -18
- package/_cjs/types/eip1193.js.map +1 -1
- package/_cjs/utils/formatters/feeHistory.js +5 -0
- package/_cjs/utils/formatters/feeHistory.js.map +1 -1
- package/_cjs/utils/lru.js +1 -6
- package/_cjs/utils/lru.js.map +1 -1
- package/_cjs/utils/signature/serializeErc8010Signature.js +3 -1
- package/_cjs/utils/signature/serializeErc8010Signature.js.map +1 -1
- package/_cjs/utils/signature/toPrefixedMessage.js +3 -1
- package/_cjs/utils/signature/toPrefixedMessage.js.map +1 -1
- package/_cjs/utils/unit/Value.js +2 -12
- package/_cjs/utils/unit/Value.js.map +1 -1
- package/_esm/account-abstraction/actions/bundler/prepareUserOperation.js +6 -1
- package/_esm/account-abstraction/actions/bundler/prepareUserOperation.js.map +1 -1
- package/_esm/account-abstraction/errors/bundler.js +38 -228
- package/_esm/account-abstraction/errors/bundler.js.map +1 -1
- package/_esm/account-abstraction/errors/userOperation.js +1 -6
- package/_esm/account-abstraction/errors/userOperation.js.map +1 -1
- package/_esm/account-abstraction/utils/formatters/userOperation.js +11 -1
- package/_esm/account-abstraction/utils/formatters/userOperation.js.map +1 -1
- package/_esm/actions/public/estimateContractGas.js +7 -1
- package/_esm/actions/public/estimateContractGas.js.map +1 -1
- package/_esm/actions/public/simulateBlocks.js +6 -1
- package/_esm/actions/public/simulateBlocks.js.map +1 -1
- package/_esm/actions/public/simulateContract.js +7 -1
- package/_esm/actions/public/simulateContract.js.map +1 -1
- package/_esm/actions/wallet/sendCalls.js +8 -1
- package/_esm/actions/wallet/sendCalls.js.map +1 -1
- package/_esm/actions/wallet/sendTransaction.js +8 -2
- package/_esm/actions/wallet/sendTransaction.js.map +1 -1
- package/_esm/actions/wallet/sendTransactionSync.js +8 -2
- package/_esm/actions/wallet/sendTransactionSync.js.map +1 -1
- package/_esm/chains/definitions/sevenChain.js +23 -0
- package/_esm/chains/definitions/sevenChain.js.map +1 -0
- package/_esm/chains/index.js +1 -0
- package/_esm/chains/index.js.map +1 -1
- package/_esm/constants/abis.js +17 -1
- package/_esm/constants/abis.js.map +1 -1
- package/_esm/errors/abi.js +9 -54
- package/_esm/errors/abi.js.map +1 -1
- package/_esm/errors/base.js +6 -36
- package/_esm/errors/base.js.map +1 -1
- package/_esm/errors/calls.js +1 -6
- package/_esm/errors/calls.js.map +1 -1
- package/_esm/errors/contract.js +14 -84
- package/_esm/errors/contract.js.map +1 -1
- package/_esm/errors/estimateGas.js +1 -6
- package/_esm/errors/estimateGas.js.map +1 -1
- package/_esm/errors/node.js +12 -72
- package/_esm/errors/node.js.map +1 -1
- package/_esm/errors/request.js +16 -86
- package/_esm/errors/request.js.map +1 -1
- package/_esm/errors/rpc.js +29 -174
- package/_esm/errors/rpc.js.map +1 -1
- package/_esm/errors/transaction.js +5 -30
- package/_esm/errors/transaction.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/experimental/erc7811/actions/getAssets.js +6 -1
- package/_esm/experimental/erc7811/actions/getAssets.js.map +1 -1
- package/_esm/tempo/Account.js +2 -7
- package/_esm/tempo/Account.js.map +1 -1
- package/_esm/tempo/Gateway.js +12 -42
- package/_esm/tempo/Gateway.js.map +1 -1
- package/_esm/tempo/actions/accessKey.js +34 -119
- package/_esm/tempo/actions/accessKey.js.map +1 -1
- package/_esm/tempo/actions/amm.js +10 -35
- package/_esm/tempo/actions/amm.js.map +1 -1
- package/_esm/tempo/actions/channel.js +20 -70
- package/_esm/tempo/actions/channel.js.map +1 -1
- package/_esm/tempo/actions/dex.js +58 -203
- package/_esm/tempo/actions/dex.js.map +1 -1
- package/_esm/tempo/actions/earn/deployment.js +3 -18
- package/_esm/tempo/actions/earn/deployment.js.map +1 -1
- package/_esm/tempo/actions/fee.js +6 -21
- package/_esm/tempo/actions/fee.js.map +1 -1
- package/_esm/tempo/actions/nonce.js +6 -21
- package/_esm/tempo/actions/nonce.js.map +1 -1
- package/_esm/tempo/actions/policy.js +2 -7
- package/_esm/tempo/actions/policy.js.map +1 -1
- package/_esm/tempo/actions/simulate.js +6 -1
- package/_esm/tempo/actions/simulate.js.map +1 -1
- package/_esm/tempo/actions/token.js +50 -175
- package/_esm/tempo/actions/token.js.map +1 -1
- package/_esm/tempo/errors.js +10 -35
- package/_esm/tempo/errors.js.map +1 -1
- package/_esm/types/eip1193.js +3 -18
- package/_esm/types/eip1193.js.map +1 -1
- package/_esm/utils/formatters/feeHistory.js +5 -0
- package/_esm/utils/formatters/feeHistory.js.map +1 -1
- package/_esm/utils/lru.js +1 -6
- package/_esm/utils/lru.js.map +1 -1
- package/_esm/utils/signature/serializeErc8010Signature.js +3 -1
- package/_esm/utils/signature/serializeErc8010Signature.js.map +1 -1
- package/_esm/utils/signature/toPrefixedMessage.js +4 -1
- package/_esm/utils/signature/toPrefixedMessage.js.map +1 -1
- package/_esm/utils/unit/Value.js +2 -12
- package/_esm/utils/unit/Value.js.map +1 -1
- package/_types/account-abstraction/actions/bundler/prepareUserOperation.d.ts.map +1 -1
- package/_types/account-abstraction/utils/formatters/userOperation.d.ts.map +1 -1
- package/_types/actions/public/estimateContractGas.d.ts.map +1 -1
- package/_types/actions/public/simulateBlocks.d.ts.map +1 -1
- package/_types/actions/public/simulateContract.d.ts.map +1 -1
- package/_types/actions/wallet/sendCalls.d.ts.map +1 -1
- package/_types/actions/wallet/sendTransaction.d.ts.map +1 -1
- package/_types/actions/wallet/sendTransactionSync.d.ts.map +1 -1
- package/_types/chains/definitions/sevenChain.d.ts +54 -0
- package/_types/chains/definitions/sevenChain.d.ts.map +1 -0
- package/_types/chains/index.d.ts +1 -0
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/constants/abis.d.ts +12 -1
- package/_types/constants/abis.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/tempo/actions/simulate.d.ts.map +1 -1
- package/_types/types/block.d.ts +2 -0
- package/_types/types/block.d.ts.map +1 -1
- package/_types/types/eip1193.d.ts +1 -1
- package/_types/types/eip1193.d.ts.map +1 -1
- package/_types/types/fee.d.ts +7 -0
- package/_types/types/fee.d.ts.map +1 -1
- package/_types/utils/formatters/feeHistory.d.ts.map +1 -1
- package/_types/utils/signature/serializeErc8010Signature.d.ts.map +1 -1
- package/_types/utils/signature/toPrefixedMessage.d.ts.map +1 -1
- package/account-abstraction/actions/bundler/prepareUserOperation.ts +6 -1
- package/account-abstraction/utils/formatters/userOperation.ts +12 -1
- package/actions/public/estimateContractGas.ts +7 -1
- package/actions/public/simulateBlocks.ts +6 -1
- package/actions/public/simulateContract.ts +7 -1
- package/actions/wallet/sendCalls.ts +8 -1
- package/actions/wallet/sendTransaction.ts +8 -2
- package/actions/wallet/sendTransactionSync.ts +8 -2
- package/chains/definitions/sevenChain.ts +23 -0
- package/chains/index.ts +1 -0
- package/constants/abis.ts +17 -1
- package/errors/version.ts +1 -1
- package/experimental/erc7811/actions/getAssets.ts +8 -1
- package/package.json +1 -1
- package/tempo/actions/simulate.ts +6 -1
- package/types/block.ts +2 -0
- package/types/eip1193.ts +1 -1
- package/types/fee.ts +7 -0
- package/utils/formatters/feeHistory.ts +5 -0
- package/utils/signature/serializeErc8010Signature.ts +4 -1
- package/utils/signature/toPrefixedMessage.ts +5 -1
|
@@ -545,7 +545,12 @@ export async function prepareUserOperation<
|
|
|
545
545
|
////////////////////////////////////////////////////////////////////////////////
|
|
546
546
|
|
|
547
547
|
if (typeof callData !== 'undefined')
|
|
548
|
-
request.callData = dataSuffix
|
|
548
|
+
request.callData = dataSuffix
|
|
549
|
+
? concat([
|
|
550
|
+
callData,
|
|
551
|
+
dataSuffix.length % 2 ? `0x0${dataSuffix.slice(2)}` : dataSuffix,
|
|
552
|
+
])
|
|
553
|
+
: callData
|
|
549
554
|
if (typeof factory !== 'undefined')
|
|
550
555
|
request = { ...request, ...(factory as any) }
|
|
551
556
|
if (typeof fees !== 'undefined') request = { ...request, ...(fees as any) }
|
|
@@ -5,7 +5,18 @@ import type { UserOperation } from '../../types/userOperation.js'
|
|
|
5
5
|
export type FormatUserOperationErrorType = ErrorType
|
|
6
6
|
|
|
7
7
|
export function formatUserOperation(parameters: RpcUserOperation) {
|
|
8
|
-
const
|
|
8
|
+
const { eip7702Auth, ...rest } = parameters
|
|
9
|
+
const userOperation = rest as unknown as UserOperation
|
|
10
|
+
|
|
11
|
+
if (eip7702Auth)
|
|
12
|
+
userOperation.authorization = {
|
|
13
|
+
address: eip7702Auth.address,
|
|
14
|
+
chainId: Number(eip7702Auth.chainId),
|
|
15
|
+
nonce: Number(eip7702Auth.nonce),
|
|
16
|
+
r: eip7702Auth.r,
|
|
17
|
+
s: eip7702Auth.s,
|
|
18
|
+
yParity: Number(eip7702Auth.yParity),
|
|
19
|
+
}
|
|
9
20
|
|
|
10
21
|
if (parameters.callGasLimit)
|
|
11
22
|
userOperation.callGasLimit = BigInt(parameters.callGasLimit)
|
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
type EncodeFunctionDataParameters,
|
|
23
23
|
encodeFunctionData,
|
|
24
24
|
} from '../../utils/abi/encodeFunctionData.js'
|
|
25
|
+
import { concat } from '../../utils/data/concat.js'
|
|
25
26
|
import {
|
|
26
27
|
type GetContractErrorReturnType,
|
|
27
28
|
getContractError,
|
|
@@ -128,7 +129,12 @@ export async function estimateContractGas<
|
|
|
128
129
|
estimateGas,
|
|
129
130
|
'estimateGas',
|
|
130
131
|
)({
|
|
131
|
-
data:
|
|
132
|
+
data: dataSuffix
|
|
133
|
+
? concat([
|
|
134
|
+
data,
|
|
135
|
+
dataSuffix.length % 2 ? `0x0${dataSuffix.slice(2)}` : dataSuffix,
|
|
136
|
+
])
|
|
137
|
+
: data,
|
|
132
138
|
to: address,
|
|
133
139
|
...request,
|
|
134
140
|
} as unknown as EstimateGasParameters)
|
|
@@ -215,7 +215,12 @@ export async function simulateBlocks<
|
|
|
215
215
|
...call,
|
|
216
216
|
account,
|
|
217
217
|
data: call.dataSuffix
|
|
218
|
-
? concat([
|
|
218
|
+
? concat([
|
|
219
|
+
data || '0x',
|
|
220
|
+
call.dataSuffix.length % 2
|
|
221
|
+
? `0x0${call.dataSuffix.slice(2)}`
|
|
222
|
+
: call.dataSuffix,
|
|
223
|
+
])
|
|
219
224
|
: data,
|
|
220
225
|
from: call.from ?? account?.address,
|
|
221
226
|
} as const
|
|
@@ -34,6 +34,7 @@ import {
|
|
|
34
34
|
type EncodeFunctionDataErrorType,
|
|
35
35
|
encodeFunctionData,
|
|
36
36
|
} from '../../utils/abi/encodeFunctionData.js'
|
|
37
|
+
import { concat } from '../../utils/data/concat.js'
|
|
37
38
|
import {
|
|
38
39
|
type GetContractErrorReturnType,
|
|
39
40
|
getContractError,
|
|
@@ -278,7 +279,12 @@ export async function simulateContract<
|
|
|
278
279
|
'call',
|
|
279
280
|
)({
|
|
280
281
|
batch: false,
|
|
281
|
-
data:
|
|
282
|
+
data: dataSuffix
|
|
283
|
+
? concat([
|
|
284
|
+
calldata,
|
|
285
|
+
dataSuffix.length % 2 ? `0x0${dataSuffix.slice(2)}` : dataSuffix,
|
|
286
|
+
])
|
|
287
|
+
: calldata,
|
|
282
288
|
to: address,
|
|
283
289
|
...callRequest,
|
|
284
290
|
// `call` omits the sender for `null` at runtime, but its parameter type excludes `null`.
|
|
@@ -138,7 +138,14 @@ export async function sendCalls<
|
|
|
138
138
|
: call.data
|
|
139
139
|
|
|
140
140
|
return {
|
|
141
|
-
data: call.dataSuffix
|
|
141
|
+
data: call.dataSuffix
|
|
142
|
+
? concat([
|
|
143
|
+
data ?? '0x',
|
|
144
|
+
call.dataSuffix.length % 2
|
|
145
|
+
? `0x0${call.dataSuffix.slice(2)}`
|
|
146
|
+
: call.dataSuffix,
|
|
147
|
+
])
|
|
148
|
+
: data,
|
|
142
149
|
to: call.to,
|
|
143
150
|
value: call.value ? numberToHex(call.value) : undefined,
|
|
144
151
|
}
|
|
@@ -191,6 +191,12 @@ export async function sendTransaction<
|
|
|
191
191
|
docsPath: '/docs/actions/wallet/sendTransaction',
|
|
192
192
|
})
|
|
193
193
|
const account = account_ ? parseAccount(account_) : null
|
|
194
|
+
const calldata = dataSuffix
|
|
195
|
+
? concat([
|
|
196
|
+
data ?? '0x',
|
|
197
|
+
dataSuffix.length % 2 ? `0x0${dataSuffix.slice(2)}` : dataSuffix,
|
|
198
|
+
])
|
|
199
|
+
: data
|
|
194
200
|
let nonceManagerParameters:
|
|
195
201
|
| { address: Address; chainId: number; nonce?: number | undefined }
|
|
196
202
|
| undefined
|
|
@@ -243,7 +249,7 @@ export async function sendTransaction<
|
|
|
243
249
|
authorizationList,
|
|
244
250
|
blobs,
|
|
245
251
|
chainId,
|
|
246
|
-
data:
|
|
252
|
+
data: calldata,
|
|
247
253
|
gas,
|
|
248
254
|
gasPrice,
|
|
249
255
|
maxFeePerBlobGas,
|
|
@@ -352,7 +358,7 @@ export async function sendTransaction<
|
|
|
352
358
|
authorizationList,
|
|
353
359
|
blobs,
|
|
354
360
|
chain,
|
|
355
|
-
data:
|
|
361
|
+
data: calldata,
|
|
356
362
|
gas,
|
|
357
363
|
gasPrice,
|
|
358
364
|
maxFeePerBlobGas,
|
|
@@ -220,6 +220,12 @@ export async function sendTransactionSync<
|
|
|
220
220
|
docsPath: '/docs/actions/wallet/sendTransactionSync',
|
|
221
221
|
})
|
|
222
222
|
const account = account_ ? parseAccount(account_) : null
|
|
223
|
+
const calldata = dataSuffix
|
|
224
|
+
? concat([
|
|
225
|
+
data ?? '0x',
|
|
226
|
+
dataSuffix.length % 2 ? `0x0${dataSuffix.slice(2)}` : dataSuffix,
|
|
227
|
+
])
|
|
228
|
+
: data
|
|
223
229
|
let nonceManagerParameters:
|
|
224
230
|
| { address: Address; chainId: number; nonce?: number | undefined }
|
|
225
231
|
| undefined
|
|
@@ -272,7 +278,7 @@ export async function sendTransactionSync<
|
|
|
272
278
|
authorizationList,
|
|
273
279
|
blobs,
|
|
274
280
|
chainId,
|
|
275
|
-
data:
|
|
281
|
+
data: calldata,
|
|
276
282
|
gas,
|
|
277
283
|
gasPrice,
|
|
278
284
|
maxFeePerBlobGas,
|
|
@@ -397,7 +403,7 @@ export async function sendTransactionSync<
|
|
|
397
403
|
authorizationList,
|
|
398
404
|
blobs,
|
|
399
405
|
chain,
|
|
400
|
-
data:
|
|
406
|
+
data: calldata,
|
|
401
407
|
gas,
|
|
402
408
|
gasPrice,
|
|
403
409
|
maxFeePerBlobGas,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js'
|
|
2
|
+
|
|
3
|
+
export const sevenChain = /*#__PURE__*/ defineChain({
|
|
4
|
+
id: 70007,
|
|
5
|
+
name: 'Seven Chain',
|
|
6
|
+
blockTime: 20_000,
|
|
7
|
+
nativeCurrency: {
|
|
8
|
+
decimals: 18,
|
|
9
|
+
name: 'Seven',
|
|
10
|
+
symbol: 'SEVEN',
|
|
11
|
+
},
|
|
12
|
+
rpcUrls: {
|
|
13
|
+
default: {
|
|
14
|
+
http: ['https://theseven.meme/api/seven-chain/jsonrpc'],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
blockExplorers: {
|
|
18
|
+
default: {
|
|
19
|
+
name: 'Seven Chain Explorer',
|
|
20
|
+
url: 'https://theseven.meme/blockchain/explorer',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
})
|
package/chains/index.ts
CHANGED
|
@@ -570,6 +570,7 @@ export { seiTestnet } from './definitions/seiTestnet.js'
|
|
|
570
570
|
export { sentrix } from './definitions/sentrix.js'
|
|
571
571
|
export { sentrixTestnet } from './definitions/sentrixTestnet.js'
|
|
572
572
|
export { sepolia } from './definitions/sepolia.js'
|
|
573
|
+
export { sevenChain } from './definitions/sevenChain.js'
|
|
573
574
|
export { shape } from './definitions/shape.js'
|
|
574
575
|
export { shapeSepolia } from './definitions/shapeSepolia.js'
|
|
575
576
|
export { shardeum } from './definitions/shardeum.js'
|
package/constants/abis.ts
CHANGED
|
@@ -1387,6 +1387,22 @@ export const erc721Abi = [
|
|
|
1387
1387
|
],
|
|
1388
1388
|
outputs: [],
|
|
1389
1389
|
},
|
|
1390
|
+
{
|
|
1391
|
+
type: 'function',
|
|
1392
|
+
name: 'supportsInterface',
|
|
1393
|
+
stateMutability: 'view',
|
|
1394
|
+
inputs: [
|
|
1395
|
+
{
|
|
1396
|
+
name: 'interfaceId',
|
|
1397
|
+
type: 'bytes4',
|
|
1398
|
+
},
|
|
1399
|
+
],
|
|
1400
|
+
outputs: [
|
|
1401
|
+
{
|
|
1402
|
+
type: 'bool',
|
|
1403
|
+
},
|
|
1404
|
+
],
|
|
1405
|
+
},
|
|
1390
1406
|
{
|
|
1391
1407
|
type: 'function',
|
|
1392
1408
|
name: 'symbol',
|
|
@@ -1416,7 +1432,7 @@ export const erc721Abi = [
|
|
|
1416
1432
|
},
|
|
1417
1433
|
{
|
|
1418
1434
|
type: 'function',
|
|
1419
|
-
name: '
|
|
1435
|
+
name: 'tokenOfOwnerByIndex',
|
|
1420
1436
|
stateMutability: 'view',
|
|
1421
1437
|
inputs: [
|
|
1422
1438
|
{
|
package/errors/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '2.58.
|
|
1
|
+
export const version = '2.58.6'
|
|
@@ -208,7 +208,14 @@ function formatRequest(
|
|
|
208
208
|
|
|
209
209
|
return {
|
|
210
210
|
account: account.address,
|
|
211
|
-
assetFilter: assets
|
|
211
|
+
assetFilter: assets
|
|
212
|
+
? Object.fromEntries(
|
|
213
|
+
Object.entries(assets).map(([chainId, filter]) => [
|
|
214
|
+
numberToHex(Number(chainId)),
|
|
215
|
+
filter,
|
|
216
|
+
]),
|
|
217
|
+
)
|
|
218
|
+
: undefined,
|
|
212
219
|
assetTypeFilter: assetTypes,
|
|
213
220
|
chainFilter: chainIds?.map((chainId) => numberToHex(chainId)),
|
|
214
221
|
}
|
package/package.json
CHANGED
|
@@ -150,7 +150,12 @@ export async function simulateBlocks<
|
|
|
150
150
|
...call,
|
|
151
151
|
account,
|
|
152
152
|
data: call.dataSuffix
|
|
153
|
-
? concat([
|
|
153
|
+
? concat([
|
|
154
|
+
data || '0x',
|
|
155
|
+
call.dataSuffix.length % 2
|
|
156
|
+
? `0x0${call.dataSuffix.slice(2)}`
|
|
157
|
+
: call.dataSuffix,
|
|
158
|
+
])
|
|
154
159
|
: data,
|
|
155
160
|
from: call.from ?? account?.address,
|
|
156
161
|
} as const
|
package/types/block.ts
CHANGED
|
@@ -46,6 +46,8 @@ export type Block<
|
|
|
46
46
|
parentHash: Hash
|
|
47
47
|
/** Root of the this block’s receipts trie */
|
|
48
48
|
receiptsRoot: Hex
|
|
49
|
+
/** Hash of the execution layer requests ([EIP-7685](https://eips.ethereum.org/EIPS/eip-7685)) */
|
|
50
|
+
requestsHash?: Hash | undefined
|
|
49
51
|
sealFields: Hex[]
|
|
50
52
|
/** SHA3 of the uncles data in this block */
|
|
51
53
|
sha3Uncles: Hash
|
package/types/eip1193.ts
CHANGED
package/types/fee.ts
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import type { OneOf } from './utils.js'
|
|
2
2
|
|
|
3
3
|
export type FeeHistory<quantity = bigint> = {
|
|
4
|
+
/**
|
|
5
|
+
* An array of block base fees per blob gas (in wei). This includes the next block after
|
|
6
|
+
* the newest of the returned range, because this value can be derived from the newest block.
|
|
7
|
+
* Zeroes are returned for pre-EIP-4844 blocks. */
|
|
8
|
+
baseFeePerBlobGas?: readonly quantity[] | undefined
|
|
4
9
|
/**
|
|
5
10
|
* An array of block base fees per gas (in wei). This includes the next block after
|
|
6
11
|
* the newest of the returned range, because this value can be derived from the newest block.
|
|
7
12
|
* Zeroes are returned for pre-EIP-1559 blocks. */
|
|
8
13
|
baseFeePerGas: quantity[]
|
|
14
|
+
/** An array of block blob gas used ratios. These are calculated as the ratio of blobGasUsed and the max blob gas per block. */
|
|
15
|
+
blobGasUsedRatio?: readonly number[] | undefined
|
|
9
16
|
/** An array of block gas used ratios. These are calculated as the ratio of gasUsed and gasLimit. */
|
|
10
17
|
gasUsedRatio: number[]
|
|
11
18
|
/** Lowest number block of the returned range. */
|
|
@@ -5,8 +5,13 @@ import type { RpcFeeHistory } from '../../types/rpc.js'
|
|
|
5
5
|
export type FormatFeeHistoryErrorType = ErrorType
|
|
6
6
|
|
|
7
7
|
export function formatFeeHistory(feeHistory: RpcFeeHistory): FeeHistory {
|
|
8
|
+
const { baseFeePerBlobGas, blobGasUsedRatio } = feeHistory
|
|
8
9
|
return {
|
|
10
|
+
...(baseFeePerBlobGas && {
|
|
11
|
+
baseFeePerBlobGas: baseFeePerBlobGas.map((value) => BigInt(value)),
|
|
12
|
+
}),
|
|
9
13
|
baseFeePerGas: feeHistory.baseFeePerGas.map((value) => BigInt(value)),
|
|
14
|
+
...(blobGasUsedRatio && { blobGasUsedRatio }),
|
|
10
15
|
gasUsedRatio: feeHistory.gasUsedRatio,
|
|
11
16
|
oldestBlock: BigInt(feeHistory.oldestBlock),
|
|
12
17
|
reward: feeHistory.reward?.map((reward) =>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Address } from 'abitype'
|
|
2
2
|
import { SignatureErc8010 } from 'ox/erc8010'
|
|
3
|
+
import * as Signature from 'ox/Signature'
|
|
3
4
|
import type { ErrorType } from '../../errors/utils.js'
|
|
4
5
|
import type { SignedAuthorization } from '../../types/authorization.js'
|
|
5
6
|
import type { ByteArray, Hex } from '../../types/misc.js'
|
|
@@ -42,7 +43,9 @@ export function serializeErc8010Signature<to extends To = 'hex'>(
|
|
|
42
43
|
nonce: BigInt(parameters.authorization.nonce),
|
|
43
44
|
r: BigInt(parameters.authorization.r),
|
|
44
45
|
s: BigInt(parameters.authorization.s),
|
|
45
|
-
yParity:
|
|
46
|
+
yParity:
|
|
47
|
+
parameters.authorization.yParity ??
|
|
48
|
+
Signature.vToYParity(Number(parameters.authorization.v)),
|
|
46
49
|
},
|
|
47
50
|
data,
|
|
48
51
|
signature,
|
|
@@ -19,7 +19,11 @@ export type ToPrefixedMessageErrorType =
|
|
|
19
19
|
export function toPrefixedMessage(message_: SignableMessage): Hex {
|
|
20
20
|
const message = (() => {
|
|
21
21
|
if (typeof message_ === 'string') return stringToHex(message_)
|
|
22
|
-
|
|
22
|
+
// Odd-length hex is left-padded to whole bytes, matching `hexToBytes`.
|
|
23
|
+
if (typeof message_.raw === 'string')
|
|
24
|
+
return message_.raw.length % 2
|
|
25
|
+
? (`0x0${message_.raw.slice(2)}` as Hex)
|
|
26
|
+
: message_.raw
|
|
23
27
|
return bytesToHex(message_.raw)
|
|
24
28
|
})()
|
|
25
29
|
const prefix = stringToHex(`${presignMessagePrefix}${size(message)}`)
|