viem 2.57.2 → 2.57.3
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 +20 -0
- package/_cjs/account-abstraction/actions/bundler/waitForUserOperationReceipt.js +4 -2
- package/_cjs/account-abstraction/actions/bundler/waitForUserOperationReceipt.js.map +1 -1
- package/_cjs/actions/public/waitForTransactionReceipt.js +2 -1
- package/_cjs/actions/public/waitForTransactionReceipt.js.map +1 -1
- package/_cjs/actions/wallet/sendCalls.js +2 -0
- package/_cjs/actions/wallet/sendCalls.js.map +1 -1
- package/_cjs/chains/definitions/jasmyChain.js +9 -2
- package/_cjs/chains/definitions/jasmyChain.js.map +1 -1
- package/_cjs/chains/definitions/jasmyChainTestnet.js +9 -2
- package/_cjs/chains/definitions/jasmyChainTestnet.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/tempo/internal/relay/preflight.js +1 -1
- package/_cjs/tempo/internal/relay/preflight.js.map +1 -1
- package/_cjs/utils/errors/getContractError.js +1 -1
- package/_cjs/utils/errors/getContractError.js.map +1 -1
- package/_cjs/utils/rpc/ipc.js +20 -2
- package/_cjs/utils/rpc/ipc.js.map +1 -1
- package/_cjs/utils/rpc/socket.js +3 -2
- package/_cjs/utils/rpc/socket.js.map +1 -1
- package/_esm/account-abstraction/actions/bundler/waitForUserOperationReceipt.js +8 -2
- package/_esm/account-abstraction/actions/bundler/waitForUserOperationReceipt.js.map +1 -1
- package/_esm/actions/public/waitForTransactionReceipt.js +2 -1
- package/_esm/actions/public/waitForTransactionReceipt.js.map +1 -1
- package/_esm/actions/wallet/sendCalls.js +2 -0
- package/_esm/actions/wallet/sendCalls.js.map +1 -1
- package/_esm/chains/definitions/jasmyChain.js +9 -2
- package/_esm/chains/definitions/jasmyChain.js.map +1 -1
- package/_esm/chains/definitions/jasmyChainTestnet.js +9 -2
- package/_esm/chains/definitions/jasmyChainTestnet.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/tempo/Relay.js +1 -1
- package/_esm/tempo/internal/relay/feeToken.js +1 -1
- package/_esm/tempo/internal/relay/feeToken.js.map +1 -1
- package/_esm/tempo/internal/relay/preflight.js +3 -3
- package/_esm/tempo/internal/relay/preflight.js.map +1 -1
- package/_esm/utils/errors/getContractError.js +1 -1
- package/_esm/utils/errors/getContractError.js.map +1 -1
- package/_esm/utils/rpc/ipc.js +20 -2
- package/_esm/utils/rpc/ipc.js.map +1 -1
- package/_esm/utils/rpc/socket.js +3 -2
- package/_esm/utils/rpc/socket.js.map +1 -1
- package/_types/account-abstraction/actions/bundler/waitForUserOperationReceipt.d.ts.map +1 -1
- package/_types/actions/public/waitForTransactionReceipt.d.ts.map +1 -1
- package/_types/actions/wallet/sendCalls.d.ts.map +1 -1
- package/_types/chains/definitions/jasmyChain.d.ts +8 -13
- package/_types/chains/definitions/jasmyChain.d.ts.map +1 -1
- package/_types/chains/definitions/jasmyChainTestnet.d.ts +8 -13
- package/_types/chains/definitions/jasmyChainTestnet.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/tempo/Relay.d.ts +1 -1
- package/_types/tempo/internal/relay/feeToken.d.ts +1 -1
- package/_types/tempo/internal/relay/feeToken.d.ts.map +1 -1
- package/_types/tempo/internal/relay/preflight.d.ts +1 -1
- package/_types/tempo/internal/relay/preflight.d.ts.map +1 -1
- package/_types/utils/errors/getContractError.d.ts.map +1 -1
- package/_types/utils/rpc/ipc.d.ts.map +1 -1
- package/_types/utils/rpc/socket.d.ts.map +1 -1
- package/account-abstraction/actions/bundler/waitForUserOperationReceipt.ts +58 -48
- package/actions/public/waitForTransactionReceipt.ts +2 -1
- package/actions/wallet/sendCalls.ts +2 -0
- package/chains/definitions/jasmyChain.ts +9 -2
- package/chains/definitions/jasmyChainTestnet.ts +9 -2
- package/errors/version.ts +1 -1
- package/package.json +1 -1
- package/tempo/Relay.ts +1 -1
- package/tempo/internal/relay/feeToken.ts +1 -1
- package/tempo/internal/relay/preflight.ts +3 -3
- package/utils/errors/getContractError.ts +3 -1
- package/utils/rpc/ipc.ts +17 -2
- package/utils/rpc/socket.ts +3 -2
|
@@ -8,7 +8,7 @@ import { encodeAbiParameters } from '../../../utils/abi/encodeAbiParameters.js'
|
|
|
8
8
|
import { concat } from '../../../utils/data/concat.js'
|
|
9
9
|
import * as Addresses from '../../Addresses.js'
|
|
10
10
|
|
|
11
|
-
/** Reads fee preferences, balances, and virtual masters
|
|
11
|
+
/** Reads fee preferences, liquid fee-token balances, and virtual masters in one RPC request. */
|
|
12
12
|
export async function read(
|
|
13
13
|
client: Client,
|
|
14
14
|
options: {
|
|
@@ -76,6 +76,6 @@ export async function read(
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
// forge inspect contracts
|
|
79
|
+
// forge inspect --root contracts src/deployless/RelayPreflight.sol:RelayPreflight bytecode --optimize --evm-version paris
|
|
80
80
|
const bytecode =
|
|
81
|
-
'
|
|
81
|
+
'0x608060405234801561001057600080fd5b506040516108be3803806108be83398101604081905261002f916106ed565b6040516001600160a01b038616602482015260009061008090869060440160408051601f198184030181529190526020810180516001600160e01b03908116631da931f560e31b179091526103fc16565b9150600090506001600160a01b0382111561009c57600061009e565b815b905060006001600160a01b038816156101305760405141602482015260009081906100fb908a9060440160408051601f198184030181529190526020810180516001600160e01b039081166336e2a53d60e11b179091526103fc16565b9150915081801561011357506001600160a01b038111155b1561012d578015610124578061012a565b608360961b5b92505b50505b600086516001600160401b0381111561014b5761014b610601565b604051908082528060200260200182016040528015610174578160200160208202803683370190505b506040516001600160a01b038b1660248201529091506000908190819060440160408051601f198184030181529190526020810180516001600160e01b03166370a0823160e01b179052905060005b8a51811015610270576101f78b82815181106101e1576101e16107e9565b6020026020010151838e8961042c60201b60201c565b858281518110610209576102096107e9565b602002602001018181525050866001600160a01b03168b8281518110610231576102316107e9565b60200260200101516001600160a01b031603610268576001925084818151811061025d5761025d6107e9565b602002602001015193505b6001016101c3565b508115801561028757506001600160a01b03861615155b1561029b5761029886828d8861042c565b92505b600088516001600160401b038111156102b6576102b6610601565b6040519080825280602002602001820160405280156102df578160200160208202803683370190505b509050600160005b8a518110156103c7576000806103648e8e8581518110610309576103096107e9565b602002602001015160405160240161033191906001600160e01b031991909116815260200190565b60408051601f198184030181529190526020810180516001600160e01b03908116636c2558b360e11b179091526103fc16565b9150915081158061037b57506001600160a01b0381115b1561038957600093506103bd565b8085848151811061039c5761039c6107e9565b60200260200101906001600160a01b031690816001600160a01b0316815250505b50506001016102e7565b50600088868884866040516020016103e3959493929190610844565b6040516020818303038152906040529050805160208201f35b60008060405160208185516020870188620186a0fa60203d1015169250821561042457805191505b509250929050565b60008061043986866103fc565b91505080158061045057506001600160a01b038316155b1561045f576000915050610565565b826001600160a01b0316866001600160a01b03161480610485575061048584878561056d565b15610491579050610565565b6040805160048152602481019091526020810180516001600160e01b03908116630217a4b760e41b179091526000916104cd918991906103fc16565b9150508015806104e357506001600160a01b0381115b156104f357600092505050610565565b806001600160a01b03808216908916148061051f5750846001600160a01b0316816001600160a01b0316145b156105305760009350505050610565565b61053b86898361056d565b801561054d575061054d86828761056d565b1561055d57829350505050610565565b600093505050505b949350505050565b6040516001600160a01b03808416602483015282166044820152600090819060640160408051601f198184030181529181526020820180516001600160e01b031663298d501f60e11b1781528151835193945092839189620186a0fa600060208301511160403d101582161693505050509392505050565b80516001600160a01b03811681146105fc57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561063f5761063f610601565b604052919050565b60006001600160401b0382111561066057610660610601565b5060051b60200190565b600082601f83011261067b57600080fd5b815161068e61068982610647565b610617565b8082825260208201915060208360051b8601019250858311156106b057600080fd5b602085015b838110156106e35780516001600160e01b0319811681146106d557600080fd5b8352602092830192016106b5565b5095945050505050565b600080600080600060a0868803121561070557600080fd5b61070e866105e5565b945061071c602087016105e5565b60408701519094506001600160401b0381111561073857600080fd5b8601601f8101881361074957600080fd5b805161075761068982610647565b8082825260208201915060208360051b85010192508a83111561077957600080fd5b6020840193505b828410156107a257610791846105e5565b825260209384019390910190610780565b95506107b492505050606087016105e5565b60808701519092506001600160401b038111156107d057600080fd5b6107dc8882890161066a565b9150509295509295909350565b634e487b7160e01b600052603260045260246000fd5b600081518084526020840193506020830160005b8281101561083a5781516001600160a01b0316865260209586019590910190600101610813565b5093949350505050565b6001600160a01b0386168152602080820186905260a060408301819052855190830181905260009186019060c0840190835b81811015610894578351835260209384019390920191600101610876565b5050851515606085015283810360808501526108b081866107ff565b999850505050505050505056fe'
|
|
@@ -49,7 +49,9 @@ export function getContractError<err extends ErrorType<string>>(
|
|
|
49
49
|
err instanceof RawContractError
|
|
50
50
|
? err
|
|
51
51
|
: err instanceof BaseError
|
|
52
|
-
? err.walk(
|
|
52
|
+
? err.walk(
|
|
53
|
+
(err) => typeof err === 'object' && err !== null && 'data' in err,
|
|
54
|
+
) || err.walk()
|
|
53
55
|
: {}
|
|
54
56
|
) as BaseError
|
|
55
57
|
const { code, data, details, message, shortMessage } =
|
package/utils/rpc/ipc.ts
CHANGED
|
@@ -14,6 +14,8 @@ export type GetIpcRpcClientOptions = Pick<
|
|
|
14
14
|
|
|
15
15
|
const openingBrace = '{'.charCodeAt(0)
|
|
16
16
|
const closingBrace = '}'.charCodeAt(0)
|
|
17
|
+
const quote = '"'.charCodeAt(0)
|
|
18
|
+
const backslash = '\\'.charCodeAt(0)
|
|
17
19
|
|
|
18
20
|
/** @internal */
|
|
19
21
|
export function extractMessages(buffer: Buffer): [Buffer[], Buffer] {
|
|
@@ -21,9 +23,22 @@ export function extractMessages(buffer: Buffer): [Buffer[], Buffer] {
|
|
|
21
23
|
|
|
22
24
|
let cursor = 0
|
|
23
25
|
let level = 0
|
|
26
|
+
let inString = false
|
|
27
|
+
let escaped = false
|
|
24
28
|
for (let i = 0; i < buffer.length; i++) {
|
|
25
|
-
|
|
26
|
-
if (
|
|
29
|
+
const byte = buffer[i]
|
|
30
|
+
if (inString) {
|
|
31
|
+
if (escaped) escaped = false
|
|
32
|
+
else if (byte === backslash) escaped = true
|
|
33
|
+
else if (byte === quote) inString = false
|
|
34
|
+
continue
|
|
35
|
+
}
|
|
36
|
+
if (byte === quote) {
|
|
37
|
+
inString = true
|
|
38
|
+
continue
|
|
39
|
+
}
|
|
40
|
+
if (byte === openingBrace) level++
|
|
41
|
+
if (byte === closingBrace) level--
|
|
27
42
|
if (level === 0) {
|
|
28
43
|
const message = buffer.subarray(cursor, i + 1)
|
|
29
44
|
if (
|
package/utils/rpc/socket.ts
CHANGED
|
@@ -288,11 +288,12 @@ export async function getSocketRpcClient<socket extends {}>(
|
|
|
288
288
|
}
|
|
289
289
|
},
|
|
290
290
|
requestAsync({ body, timeout = 10_000 }) {
|
|
291
|
+
const id = body.id ?? idCache.take()
|
|
291
292
|
return withTimeout(
|
|
292
293
|
() =>
|
|
293
294
|
new Promise<RpcResponse>((onResponse, onError) =>
|
|
294
295
|
this.request({
|
|
295
|
-
body,
|
|
296
|
+
body: { ...body, id },
|
|
296
297
|
onError,
|
|
297
298
|
onResponse,
|
|
298
299
|
}),
|
|
@@ -301,7 +302,7 @@ export async function getSocketRpcClient<socket extends {}>(
|
|
|
301
302
|
errorInstance: new TimeoutError({ body, url }),
|
|
302
303
|
timeout,
|
|
303
304
|
},
|
|
304
|
-
)
|
|
305
|
+
).finally(() => requests.delete(id))
|
|
305
306
|
},
|
|
306
307
|
requests,
|
|
307
308
|
subscriptions,
|