@matterlabs/zksync-js 0.0.8 → 0.0.9

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.
Files changed (74) hide show
  1. package/dist/adapters/ethers/client.cjs +1640 -236
  2. package/dist/adapters/ethers/client.cjs.map +1 -1
  3. package/dist/adapters/ethers/client.d.ts +11 -0
  4. package/dist/adapters/ethers/client.js +5 -5
  5. package/dist/adapters/ethers/index.cjs +4395 -1525
  6. package/dist/adapters/ethers/index.cjs.map +1 -1
  7. package/dist/adapters/ethers/index.d.ts +4 -0
  8. package/dist/adapters/ethers/index.js +8 -8
  9. package/dist/adapters/ethers/resources/contracts/types.d.ts +15 -0
  10. package/dist/adapters/ethers/resources/deposits/context.d.ts +3 -3
  11. package/dist/adapters/ethers/resources/deposits/services/gas.d.ts +2 -2
  12. package/dist/adapters/ethers/resources/deposits/services/verification.d.ts +1 -1
  13. package/dist/adapters/ethers/resources/interop/address.d.ts +18 -0
  14. package/dist/adapters/ethers/resources/interop/attributes/resource.d.ts +9 -0
  15. package/dist/adapters/ethers/resources/interop/context.d.ts +36 -0
  16. package/dist/adapters/ethers/resources/interop/index.d.ts +63 -0
  17. package/dist/adapters/ethers/resources/interop/resolvers.d.ts +9 -0
  18. package/dist/adapters/ethers/resources/interop/routes/direct.d.ts +2 -0
  19. package/dist/adapters/ethers/resources/interop/routes/indirect.d.ts +2 -0
  20. package/dist/adapters/ethers/resources/interop/routes/types.d.ts +13 -0
  21. package/dist/adapters/ethers/resources/interop/services/erc20.d.ts +15 -0
  22. package/dist/adapters/ethers/resources/interop/services/finalization/bundle.d.ts +15 -0
  23. package/dist/adapters/ethers/resources/interop/services/finalization/data-fetchers.d.ts +17 -0
  24. package/dist/adapters/ethers/resources/interop/services/finalization/decoders.d.ts +12 -0
  25. package/dist/adapters/ethers/resources/interop/services/finalization/index.d.ts +13 -0
  26. package/dist/adapters/ethers/resources/interop/services/finalization/polling.d.ts +7 -0
  27. package/dist/adapters/ethers/resources/interop/services/finalization/status.d.ts +5 -0
  28. package/dist/adapters/ethers/resources/interop/services/finalization/topics.d.ts +6 -0
  29. package/dist/adapters/ethers/resources/interop/services/starter-data.d.ts +6 -0
  30. package/dist/adapters/ethers/resources/interop/types.d.ts +16 -0
  31. package/dist/adapters/ethers/resources/withdrawals/context.d.ts +2 -2
  32. package/dist/adapters/ethers/sdk.cjs +3357 -917
  33. package/dist/adapters/ethers/sdk.cjs.map +1 -1
  34. package/dist/adapters/ethers/sdk.d.ts +10 -8
  35. package/dist/adapters/ethers/sdk.js +6 -6
  36. package/dist/adapters/viem/client.cjs +685 -31
  37. package/dist/adapters/viem/client.cjs.map +1 -1
  38. package/dist/adapters/viem/client.js +5 -3
  39. package/dist/adapters/viem/index.cjs +282 -203
  40. package/dist/adapters/viem/index.cjs.map +1 -1
  41. package/dist/adapters/viem/index.d.ts +1 -0
  42. package/dist/adapters/viem/index.js +8 -7
  43. package/dist/adapters/viem/resources/deposits/context.d.ts +3 -3
  44. package/dist/adapters/viem/resources/deposits/services/gas.d.ts +2 -2
  45. package/dist/adapters/viem/resources/deposits/services/verification.d.ts +1 -1
  46. package/dist/adapters/viem/resources/withdrawals/context.d.ts +2 -2
  47. package/dist/adapters/viem/sdk.cjs +39 -58
  48. package/dist/adapters/viem/sdk.cjs.map +1 -1
  49. package/dist/adapters/viem/sdk.js +5 -5
  50. package/dist/{chunk-LNIEQ7AN.js → chunk-5AG6B7UX.js} +36 -60
  51. package/dist/{chunk-NODVRI3E.js → chunk-AIFHAPJC.js} +8 -2
  52. package/dist/{chunk-3GFCAGGI.js → chunk-FBKBF7YM.js} +1533 -1434
  53. package/dist/{chunk-L343N56B.js → chunk-IYEDEUXG.js} +1 -1
  54. package/dist/chunk-JNWHQJU3.js +209 -0
  55. package/dist/{chunk-ODMBZ2VX.js → chunk-KLNFDFLA.js} +42 -31
  56. package/dist/{chunk-NVULC4JB.js → chunk-QDJOEVGJ.js} +2 -2
  57. package/dist/{chunk-63DNJXS3.js → chunk-RRKVUW3G.js} +1375 -75
  58. package/dist/{chunk-5V2JRM5J.js → chunk-SRPKTXIF.js} +1 -1
  59. package/dist/{chunk-SHQQI3UD.js → chunk-UIXU35ZU.js} +1 -1
  60. package/dist/{chunk-QZVYN3YA.js → chunk-ZVHFVUDE.js} +2 -37
  61. package/dist/core/index.cjs +3 -2
  62. package/dist/core/index.cjs.map +1 -1
  63. package/dist/core/index.js +4 -4
  64. package/dist/core/resources/interop/attributes/types.d.ts +0 -2
  65. package/dist/core/resources/interop/finalization.d.ts +0 -1
  66. package/dist/core/types/errors.d.ts +15 -5
  67. package/dist/core/types/fees.d.ts +9 -0
  68. package/dist/core/types/flows/interop.d.ts +12 -36
  69. package/dist/core/types/primitives.d.ts +1 -0
  70. package/dist/index.cjs +3 -2
  71. package/dist/index.cjs.map +1 -1
  72. package/dist/index.js +4 -4
  73. package/package.json +1 -1
  74. package/dist/chunk-FGXRG2JS.js +0 -142
@@ -1,4 +1,4 @@
1
- import { __export } from './chunk-C3AGOEHR.js';
1
+ import { __export, ETH_ADDRESS, FORMAL_ETH_ADDRESS, L2_BASE_TOKEN_ADDRESS } from './chunk-C3AGOEHR.js';
2
2
 
3
3
  // src/core/internal/abis/IBridgehub.ts
