@1delta/abis 0.0.13 → 0.0.15

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 (34) hide show
  1. package/dist/fluid/vaultResolver.d.ts +388 -0
  2. package/dist/fluid/vaultResolver.d.ts.map +1 -1
  3. package/dist/fluid/vaultResolver.js +532 -5
  4. package/dist/gearbox/addressProviderV310.d.ts +17 -0
  5. package/dist/gearbox/addressProviderV310.d.ts.map +1 -0
  6. package/dist/gearbox/addressProviderV310.js +24 -0
  7. package/dist/gearbox/creditAccountCompressorV310.d.ts +203 -0
  8. package/dist/gearbox/creditAccountCompressorV310.d.ts.map +1 -0
  9. package/dist/gearbox/creditAccountCompressorV310.js +140 -0
  10. package/dist/gearbox/creditFacadeV3.d.ts +59 -0
  11. package/dist/gearbox/creditFacadeV3.d.ts.map +1 -0
  12. package/dist/gearbox/creditFacadeV3.js +59 -0
  13. package/dist/gearbox/creditManagerV3.d.ts +156 -0
  14. package/dist/gearbox/creditManagerV3.d.ts.map +1 -0
  15. package/dist/gearbox/creditManagerV3.js +108 -0
  16. package/dist/gearbox/index.d.ts +9 -0
  17. package/dist/gearbox/index.d.ts.map +1 -0
  18. package/dist/gearbox/index.js +11 -0
  19. package/dist/gearbox/marketCompressorV310.d.ts +555 -0
  20. package/dist/gearbox/marketCompressorV310.d.ts.map +1 -0
  21. package/dist/gearbox/marketCompressorV310.js +619 -0
  22. package/dist/gearbox/poolQuotaKeeperV3.d.ts +65 -0
  23. package/dist/gearbox/poolQuotaKeeperV3.d.ts.map +1 -0
  24. package/dist/gearbox/poolQuotaKeeperV3.js +52 -0
  25. package/dist/gearbox/poolV3.d.ts +152 -0
  26. package/dist/gearbox/poolV3.d.ts.map +1 -0
  27. package/dist/gearbox/poolV3.js +133 -0
  28. package/dist/gearbox/priceOracleV3.d.ts +35 -0
  29. package/dist/gearbox/priceOracleV3.d.ts.map +1 -0
  30. package/dist/gearbox/priceOracleV3.js +28 -0
  31. package/dist/index.d.ts +1 -0
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +1 -0
  34. package/package.json +5 -5
@@ -1,12 +1,12 @@
1
1
  // Fluid VaultResolver ABI (deployed at 0xA5C3E16523eeeDDcC34706b0E6bE88b4c6EA95cC
2
2
  // on every supported chain — same bytecode).
3
3
  //
4
- // Only the two functions actually consumed by the fetchers are kept:
5
- // - getVaultsEntireData() VaultEntireData[] (primary fetch)
6
- // - getVaultEntireData(address) VaultEntireData (chunked fallback)
4
+ // Functions kept:
5
+ // - getVaultsEntireData() -> VaultEntireData[] (public-data fetch)
6
+ // - getVaultEntireData(address) -> VaultEntireData (chunked fallback)
7
+ // - positionsByUser(address) -> (UserPosition[], VaultEntireData[]) (user-data fetch)
7
8
  //
