viem 2.57.2 → 2.57.4
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/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/Abis.js +216 -1
- package/_cjs/tempo/Abis.js.map +1 -1
- package/_cjs/tempo/Addresses.js +2 -1
- package/_cjs/tempo/Addresses.js.map +1 -1
- package/_cjs/tempo/Selectors.js +13 -1
- package/_cjs/tempo/Selectors.js.map +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/Abis.js +216 -0
- package/_esm/tempo/Abis.js.map +1 -1
- package/_esm/tempo/Addresses.js +1 -0
- package/_esm/tempo/Addresses.js.map +1 -1
- package/_esm/tempo/Relay.js +1 -1
- package/_esm/tempo/Selectors.js +12 -0
- package/_esm/tempo/Selectors.js.map +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/Abis.d.ts +1935 -899
- package/_types/tempo/Abis.d.ts.map +1 -1
- package/_types/tempo/Addresses.d.ts +1 -0
- package/_types/tempo/Addresses.d.ts.map +1 -1
- package/_types/tempo/Relay.d.ts +1 -1
- package/_types/tempo/Selectors.d.ts +12 -0
- package/_types/tempo/Selectors.d.ts.map +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/tempo/internal/relay/utils.d.ts +59 -0
- package/_types/tempo/internal/relay/utils.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 +2 -2
- package/tempo/Abis.ts +217 -0
- package/tempo/Addresses.ts +1 -0
- package/tempo/Relay.ts +1 -1
- package/tempo/Selectors.ts +13 -0
- 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
|
@@ -7,8 +7,15 @@ export const jasmyChainTestnet = /*#__PURE__*/ defineChain({
|
|
|
7
7
|
nativeCurrency: { name: 'JasmyCoin', symbol: 'JASMY', decimals: 18 },
|
|
8
8
|
rpcUrls: {
|
|
9
9
|
default: {
|
|
10
|
-
http: ['https://
|
|
11
|
-
webSocket: ['wss://
|
|
10
|
+
http: ['https://jasmy-chain-testnet.alt.technology'],
|
|
11
|
+
webSocket: ['wss://jasmy-chain-testnet.alt.technology/ws'],
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
blockExplorers: {
|
|
15
|
+
default: {
|
|
16
|
+
name: 'Jasmy Chain Testnet Explorer',
|
|
17
|
+
url: 'https://jasmy-chain-testnet-explorer.alt.technology',
|
|
18
|
+
apiUrl: 'https://jasmy-chain-testnet-explorer.alt.technology/api',
|
|
12
19
|
},
|
|
13
20
|
},
|
|
14
21
|
testnet: true,
|
package/errors/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '2.57.
|
|
1
|
+
export const version = '2.57.4'
|
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.4",
|
|
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.54",
|
|
233
233
|
"ws": "8.21.0"
|
|
234
234
|
},
|
|
235
235
|
"license": "MIT",
|
package/tempo/Abis.ts
CHANGED
|
@@ -8735,6 +8735,222 @@ export const zoneMessenger = [
|
|
|
8735
8735
|
},
|
|
8736
8736
|
] as const
|
|
8737
8737
|
|
|
8738
|
+
// ZoneInbox ABI from tempoxyz/zones.
|
|
8739
|
+
export const zoneInbox = [
|
|
8740
|
+
{
|
|
8741
|
+
name: 'processedDepositQueueHash',
|
|
8742
|
+
type: 'function',
|
|
8743
|
+
stateMutability: 'view',
|
|
8744
|
+
inputs: [],
|
|
8745
|
+
outputs: [{ type: 'bytes32' }],
|
|
8746
|
+
},
|
|
8747
|
+
{
|
|
8748
|
+
name: 'processedDepositNumber',
|
|
8749
|
+
type: 'function',
|
|
8750
|
+
stateMutability: 'view',
|
|
8751
|
+
inputs: [],
|
|
8752
|
+
outputs: [{ type: 'uint64' }],
|
|
8753
|
+
},
|
|
8754
|
+
{
|
|
8755
|
+
name: 'processedTokenEnablementHash',
|
|
8756
|
+
type: 'function',
|
|
8757
|
+
stateMutability: 'view',
|
|
8758
|
+
inputs: [],
|
|
8759
|
+
outputs: [{ type: 'bytes32' }],
|
|
8760
|
+
},
|
|
8761
|
+
{
|
|
8762
|
+
name: 'processedEnabledTokenCount',
|
|
8763
|
+
type: 'function',
|
|
8764
|
+
stateMutability: 'view',
|
|
8765
|
+
inputs: [],
|
|
8766
|
+
outputs: [{ type: 'uint64' }],
|
|
8767
|
+
},
|
|
8768
|
+
{
|
|
8769
|
+
name: 'tempoPortal',
|
|
8770
|
+
type: 'function',
|
|
8771
|
+
stateMutability: 'view',
|
|
8772
|
+
inputs: [],
|
|
8773
|
+
outputs: [{ type: 'address' }],
|
|
8774
|
+
},
|
|
8775
|
+
{
|
|
8776
|
+
name: 'tempoState',
|
|
8777
|
+
type: 'function',
|
|
8778
|
+
stateMutability: 'view',
|
|
8779
|
+
inputs: [],
|
|
8780
|
+
outputs: [{ type: 'address' }],
|
|
8781
|
+
},
|
|
8782
|
+
{
|
|
8783
|
+
name: 'refunds',
|
|
8784
|
+
type: 'function',
|
|
8785
|
+
stateMutability: 'view',
|
|
8786
|
+
inputs: [
|
|
8787
|
+
{ type: 'address', name: 'token' },
|
|
8788
|
+
{ type: 'address', name: 'owner' },
|
|
8789
|
+
],
|
|
8790
|
+
outputs: [{ type: 'uint128' }],
|
|
8791
|
+
},
|
|
8792
|
+
{
|
|
8793
|
+
name: 'claimRefund',
|
|
8794
|
+
type: 'function',
|
|
8795
|
+
stateMutability: 'nonpayable',
|
|
8796
|
+
inputs: [{ type: 'address', name: 'token' }],
|
|
8797
|
+
outputs: [{ type: 'uint128', name: 'amount' }],
|
|
8798
|
+
},
|
|
8799
|
+
{
|
|
8800
|
+
name: 'advanceTempo',
|
|
8801
|
+
type: 'function',
|
|
8802
|
+
stateMutability: 'nonpayable',
|
|
8803
|
+
inputs: [
|
|
8804
|
+
{ type: 'bytes', name: 'header' },
|
|
8805
|
+
{
|
|
8806
|
+
type: 'tuple[]',
|
|
8807
|
+
name: 'deposits',
|
|
8808
|
+
components: [
|
|
8809
|
+
{ type: 'uint8', name: 'depositType' },
|
|
8810
|
+
{ type: 'bytes', name: 'depositData' },
|
|
8811
|
+
{ type: 'bool', name: 'rejected' },
|
|
8812
|
+
],
|
|
8813
|
+
},
|
|
8814
|
+
{
|
|
8815
|
+
type: 'tuple[]',
|
|
8816
|
+
name: 'decryptions',
|
|
8817
|
+
components: [
|
|
8818
|
+
{ type: 'bytes32', name: 'sharedSecret' },
|
|
8819
|
+
{ type: 'uint8', name: 'sharedSecretYParity' },
|
|
8820
|
+
{
|
|
8821
|
+
type: 'tuple',
|
|
8822
|
+
name: 'cpProof',
|
|
8823
|
+
components: [
|
|
8824
|
+
{ type: 'bytes32', name: 's' },
|
|
8825
|
+
{ type: 'bytes32', name: 'c' },
|
|
8826
|
+
],
|
|
8827
|
+
},
|
|
8828
|
+
],
|
|
8829
|
+
},
|
|
8830
|
+
{
|
|
8831
|
+
type: 'tuple[]',
|
|
8832
|
+
name: 'enabledTokens',
|
|
8833
|
+
components: [
|
|
8834
|
+
{ type: 'address', name: 'token' },
|
|
8835
|
+
{ type: 'string', name: 'name' },
|
|
8836
|
+
{ type: 'string', name: 'symbol' },
|
|
8837
|
+
{ type: 'string', name: 'currency' },
|
|
8838
|
+
],
|
|
8839
|
+
},
|
|
8840
|
+
],
|
|
8841
|
+
outputs: [],
|
|
8842
|
+
},
|
|
8843
|
+
{
|
|
8844
|
+
name: 'advanceTempoHeaders',
|
|
8845
|
+
type: 'function',
|
|
8846
|
+
stateMutability: 'nonpayable',
|
|
8847
|
+
inputs: [{ type: 'bytes[]', name: 'headers' }],
|
|
8848
|
+
outputs: [],
|
|
8849
|
+
},
|
|
8850
|
+
{
|
|
8851
|
+
name: 'TempoAdvanced',
|
|
8852
|
+
type: 'event',
|
|
8853
|
+
inputs: [
|
|
8854
|
+
{ type: 'bytes32', name: 'tempoBlockHash', indexed: true },
|
|
8855
|
+
{ type: 'uint64', name: 'tempoBlockNumber', indexed: true },
|
|
8856
|
+
{ type: 'uint256', name: 'depositsProcessed' },
|
|
8857
|
+
{ type: 'bytes32', name: 'newProcessedDepositQueueHash' },
|
|
8858
|
+
{ type: 'uint64', name: 'lastProcessedDepositNumber' },
|
|
8859
|
+
],
|
|
8860
|
+
},
|
|
8861
|
+
{
|
|
8862
|
+
name: 'TempoAdvanced',
|
|
8863
|
+
type: 'event',
|
|
8864
|
+
inputs: [
|
|
8865
|
+
{ type: 'bytes32', name: 'tempoBlockHash', indexed: true },
|
|
8866
|
+
{ type: 'uint64', name: 'tempoBlockNumber', indexed: true },
|
|
8867
|
+
{ type: 'uint256', name: 'depositsProcessed' },
|
|
8868
|
+
{ type: 'bytes32', name: 'newProcessedDepositQueueHash' },
|
|
8869
|
+
{ type: 'uint64', name: 'lastProcessedDepositNumber' },
|
|
8870
|
+
{ type: 'uint64', name: 'lastProcessedEnabledTokenCount' },
|
|
8871
|
+
],
|
|
8872
|
+
},
|
|
8873
|
+
{
|
|
8874
|
+
name: 'DepositProcessed',
|
|
8875
|
+
type: 'event',
|
|
8876
|
+
inputs: [
|
|
8877
|
+
{ type: 'bytes32', name: 'depositHash', indexed: true },
|
|
8878
|
+
{ type: 'address', name: 'sender', indexed: true },
|
|
8879
|
+
{ type: 'address', name: 'to', indexed: true },
|
|
8880
|
+
{ type: 'address', name: 'token' },
|
|
8881
|
+
{ type: 'uint128', name: 'amount' },
|
|
8882
|
+
{ type: 'bytes32', name: 'memo' },
|
|
8883
|
+
],
|
|
8884
|
+
},
|
|
8885
|
+
{
|
|
8886
|
+
name: 'DepositFailed',
|
|
8887
|
+
type: 'event',
|
|
8888
|
+
inputs: [
|
|
8889
|
+
{ type: 'bytes32', name: 'depositHash', indexed: true },
|
|
8890
|
+
{ type: 'address', name: 'sender', indexed: true },
|
|
8891
|
+
{ type: 'address', name: 'token' },
|
|
8892
|
+
{ type: 'uint128', name: 'amount' },
|
|
8893
|
+
],
|
|
8894
|
+
},
|
|
8895
|
+
{
|
|
8896
|
+
name: 'DepositRejected',
|
|
8897
|
+
type: 'event',
|
|
8898
|
+
inputs: [
|
|
8899
|
+
{ type: 'bytes32', name: 'depositHash', indexed: true },
|
|
8900
|
+
{ type: 'address', name: 'sender', indexed: true },
|
|
8901
|
+
{ type: 'uint8', name: 'depositType' },
|
|
8902
|
+
{ type: 'address', name: 'token' },
|
|
8903
|
+
{ type: 'uint128', name: 'amount' },
|
|
8904
|
+
{ type: 'address', name: 'tempoRefundRecipient' },
|
|
8905
|
+
],
|
|
8906
|
+
},
|
|
8907
|
+
{
|
|
8908
|
+
name: 'WithdrawalBounceBackProcessed',
|
|
8909
|
+
type: 'event',
|
|
8910
|
+
inputs: [
|
|
8911
|
+
{ type: 'address', name: 'zoneFallbackRecipient', indexed: true },
|
|
8912
|
+
{ type: 'address', name: 'token' },
|
|
8913
|
+
{ type: 'uint128', name: 'amount' },
|
|
8914
|
+
],
|
|
8915
|
+
},
|
|
8916
|
+
{
|
|
8917
|
+
name: 'WithdrawalBounceBackPending',
|
|
8918
|
+
type: 'event',
|
|
8919
|
+
inputs: [
|
|
8920
|
+
{ type: 'address', name: 'zoneFallbackRecipient', indexed: true },
|
|
8921
|
+
{ type: 'address', name: 'token' },
|
|
8922
|
+
{ type: 'uint128', name: 'amount' },
|
|
8923
|
+
],
|
|
8924
|
+
},
|
|
8925
|
+
{
|
|
8926
|
+
name: 'RefundClaimed',
|
|
8927
|
+
type: 'event',
|
|
8928
|
+
inputs: [
|
|
8929
|
+
{ type: 'address', name: 'recipient', indexed: true },
|
|
8930
|
+
{ type: 'address', name: 'token', indexed: true },
|
|
8931
|
+
{ type: 'uint128', name: 'amount' },
|
|
8932
|
+
],
|
|
8933
|
+
},
|
|
8934
|
+
{
|
|
8935
|
+
name: 'TokenEnabled',
|
|
8936
|
+
type: 'event',
|
|
8937
|
+
inputs: [
|
|
8938
|
+
{ type: 'address', name: 'token', indexed: true },
|
|
8939
|
+
{ type: 'string', name: 'name' },
|
|
8940
|
+
{ type: 'string', name: 'symbol' },
|
|
8941
|
+
{ type: 'string', name: 'currency' },
|
|
8942
|
+
],
|
|
8943
|
+
},
|
|
8944
|
+
{ name: 'OnlySequencer', type: 'error', inputs: [] },
|
|
8945
|
+
{ name: 'InvalidDepositQueueHash', type: 'error', inputs: [] },
|
|
8946
|
+
{ name: 'InvalidWithdrawalBounceBack', type: 'error', inputs: [] },
|
|
8947
|
+
{ name: 'InvalidTokenEnablementHash', type: 'error', inputs: [] },
|
|
8948
|
+
{ name: 'MissingDecryptionData', type: 'error', inputs: [] },
|
|
8949
|
+
{ name: 'ExtraDecryptionData', type: 'error', inputs: [] },
|
|
8950
|
+
{ name: 'InvalidSharedSecretProof', type: 'error', inputs: [] },
|
|
8951
|
+
{ name: 'Unauthorized', type: 'error', inputs: [] },
|
|
8952
|
+
] as const
|
|
8953
|
+
|
|
8738
8954
|
// Source: tempoxyz/propAMM@bff7c1fa50cf72e2896a078abae4e164c36caa93
|
|
8739
8955
|
|
|
8740
8956
|
export const directPropAmm = [
|
|
@@ -9682,6 +9898,7 @@ export const earn = [
|
|
|
9682
9898
|
] as const
|
|
9683
9899
|
|
|
9684
9900
|
export const zone = [
|
|
9901
|
+
...zoneInbox,
|
|
9685
9902
|
...zoneMessenger,
|
|
9686
9903
|
...zoneOutbox,
|
|
9687
9904
|
...zonePortalPreT13Retired,
|
package/tempo/Addresses.ts
CHANGED
|
@@ -32,6 +32,7 @@ export const validator = '0xcccccccc00000000000000000000000000000000'
|
|
|
32
32
|
export const validatorV2 = '0xcccccccc00000000000000000000000000000001'
|
|
33
33
|
export const zoneFactory = '0x5aF2000000000000000000000000000000000000'
|
|
34
34
|
export const zoneMessenger = '0x5A4d000000000000000000000000000000000000'
|
|
35
|
+
export const zoneInbox = '0x1c00000000000000000000000000000000000001'
|
|
35
36
|
export const zoneOutbox = '0x1c00000000000000000000000000000000000002'
|
|
36
37
|
export const zonePortalImplementation =
|
|
37
38
|
'0x5AD1000000000000000000000000000000000000'
|
package/tempo/Relay.ts
CHANGED
package/tempo/Selectors.ts
CHANGED
|
@@ -439,3 +439,16 @@ export const zoneOutbox = {
|
|
|
439
439
|
export const zoneMessenger = {
|
|
440
440
|
relayMessage: '0x11da5261',
|
|
441
441
|
} as const satisfies FunctionSelectors<typeof Abis.zoneMessenger>
|
|
442
|
+
|
|
443
|
+
export const zoneInbox = {
|
|
444
|
+
advanceTempo: '0x86516ec0',
|
|
445
|
+
advanceTempoHeaders: '0xae58328d',
|
|
446
|
+
claimRefund: '0xbffa55d5',
|
|
447
|
+
processedDepositNumber: '0x2d488482',
|
|
448
|
+
processedDepositQueueHash: '0x82648c3b',
|
|
449
|
+
processedEnabledTokenCount: '0x1b366d74',
|
|
450
|
+
processedTokenEnablementHash: '0x8f2e461a',
|
|
451
|
+
refunds: '0x857e85f8',
|
|
452
|
+
tempoPortal: '0xa21de6d9',
|
|
453
|
+
tempoState: '0x1fbb25ad',
|
|
454
|
+
} as const satisfies FunctionSelectors<typeof Abis.zoneInbox>
|
|
@@ -79,7 +79,7 @@ export async function getDefaultTokens(
|
|
|
79
79
|
})
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
/** Resolves a funded fee-token candidate. @internal */
|
|
82
|
+
/** Resolves a funded fee-token candidate with fee AMM liquidity. @internal */
|
|
83
83
|
export async function resolveFeeToken(
|
|
84
84
|
client: Client,
|
|
85
85
|
options: resolveFeeToken.Options,
|
|
@@ -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,
|