4
4
  var IBridgehubABI = [
@@ -3982,1119 +3982,1116 @@ var IBaseTokenABI = [
3982
3982
  ];
3983
3983
  var IBaseToken_default = IBaseTokenABI;
3984
3984
 
3985
- // src/core/abi.ts
3986
- var abi_exports = {};
3987
- __export(abi_exports, {
3988
- IBaseTokenABI: () => IBaseToken_default,
3989
- IBridgehubABI: () => IBridgehub_default,
3990
- IERC20ABI: () => IERC20_default,
3991
- IERC7786AttributesABI: () => IERC7786Attributes_default,
3992
- IInteropHandlerABI: () => IInteropHandler_default,
3993
- IL1AssetRouterABI: () => IL1AssetRouter_default,
3994
- IL1NullifierABI: () => IL1Nullifier_default,
3995
- IL2AssetRouterABI: () => IL2AssetRouter_default,
3996
- InteropCenterABI: () => InteropCenter_default,
3997
- InteropRootStorageABI: () => InteropRootStorage_default,
3998
- L1NativeTokenVaultABI: () => L1NativeTokenVault_default,
3999
- L2MessageVerificationABI: () => L2MessageVerification_default,
4000
- L2NativeTokenVaultABI: () => L2NativeTokenVault_default,
4001
- MailboxABI: () => Mailbox_default
4002
- });
4003
-
4004
- // src/core/internal/abis/IERC20.ts
4005
- var IERC20ABI = [
4006
- {
4007
- type: "constructor",
4008
- inputs: [
4009
- { name: "_name", type: "string", internalType: "string" },
4010
- { name: "_symbol", type: "string", internalType: "string" },
4011
- { name: "_decimals", type: "uint8", internalType: "uint8" }
4012
- ],
4013
- stateMutability: "nonpayable"
4014
- },
4015
- {
4016
- type: "function",
4017
- name: "allowance",
4018
- inputs: [
4019
- { name: "", type: "address", internalType: "address" },
4020
- { name: "", type: "address", internalType: "address" }
4021
- ],
4022
- outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
4023
- stateMutability: "view"
4024
- },
4025
- {
4026
- type: "function",
4027
- name: "approve",
4028
- inputs: [
4029
- { name: "spender", type: "address", internalType: "address" },
4030
- { name: "amount", type: "uint256", internalType: "uint256" }
4031
- ],
4032
- outputs: [{ name: "", type: "bool", internalType: "bool" }],
4033
- stateMutability: "nonpayable"
4034
- },
4035
- {
4036
- type: "function",
4037
- name: "balanceOf",
4038
- inputs: [{ name: "", type: "address", internalType: "address" }],
4039
- outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
4040
- stateMutability: "view"
4041
- },
4042
- {
4043
- type: "function",
4044
- name: "decimals",
4045
- inputs: [],
4046
- outputs: [{ name: "", type: "uint8", internalType: "uint8" }],
4047
- stateMutability: "view"
4048
- },
3985
+ // src/core/internal/abis/InteropCenter.ts
3986
+ var InteropCenterABI = [
4049
3987
  {
4050
- type: "function",
4051
- name: "mint",
4052
3988
  inputs: [
4053
- { name: "to", type: "address", internalType: "address" },
4054
- { name: "amount", type: "uint256", internalType: "uint256" }
3989
+ {
3990
+ internalType: "bytes4",
3991
+ name: "selector",
3992
+ type: "bytes4"
3993
+ }
4055
3994
  ],
4056
- outputs: [],
4057
- stateMutability: "nonpayable"
4058
- },
4059
- {
4060
- type: "function",
4061
- name: "name",
4062
- inputs: [],
4063
- outputs: [{ name: "", type: "string", internalType: "string" }],
4064
- stateMutability: "view"
4065
- },
4066
- {
4067
- type: "function",
4068
- name: "owner",
4069
- inputs: [],
4070
- outputs: [{ name: "", type: "address", internalType: "address" }],
4071
- stateMutability: "view"
4072
- },
4073
- {
4074
- type: "function",
4075
- name: "symbol",
4076
- inputs: [],
4077
- outputs: [{ name: "", type: "string", internalType: "string" }],
4078
- stateMutability: "view"
4079
- },
4080
- {
4081
- type: "function",
4082
- name: "totalSupply",
4083
- inputs: [],
4084
- outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
4085
- stateMutability: "view"
3995
+ name: "AttributeAlreadySet",
3996
+ type: "error"
4086
3997
  },
4087
3998
  {
4088
- type: "function",
4089
- name: "transfer",
4090
3999
  inputs: [
4091
- { name: "to", type: "address", internalType: "address" },
4092
- { name: "amount", type: "uint256", internalType: "uint256" }
4000
+ {
4001
+ internalType: "bytes4",
4002
+ name: "selector",
4003
+ type: "bytes4"
4004
+ },
4005
+ {
4006
+ internalType: "uint256",
4007
+ name: "restriction",
4008
+ type: "uint256"
4009
+ }
4093
4010
  ],
4094
- outputs: [{ name: "", type: "bool", internalType: "bool" }],
4095
- stateMutability: "nonpayable"
4011
+ name: "AttributeViolatesRestriction",
4012
+ type: "error"
4096
4013
  },
4097
4014
  {
4098
- type: "function",
4099
- name: "transferFrom",
4100
4015
  inputs: [
4101
- { name: "from", type: "address", internalType: "address" },
4102
- { name: "to", type: "address", internalType: "address" },
4103
- { name: "amount", type: "uint256", internalType: "uint256" }
4016
+ {
4017
+ internalType: "uint256",
4018
+ name: "expected",
4019
+ type: "uint256"
4020
+ },
4021
+ {
4022
+ internalType: "uint256",
4023
+ name: "actual",
4024
+ type: "uint256"
4025
+ }
4104
4026
  ],
4105
- outputs: [{ name: "", type: "bool", internalType: "bool" }],
4106
- stateMutability: "nonpayable"
4027
+ name: "IndirectCallValueMismatch",
4028
+ type: "error"
4107
4029
  },
4108
4030
  {
4109
- type: "event",
4110
- name: "Approval",
4111
4031
  inputs: [
4112
- { name: "owner", type: "address", indexed: true, internalType: "address" },
4113
- { name: "spender", type: "address", indexed: true, internalType: "address" },
4114
- { name: "value", type: "uint256", indexed: false, internalType: "uint256" }
4032
+ {
4033
+ internalType: "bytes",
4034
+ name: "interoperableAddress",
4035
+ type: "bytes"
4036
+ }
4115
4037
  ],
4116
- anonymous: false
4038
+ name: "InteroperableAddressChainReferenceNotEmpty",
4039
+ type: "error"
4117
4040
  },
4118
4041
  {
4119
- type: "event",
4120
- name: "Transfer",
4121
4042
  inputs: [
4122
- { name: "from", type: "address", indexed: true, internalType: "address" },
4123
- { name: "to", type: "address", indexed: true, internalType: "address" },
4124
- { name: "value", type: "uint256", indexed: false, internalType: "uint256" }
4043
+ {
4044
+ internalType: "bytes",
4045
+ name: "interoperableAddress",
4046
+ type: "bytes"
4047
+ }
4125
4048
  ],
4126
- anonymous: false
4049
+ name: "InteroperableAddressNotEmpty",
4050
+ type: "error"
4127
4051
  },
4128
- { type: "error", name: "InsufficientAllowance", inputs: [] },
4129
- { type: "error", name: "InsufficientBalance", inputs: [] },
4130
- { type: "error", name: "NotOwner", inputs: [] }
4131
- ];
4132
- var IERC20_default = IERC20ABI;
4133
-
4134
- // src/core/internal/abis/IERC7786Attributes.ts
4135
- var IERC7786AttributesABI = [
4136
4052
  {
4137
4053
  inputs: [
4138
4054
  {
4139
4055
  internalType: "bytes",
4140
- name: "_executionAddress",
4056
+ name: "",
4141
4057
  type: "bytes"
4142
4058
  }
4143
4059
  ],
4144
- name: "executionAddress",
4145
- outputs: [],
4146
- stateMutability: "pure",
4147
- type: "function"
4060
+ name: "InteroperableAddressParsingError",
4061
+ type: "error"
4148
4062
  },
4149
4063
  {
4150
4064
  inputs: [
4151
4065
  {
4152
4066
  internalType: "uint256",
4153
- name: "_indirectCallMessageValue",
4067
+ name: "expectedMsgValue",
4068
+ type: "uint256"
4069
+ },
4070
+ {
4071
+ internalType: "uint256",
4072
+ name: "providedMsgValue",
4154
4073
  type: "uint256"
4155
4074
  }
4156
4075
  ],
4157
- name: "indirectCall",
4158
- outputs: [],
4159
- stateMutability: "pure",
4160
- type: "function"
4076
+ name: "MsgValueMismatch",
4077
+ type: "error"
4078
+ },
4079
+ {
4080
+ inputs: [],
4081
+ name: "NotInGatewayMode",
4082
+ type: "error"
4161
4083
  },
4162
4084
  {
4163
4085
  inputs: [
4164
4086
  {
4165
4087
  internalType: "uint256",
4166
- name: "_interopCallValue",
4088
+ name: "sourceChainId",
4089
+ type: "uint256"
4090
+ },
4091
+ {
4092
+ internalType: "uint256",
4093
+ name: "destinationChainId",
4167
4094
  type: "uint256"
4168
4095
  }
4169
4096
  ],
4170
- name: "interopCallValue",
4171
- outputs: [],
4172
- stateMutability: "pure",
4173
- type: "function"
4097
+ name: "NotL2ToL2",
4098
+ type: "error"
4099
+ },
4100
+ {
4101
+ inputs: [],
4102
+ name: "SlotOccupied",
4103
+ type: "error"
4174
4104
  },
4175
4105
  {
4176
4106
  inputs: [
4177
4107
  {
4178
- internalType: "bytes",
4179
- name: "_unbundlerAddress",
4180
- type: "bytes"
4108
+ internalType: "address",
4109
+ name: "caller",
4110
+ type: "address"
4181
4111
  }
4182
4112
  ],
4183
- name: "unbundlerAddress",
4184
- outputs: [],
4185
- stateMutability: "pure",
4186
- type: "function"
4187
- }
4188
- ];
4189
- var IERC7786Attributes_default = IERC7786AttributesABI;
4190
-
4191
- // src/core/internal/abis/Mailbox.ts
4192
- var MailboxABI = [
4113
+ name: "Unauthorized",
4114
+ type: "error"
4115
+ },
4193
4116
  {
4194
- type: "constructor",
4195
4117
  inputs: [
4196
- { name: "_eraChainId", type: "uint256", internalType: "uint256" },
4197
- { name: "_l1ChainId", type: "uint256", internalType: "uint256" }
4118
+ {
4119
+ internalType: "bytes4",
4120
+ name: "selector",
4121
+ type: "bytes4"
4122
+ }
4198
4123
  ],
4199
- stateMutability: "nonpayable"
4124
+ name: "UnsupportedAttribute",
4125
+ type: "error"
4200
4126
  },
4201
4127
  {
4202
- type: "function",
4203
- name: "bridgehubRequestL2Transaction",
4128
+ anonymous: false,
4204
4129
  inputs: [
4205
4130
  {
4206
- name: "_request",
4207
- type: "tuple",
4208
- internalType: "struct BridgehubL2TransactionRequest",
4209
- components: [
4210
- { name: "sender", type: "address", internalType: "address" },
4211
- { name: "contractL2", type: "address", internalType: "address" },
4212
- { name: "mintValue", type: "uint256", internalType: "uint256" },
4213
- { name: "l2Value", type: "uint256", internalType: "uint256" },
4214
- { name: "l2Calldata", type: "bytes", internalType: "bytes" },
4215
- { name: "l2GasLimit", type: "uint256", internalType: "uint256" },
4216
- { name: "l2GasPerPubdataByteLimit", type: "uint256", internalType: "uint256" },
4217
- { name: "factoryDeps", type: "bytes[]", internalType: "bytes[]" },
4218
- { name: "refundRecipient", type: "address", internalType: "address" }
4219
- ]
4131
+ indexed: false,
4132
+ internalType: "uint8",
4133
+ name: "version",
4134
+ type: "uint8"
4220
4135
  }
4221
4136
  ],
4222
- outputs: [{ name: "canonicalTxHash", type: "bytes32", internalType: "bytes32" }],
4223
- stateMutability: "nonpayable"
4224
- },
4225
- {
4226
- type: "function",
4227
- name: "bridgehubRequestL2TransactionOnGateway",
4228
- inputs: [
4229
- { name: "_canonicalTxHash", type: "bytes32", internalType: "bytes32" },
4230
- { name: "_expirationTimestamp", type: "uint64", internalType: "uint64" }
4231
- ],
4232
- outputs: [],
4233
- stateMutability: "nonpayable"
4234
- },
4235
- {
4236
- type: "function",
4237
- name: "finalizeEthWithdrawal",
4238
- inputs: [
4239
- { name: "_l2BatchNumber", type: "uint256", internalType: "uint256" },
4240
- { name: "_l2MessageIndex", type: "uint256", internalType: "uint256" },
4241
- { name: "_l2TxNumberInBatch", type: "uint16", internalType: "uint16" },
4242
- { name: "_message", type: "bytes", internalType: "bytes" },
4243
- { name: "_merkleProof", type: "bytes32[]", internalType: "bytes32[]" }
4244
- ],
4245
- outputs: [],
4246
- stateMutability: "nonpayable"
4247
- },
4248
- {
4249
- type: "function",
4250
- name: "getName",
4251
- inputs: [],
4252
- outputs: [{ name: "", type: "string", internalType: "string" }],
4253
- stateMutability: "view"
4254
- },
4255
- {
4256
- type: "function",
4257
- name: "l2TransactionBaseCost",
4258
- inputs: [
4259
- { name: "_gasPrice", type: "uint256", internalType: "uint256" },
4260
- { name: "_l2GasLimit", type: "uint256", internalType: "uint256" },
4261
- { name: "_l2GasPerPubdataByteLimit", type: "uint256", internalType: "uint256" }
4262
- ],
4263
- outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
4264
- stateMutability: "view"
4265
- },
4266
- {
4267
- type: "function",
4268
- name: "proveL1ToL2TransactionStatus",
4269
- inputs: [
4270
- { name: "_l2TxHash", type: "bytes32", internalType: "bytes32" },
4271
- { name: "_l2BatchNumber", type: "uint256", internalType: "uint256" },
4272
- { name: "_l2MessageIndex", type: "uint256", internalType: "uint256" },
4273
- { name: "_l2TxNumberInBatch", type: "uint16", internalType: "uint16" },
4274
- { name: "_merkleProof", type: "bytes32[]", internalType: "bytes32[]" },
4275
- { name: "_status", type: "uint8", internalType: "enum TxStatus" }
4276
- ],
4277
- outputs: [{ name: "", type: "bool", internalType: "bool" }],
4278
- stateMutability: "view"
4279
- },
4280
- {
4281
- type: "function",
4282
- name: "proveL2LeafInclusion",
4283
- inputs: [
4284
- { name: "_batchNumber", type: "uint256", internalType: "uint256" },
4285
- { name: "_leafProofMask", type: "uint256", internalType: "uint256" },
4286
- { name: "_leaf", type: "bytes32", internalType: "bytes32" },
4287
- { name: "_proof", type: "bytes32[]", internalType: "bytes32[]" }
4288
- ],
4289
- outputs: [{ name: "", type: "bool", internalType: "bool" }],
4290
- stateMutability: "view"
4291
- },
4292
- {
4293
- type: "function",
4294
- name: "proveL2LeafInclusionShared",
4295
- inputs: [
4296
- { name: "_chainId", type: "uint256", internalType: "uint256" },
4297
- { name: "_blockOrBatchNumber", type: "uint256", internalType: "uint256" },
4298
- { name: "_leafProofMask", type: "uint256", internalType: "uint256" },
4299
- { name: "_leaf", type: "bytes32", internalType: "bytes32" },
4300
- { name: "_proof", type: "bytes32[]", internalType: "bytes32[]" }
4301
- ],
4302
- outputs: [{ name: "", type: "bool", internalType: "bool" }],
4303
- stateMutability: "view"
4137
+ name: "Initialized",
4138
+ type: "event"
4304
4139
  },
4305
4140
  {
4306
- type: "function",
4307
- name: "proveL2LogInclusion",
4141
+ anonymous: false,
4308
4142
  inputs: [
4309
- { name: "_batchNumber", type: "uint256", internalType: "uint256" },
4310
- { name: "_index", type: "uint256", internalType: "uint256" },
4311
4143
  {
4312
- name: "_log",
4313
- type: "tuple",
4314
- internalType: "struct L2Log",
4315
- components: [
4316
- { name: "l2ShardId", type: "uint8", internalType: "uint8" },
4317
- { name: "isService", type: "bool", internalType: "bool" },
4318
- { name: "txNumberInBatch", type: "uint16", internalType: "uint16" },
4319
- { name: "sender", type: "address", internalType: "address" },
4320
- { name: "key", type: "bytes32", internalType: "bytes32" },
4321
- { name: "value", type: "bytes32", internalType: "bytes32" }
4322
- ]
4144
+ indexed: false,
4145
+ internalType: "bytes32",
4146
+ name: "l2l1MsgHash",
4147
+ type: "bytes32"
4323
4148
  },
4324
- { name: "_proof", type: "bytes32[]", internalType: "bytes32[]" }
4325
- ],
4326
- outputs: [{ name: "", type: "bool", internalType: "bool" }],
4327
- stateMutability: "view"
4328
- },
4329
- {
4330
- type: "function",
4331
- name: "proveL2LogInclusionShared",
4332
- inputs: [
4333
- { name: "_chainId", type: "uint256", internalType: "uint256" },
4334
- { name: "_blockOrBatchNumber", type: "uint256", internalType: "uint256" },
4335
- { name: "_index", type: "uint256", internalType: "uint256" },
4336
4149
  {
4337
- name: "_log",
4338
- type: "tuple",
4339
- internalType: "struct L2Log",
4340
- components: [
4341
- { name: "l2ShardId", type: "uint8", internalType: "uint8" },
4342
- { name: "isService", type: "bool", internalType: "bool" },
4343
- { name: "txNumberInBatch", type: "uint16", internalType: "uint16" },
4344
- { name: "sender", type: "address", internalType: "address" },
4345
- { name: "key", type: "bytes32", internalType: "bytes32" },
4346
- { name: "value", type: "bytes32", internalType: "bytes32" }
4347
- ]
4150
+ indexed: false,
4151
+ internalType: "bytes32",
4152
+ name: "interopBundleHash",
4153
+ type: "bytes32"
4348
4154
  },
4349
- { name: "_proof", type: "bytes32[]", internalType: "bytes32[]" }
4350
- ],
4351
- outputs: [{ name: "", type: "bool", internalType: "bool" }],
4352
- stateMutability: "view"
4353
- },
4354
- {
4355
- type: "function",
4356
- name: "proveL2MessageInclusion",
4357
- inputs: [
4358
- { name: "_batchNumber", type: "uint256", internalType: "uint256" },
4359
- { name: "_index", type: "uint256", internalType: "uint256" },
4360
4155
  {
4361
- name: "_message",
4362
- type: "tuple",
4363
- internalType: "struct L2Message",
4364
4156
  components: [
4365
- { name: "txNumberInBatch", type: "uint16", internalType: "uint16" },
4366
- { name: "sender", type: "address", internalType: "address" },
4367
- { name: "data", type: "bytes", internalType: "bytes" }
4368
- ]
4369
- },
4370
- { name: "_proof", type: "bytes32[]", internalType: "bytes32[]" }
4157
+ {
4158
+ internalType: "bytes1",
4159
+ name: "version",
4160
+ type: "bytes1"
4161
+ },
4162
+ {
4163
+ internalType: "uint256",
4164
+ name: "sourceChainId",
4165
+ type: "uint256"
4166
+ },
4167
+ {
4168
+ internalType: "uint256",
4169
+ name: "destinationChainId",
4170
+ type: "uint256"
4171
+ },
4172
+ {
4173
+ internalType: "bytes32",
4174
+ name: "interopBundleSalt",
4175
+ type: "bytes32"
4176
+ },
4177
+ {
4178
+ components: [
4179
+ {
4180
+ internalType: "bytes1",
4181
+ name: "version",
4182
+ type: "bytes1"
4183
+ },
4184
+ {
4185
+ internalType: "bool",
4186
+ name: "shadowAccount",
4187
+ type: "bool"
4188
+ },
4189
+ {
4190
+ internalType: "address",
4191
+ name: "to",
4192
+ type: "address"
4193
+ },
4194
+ {
4195
+ internalType: "address",
4196
+ name: "from",
4197
+ type: "address"
4198
+ },
4199
+ {
4200
+ internalType: "uint256",
4201
+ name: "value",
4202
+ type: "uint256"
4203
+ },
4204
+ {
4205
+ internalType: "bytes",
4206
+ name: "data",
4207
+ type: "bytes"
4208
+ }
4209
+ ],
4210
+ internalType: "struct InteropCall[]",
4211
+ name: "calls",
4212
+ type: "tuple[]"
4213
+ },
4214
+ {
4215
+ components: [
4216
+ {
4217
+ internalType: "bytes",
4218
+ name: "executionAddress",
4219
+ type: "bytes"
4220
+ },
4221
+ {
4222
+ internalType: "bytes",
4223
+ name: "unbundlerAddress",
4224
+ type: "bytes"
4225
+ }
4226
+ ],
4227
+ internalType: "struct BundleAttributes",
4228
+ name: "bundleAttributes",
4229
+ type: "tuple"
4230
+ }
4231
+ ],
4232
+ indexed: false,
4233
+ internalType: "struct InteropBundle",
4234
+ name: "interopBundle",
4235
+ type: "tuple"
4236
+ }
4371
4237
  ],
4372
- outputs: [{ name: "", type: "bool", internalType: "bool" }],
4373
- stateMutability: "view"
4238
+ name: "InteropBundleSent",
4239
+ type: "event"
4374
4240
  },
4375
4241
  {
4376
- type: "function",
4377
- name: "proveL2MessageInclusionShared",
4242
+ anonymous: false,
4378
4243
  inputs: [
4379
- { name: "_chainId", type: "uint256", internalType: "uint256" },
4380
- { name: "_blockOrBatchNumber", type: "uint256", internalType: "uint256" },
4381
- { name: "_index", type: "uint256", internalType: "uint256" },
4382
4244
  {
4383
- name: "_message",
4384
- type: "tuple",
4385
- internalType: "struct L2Message",
4386
- components: [
4387
- { name: "txNumberInBatch", type: "uint16", internalType: "uint16" },
4388
- { name: "sender", type: "address", internalType: "address" },
4389
- { name: "data", type: "bytes", internalType: "bytes" }
4390
- ]
4245
+ indexed: true,
4246
+ internalType: "bytes32",
4247
+ name: "sendId",
4248
+ type: "bytes32"
4391
4249
  },
4392
- { name: "_proof", type: "bytes32[]", internalType: "bytes32[]" }
4393
- ],
4394
- outputs: [{ name: "", type: "bool", internalType: "bool" }],
4395
- stateMutability: "view"
4396
- },
4397
- {
4398
- type: "function",
4399
- name: "requestL2ServiceTransaction",
4400
- inputs: [
4401
- { name: "_contractL2", type: "address", internalType: "address" },
4402
- { name: "_l2Calldata", type: "bytes", internalType: "bytes" }
4403
- ],
4404
- outputs: [{ name: "canonicalTxHash", type: "bytes32", internalType: "bytes32" }],
4405
- stateMutability: "nonpayable"
4250
+ {
4251
+ indexed: false,
4252
+ internalType: "bytes",
4253
+ name: "sender",
4254
+ type: "bytes"
4255
+ },
4256
+ {
4257
+ indexed: false,
4258
+ internalType: "bytes",
4259
+ name: "recipient",
4260
+ type: "bytes"
4261
+ },
4262
+ {
4263
+ indexed: false,
4264
+ internalType: "bytes",
4265
+ name: "payload",
4266
+ type: "bytes"
4267
+ },
4268
+ {
4269
+ indexed: false,
4270
+ internalType: "uint256",
4271
+ name: "value",
4272
+ type: "uint256"
4273
+ },
4274
+ {
4275
+ indexed: false,
4276
+ internalType: "bytes[]",
4277
+ name: "attributes",
4278
+ type: "bytes[]"
4279
+ }
4280
+ ],
4281
+ name: "MessageSent",
4282
+ type: "event"
4406
4283
  },
4407
4284
  {
4408
- type: "function",
4409
- name: "requestL2Transaction",
4285
+ anonymous: false,
4410
4286
  inputs: [
4411
- { name: "_contractL2", type: "address", internalType: "address" },
4412
- { name: "_l2Value", type: "uint256", internalType: "uint256" },
4413
- { name: "_calldata", type: "bytes", internalType: "bytes" },
4414
- { name: "_l2GasLimit", type: "uint256", internalType: "uint256" },
4415
- { name: "_l2GasPerPubdataByteLimit", type: "uint256", internalType: "uint256" },
4416
- { name: "_factoryDeps", type: "bytes[]", internalType: "bytes[]" },
4417
- { name: "_refundRecipient", type: "address", internalType: "address" }
4287
+ {
4288
+ indexed: true,
4289
+ internalType: "address",
4290
+ name: "oldAssetRouter",
4291
+ type: "address"
4292
+ },
4293
+ {
4294
+ indexed: true,
4295
+ internalType: "address",
4296
+ name: "newAssetRouter",
4297
+ type: "address"
4298
+ }
4418
4299
  ],
4419
- outputs: [{ name: "canonicalTxHash", type: "bytes32", internalType: "bytes32" }],
4420
- stateMutability: "payable"
4300
+ name: "NewAssetRouter",
4301
+ type: "event"
4421
4302
  },
4422
4303
  {
4423
- type: "function",
4424
- name: "requestL2TransactionToGatewayMailbox",
4304
+ anonymous: false,
4425
4305
  inputs: [
4426
- { name: "_chainId", type: "uint256", internalType: "uint256" },
4427
- { name: "_canonicalTxHash", type: "bytes32", internalType: "bytes32" },
4428
- { name: "_expirationTimestamp", type: "uint64", internalType: "uint64" }
4306
+ {
4307
+ indexed: true,
4308
+ internalType: "address",
4309
+ name: "oldAssetTracker",
4310
+ type: "address"
4311
+ },
4312
+ {
4313
+ indexed: true,
4314
+ internalType: "address",
4315
+ name: "newAssetTracker",
4316
+ type: "address"
4317
+ }
4429
4318
  ],
4430
- outputs: [{ name: "canonicalTxHash", type: "bytes32", internalType: "bytes32" }],
4431
- stateMutability: "nonpayable"
4319
+ name: "NewAssetTracker",
4320
+ type: "event"
4432
4321
  },