8
- // Struct fields match the verified contract byte-for-byte — reordering or
9
- // dropping any field will break viem's tuple decoding.
9
+ // Struct fields match the verified contract byte-for-byte.
10
10
  export const FluidVaultResolverAbi = [
11
11
  {
12
12
  inputs: [
@@ -949,4 +949,531 @@ export const FluidVaultResolverAbi = [
949
949
  stateMutability: "view",
950
950
  type: "function",
951
951
  },
952
+ {
953
+ inputs: [
954
+ {
955
+ name: "user_",
956
+ type: "address",
957
+ },
958
+ ],
959
+ name: "positionsByUser",
960
+ outputs: [
961
+ {
962
+ components: [
963
+ {
964
+ name: "nftId",
965
+ type: "uint256",
966
+ },
967
+ {
968
+ name: "owner",
969
+ type: "address",
970
+ },
971
+ {
972
+ name: "isLiquidated",
973
+ type: "bool",
974
+ },
975
+ {
976
+ name: "isSupplyPosition",
977
+ type: "bool",
978
+ },
979
+ {
980
+ name: "tick",
981
+ type: "int256",
982
+ },
983
+ {
984
+ name: "tickId",
985
+ type: "uint256",
986
+ },
987
+ {
988
+ name: "beforeSupply",
989
+ type: "uint256",
990
+ },
991
+ {
992
+ name: "beforeBorrow",
993
+ type: "uint256",
994
+ },
995
+ {
996
+ name: "beforeDustBorrow",
997
+ type: "uint256",
998
+ },
999
+ {
1000
+ name: "supply",
1001
+ type: "uint256",
1002
+ },
1003
+ {
1004
+ name: "borrow",
1005
+ type: "uint256",
1006
+ },
1007
+ {
1008
+ name: "dustBorrow",
1009
+ type: "uint256",
1010
+ },
1011
+ ],
1012
+ name: "userPositions_",
1013
+ type: "tuple[]",
1014
+ },
1015
+ {
1016
+ components: [
1017
+ {
1018
+ name: "vault",
1019
+ type: "address",
1020
+ },
1021
+ {
1022
+ name: "isSmartCol",
1023
+ type: "bool",
1024
+ },
1025
+ {
1026
+ name: "isSmartDebt",
1027
+ type: "bool",
1028
+ },
1029
+ {
1030
+ components: [
1031
+ {
1032
+ name: "liquidity",
1033
+ type: "address",
1034
+ },
1035
+ {
1036
+ name: "factory",
1037
+ type: "address",
1038
+ },
1039
+ {
1040
+ name: "operateImplementation",
1041
+ type: "address",
1042
+ },
1043
+ {
1044
+ name: "adminImplementation",
1045
+ type: "address",
1046
+ },
1047
+ {
1048
+ name: "secondaryImplementation",
1049
+ type: "address",
1050
+ },
1051
+ {
1052
+ name: "deployer",
1053
+ type: "address",
1054
+ },
1055
+ {
1056
+ name: "supply",
1057
+ type: "address",
1058
+ },
1059
+ {
1060
+ name: "borrow",
1061
+ type: "address",
1062
+ },
1063
+ {
1064
+ components: [
1065
+ {
1066
+ name: "token0",
1067
+ type: "address",
1068
+ },
1069
+ {
1070
+ name: "token1",
1071
+ type: "address",
1072
+ },
1073
+ ],
1074
+ name: "supplyToken",
1075
+ type: "tuple",
1076
+ },
1077
+ {
1078
+ components: [
1079
+ {
1080
+ name: "token0",
1081
+ type: "address",
1082
+ },
1083
+ {
1084
+ name: "token1",
1085
+ type: "address",
1086
+ },
1087
+ ],
1088
+ name: "borrowToken",
1089
+ type: "tuple",
1090
+ },
1091
+ {
1092
+ name: "vaultId",
1093
+ type: "uint256",
1094
+ },
1095
+ {
1096
+ name: "vaultType",
1097
+ type: "uint256",
1098
+ },
1099
+ {
1100
+ name: "supplyExchangePriceSlot",
1101
+ type: "bytes32",
1102
+ },
1103
+ {
1104
+ name: "borrowExchangePriceSlot",
1105
+ type: "bytes32",
1106
+ },
1107
+ {
1108
+ name: "userSupplySlot",
1109
+ type: "bytes32",
1110
+ },
1111
+ {
1112
+ name: "userBorrowSlot",
1113
+ type: "bytes32",
1114
+ },
1115
+ ],
1116
+ name: "constantVariables",
1117
+ type: "tuple",
1118
+ },
1119
+ {
1120
+ components: [
1121
+ {
1122
+ name: "supplyRateMagnifier",
1123
+ type: "uint16",
1124
+ },
1125
+ {
1126
+ name: "borrowRateMagnifier",
1127
+ type: "uint16",
1128
+ },
1129
+ {
1130
+ name: "collateralFactor",
1131
+ type: "uint16",
1132
+ },
1133
+ {
1134
+ name: "liquidationThreshold",
1135
+ type: "uint16",
1136
+ },
1137
+ {
1138
+ name: "liquidationMaxLimit",
1139
+ type: "uint16",
1140
+ },
1141
+ {
1142
+ name: "withdrawalGap",
1143
+ type: "uint16",
1144
+ },
1145
+ {
1146
+ name: "liquidationPenalty",
1147
+ type: "uint16",
1148
+ },
1149
+ {
1150
+ name: "borrowFee",
1151
+ type: "uint16",
1152
+ },
1153
+ {
1154
+ name: "oracle",
1155
+ type: "address",
1156
+ },
1157
+ {
1158
+ name: "oraclePriceOperate",
1159
+ type: "uint256",
1160
+ },
1161
+ {
1162
+ name: "oraclePriceLiquidate",
1163
+ type: "uint256",
1164
+ },
1165
+ {
1166
+ name: "rebalancer",
1167
+ type: "address",
1168
+ },
1169
+ {
1170
+ name: "lastUpdateTimestamp",
1171
+ type: "uint256",
1172
+ },
1173
+ ],
1174
+ name: "configs",
1175
+ type: "tuple",
1176
+ },
1177
+ {
1178
+ components: [
1179
+ {
1180
+ name: "lastStoredLiquiditySupplyExchangePrice",
1181
+ type: "uint256",
1182
+ },
1183
+ {
1184
+ name: "lastStoredLiquidityBorrowExchangePrice",
1185
+ type: "uint256",
1186
+ },
1187
+ {
1188
+ name: "lastStoredVaultSupplyExchangePrice",
1189
+ type: "uint256",
1190
+ },
1191
+ {
1192
+ name: "lastStoredVaultBorrowExchangePrice",
1193
+ type: "uint256",
1194
+ },
1195
+ {
1196
+ name: "liquiditySupplyExchangePrice",
1197
+ type: "uint256",
1198
+ },
1199
+ {
1200
+ name: "liquidityBorrowExchangePrice",
1201
+ type: "uint256",
1202
+ },
1203
+ {
1204
+ name: "vaultSupplyExchangePrice",
1205
+ type: "uint256",
1206
+ },
1207
+ {
1208
+ name: "vaultBorrowExchangePrice",
1209
+ type: "uint256",
1210
+ },
1211
+ {
1212
+ name: "supplyRateLiquidity",
1213
+ type: "uint256",
1214
+ },
1215
+ {
1216
+ name: "borrowRateLiquidity",
1217
+ type: "uint256",
1218
+ },
1219
+ {
1220
+ name: "supplyRateVault",
1221
+ type: "int256",
1222
+ },
1223
+ {
1224
+ name: "borrowRateVault",
1225
+ type: "int256",
1226
+ },
1227
+ {
1228
+ name: "rewardsOrFeeRateSupply",
1229
+ type: "int256",
1230
+ },
1231
+ {
1232
+ name: "rewardsOrFeeRateBorrow",
1233
+ type: "int256",
1234
+ },
1235
+ ],
1236
+ name: "exchangePricesAndRates",
1237
+ type: "tuple",
1238
+ },
1239
+ {
1240
+ components: [
1241
+ {
1242
+ name: "totalSupplyVault",
1243
+ type: "uint256",
1244
+ },
1245
+ {
1246
+ name: "totalBorrowVault",
1247
+ type: "uint256",
1248
+ },
1249
+ {
1250
+ name: "totalSupplyLiquidityOrDex",
1251
+ type: "uint256",
1252
+ },
1253
+ {
1254
+ name: "totalBorrowLiquidityOrDex",
1255
+ type: "uint256",
1256
+ },
1257
+ {
1258
+ name: "absorbedSupply",
1259
+ type: "uint256",
1260
+ },
1261
+ {
1262
+ name: "absorbedBorrow",
1263
+ type: "uint256",
1264
+ },
1265
+ ],
1266
+ name: "totalSupplyAndBorrow",
1267
+ type: "tuple",
1268
+ },
1269
+ {
1270
+ components: [
1271
+ {
1272
+ name: "withdrawLimit",
1273
+ type: "uint256",
1274
+ },
1275
+ {
1276
+ name: "withdrawableUntilLimit",
1277
+ type: "uint256",
1278
+ },
1279
+ {
1280
+ name: "withdrawable",
1281
+ type: "uint256",
1282
+ },
1283
+ {
1284
+ name: "borrowLimit",
1285
+ type: "uint256",
1286
+ },
1287
+ {
1288
+ name: "borrowableUntilLimit",
1289
+ type: "uint256",
1290
+ },
1291
+ {
1292
+ name: "borrowable",
1293
+ type: "uint256",
1294
+ },
1295
+ {
1296
+ name: "borrowLimitUtilization",
1297
+ type: "uint256",
1298
+ },
1299
+ {
1300
+ name: "minimumBorrowing",
1301
+ type: "uint256",
1302
+ },
1303
+ ],
1304
+ name: "limitsAndAvailability",
1305
+ type: "tuple",
1306
+ },
1307
+ {
1308
+ components: [
1309
+ {
1310
+ name: "totalPositions",
1311
+ type: "uint256",
1312
+ },
1313
+ {
1314
+ name: "topTick",
1315
+ type: "int256",
1316
+ },
1317
+ {
1318
+ name: "currentBranch",
1319
+ type: "uint256",
1320
+ },
1321
+ {
1322
+ name: "totalBranch",
1323
+ type: "uint256",
1324
+ },
1325
+ {
1326
+ name: "totalBorrow",
1327
+ type: "uint256",
1328
+ },
1329
+ {
1330
+ name: "totalSupply",
1331
+ type: "uint256",
1332
+ },
1333
+ {
1334
+ components: [
1335
+ {
1336
+ name: "status",
1337
+ type: "uint256",
1338
+ },
1339
+ {
1340
+ name: "minimaTick",
1341
+ type: "int256",
1342
+ },
1343
+ {
1344
+ name: "debtFactor",
1345
+ type: "uint256",
1346
+ },
1347
+ {
1348
+ name: "partials",
1349
+ type: "uint256",
1350
+ },
1351
+ {
1352
+ name: "debtLiquidity",
1353
+ type: "uint256",
1354
+ },
1355
+ {
1356
+ name: "baseBranchId",
1357
+ type: "uint256",
1358
+ },
1359
+ {
1360
+ name: "baseBranchMinima",
1361
+ type: "int256",
1362
+ },
1363
+ ],
1364
+ name: "currentBranchState",
1365
+ type: "tuple",
1366
+ },
1367
+ ],
1368
+ name: "vaultState",
1369
+ type: "tuple",
1370
+ },
1371
+ {
1372
+ components: [
1373
+ {
1374
+ name: "modeWithInterest",
1375
+ type: "bool",
1376
+ },
1377
+ {
1378
+ name: "supply",
1379
+ type: "uint256",
1380
+ },
1381
+ {
1382
+ name: "withdrawalLimit",
1383
+ type: "uint256",
1384
+ },
1385
+ {
1386
+ name: "lastUpdateTimestamp",
1387
+ type: "uint256",
1388
+ },
1389
+ {
1390
+ name: "expandPercent",
1391
+ type: "uint256",
1392
+ },
1393
+ {
1394
+ name: "expandDuration",
1395
+ type: "uint256",
1396
+ },
1397
+ {
1398
+ name: "baseWithdrawalLimit",
1399
+ type: "uint256",
1400
+ },
1401
+ {
1402
+ name: "withdrawableUntilLimit",
1403
+ type: "uint256",
1404
+ },
1405
+ {
1406
+ name: "withdrawable",
1407
+ type: "uint256",
1408
+ },
1409
+ {
1410
+ name: "decayEndTimestamp",
1411
+ type: "uint256",
1412
+ },
1413
+ {
1414
+ name: "decayAmount",
1415
+ type: "uint256",
1416
+ },
1417
+ ],
1418
+ name: "liquidityUserSupplyData",
1419
+ type: "tuple",
1420
+ },
1421
+ {
1422
+ components: [
1423
+ {
1424
+ name: "modeWithInterest",
1425
+ type: "bool",
1426
+ },
1427
+ {
1428
+ name: "borrow",
1429
+ type: "uint256",
1430
+ },
1431
+ {
1432
+ name: "borrowLimit",
1433
+ type: "uint256",
1434
+ },
1435
+ {
1436
+ name: "lastUpdateTimestamp",
1437
+ type: "uint256",
1438
+ },
1439
+ {
1440
+ name: "expandPercent",
1441
+ type: "uint256",
1442
+ },
1443
+ {
1444
+ name: "expandDuration",
1445
+ type: "uint256",
1446
+ },
1447
+ {
1448
+ name: "baseBorrowLimit",
1449
+ type: "uint256",
1450
+ },
1451
+ {
1452
+ name: "maxBorrowLimit",
1453
+ type: "uint256",
1454
+ },
1455
+ {
1456
+ name: "borrowableUntilLimit",
1457
+ type: "uint256",
1458
+ },
1459
+ {
1460
+ name: "borrowable",
1461
+ type: "uint256",
1462
+ },
1463
+ {
1464
+ name: "borrowLimitUtilization",
1465
+ type: "uint256",
1466
+ },
1467
+ ],
1468
+ name: "liquidityUserBorrowData",
1469
+ type: "tuple",
1470
+ },
1471
+ ],
1472
+ name: "vaultsData_",
1473
+ type: "tuple[]",
1474
+ },
1475
+ ],
1476
+ stateMutability: "view",
1477
+ type: "function",
1478
+ },
952
1479
  ];
@@ -0,0 +1,17 @@
1
+ export declare const GearboxAddressProviderV310Abi: readonly [{
2
+ readonly inputs: readonly [{
3
+ readonly name: "key";
4
+ readonly type: "bytes32";
5
+ }, {
6
+ readonly name: "version";
7
+ readonly type: "uint256";
8
+ }];
9
+ readonly name: "getAddressOrRevert";
10
+ readonly outputs: readonly [{
11
+ readonly name: "";
12
+ readonly type: "address";
13
+ }];
14
+ readonly stateMutability: "view";
15
+ readonly type: "function";
16
+ }];
17
+ //# sourceMappingURL=addressProviderV310.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addressProviderV310.d.ts","sourceRoot":"","sources":["../../src/gearbox/addressProviderV310.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;EAWhC,CAAA"}
@@ -0,0 +1,24 @@
1
+ // Gearbox AddressProviderV3.10 ABI — minimal subset.
2
+ //
3
+ // The V3.10 AddressProvider is CREATE2-deterministic at
4
+ // 0xF7f0a609BfAb9a0A98786951ef10e5FE26cC1E38
5
+ // on every chain Gearbox deploys to. Callers resolve compressor /
6
+ // registry addresses (MARKET_COMPRESSOR, ACCOUNT_COMPRESSOR, …) by
7
+ // `getAddressOrRevert(keyBytes32, 310)`.
8
+ //
9
+ // Keys live in `@1delta/data-sdk/constants` (or equivalent string
10
+ // consts). The helper in `margin-fetcher` also exposes `getAddresses`
11
+ // for a multi-key single-RPC lookup, but we vendor only the single-key
12
+ // variant here to keep surface minimal.
13
+ export const GearboxAddressProviderV310Abi = [
14
+ {
15
+ inputs: [
16
+ { name: 'key', type: 'bytes32' },
17
+ { name: 'version', type: 'uint256' },
18
+ ],
19
+ name: 'getAddressOrRevert',
20
+ outputs: [{ name: '', type: 'address' }],
21
+ stateMutability: 'view',
22
+ type: 'function',
23
+ },
24
+ ];