@optimex-xyz/market-maker-sdk 0.9.0-staging-bbae22c → 0.9.0-staging-adbbc25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,12 +1,12 @@
1
1
  import { DeferredTopicFilter, EventFragment, EventLog, TransactionRequest, Typed, ContractTransactionResponse, FunctionFragment, ContractTransaction, LogDescription, BaseContract, ContractRunner, Interface, AddressLike, BigNumberish, BytesLike, Result, Listener, ContractMethod, Provider, Signer as Signer$1, Wallet, TypedDataDomain } from 'ethers';
2
2
  import { z } from 'zod';
3
3
 
4
- type Environment = 'dev' | 'prelive' | 'production' | 'staging';
4
+ type Environment = 'development' | 'prelive' | 'production' | 'staging';
5
5
  interface EnvironmentConfig {
6
6
  backendUrl: string;
7
7
  rpcUrl: string;
8
- paymentAddressMap: Record<string, string>;
9
8
  protocolFetcherProxyAddress: string;
9
+ isTestnet: boolean;
10
10
  }
11
11
  interface AppConfig extends EnvironmentConfig {
12
12
  env: Environment;
@@ -36,8 +36,8 @@ declare class Config {
36
36
  get(): AppConfig;
37
37
  getBackendUrl(): string;
38
38
  getRpcUrl(): string;
39
- getPaymentAddress(networkId: string): string | undefined;
40
39
  getProtocolFetcherAddress(): string;
40
+ isTestnet(): boolean;
41
41
  }
42
42
  declare const config: Config;
43
43
 
@@ -986,6 +986,167 @@ interface ERC20 extends BaseContract {
986
986
  };
987
987
  }
988
988
 
989
+ interface MorphoLiquidationGatewayInterface extends Interface {
990
+ getFunction(nameOrSignature: "gatewayHelper" | "getProtocol" | "optimexDomain" | "payment" | "paymentDetails" | "setHelper" | "setProtocol"): FunctionFragment;
991
+ getEvent(nameOrSignatureOrTopic: "HelperUpdated" | "PaymentExecuted" | "ProtocolUpdated"): EventFragment;
992
+ encodeFunctionData(functionFragment: "gatewayHelper", values?: undefined): string;
993
+ encodeFunctionData(functionFragment: "getProtocol", values?: undefined): string;
994
+ encodeFunctionData(functionFragment: "optimexDomain", values?: undefined): string;
995
+ encodeFunctionData(functionFragment: "payment", values: [AddressLike, BigNumberish, BytesLike]): string;
996
+ encodeFunctionData(functionFragment: "paymentDetails", values?: undefined): string;
997
+ encodeFunctionData(functionFragment: "setHelper", values: [AddressLike]): string;
998
+ encodeFunctionData(functionFragment: "setProtocol", values: [AddressLike]): string;
999
+ decodeFunctionResult(functionFragment: "gatewayHelper", data: BytesLike): Result;
1000
+ decodeFunctionResult(functionFragment: "getProtocol", data: BytesLike): Result;
1001
+ decodeFunctionResult(functionFragment: "optimexDomain", data: BytesLike): Result;
1002
+ decodeFunctionResult(functionFragment: "payment", data: BytesLike): Result;
1003
+ decodeFunctionResult(functionFragment: "paymentDetails", data: BytesLike): Result;
1004
+ decodeFunctionResult(functionFragment: "setHelper", data: BytesLike): Result;
1005
+ decodeFunctionResult(functionFragment: "setProtocol", data: BytesLike): Result;
1006
+ }
1007
+ declare namespace HelperUpdatedEvent {
1008
+ type InputTuple = [operator: AddressLike, newHelper: AddressLike];
1009
+ type OutputTuple = [operator: string, newHelper: string];
1010
+ interface OutputObject {
1011
+ operator: string;
1012
+ newHelper: string;
1013
+ }
1014
+ type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
1015
+ type Filter = TypedDeferredTopicFilter<Event>;
1016
+ type Log = TypedEventLog<Event>;
1017
+ type LogDescription = TypedLogDescription<Event>;
1018
+ }
1019
+ declare namespace PaymentExecutedEvent {
1020
+ type InputTuple = [
1021
+ payer: AddressLike,
1022
+ liquidator: AddressLike,
1023
+ token: AddressLike,
1024
+ amount: BigNumberish
1025
+ ];
1026
+ type OutputTuple = [
1027
+ payer: string,
1028
+ liquidator: string,
1029
+ token: string,
1030
+ amount: bigint
1031
+ ];
1032
+ interface OutputObject {
1033
+ payer: string;
1034
+ liquidator: string;
1035
+ token: string;
1036
+ amount: bigint;
1037
+ }
1038
+ type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
1039
+ type Filter = TypedDeferredTopicFilter<Event>;
1040
+ type Log = TypedEventLog<Event>;
1041
+ type LogDescription = TypedLogDescription<Event>;
1042
+ }
1043
+ declare namespace ProtocolUpdatedEvent$1 {
1044
+ type InputTuple = [operator: AddressLike, newProtocol: AddressLike];
1045
+ type OutputTuple = [operator: string, newProtocol: string];
1046
+ interface OutputObject {
1047
+ operator: string;
1048
+ newProtocol: string;
1049
+ }
1050
+ type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
1051
+ type Filter = TypedDeferredTopicFilter<Event>;
1052
+ type Log = TypedEventLog<Event>;
1053
+ type LogDescription = TypedLogDescription<Event>;
1054
+ }
1055
+ interface MorphoLiquidationGateway extends BaseContract {
1056
+ connect(runner?: ContractRunner | null): MorphoLiquidationGateway;
1057
+ waitForDeployment(): Promise<this>;
1058
+ interface: MorphoLiquidationGatewayInterface;
1059
+ queryFilter<TCEvent extends TypedContractEvent>(event: TCEvent, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TypedEventLog<TCEvent>>>;
1060
+ queryFilter<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TypedEventLog<TCEvent>>>;
1061
+ on<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>;
1062
+ on<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, listener: TypedListener<TCEvent>): Promise<this>;
1063
+ once<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>;
1064
+ once<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, listener: TypedListener<TCEvent>): Promise<this>;
1065
+ listeners<TCEvent extends TypedContractEvent>(event: TCEvent): Promise<Array<TypedListener<TCEvent>>>;
1066
+ listeners(eventName?: string): Promise<Array<Listener>>;
1067
+ removeAllListeners<TCEvent extends TypedContractEvent>(event?: TCEvent): Promise<this>;
1068
+ gatewayHelper: TypedContractMethod<[], [string], "view">;
1069
+ getProtocol: TypedContractMethod<[], [string], "view">;
1070
+ optimexDomain: TypedContractMethod<[
1071
+ ], [
1072
+ [string, string] & {
1073
+ name: string;
1074
+ version: string;
1075
+ }
1076
+ ], "view">;
1077
+ payment: TypedContractMethod<[
1078
+ token: AddressLike,
1079
+ amount: BigNumberish,
1080
+ externalCall: BytesLike
1081
+ ], [
1082
+ void
1083
+ ], "nonpayable">;
1084
+ paymentDetails: TypedContractMethod<[
1085
+ ], [
1086
+ [
1087
+ string,
1088
+ string,
1089
+ bigint
1090
+ ] & {
1091
+ payer: string;
1092
+ paymentToken: string;
1093
+ paymentAmount: bigint;
1094
+ }
1095
+ ], "view">;
1096
+ setHelper: TypedContractMethod<[
1097
+ newHelper: AddressLike
1098
+ ], [
1099
+ void
1100
+ ], "nonpayable">;
1101
+ setProtocol: TypedContractMethod<[
1102
+ newProtocol: AddressLike
1103
+ ], [
1104
+ void
1105
+ ], "nonpayable">;
1106
+ getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T;
1107
+ getFunction(nameOrSignature: "gatewayHelper"): TypedContractMethod<[], [string], "view">;
1108
+ getFunction(nameOrSignature: "getProtocol"): TypedContractMethod<[], [string], "view">;
1109
+ getFunction(nameOrSignature: "optimexDomain"): TypedContractMethod<[
1110
+ ], [
1111
+ [string, string] & {
1112
+ name: string;
1113
+ version: string;
1114
+ }
1115
+ ], "view">;
1116
+ getFunction(nameOrSignature: "payment"): TypedContractMethod<[
1117
+ token: AddressLike,
1118
+ amount: BigNumberish,
1119
+ externalCall: BytesLike
1120
+ ], [
1121
+ void
1122
+ ], "nonpayable">;
1123
+ getFunction(nameOrSignature: "paymentDetails"): TypedContractMethod<[
1124
+ ], [
1125
+ [
1126
+ string,
1127
+ string,
1128
+ bigint
1129
+ ] & {
1130
+ payer: string;
1131
+ paymentToken: string;
1132
+ paymentAmount: bigint;
1133
+ }
1134
+ ], "view">;
1135
+ getFunction(nameOrSignature: "setHelper"): TypedContractMethod<[newHelper: AddressLike], [void], "nonpayable">;
1136
+ getFunction(nameOrSignature: "setProtocol"): TypedContractMethod<[newProtocol: AddressLike], [void], "nonpayable">;
1137
+ getEvent(key: "HelperUpdated"): TypedContractEvent<HelperUpdatedEvent.InputTuple, HelperUpdatedEvent.OutputTuple, HelperUpdatedEvent.OutputObject>;
1138
+ getEvent(key: "PaymentExecuted"): TypedContractEvent<PaymentExecutedEvent.InputTuple, PaymentExecutedEvent.OutputTuple, PaymentExecutedEvent.OutputObject>;
1139
+ getEvent(key: "ProtocolUpdated"): TypedContractEvent<ProtocolUpdatedEvent$1.InputTuple, ProtocolUpdatedEvent$1.OutputTuple, ProtocolUpdatedEvent$1.OutputObject>;
1140
+ filters: {
1141
+ "HelperUpdated(address,address)": TypedContractEvent<HelperUpdatedEvent.InputTuple, HelperUpdatedEvent.OutputTuple, HelperUpdatedEvent.OutputObject>;
1142
+ HelperUpdated: TypedContractEvent<HelperUpdatedEvent.InputTuple, HelperUpdatedEvent.OutputTuple, HelperUpdatedEvent.OutputObject>;
1143
+ "PaymentExecuted(address,address,address,uint256)": TypedContractEvent<PaymentExecutedEvent.InputTuple, PaymentExecutedEvent.OutputTuple, PaymentExecutedEvent.OutputObject>;
1144
+ PaymentExecuted: TypedContractEvent<PaymentExecutedEvent.InputTuple, PaymentExecutedEvent.OutputTuple, PaymentExecutedEvent.OutputObject>;
1145
+ "ProtocolUpdated(address,address)": TypedContractEvent<ProtocolUpdatedEvent$1.InputTuple, ProtocolUpdatedEvent$1.OutputTuple, ProtocolUpdatedEvent$1.OutputObject>;
1146
+ ProtocolUpdated: TypedContractEvent<ProtocolUpdatedEvent$1.InputTuple, ProtocolUpdatedEvent$1.OutputTuple, ProtocolUpdatedEvent$1.OutputObject>;
1147
+ };
1148
+ }
1149
+
989
1150
  interface PaymentInterface extends Interface {
990
1151
  getFunction(nameOrSignature: "payment" | "protocol" | "setProtocol"): FunctionFragment;
991
1152
  getEvent(nameOrSignatureOrTopic: "PaymentTransferred" | "ProtocolUpdated"): EventFragment;
@@ -1131,15 +1292,23 @@ declare namespace ITypes$2 {
1131
1292
  };
1132
1293
  }