4433
4322
  {
4434
- type: "event",
4435
- name: "NewPriorityRequest",
4323
+ anonymous: false,
4436
4324
  inputs: [
4437
- { name: "txId", type: "uint256", indexed: false, internalType: "uint256" },
4438
- { name: "txHash", type: "bytes32", indexed: false, internalType: "bytes32" },
4439
4325
  {
4440
- name: "expirationTimestamp",
4441
- type: "uint64",
4442
- indexed: false,
4443
- internalType: "uint64"
4326
+ indexed: true,
4327
+ internalType: "address",
4328
+ name: "previousOwner",
4329
+ type: "address"
4444
4330
  },
4445
4331
  {
4446
- name: "transaction",
4447
- type: "tuple",
4448
- indexed: false,
4449
- internalType: "struct L2CanonicalTransaction",
4450
- components: [
4451
- { name: "txType", type: "uint256", internalType: "uint256" },
4452
- { name: "from", type: "uint256", internalType: "uint256" },
4453
- { name: "to", type: "uint256", internalType: "uint256" },
4454
- { name: "gasLimit", type: "uint256", internalType: "uint256" },
4455
- { name: "gasPerPubdataByteLimit", type: "uint256", internalType: "uint256" },
4456
- { name: "maxFeePerGas", type: "uint256", internalType: "uint256" },
4457
- { name: "maxPriorityFeePerGas", type: "uint256", internalType: "uint256" },
4458
- { name: "paymaster", type: "uint256", internalType: "uint256" },
4459
- { name: "nonce", type: "uint256", internalType: "uint256" },
4460
- { name: "value", type: "uint256", internalType: "uint256" },
4461
- { name: "reserved", type: "uint256[4]", internalType: "uint256[4]" },
4462
- { name: "data", type: "bytes", internalType: "bytes" },
4463
- { name: "signature", type: "bytes", internalType: "bytes" },
4464
- { name: "factoryDeps", type: "uint256[]", internalType: "uint256[]" },
4465
- { name: "paymasterInput", type: "bytes", internalType: "bytes" },
4466
- { name: "reservedDynamic", type: "bytes", internalType: "bytes" }
4467
- ]
4468
- },
4469
- { name: "factoryDeps", type: "bytes[]", indexed: false, internalType: "bytes[]" }
4332
+ indexed: true,
4333
+ internalType: "address",
4334
+ name: "newOwner",
4335
+ type: "address"
4336
+ }
4470
4337
  ],
4471
- anonymous: false
4338
+ name: "OwnershipTransferStarted",
4339
+ type: "event"
4472
4340
  },
4473
4341
  {
4474
- type: "event",
4475
- name: "NewPriorityRequestId",
4342
+ anonymous: false,
4476
4343
  inputs: [
4477
- { name: "txId", type: "uint256", indexed: true, internalType: "uint256" },
4478
- { name: "txHash", type: "bytes32", indexed: true, internalType: "bytes32" }
4344
+ {
4345
+ indexed: true,
4346
+ internalType: "address",
4347
+ name: "previousOwner",
4348
+ type: "address"
4349
+ },
4350
+ {
4351
+ indexed: true,
4352
+ internalType: "address",
4353
+ name: "newOwner",
4354
+ type: "address"
4355
+ }
4479
4356
  ],
4480
- anonymous: false
4357
+ name: "OwnershipTransferred",
4358
+ type: "event"
4481
4359
  },
4482
4360
  {
4483
- type: "event",
4484
- name: "NewRelayedPriorityTransaction",
4361
+ anonymous: false,
4485
4362
  inputs: [
4486
- { name: "txId", type: "uint256", indexed: false, internalType: "uint256" },
4487
- { name: "txHash", type: "bytes32", indexed: false, internalType: "bytes32" },
4488
4363
  {
4489
- name: "expirationTimestamp",
4490
- type: "uint64",
4491
4364
  indexed: false,
4492
- internalType: "uint64"
4365
+ internalType: "address",
4366
+ name: "account",
4367
+ type: "address"
4493
4368
  }
4494
4369
  ],
4495
- anonymous: false
4496
- },
4497
- { type: "error", name: "BaseTokenGasPriceDenominatorNotSet", inputs: [] },
4498
- {
4499
- type: "error",
4500
- name: "BatchNotExecuted",
4501
- inputs: [{ name: "batchNumber", type: "uint256", internalType: "uint256" }]
4502
- },
4503
- { type: "error", name: "GasPerPubdataMismatch", inputs: [] },
4504
- { type: "error", name: "HashedLogIsDefault", inputs: [] },
4505
- { type: "error", name: "InvalidChainId", inputs: [] },
4506
- { type: "error", name: "InvalidProofLengthForFinalNode", inputs: [] },
4507
- {
4508
- type: "error",
4509
- name: "LengthIsNotDivisibleBy32",
4510
- inputs: [{ name: "length", type: "uint256", internalType: "uint256" }]
4511
- },
4512
- { type: "error", name: "LocalRootIsZero", inputs: [] },
4513
- { type: "error", name: "LocalRootMustBeZero", inputs: [] },
4514
- {
4515
- type: "error",
4516
- name: "MalformedBytecode",
4517
- inputs: [{ name: "", type: "uint8", internalType: "enum BytecodeError" }]
4370
+ name: "Paused",
4371
+ type: "event"
4518
4372
  },
4519
- { type: "error", name: "MerkleIndexOutOfBounds", inputs: [] },
4520
- { type: "error", name: "MerklePathEmpty", inputs: [] },
4521
- { type: "error", name: "MerklePathOutOfBounds", inputs: [] },
4522
4373
  {
4523
- type: "error",
4524
- name: "MsgValueTooLow",
4374
+ anonymous: false,
4525
4375
  inputs: [
4526
- { name: "required", type: "uint256", internalType: "uint256" },
4527
- { name: "provided", type: "uint256", internalType: "uint256" }
4528
- ]
4529
- },
4530
- { type: "error", name: "NotHyperchain", inputs: [] },
4531
- { type: "error", name: "NotInitializedReentrancyGuard", inputs: [] },
4532
- {
4533
- type: "error",
4534
- name: "NotL1",
4535
- inputs: [{ name: "blockChainId", type: "uint256", internalType: "uint256" }]
4376
+ {
4377
+ indexed: false,
4378
+ internalType: "address",
4379
+ name: "account",
4380
+ type: "address"
4381
+ }
4382
+ ],
4383
+ name: "Unpaused",
4384
+ type: "event"
4536
4385
  },
4537
- { type: "error", name: "NotSettlementLayer", inputs: [] },
4538
- { type: "error", name: "OnlyEraSupported", inputs: [] },
4539
4386
  {
4540
- type: "error",
4541
- name: "PubdataGreaterThanLimit",
4542
- inputs: [
4543
- { name: "limit", type: "uint256", internalType: "uint256" },
4544
- { name: "length", type: "uint256", internalType: "uint256" }
4545
- ]
4387
+ inputs: [],
4388
+ name: "L1_CHAIN_ID",
4389
+ outputs: [
4390
+ {
4391
+ internalType: "uint256",
4392
+ name: "",
4393
+ type: "uint256"
4394
+ }
4395
+ ],
4396
+ stateMutability: "view",
4397
+ type: "function"
4546
4398
  },
4547
- { type: "error", name: "Reentrancy", inputs: [] },
4548
- { type: "error", name: "TooManyFactoryDeps", inputs: [] },
4549
- { type: "error", name: "TooMuchGas", inputs: [] },
4550
- { type: "error", name: "TransactionNotAllowed", inputs: [] },
4551
- { type: "error", name: "TxnBodyGasLimitNotEnoughGas", inputs: [] },
4552
4399
  {
4553
- type: "error",
4554
- name: "Unauthorized",
4555
- inputs: [{ name: "caller", type: "address", internalType: "address" }]
4400
+ inputs: [],
4401
+ name: "acceptOwnership",
4402
+ outputs: [],
4403
+ stateMutability: "nonpayable",
4404
+ type: "function"
4556
4405
  },
4557
4406
  {
4558
- type: "error",
4559
- name: "UnsupportedProofMetadataVersion",
4560
- inputs: [{ name: "metadataVersion", type: "uint256", internalType: "uint256" }]
4407
+ inputs: [
4408
+ {
4409
+ internalType: "uint256",
4410
+ name: "_chainId",
4411
+ type: "uint256"
4412
+ },
4413
+ {
4414
+ internalType: "bytes32",
4415
+ name: "_canonicalTxHash",
4416
+ type: "bytes32"
4417
+ },
4418
+ {
4419
+ internalType: "uint64",
4420
+ name: "_expirationTimestamp",
4421
+ type: "uint64"
4422
+ },
4423
+ {
4424
+ components: [
4425
+ {
4426
+ internalType: "bytes1",
4427
+ name: "version",
4428
+ type: "bytes1"
4429
+ },
4430
+ {
4431
+ internalType: "address",
4432
+ name: "originToken",
4433
+ type: "address"
4434
+ },
4435
+ {
4436
+ internalType: "bytes32",
4437
+ name: "baseTokenAssetId",
4438
+ type: "bytes32"
4439
+ },
4440
+ {
4441
+ internalType: "uint256",
4442
+ name: "baseTokenAmount",
4443
+ type: "uint256"
4444
+ },
4445
+ {
4446
+ internalType: "bytes32",
4447
+ name: "assetId",
4448
+ type: "bytes32"
4449
+ },
4450
+ {
4451
+ internalType: "uint256",
4452
+ name: "amount",
4453
+ type: "uint256"
4454
+ },
4455
+ {
4456
+ internalType: "uint256",
4457
+ name: "tokenOriginChainId",
4458
+ type: "uint256"
4459
+ }
4460
+ ],
4461
+ internalType: "struct BalanceChange",
4462
+ name: "_balanceChange",
4463
+ type: "tuple"
4464
+ }
4465
+ ],
4466
+ name: "forwardTransactionOnGatewayWithBalanceChange",
4467
+ outputs: [],
4468
+ stateMutability: "nonpayable",
4469
+ type: "function"
4561
4470
  },
4562
- { type: "error", name: "ValidateTxnNotEnoughGas", inputs: [] },
4563
- { type: "error", name: "ZeroGasPriceL1TxZKSyncOS", inputs: [] }
4564
- ];
4565
- var Mailbox_default = MailboxABI;
4566
-
4567
- // src/core/internal/abis/InteropCenter.ts
4568
- var InteropCenterABI = [
4569
4471
  {
4570
4472
  inputs: [
4571
4473
  {
4572
- internalType: "bytes4",
4573
- name: "selector",
4574
- type: "bytes4"
4474
+ internalType: "uint256",
4475
+ name: "_l1ChainId",
4476
+ type: "uint256"
4477
+ },
4478
+ {
4479
+ internalType: "address",
4480
+ name: "_owner",
4481
+ type: "address"
4575
4482
  }
4576
4483
  ],
4577
- name: "AttributeAlreadySet",
4578
- type: "error"
4484
+ name: "initL2",
4485
+ outputs: [],
4486
+ stateMutability: "nonpayable",
4487
+ type: "function"
4579
4488
  },
4580
4489
  {
4581
4490
  inputs: [
4582
4491
  {
4583
- internalType: "bytes4",
4584
- name: "selector",
4585
- type: "bytes4"
4586
- },
4492
+ internalType: "address",
4493
+ name: "sender",
4494
+ type: "address"
4495
+ }
4496
+ ],
4497
+ name: "interopBundleNonce",
4498
+ outputs: [
4587
4499
  {
4588
4500
  internalType: "uint256",
4589
- name: "restriction",
4501
+ name: "numberOfBundlesSent",
4590
4502
  type: "uint256"
4591
4503
  }
4592
4504
  ],
4593
- name: "AttributeViolatesRestriction",
4594
- type: "error"
4505
+ stateMutability: "view",
4506
+ type: "function"
4507
+ },
4508
+ {
4509
+ inputs: [],
4510
+ name: "owner",
4511
+ outputs: [
4512
+ {
4513
+ internalType: "address",
4514
+ name: "",
4515
+ type: "address"
4516
+ }
4517
+ ],
4518
+ stateMutability: "view",
4519
+ type: "function"
4595
4520
  },
4596
4521
  {
4597
4522
  inputs: [
4598
4523
  {
4599
- internalType: "uint256",
4600
- name: "expected",
4601
- type: "uint256"
4524
+ internalType: "bytes[]",
4525
+ name: "_attributes",
4526
+ type: "bytes[]"
4602
4527
  },
4603
4528
  {
4604
- internalType: "uint256",
4605
- name: "actual",
4606
- type: "uint256"
4529
+ internalType: "enum IInteropCenter.AttributeParsingRestrictions",
4530
+ name: "_restriction",
4531
+ type: "uint8"
4607
4532
  }
4608
4533
  ],
4609
- name: "IndirectCallValueMismatch",
4610
- type: "error"
4534
+ name: "parseAttributes",
4535
+ outputs: [
4536
+ {
4537
+ components: [
4538
+ {
4539
+ internalType: "uint256",
4540
+ name: "interopCallValue",
4541
+ type: "uint256"
4542
+ },
4543
+ {
4544
+ internalType: "bool",
4545
+ name: "indirectCall",
4546
+ type: "bool"
4547
+ },
4548
+ {
4549
+ internalType: "uint256",
4550
+ name: "indirectCallMessageValue",
4551
+ type: "uint256"
4552
+ }
4553
+ ],
4554
+ internalType: "struct CallAttributes",
4555
+ name: "callAttributes",
4556
+ type: "tuple"
4557
+ },
4558
+ {
4559
+ components: [
4560
+ {
4561
+ internalType: "bytes",
4562
+ name: "executionAddress",
4563
+ type: "bytes"
4564
+ },
4565
+ {
4566
+ internalType: "bytes",
4567
+ name: "unbundlerAddress",
4568
+ type: "bytes"
4569
+ }
4570
+ ],
4571
+ internalType: "struct BundleAttributes",
4572
+ name: "bundleAttributes",
4573
+ type: "tuple"
4574
+ }
4575
+ ],
4576
+ stateMutability: "pure",
4577
+ type: "function"
4611
4578
  },
