viem 2.57.4 → 2.57.5
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 +26 -0
- package/_cjs/actions/public/waitForTransactionReceipt.js +5 -2
- package/_cjs/actions/public/waitForTransactionReceipt.js.map +1 -1
- package/_cjs/actions/wallet/waitForCallsStatus.js +25 -2
- package/_cjs/actions/wallet/waitForCallsStatus.js.map +1 -1
- package/_cjs/chains/definitions/arcTestnet.js +11 -8
- package/_cjs/chains/definitions/arcTestnet.js.map +1 -1
- package/_cjs/chains/definitions/qmsTestnet.js +30 -0
- package/_cjs/chains/definitions/qmsTestnet.js.map +1 -0
- package/_cjs/chains/definitions/tempo.js +1 -1
- package/_cjs/chains/definitions/tempoModerato.js +2 -2
- package/_cjs/chains/index.js +7 -5
- package/_cjs/chains/index.js.map +1 -1
- package/_cjs/clients/transports/ipc.js +19 -10
- package/_cjs/clients/transports/ipc.js.map +1 -1
- package/_cjs/clients/transports/webSocket.js +19 -10
- package/_cjs/clients/transports/webSocket.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/tempo/Account.js +40 -40
- package/_cjs/tempo/Account.js.map +1 -1
- package/_cjs/tempo/Decorator.js +9 -8
- package/_cjs/tempo/Decorator.js.map +1 -1
- package/_cjs/tempo/ExecutionError.js +1 -1
- package/_cjs/tempo/ExecutionError.js.map +1 -1
- package/_cjs/tempo/Formatters.js +8 -7
- package/_cjs/tempo/Formatters.js.map +1 -1
- package/_cjs/tempo/KeyAuthorizationManager.js +25 -16
- package/_cjs/tempo/KeyAuthorizationManager.js.map +1 -1
- package/_cjs/tempo/Relay.js +9 -4
- package/_cjs/tempo/Relay.js.map +1 -1
- package/_cjs/tempo/Transaction.js +9 -9
- package/_cjs/tempo/Transaction.js.map +1 -1
- package/_cjs/tempo/Transport.js +21 -11
- package/_cjs/tempo/Transport.js.map +1 -1
- package/_cjs/tempo/{multisig → accounts}/Config.js +8 -8
- package/_cjs/tempo/{multisig → accounts}/Config.js.map +1 -1
- package/_cjs/tempo/{multisig → accounts}/Operation.js +10 -10
- package/_cjs/tempo/{multisig → accounts}/Operation.js.map +1 -1
- package/_cjs/tempo/{multisig → accounts}/Signature.js +2 -2
- package/_cjs/tempo/accounts/Signature.js.map +1 -0
- package/_cjs/tempo/actions/accessKey.js +60 -37
- package/_cjs/tempo/actions/accessKey.js.map +1 -1
- package/_cjs/tempo/actions/{multisig.js → accounts.js} +13 -18
- package/_cjs/tempo/actions/accounts.js.map +1 -0
- package/_cjs/tempo/actions/index.js +2 -2
- package/_cjs/tempo/actions/index.js.map +1 -1
- package/_cjs/tempo/chainConfig.js +37 -37
- package/_cjs/tempo/chainConfig.js.map +1 -1
- package/_cjs/tempo/index.js +3 -3
- package/_cjs/tempo/index.js.map +1 -1
- package/_cjs/tempo/internal/relay/{multisig.js → accounts.js} +90 -93
- package/_cjs/tempo/internal/relay/accounts.js.map +1 -0
- package/_cjs/tempo/internal/relay/keyAuthorization.js +296 -0
- package/_cjs/tempo/internal/relay/keyAuthorization.js.map +1 -0
- package/_cjs/tempo/internal/relay/plugin.js +17 -7
- package/_cjs/tempo/internal/relay/plugin.js.map +1 -1
- package/_cjs/utils/hash/normalizeSignature.js +1 -1
- package/_cjs/utils/hash/normalizeSignature.js.map +1 -1
- package/_cjs/utils/rpc/http.js +66 -31
- package/_cjs/utils/rpc/http.js.map +1 -1
- package/_cjs/utils/rpc/socket.js +1 -1
- package/_cjs/utils/rpc/socket.js.map +1 -1
- package/_esm/actions/public/waitForTransactionReceipt.js +5 -2
- package/_esm/actions/public/waitForTransactionReceipt.js.map +1 -1
- package/_esm/actions/wallet/waitForCallsStatus.js +39 -2
- package/_esm/actions/wallet/waitForCallsStatus.js.map +1 -1
- package/_esm/chains/definitions/arcTestnet.js +11 -8
- package/_esm/chains/definitions/arcTestnet.js.map +1 -1
- package/_esm/chains/definitions/qmsTestnet.js +27 -0
- package/_esm/chains/definitions/qmsTestnet.js.map +1 -0
- package/_esm/chains/definitions/tempo.js +1 -1
- package/_esm/chains/definitions/tempoModerato.js +2 -2
- package/_esm/chains/index.js +1 -0
- package/_esm/chains/index.js.map +1 -1
- package/_esm/clients/transports/ipc.js +21 -10
- package/_esm/clients/transports/ipc.js.map +1 -1
- package/_esm/clients/transports/webSocket.js +21 -10
- package/_esm/clients/transports/webSocket.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/tempo/Account.js +42 -42
- package/_esm/tempo/Account.js.map +1 -1
- package/_esm/tempo/Client.js +3 -3
- package/_esm/tempo/Decorator.js +9 -8
- package/_esm/tempo/Decorator.js.map +1 -1
- package/_esm/tempo/ExecutionError.js +1 -1
- package/_esm/tempo/ExecutionError.js.map +1 -1
- package/_esm/tempo/Formatters.js +11 -10
- package/_esm/tempo/Formatters.js.map +1 -1
- package/_esm/tempo/KeyAuthorizationManager.js +58 -16
- package/_esm/tempo/KeyAuthorizationManager.js.map +1 -1
- package/_esm/tempo/Relay.js +49 -8
- package/_esm/tempo/Relay.js.map +1 -1
- package/_esm/tempo/Transaction.js +11 -11
- package/_esm/tempo/Transaction.js.map +1 -1
- package/_esm/tempo/Transport.js +22 -12
- package/_esm/tempo/Transport.js.map +1 -1
- package/_esm/tempo/{multisig → accounts}/Config.js +14 -14
- package/_esm/tempo/{multisig → accounts}/Config.js.map +1 -1
- package/_esm/tempo/{multisig → accounts}/Operation.js +17 -17
- package/_esm/tempo/{multisig → accounts}/Operation.js.map +1 -1
- package/_esm/tempo/accounts/Signature.js +9 -0
- package/_esm/tempo/accounts/Signature.js.map +1 -0
- package/_esm/tempo/actions/accessKey.js +93 -38
- package/_esm/tempo/actions/accessKey.js.map +1 -1
- package/_esm/tempo/actions/{multisig.js → accounts.js} +31 -36
- package/_esm/tempo/actions/accounts.js.map +1 -0
- package/_esm/tempo/actions/index.js +1 -1
- package/_esm/tempo/actions/index.js.map +1 -1
- package/_esm/tempo/chainConfig.js +38 -38
- package/_esm/tempo/chainConfig.js.map +1 -1
- package/_esm/tempo/index.js +2 -1
- package/_esm/tempo/index.js.map +1 -1
- package/_esm/tempo/internal/relay/{multisig.js → accounts.js} +93 -98
- package/_esm/tempo/internal/relay/accounts.js.map +1 -0
- package/_esm/tempo/internal/relay/feePayer.js +1 -1
- package/_esm/tempo/internal/relay/feePayer.js.map +1 -1
- package/_esm/tempo/internal/relay/keyAuthorization.js +334 -0
- package/_esm/tempo/internal/relay/keyAuthorization.js.map +1 -0
- package/_esm/tempo/internal/relay/plugin.js +15 -6
- package/_esm/tempo/internal/relay/plugin.js.map +1 -1
- package/_esm/utils/hash/normalizeSignature.js +3 -2
- package/_esm/utils/hash/normalizeSignature.js.map +1 -1
- package/_esm/utils/rpc/http.js +74 -31
- package/_esm/utils/rpc/http.js.map +1 -1
- package/_esm/utils/rpc/socket.js +3 -1
- package/_esm/utils/rpc/socket.js.map +1 -1
- package/_types/actions/public/waitForTransactionReceipt.d.ts.map +1 -1
- package/_types/actions/wallet/waitForCallsStatus.d.ts.map +1 -1
- package/_types/chains/definitions/arcTestnet.d.ts +5 -5
- package/_types/chains/definitions/arcTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/qmsTestnet.d.ts +50 -0
- package/_types/chains/definitions/qmsTestnet.d.ts.map +1 -0
- package/_types/chains/definitions/tempo.d.ts +2 -2
- package/_types/chains/definitions/tempoModerato.d.ts +4 -4
- package/_types/chains/index.d.ts +1 -0
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/clients/transports/ipc.d.ts.map +1 -1
- package/_types/clients/transports/webSocket.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/tempo/Account.d.ts +28 -28
- package/_types/tempo/Account.d.ts.map +1 -1
- package/_types/tempo/Client.d.ts +3 -3
- package/_types/tempo/Decorator.d.ts +63 -37
- package/_types/tempo/Decorator.d.ts.map +1 -1
- package/_types/tempo/Formatters.d.ts.map +1 -1
- package/_types/tempo/KeyAuthorizationManager.d.ts +45 -2
- package/_types/tempo/KeyAuthorizationManager.d.ts.map +1 -1
- package/_types/tempo/Relay.d.ts +62 -12
- package/_types/tempo/Relay.d.ts.map +1 -1
- package/_types/tempo/Transaction.d.ts +14 -11
- package/_types/tempo/Transaction.d.ts.map +1 -1
- package/_types/tempo/Transport.d.ts +20 -7
- package/_types/tempo/Transport.d.ts.map +1 -1
- package/_types/tempo/{multisig → accounts}/Config.d.ts +7 -7
- package/_types/tempo/accounts/Config.d.ts.map +1 -0
- package/_types/tempo/{multisig → accounts}/Operation.d.ts +7 -7
- package/_types/tempo/accounts/Operation.d.ts.map +1 -0
- package/_types/tempo/{multisig → accounts}/Signature.d.ts +1 -1
- package/_types/tempo/accounts/Signature.d.ts.map +1 -0
- package/_types/tempo/actions/accessKey.d.ts +59 -17
- package/_types/tempo/actions/accessKey.d.ts.map +1 -1
- package/_types/tempo/actions/{multisig.d.ts → accounts.d.ts} +28 -28
- package/_types/tempo/actions/{multisig.d.ts.map → accounts.d.ts.map} +1 -1
- package/_types/tempo/actions/index.d.ts +1 -1
- package/_types/tempo/actions/index.d.ts.map +1 -1
- package/_types/tempo/index.d.ts +3 -2
- package/_types/tempo/index.d.ts.map +1 -1
- package/_types/tempo/internal/relay/accounts.d.ts +15 -0
- package/_types/tempo/internal/relay/accounts.d.ts.map +1 -0
- package/_types/tempo/internal/relay/keyAuthorization.d.ts +25 -0
- package/_types/tempo/internal/relay/keyAuthorization.d.ts.map +1 -0
- package/_types/tempo/internal/relay/plugin.d.ts +6 -3
- package/_types/tempo/internal/relay/plugin.d.ts.map +1 -1
- package/_types/utils/hash/normalizeSignature.d.ts.map +1 -1
- package/_types/utils/rpc/http.d.ts.map +1 -1
- package/_types/utils/rpc/socket.d.ts.map +1 -1
- package/actions/public/waitForTransactionReceipt.ts +8 -2
- package/actions/wallet/waitForCallsStatus.ts +41 -2
- package/chains/definitions/arcTestnet.ts +11 -8
- package/chains/definitions/qmsTestnet.ts +27 -0
- package/chains/definitions/tempo.ts +1 -1
- package/chains/definitions/tempoModerato.ts +2 -2
- package/chains/index.ts +1 -0
- package/clients/transports/ipc.ts +38 -29
- package/clients/transports/webSocket.ts +42 -33
- package/errors/version.ts +1 -1
- package/package.json +2 -2
- package/tempo/Account.ts +95 -84
- package/tempo/Client.ts +3 -3
- package/tempo/Decorator.ts +86 -57
- package/tempo/ExecutionError.ts +1 -1
- package/tempo/Formatters.ts +14 -13
- package/tempo/KeyAuthorizationManager.ts +71 -19
- package/tempo/Relay.ts +70 -14
- package/tempo/Transaction.ts +31 -23
- package/tempo/Transport.ts +49 -21
- package/tempo/{multisig → accounts}/Config.ts +21 -21
- package/tempo/{multisig → accounts}/Operation.ts +26 -26
- package/tempo/{multisig → accounts}/Signature.ts +5 -3
- package/tempo/actions/accessKey.ts +179 -79
- package/tempo/actions/{multisig.ts → accounts.ts} +47 -56
- package/tempo/actions/index.ts +1 -1
- package/tempo/chainConfig.ts +52 -52
- package/tempo/index.ts +5 -4
- package/tempo/internal/relay/{multisig.ts → accounts.ts} +118 -118
- package/tempo/internal/relay/feePayer.ts +1 -1
- package/tempo/internal/relay/keyAuthorization.ts +415 -0
- package/tempo/internal/relay/plugin.ts +20 -7
- package/utils/hash/normalizeSignature.ts +3 -2
- package/utils/rpc/http.ts +76 -30
- package/utils/rpc/socket.ts +3 -1
- package/_cjs/tempo/actions/multisig.js.map +0 -1
- package/_cjs/tempo/internal/relay/multisig.js.map +0 -1
- package/_cjs/tempo/multisig/Signature.js.map +0 -1
- package/_esm/tempo/actions/multisig.js.map +0 -1
- package/_esm/tempo/internal/relay/multisig.js.map +0 -1
- package/_esm/tempo/multisig/Signature.js +0 -9
- package/_esm/tempo/multisig/Signature.js.map +0 -1
- package/_types/tempo/internal/relay/multisig.d.ts +0 -4
- package/_types/tempo/internal/relay/multisig.d.ts.map +0 -1
- package/_types/tempo/multisig/Config.d.ts.map +0 -1
- package/_types/tempo/multisig/Operation.d.ts.map +0 -1
- package/_types/tempo/multisig/Signature.d.ts.map +0 -1
|
@@ -11,6 +11,7 @@ import type { ErrorType } from '../../errors/utils.js'
|
|
|
11
11
|
import type { Chain } from '../../types/chain.js'
|
|
12
12
|
import type { Hash } from '../../types/misc.js'
|
|
13
13
|
import type { Transaction } from '../../types/transaction.js'
|
|
14
|
+
import { isAddressEqual } from '../../utils/address/isAddressEqual.js'
|
|
14
15
|
import { getAction } from '../../utils/getAction.js'
|
|
15
16
|
import { type ObserveErrorType, observe } from '../../utils/observe.js'
|
|
16
17
|
import { withResolvers } from '../../utils/promise/withResolvers.js'
|
|
@@ -329,7 +330,7 @@ export async function waitForTransactionReceipt<
|
|
|
329
330
|
block.transactions as {} as Transaction[]
|
|
330
331
|
).find(
|
|
331
332
|
({ from, hash, nonce }) =>
|
|
332
|
-
from
|
|
333
|
+
isAddressEqual(from, replacedTransaction!.from) &&
|
|
333
334
|
hash !== replacedTransaction!.hash &&
|
|
334
335
|
nonce === replacedTransaction!.nonce,
|
|
335
336
|
)
|
|
@@ -356,7 +357,12 @@ export async function waitForTransactionReceipt<
|
|
|
356
357
|
|
|
357
358
|
let reason: ReplacementReason = 'replaced'
|
|
358
359
|
if (
|
|
359
|
-
replacementTransaction.to
|
|
360
|
+
(replacementTransaction.to && replacedTransaction.to
|
|
361
|
+
? isAddressEqual(
|
|
362
|
+
replacementTransaction.to,
|
|
363
|
+
replacedTransaction.to,
|
|
364
|
+
)
|
|
365
|
+
: replacementTransaction.to === replacedTransaction.to) &&
|
|
360
366
|
replacementTransaction.value === replacedTransaction.value &&
|
|
361
367
|
replacementTransaction.input === replacedTransaction.input
|
|
362
368
|
) {
|
|
@@ -69,6 +69,17 @@ export type WaitForCallsStatusErrorType =
|
|
|
69
69
|
| WaitForCallsStatusTimeoutError
|
|
70
70
|
| ErrorType
|
|
71
71
|
|
|
72
|
+
const functionIds = /*#__PURE__*/ new WeakMap<object, number>()
|
|
73
|
+
let functionCount = 0
|
|
74
|
+
function getFunctionId(fn: object): number {
|
|
75
|
+
let fnId = functionIds.get(fn)
|
|
76
|
+
if (fnId === undefined) {
|
|
77
|
+
fnId = ++functionCount
|
|
78
|
+
functionIds.set(fn, fnId)
|
|
79
|
+
}
|
|
80
|
+
return fnId
|
|
81
|
+
}
|
|
82
|
+
|
|
72
83
|
/**
|
|
73
84
|
* Waits for the status & receipts of a call bundle that was sent via `sendCalls`.
|
|
74
85
|
*
|
|
@@ -104,7 +115,31 @@ export async function waitForCallsStatus<chain extends Chain | undefined>(
|
|
|
104
115
|
timeout = 60_000,
|
|
105
116
|
throwOnFailure = false,
|
|
106
117
|
} = parameters
|
|
107
|
-
const observerId = stringify([
|
|
118
|
+
const observerId = stringify([
|
|
119
|
+
'waitForCallsStatus',
|
|
120
|
+
client.uid,
|
|
121
|
+
id,
|
|
122
|
+
// Concurrent calls with different behavior-defining options must not
|
|
123
|
+
// share an observer: the first call's polling closure decides the
|
|
124
|
+
// status check, failure handling and retry behavior for everyone.
|
|
125
|
+
// `timeout` is enforced per caller below, so it is not included.
|
|
126
|
+
{
|
|
127
|
+
pollingInterval,
|
|
128
|
+
retryCount,
|
|
129
|
+
// Caller-provided functions are keyed by identity, not source text:
|
|
130
|
+
// two predicates built by the same factory have identical source
|
|
131
|
+
// but capture different values, so they must not share an observer.
|
|
132
|
+
// Keying on `parameters.*` (not the destructured defaults) keeps
|
|
133
|
+
// calls that use the defaults on one shared observer, since the
|
|
134
|
+
// default functions are recreated on every call.
|
|
135
|
+
retryDelay:
|
|
136
|
+
typeof parameters.retryDelay === 'function'
|
|
137
|
+
? ['function', getFunctionId(parameters.retryDelay)]
|
|
138
|
+
: parameters.retryDelay,
|
|
139
|
+
status: parameters.status ? getFunctionId(parameters.status) : undefined,
|
|
140
|
+
throwOnFailure,
|
|
141
|
+
},
|
|
142
|
+
])
|
|
108
143
|
|
|
109
144
|
const { promise, resolve, reject } =
|
|
110
145
|
withResolvers<WaitForCallsStatusReturnType>()
|
|
@@ -161,7 +196,11 @@ export async function waitForCallsStatus<chain extends Chain | undefined>(
|
|
|
161
196
|
}, timeout)
|
|
162
197
|
: undefined
|
|
163
198
|
|
|
164
|
-
|
|
199
|
+
// Remove this caller's listener once its promise settles. `done` only
|
|
200
|
+
// unobserves the caller that started the poll, so a listener from a
|
|
201
|
+
// concurrent caller would otherwise stay cached and block every later
|
|
202
|
+
// wait for the same id from polling.
|
|
203
|
+
return await promise.finally(() => unobserve())
|
|
165
204
|
}
|
|
166
205
|
|
|
167
206
|
export type WaitForCallsStatusTimeoutErrorType =
|
|
@@ -11,21 +11,24 @@ export const arcTestnet = /*#__PURE__*/ defineChain({
|
|
|
11
11
|
rpcUrls: {
|
|
12
12
|
default: {
|
|
13
13
|
http: [
|
|
14
|
-
'https://rpc.testnet.arc.
|
|
15
|
-
'https://rpc.
|
|
16
|
-
'https://rpc.
|
|
14
|
+
'https://rpc.testnet.arc.io',
|
|
15
|
+
'https://rpc.blockdaemon.testnet.arc.io',
|
|
16
|
+
'https://rpc.drpc.testnet.arc.io',
|
|
17
|
+
'https://rpc.quicknode.testnet.arc.io',
|
|
17
18
|
],
|
|
18
19
|
webSocket: [
|
|
19
|
-
'wss://rpc.testnet.arc.
|
|
20
|
-
'wss://rpc.
|
|
20
|
+
'wss://rpc.testnet.arc.io',
|
|
21
|
+
'wss://rpc.blockdaemon.testnet.arc.io:443/websocket',
|
|
22
|
+
'wss://rpc.drpc.testnet.arc.io',
|
|
23
|
+
'wss://rpc.quicknode.testnet.arc.io',
|
|
21
24
|
],
|
|
22
25
|
},
|
|
23
26
|
},
|
|
24
27
|
blockExplorers: {
|
|
25
28
|
default: {
|
|
26
|
-
name: '
|
|
27
|
-
url: 'https://testnet.
|
|
28
|
-
apiUrl: 'https://testnet.
|
|
29
|
+
name: 'Arc Explorer',
|
|
30
|
+
url: 'https://explorer.testnet.arc.io',
|
|
31
|
+
apiUrl: 'https://explorer.testnet.arc.io/api',
|
|
29
32
|
},
|
|
30
33
|
},
|
|
31
34
|
contracts: {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js'
|
|
2
|
+
|
|
3
|
+
export const qmsTestnet = /*#__PURE__*/ defineChain({
|
|
4
|
+
id: 19480,
|
|
5
|
+
name: 'QMS Testnet',
|
|
6
|
+
nativeCurrency: { name: 'QMS', symbol: 'QMS', decimals: 18 },
|
|
7
|
+
rpcUrls: {
|
|
8
|
+
default: {
|
|
9
|
+
http: ['https://rpc.testnet.qms.finance'],
|
|
10
|
+
webSocket: ['wss://rpc.testnet.qms.finance'],
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
blockExplorers: {
|
|
14
|
+
default: {
|
|
15
|
+
name: 'QMS Testnet Explorer',
|
|
16
|
+
url: 'https://testnet.qmsscan.io',
|
|
17
|
+
apiUrl: 'https://testnet.qmsscan.io/api',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
contracts: {
|
|
21
|
+
multicall3: {
|
|
22
|
+
address: '0xcA11bde05977b3631167028862bE2a173976CA11',
|
|
23
|
+
blockCreated: 0,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
testnet: true,
|
|
27
|
+
})
|
|
@@ -12,7 +12,7 @@ export const tempo = /*#__PURE__*/ defineChain({
|
|
|
12
12
|
},
|
|
13
13
|
contracts: {
|
|
14
14
|
earnFactory: {
|
|
15
|
-
address: '
|
|
15
|
+
address: '0x3085A8003f340CD51C72D9e1a1298CDafB171B02',
|
|
16
16
|
},
|
|
17
17
|
erc4626EngineFactory: {
|
|
18
18
|
address: '0xd43D00981222a8db444A528E69f19E3cE5A7D2Ff',
|
|
@@ -13,10 +13,10 @@ export const tempoModerato = /*#__PURE__*/ defineChain({
|
|
|
13
13
|
},
|
|
14
14
|
contracts: {
|
|
15
15
|
earnFactory: {
|
|
16
|
-
address: '
|
|
16
|
+
address: '0x1de6B233984583F4d936ae4265f3b60282b70cc6',
|
|
17
17
|
},
|
|
18
18
|
erc4626EngineFactory: {
|
|
19
|
-
address: '
|
|
19
|
+
address: '0x0d57c10249eb3a92b7d81bBA6221F80F2865448A',
|
|
20
20
|
},
|
|
21
21
|
},
|
|
22
22
|
name: 'Tempo Testnet (Moderato)',
|
package/chains/index.ts
CHANGED
|
@@ -519,6 +519,7 @@ export { pumpfiTestnet } from './definitions/pumpfiTestnet.js'
|
|
|
519
519
|
export { pyrope } from './definitions/pyrope.js'
|
|
520
520
|
export { ql1 } from './definitions/ql1.js'
|
|
521
521
|
export { qMainnet } from './definitions/qMainnet.js'
|
|
522
|
+
export { qmsTestnet } from './definitions/qmsTestnet.js'
|
|
522
523
|
export { qTestnet } from './definitions/qTestnet.js'
|
|
523
524
|
export { quai } from './definitions/quai.js'
|
|
524
525
|
export { quaiTestnet } from './definitions/quaiTestnet.js'
|
|
@@ -133,42 +133,51 @@ export function ipc(
|
|
|
133
133
|
},
|
|
134
134
|
async subscribe({ params, onData, onError }: any) {
|
|
135
135
|
const rpcClient = await getIpcRpcClient(path)
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
// Updated when the subscription is re-established after a reconnect.
|
|
137
|
+
let subscriptionId: Hash
|
|
138
|
+
let unsubscribed = false
|
|
139
|
+
function unsubscribe() {
|
|
140
|
+
unsubscribed = true
|
|
141
|
+
return new Promise<any>((resolve) =>
|
|
138
142
|
rpcClient.request({
|
|
139
143
|
body: {
|
|
140
|
-
method: '
|
|
141
|
-
params,
|
|
142
|
-
},
|
|
143
|
-
onResponse(response) {
|
|
144
|
-
if (response.error) {
|
|
145
|
-
reject(response.error)
|
|
146
|
-
onError?.(response.error)
|
|
147
|
-
return
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if (typeof response.id === 'number') {
|
|
151
|
-
resolve(response)
|
|
152
|
-
return
|
|
153
|
-
}
|
|
154
|
-
if (response.method !== 'eth_subscription') return
|
|
155
|
-
onData(response.params)
|
|
144
|
+
method: 'eth_unsubscribe',
|
|
145
|
+
params: [subscriptionId],
|
|
156
146
|
},
|
|
147
|
+
onResponse: resolve,
|
|
157
148
|
}),
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
await new Promise<any>((resolve, reject) =>
|
|
152
|
+
rpcClient.request({
|
|
153
|
+
body: {
|
|
154
|
+
method: 'eth_subscribe',
|
|
155
|
+
params,
|
|
156
|
+
},
|
|
157
|
+
onResponse(response) {
|
|
158
|
+
if (response.error) {
|
|
159
|
+
reject(response.error)
|
|
160
|
+
onError?.(response.error)
|
|
161
|
+
return
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
if (typeof response.id === 'number') {
|
|
165
|
+
subscriptionId = response.result
|
|
166
|
+
// Re-subscribed while an unsubscribe was in flight.
|
|
167
|
+
if (unsubscribed) unsubscribe()
|
|
168
|
+
resolve(response)
|
|
169
|
+
return
|
|
170
|
+
}
|
|
171
|
+
if (response.method !== 'eth_subscription') return
|
|
172
|
+
onData(response.params)
|
|
173
|
+
},
|
|
174
|
+
}),
|
|
158
175
|
)
|
|
159
176
|
return {
|
|
160
|
-
subscriptionId
|
|
161
|
-
|
|
162
|
-
return new Promise<any>((resolve) =>
|
|
163
|
-
rpcClient.request({
|
|
164
|
-
body: {
|
|
165
|
-
method: 'eth_unsubscribe',
|
|
166
|
-
params: [subscriptionId],
|
|
167
|
-
},
|
|
168
|
-
onResponse: resolve,
|
|
169
|
-
}),
|
|
170
|
-
)
|
|
177
|
+
get subscriptionId() {
|
|
178
|
+
return subscriptionId
|
|
171
179
|
},
|
|
180
|
+
unsubscribe,
|
|
172
181
|
}
|
|
173
182
|
},
|
|
174
183
|
},
|
|
@@ -154,47 +154,56 @@ export function webSocket(
|
|
|
154
154
|
},
|
|
155
155
|
async subscribe({ params, onData, onError }: any) {
|
|
156
156
|
const rpcClient = await getWebSocketRpcClient(url_, wsRpcClientOpts)
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
// Updated when the subscription is re-established after a reconnect.
|
|
158
|
+
let subscriptionId: Hash
|
|
159
|
+
let unsubscribed = false
|
|
160
|
+
function unsubscribe() {
|
|
161
|
+
unsubscribed = true
|
|
162
|
+
return new Promise<any>((resolve) =>
|
|
159
163
|
rpcClient.request({
|
|
160
164
|
body: {
|
|
161
|
-
method: '
|
|
162
|
-
params,
|
|
165
|
+
method: 'eth_unsubscribe',
|
|
166
|
+
params: [subscriptionId],
|
|
163
167
|
},
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
168
|
+
onResponse: resolve,
|
|
169
|
+
}),
|
|
170
|
+
)
|
|
171
|
+
}
|
|
172
|
+
await new Promise<any>((resolve, reject) =>
|
|
173
|
+
rpcClient.request({
|
|
174
|
+
body: {
|
|
175
|
+
method: 'eth_subscribe',
|
|
176
|
+
params,
|
|
177
|
+
},
|
|
178
|
+
onError(error) {
|
|
179
|
+
reject(error)
|
|
180
|
+
onError?.(error)
|
|
181
|
+
return
|
|
182
|
+
},
|
|
183
|
+
onResponse(response) {
|
|
184
|
+
if (response.error) {
|
|
185
|
+
reject(response.error)
|
|
186
|
+
onError?.(response.error)
|
|
167
187
|
return
|
|
168
|
-
}
|
|
169
|
-
onResponse(response) {
|
|
170
|
-
if (response.error) {
|
|
171
|
-
reject(response.error)
|
|
172
|
-
onError?.(response.error)
|
|
173
|
-
return
|
|
174
|
-
}
|
|
188
|
+
}
|
|
175
189
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
}
|
|
183
|
-
|
|
190
|
+
if (typeof response.id === 'number') {
|
|
191
|
+
subscriptionId = response.result
|
|
192
|
+
// Re-subscribed while an unsubscribe was in flight.
|
|
193
|
+
if (unsubscribed) unsubscribe()
|
|
194
|
+
resolve(response)
|
|
195
|
+
return
|
|
196
|
+
}
|
|
197
|
+
if (response.method !== 'eth_subscription') return
|
|
198
|
+
onData(response.params)
|
|
199
|
+
},
|
|
200
|
+
}),
|
|
184
201
|
)
|
|
185
202
|
return {
|
|
186
|
-
subscriptionId
|
|
187
|
-
|
|
188
|
-
return new Promise<any>((resolve) =>
|
|
189
|
-
rpcClient.request({
|
|
190
|
-
body: {
|
|
191
|
-
method: 'eth_unsubscribe',
|
|
192
|
-
params: [subscriptionId],
|
|
193
|
-
},
|
|
194
|
-
onResponse: resolve,
|
|
195
|
-
}),
|
|
196
|
-
)
|
|
203
|
+
get subscriptionId() {
|
|
204
|
+
return subscriptionId
|
|
197
205
|
},
|
|
206
|
+
unsubscribe,
|
|
198
207
|
}
|
|
199
208
|
},
|
|
200
209
|
},
|
package/errors/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '2.57.
|
|
1
|
+
export const version = '2.57.5'
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "viem",
|
|
3
3
|
"description": "TypeScript Interface for Ethereum",
|
|
4
|
-
"version": "2.57.
|
|
4
|
+
"version": "2.57.5",
|
|
5
5
|
"main": "./_cjs/index.js",
|
|
6
6
|
"module": "./_esm/index.js",
|
|
7
7
|
"types": "./_types/index.d.ts",
|
|
@@ -229,7 +229,7 @@
|
|
|
229
229
|
"@scure/bip39": "1.6.0",
|
|
230
230
|
"abitype": "1.2.3",
|
|
231
231
|
"isows": "1.0.7",
|
|
232
|
-
"ox": "0.14.
|
|
232
|
+
"ox": "0.14.56",
|
|
233
233
|
"ws": "8.21.0"
|
|
234
234
|
},
|
|
235
235
|
"license": "MIT",
|