viem 2.57.14 → 2.57.15
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 +44 -0
- package/_cjs/account-abstraction/utils/formatters/userOperationReceipt.js +2 -0
- package/_cjs/account-abstraction/utils/formatters/userOperationReceipt.js.map +1 -1
- package/_cjs/actions/public/estimateGas.js +5 -2
- package/_cjs/actions/public/estimateGas.js.map +1 -1
- package/_cjs/actions/public/fillTransaction.js +2 -0
- package/_cjs/actions/public/fillTransaction.js.map +1 -1
- package/_cjs/actions/public/getFilterChanges.js +1 -0
- package/_cjs/actions/public/getFilterChanges.js.map +1 -1
- package/_cjs/actions/public/getFilterLogs.js +1 -0
- package/_cjs/actions/public/getFilterLogs.js.map +1 -1
- package/_cjs/actions/public/watchBlockNumber.js +3 -1
- package/_cjs/actions/public/watchBlockNumber.js.map +1 -1
- package/_cjs/actions/public/watchBlocks.js +20 -8
- package/_cjs/actions/public/watchBlocks.js.map +1 -1
- package/_cjs/actions/public/watchContractEvent.js +10 -3
- package/_cjs/actions/public/watchContractEvent.js.map +1 -1
- package/_cjs/actions/public/watchEvent.js +5 -0
- package/_cjs/actions/public/watchEvent.js.map +1 -1
- package/_cjs/actions/wallet/prepareTransactionRequest.js +3 -2
- package/_cjs/actions/wallet/prepareTransactionRequest.js.map +1 -1
- package/_cjs/actions/wallet/sendTransaction.js +4 -2
- package/_cjs/actions/wallet/sendTransaction.js.map +1 -1
- package/_cjs/actions/wallet/sendTransactionSync.js +48 -7
- package/_cjs/actions/wallet/sendTransactionSync.js.map +1 -1
- package/_cjs/chains/definitions/hashKeyChain.js +4 -4
- package/_cjs/chains/definitions/hashKeyChain.js.map +1 -1
- package/_cjs/chains/definitions/hashkeyChainTestnet.js +4 -4
- package/_cjs/chains/definitions/hashkeyChainTestnet.js.map +1 -1
- package/_cjs/chains/definitions/turkchain.js +26 -0
- package/_cjs/chains/definitions/turkchain.js.map +1 -0
- package/_cjs/chains/definitions/zksync.js +1 -1
- package/_cjs/chains/definitions/zksync.js.map +1 -1
- package/_cjs/chains/index.js +4 -2
- package/_cjs/chains/index.js.map +1 -1
- package/_cjs/clients/createClient.js.map +1 -1
- package/_cjs/clients/transports/fallback.js +5 -0
- package/_cjs/clients/transports/fallback.js.map +1 -1
- package/_cjs/errors/node.js +10 -4
- package/_cjs/errors/node.js.map +1 -1
- package/_cjs/errors/typedData.js +4 -2
- package/_cjs/errors/typedData.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/index.js +5 -4
- package/_cjs/index.js.map +1 -1
- package/_cjs/tempo/Account.js +85 -12
- package/_cjs/tempo/Account.js.map +1 -1
- package/_cjs/tempo/Transaction.js +2 -1
- package/_cjs/tempo/Transaction.js.map +1 -1
- package/_cjs/tempo/chainConfig.js +4 -12
- package/_cjs/tempo/chainConfig.js.map +1 -1
- package/_cjs/tempo/internal/relay/feePayer.js +18 -5
- package/_cjs/tempo/internal/relay/feePayer.js.map +1 -1
- package/_cjs/utils/abi/decodeEventLog.js +57 -7
- package/_cjs/utils/abi/decodeEventLog.js.map +1 -1
- package/_cjs/utils/abi/getAbiItem.js +27 -6
- package/_cjs/utils/abi/getAbiItem.js.map +1 -1
- package/_cjs/utils/abi/parseEventLogs.js +27 -4
- package/_cjs/utils/abi/parseEventLogs.js.map +1 -1
- package/_cjs/utils/authorization/recoverAuthorizationAddress.js +9 -2
- package/_cjs/utils/authorization/recoverAuthorizationAddress.js.map +1 -1
- package/_cjs/utils/authorization/verifyAuthorization.js +14 -4
- package/_cjs/utils/authorization/verifyAuthorization.js.map +1 -1
- package/_cjs/utils/ccip.js +134 -28
- package/_cjs/utils/ccip.js.map +1 -1
- package/_cjs/utils/ccipTunnel.js +5 -1
- package/_cjs/utils/ccipTunnel.js.map +1 -1
- package/_cjs/utils/ens/localBatchGatewayRequest.js +55 -5
- package/_cjs/utils/ens/localBatchGatewayRequest.js.map +1 -1
- package/_cjs/utils/internal/http.js +79 -0
- package/_cjs/utils/internal/http.js.map +1 -0
- package/_cjs/utils/nonceManager.js.map +1 -1
- package/_cjs/utils/rpc/http.js +3 -73
- package/_cjs/utils/rpc/http.js.map +1 -1
- package/_cjs/utils/transaction/assertRequest.js +2 -2
- package/_cjs/utils/transaction/assertRequest.js.map +1 -1
- package/_cjs/utils/transaction/assertTransaction.js +2 -2
- package/_cjs/utils/transaction/assertTransaction.js.map +1 -1
- package/_cjs/utils/transaction/parseTransaction.js +21 -7
- package/_cjs/utils/transaction/parseTransaction.js.map +1 -1
- package/_cjs/utils/typedData.js +19 -6
- package/_cjs/utils/typedData.js.map +1 -1
- package/_esm/account-abstraction/utils/formatters/userOperationReceipt.js +2 -0
- package/_esm/account-abstraction/utils/formatters/userOperationReceipt.js.map +1 -1
- package/_esm/actions/public/estimateGas.js +10 -5
- package/_esm/actions/public/estimateGas.js.map +1 -1
- package/_esm/actions/public/fillTransaction.js +2 -0
- package/_esm/actions/public/fillTransaction.js.map +1 -1
- package/_esm/actions/public/getFilterChanges.js +1 -0
- package/_esm/actions/public/getFilterChanges.js.map +1 -1
- package/_esm/actions/public/getFilterLogs.js +1 -0
- package/_esm/actions/public/getFilterLogs.js.map +1 -1
- package/_esm/actions/public/watchBlockNumber.js +5 -1
- package/_esm/actions/public/watchBlockNumber.js.map +1 -1
- package/_esm/actions/public/watchBlocks.js +28 -8
- package/_esm/actions/public/watchBlocks.js.map +1 -1
- package/_esm/actions/public/watchContractEvent.js +15 -5
- package/_esm/actions/public/watchContractEvent.js.map +1 -1
- package/_esm/actions/public/watchEvent.js +11 -2
- package/_esm/actions/public/watchEvent.js.map +1 -1
- package/_esm/actions/wallet/prepareTransactionRequest.js +3 -2
- package/_esm/actions/wallet/prepareTransactionRequest.js.map +1 -1
- package/_esm/actions/wallet/sendTransaction.js +6 -2
- package/_esm/actions/wallet/sendTransaction.js.map +1 -1
- package/_esm/actions/wallet/sendTransactionSync.js +59 -8
- package/_esm/actions/wallet/sendTransactionSync.js.map +1 -1
- package/_esm/chains/definitions/hashKeyChain.js +4 -4
- package/_esm/chains/definitions/hashKeyChain.js.map +1 -1
- package/_esm/chains/definitions/hashkeyChainTestnet.js +4 -4
- package/_esm/chains/definitions/hashkeyChainTestnet.js.map +1 -1
- package/_esm/chains/definitions/turkchain.js +23 -0
- package/_esm/chains/definitions/turkchain.js.map +1 -0
- package/_esm/chains/definitions/zksync.js +1 -1
- package/_esm/chains/definitions/zksync.js.map +1 -1
- package/_esm/chains/index.js +1 -0
- package/_esm/chains/index.js.map +1 -1
- package/_esm/clients/createClient.js.map +1 -1
- package/_esm/clients/transports/fallback.js +8 -0
- package/_esm/clients/transports/fallback.js.map +1 -1
- package/_esm/errors/node.js +10 -4
- package/_esm/errors/node.js.map +1 -1
- package/_esm/errors/typedData.js +5 -2
- package/_esm/errors/typedData.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/index.js +1 -1
- package/_esm/index.js.map +1 -1
- package/_esm/tempo/Account.js +122 -11
- package/_esm/tempo/Account.js.map +1 -1
- package/_esm/tempo/Transaction.js +2 -0
- package/_esm/tempo/Transaction.js.map +1 -1
- package/_esm/tempo/chainConfig.js +13 -15
- package/_esm/tempo/chainConfig.js.map +1 -1
- package/_esm/tempo/internal/relay/feePayer.js +24 -7
- package/_esm/tempo/internal/relay/feePayer.js.map +1 -1
- package/_esm/utils/abi/decodeEventLog.js +69 -7
- package/_esm/utils/abi/decodeEventLog.js.map +1 -1
- package/_esm/utils/abi/getAbiItem.js +34 -6
- package/_esm/utils/abi/getAbiItem.js.map +1 -1
- package/_esm/utils/abi/parseEventLogs.js +43 -10
- package/_esm/utils/abi/parseEventLogs.js.map +1 -1
- package/_esm/utils/authorization/recoverAuthorizationAddress.js +11 -2
- package/_esm/utils/authorization/recoverAuthorizationAddress.js.map +1 -1
- package/_esm/utils/authorization/verifyAuthorization.js +15 -4
- package/_esm/utils/authorization/verifyAuthorization.js.map +1 -1
- package/_esm/utils/ccip.js +163 -31
- package/_esm/utils/ccip.js.map +1 -1
- package/_esm/utils/ccipTunnel.js +5 -1
- package/_esm/utils/ccipTunnel.js.map +1 -1
- package/_esm/utils/ens/localBatchGatewayRequest.js +69 -4
- package/_esm/utils/ens/localBatchGatewayRequest.js.map +1 -1
- package/_esm/utils/internal/http.js +83 -0
- package/_esm/utils/internal/http.js.map +1 -0
- package/_esm/utils/nonceManager.js.map +1 -1
- package/_esm/utils/rpc/http.js +1 -75
- package/_esm/utils/rpc/http.js.map +1 -1
- package/_esm/utils/transaction/assertRequest.js +2 -2
- package/_esm/utils/transaction/assertRequest.js.map +1 -1
- package/_esm/utils/transaction/assertTransaction.js +2 -2
- package/_esm/utils/transaction/assertTransaction.js.map +1 -1
- package/_esm/utils/transaction/parseTransaction.js +24 -7
- package/_esm/utils/transaction/parseTransaction.js.map +1 -1
- package/_esm/utils/typedData.js +25 -8
- package/_esm/utils/typedData.js.map +1 -1
- package/_types/account-abstraction/utils/formatters/userOperationReceipt.d.ts.map +1 -1
- package/_types/actions/public/estimateGas.d.ts.map +1 -1
- package/_types/actions/public/fillTransaction.d.ts.map +1 -1
- package/_types/actions/public/getFilterChanges.d.ts.map +1 -1
- package/_types/actions/public/getFilterLogs.d.ts.map +1 -1
- package/_types/actions/public/watchBlockNumber.d.ts +6 -2
- package/_types/actions/public/watchBlockNumber.d.ts.map +1 -1
- package/_types/actions/public/watchBlocks.d.ts +7 -2
- package/_types/actions/public/watchBlocks.d.ts.map +1 -1
- package/_types/actions/public/watchContractEvent.d.ts.map +1 -1
- package/_types/actions/public/watchEvent.d.ts.map +1 -1
- package/_types/actions/wallet/prepareTransactionRequest.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/hashKeyChain.d.ts +4 -4
- package/_types/chains/definitions/hashkeyChainTestnet.d.ts +4 -4
- package/_types/chains/definitions/turkchain.d.ts +53 -0
- package/_types/chains/definitions/turkchain.d.ts.map +1 -0
- package/_types/chains/definitions/zksync.d.ts +1 -1
- package/_types/chains/index.d.ts +1 -0
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/clients/createClient.d.ts +6 -0
- package/_types/clients/createClient.d.ts.map +1 -1
- package/_types/clients/transports/fallback.d.ts.map +1 -1
- package/_types/errors/node.d.ts.map +1 -1
- package/_types/errors/typedData.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/index.d.ts +1 -1
- package/_types/index.d.ts.map +1 -1
- package/_types/tempo/Account.d.ts +77 -4
- package/_types/tempo/Account.d.ts.map +1 -1
- package/_types/tempo/Relay.d.ts +1 -1
- package/_types/tempo/Relay.d.ts.map +1 -1
- package/_types/tempo/Transaction.d.ts +2 -0
- package/_types/tempo/Transaction.d.ts.map +1 -1
- package/_types/tempo/chainConfig.d.ts.map +1 -1
- package/_types/tempo/internal/relay/feePayer.d.ts.map +1 -1
- package/_types/tempo/internal/relay/utils.d.ts +8 -8
- package/_types/utils/abi/decodeEventLog.d.ts +13 -1
- package/_types/utils/abi/decodeEventLog.d.ts.map +1 -1
- package/_types/utils/abi/getAbiItem.d.ts.map +1 -1
- package/_types/utils/abi/parseEventLogs.d.ts.map +1 -1
- package/_types/utils/authorization/recoverAuthorizationAddress.d.ts +2 -1
- package/_types/utils/authorization/recoverAuthorizationAddress.d.ts.map +1 -1
- package/_types/utils/authorization/verifyAuthorization.d.ts.map +1 -1
- package/_types/utils/ccip.d.ts +24 -4
- package/_types/utils/ccip.d.ts.map +1 -1
- package/_types/utils/ccipTunnel.d.ts.map +1 -1
- package/_types/utils/ens/localBatchGatewayRequest.d.ts +26 -0
- package/_types/utils/ens/localBatchGatewayRequest.d.ts.map +1 -1
- package/_types/utils/internal/http.d.ts +16 -0
- package/_types/utils/internal/http.d.ts.map +1 -0
- package/_types/utils/nonceManager.d.ts +15 -1
- package/_types/utils/nonceManager.d.ts.map +1 -1
- package/_types/utils/rpc/http.d.ts.map +1 -1
- package/_types/utils/transaction/parseTransaction.d.ts.map +1 -1
- package/_types/utils/typedData.d.ts.map +1 -1
- package/account-abstraction/utils/formatters/userOperationReceipt.ts +1 -0
- package/actions/public/estimateGas.ts +12 -5
- package/actions/public/fillTransaction.ts +2 -0
- package/actions/public/getFilterChanges.ts +1 -0
- package/actions/public/getFilterLogs.ts +1 -0
- package/actions/public/watchBlockNumber.ts +11 -2
- package/actions/public/watchBlocks.ts +46 -14
- package/actions/public/watchContractEvent.ts +22 -4
- package/actions/public/watchEvent.ts +17 -1
- package/actions/wallet/prepareTransactionRequest.ts +6 -2
- package/actions/wallet/sendTransaction.ts +9 -3
- package/actions/wallet/sendTransactionSync.ts +74 -12
- package/chains/definitions/hashKeyChain.ts +4 -4
- package/chains/definitions/hashkeyChainTestnet.ts +4 -4
- package/chains/definitions/turkchain.ts +23 -0
- package/chains/definitions/zksync.ts +1 -1
- package/chains/index.ts +1 -0
- package/clients/createClient.ts +6 -0
- package/clients/transports/fallback.ts +11 -0
- package/errors/node.ts +11 -5
- package/errors/typedData.ts +5 -2
- package/errors/version.ts +1 -1
- package/index.ts +2 -0
- package/package.json +1 -1
- package/tempo/Account.ts +202 -16
- package/tempo/Relay.ts +1 -1
- package/tempo/Transaction.ts +3 -0
- package/tempo/chainConfig.ts +13 -15
- package/tempo/internal/relay/feePayer.ts +30 -7
- package/utils/abi/decodeEventLog.ts +97 -10
- package/utils/abi/getAbiItem.ts +35 -5
- package/utils/abi/parseEventLogs.ts +48 -11
- package/utils/authorization/recoverAuthorizationAddress.ts +18 -2
- package/utils/authorization/verifyAuthorization.ts +12 -7
- package/utils/ccip.ts +199 -33
- package/utils/ccipTunnel.ts +5 -1
- package/utils/ens/localBatchGatewayRequest.ts +82 -4
- package/utils/internal/http.ts +92 -0
- package/utils/nonceManager.ts +16 -1
- package/utils/rpc/http.ts +1 -83
- package/utils/transaction/assertRequest.ts +2 -2
- package/utils/transaction/assertTransaction.ts +2 -2
- package/utils/transaction/parseTransaction.ts +32 -7
- package/utils/typedData.ts +31 -8
|
@@ -191,7 +191,9 @@ export async function sendTransaction<
|
|
|
191
191
|
docsPath: '/docs/actions/wallet/sendTransaction',
|
|
192
192
|
})
|
|
193
193
|
const account = account_ ? parseAccount(account_) : null
|
|
194
|
-
let nonceManagerParameters:
|
|
194
|
+
let nonceManagerParameters:
|
|
195
|
+
| { address: Address; chainId: number; nonce?: number | undefined }
|
|
196
|
+
| undefined
|
|
195
197
|
|
|
196
198
|
try {
|
|
197
199
|
assertRequest(parameters as AssertRequestParameters)
|
|
@@ -316,12 +318,16 @@ export async function sendTransaction<
|
|
|
316
318
|
return account.nonceManager
|
|
317
319
|
const nonceManager = account.nonceManager
|
|
318
320
|
return {
|
|
319
|
-
consume(parameters) {
|
|
321
|
+
async consume(parameters) {
|
|
320
322
|
nonceManagerParameters = {
|
|
321
323
|
address: parameters.address,
|
|
322
324
|
chainId: parameters.chainId,
|
|
323
325
|
}
|
|
324
|
-
|
|
326
|
+
const nonce = await nonceManager.consume(parameters)
|
|
327
|
+
// Pass the consumed nonce to `reset` so the manager can tell
|
|
328
|
+
// which `consume` a failed send follows.
|
|
329
|
+
nonceManagerParameters = { ...nonceManagerParameters, nonce }
|
|
330
|
+
return nonce
|
|
325
331
|
},
|
|
326
332
|
get(parameters) {
|
|
327
333
|
return nonceManager.get(parameters)
|
|
@@ -18,6 +18,7 @@ import { BaseError } from '../../errors/base.js'
|
|
|
18
18
|
import {
|
|
19
19
|
TransactionReceiptRevertedError,
|
|
20
20
|
type TransactionReceiptRevertedErrorType,
|
|
21
|
+
WaitForTransactionReceiptTimeoutError,
|
|
21
22
|
} from '../../errors/transaction.js'
|
|
22
23
|
import type { ErrorType } from '../../errors/utils.js'
|
|
23
24
|
import type { GetAccountParameter } from '../../types/account.js'
|
|
@@ -40,6 +41,9 @@ import {
|
|
|
40
41
|
assertCurrentChain,
|
|
41
42
|
} from '../../utils/chain/assertCurrentChain.js'
|
|
42
43
|
import { concat } from '../../utils/data/concat.js'
|
|
44
|
+
import { sliceHex } from '../../utils/data/slice.js'
|
|
45
|
+
import { fromRlp } from '../../utils/encoding/fromRlp.js'
|
|
46
|
+
import { toRlp } from '../../utils/encoding/toRlp.js'
|
|
43
47
|
import {
|
|
44
48
|
type GetTransactionErrorReturnType,
|
|
45
49
|
getTransactionError,
|
|
@@ -50,6 +54,8 @@ import {
|
|
|
50
54
|
formatTransactionRequest,
|
|
51
55
|
} from '../../utils/formatters/transactionRequest.js'
|
|
52
56
|
import { getAction } from '../../utils/getAction.js'
|
|
57
|
+
import { isHash } from '../../utils/hash/isHash.js'
|
|
58
|
+
import { keccak256 } from '../../utils/hash/keccak256.js'
|
|
53
59
|
import { LruMap } from '../../utils/lru.js'
|
|
54
60
|
import type { NonceManager } from '../../utils/nonceManager.js'
|
|
55
61
|
import {
|
|
@@ -214,7 +220,9 @@ export async function sendTransactionSync<
|
|
|
214
220
|
docsPath: '/docs/actions/wallet/sendTransactionSync',
|
|
215
221
|
})
|
|
216
222
|
const account = account_ ? parseAccount(account_) : null
|
|
217
|
-
let nonceManagerParameters:
|
|
223
|
+
let nonceManagerParameters:
|
|
224
|
+
| { address: Address; chainId: number; nonce?: number | undefined }
|
|
225
|
+
| undefined
|
|
218
226
|
|
|
219
227
|
try {
|
|
220
228
|
assertRequest(parameters as AssertRequestParameters)
|
|
@@ -355,12 +363,16 @@ export async function sendTransactionSync<
|
|
|
355
363
|
return account.nonceManager
|
|
356
364
|
const nonceManager = account.nonceManager
|
|
357
365
|
return {
|
|
358
|
-
consume(parameters) {
|
|
366
|
+
async consume(parameters) {
|
|
359
367
|
nonceManagerParameters = {
|
|
360
368
|
address: parameters.address,
|
|
361
369
|
chainId: parameters.chainId,
|
|
362
370
|
}
|
|
363
|
-
|
|
371
|
+
const nonce = await nonceManager.consume(parameters)
|
|
372
|
+
// Pass the consumed nonce to `reset` so the manager can tell
|
|
373
|
+
// which `consume` a failed send follows.
|
|
374
|
+
nonceManagerParameters = { ...nonceManagerParameters, nonce }
|
|
375
|
+
return nonce
|
|
364
376
|
},
|
|
365
377
|
get(parameters) {
|
|
366
378
|
return nonceManager.get(parameters)
|
|
@@ -415,15 +427,65 @@ export async function sendTransactionSync<
|
|
|
415
427
|
transaction: request as never,
|
|
416
428
|
})
|
|
417
429
|
: signedTransaction
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
430
|
+
const start = Date.now()
|
|
431
|
+
try {
|
|
432
|
+
return (await getAction(
|
|
433
|
+
client,
|
|
434
|
+
sendRawTransactionSync,
|
|
435
|
+
'sendRawTransactionSync',
|
|
436
|
+
)({
|
|
437
|
+
serializedTransaction,
|
|
438
|
+
throwOnReceiptRevert,
|
|
439
|
+
timeout: parameters.timeout,
|
|
440
|
+
})) as never
|
|
441
|
+
} catch (err) {
|
|
442
|
+
// The node accepted the transaction but stopped waiting for its
|
|
443
|
+
// receipt (EIP-7966).
|
|
444
|
+
const timeoutError =
|
|
445
|
+
err instanceof BaseError
|
|
446
|
+
? (err.walk((e) => (e as { code?: unknown } | null)?.code === 4) as
|
|
447
|
+
| (Error & { data?: unknown })
|
|
448
|
+
| null)
|
|
449
|
+
: null
|
|
450
|
+
if (!timeoutError) throw err
|
|
451
|
+
|
|
452
|
+
// The pending transaction holds the nonce, so keep it.
|
|
453
|
+
nonceManagerParameters = undefined
|
|
454
|
+
|
|
455
|
+
// Prefer the node's hash, since a relay (such as a fee payer) can
|
|
456
|
+
// change the bytes it broadcasts. Without one, derive it locally.
|
|
457
|
+
const hash = (() => {
|
|
458
|
+
const { data } = timeoutError
|
|
459
|
+
if (typeof data === 'string' && isHash(data)) return data
|
|
460
|
+
// An EIP-4844 network wrapper holds the signed payload, then the
|
|
461
|
+
// blobs, commitments, and proofs. The hash covers only the payload.
|
|
462
|
+
if (sliceHex(serializedTransaction, 0, 1) === '0x03') {
|
|
463
|
+
const fields = fromRlp(sliceHex(serializedTransaction, 1))
|
|
464
|
+
if (fields.length === 4 && Array.isArray(fields[0]))
|
|
465
|
+
return keccak256(concat(['0x03', toRlp(fields[0])]))
|
|
466
|
+
}
|
|
467
|
+
return keccak256(serializedTransaction)
|
|
468
|
+
})()
|
|
469
|
+
|
|
470
|
+
const remaining = timeout - (Date.now() - start)
|
|
471
|
+
// The node used up `timeout` before it answered.
|
|
472
|
+
if (remaining <= 0)
|
|
473
|
+
throw new WaitForTransactionReceiptTimeoutError({ hash })
|
|
474
|
+
|
|
475
|
+
const receipt = await getAction(
|
|
476
|
+
client,
|
|
477
|
+
waitForTransactionReceipt,
|
|
478
|
+
'waitForTransactionReceipt',
|
|
479
|
+
)({
|
|
480
|
+
checkReplacement: false,
|
|
481
|
+
hash,
|
|
482
|
+
pollingInterval,
|
|
483
|
+
timeout: remaining,
|
|
484
|
+
})
|
|
485
|
+
if (throwOnReceiptRevert && receipt.status === 'reverted')
|
|
486
|
+
throw new TransactionReceiptRevertedError({ receipt })
|
|
487
|
+
return receipt as never
|
|
488
|
+
}
|
|
427
489
|
}
|
|
428
490
|
|
|
429
491
|
if (account?.type === 'smart')
|
|
@@ -2,10 +2,10 @@ import { defineChain } from '../../utils/chain/defineChain.js'
|
|
|
2
2
|
|
|
3
3
|
export const hashkey = /*#__PURE__*/ defineChain({
|
|
4
4
|
id: 177,
|
|
5
|
-
name: '
|
|
5
|
+
name: 'HSKChain',
|
|
6
6
|
nativeCurrency: {
|
|
7
7
|
decimals: 18,
|
|
8
|
-
name: 'HashKey
|
|
8
|
+
name: 'HashKey Platform Token',
|
|
9
9
|
symbol: 'HSK',
|
|
10
10
|
},
|
|
11
11
|
rpcUrls: {
|
|
@@ -15,8 +15,8 @@ export const hashkey = /*#__PURE__*/ defineChain({
|
|
|
15
15
|
},
|
|
16
16
|
blockExplorers: {
|
|
17
17
|
default: {
|
|
18
|
-
name: '
|
|
19
|
-
url: 'https://
|
|
18
|
+
name: 'HSKChain Explorer',
|
|
19
|
+
url: 'https://hsk.blockscout.com',
|
|
20
20
|
},
|
|
21
21
|
},
|
|
22
22
|
contracts: {
|
|
@@ -2,10 +2,10 @@ import { defineChain } from '../../utils/chain/defineChain.js'
|
|
|
2
2
|
|
|
3
3
|
export const hashkeyTestnet = /*#__PURE__*/ defineChain({
|
|
4
4
|
id: 133,
|
|
5
|
-
name: '
|
|
5
|
+
name: 'HSKChain Testnet',
|
|
6
6
|
nativeCurrency: {
|
|
7
7
|
decimals: 18,
|
|
8
|
-
name: 'HashKey
|
|
8
|
+
name: 'HashKey Platform Token',
|
|
9
9
|
symbol: 'HSK',
|
|
10
10
|
},
|
|
11
11
|
rpcUrls: {
|
|
@@ -15,8 +15,8 @@ export const hashkeyTestnet = /*#__PURE__*/ defineChain({
|
|
|
15
15
|
},
|
|
16
16
|
blockExplorers: {
|
|
17
17
|
default: {
|
|
18
|
-
name: '
|
|
19
|
-
url: 'https://testnet-explorer.
|
|
18
|
+
name: 'HSKChain Testnet explorer',
|
|
19
|
+
url: 'https://testnet-explorer.hskchain.net',
|
|
20
20
|
},
|
|
21
21
|
},
|
|
22
22
|
testnet: true,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js'
|
|
2
|
+
|
|
3
|
+
export const turkchain = /*#__PURE__*/ defineChain({
|
|
4
|
+
id: 1919,
|
|
5
|
+
name: 'Turkchain',
|
|
6
|
+
nativeCurrency: {
|
|
7
|
+
decimals: 18,
|
|
8
|
+
name: 'TC',
|
|
9
|
+
symbol: 'TURK',
|
|
10
|
+
},
|
|
11
|
+
rpcUrls: {
|
|
12
|
+
default: {
|
|
13
|
+
http: ['https://rpc.turkscan.com'],
|
|
14
|
+
webSocket: ['wss://evm-ws.turkscan.com'],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
blockExplorers: {
|
|
18
|
+
default: {
|
|
19
|
+
name: 'TurkScan',
|
|
20
|
+
url: 'https://turkscan.com',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
})
|
|
@@ -21,7 +21,7 @@ export const zksync = /*#__PURE__*/ defineChain({
|
|
|
21
21
|
blockExplorers: {
|
|
22
22
|
default: {
|
|
23
23
|
name: 'ZKsync Explorer',
|
|
24
|
-
url: 'https://explorer.zksync.io
|
|
24
|
+
url: 'https://explorer.zksync.io',
|
|
25
25
|
apiUrl: 'https://block-explorer-api.mainnet.zksync.io/api',
|
|
26
26
|
},
|
|
27
27
|
},
|
package/chains/index.ts
CHANGED
|
@@ -689,6 +689,7 @@ export { treasureTopaz } from './definitions/treasureTopaz.js'
|
|
|
689
689
|
export { tron } from './definitions/tron.js'
|
|
690
690
|
export { tronNile } from './definitions/tronNile.js'
|
|
691
691
|
export { tronShasta } from './definitions/tronShasta.js'
|
|
692
|
+
export { turkchain } from './definitions/turkchain.js'
|
|
692
693
|
export { ubiq } from './definitions/ubiq.js'
|
|
693
694
|
export { ultra } from './definitions/ultra.js'
|
|
694
695
|
export { ultraTestnet } from './definitions/ultraTestnet.js'
|
package/clients/createClient.ts
CHANGED
|
@@ -62,6 +62,12 @@ export type ClientConfig<
|
|
|
62
62
|
/**
|
|
63
63
|
* [CCIP Read](https://eips.ethereum.org/EIPS/eip-3668) configuration.
|
|
64
64
|
* If `false`, the client will not support offchain CCIP lookups.
|
|
65
|
+
*
|
|
66
|
+
* Gateway URLs must be HTTP(S). A lookup follows at most 4 nested callbacks
|
|
67
|
+
* and 4 nested local batches, and makes at most 256 gateway requests to
|
|
68
|
+
* contract-chosen URLs, 16 at a time. Each gateway request, including the
|
|
69
|
+
* response body, uses the transport timeout (default 10 seconds; the longest
|
|
70
|
+
* of a `fallback`'s transports) and reads at most 10 MiB.
|
|
65
71
|
*/
|
|
66
72
|
ccipRead?:
|
|
67
73
|
| {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BaseError } from '../../errors/base.js'
|
|
1
2
|
import { ExecutionRevertedError } from '../../errors/node.js'
|
|
2
3
|
import {
|
|
3
4
|
TransactionRejectedRpcError,
|
|
@@ -164,6 +165,16 @@ export function fallback<const transports extends readonly Transport[]>(
|
|
|
164
165
|
|
|
165
166
|
if (shouldThrow_(err as Error)) throw err
|
|
166
167
|
|
|
168
|
+
// The node accepted the transaction but stopped waiting for its
|
|
169
|
+
// receipt (EIP-7966), so do not send it to the next one. Custom
|
|
170
|
+
// transports wrap the provider's error, so check the causes too.
|
|
171
|
+
if (
|
|
172
|
+
method === 'eth_sendRawTransactionSync' &&
|
|
173
|
+
err instanceof BaseError &&
|
|
174
|
+
err.walk((e) => (e as { code?: unknown } | null)?.code === 4)
|
|
175
|
+
)
|
|
176
|
+
throw err
|
|
177
|
+
|
|
167
178
|
// If we've reached the end of the fallbacks, throw the error.
|
|
168
179
|
if (i === transports.length - 1) throw err
|
|
169
180
|
|
package/errors/node.ts
CHANGED
|
@@ -53,7 +53,9 @@ export class FeeCapTooHighError extends BaseError {
|
|
|
53
53
|
} = {}) {
|
|
54
54
|
super(
|
|
55
55
|
`The fee cap (\`maxFeePerGas\`${
|
|
56
|
-
|
|
56
|
+
typeof maxFeePerGas === 'bigint'
|
|
57
|
+
? ` = ${formatGwei(maxFeePerGas)} gwei`
|
|
58
|
+
: ''
|
|
57
59
|
}) cannot be higher than the maximum allowed value (2^256-1).`,
|
|
58
60
|
{
|
|
59
61
|
cause,
|
|
@@ -78,8 +80,10 @@ export class FeeCapTooLowError extends BaseError {
|
|
|
78
80
|
} = {}) {
|
|
79
81
|
super(
|
|
80
82
|
`The fee cap (\`maxFeePerGas\`${
|
|
81
|
-
|
|
82
|
-
|
|
83
|
+
typeof maxFeePerGas === 'bigint'
|
|
84
|
+
? ` = ${formatGwei(maxFeePerGas)} gwei`
|
|
85
|
+
: ''
|
|
86
|
+
}) cannot be lower than the block base fee.`,
|
|
83
87
|
{
|
|
84
88
|
cause,
|
|
85
89
|
name: 'FeeCapTooLowError',
|
|
@@ -249,11 +253,13 @@ export class TipAboveFeeCapError extends BaseError {
|
|
|
249
253
|
super(
|
|
250
254
|
[
|
|
251
255
|
`The provided tip (\`maxPriorityFeePerGas\`${
|
|
252
|
-
maxPriorityFeePerGas
|
|
256
|
+
typeof maxPriorityFeePerGas === 'bigint'
|
|
253
257
|
? ` = ${formatGwei(maxPriorityFeePerGas)} gwei`
|
|
254
258
|
: ''
|
|
255
259
|
}) cannot be higher than the fee cap (\`maxFeePerGas\`${
|
|
256
|
-
|
|
260
|
+
typeof maxFeePerGas === 'bigint'
|
|
261
|
+
? ` = ${formatGwei(maxFeePerGas)} gwei`
|
|
262
|
+
: ''
|
|
257
263
|
}).`,
|
|
258
264
|
].join('\n'),
|
|
259
265
|
{
|
package/errors/typedData.ts
CHANGED
|
@@ -51,9 +51,12 @@ export type InvalidTypedDataTypeErrorType = InvalidTypedDataTypeError & {
|
|
|
51
51
|
}
|
|
52
52
|
export class InvalidTypedDataTypeError extends BaseError {
|
|
53
53
|
constructor({ type }: { type: string }) {
|
|
54
|
-
|
|
54
|
+
// Suggest the canonical type only for the `int`/`uint` aliases.
|
|
55
|
+
const isAlias = /^u?int(\[[0-9]*\])*$/.test(type)
|
|
55
56
|
super(`Type "${type}" is not a valid EIP-712 type.`, {
|
|
56
|
-
metaMessages:
|
|
57
|
+
metaMessages: isAlias
|
|
58
|
+
? [`Use "${type.replace(/^(u?int)/, '$&256')}" instead.`]
|
|
59
|
+
: undefined,
|
|
57
60
|
name: 'InvalidTypedDataTypeError',
|
|
58
61
|
})
|
|
59
62
|
}
|
package/errors/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '2.57.
|
|
1
|
+
export const version = '2.57.15'
|
package/index.ts
CHANGED
|
@@ -1350,6 +1350,8 @@ export {
|
|
|
1350
1350
|
decodeErrorResult,
|
|
1351
1351
|
} from './utils/abi/decodeErrorResult.js'
|
|
1352
1352
|
export {
|
|
1353
|
+
AbiEventAmbiguityError,
|
|
1354
|
+
type AbiEventAmbiguityErrorType,
|
|
1353
1355
|
type DecodeEventLogErrorType,
|
|
1354
1356
|
type DecodeEventLogParameters,
|
|
1355
1357
|
type DecodeEventLogReturnType,
|