4612
4579
  {
4613
- inputs: [
4580
+ inputs: [],
4581
+ name: "pause",
4582
+ outputs: [],
4583
+ stateMutability: "nonpayable",
4584
+ type: "function"
4585
+ },
4586
+ {
4587
+ inputs: [],
4588
+ name: "paused",
4589
+ outputs: [
4614
4590
  {
4615
- internalType: "bytes",
4616
- name: "interoperableAddress",
4617
- type: "bytes"
4591
+ internalType: "bool",
4592
+ name: "",
4593
+ type: "bool"
4618
4594
  }
4619
4595
  ],
4620
- name: "InteroperableAddressChainReferenceNotEmpty",
4621
- type: "error"
4596
+ stateMutability: "view",
4597
+ type: "function"
4622
4598
  },
4623
4599
  {
4624
- inputs: [
4600
+ inputs: [],
4601
+ name: "pendingOwner",
4602
+ outputs: [
4625
4603
  {
4626
- internalType: "bytes",
4627
- name: "interoperableAddress",
4628
- type: "bytes"
4604
+ internalType: "address",
4605
+ name: "",
4606
+ type: "address"
4629
4607
  }
4630
4608
  ],
4631
- name: "InteroperableAddressNotEmpty",
4632
- type: "error"
4609
+ stateMutability: "view",
4610
+ type: "function"
4611
+ },
4612
+ {
4613
+ inputs: [],
4614
+ name: "renounceOwnership",
4615
+ outputs: [],
4616
+ stateMutability: "nonpayable",
4617
+ type: "function"
4633
4618
  },
4634
4619
  {
4635
4620
  inputs: [
4636
4621
  {
4637
4622
  internalType: "bytes",
4638
- name: "",
4623
+ name: "_destinationChainId",
4639
4624
  type: "bytes"
4625
+ },
4626
+ {
4627
+ components: [
4628
+ {
4629
+ internalType: "bytes",
4630
+ name: "to",
4631
+ type: "bytes"
4632
+ },
4633
+ {
4634
+ internalType: "bytes",
4635
+ name: "data",
4636
+ type: "bytes"
4637
+ },
4638
+ {
4639
+ internalType: "bytes[]",
4640
+ name: "callAttributes",
4641
+ type: "bytes[]"
4642
+ }
4643
+ ],
4644
+ internalType: "struct InteropCallStarter[]",
4645
+ name: "_callStarters",
4646
+ type: "tuple[]"
4647
+ },
4648
+ {
4649
+ internalType: "bytes[]",
4650
+ name: "_bundleAttributes",
4651
+ type: "bytes[]"
4640
4652
  }
4641
4653
  ],
4642
- name: "InteroperableAddressParsingError",
4643
- type: "error"
4654
+ name: "sendBundle",
4655
+ outputs: [
4656
+ {
4657
+ internalType: "bytes32",
4658
+ name: "bundleHash",
4659
+ type: "bytes32"
4660
+ }
4661
+ ],
4662
+ stateMutability: "payable",
4663
+ type: "function"
4644
4664
  },
4645
4665
  {
4646
4666
  inputs: [
4647
4667
  {
4648
- internalType: "uint256",
4649
- name: "expectedMsgValue",
4650
- type: "uint256"
4668
+ internalType: "bytes",
4669
+ name: "recipient",
4670
+ type: "bytes"
4651
4671
  },
4652
4672
  {
4653
- internalType: "uint256",
4654
- name: "providedMsgValue",
4655
- type: "uint256"
4673
+ internalType: "bytes",
4674
+ name: "payload",
4675
+ type: "bytes"
4676
+ },
4677
+ {
4678
+ internalType: "bytes[]",
4679
+ name: "attributes",
4680
+ type: "bytes[]"
4656
4681
  }
4657
4682
  ],
4658
- name: "MsgValueMismatch",
4659
- type: "error"
4683
+ name: "sendMessage",
4684
+ outputs: [
4685
+ {
4686
+ internalType: "bytes32",
4687
+ name: "sendId",
4688
+ type: "bytes32"
4689
+ }
4690
+ ],
4691
+ stateMutability: "payable",
4692
+ type: "function"
4660
4693
  },
4661
4694
  {
4662
- inputs: [],
4663
- name: "NotInGatewayMode",
4664
- type: "error"
4695
+ inputs: [
4696
+ {
4697
+ internalType: "bytes4",
4698
+ name: "_attributeSelector",
4699
+ type: "bytes4"
4700
+ }
4701
+ ],
4702
+ name: "supportsAttribute",
4703
+ outputs: [
4704
+ {
4705
+ internalType: "bool",
4706
+ name: "",
4707
+ type: "bool"
4708
+ }
4709
+ ],
4710
+ stateMutability: "pure",
4711
+ type: "function"
4665
4712
  },
4666
4713
  {
4667
4714
  inputs: [
4668
4715
  {
4669
- internalType: "uint256",
4670
- name: "sourceChainId",
4671
- type: "uint256"
4672
- },
4673
- {
4674
- internalType: "uint256",
4675
- name: "destinationChainId",
4676
- type: "uint256"
4716
+ internalType: "address",
4717
+ name: "newOwner",
4718
+ type: "address"
4677
4719
  }
4678
4720
  ],
4679
- name: "NotL2ToL2",
4680
- type: "error"
4721
+ name: "transferOwnership",
4722
+ outputs: [],
4723
+ stateMutability: "nonpayable",
4724
+ type: "function"
4681
4725
  },
4682
4726
  {
4683
4727
  inputs: [],
4684
- name: "SlotOccupied",
4685
- type: "error"
4686
- },
4728
+ name: "unpause",
4729
+ outputs: [],
4730
+ stateMutability: "nonpayable",
4731
+ type: "function"
4732
+ }
4733
+ ];
4734
+ var InteropCenter_default = InteropCenterABI;
4735
+
4736
+ // src/core/internal/abis/IInteropHandler.ts
4737
+ var IInteropHandlerABI = [
4687
4738
  {
4739
+ anonymous: false,
4688
4740
  inputs: [
4689
4741
  {
4690
- internalType: "address",
4691
- name: "caller",
4692
- type: "address"
4742
+ indexed: true,
4743
+ internalType: "bytes32",
4744
+ name: "bundleHash",
4745
+ type: "bytes32"
4693
4746
  }
4694
4747
  ],
4695
- name: "Unauthorized",
4696
- type: "error"
4748
+ name: "BundleExecuted",
4749
+ type: "event"
4697
4750
  },
4698
4751
  {
4752
+ anonymous: false,
4699
4753
  inputs: [
4700
4754
  {
4701
- internalType: "bytes4",
4702
- name: "selector",
4703
- type: "bytes4"
4755
+ indexed: true,
4756
+ internalType: "bytes32",
4757
+ name: "bundleHash",
4758
+ type: "bytes32"
4704
4759
  }
4705
4760
  ],
4706
- name: "UnsupportedAttribute",
4707
- type: "error"
4761
+ name: "BundleUnbundled",
4762
+ type: "event"
4708
4763
  },
4709
4764
  {
4710
4765
  anonymous: false,
4711
4766
  inputs: [
4712
4767
  {
4713
- indexed: false,
4714
- internalType: "uint8",
4715
- name: "version",
4716
- type: "uint8"
4768
+ indexed: true,
4769
+ internalType: "bytes32",
4770
+ name: "bundleHash",
4771
+ type: "bytes32"
4717
4772
  }
4718
4773
  ],
4719
- name: "Initialized",
4774
+ name: "BundleVerified",
4720
4775
  type: "event"
4721
4776
  },
4722
4777
  {
4723
4778
  anonymous: false,
4724
4779
  inputs: [
4725
4780
  {
4726
- indexed: false,
4781
+ indexed: true,
4727
4782
  internalType: "bytes32",
4728
- name: "l2l1MsgHash",
4783
+ name: "bundleHash",
4729
4784
  type: "bytes32"
4730
4785
  },
4786
+ {
4787
+ indexed: true,
4788
+ internalType: "uint256",
4789
+ name: "callIndex",
4790
+ type: "uint256"
4791
+ },
4731
4792
  {
4732
4793
  indexed: false,
4733
- internalType: "bytes32",
4734
- name: "interopBundleHash",
4735
- type: "bytes32"
4794
+ internalType: "enum CallStatus",
4795
+ name: "status",
4796
+ type: "uint8"
4797
+ }
4798
+ ],
4799
+ name: "CallProcessed",
4800
+ type: "event"
4801
+ },
4802
+ {
4803
+ inputs: [
4804
+ {
4805
+ internalType: "bytes",
4806
+ name: "_bundle",
4807
+ type: "bytes"
4736
4808
  },
4737
4809
  {
4738
4810
  components: [
4739
- {
4740
- internalType: "bytes1",
4741
- name: "version",
4742
- type: "bytes1"
4743
- },
4744
4811
  {
4745
4812
  internalType: "uint256",
4746
- name: "sourceChainId",
4813
+ name: "chainId",
4747
4814
  type: "uint256"
4748
4815
  },
4749
4816
  {
4750
4817
  internalType: "uint256",
4751
- name: "destinationChainId",
4818
+ name: "l1BatchNumber",
4752
4819
  type: "uint256"
4753
4820
  },
4754
4821
  {
4755
- internalType: "bytes32",
4756
- name: "interopBundleSalt",
4757
- type: "bytes32"
4822
+ internalType: "uint256",
4823
+ name: "l2MessageIndex",
4824
+ type: "uint256"
4758
4825
  },
4759
4826
  {
4760
4827
  components: [
4761
4828
  {
4762
- internalType: "bytes1",
4763
- name: "version",
4764
- type: "bytes1"
4765
- },
4766
- {
4767
- internalType: "bool",
4768
- name: "shadowAccount",
4769
- type: "bool"
4770
- },
4771
- {
4772
- internalType: "address",
4773
- name: "to",
4774
- type: "address"
4829
+ internalType: "uint16",
4830
+ name: "txNumberInBatch",
4831
+ type: "uint16"
4775
4832
  },
4776
4833
  {
4777
4834
  internalType: "address",
4778
- name: "from",
4835
+ name: "sender",
4779
4836
  type: "address"
4780
4837
  },
4781
- {
4782
- internalType: "uint256",
4783
- name: "value",
4784
- type: "uint256"
4785
- },
4786
4838
  {
4787
4839
  internalType: "bytes",
4788
4840
  name: "data",
4789
4841
  type: "bytes"
4790
4842
  }
4791
4843
  ],
4792
- internalType: "struct InteropCall[]",
4793
- name: "calls",
4794
- type: "tuple[]"
4844
+ internalType: "struct L2Message",
4845
+ name: "message",
4846
+ type: "tuple"
4795
4847
  },
4796
4848
  {
4797
- components: [
4798
- {
4799
- internalType: "bytes",
4800
- name: "executionAddress",
4801
- type: "bytes"
4802
- },
4803
- {
4804
- internalType: "bytes",
4805
- name: "unbundlerAddress",
4806
- type: "bytes"
4807
- }
4808
- ],
4809
- internalType: "struct BundleAttributes",
4810
- name: "bundleAttributes",
4811
- type: "tuple"
4849
+ internalType: "bytes32[]",
4850
+ name: "proof",
4851
+ type: "bytes32[]"
4812
4852
  }
4813
4853
  ],
4814
- indexed: false,
4815
- internalType: "struct InteropBundle",
4816
- name: "interopBundle",
4854
+ internalType: "struct MessageInclusionProof",
4855
+ name: "_proof",
4817
4856
  type: "tuple"
4818
4857
  }
4819
4858
  ],
4820
- name: "InteropBundleSent",
4821
- type: "event"
4859
+ name: "executeBundle",
4860
+ outputs: [],
4861
+ stateMutability: "nonpayable",
4862
+ type: "function"
4822
4863
  },
4823
4864
  {
4824
- anonymous: false,
4825
4865
  inputs: [
4826
4866
  {
4827
- indexed: true,
4828
- internalType: "bytes32",
4829
- name: "sendId",
4830
- type: "bytes32"
4831
- },
4832
- {
4833
- indexed: false,
4834
- internalType: "bytes",
4835
- name: "sender",
4836
- type: "bytes"
4837
- },
4838
- {
4839
- indexed: false,
4840
- internalType: "bytes",
4841
- name: "recipient",
4842
- type: "bytes"
4843
- },
4844
- {
4845
- indexed: false,
4846
- internalType: "bytes",
4847
- name: "payload",
4848
- type: "bytes"
4849
- },
4850
- {
4851
- indexed: false,
4852
4867
  internalType: "uint256",
4853
- name: "value",
4868
+ name: "_sourceChainId",
4854
4869
  type: "uint256"
4855
4870
  },
4856
4871
  {
4857
- indexed: false,
4858
- internalType: "bytes[]",
4859
- name: "attributes",
4860
- type: "bytes[]"
4861
- }
4862
- ],
4863
- name: "MessageSent",
4864
- type: "event"
4865
- },
4866
- {
4867
- anonymous: false,
4868
- inputs: [
4869
- {
4870
- indexed: true,
4871
- internalType: "address",
4872
- name: "oldAssetRouter",
4873
- type: "address"
4874
- },
4875
- {
4876
- indexed: true,
4877
- internalType: "address",
4878
- name: "newAssetRouter",
4879
- type: "address"
4880
- }
4881
- ],
4882
- name: "NewAssetRouter",
4883
- type: "event"
4884
- },
4885
- {
4886
- anonymous: false,
4887
- inputs: [
4888
- {
4889
- indexed: true,
4890
- internalType: "address",
4891
- name: "oldAssetTracker",
4892
- type: "address"
4893
- },
4894
- {
4895
- indexed: true,
4896
- internalType: "address",
4897
- name: "newAssetTracker",
4898
- type: "address"
4899
- }
4900
- ],
4901
- name: "NewAssetTracker",
4902
- type: "event"
4903
- },
4904
- {
4905
- anonymous: false,
4906
- inputs: [
4907
- {
4908
- indexed: true,
4909
- internalType: "address",
4910
- name: "previousOwner",
4911
- type: "address"
4872
+ internalType: "bytes",
4873
+ name: "_bundle",
4874
+ type: "bytes"
4912
4875
  },
4913
4876
  {
4914
- indexed: true,
4915
- internalType: "address",
4916
- name: "newOwner",
4917
- type: "address"
4877
+ internalType: "enum CallStatus[]",
4878
+ name: "_callStatus",
4879
+ type: "uint8[]"
4918
4880
  }
4919
4881
  ],
4920
- name: "OwnershipTransferStarted",
4921
- type: "event"
4882
+ name: "unbundleBundle",
4883
+ outputs: [],
4884
+ stateMutability: "nonpayable",
4885
+ type: "function"
4922
4886
  },
4923
4887
  {
4924
- anonymous: false,
4925
4888
  inputs: [
4926
4889
  {
4927
- indexed: true,
4928
- internalType: "address",
4929
- name: "previousOwner",
4930
- type: "address"
4890
+ internalType: "bytes",
4891
+ name: "_bundle",
4892
+ type: "bytes"
4931
4893
  },
4932
4894
  {
4933
- indexed: true,
4934
- internalType: "address",
4935
- name: "newOwner",
4936
- type: "address"
4895
+ components: [
4896
+ {
4897
+ internalType: "uint256",
4898
+ name: "chainId",
4899
+ type: "uint256"
4900
+ },
4901
+ {
4902
+ internalType: "uint256",
4903
+ name: "l1BatchNumber",
4904
+ type: "uint256"
4905
+ },
4906
+ {
4907
+ internalType: "uint256",
4908
+ name: "l2MessageIndex",
4909
+ type: "uint256"
4910
+ },
4911
+ {
4912
+ components: [
4913
+ {
4914
+ internalType: "uint16",
4915
+ name: "txNumberInBatch",
4916
+ type: "uint16"
4917
+ },
4918
+ {
4919
+ internalType: "address",
4920
+ name: "sender",
4921
+ type: "address"
4922
+ },
4923
+ {
4924
+ internalType: "bytes",
4925
+ name: "data",
4926
+ type: "bytes"
4927
+ }
4928
+ ],
4929
+ internalType: "struct L2Message",
4930
+ name: "message",
4931
+ type: "tuple"
4932
+ },
4933
+ {
4934
+ internalType: "bytes32[]",
4935
+ name: "proof",
4936
+ type: "bytes32[]"
4937
+ }
4938
+ ],
4939
+ internalType: "struct MessageInclusionProof",
4940
+ name: "_proof",
4941
+ type: "tuple"
4937
4942
  }
4938
4943
  ],
4939
- name: "OwnershipTransferred",
4940
- type: "event"
4944
+ name: "verifyBundle",
4945
+ outputs: [],
4946
+ stateMutability: "nonpayable",
4947
+ type: "function"
4948
+ }
4949
+ ];
4950
+ var IInteropHandler_default = IInteropHandlerABI;
4951
+
4952
+ // src/core/internal/abis/L2MessageVerification.ts
4953
+ var L2MessageVerificationABI = [
4954
+ {
4955
+ inputs: [],
4956
+ name: "DepthMoreThanOneForRecursiveMerkleProof",
4957
+ type: "error"
4941
4958
  },
4942
4959
  {
4943
- anonymous: false,
4944
- inputs: [
4945
- {
4946
- indexed: false,
4947
- internalType: "address",
4948
- name: "account",
4949
- type: "address"
4950
- }
4951
- ],
4952
- name: "Paused",
4953
- type: "event"
4960
+ inputs: [],
4961
+ name: "HashedLogIsDefault",
4962
+ type: "error"
4954
4963
  },
4955
4964
  {
4956
- anonymous: false,
4957
- inputs: [
4958
- {
4959
- indexed: false,
4960
- internalType: "address",
4961
- name: "account",
4962
- type: "address"
4963
- }
4964
- ],
4965
- name: "Unpaused",
4966
- type: "event"
4965
+ inputs: [],
4966
+ name: "InvalidProofLengthForFinalNode",
4967
+ type: "error"
4967
4968
  },
4968
4969
  {
4969
4970
  inputs: [],
4970
- name: "L1_CHAIN_ID",
4971
- outputs: [
4972
- {
4973
- internalType: "uint256",
4974
- name: "",
4975
- type: "uint256"
4976
- }
4977
- ],
4978
- stateMutability: "view",
4979
- type: "function"
4971
+ name: "MerkleIndexOutOfBounds",
4972
+ type: "error"
4980
4973
  },
4981
4974
  {
4982
4975
  inputs: [],
4983
- name: "acceptOwnership",
4984
- outputs: [],
4985
- stateMutability: "nonpayable",
4986
- type: "function"
4976
+ name: "MerklePathEmpty",
4977
+ type: "error"
4978
+ },
4979
+ {
4980
+ inputs: [],
4981
+ name: "MerklePathOutOfBounds",
4982
+ type: "error"
4987
4983
  },
4988
4984
  {
4989
4985
  inputs: [
4990
4986
  {
4991
4987
  internalType: "uint256",
4992
- name: "_chainId",
4988
+ name: "metadataVersion",
4993
4989
  type: "uint256"
4994
- },
4995
- {
4996
- internalType: "bytes32",
4997
- name: "_canonicalTxHash",
4998
- type: "bytes32"
4999
- },
5000
- {
5001
- internalType: "uint64",
5002
- name: "_expirationTimestamp",
5003
- type: "uint64"
5004
- },
4990
+ }
4991
+ ],
4992
+ name: "UnsupportedProofMetadataVersion",
4993
+ type: "error"
4994
+ },
4995
+ {
4996
+ inputs: [
5005
4997
  {
5006
4998
  components: [
5007
4999
  {
5008
- internalType: "bytes1",
5009
- name: "version",
5010
- type: "bytes1"
5011
- },
5012
- {
5013
- internalType: "address",
5014
- name: "originToken",
5015
- type: "address"
5000
+ internalType: "uint256",
5001
+ name: "chainId",
5002
+ type: "uint256"
5016
5003
  },
5017
5004
  {
5018
- internalType: "bytes32",
5019
- name: "baseTokenAssetId",
5020
- type: "bytes32"
5005
+ internalType: "uint256",
5006
+ name: "l2BatchNumber",
5007
+ type: "uint256"
5021
5008
  },
5022
5009
  {
5023
5010
  internalType: "uint256",
5024
- name: "baseTokenAmount",
5011
+ name: "l2MessageIndex",
5025
5012
  type: "uint256"
5026
5013
  },
5027
5014
  {
5028
- internalType: "bytes32",
5029
- name: "assetId",
5030
- type: "bytes32"
5015
+ internalType: "address",
5016
+ name: "l2Sender",
5017
+ type: "address"
5031
5018
  },
5032
5019
  {
5033
- internalType: "uint256",
5034
- name: "amount",
5035
- type: "uint256"
5020
+ internalType: "uint16",
5021
+ name: "l2TxNumberInBatch",
5022
+ type: "uint16"
5036
5023
  },
5037
5024
  {
5038
- internalType: "uint256",
5039
- name: "tokenOriginChainId",
5040
- type: "uint256"
5025
+ internalType: "bytes",
5026
+ name: "message",
5027
+ type: "bytes"
5028
+ },
5029
+ {
5030
+ internalType: "bytes32[]",
5031
+ name: "merkleProof",
5032
+ type: "bytes32[]"
5041
5033
  }
5042
5034
  ],
5043
- internalType: "struct BalanceChange",
5044
- name: "_balanceChange",
5035
+ internalType: "struct FinalizeL1DepositParams",
5036
+ name: "_finalizeWithdrawalParams",
5045
5037
  type: "tuple"
5046
5038
  }
5047
5039
  ],
5048
- name: "forwardTransactionOnGatewayWithBalanceChange",
5049
- outputs: [],
5050
- stateMutability: "nonpayable",
5040
+ name: "proveL1DepositParamsInclusion",
5041
+ outputs: [
5042
+ {
5043
+ internalType: "bool",
5044
+ name: "success",
5045
+ type: "bool"
5046
+ }
5047
+ ],
5048
+ stateMutability: "view",
5051
5049
  type: "function"
5052
5050
  },