1133
1294
  interface ProtocolFetcherProxyInterface extends Interface {
1134
- getFunction(nameOrSignature: "getLatestMPCInfo" | "getMPCInfo" | "getManagementOwner" | "getPFeeRate" | "getPMMAccounts" | "getProtocolState" | "getTokens" | "getVault" | "isMPCNode" | "isSolver" | "isValidNetwork" | "isValidPMM" | "isValidPMMAccount" | "isValidPubkey" | "isValidToken" | "numOfPMMAccounts" | "numOfSupportedTokens" | "pManagement" | "registry" | "router" | "setProtocolManagement" | "setRouter" | "setSignerExtension" | "setVaultRegistry" | "signerExtension"): FunctionFragment;
1295
+ getFunction(nameOrSignature: "DEFAULT_ADMIN_ROLE" | "getLatestMPCInfo" | "getMPCInfo" | "getManagementOwner" | "getPFeeRate" | "getPMMAccounts" | "getProtocolState" | "getRoleAdmin" | "getRoleMember" | "getRoleMemberCount" | "getRoleMembers" | "getTokens" | "getVault" | "grantRole" | "hasRole" | "isMPCNode" | "isSolver" | "isValidNetwork" | "isValidPMM" | "isValidPMMAccount" | "isValidPubkey" | "isValidToken" | "numOfPMMAccounts" | "numOfSupportedTokens" | "pManagement" | "registry" | "renounceRole" | "revokeRole" | "router" | "setProtocolManagement" | "setRouter" | "setSignerExtension" | "setVaultRegistry" | "signerExtension" | "supportsInterface"): FunctionFragment;
1296
+ getEvent(nameOrSignatureOrTopic: "RoleAdminChanged" | "RoleGranted" | "RoleRevoked"): EventFragment;
1297
+ encodeFunctionData(functionFragment: "DEFAULT_ADMIN_ROLE", values?: undefined): string;
1135
1298
  encodeFunctionData(functionFragment: "getLatestMPCInfo", values: [BytesLike]): string;
1136
1299
  encodeFunctionData(functionFragment: "getMPCInfo", values: [BytesLike, BytesLike]): string;
1137
1300
  encodeFunctionData(functionFragment: "getManagementOwner", values?: undefined): string;
1138
1301
  encodeFunctionData(functionFragment: "getPFeeRate", values: [[BytesLike, BytesLike, BytesLike, BytesLike]]): string;
1139
1302
  encodeFunctionData(functionFragment: "getPMMAccounts", values: [BytesLike, BigNumberish, BigNumberish]): string;
1140
1303
  encodeFunctionData(functionFragment: "getProtocolState", values?: undefined): string;
1304
+ encodeFunctionData(functionFragment: "getRoleAdmin", values: [BytesLike]): string;
1305
+ encodeFunctionData(functionFragment: "getRoleMember", values: [BytesLike, BigNumberish]): string;
1306
+ encodeFunctionData(functionFragment: "getRoleMemberCount", values: [BytesLike]): string;
1307
+ encodeFunctionData(functionFragment: "getRoleMembers", values: [BytesLike]): string;
1141
1308
  encodeFunctionData(functionFragment: "getTokens", values: [BigNumberish, BigNumberish]): string;
1142
1309
  encodeFunctionData(functionFragment: "getVault", values: [BytesLike, BytesLike]): string;
1310
+ encodeFunctionData(functionFragment: "grantRole", values: [BytesLike, AddressLike]): string;
1311
+ encodeFunctionData(functionFragment: "hasRole", values: [BytesLike, AddressLike]): string;
1143
1312
  encodeFunctionData(functionFragment: "isMPCNode", values: [AddressLike]): string;
1144
1313
  encodeFunctionData(functionFragment: "isSolver", values: [AddressLike]): string;
1145
1314
  encodeFunctionData(functionFragment: "isValidNetwork", values: [BytesLike]): string;
@@ -1151,20 +1320,30 @@ interface ProtocolFetcherProxyInterface extends Interface {
1151
1320
  encodeFunctionData(functionFragment: "numOfSupportedTokens", values?: undefined): string;
1152
1321
  encodeFunctionData(functionFragment: "pManagement", values?: undefined): string;
1153
1322
  encodeFunctionData(functionFragment: "registry", values?: undefined): string;
1323
+ encodeFunctionData(functionFragment: "renounceRole", values: [BytesLike, AddressLike]): string;
1324
+ encodeFunctionData(functionFragment: "revokeRole", values: [BytesLike, AddressLike]): string;
1154
1325
  encodeFunctionData(functionFragment: "router", values?: undefined): string;
1155
1326
  encodeFunctionData(functionFragment: "setProtocolManagement", values: [AddressLike]): string;
1156
1327
  encodeFunctionData(functionFragment: "setRouter", values: [AddressLike]): string;
1157
1328
  encodeFunctionData(functionFragment: "setSignerExtension", values: [AddressLike]): string;
1158
1329
  encodeFunctionData(functionFragment: "setVaultRegistry", values: [AddressLike]): string;
1159
1330
  encodeFunctionData(functionFragment: "signerExtension", values?: undefined): string;
1331
+ encodeFunctionData(functionFragment: "supportsInterface", values: [BytesLike]): string;
1332
+ decodeFunctionResult(functionFragment: "DEFAULT_ADMIN_ROLE", data: BytesLike): Result;
1160
1333
  decodeFunctionResult(functionFragment: "getLatestMPCInfo", data: BytesLike): Result;
1161
1334
  decodeFunctionResult(functionFragment: "getMPCInfo", data: BytesLike): Result;
1162
1335
  decodeFunctionResult(functionFragment: "getManagementOwner", data: BytesLike): Result;
1163
1336
  decodeFunctionResult(functionFragment: "getPFeeRate", data: BytesLike): Result;
1164
1337
  decodeFunctionResult(functionFragment: "getPMMAccounts", data: BytesLike): Result;
1165
1338
  decodeFunctionResult(functionFragment: "getProtocolState", data: BytesLike): Result;
1339
+ decodeFunctionResult(functionFragment: "getRoleAdmin", data: BytesLike): Result;
1340
+ decodeFunctionResult(functionFragment: "getRoleMember", data: BytesLike): Result;
1341
+ decodeFunctionResult(functionFragment: "getRoleMemberCount", data: BytesLike): Result;
1342
+ decodeFunctionResult(functionFragment: "getRoleMembers", data: BytesLike): Result;
1166
1343
  decodeFunctionResult(functionFragment: "getTokens", data: BytesLike): Result;
1167
1344
  decodeFunctionResult(functionFragment: "getVault", data: BytesLike): Result;
1345
+ decodeFunctionResult(functionFragment: "grantRole", data: BytesLike): Result;
1346
+ decodeFunctionResult(functionFragment: "hasRole", data: BytesLike): Result;
1168
1347
  decodeFunctionResult(functionFragment: "isMPCNode", data: BytesLike): Result;
1169
1348
  decodeFunctionResult(functionFragment: "isSolver", data: BytesLike): Result;
1170
1349
  decodeFunctionResult(functionFragment: "isValidNetwork", data: BytesLike): Result;
@@ -1176,12 +1355,70 @@ interface ProtocolFetcherProxyInterface extends Interface {
1176
1355
  decodeFunctionResult(functionFragment: "numOfSupportedTokens", data: BytesLike): Result;
1177
1356
  decodeFunctionResult(functionFragment: "pManagement", data: BytesLike): Result;
1178
1357
  decodeFunctionResult(functionFragment: "registry", data: BytesLike): Result;
1358
+ decodeFunctionResult(functionFragment: "renounceRole", data: BytesLike): Result;
1359
+ decodeFunctionResult(functionFragment: "revokeRole", data: BytesLike): Result;
1179
1360
  decodeFunctionResult(functionFragment: "router", data: BytesLike): Result;
1180
1361
  decodeFunctionResult(functionFragment: "setProtocolManagement", data: BytesLike): Result;
1181
1362
  decodeFunctionResult(functionFragment: "setRouter", data: BytesLike): Result;
1182
1363
  decodeFunctionResult(functionFragment: "setSignerExtension", data: BytesLike): Result;
1183
1364
  decodeFunctionResult(functionFragment: "setVaultRegistry", data: BytesLike): Result;
1184
1365
  decodeFunctionResult(functionFragment: "signerExtension", data: BytesLike): Result;
1366
+ decodeFunctionResult(functionFragment: "supportsInterface", data: BytesLike): Result;
1367
+ }
1368
+ declare namespace RoleAdminChangedEvent {
1369
+ type InputTuple = [
1370
+ role: BytesLike,
1371
+ previousAdminRole: BytesLike,
1372
+ newAdminRole: BytesLike
1373
+ ];
1374
+ type OutputTuple = [
1375
+ role: string,
1376
+ previousAdminRole: string,
1377
+ newAdminRole: string
1378
+ ];
1379
+ interface OutputObject {
1380
+ role: string;
1381
+ previousAdminRole: string;
1382
+ newAdminRole: string;
1383
+ }
1384
+ type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
1385
+ type Filter = TypedDeferredTopicFilter<Event>;
1386
+ type Log = TypedEventLog<Event>;
1387
+ type LogDescription = TypedLogDescription<Event>;
1388
+ }
1389
+ declare namespace RoleGrantedEvent {
1390
+ type InputTuple = [
1391
+ role: BytesLike,
1392
+ account: AddressLike,
1393
+ sender: AddressLike
1394
+ ];
1395
+ type OutputTuple = [role: string, account: string, sender: string];
1396
+ interface OutputObject {
1397
+ role: string;
1398
+ account: string;
1399
+ sender: string;
1400
+ }
1401
+ type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
1402
+ type Filter = TypedDeferredTopicFilter<Event>;
1403
+ type Log = TypedEventLog<Event>;
1404
+ type LogDescription = TypedLogDescription<Event>;
1405
+ }
1406
+ declare namespace RoleRevokedEvent {
1407
+ type InputTuple = [
1408
+ role: BytesLike,
1409
+ account: AddressLike,
1410
+ sender: AddressLike
1411
+ ];
1412
+ type OutputTuple = [role: string, account: string, sender: string];
1413
+ interface OutputObject {
1414
+ role: string;
1415
+ account: string;
1416
+ sender: string;
1417
+ }
1418
+ type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
1419
+ type Filter = TypedDeferredTopicFilter<Event>;
1420
+ type Log = TypedEventLog<Event>;
1421
+ type LogDescription = TypedLogDescription<Event>;
1185
1422
  }
1186
1423
  interface ProtocolFetcherProxy extends BaseContract {
1187
1424
  connect(runner?: ContractRunner | null): ProtocolFetcherProxy;
@@ -1196,6 +1433,7 @@ interface ProtocolFetcherProxy extends BaseContract {
1196
1433
  listeners<TCEvent extends TypedContractEvent>(event: TCEvent): Promise<Array<TypedListener<TCEvent>>>;
1197
1434
  listeners(eventName?: string): Promise<Array<Listener>>;
1198
1435
  removeAllListeners<TCEvent extends TypedContractEvent>(event?: TCEvent): Promise<this>;
1436
+ DEFAULT_ADMIN_ROLE: TypedContractMethod<[], [string], "view">;
1199
1437
  getLatestMPCInfo: TypedContractMethod<[
1200
1438
  networkId: BytesLike
1201
1439
  ], [
@@ -1221,6 +1459,15 @@ interface ProtocolFetcherProxy extends BaseContract {
1221
1459
  string[]
1222
1460
  ], "view">;
1223
1461
  getProtocolState: TypedContractMethod<[], [bigint], "view">;
1462
+ getRoleAdmin: TypedContractMethod<[role: BytesLike], [string], "view">;
1463
+ getRoleMember: TypedContractMethod<[
1464
+ role: BytesLike,
1465
+ index: BigNumberish
1466
+ ], [
1467
+ string
1468
+ ], "view">;
1469
+ getRoleMemberCount: TypedContractMethod<[role: BytesLike], [bigint], "view">;
1470
+ getRoleMembers: TypedContractMethod<[role: BytesLike], [string[]], "view">;
1224
1471
  getTokens: TypedContractMethod<[
1225
1472
  fromIdx: BigNumberish,
1226
1473
  toIdx: BigNumberish
@@ -1233,6 +1480,18 @@ interface ProtocolFetcherProxy extends BaseContract {
1233
1480
  ], [
1234
1481
  string
1235
1482
  ], "view">;
1483
+ grantRole: TypedContractMethod<[
1484
+ role: BytesLike,
1485
+ account: AddressLike
1486
+ ], [
1487
+ void
1488
+ ], "nonpayable">;
1489
+ hasRole: TypedContractMethod<[
1490
+ role: BytesLike,
1491
+ account: AddressLike
1492
+ ], [
1493
+ boolean
1494
+ ], "view">;
1236
1495
  isMPCNode: TypedContractMethod<[account: AddressLike], [boolean], "view">;
1237
1496
  isSolver: TypedContractMethod<[account: AddressLike], [boolean], "view">;
1238
1497
  isValidNetwork: TypedContractMethod<[
@@ -1263,6 +1522,18 @@ interface ProtocolFetcherProxy extends BaseContract {
1263
1522
  numOfSupportedTokens: TypedContractMethod<[], [bigint], "view">;
1264
1523
  pManagement: TypedContractMethod<[], [string], "view">;
1265
1524
  registry: TypedContractMethod<[], [string], "view">;
1525
+ renounceRole: TypedContractMethod<[
1526
+ role: BytesLike,
1527
+ callerConfirmation: AddressLike
1528
+ ], [
1529
+ void
1530
+ ], "nonpayable">;
1531
+ revokeRole: TypedContractMethod<[
1532
+ role: BytesLike,
1533
+ account: AddressLike
1534
+ ], [
1535
+ void
1536
+ ], "nonpayable">;
1266
1537
  router: TypedContractMethod<[], [string], "view">;
1267
1538
  setProtocolManagement: TypedContractMethod<[
1268
1539
  newManagement: AddressLike
@@ -1285,7 +1556,13 @@ interface ProtocolFetcherProxy extends BaseContract {
1285
1556
  void
1286
1557
  ], "nonpayable">;
1287
1558
  signerExtension: TypedContractMethod<[], [string], "view">;
1559
+ supportsInterface: TypedContractMethod<[
1560
+ interfaceId: BytesLike
1561
+ ], [
1562
+ boolean
1563
+ ], "view">;
1288
1564
  getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T;
1565
+ getFunction(nameOrSignature: "DEFAULT_ADMIN_ROLE"): TypedContractMethod<[], [string], "view">;
1289
1566
  getFunction(nameOrSignature: "getLatestMPCInfo"): TypedContractMethod<[
1290
1567
  networkId: BytesLike
1291
1568
  ], [
@@ -1311,6 +1588,15 @@ interface ProtocolFetcherProxy extends BaseContract {
1311
1588
  string[]
1312
1589
  ], "view">;
1313
1590
  getFunction(nameOrSignature: "getProtocolState"): TypedContractMethod<[], [bigint], "view">;
1591
+ getFunction(nameOrSignature: "getRoleAdmin"): TypedContractMethod<[role: BytesLike], [string], "view">;
1592
+ getFunction(nameOrSignature: "getRoleMember"): TypedContractMethod<[
1593
+ role: BytesLike,
1594
+ index: BigNumberish
1595
+ ], [
1596
+ string
1597
+ ], "view">;
1598
+ getFunction(nameOrSignature: "getRoleMemberCount"): TypedContractMethod<[role: BytesLike], [bigint], "view">;
1599
+ getFunction(nameOrSignature: "getRoleMembers"): TypedContractMethod<[role: BytesLike], [string[]], "view">;
1314
1600
  getFunction(nameOrSignature: "getTokens"): TypedContractMethod<[
1315
1601
  fromIdx: BigNumberish,
1316
1602
  toIdx: BigNumberish
@@ -1323,6 +1609,18 @@ interface ProtocolFetcherProxy extends BaseContract {
1323
1609
  ], [
1324
1610
  string
1325
1611
  ], "view">;
1612
+ getFunction(nameOrSignature: "grantRole"): TypedContractMethod<[
1613
+ role: BytesLike,
1614
+ account: AddressLike
1615
+ ], [
1616
+ void
1617
+ ], "nonpayable">;
1618
+ getFunction(nameOrSignature: "hasRole"): TypedContractMethod<[
1619
+ role: BytesLike,
1620
+ account: AddressLike
1621
+ ], [
1622
+ boolean
1623
+ ], "view">;
1326
1624
  getFunction(nameOrSignature: "isMPCNode"): TypedContractMethod<[account: AddressLike], [boolean], "view">;
1327
1625
  getFunction(nameOrSignature: "isSolver"): TypedContractMethod<[account: AddressLike], [boolean], "view">;
1328
1626
  getFunction(nameOrSignature: "isValidNetwork"): TypedContractMethod<[networkId: BytesLike], [boolean], "view">;
@@ -1349,6 +1647,18 @@ interface ProtocolFetcherProxy extends BaseContract {
1349
1647
  getFunction(nameOrSignature: "numOfSupportedTokens"): TypedContractMethod<[], [bigint], "view">;
1350
1648
  getFunction(nameOrSignature: "pManagement"): TypedContractMethod<[], [string], "view">;
1351
1649
  getFunction(nameOrSignature: "registry"): TypedContractMethod<[], [string], "view">;
1650
+ getFunction(nameOrSignature: "renounceRole"): TypedContractMethod<[
1651
+ role: BytesLike,
1652
+ callerConfirmation: AddressLike
1653
+ ], [
1654
+ void
1655
+ ], "nonpayable">;
1656
+ getFunction(nameOrSignature: "revokeRole"): TypedContractMethod<[
1657
+ role: BytesLike,
1658
+ account: AddressLike
1659
+ ], [
1660
+ void
1661
+ ], "nonpayable">;
1352
1662
  getFunction(nameOrSignature: "router"): TypedContractMethod<[], [string], "view">;
1353
1663
  getFunction(nameOrSignature: "setProtocolManagement"): TypedContractMethod<[newManagement: AddressLike], [void], "nonpayable">;
1354
1664
  getFunction(nameOrSignature: "setRouter"): TypedContractMethod<[newRouter: AddressLike], [void], "nonpayable">;
@@ -1359,7 +1669,18 @@ interface ProtocolFetcherProxy extends BaseContract {
1359
1669
  ], "nonpayable">;
1360
1670
  getFunction(nameOrSignature: "setVaultRegistry"): TypedContractMethod<[newRegistry: AddressLike], [void], "nonpayable">;
1361
1671
  getFunction(nameOrSignature: "signerExtension"): TypedContractMethod<[], [string], "view">;
1362
- filters: {};
1672
+ getFunction(nameOrSignature: "supportsInterface"): TypedContractMethod<[interfaceId: BytesLike], [boolean], "view">;
1673
+ getEvent(key: "RoleAdminChanged"): TypedContractEvent<RoleAdminChangedEvent.InputTuple, RoleAdminChangedEvent.OutputTuple, RoleAdminChangedEvent.OutputObject>;
1674
+ getEvent(key: "RoleGranted"): TypedContractEvent<RoleGrantedEvent.InputTuple, RoleGrantedEvent.OutputTuple, RoleGrantedEvent.OutputObject>;
1675
+ getEvent(key: "RoleRevoked"): TypedContractEvent<RoleRevokedEvent.InputTuple, RoleRevokedEvent.OutputTuple, RoleRevokedEvent.OutputObject>;
1676
+ filters: {
1677
+ "RoleAdminChanged(bytes32,bytes32,bytes32)": TypedContractEvent<RoleAdminChangedEvent.InputTuple, RoleAdminChangedEvent.OutputTuple, RoleAdminChangedEvent.OutputObject>;
1678
+ RoleAdminChanged: TypedContractEvent<RoleAdminChangedEvent.InputTuple, RoleAdminChangedEvent.OutputTuple, RoleAdminChangedEvent.OutputObject>;
1679
+ "RoleGranted(bytes32,address,address)": TypedContractEvent<RoleGrantedEvent.InputTuple, RoleGrantedEvent.OutputTuple, RoleGrantedEvent.OutputObject>;
1680
+ RoleGranted: TypedContractEvent<RoleGrantedEvent.InputTuple, RoleGrantedEvent.OutputTuple, RoleGrantedEvent.OutputObject>;
1681
+ "RoleRevoked(bytes32,address,address)": TypedContractEvent<RoleRevokedEvent.InputTuple, RoleRevokedEvent.OutputTuple, RoleRevokedEvent.OutputObject>;
1682
+ RoleRevoked: TypedContractEvent<RoleRevokedEvent.InputTuple, RoleRevokedEvent.OutputTuple, RoleRevokedEvent.OutputObject>;
1683
+ };
1363
1684
  }
1364
1685
 
1365
1686
  declare namespace ITypes$1 {
@@ -3525,50 +3846,50 @@ declare class ERC20__factory {
3525
3846
  static connect(address: string, runner?: ContractRunner | null): ERC20;
3526
3847
  }
3527
3848
 
3528
- declare class Payment__factory {
3849
+ declare class MorphoLiquidationGateway__factory {
3529
3850
  static readonly abi: readonly [{
3530
3851
  readonly inputs: readonly [{
3531
3852
  readonly internalType: "address";
3532
- readonly name: "pAddress";
3853
+ readonly name: "initProtocol";
3533
3854
  readonly type: "address";
3855
+ }, {
3856
+ readonly internalType: "string";
3857
+ readonly name: "name";
3858
+ readonly type: "string";
3859
+ }, {
3860
+ readonly internalType: "string";
3861
+ readonly name: "symbol";
3862
+ readonly type: "string";
3534
3863
  }];
3535
3864
  readonly stateMutability: "nonpayable";
3536
3865
  readonly type: "constructor";
3537
3866
  }, {
3538
3867
  readonly inputs: readonly [];
3539
- readonly name: "AddressZero";
3868
+ readonly name: "IncompleteConsumption";
3540
3869
  readonly type: "error";
3541
3870
  }, {
3542
3871
  readonly inputs: readonly [];
3543
- readonly name: "DeadlineExceeded";
3872
+ readonly name: "NoHelper";
3544
3873
  readonly type: "error";
3545
3874
  }, {
3546
3875
  readonly inputs: readonly [];
3547
- readonly name: "FailedCall";
3876
+ readonly name: "ReentrancyGuardReentrantCall";
3548
3877
  readonly type: "error";
3549
3878
  }, {
3550
3879
  readonly inputs: readonly [{
3880
+ readonly internalType: "address";
3881
+ readonly name: "spender";
3882
+ readonly type: "address";
3883
+ }, {
3551
3884
  readonly internalType: "uint256";
3552
- readonly name: "balance";
3885
+ readonly name: "currentAllowance";
3553
3886
  readonly type: "uint256";
3554
3887
  }, {
3555
3888
  readonly internalType: "uint256";
3556
- readonly name: "needed";
3889
+ readonly name: "requestedDecrease";
3557
3890
  readonly type: "uint256";
3558
3891
  }];
3559
- readonly name: "InsufficientBalance";
3560
- readonly type: "error";
3561
- }, {
3562
- readonly inputs: readonly [];
3563
- readonly name: "InvalidPaymentAmount";
3564
- readonly type: "error";
3565
- }, {
3566
- readonly inputs: readonly [];
3567
- readonly name: "NativeCoinNotMatched";
3568
- readonly type: "error";
3569
- }, {
3570
- readonly inputs: readonly [];
3571
- readonly name: "ReentrancyGuardReentrantCall";
3892
+ readonly name: "SafeERC20FailedDecreaseAllowance";
3572
3893
  readonly type: "error";
3573
3894
  }, {
3574
3895
  readonly inputs: readonly [{
@@ -3579,30 +3900,47 @@ declare class Payment__factory {
3579
3900
  readonly name: "SafeERC20FailedOperation";
3580
3901
  readonly type: "error";
3581
3902
  }, {
3582
- readonly inputs: readonly [];
3903
+ readonly inputs: readonly [{
3904
+ readonly internalType: "address";
3905
+ readonly name: "sender";
3906
+ readonly type: "address";
3907
+ }];
3583
3908
  readonly name: "Unauthorized";
3584
3909
  readonly type: "error";
3910
+ }, {
3911
+ readonly inputs: readonly [];
3912
+ readonly name: "ZeroAddress";
3913
+ readonly type: "error";
3914
+ }, {
3915
+ readonly inputs: readonly [];
3916
+ readonly name: "ZeroAmount";
3917
+ readonly type: "error";
3585
3918
  }, {
3586
3919
  readonly anonymous: false;
3587
3920
  readonly inputs: readonly [{
3588
3921
  readonly indexed: true;
3589
- readonly internalType: "bytes32";
3590
- readonly name: "tradeId";
3591
- readonly type: "bytes32";
3922
+ readonly internalType: "address";
3923
+ readonly name: "operator";
3924
+ readonly type: "address";
3592
3925
  }, {
3593
3926
  readonly indexed: true;
3594
3927
  readonly internalType: "address";
3595
- readonly name: "from";
3928
+ readonly name: "newHelper";
3596
3929
  readonly type: "address";
3597
- }, {
3930
+ }];
3931
+ readonly name: "HelperUpdated";
3932
+ readonly type: "event";
3933
+ }, {
3934
+ readonly anonymous: false;
3935
+ readonly inputs: readonly [{
3598
3936
  readonly indexed: true;
3599
3937
  readonly internalType: "address";
3600
- readonly name: "to";
3938
+ readonly name: "payer";
3601
3939
  readonly type: "address";
3602
3940
  }, {
3603
- readonly indexed: false;
3941
+ readonly indexed: true;
3604
3942
  readonly internalType: "address";
3605
- readonly name: "pFeeAddr";
3943
+ readonly name: "liquidator";
3606
3944
  readonly type: "address";
3607
3945
  }, {
3608
3946
  readonly indexed: false;
@@ -3612,22 +3950,17 @@ declare class Payment__factory {
3612
3950
  }, {
3613
3951
  readonly indexed: false;
3614
3952
  readonly internalType: "uint256";
3615
- readonly name: "payToUser";
3616
- readonly type: "uint256";
3617
- }, {
3618
- readonly indexed: false;
3619
- readonly internalType: "uint256";
3620
- readonly name: "totalFee";
3953
+ readonly name: "amount";
3621
3954
  readonly type: "uint256";
3622
3955
  }];
3623
- readonly name: "PaymentTransferred";
3956
+ readonly name: "PaymentExecuted";
3624
3957
  readonly type: "event";
3625
3958
  }, {
3626
3959
  readonly anonymous: false;
3627
3960
  readonly inputs: readonly [{
3628
3961
  readonly indexed: true;
3629
3962
  readonly internalType: "address";
3630
- readonly name: "owner";
3963
+ readonly name: "operator";
3631
3964
  readonly type: "address";
3632
3965
  }, {
3633
3966
  readonly indexed: true;
@@ -3638,15 +3971,222 @@ declare class Payment__factory {
3638
3971
  readonly name: "ProtocolUpdated";
3639
3972
  readonly type: "event";
3640
3973
  }, {
3641
- readonly inputs: readonly [{
3642
- readonly internalType: "bytes32";
3643
- readonly name: "tradeId";
3644
- readonly type: "bytes32";
3645
- }, {
3646
- readonly internalType: "address";
3647
- readonly name: "token";
3974
+ readonly inputs: readonly [];
3975
+ readonly name: "gatewayHelper";
3976
+ readonly outputs: readonly [{
3977
+ readonly internalType: "contract IGatewayHelper";
3978
+ readonly name: "";
3648
3979
  readonly type: "address";
3649
- }, {
3980
+ }];
3981
+ readonly stateMutability: "view";
3982
+ readonly type: "function";
3983
+ }, {
3984
+ readonly inputs: readonly [];
3985
+ readonly name: "getProtocol";
3986
+ readonly outputs: readonly [{
3987
+ readonly internalType: "address";
3988
+ readonly name: "protocol";
3989
+ readonly type: "address";
3990
+ }];
3991
+ readonly stateMutability: "view";
3992
+ readonly type: "function";
3993
+ }, {
3994
+ readonly inputs: readonly [];
3995
+ readonly name: "optimexDomain";
3996
+ readonly outputs: readonly [{
3997
+ readonly internalType: "string";
3998
+ readonly name: "name";
3999
+ readonly type: "string";
4000
+ }, {
4001
+ readonly internalType: "string";
4002
+ readonly name: "version";
4003
+ readonly type: "string";
4004
+ }];
4005
+ readonly stateMutability: "view";
4006
+ readonly type: "function";
4007
+ }, {
4008
+ readonly inputs: readonly [{
4009
+ readonly internalType: "address";
4010
+ readonly name: "token";
4011
+ readonly type: "address";
4012
+ }, {
4013
+ readonly internalType: "uint256";
4014
+ readonly name: "amount";
4015
+ readonly type: "uint256";
4016
+ }, {
4017
+ readonly internalType: "bytes";
4018
+ readonly name: "externalCall";
4019
+ readonly type: "bytes";
4020
+ }];
4021
+ readonly name: "payment";
4022
+ readonly outputs: readonly [];
4023
+ readonly stateMutability: "nonpayable";
4024
+ readonly type: "function";
4025
+ }, {
4026
+ readonly inputs: readonly [];
4027
+ readonly name: "paymentDetails";
4028
+ readonly outputs: readonly [{
4029
+ readonly internalType: "address";
4030
+ readonly name: "payer";
4031
+ readonly type: "address";
4032
+ }, {
4033
+ readonly internalType: "address";
4034
+ readonly name: "paymentToken";
4035
+ readonly type: "address";
4036
+ }, {
4037
+ readonly internalType: "uint256";
4038
+ readonly name: "paymentAmount";
4039
+ readonly type: "uint256";
4040
+ }];
4041
+ readonly stateMutability: "view";
4042
+ readonly type: "function";
4043
+ }, {
4044
+ readonly inputs: readonly [{
4045
+ readonly internalType: "address";
4046
+ readonly name: "newHelper";
4047
+ readonly type: "address";
4048
+ }];
4049
+ readonly name: "setHelper";
4050
+ readonly outputs: readonly [];
4051
+ readonly stateMutability: "nonpayable";
4052
+ readonly type: "function";
4053
+ }, {
4054
+ readonly inputs: readonly [{
4055
+ readonly internalType: "address";
4056
+ readonly name: "newProtocol";
4057
+ readonly type: "address";
4058
+ }];
4059
+ readonly name: "setProtocol";
4060
+ readonly outputs: readonly [];
4061
+ readonly stateMutability: "nonpayable";
4062
+ readonly type: "function";
4063
+ }];
4064
+ static createInterface(): MorphoLiquidationGatewayInterface;
4065
+ static connect(address: string, runner?: ContractRunner | null): MorphoLiquidationGateway;
4066
+ }
4067
+
4068
+ declare class Payment__factory {
4069
+ static readonly abi: readonly [{
4070
+ readonly inputs: readonly [{
4071
+ readonly internalType: "address";
4072
+ readonly name: "pAddress";
4073
+ readonly type: "address";
4074
+ }];
4075
+ readonly stateMutability: "nonpayable";
4076
+ readonly type: "constructor";
4077
+ }, {
4078
+ readonly inputs: readonly [];
4079
+ readonly name: "AddressZero";
4080
+ readonly type: "error";
4081
+ }, {
4082
+ readonly inputs: readonly [];
4083
+ readonly name: "DeadlineExceeded";
4084
+ readonly type: "error";
4085
+ }, {
4086
+ readonly inputs: readonly [];
4087
+ readonly name: "FailedCall";
4088
+ readonly type: "error";
4089
+ }, {
4090
+ readonly inputs: readonly [{
4091
+ readonly internalType: "uint256";
4092
+ readonly name: "balance";
4093
+ readonly type: "uint256";
4094
+ }, {
4095
+ readonly internalType: "uint256";
4096
+ readonly name: "needed";
4097
+ readonly type: "uint256";
4098
+ }];
4099
+ readonly name: "InsufficientBalance";
4100
+ readonly type: "error";
4101
+ }, {
4102
+ readonly inputs: readonly [];
4103
+ readonly name: "InvalidPaymentAmount";
4104
+ readonly type: "error";
4105
+ }, {
4106
+ readonly inputs: readonly [];
4107
+ readonly name: "NativeCoinNotMatched";
4108
+ readonly type: "error";
4109
+ }, {
4110
+ readonly inputs: readonly [];
4111
+ readonly name: "ReentrancyGuardReentrantCall";
4112
+ readonly type: "error";
4113
+ }, {
4114
+ readonly inputs: readonly [{
4115
+ readonly internalType: "address";
4116
+ readonly name: "token";
4117
+ readonly type: "address";
4118
+ }];
4119
+ readonly name: "SafeERC20FailedOperation";
4120
+ readonly type: "error";
4121
+ }, {
4122
+ readonly inputs: readonly [];
4123
+ readonly name: "Unauthorized";
4124
+ readonly type: "error";
4125
+ }, {
4126
+ readonly anonymous: false;
4127
+ readonly inputs: readonly [{
4128
+ readonly indexed: true;
4129
+ readonly internalType: "bytes32";
4130
+ readonly name: "tradeId";
4131
+ readonly type: "bytes32";
4132
+ }, {
4133
+ readonly indexed: true;
4134
+ readonly internalType: "address";
4135
+ readonly name: "from";
4136
+ readonly type: "address";
4137
+ }, {
4138
+ readonly indexed: true;
4139
+ readonly internalType: "address";
4140
+ readonly name: "to";
4141
+ readonly type: "address";
4142
+ }, {
4143
+ readonly indexed: false;
4144
+ readonly internalType: "address";
4145
+ readonly name: "pFeeAddr";
4146
+ readonly type: "address";
4147
+ }, {
4148
+ readonly indexed: false;
4149
+ readonly internalType: "address";
4150
+ readonly name: "token";
4151
+ readonly type: "address";
4152
+ }, {
4153
+ readonly indexed: false;
4154
+ readonly internalType: "uint256";
4155
+ readonly name: "payToUser";
4156
+ readonly type: "uint256";
4157
+ }, {
4158
+ readonly indexed: false;
4159
+ readonly internalType: "uint256";
4160
+ readonly name: "totalFee";
4161
+ readonly type: "uint256";
4162
+ }];
4163
+ readonly name: "PaymentTransferred";
4164
+ readonly type: "event";
4165
+ }, {
4166
+ readonly anonymous: false;
4167
+ readonly inputs: readonly [{
4168
+ readonly indexed: true;
4169
+ readonly internalType: "address";
4170
+ readonly name: "owner";
4171
+ readonly type: "address";
4172
+ }, {
4173
+ readonly indexed: true;
4174
+ readonly internalType: "address";
4175
+ readonly name: "newProtocol";
4176
+ readonly type: "address";
4177
+ }];
4178
+ readonly name: "ProtocolUpdated";
4179
+ readonly type: "event";
4180
+ }, {
4181
+ readonly inputs: readonly [{
4182
+ readonly internalType: "bytes32";
4183
+ readonly name: "tradeId";
4184
+ readonly type: "bytes32";
4185
+ }, {
4186
+ readonly internalType: "address";
4187
+ readonly name: "token";
4188
+ readonly type: "address";
4189
+ }, {
3650
4190
  readonly internalType: "address";
3651
4191
  readonly name: "toUser";
3652
4192
  readonly type: "address";
@@ -3713,6 +4253,22 @@ declare class ProtocolFetcherProxy__factory {
3713
4253
  }];
3714
4254
  readonly stateMutability: "nonpayable";
3715
4255
  readonly type: "constructor";
4256
+ }, {
4257
+ readonly inputs: readonly [];
4258
+ readonly name: "AccessControlBadConfirmation";
4259
+ readonly type: "error";
4260
+ }, {
4261
+ readonly inputs: readonly [{
4262
+ readonly internalType: "address";
4263
+ readonly name: "account";
4264
+ readonly type: "address";
4265
+ }, {
4266
+ readonly internalType: "bytes32";
4267
+ readonly name: "neededRole";
4268
+ readonly type: "bytes32";
4269
+ }];
4270
+ readonly name: "AccessControlUnauthorizedAccount";
4271
+ readonly type: "error";
3716
4272
  }, {
3717
4273
  readonly inputs: readonly [];
3718
4274
  readonly name: "AddressZero";
@@ -3721,6 +4277,76 @@ declare class ProtocolFetcherProxy__factory {
3721
4277
  readonly inputs: readonly [];
3722
4278
  readonly name: "Unauthorized";
3723
4279
  readonly type: "error";
4280
+ }, {
4281
+ readonly anonymous: false;
4282
+ readonly inputs: readonly [{
4283
+ readonly indexed: true;
4284
+ readonly internalType: "bytes32";
4285
+ readonly name: "role";
4286
+ readonly type: "bytes32";
4287
+ }, {
4288
+ readonly indexed: true;
4289
+ readonly internalType: "bytes32";
4290
+ readonly name: "previousAdminRole";
4291
+ readonly type: "bytes32";
4292
+ }, {
4293
+ readonly indexed: true;
4294
+ readonly internalType: "bytes32";
4295
+ readonly name: "newAdminRole";
4296
+ readonly type: "bytes32";
4297
+ }];
4298
+ readonly name: "RoleAdminChanged";
4299
+ readonly type: "event";
4300
+ }, {
4301
+ readonly anonymous: false;
4302
+ readonly inputs: readonly [{
4303
+ readonly indexed: true;
4304
+ readonly internalType: "bytes32";
4305
+ readonly name: "role";
4306
+ readonly type: "bytes32";
4307
+ }, {
4308
+ readonly indexed: true;
4309
+ readonly internalType: "address";
4310
+ readonly name: "account";
4311
+ readonly type: "address";
4312
+ }, {
4313
+ readonly indexed: true;
4314
+ readonly internalType: "address";
4315
+ readonly name: "sender";
4316
+ readonly type: "address";
4317
+ }];
4318
+ readonly name: "RoleGranted";
4319
+ readonly type: "event";
4320
+ }, {
4321
+ readonly anonymous: false;
4322
+ readonly inputs: readonly [{
4323
+ readonly indexed: true;
4324
+ readonly internalType: "bytes32";
4325
+ readonly name: "role";
4326
+ readonly type: "bytes32";
4327
+ }, {
4328
+ readonly indexed: true;
4329
+ readonly internalType: "address";
4330
+ readonly name: "account";
4331
+ readonly type: "address";
4332
+ }, {
4333
+ readonly indexed: true;
4334
+ readonly internalType: "address";
4335
+ readonly name: "sender";
4336
+ readonly type: "address";
4337
+ }];
4338
+ readonly name: "RoleRevoked";
4339
+ readonly type: "event";
4340
+ }, {
4341
+ readonly inputs: readonly [];
4342
+ readonly name: "DEFAULT_ADMIN_ROLE";
4343
+ readonly outputs: readonly [{
4344
+ readonly internalType: "bytes32";
4345
+ readonly name: "";
4346
+ readonly type: "bytes32";
4347
+ }];
4348
+ readonly stateMutability: "view";
4349
+ readonly type: "function";
3724
4350
  }, {
3725
4351
  readonly inputs: readonly [{
3726
4352
  readonly internalType: "bytes";
@@ -3843,6 +4469,66 @@ declare class ProtocolFetcherProxy__factory {
3843
4469
  }];
3844
4470
  readonly stateMutability: "view";
3845
4471
  readonly type: "function";
4472
+ }, {
4473
+ readonly inputs: readonly [{
4474
+ readonly internalType: "bytes32";
4475
+ readonly name: "role";
4476
+ readonly type: "bytes32";
4477
+ }];
4478
+ readonly name: "getRoleAdmin";
4479
+ readonly outputs: readonly [{
4480
+ readonly internalType: "bytes32";
4481
+ readonly name: "";
4482
+ readonly type: "bytes32";
4483
+ }];
4484
+ readonly stateMutability: "view";
4485
+ readonly type: "function";
4486
+ }, {
4487
+ readonly inputs: readonly [{
4488
+ readonly internalType: "bytes32";
4489
+ readonly name: "role";
4490
+ readonly type: "bytes32";
4491
+ }, {
4492
+ readonly internalType: "uint256";
4493
+ readonly name: "index";
4494
+ readonly type: "uint256";
4495
+ }];
4496
+ readonly name: "getRoleMember";
4497
+ readonly outputs: readonly [{
4498
+ readonly internalType: "address";
4499
+ readonly name: "";
4500
+ readonly type: "address";
4501
+ }];
4502
+ readonly stateMutability: "view";
4503
+ readonly type: "function";
4504
+ }, {
4505
+ readonly inputs: readonly [{
4506
+ readonly internalType: "bytes32";
4507
+ readonly name: "role";
4508
+ readonly type: "bytes32";
4509
+ }];
4510
+ readonly name: "getRoleMemberCount";
4511
+ readonly outputs: readonly [{
4512
+ readonly internalType: "uint256";
4513
+ readonly name: "";
4514
+ readonly type: "uint256";
4515
+ }];
4516
+ readonly stateMutability: "view";
4517
+ readonly type: "function";
4518
+ }, {
4519
+ readonly inputs: readonly [{
4520
+ readonly internalType: "bytes32";
4521
+ readonly name: "role";
4522
+ readonly type: "bytes32";
4523
+ }];
4524
+ readonly name: "getRoleMembers";
4525
+ readonly outputs: readonly [{
4526
+ readonly internalType: "address[]";
4527
+ readonly name: "";
4528
+ readonly type: "address[]";
4529
+ }];
4530
+ readonly stateMutability: "view";
4531
+ readonly type: "function";
3846
4532
  }, {
3847
4533
  readonly inputs: readonly [{
3848
4534
  readonly internalType: "uint256";
@@ -3888,6 +4574,38 @@ declare class ProtocolFetcherProxy__factory {
3888
4574
  }];
3889
4575
  readonly stateMutability: "view";
3890
4576
  readonly type: "function";
4577
+ }, {
4578
+ readonly inputs: readonly [{
4579
+ readonly internalType: "bytes32";
4580
+ readonly name: "role";
4581
+ readonly type: "bytes32";
4582
+ }, {
4583
+ readonly internalType: "address";
4584
+ readonly name: "account";
4585
+ readonly type: "address";
4586
+ }];
4587
+ readonly name: "grantRole";
4588
+ readonly outputs: readonly [];
4589
+ readonly stateMutability: "nonpayable";
4590
+ readonly type: "function";
4591
+ }, {
4592
+ readonly inputs: readonly [{
4593
+ readonly internalType: "bytes32";
4594
+ readonly name: "role";
4595
+ readonly type: "bytes32";
4596
+ }, {
4597
+ readonly internalType: "address";
4598
+ readonly name: "account";
4599
+ readonly type: "address";
4600
+ }];
4601
+ readonly name: "hasRole";
4602
+ readonly outputs: readonly [{
4603
+ readonly internalType: "bool";
4604
+ readonly name: "";
4605
+ readonly type: "bool";
4606
+ }];
4607
+ readonly stateMutability: "view";
4608
+ readonly type: "function";
3891
4609
  }, {
3892
4610
  readonly inputs: readonly [{
3893
4611
  readonly internalType: "address";
@@ -4042,6 +4760,34 @@ declare class ProtocolFetcherProxy__factory {
4042
4760
  }];
4043
4761
  readonly stateMutability: "view";
4044
4762
  readonly type: "function";
4763
+ }, {
4764
+ readonly inputs: readonly [{
4765
+ readonly internalType: "bytes32";
4766
+ readonly name: "role";
4767
+ readonly type: "bytes32";
4768
+ }, {
4769
+ readonly internalType: "address";
4770
+ readonly name: "callerConfirmation";
4771
+ readonly type: "address";
4772
+ }];
4773
+ readonly name: "renounceRole";
4774
+ readonly outputs: readonly [];
4775
+ readonly stateMutability: "nonpayable";
4776
+ readonly type: "function";
4777
+ }, {
4778
+ readonly inputs: readonly [{
4779
+ readonly internalType: "bytes32";
4780
+ readonly name: "role";
4781
+ readonly type: "bytes32";
4782
+ }, {
4783
+ readonly internalType: "address";
4784
+ readonly name: "account";
4785
+ readonly type: "address";
4786
+ }];
4787
+ readonly name: "revokeRole";
4788
+ readonly outputs: readonly [];
4789
+ readonly stateMutability: "nonpayable";
4790
+ readonly type: "function";
4045
4791
  }, {
4046
4792
  readonly inputs: readonly [];
4047
4793
  readonly name: "router";
@@ -4102,6 +4848,20 @@ declare class ProtocolFetcherProxy__factory {
4102
4848
  }];
4103
4849
  readonly stateMutability: "view";
4104
4850
  readonly type: "function";
4851
+ }, {
4852
+ readonly inputs: readonly [{
4853
+ readonly internalType: "bytes4";
4854
+ readonly name: "interfaceId";
4855
+ readonly type: "bytes4";
4856
+ }];
4857
+ readonly name: "supportsInterface";
4858
+ readonly outputs: readonly [{
4859
+ readonly internalType: "bool";
4860
+ readonly name: "";
4861
+ readonly type: "bool";
4862
+ }];
4863
+ readonly stateMutability: "view";
4864
+ readonly type: "function";
4105
4865
  }];
4106
4866
  static createInterface(): ProtocolFetcherProxyInterface;
4107
4867
  static connect(address: string, runner?: ContractRunner | null): ProtocolFetcherProxy;
@@ -5518,6 +6278,8 @@ declare class Signer__factory {
5518
6278
 
5519
6279
  type index_ERC20__factory = ERC20__factory;
5520
6280
  declare const index_ERC20__factory: typeof ERC20__factory;
6281
+ type index_MorphoLiquidationGateway__factory = MorphoLiquidationGateway__factory;
6282
+ declare const index_MorphoLiquidationGateway__factory: typeof MorphoLiquidationGateway__factory;
5521
6283
  type index_Payment__factory = Payment__factory;
5522
6284
  declare const index_Payment__factory: typeof Payment__factory;
5523
6285
  type index_ProtocolFetcherProxy__factory = ProtocolFetcherProxy__factory;
@@ -5527,7 +6289,7 @@ declare const index_Router__factory: typeof Router__factory;
5527
6289
  type index_Signer__factory = Signer__factory;
5528
6290
  declare const index_Signer__factory: typeof Signer__factory;
5529
6291
  declare namespace index {
5530
- export { index_ERC20__factory as ERC20__factory, index_Payment__factory as Payment__factory, index_ProtocolFetcherProxy__factory as ProtocolFetcherProxy__factory, index_Router__factory as Router__factory, index_Signer__factory as Signer__factory };
6292
+ export { index_ERC20__factory as ERC20__factory, index_MorphoLiquidationGateway__factory as MorphoLiquidationGateway__factory, index_Payment__factory as Payment__factory, index_ProtocolFetcherProxy__factory as ProtocolFetcherProxy__factory, index_Router__factory as Router__factory, index_Signer__factory as Signer__factory };
5531
6293
  }
5532
6294
 
5533
6295
  declare namespace ITypes {
@@ -5563,6 +6325,76 @@ declare namespace ITypes {
5563
6325
  type TradeFinalizationStructOutput = ITypes$1.TradeFinalizationStructOutput;
5564
6326
  }
5565
6327
 
6328
+ declare enum OptimexEvmNetwork {
6329
+ EthereumSepolia = "ethereum_sepolia",
6330
+ EthereumMainnet = "ethereum",
6331
+ BaseTestnet = "base_sepolia",
6332
+ BaseMainnet = "base",
6333
+ ArbitrumSepolia = "arbitrum_sepolia",
6334
+ Arbitrum = "arbitrum",
6335
+ OptimismSepolia = "optimism_sepolia",
6336
+ Optimism = "optimism",
6337
+ BSC = "bsc"
6338
+ }
6339
+ declare enum OptimexL2Network {
6340
+ Testnet = "optimex_testnet",
6341
+ Mainnet = "optimex"
6342
+ }
6343
+ declare enum OptimexBtcNetwork {
6344
+ BitcoinTestnet = "bitcoin_testnet",
6345
+ BitcoinMainnet = "bitcoin"
6346
+ }
6347
+ declare enum OptimexSolanaNetwork {
6348
+ SolanaDevnet = "solana_devnet",
6349
+ SolanaMainnet = "solana"
6350
+ }
6351
+ declare enum OptimexLendingNetwork {
6352
+ Morpho = "MORPHO"
6353
+ }
6354
+ type UnknownNetwork = '';
6355
+ type OptimexNetwork = OptimexEvmNetwork | OptimexBtcNetwork | OptimexSolanaNetwork | OptimexL2Network | OptimexLendingNetwork | '';
6356
+ declare const isEvmNetwork: (network: OptimexNetwork) => network is OptimexEvmNetwork;
6357
+ declare const isBtcNetwork: (network: OptimexNetwork) => network is OptimexBtcNetwork;
6358
+ declare const isSolanaNetwork: (network: OptimexNetwork) => network is OptimexSolanaNetwork;
6359
+ declare const isL2Network: (network: OptimexNetwork) => network is OptimexL2Network;
6360
+
6361
+ declare enum AssetChainContractRole {
6362
+ AcrossTransitVault = "AcrossTransitVault",
6363
+ Payment = "OptimexSwapPayment",
6364
+ OptimexManagement = "OptimexManagement",
6365
+ MorphoSupplier = "MorphoSupplier",
6366
+ MorphoLiquidationGateway = "MorphoLiquidationGateway",
6367
+ MorphoManagement = "MorphoManagement"
6368
+ }
6369
+ declare enum L2ContractRole {
6370
+ MorphoAdapter = "MorphoAdapter",
6371
+ MorphoMarketRegistry = "MorphoMarketRegistry",
6372
+ AcrossRefund = "AcrossRefund"
6373
+ }
6374
+
6375
+ declare class ProtocolService implements ConfigObserver {
6376
+ private provider;
6377
+ private contract;
6378
+ l2Network: OptimexL2Network;
6379
+ constructor();
6380
+ /**
6381
+ * Implementation of ConfigObserver interface
6382
+ * Updates service when config changes
6383
+ */
6384
+ onConfigUpdate(newConfig: AppConfig): void;
6385
+ getCurrentPubkey(network: string): Promise<ITypes.MPCInfoStructOutput>;
6386
+ getPFeeRate({ fromNetworkId, fromTokenId, toNetworkId, toTokenId, }: {
6387
+ fromNetworkId: string;
6388
+ fromTokenId: string;
6389
+ toNetworkId: string;
6390
+ toTokenId: string;
6391
+ }): Promise<number>;
6392
+ getRouter(): Promise<string>;
6393
+ getAssetChainConfig(network: OptimexEvmNetwork, role: AssetChainContractRole): Promise<string[]>;
6394
+ getL2Config(role: L2ContractRole): Promise<string[]>;
6395
+ }
6396
+ declare const protocolService: ProtocolService;
6397
+
5566
6398
  declare class RouterService implements ConfigObserver {
5567
6399
  private provider;
5568
6400
  private contract;
@@ -5581,6 +6413,7 @@ declare class RouterService implements ConfigObserver {
5581
6413
  getFeeDetails(tradeId: BytesLike): Promise<ITypes.FeeDetailsStructOutput>;
5582
6414
  getTradeData(tradeId: BytesLike): Promise<ITypes.TradeDataStructOutput>;
5583
6415
  getManagement(): Promise<string>;
6416
+ getAffiliateInfo(tradeId: BytesLike): Promise<ITypes.AffiliateStructOutput>;
5584
6417
  }
5585
6418
  declare const routerService: RouterService;
5586
6419
 
@@ -6184,4 +7017,4 @@ declare function camelToSnakeCase(str: string): string;
6184
7017
  declare const ensureHexPrefix: (value: string) => string;
6185
7018
  declare const removeHexPrefix: (value: string) => string;
6186
7019
 
6187
- export { type AppConfig, type ConfigObserver, type ERC20, ERC20__factory, type Environment, type EnvironmentConfig, ITypes, type Payment, Payment__factory, type ProtocolFetcherProxy, ProtocolFetcherProxy__factory, type Router, RouterService, Router__factory, SDK, SignatureType, type Signer, SignerService, Signer__factory, SolverService, type Token, TokenSchema, TokenService, camelToSnakeCase, config, confirmDepositType, confirmPaymentType, confirmSettlementType, convertToCamelCase, convertToSnakeCase, ensureHexPrefix, index as factories, getCommitInfoHash, getMakePaymentHash, getSignature, getSigner, getTradeIdsHash, makePaymentType, presignType, removeHexPrefix, rfqAuthenticationTypes, routerService, sdk, selectionType, signerService, snakeToCamelCase, solverService, tokenService };
7020
+ export { type AppConfig, AssetChainContractRole, type ConfigObserver, type ERC20, ERC20__factory, type Environment, type EnvironmentConfig, ITypes, L2ContractRole, type MorphoLiquidationGateway, MorphoLiquidationGateway__factory, OptimexBtcNetwork, OptimexEvmNetwork, OptimexL2Network, OptimexLendingNetwork, type OptimexNetwork, OptimexSolanaNetwork, type Payment, Payment__factory, type ProtocolFetcherProxy, ProtocolFetcherProxy__factory, ProtocolService, type Router, RouterService, Router__factory, SDK, SignatureType, type Signer, SignerService, Signer__factory, SolverService, type Token, TokenSchema, TokenService, type UnknownNetwork, camelToSnakeCase, config, confirmDepositType, confirmPaymentType, confirmSettlementType, convertToCamelCase, convertToSnakeCase, ensureHexPrefix, index as factories, getCommitInfoHash, getMakePaymentHash, getSignature, getSigner, getTradeIdsHash, isBtcNetwork, isEvmNetwork, isL2Network, isSolanaNetwork, makePaymentType, presignType, protocolService, removeHexPrefix, rfqAuthenticationTypes, routerService, sdk, selectionType, signerService, snakeToCamelCase, solverService, tokenService };