5053
5051
  {
5054
5052
  inputs: [
5055
5053
  {
5056
5054
  internalType: "uint256",
5057
- name: "_l1ChainId",
5055
+ name: "_chainId",
5058
5056
  type: "uint256"
5059
5057
  },
5060
5058
  {
5061
- internalType: "address",
5062
- name: "_owner",
5063
- type: "address"
5064
- }
5065
- ],
5066
- name: "initL2",
5067
- outputs: [],
5068
- stateMutability: "nonpayable",
5069
- type: "function"
5070
- },
5071
- {
5072
- inputs: [
5059
+ internalType: "bytes32",
5060
+ name: "_l2TxHash",
5061
+ type: "bytes32"
5062
+ },
5073
5063
  {
5074
- internalType: "address",
5075
- name: "sender",
5076
- type: "address"
5077
- }
5078
- ],
5079
- name: "interopBundleNonce",
5080
- outputs: [
5064
+ internalType: "uint256",
5065
+ name: "_l2BatchNumber",
5066
+ type: "uint256"
5067
+ },
5068
+ {
5069
+ internalType: "uint256",
5070
+ name: "_l2MessageIndex",
5071
+ type: "uint256"
5072
+ },
5073
+ {
5074
+ internalType: "uint16",
5075
+ name: "_l2TxNumberInBatch",
5076
+ type: "uint16"
5077
+ },
5081
5078
  {
5082
- internalType: "uint256",
5083
- name: "numberOfBundlesSent",
5084
- type: "uint256"
5079
+ internalType: "bytes32[]",
5080
+ name: "_merkleProof",
5081
+ type: "bytes32[]"
5082
+ },
5083
+ {
5084
+ internalType: "enum TxStatus",
5085
+ name: "_status",
5086
+ type: "uint8"
5085
5087
  }
5086
5088
  ],
5087
- stateMutability: "view",
5088
- type: "function"
5089
- },
5090
- {
5091
- inputs: [],
5092
- name: "owner",
5089
+ name: "proveL1ToL2TransactionStatusShared",
5093
5090
  outputs: [
5094
5091
  {
5095
- internalType: "address",
5092
+ internalType: "bool",
5096
5093
  name: "",
5097
- type: "address"
5094
+ type: "bool"
5098
5095
  }
5099
5096
  ],
5100
5097
  stateMutability: "view",
@@ -5103,71 +5100,32 @@ var InteropCenterABI = [
5103
5100
  {
5104
5101
  inputs: [
5105
5102
  {
5106
- internalType: "bytes[]",
5107
- name: "_attributes",
5108
- type: "bytes[]"
5103
+ internalType: "uint256",
5104
+ name: "_chainId",
5105
+ type: "uint256"
5109
5106
  },
5110
5107
  {
5111
- internalType: "enum IInteropCenter.AttributeParsingRestrictions",
5112
- name: "_restriction",
5113
- type: "uint8"
5114
- }
5115
- ],
5116
- name: "parseAttributes",
5117
- outputs: [
5108
+ internalType: "uint256",
5109
+ name: "_blockOrBatchNumber",
5110
+ type: "uint256"
5111
+ },
5118
5112
  {
5119
- components: [
5120
- {
5121
- internalType: "uint256",
5122
- name: "interopCallValue",
5123
- type: "uint256"
5124
- },
5125
- {
5126
- internalType: "bool",
5127
- name: "indirectCall",
5128
- type: "bool"
5129
- },
5130
- {
5131
- internalType: "uint256",
5132
- name: "indirectCallMessageValue",
5133
- type: "uint256"
5134
- }
5135
- ],
5136
- internalType: "struct CallAttributes",
5137
- name: "callAttributes",
5138
- type: "tuple"
5113
+ internalType: "uint256",
5114
+ name: "_leafProofMask",
5115
+ type: "uint256"
5139
5116
  },
5140
5117
  {
5141
- components: [
5142
- {
5143
- internalType: "bytes",
5144
- name: "executionAddress",
5145
- type: "bytes"
5146
- },
5147
- {
5148
- internalType: "bytes",
5149
- name: "unbundlerAddress",
5150
- type: "bytes"
5151
- }
5152
- ],
5153
- internalType: "struct BundleAttributes",
5154
- name: "bundleAttributes",
5155
- type: "tuple"
5118
+ internalType: "bytes32",
5119
+ name: "_leaf",
5120
+ type: "bytes32"
5121
+ },
5122
+ {
5123
+ internalType: "bytes32[]",
5124
+ name: "_proof",
5125
+ type: "bytes32[]"
5156
5126
  }
5157
5127
  ],
5158
- stateMutability: "pure",
5159
- type: "function"
5160
- },
5161
- {
5162
- inputs: [],
5163
- name: "pause",
5164
- outputs: [],
5165
- stateMutability: "nonpayable",
5166
- type: "function"
5167
- },
5168
- {
5169
- inputs: [],
5170
- name: "paused",
5128
+ name: "proveL2LeafInclusionShared",
5171
5129
  outputs: [
5172
5130
  {
5173
5131
  internalType: "bool",
@@ -5179,109 +5137,166 @@ var InteropCenterABI = [
5179
5137
  type: "function"
5180
5138
  },
5181
5139
  {
5182
- inputs: [],
5183
- name: "pendingOwner",
5140
+ inputs: [
5141
+ {
5142
+ internalType: "uint256",
5143
+ name: "_chainId",
5144
+ type: "uint256"
5145
+ },
5146
+ {
5147
+ internalType: "uint256",
5148
+ name: "_blockOrBatchNumber",
5149
+ type: "uint256"
5150
+ },
5151
+ {
5152
+ internalType: "uint256",
5153
+ name: "_leafProofMask",
5154
+ type: "uint256"
5155
+ },
5156
+ {
5157
+ internalType: "bytes32",
5158
+ name: "_leaf",
5159
+ type: "bytes32"
5160
+ },
5161
+ {
5162
+ internalType: "bytes32[]",
5163
+ name: "_proof",
5164
+ type: "bytes32[]"
5165
+ },
5166
+ {
5167
+ internalType: "uint256",
5168
+ name: "_depth",
5169
+ type: "uint256"
5170
+ }
5171
+ ],
5172
+ name: "proveL2LeafInclusionSharedRecursive",
5184
5173
  outputs: [
5185
5174
  {
5186
- internalType: "address",
5175
+ internalType: "bool",
5187
5176
  name: "",
5188
- type: "address"
5177
+ type: "bool"
5189
5178
  }
5190
5179
  ],
5191
5180
  stateMutability: "view",
5192
5181
  type: "function"
5193
5182
  },
5194
- {
5195
- inputs: [],
5196
- name: "renounceOwnership",
5197
- outputs: [],
5198
- stateMutability: "nonpayable",
5199
- type: "function"
5200
- },
5201
5183
  {
5202
5184
  inputs: [
5203
5185
  {
5204
- internalType: "bytes",
5205
- name: "_destinationChainId",
5206
- type: "bytes"
5186
+ internalType: "uint256",
5187
+ name: "_chainId",
5188
+ type: "uint256"
5189
+ },
5190
+ {
5191
+ internalType: "uint256",
5192
+ name: "_blockOrBatchNumber",
5193
+ type: "uint256"
5194
+ },
5195
+ {
5196
+ internalType: "uint256",
5197
+ name: "_index",
5198
+ type: "uint256"
5207
5199
  },
5208
5200
  {
5209
5201
  components: [
5210
5202
  {
5211
- internalType: "bytes",
5212
- name: "to",
5213
- type: "bytes"
5203
+ internalType: "uint8",
5204
+ name: "l2ShardId",
5205
+ type: "uint8"
5214
5206
  },
5215
5207
  {
5216
- internalType: "bytes",
5217
- name: "data",
5218
- type: "bytes"
5208
+ internalType: "bool",
5209
+ name: "isService",
5210
+ type: "bool"
5219
5211
  },
5220
5212
  {
5221
- internalType: "bytes[]",
5222
- name: "callAttributes",
5223
- type: "bytes[]"
5213
+ internalType: "uint16",
5214
+ name: "txNumberInBatch",
5215
+ type: "uint16"
5216
+ },
5217
+ {
5218
+ internalType: "address",
5219
+ name: "sender",
5220
+ type: "address"
5221
+ },
5222
+ {
5223
+ internalType: "bytes32",
5224
+ name: "key",
5225
+ type: "bytes32"
5226
+ },
5227
+ {
5228
+ internalType: "bytes32",
5229
+ name: "value",
5230
+ type: "bytes32"
5224
5231
  }
5225
5232
  ],
5226
- internalType: "struct InteropCallStarter[]",
5227
- name: "_callStarters",
5228
- type: "tuple[]"
5233
+ internalType: "struct L2Log",
5234
+ name: "_log",
5235
+ type: "tuple"
5229
5236
  },
5230
5237
  {
5231
- internalType: "bytes[]",
5232
- name: "_bundleAttributes",
5233
- type: "bytes[]"
5238
+ internalType: "bytes32[]",
5239
+ name: "_proof",
5240
+ type: "bytes32[]"
5234
5241
  }
5235
5242
  ],
5236
- name: "sendBundle",
5243
+ name: "proveL2LogInclusionShared",
5237
5244
  outputs: [
5238
5245
  {
5239
- internalType: "bytes32",
5240
- name: "bundleHash",
5241
- type: "bytes32"
5246
+ internalType: "bool",
5247
+ name: "",
5248
+ type: "bool"
5242
5249
  }
5243
5250
  ],
5244
- stateMutability: "payable",
5251
+ stateMutability: "view",
5245
5252
  type: "function"
5246
5253
  },
5247
5254
  {
5248
5255
  inputs: [
5249
5256
  {
5250
- internalType: "bytes",
5251
- name: "recipient",
5252
- type: "bytes"
5257
+ internalType: "uint256",
5258
+ name: "_chainId",
5259
+ type: "uint256"
5253
5260
  },
5254
5261
  {
5255
- internalType: "bytes",
5256
- name: "payload",
5257
- type: "bytes"
5262
+ internalType: "uint256",
5263
+ name: "_blockOrBatchNumber",
5264
+ type: "uint256"
5258
5265
  },
5259
5266
  {
5260
- internalType: "bytes[]",
5261
- name: "attributes",
5262
- type: "bytes[]"
5263
- }
5264
- ],
5265
- name: "sendMessage",
5266
- outputs: [
5267
+ internalType: "uint256",
5268
+ name: "_index",
5269
+ type: "uint256"
5270
+ },
5267
5271
  {
5268
- internalType: "bytes32",
5269
- name: "sendId",
5270
- type: "bytes32"
5271
- }
5272
- ],
5273
- stateMutability: "payable",
5274
- type: "function"
5275
- },
5276
- {
5277
- inputs: [
5272
+ components: [
5273
+ {
5274
+ internalType: "uint16",
5275
+ name: "txNumberInBatch",
5276
+ type: "uint16"
5277
+ },
5278
+ {
5279
+ internalType: "address",
5280
+ name: "sender",
5281
+ type: "address"
5282
+ },
5283
+ {
5284
+ internalType: "bytes",
5285
+ name: "data",
5286
+ type: "bytes"
5287
+ }
5288
+ ],
5289
+ internalType: "struct L2Message",
5290
+ name: "_message",
5291
+ type: "tuple"
5292
+ },
5278
5293
  {
5279
- internalType: "bytes4",
5280
- name: "_attributeSelector",
5281
- type: "bytes4"
5294
+ internalType: "bytes32[]",
5295
+ name: "_proof",
5296
+ type: "bytes32[]"
5282
5297
  }
5283
5298
  ],
5284
- name: "supportsAttribute",
5299
+ name: "proveL2MessageInclusionShared",
5285
5300
  outputs: [
5286
5301
  {
5287
5302
  internalType: "bool",
@@ -5289,642 +5304,670 @@ var InteropCenterABI = [
5289
5304
  type: "bool"
5290
5305
  }
5291
5306
  ],
5292
- stateMutability: "pure",
5307
+ stateMutability: "view",
5293
5308
  type: "function"
5294
- },
5309
+ }
5310
+ ];
5311
+ var L2MessageVerification_default = L2MessageVerificationABI;
5312
+
5313
+ // src/core/abi.ts
5314
+ var abi_exports = {};
5315
+ __export(abi_exports, {
5316
+ IBaseTokenABI: () => IBaseToken_default,
5317
+ IBridgehubABI: () => IBridgehub_default,
5318
+ IERC20ABI: () => IERC20_default,
5319
+ IERC7786AttributesABI: () => IERC7786Attributes_default,
5320
+ IInteropHandlerABI: () => IInteropHandler_default,
5321
+ IL1AssetRouterABI: () => IL1AssetRouter_default,
5322
+ IL1NullifierABI: () => IL1Nullifier_default,
5323
+ IL2AssetRouterABI: () => IL2AssetRouter_default,
5324
+ InteropCenterABI: () => InteropCenter_default,
5325
+ InteropRootStorageABI: () => InteropRootStorage_default,
5326
+ L1NativeTokenVaultABI: () => L1NativeTokenVault_default,
5327
+ L2MessageVerificationABI: () => L2MessageVerification_default,
5328
+ L2NativeTokenVaultABI: () => L2NativeTokenVault_default,
5329
+ MailboxABI: () => Mailbox_default
5330
+ });
5331
+
5332
+ // src/core/internal/abis/IERC20.ts
5333
+ var IERC20ABI = [
5295
5334
  {
5335
+ type: "constructor",
5296
5336
  inputs: [
5297
- {
5298
- internalType: "address",
5299
- name: "newOwner",
5300
- type: "address"
5301
- }
5337
+ { name: "_name", type: "string", internalType: "string" },
5338
+ { name: "_symbol", type: "string", internalType: "string" },
5339
+ { name: "_decimals", type: "uint8", internalType: "uint8" }
5302
5340
  ],
5303
- name: "transferOwnership",
5304
- outputs: [],
5305
- stateMutability: "nonpayable",
5306
- type: "function"
5341
+ stateMutability: "nonpayable"
5307
5342
  },
5308
5343
  {
5309
- inputs: [],
5310
- name: "unpause",
5311
- outputs: [],
5312
- stateMutability: "nonpayable",
5313
- type: "function"
5314
- }
5315
- ];
5316
- var InteropCenter_default = InteropCenterABI;
5317
-
5318
- // src/core/internal/abis/IInteropHandler.ts
5319
- var IInteropHandlerABI = [
5344
+ type: "function",
5345
+ name: "allowance",
5346
+ inputs: [
5347
+ { name: "", type: "address", internalType: "address" },
5348
+ { name: "", type: "address", internalType: "address" }
5349
+ ],
5350
+ outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
5351
+ stateMutability: "view"
5352
+ },
5320
5353
  {
5321
- anonymous: false,
5354
+ type: "function",
5355
+ name: "approve",
5322
5356
  inputs: [
5323
- {
5324
- indexed: true,
5325
- internalType: "bytes32",
5326
- name: "bundleHash",
5327
- type: "bytes32"
5328
- }
5357
+ { name: "spender", type: "address", internalType: "address" },
5358
+ { name: "amount", type: "uint256", internalType: "uint256" }
5329
5359
  ],
5330
- name: "BundleExecuted",
5331
- type: "event"
5360
+ outputs: [{ name: "", type: "bool", internalType: "bool" }],
5361
+ stateMutability: "nonpayable"
5332
5362
  },
5333
5363
  {
5334
- anonymous: false,
5364
+ type: "function",
5365
+ name: "balanceOf",
5366
+ inputs: [{ name: "", type: "address", internalType: "address" }],
5367
+ outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
5368
+ stateMutability: "view"
5369
+ },
5370
+ {
5371
+ type: "function",
5372
+ name: "decimals",
5373
+ inputs: [],
5374
+ outputs: [{ name: "", type: "uint8", internalType: "uint8" }],
5375
+ stateMutability: "view"
5376
+ },
5377
+ {
5378
+ type: "function",
5379
+ name: "mint",
5335
5380
  inputs: [
5336
- {
5337
- indexed: true,
5338
- internalType: "bytes32",
5339
- name: "bundleHash",
5340
- type: "bytes32"
5341
- }
5381
+ { name: "to", type: "address", internalType: "address" },
5382
+ { name: "amount", type: "uint256", internalType: "uint256" }
5342
5383
  ],
5343
- name: "BundleUnbundled",
5344
- type: "event"
5384
+ outputs: [],
5385
+ stateMutability: "nonpayable"
5345
5386
  },
5346
5387
  {
5347
- anonymous: false,
5388
+ type: "function",
5389
+ name: "name",
5390
+ inputs: [],
5391
+ outputs: [{ name: "", type: "string", internalType: "string" }],
5392
+ stateMutability: "view"
5393
+ },
5394
+ {
5395
+ type: "function",
5396
+ name: "owner",
5397
+ inputs: [],
5398
+ outputs: [{ name: "", type: "address", internalType: "address" }],
5399
+ stateMutability: "view"
5400
+ },
5401
+ {
5402
+ type: "function",
5403
+ name: "symbol",
5404
+ inputs: [],
5405
+ outputs: [{ name: "", type: "string", internalType: "string" }],
5406
+ stateMutability: "view"
5407
+ },
5408
+ {
5409
+ type: "function",
5410
+ name: "totalSupply",
5411
+ inputs: [],
5412
+ outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
5413
+ stateMutability: "view"
5414
+ },
5415
+ {
5416
+ type: "function",
5417
+ name: "transfer",
5348
5418
  inputs: [
5349
- {
5350
- indexed: true,
5351
- internalType: "bytes32",
5352
- name: "bundleHash",
5353
- type: "bytes32"
5354
- }
5419
+ { name: "to", type: "address", internalType: "address" },
5420
+ { name: "amount", type: "uint256", internalType: "uint256" }
5355
5421
  ],
5356
- name: "BundleVerified",
5357
- type: "event"
5422
+ outputs: [{ name: "", type: "bool", internalType: "bool" }],
5423
+ stateMutability: "nonpayable"
5358
5424
  },
5359
5425
  {
5360
- anonymous: false,
5426
+ type: "function",
5427
+ name: "transferFrom",
5361
5428
  inputs: [
5362
- {
5363
- indexed: true,
5364
- internalType: "bytes32",
5365
- name: "bundleHash",
5366
- type: "bytes32"
5367
- },
5368
- {
5369
- indexed: true,
5370
- internalType: "uint256",
5371
- name: "callIndex",
5372
- type: "uint256"
5373
- },
5374
- {
5375
- indexed: false,
5376
- internalType: "enum CallStatus",
5377
- name: "status",
5378
- type: "uint8"
5379
- }
5429
+ { name: "from", type: "address", internalType: "address" },
5430
+ { name: "to", type: "address", internalType: "address" },
5431
+ { name: "amount", type: "uint256", internalType: "uint256" }
5380
5432
  ],
5381
- name: "CallProcessed",
5382
- type: "event"
5433
+ outputs: [{ name: "", type: "bool", internalType: "bool" }],
5434
+ stateMutability: "nonpayable"
5383
5435
  },
5384
5436
  {
5437
+ type: "event",
5438
+ name: "Approval",
5385
5439
  inputs: [
5386
- {
5387
- internalType: "bytes",
5388
- name: "_bundle",
5389
- type: "bytes"
5390
- },
5391
- {
5392
- components: [
5393
- {
5394
- internalType: "uint256",
5395
- name: "chainId",
5396
- type: "uint256"
5397
- },
5398
- {
5399
- internalType: "uint256",
5400
- name: "l1BatchNumber",
5401
- type: "uint256"
5402
- },
5403
- {
5404
- internalType: "uint256",
5405
- name: "l2MessageIndex",
5406
- type: "uint256"
5407
- },
5408
- {
5409
- components: [
5410
- {
5411
- internalType: "uint16",
5412
- name: "txNumberInBatch",
5413
- type: "uint16"
5414
- },
5415
- {
5416
- internalType: "address",
5417
- name: "sender",
5418
- type: "address"
5419
- },
5420
- {
5421
- internalType: "bytes",
5422
- name: "data",
5423
- type: "bytes"
5424
- }
5425
- ],
5426
- internalType: "struct L2Message",
5427
- name: "message",
5428
- type: "tuple"
5429
- },
5430
- {
5431
- internalType: "bytes32[]",
5432
- name: "proof",
5433
- type: "bytes32[]"
5434
- }
5435
- ],
5436
- internalType: "struct MessageInclusionProof",
5437
- name: "_proof",
5438
- type: "tuple"
5440
+ { name: "owner", type: "address", indexed: true, internalType: "address" },
5441
+ { name: "spender", type: "address", indexed: true, internalType: "address" },
5442
+ { name: "value", type: "uint256", indexed: false, internalType: "uint256" }
5443
+ ],
5444
+ anonymous: false
5445
+ },
5446
+ {
5447
+ type: "event",
5448
+ name: "Transfer",
5449
+ inputs: [
5450
+ { name: "from", type: "address", indexed: true, internalType: "address" },
5451
+ { name: "to", type: "address", indexed: true, internalType: "address" },
5452
+ { name: "value", type: "uint256", indexed: false, internalType: "uint256" }
5453
+ ],
5454
+ anonymous: false
5455
+ },
5456
+ { type: "error", name: "InsufficientAllowance", inputs: [] },
5457
+ { type: "error", name: "InsufficientBalance", inputs: [] },
5458
+ { type: "error", name: "NotOwner", inputs: [] }
5459
+ ];
5460
+ var IERC20_default = IERC20ABI;
5461
+
5462
+ // src/core/internal/abis/IERC7786Attributes.ts
5463
+ var IERC7786AttributesABI = [
5464
+ {
5465
+ inputs: [
5466
+ {
5467
+ internalType: "bytes",
5468
+ name: "_executionAddress",
5469
+ type: "bytes"
5439
5470
  }
5440
5471
  ],
5441
- name: "executeBundle",
5472
+ name: "executionAddress",
5442
5473
  outputs: [],
5443
- stateMutability: "nonpayable",
5474
+ stateMutability: "pure",
5444
5475
  type: "function"
5445
5476
  },
5446
5477
  {
5447
5478
  inputs: [
5448
5479
  {
5449
5480
  internalType: "uint256",
5450
- name: "_sourceChainId",
5481
+ name: "_indirectCallMessageValue",
5451
5482
  type: "uint256"
5452
- },
5453
- {
5454
- internalType: "bytes",
5455
- name: "_bundle",
5456
- type: "bytes"
5457
- },
5483
+ }
5484
+ ],
5485
+ name: "indirectCall",
5486
+ outputs: [],
5487
+ stateMutability: "pure",
5488
+ type: "function"
5489
+ },
5490
+ {
5491
+ inputs: [
5458
5492
  {
5459
- internalType: "enum CallStatus[]",
5460
- name: "_callStatus",
5461
- type: "uint8[]"
5493
+ internalType: "uint256",
5494
+ name: "_interopCallValue",
5495
+ type: "uint256"
5462
5496
  }
5463
5497
  ],
5464
- name: "unbundleBundle",
5498
+ name: "interopCallValue",
5465
5499
  outputs: [],
5466
- stateMutability: "nonpayable",
5500
+ stateMutability: "pure",
5467
5501
  type: "function"
5468
5502
  },
5469
5503
  {
5470
5504
  inputs: [
5471
5505
  {
5472
5506
  internalType: "bytes",
5473
- name: "_bundle",
5507
+ name: "_unbundlerAddress",
5474
5508
  type: "bytes"
5475
- },
5476
- {
5477
- components: [
5478
- {
5479
- internalType: "uint256",
5480
- name: "chainId",
5481
- type: "uint256"
5482
- },
5483
- {
5484
- internalType: "uint256",
5485
- name: "l1BatchNumber",
5486
- type: "uint256"
5487
- },
5488
- {
5489
- internalType: "uint256",
5490
- name: "l2MessageIndex",
5491
- type: "uint256"
5492
- },
5493
- {
5494
- components: [
5495
- {
5496
- internalType: "uint16",
5497
- name: "txNumberInBatch",
5498
- type: "uint16"
5499
- },
5500
- {
5501
- internalType: "address",
5502
- name: "sender",
5503
- type: "address"
5504
- },
5505
- {
5506
- internalType: "bytes",
5507
- name: "data",
5508
- type: "bytes"
5509
- }
5510
- ],
5511
- internalType: "struct L2Message",
5512
- name: "message",
5513
- type: "tuple"
5514
- },
5515
- {
5516
- internalType: "bytes32[]",
5517
- name: "proof",
5518
- type: "bytes32[]"
5519
- }
5520
- ],
5521
- internalType: "struct MessageInclusionProof",
5522
- name: "_proof",
5523
- type: "tuple"
5524
5509
  }
5525
5510
  ],
5526
- name: "verifyBundle",
5511
+ name: "unbundlerAddress",
5527
5512
  outputs: [],
5528
- stateMutability: "nonpayable",
5513
+ stateMutability: "pure",
5529
5514
  type: "function"
5530
5515
  }
5531
5516
  ];
5532
- var IInteropHandler_default = IInteropHandlerABI;
5517
+ var IERC7786Attributes_default = IERC7786AttributesABI;
5533
5518
 
5534
- // src/core/internal/abis/InteropRootStorage.ts
5535
- var InteropRootStorageABI = [
5519
+ // src/core/internal/abis/Mailbox.ts
5520
+ var MailboxABI = [
5536
5521
  {
5522
+ type: "constructor",
5537
5523
  inputs: [
5538
- {
5539
- internalType: "uint256",
5540
- name: "chainId",
5541
- type: "uint256"
5542
- },
5543
- {
5544
- internalType: "uint256",
5545
- name: "batchNumber",
5546
- type: "uint256"
5547
- }
5524
+ { name: "_eraChainId", type: "uint256", internalType: "uint256" },
5525
+ { name: "_l1ChainId", type: "uint256", internalType: "uint256" }
5548
5526
  ],
5549
- name: "interopRoots",
5550
- outputs: [
5527
+ stateMutability: "nonpayable"
5528
+ },
5529
+ {
5530
+ type: "function",
5531
+ name: "bridgehubRequestL2Transaction",
5532
+ inputs: [
5551
5533
  {
5552
- internalType: "bytes32",
5553
- name: "",
5554
- type: "bytes32"
5534
+ name: "_request",
5535
+ type: "tuple",
5536
+ internalType: "struct BridgehubL2TransactionRequest",
5537
+ components: [
5538
+ { name: "sender", type: "address", internalType: "address" },
5539
+ { name: "contractL2", type: "address", internalType: "address" },
5540
+ { name: "mintValue", type: "uint256", internalType: "uint256" },
5541
+ { name: "l2Value", type: "uint256", internalType: "uint256" },
5542
+ { name: "l2Calldata", type: "bytes", internalType: "bytes" },
5543
+ { name: "l2GasLimit", type: "uint256", internalType: "uint256" },
5544
+ { name: "l2GasPerPubdataByteLimit", type: "uint256", internalType: "uint256" },
5545
+ { name: "factoryDeps", type: "bytes[]", internalType: "bytes[]" },
5546
+ { name: "refundRecipient", type: "address", internalType: "address" }
5547
+ ]
5555
5548
  }
5556
5549
  ],
5557
- stateMutability: "view",
5558
- type: "function"
5559
- }
5560
- ];
5561
- var InteropRootStorage_default = InteropRootStorageABI;
5562
-
5563
- // src/core/internal/abis/L2MessageVerification.ts
5564
- var L2MessageVerificationABI = [
5550
+ outputs: [{ name: "canonicalTxHash", type: "bytes32", internalType: "bytes32" }],
5551
+ stateMutability: "nonpayable"
5552
+ },
5565
5553
  {
5566
- inputs: [],
5567
- name: "DepthMoreThanOneForRecursiveMerkleProof",
5568
- type: "error"
5554
+ type: "function",
5555
+ name: "bridgehubRequestL2TransactionOnGateway",
5556
+ inputs: [
5557
+ { name: "_canonicalTxHash", type: "bytes32", internalType: "bytes32" },
5558
+ { name: "_expirationTimestamp", type: "uint64", internalType: "uint64" }
5559
+ ],
5560
+ outputs: [],
5561
+ stateMutability: "nonpayable"
5569
5562
  },
5570
5563
  {
5571
- inputs: [],
5572
- name: "HashedLogIsDefault",
5573
- type: "error"
5564
+ type: "function",
5565
+ name: "finalizeEthWithdrawal",
5566
+ inputs: [
5567
+ { name: "_l2BatchNumber", type: "uint256", internalType: "uint256" },
5568
+ { name: "_l2MessageIndex", type: "uint256", internalType: "uint256" },
5569
+ { name: "_l2TxNumberInBatch", type: "uint16", internalType: "uint16" },
5570
+ { name: "_message", type: "bytes", internalType: "bytes" },
5571
+ { name: "_merkleProof", type: "bytes32[]", internalType: "bytes32[]" }
5572
+ ],
5573
+ outputs: [],
5574
+ stateMutability: "nonpayable"
5574
5575
  },
5575
5576
  {
5577
+ type: "function",
5578
+ name: "getName",
5576
5579
  inputs: [],
5577
- name: "InvalidProofLengthForFinalNode",
5578
- type: "error"
5580
+ outputs: [{ name: "", type: "string", internalType: "string" }],
5581
+ stateMutability: "view"
5579
5582
  },
5580
5583
  {
5581
- inputs: [],
5582
- name: "MerkleIndexOutOfBounds",
5583
- type: "error"
5584
+ type: "function",
5585
+ name: "l2TransactionBaseCost",
5586
+ inputs: [
5587
+ { name: "_gasPrice", type: "uint256", internalType: "uint256" },
5588
+ { name: "_l2GasLimit", type: "uint256", internalType: "uint256" },
5589
+ { name: "_l2GasPerPubdataByteLimit", type: "uint256", internalType: "uint256" }
5590
+ ],
5591
+ outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
5592
+ stateMutability: "view"
5584
5593
  },
5585
5594
  {
5586
- inputs: [],
5587
- name: "MerklePathEmpty",
5588
- type: "error"
5595
+ type: "function",
5596
+ name: "proveL1ToL2TransactionStatus",
5597
+ inputs: [
5598
+ { name: "_l2TxHash", type: "bytes32", internalType: "bytes32" },
5599
+ { name: "_l2BatchNumber", type: "uint256", internalType: "uint256" },
5600
+ { name: "_l2MessageIndex", type: "uint256", internalType: "uint256" },
5601
+ { name: "_l2TxNumberInBatch", type: "uint16", internalType: "uint16" },
5602
+ { name: "_merkleProof", type: "bytes32[]", internalType: "bytes32[]" },
5603
+ { name: "_status", type: "uint8", internalType: "enum TxStatus" }
5604
+ ],
5605
+ outputs: [{ name: "", type: "bool", internalType: "bool" }],
5606
+ stateMutability: "view"
5589
5607
  },
5590
5608
  {
5591
- inputs: [],
5592
- name: "MerklePathOutOfBounds",
5593
- type: "error"
5609
+ type: "function",
5610
+ name: "proveL2LeafInclusion",
5611
+ inputs: [
5612
+ { name: "_batchNumber", type: "uint256", internalType: "uint256" },
5613
+ { name: "_leafProofMask", type: "uint256", internalType: "uint256" },
5614
+ { name: "_leaf", type: "bytes32", internalType: "bytes32" },
5615
+ { name: "_proof", type: "bytes32[]", internalType: "bytes32[]" }
5616
+ ],
5617
+ outputs: [{ name: "", type: "bool", internalType: "bool" }],
5618
+ stateMutability: "view"
5594
5619
  },
5595
5620
  {
5621
+ type: "function",
5622
+ name: "proveL2LeafInclusionShared",
5596
5623
  inputs: [
5597
- {
5598
- internalType: "uint256",
5599
- name: "metadataVersion",
5600
- type: "uint256"
5601
- }
5624
+ { name: "_chainId", type: "uint256", internalType: "uint256" },
5625
+ { name: "_blockOrBatchNumber", type: "uint256", internalType: "uint256" },
5626
+ { name: "_leafProofMask", type: "uint256", internalType: "uint256" },
5627
+ { name: "_leaf", type: "bytes32", internalType: "bytes32" },
5628
+ { name: "_proof", type: "bytes32[]", internalType: "bytes32[]" }
5602
5629
  ],
5603
- name: "UnsupportedProofMetadataVersion",
5604
- type: "error"
5630
+ outputs: [{ name: "", type: "bool", internalType: "bool" }],
5631
+ stateMutability: "view"
5605
5632
  },
5606
5633
  {
5634
+ type: "function",
5635
+ name: "proveL2LogInclusion",
5607
5636
  inputs: [
5637
+ { name: "_batchNumber", type: "uint256", internalType: "uint256" },
5638
+ { name: "_index", type: "uint256", internalType: "uint256" },
5608
5639
  {
5640
+ name: "_log",
5641
+ type: "tuple",
5642
+ internalType: "struct L2Log",
5609
5643
  components: [
5610
- {
5611
- internalType: "uint256",
5612
- name: "chainId",
5613
- type: "uint256"
5614
- },
5615
- {
5616
- internalType: "uint256",
5617
- name: "l2BatchNumber",
5618
- type: "uint256"
5619
- },
5620
- {
5621
- internalType: "uint256",
5622
- name: "l2MessageIndex",
5623
- type: "uint256"
5624
- },
5625
- {
5626
- internalType: "address",
5627
- name: "l2Sender",
5628
- type: "address"
5629
- },
5630
- {
5631
- internalType: "uint16",
5632
- name: "l2TxNumberInBatch",
5633
- type: "uint16"
5634
- },
5635
- {
5636
- internalType: "bytes",
5637
- name: "message",
5638
- type: "bytes"
5639
- },
5640
- {
5641
- internalType: "bytes32[]",
5642
- name: "merkleProof",
5643
- type: "bytes32[]"
5644
- }
5645
- ],
5646
- internalType: "struct FinalizeL1DepositParams",
5647
- name: "_finalizeWithdrawalParams",
5648
- type: "tuple"
5649
- }
5650
- ],
5651
- name: "proveL1DepositParamsInclusion",
5652
- outputs: [
5653
- {
5654
- internalType: "bool",
5655
- name: "success",
5656
- type: "bool"
5657
- }
5644
+ { name: "l2ShardId", type: "uint8", internalType: "uint8" },
5645
+ { name: "isService", type: "bool", internalType: "bool" },
5646
+ { name: "txNumberInBatch", type: "uint16", internalType: "uint16" },
5647
+ { name: "sender", type: "address", internalType: "address" },
5648
+ { name: "key", type: "bytes32", internalType: "bytes32" },
5649
+ { name: "value", type: "bytes32", internalType: "bytes32" }
5650
+ ]
5651
+ },
5652
+ { name: "_proof", type: "bytes32[]", internalType: "bytes32[]" }
5658
5653
  ],
5659
- stateMutability: "view",
5660
- type: "function"
5654
+ outputs: [{ name: "", type: "bool", internalType: "bool" }],
5655
+ stateMutability: "view"
5661
5656
  },
5662
5657
  {
5658
+ type: "function",
5659
+ name: "proveL2LogInclusionShared",
5663
5660
  inputs: [
5661
+ { name: "_chainId", type: "uint256", internalType: "uint256" },
5662
+ { name: "_blockOrBatchNumber", type: "uint256", internalType: "uint256" },
5663
+ { name: "_index", type: "uint256", internalType: "uint256" },
5664
5664
  {
5665
- internalType: "uint256",
5666
- name: "_chainId",
5667
- type: "uint256"
5668
- },
5669
- {
5670
- internalType: "bytes32",
5671
- name: "_l2TxHash",
5672
- type: "bytes32"
5673
- },
5674
- {
5675
- internalType: "uint256",
5676
- name: "_l2BatchNumber",
5677
- type: "uint256"
5678
- },
5679
- {
5680
- internalType: "uint256",
5681
- name: "_l2MessageIndex",
5682
- type: "uint256"
5683
- },
5684
- {
5685
- internalType: "uint16",
5686
- name: "_l2TxNumberInBatch",
5687
- type: "uint16"
5688
- },
5689
- {
5690
- internalType: "bytes32[]",
5691
- name: "_merkleProof",
5692
- type: "bytes32[]"
5665
+ name: "_log",
5666
+ type: "tuple",
5667
+ internalType: "struct L2Log",
5668
+ components: [
5669
+ { name: "l2ShardId", type: "uint8", internalType: "uint8" },
5670
+ { name: "isService", type: "bool", internalType: "bool" },
5671
+ { name: "txNumberInBatch", type: "uint16", internalType: "uint16" },
5672
+ { name: "sender", type: "address", internalType: "address" },
5673
+ { name: "key", type: "bytes32", internalType: "bytes32" },
5674
+ { name: "value", type: "bytes32", internalType: "bytes32" }
5675
+ ]
5693
5676
  },
5694
- {
5695
- internalType: "enum TxStatus",
5696
- name: "_status",
5697
- type: "uint8"
5698
- }
5699
- ],
5700
- name: "proveL1ToL2TransactionStatusShared",
5701
- outputs: [
5702
- {
5703
- internalType: "bool",
5704
- name: "",
5705
- type: "bool"
5706
- }
5677
+ { name: "_proof", type: "bytes32[]", internalType: "bytes32[]" }
5707
5678
  ],
5708
- stateMutability: "view",
5709
- type: "function"
5679
+ outputs: [{ name: "", type: "bool", internalType: "bool" }],
5680
+ stateMutability: "view"
5710
5681
  },
5711
5682
  {
5683
+ type: "function",
5684
+ name: "proveL2MessageInclusion",
5712
5685
  inputs: [
5686
+ { name: "_batchNumber", type: "uint256", internalType: "uint256" },
5687
+ { name: "_index", type: "uint256", internalType: "uint256" },
5713
5688
  {
5714
- internalType: "uint256",
5715
- name: "_chainId",
5716
- type: "uint256"
5717
- },
5718
- {
5719
- internalType: "uint256",
5720
- name: "_blockOrBatchNumber",
5721
- type: "uint256"
5722
- },
5723
- {
5724
- internalType: "uint256",
5725
- name: "_leafProofMask",
5726
- type: "uint256"
5689
+ name: "_message",
5690
+ type: "tuple",
5691
+ internalType: "struct L2Message",
5692
+ components: [
5693
+ { name: "txNumberInBatch", type: "uint16", internalType: "uint16" },
5694
+ { name: "sender", type: "address", internalType: "address" },
5695
+ { name: "data", type: "bytes", internalType: "bytes" }
5696
+ ]
5727
5697
  },
5698
+ { name: "_proof", type: "bytes32[]", internalType: "bytes32[]" }
5699
+ ],
5700
+ outputs: [{ name: "", type: "bool", internalType: "bool" }],
5701
+ stateMutability: "view"
5702
+ },
5703
+ {
5704
+ type: "function",
5705
+ name: "proveL2MessageInclusionShared",
5706
+ inputs: [
5707
+ { name: "_chainId", type: "uint256", internalType: "uint256" },
5708
+ { name: "_blockOrBatchNumber", type: "uint256", internalType: "uint256" },
5709
+ { name: "_index", type: "uint256", internalType: "uint256" },
5728
5710
  {
5729
- internalType: "bytes32",
5730
- name: "_leaf",
5731
- type: "bytes32"
5711
+ name: "_message",
5712
+ type: "tuple",
5713
+ internalType: "struct L2Message",
5714
+ components: [
5715
+ { name: "txNumberInBatch", type: "uint16", internalType: "uint16" },
5716
+ { name: "sender", type: "address", internalType: "address" },
5717
+ { name: "data", type: "bytes", internalType: "bytes" }
5718
+ ]
5732
5719
  },
5733
- {
5734
- internalType: "bytes32[]",
5735
- name: "_proof",
5736
- type: "bytes32[]"
5737
- }
5720
+ { name: "_proof", type: "bytes32[]", internalType: "bytes32[]" }
5738
5721
  ],
5739
- name: "proveL2LeafInclusionShared",
5740
- outputs: [
5741
- {
5742
- internalType: "bool",
5743
- name: "",
5744
- type: "bool"
5745
- }
5722
+ outputs: [{ name: "", type: "bool", internalType: "bool" }],
5723
+ stateMutability: "view"
5724
+ },
5725
+ {
5726
+ type: "function",
5727
+ name: "requestL2ServiceTransaction",
5728
+ inputs: [
5729
+ { name: "_contractL2", type: "address", internalType: "address" },
5730
+ { name: "_l2Calldata", type: "bytes", internalType: "bytes" }
5746
5731
  ],
5747
- stateMutability: "view",
5748
- type: "function"
5732
+ outputs: [{ name: "canonicalTxHash", type: "bytes32", internalType: "bytes32" }],
5733
+ stateMutability: "nonpayable"
5749
5734
  },
5750
5735
  {
5736
+ type: "function",
5737
+ name: "requestL2Transaction",
5751
5738
  inputs: [
5752
- {
5753
- internalType: "uint256",
5754
- name: "_chainId",
5755
- type: "uint256"
5756
- },
5757
- {
5758
- internalType: "uint256",
5759
- name: "_blockOrBatchNumber",
5760
- type: "uint256"
5761
- },
5762
- {
5763
- internalType: "uint256",
5764
- name: "_leafProofMask",
5765
- type: "uint256"
5766
- },
5767
- {
5768
- internalType: "bytes32",
5769
- name: "_leaf",
5770
- type: "bytes32"
5771
- },
5772
- {
5773
- internalType: "bytes32[]",
5774
- name: "_proof",
5775
- type: "bytes32[]"
5776
- },
5777
- {
5778
- internalType: "uint256",
5779
- name: "_depth",
5780
- type: "uint256"
5781
- }
5739
+ { name: "_contractL2", type: "address", internalType: "address" },
5740
+ { name: "_l2Value", type: "uint256", internalType: "uint256" },
5741
+ { name: "_calldata", type: "bytes", internalType: "bytes" },
5742
+ { name: "_l2GasLimit", type: "uint256", internalType: "uint256" },
5743
+ { name: "_l2GasPerPubdataByteLimit", type: "uint256", internalType: "uint256" },
5744
+ { name: "_factoryDeps", type: "bytes[]", internalType: "bytes[]" },
5745
+ { name: "_refundRecipient", type: "address", internalType: "address" }
5782
5746
  ],
5783
- name: "proveL2LeafInclusionSharedRecursive",
5784
- outputs: [
5785
- {
5786
- internalType: "bool",
5787
- name: "",
5788
- type: "bool"
5789
- }
5747
+ outputs: [{ name: "canonicalTxHash", type: "bytes32", internalType: "bytes32" }],
5748
+ stateMutability: "payable"
5749
+ },
5750
+ {
5751
+ type: "function",
5752
+ name: "requestL2TransactionToGatewayMailbox",
5753
+ inputs: [
5754
+ { name: "_chainId", type: "uint256", internalType: "uint256" },
5755
+ { name: "_canonicalTxHash", type: "bytes32", internalType: "bytes32" },
5756
+ { name: "_expirationTimestamp", type: "uint64", internalType: "uint64" }
5790
5757
  ],
5791
- stateMutability: "view",
5792
- type: "function"
5758
+ outputs: [{ name: "canonicalTxHash", type: "bytes32", internalType: "bytes32" }],
5759
+ stateMutability: "nonpayable"
5793
5760
  },
5794
5761
  {
5762
+ type: "event",
5763
+ name: "NewPriorityRequest",
5795
5764
  inputs: [
5765
+ { name: "txId", type: "uint256", indexed: false, internalType: "uint256" },
5766
+ { name: "txHash", type: "bytes32", indexed: false, internalType: "bytes32" },
5796
5767
  {
5797
- internalType: "uint256",
5798
- name: "_chainId",
5799
- type: "uint256"
5800
- },
5801
- {
5802
- internalType: "uint256",
5803
- name: "_blockOrBatchNumber",
5804
- type: "uint256"
5805
- },
5806
- {
5807
- internalType: "uint256",
5808
- name: "_index",
5809
- type: "uint256"
5768
+ name: "expirationTimestamp",
5769
+ type: "uint64",
5770
+ indexed: false,
5771
+ internalType: "uint64"
5810
5772
  },
5811
5773
  {
5774
+ name: "transaction",
5775
+ type: "tuple",
5776
+ indexed: false,
5777
+ internalType: "struct L2CanonicalTransaction",
5812
5778
  components: [
5813
- {
5814
- internalType: "uint8",
5815
- name: "l2ShardId",
5816
- type: "uint8"
5817
- },
5818
- {
5819
- internalType: "bool",
5820
- name: "isService",
5821
- type: "bool"
5822
- },
5823
- {
5824
- internalType: "uint16",
5825
- name: "txNumberInBatch",
5826
- type: "uint16"
5827
- },
5828
- {
5829
- internalType: "address",
5830
- name: "sender",
5831
- type: "address"
5832
- },
5833
- {
5834
- internalType: "bytes32",
5835
- name: "key",
5836
- type: "bytes32"
5837
- },
5838
- {
5839
- internalType: "bytes32",
5840
- name: "value",
5841
- type: "bytes32"
5842
- }
5843
- ],
5844
- internalType: "struct L2Log",
5845
- name: "_log",
5846
- type: "tuple"
5779
+ { name: "txType", type: "uint256", internalType: "uint256" },
5780
+ { name: "from", type: "uint256", internalType: "uint256" },
5781
+ { name: "to", type: "uint256", internalType: "uint256" },
5782
+ { name: "gasLimit", type: "uint256", internalType: "uint256" },
5783
+ { name: "gasPerPubdataByteLimit", type: "uint256", internalType: "uint256" },
5784
+ { name: "maxFeePerGas", type: "uint256", internalType: "uint256" },
5785
+ { name: "maxPriorityFeePerGas", type: "uint256", internalType: "uint256" },
5786
+ { name: "paymaster", type: "uint256", internalType: "uint256" },
5787
+ { name: "nonce", type: "uint256", internalType: "uint256" },
5788
+ { name: "value", type: "uint256", internalType: "uint256" },
5789
+ { name: "reserved", type: "uint256[4]", internalType: "uint256[4]" },
5790
+ { name: "data", type: "bytes", internalType: "bytes" },
5791
+ { name: "signature", type: "bytes", internalType: "bytes" },
5792
+ { name: "factoryDeps", type: "uint256[]", internalType: "uint256[]" },
5793
+ { name: "paymasterInput", type: "bytes", internalType: "bytes" },
5794
+ { name: "reservedDynamic", type: "bytes", internalType: "bytes" }
5795
+ ]
5847
5796
  },
5848
- {
5849
- internalType: "bytes32[]",
5850
- name: "_proof",
5851
- type: "bytes32[]"
5852
- }
5797
+ { name: "factoryDeps", type: "bytes[]", indexed: false, internalType: "bytes[]" }
5853
5798
  ],
5854
- name: "proveL2LogInclusionShared",
5855
- outputs: [
5799
+ anonymous: false
5800
+ },
5801
+ {
5802
+ type: "event",
5803
+ name: "NewPriorityRequestId",
5804
+ inputs: [
5805
+ { name: "txId", type: "uint256", indexed: true, internalType: "uint256" },
5806
+ { name: "txHash", type: "bytes32", indexed: true, internalType: "bytes32" }
5807
+ ],
5808
+ anonymous: false
5809
+ },
5810
+ {
5811
+ type: "event",
5812
+ name: "NewRelayedPriorityTransaction",
5813
+ inputs: [
5814
+ { name: "txId", type: "uint256", indexed: false, internalType: "uint256" },
5815
+ { name: "txHash", type: "bytes32", indexed: false, internalType: "bytes32" },
5856
5816
  {
5857
- internalType: "bool",
5858
- name: "",
5859
- type: "bool"
5817
+ name: "expirationTimestamp",
5818
+ type: "uint64",
5819
+ indexed: false,
5820
+ internalType: "uint64"
5860
5821
  }
5861
5822
  ],
5862
- stateMutability: "view",
5863
- type: "function"
5823
+ anonymous: false
5824
+ },
5825
+ { type: "error", name: "BaseTokenGasPriceDenominatorNotSet", inputs: [] },
5826
+ {
5827
+ type: "error",
5828
+ name: "BatchNotExecuted",
5829
+ inputs: [{ name: "batchNumber", type: "uint256", internalType: "uint256" }]
5830
+ },
5831
+ { type: "error", name: "GasPerPubdataMismatch", inputs: [] },
5832
+ { type: "error", name: "HashedLogIsDefault", inputs: [] },
5833
+ { type: "error", name: "InvalidChainId", inputs: [] },
5834
+ { type: "error", name: "InvalidProofLengthForFinalNode", inputs: [] },
5835
+ {
5836
+ type: "error",
5837
+ name: "LengthIsNotDivisibleBy32",
5838
+ inputs: [{ name: "length", type: "uint256", internalType: "uint256" }]
5839
+ },
5840
+ { type: "error", name: "LocalRootIsZero", inputs: [] },
5841
+ { type: "error", name: "LocalRootMustBeZero", inputs: [] },
5842
+ {
5843
+ type: "error",
5844
+ name: "MalformedBytecode",
5845
+ inputs: [{ name: "", type: "uint8", internalType: "enum BytecodeError" }]
5864
5846
  },
5847
+ { type: "error", name: "MerkleIndexOutOfBounds", inputs: [] },
5848
+ { type: "error", name: "MerklePathEmpty", inputs: [] },
5849
+ { type: "error", name: "MerklePathOutOfBounds", inputs: [] },
5850
+ {
5851
+ type: "error",
5852
+ name: "MsgValueTooLow",
5853
+ inputs: [
5854
+ { name: "required", type: "uint256", internalType: "uint256" },
5855
+ { name: "provided", type: "uint256", internalType: "uint256" }
5856
+ ]
5857
+ },
5858
+ { type: "error", name: "NotHyperchain", inputs: [] },
5859
+ { type: "error", name: "NotInitializedReentrancyGuard", inputs: [] },
5860
+ {
5861
+ type: "error",
5862
+ name: "NotL1",
5863
+ inputs: [{ name: "blockChainId", type: "uint256", internalType: "uint256" }]
5864
+ },
5865
+ { type: "error", name: "NotSettlementLayer", inputs: [] },
5866
+ { type: "error", name: "OnlyEraSupported", inputs: [] },
5867
+ {
5868
+ type: "error",
5869
+ name: "PubdataGreaterThanLimit",
5870
+ inputs: [
5871
+ { name: "limit", type: "uint256", internalType: "uint256" },
5872
+ { name: "length", type: "uint256", internalType: "uint256" }
5873
+ ]
5874
+ },
5875
+ { type: "error", name: "Reentrancy", inputs: [] },
5876
+ { type: "error", name: "TooManyFactoryDeps", inputs: [] },
5877
+ { type: "error", name: "TooMuchGas", inputs: [] },
5878
+ { type: "error", name: "TransactionNotAllowed", inputs: [] },
5879
+ { type: "error", name: "TxnBodyGasLimitNotEnoughGas", inputs: [] },
5880
+ {
5881
+ type: "error",
5882
+ name: "Unauthorized",
5883
+ inputs: [{ name: "caller", type: "address", internalType: "address" }]
5884
+ },
5885
+ {
5886
+ type: "error",
5887
+ name: "UnsupportedProofMetadataVersion",
5888
+ inputs: [{ name: "metadataVersion", type: "uint256", internalType: "uint256" }]
5889
+ },
5890
+ { type: "error", name: "ValidateTxnNotEnoughGas", inputs: [] },
5891
+ { type: "error", name: "ZeroGasPriceL1TxZKSyncOS", inputs: [] }
5892
+ ];
5893
+ var Mailbox_default = MailboxABI;
5894
+
5895
+ // src/core/internal/abis/InteropRootStorage.ts
5896
+ var InteropRootStorageABI = [
5865
5897
  {
5866
5898
  inputs: [
5867
5899
  {
5868
5900
  internalType: "uint256",
5869
- name: "_chainId",
5870
- type: "uint256"
5871
- },
5872
- {
5873
- internalType: "uint256",
5874
- name: "_blockOrBatchNumber",
5901
+ name: "chainId",
5875
5902
  type: "uint256"
5876
5903
  },
5877
5904
  {
5878
5905
  internalType: "uint256",
5879
- name: "_index",
5906
+ name: "batchNumber",
5880
5907
  type: "uint256"
5881
- },
5882
- {
5883
- components: [
5884
- {
5885
- internalType: "uint16",
5886
- name: "txNumberInBatch",
5887
- type: "uint16"
5888
- },
5889
- {
5890
- internalType: "address",
5891
- name: "sender",
5892
- type: "address"
5893
- },
5894
- {
5895
- internalType: "bytes",
5896
- name: "data",
5897
- type: "bytes"
5898
- }
5899
- ],
5900
- internalType: "struct L2Message",
5901
- name: "_message",
5902
- type: "tuple"
5903
- },
5904
- {
5905
- internalType: "bytes32[]",
5906
- name: "_proof",
5907
- type: "bytes32[]"
5908
5908
  }
5909
5909
  ],
5910
- name: "proveL2MessageInclusionShared",
5910
+ name: "interopRoots",
5911
5911
  outputs: [
5912
5912
  {
5913
- internalType: "bool",
5913
+ internalType: "bytes32",
5914
5914
  name: "",
5915
- type: "bool"
5915
+ type: "bytes32"
5916
5916
  }
5917
5917
  ],
5918
5918
  stateMutability: "view",
5919
5919
  type: "function"
5920
5920
  }
5921
5921
  ];
5922
- var L2MessageVerification_default = L2MessageVerificationABI;
5922
+ var InteropRootStorage_default = InteropRootStorageABI;
5923
+
5924
+ // src/core/utils/hash.ts
5925
+ var RegExpHex = /^0x[0-9a-fA-F]*$/;
5926
+ var isHash = (x, length) => {
5927
+ if (!x || typeof x !== "string") return false;
5928
+ return (length === void 0 || x.length === length) && RegExpHex.test(x);
5929
+ };
5930
+ var isHashArray = (x, length) => {
5931
+ if (!Array.isArray(x)) return false;
5932
+ return x.every((item) => isHash(item, length));
5933
+ };
5934
+ var isHash66 = (x) => isHash(x, 66);
5935
+ var isHash66Array = (x) => isHashArray(x, 66);
5936
+
5937
+ // src/core/utils/addr.ts
5938
+ function isAddress(x) {
5939
+ return isHash(x, 42);
5940
+ }
5941
+ function isAddressEq(a, b) {
5942
+ return a.toLowerCase() === b.toLowerCase();
5943
+ }
5944
+ function isETH(token) {
5945
+ return isAddressEq(token, FORMAL_ETH_ADDRESS) || isAddressEq(token, L2_BASE_TOKEN_ADDRESS) || isAddressEq(token, ETH_ADDRESS);
5946
+ }
5947
+ function normalizeAddrEq(a, b) {
5948
+ if (!a || !b) return false;
5949
+ const normalize = (s) => {
5950
+ const hasPrefix = s.slice(0, 2).toLowerCase() === "0x";
5951
+ const body = hasPrefix ? s.slice(2) : s;
5952
+ return `0x${body.toLowerCase()}`;
5953
+ };
5954
+ return normalize(a) === normalize(b);
5955
+ }
5956
+ var hexEq = (a, b) => a.toLowerCase() === b.toLowerCase();
5957
+ var normalizeL1Token = (token) => isAddressEq(token, FORMAL_ETH_ADDRESS) ? ETH_ADDRESS : token;
5923
5958
 
5924
5959
  // src/core/utils/number.ts
5925
5960
  var isNumber = (x) => typeof x === "number" && Number.isFinite(x);
5926
5961
  var isBigint = (x) => typeof x === "bigint";
5927
5962
 
5963
+ // src/core/utils/index.ts
5964
+ function sleep(ms) {
5965
+ return new Promise((resolve) => setTimeout(resolve, ms));
5966
+ }
5967
+ function assertNever(x) {
5968
+ throw new Error("Unexpected action type: " + String(x));
5969
+ }
5970
+
5928
5971
  // src/core/errors/formatter.ts
5929
5972
  function elideMiddle(s, max = 96) {
5930
5973
  if (s.length <= max) return s;
@@ -6070,12 +6113,18 @@ if (kInspect) {
6070
6113
  enumerable: false
6071
6114
  });
6072
6115
  }
6073
- function isZKsyncError(e) {
6116
+ function isZKsyncError(e, opts) {
6074
6117
  if (!e || typeof e !== "object") return false;
6075
6118
  const maybe = e;
6076
6119
  if (!("envelope" in maybe)) return false;
6077
6120
  const envelope = maybe.envelope;
6078
- return typeof envelope?.type === "string" && typeof envelope?.message === "string";
6121
+ if (typeof envelope?.type !== "string" || typeof envelope?.message !== "string") return false;
6122
+ if (opts?.type && envelope.type !== opts.type) return false;
6123
+ if (opts?.resource && envelope.resource !== opts.resource) return false;
6124
+ if (opts?.operation && envelope.operation !== opts.operation) return false;
6125
+ if (opts?.messageIncludes && !envelope.message.toLowerCase().includes(opts.messageIncludes.toLowerCase()))
6126
+ return false;
6127
+ return true;
6079
6128
  }
6080
6129
  function isReceiptNotFound(e) {
6081
6130
  const chain = [];
@@ -6122,6 +6171,10 @@ function isReceiptNotFound(e) {
6122
6171
  })();
6123
6172
  return MSG_RE.test(raw);
6124
6173
  }
6174
+ var OP_CLIENT = {
6175
+ ensureAddresses: "client.ensureAddresses",
6176
+ getSemverProtocolVersion: "client.getSemverProtocolVersion"
6177
+ };
6125
6178
  var OP_DEPOSITS = {
6126
6179
  // high-level flow ops
6127
6180
  quote: "deposits.quote",
@@ -6209,11 +6262,9 @@ var OP_WITHDRAWALS = {
6209
6262
  rawReceipt: "withdrawals.finalize.fetchParams:rawReceipt",
6210
6263
  messengerIndex: "withdrawals.finalize.fetchParams:messengerIndex",
6211
6264
  proof: "withdrawals.finalize.fetchParams:proof",
6212
- network: "withdrawals.finalize.fetchParams:network",
6213
- ensureAddresses: "withdrawals.finalize.fetchParams:ensureAddresses"
6265
+ network: "withdrawals.finalize.fetchParams:network"
6214
6266
  },
6215
6267
  readiness: {
6216
- ensureAddresses: "withdrawals.finalize.readiness:ensureAddresses",
6217
6268
  isFinalized: "withdrawals.finalize.readiness:isWithdrawalFinalized",
6218
6269
  simulate: "withdrawals.finalize.readiness:simulate"
6219
6270
  },
@@ -6223,6 +6274,54 @@ var OP_WITHDRAWALS = {
6223
6274
  estimate: "withdrawals.finalize.estimateFinalizationFees"
6224
6275
  }
6225
6276
  };
6277
+ var OP_INTEROP = {
6278
+ // high-level flow ops (match resource methods)
6279
+ quote: "interop.quote",
6280
+ tryQuote: "interop.tryQuote",
6281
+ prepare: "interop.prepare",
6282
+ tryPrepare: "interop.tryPrepare",
6283
+ create: "interop.create",
6284
+ tryCreate: "interop.tryCreate",
6285
+ status: "interop.status",
6286
+ wait: "interop.wait",
6287
+ tryWait: "interop.tryWait",
6288
+ finalize: "interop.finalize",
6289
+ tryFinalize: "interop.tryFinalize",
6290
+ context: {
6291
+ chainTypeManager: "interop.chainTypeManager",
6292
+ protocolVersion: "interop.protocolVersion"
6293
+ },
6294
+ // route-specific ops (keep names aligned with files)
6295
+ routes: {
6296
+ direct: {
6297
+ preflight: "interop.routes.direct:preflight",
6298
+ build: "interop.routes.direct:build"
6299
+ },
6300
+ indirect: {
6301
+ preflight: "interop.routes.indirect:preflight",
6302
+ build: "interop.routes.indirect:build"
6303
+ }
6304
+ },
6305
+ // execution path (nonce, gas, send, wait) – mirrors deposits’ style
6306
+ exec: {
6307
+ sendStep: "interop.exec:sendStep",
6308
+ waitStep: "interop.exec:waitStep"
6309
+ },
6310
+ // status service (logs & derivation)
6311
+ svc: {
6312
+ status: {
6313
+ sourceReceipt: "interop.svc.status:sourceReceipt",
6314
+ parseSentLog: "interop.svc.status:parseSentLog",
6315
+ dstLogs: "interop.svc.status:dstLogs",
6316
+ derive: "interop.svc.status:derive",
6317
+ getRoot: "interop.svc.status:getRoot"
6318
+ },
6319
+ wait: {
6320
+ poll: "interop.svc.wait:poll",
6321
+ timeout: "interop.svc.wait:timeout"
6322
+ }
6323
+ }
6324
+ };
6226
6325
 
6227
6326
  // src/core/errors/factory.ts
6228
6327
  var factory_exports = {};
@@ -6259,4 +6358,4 @@ function shapeCause(err) {
6259
6358
  };
6260
6359
  }
6261
6360
 
6262
- export { IBaseToken_default, IBridgehub_default, IERC20_default, IL1AssetRouter_default, IL1Nullifier_default, IL2AssetRouter_default, L1NativeTokenVault_default, L2NativeTokenVault_default, Mailbox_default, OP_DEPOSITS, OP_WITHDRAWALS, abi_exports, createError, factory_exports, formatEnvelopePretty, isBigint, isNumber, isReceiptNotFound, isZKsyncError, shapeCause };
6361
+ export { IBaseToken_default, IBridgehub_default, IERC20_default, IERC7786Attributes_default, IInteropHandler_default, IL1AssetRouter_default, IL1Nullifier_default, IL2AssetRouter_default, InteropCenter_default, InteropRootStorage_default, L1NativeTokenVault_default, L2MessageVerification_default, L2NativeTokenVault_default, Mailbox_default, OP_CLIENT, OP_DEPOSITS, OP_INTEROP, OP_WITHDRAWALS, abi_exports, assertNever, createError, factory_exports, formatEnvelopePretty, hexEq, isAddress, isAddressEq, isBigint, isETH, isHash, isHash66, isHash66Array, isHashArray, isNumber, isReceiptNotFound, isZKsyncError, normalizeAddrEq, normalizeL1Token, shapeCause, sleep };