@avaprotocol/sdk-js 4.0.0-dev.2 → 4.0.0-dev.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/index.js +2 -773
  2. package/dist/index.mjs +1 -772
  3. package/dist/v4/protocols/index.d.ts +1 -131
  4. package/dist/v4/protocols/index.d.ts.map +1 -1
  5. package/dist/v4/protocols/index.js +11 -85
  6. package/package.json +2 -1
  7. package/dist/v4/protocols/aave-v3.d.ts +0 -21
  8. package/dist/v4/protocols/aave-v3.d.ts.map +0 -1
  9. package/dist/v4/protocols/aave-v3.js +0 -238
  10. package/dist/v4/protocols/aerodrome.d.ts +0 -4
  11. package/dist/v4/protocols/aerodrome.d.ts.map +0 -1
  12. package/dist/v4/protocols/aerodrome.js +0 -9
  13. package/dist/v4/protocols/chainlink.d.ts +0 -7
  14. package/dist/v4/protocols/chainlink.d.ts.map +0 -1
  15. package/dist/v4/protocols/chainlink.js +0 -25
  16. package/dist/v4/protocols/common.d.ts +0 -16
  17. package/dist/v4/protocols/common.d.ts.map +0 -1
  18. package/dist/v4/protocols/common.js +0 -76
  19. package/dist/v4/protocols/compound-v3.d.ts +0 -4
  20. package/dist/v4/protocols/compound-v3.d.ts.map +0 -1
  21. package/dist/v4/protocols/compound-v3.js +0 -15
  22. package/dist/v4/protocols/erc20.d.ts +0 -5
  23. package/dist/v4/protocols/erc20.d.ts.map +0 -1
  24. package/dist/v4/protocols/erc20.js +0 -18
  25. package/dist/v4/protocols/ethena.d.ts +0 -7
  26. package/dist/v4/protocols/ethena.d.ts.map +0 -1
  27. package/dist/v4/protocols/ethena.js +0 -58
  28. package/dist/v4/protocols/frax-ether.d.ts +0 -7
  29. package/dist/v4/protocols/frax-ether.d.ts.map +0 -1
  30. package/dist/v4/protocols/frax-ether.js +0 -20
  31. package/dist/v4/protocols/lido.d.ts +0 -7
  32. package/dist/v4/protocols/lido.d.ts.map +0 -1
  33. package/dist/v4/protocols/lido.js +0 -44
  34. package/dist/v4/protocols/morpho.d.ts +0 -6
  35. package/dist/v4/protocols/morpho.d.ts.map +0 -1
  36. package/dist/v4/protocols/morpho.js +0 -89
  37. package/dist/v4/protocols/rocket-pool.d.ts +0 -6
  38. package/dist/v4/protocols/rocket-pool.d.ts.map +0 -1
  39. package/dist/v4/protocols/rocket-pool.js +0 -36
  40. package/dist/v4/protocols/sky.d.ts +0 -6
  41. package/dist/v4/protocols/sky.d.ts.map +0 -1
  42. package/dist/v4/protocols/sky.js +0 -13
  43. package/dist/v4/protocols/spark.d.ts +0 -4
  44. package/dist/v4/protocols/spark.d.ts.map +0 -1
  45. package/dist/v4/protocols/spark.js +0 -15
  46. package/dist/v4/protocols/superfluid.d.ts +0 -6
  47. package/dist/v4/protocols/superfluid.d.ts.map +0 -1
  48. package/dist/v4/protocols/superfluid.js +0 -39
  49. package/dist/v4/protocols/types.d.ts +0 -17
  50. package/dist/v4/protocols/types.d.ts.map +0 -1
  51. package/dist/v4/protocols/types.js +0 -1
  52. package/dist/v4/protocols/uniswap-v3.d.ts +0 -27
  53. package/dist/v4/protocols/uniswap-v3.d.ts.map +0 -1
  54. package/dist/v4/protocols/uniswap-v3.js +0 -197
  55. package/dist/v4/protocols/wrapped.d.ts +0 -6
  56. package/dist/v4/protocols/wrapped.d.ts.map +0 -1
  57. package/dist/v4/protocols/wrapped.js +0 -55
package/dist/index.mjs CHANGED
@@ -899,779 +899,8 @@ var Nodes = Object.freeze({
899
899
  }
900
900
  });
901
901
 
902
- // src/v4/protocols/aave-v3.ts
903
- var pool = {
904
- [Chains.EthereumMainnet]: "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
905
- [Chains.Sepolia]: "0x6Ae43d3271ff6888e7Fc43Fd7321a503ff738951",
906
- [Chains.BaseMainnet]: "0xA238Dd80C259a72e81d7e4664a9801593F98d1c5",
907
- [Chains.BaseSepolia]: "0x8bAB6d1b75f19e9eD9fCe8b9BD338844fF79aE27"
908
- };
909
- var oracle = {
910
- [Chains.EthereumMainnet]: "0x54586bE62E3c3580375aE3723C145253060Ca0C2",
911
- [Chains.Sepolia]: "0x2da88497588bf89281816106C7259e31AF45a663",
912
- [Chains.BaseMainnet]: "0x2Cc0Fc26eD4563A5ce5e8bdcfe1A2878676Ae156",
913
- [Chains.BaseSepolia]: "0x943b0dE18d4abf4eF02A85912F8fc07684C141dF"
914
- };
915
- var wethGateway = {
916
- [Chains.EthereumMainnet]: "0xd01607c3C5eCABa394D8be377a08590149325722",
917
- [Chains.Sepolia]: "0x387d311e47e80b498169e6fb51d3193167d89F7D",
918
- [Chains.BaseMainnet]: "0xa0d9C1E9E48Ca30c8d8C3B5D69FF5dc1f6DFfC24",
919
- [Chains.BaseSepolia]: "0x0568130e794429D2eEBC4dafE18f25Ff1a1ed8b6"
920
- };
921
- var eventTopics = Object.freeze({
922
- Supply: "0x2b627736bca15cd5381dcf80b0bf11fd197d01a037c52b927a881a10fb73ba61",
923
- Withdraw: "0x3115d1449a7b732c986cba18244e897a450f61e1bb8d589cd2e69e6c8924f9f7",
924
- Borrow: "0xb3d084820fb1a9decffb176436bd02558d15fac9b0ddfed8c465bc7359d7dce0",
925
- Repay: "0xa534c8dbe71f871f9f3530e97a74601fea17b426cae02e1c5aee42c96c784051",
926
- LiquidationCall: "0xe413a321e8681d831f4dbccbca790d2952b56f977908e45be37335533e005286"
927
- });
928
- var poolEventsAbi = Object.freeze([
929
- {
930
- anonymous: false,
931
- inputs: [
932
- { indexed: true, internalType: "address", name: "reserve", type: "address" },
933
- { indexed: false, internalType: "address", name: "user", type: "address" },
934
- { indexed: true, internalType: "address", name: "onBehalfOf", type: "address" },
935
- { indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
936
- { indexed: true, internalType: "uint16", name: "referralCode", type: "uint16" }
937
- ],
938
- name: "Supply",
939
- type: "event"
940
- },
941
- {
942
- anonymous: false,
943
- inputs: [
944
- { indexed: true, internalType: "address", name: "reserve", type: "address" },
945
- { indexed: true, internalType: "address", name: "user", type: "address" },
946
- { indexed: true, internalType: "address", name: "to", type: "address" },
947
- { indexed: false, internalType: "uint256", name: "amount", type: "uint256" }
948
- ],
949
- name: "Withdraw",
950
- type: "event"
951
- },
952
- {
953
- anonymous: false,
954
- inputs: [
955
- { indexed: true, internalType: "address", name: "reserve", type: "address" },
956
- { indexed: false, internalType: "address", name: "user", type: "address" },
957
- { indexed: true, internalType: "address", name: "onBehalfOf", type: "address" },
958
- { indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
959
- { indexed: false, internalType: "uint8", name: "interestRateMode", type: "uint8" },
960
- { indexed: false, internalType: "uint256", name: "borrowRate", type: "uint256" },
961
- { indexed: true, internalType: "uint16", name: "referralCode", type: "uint16" }
962
- ],
963
- name: "Borrow",
964
- type: "event"
965
- },
966
- {
967
- anonymous: false,
968
- inputs: [
969
- { indexed: true, internalType: "address", name: "reserve", type: "address" },
970
- { indexed: true, internalType: "address", name: "user", type: "address" },
971
- { indexed: true, internalType: "address", name: "repayer", type: "address" },
972
- { indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
973
- { indexed: false, internalType: "bool", name: "useATokens", type: "bool" }
974
- ],
975
- name: "Repay",
976
- type: "event"
977
- },
978
- {
979
- anonymous: false,
980
- inputs: [
981
- { indexed: true, internalType: "address", name: "collateralAsset", type: "address" },
982
- { indexed: true, internalType: "address", name: "debtAsset", type: "address" },
983
- { indexed: true, internalType: "address", name: "user", type: "address" },
984
- { indexed: false, internalType: "uint256", name: "debtToCover", type: "uint256" },
985
- { indexed: false, internalType: "uint256", name: "liquidatedCollateralAmount", type: "uint256" },
986
- { indexed: false, internalType: "address", name: "liquidator", type: "address" },
987
- { indexed: false, internalType: "bool", name: "receiveAToken", type: "bool" }
988
- ],
989
- name: "LiquidationCall",
990
- type: "event"
991
- }
992
- ]);
993
- var poolMethodsAbi = Object.freeze([
994
- {
995
- inputs: [{ internalType: "address", name: "user", type: "address" }],
996
- name: "getUserAccountData",
997
- outputs: [
998
- { internalType: "uint256", name: "totalCollateralBase", type: "uint256" },
999
- { internalType: "uint256", name: "totalDebtBase", type: "uint256" },
1000
- { internalType: "uint256", name: "availableBorrowsBase", type: "uint256" },
1001
- { internalType: "uint256", name: "currentLiquidationThreshold", type: "uint256" },
1002
- { internalType: "uint256", name: "ltv", type: "uint256" },
1003
- { internalType: "uint256", name: "healthFactor", type: "uint256" }
1004
- ],
1005
- stateMutability: "view",
1006
- type: "function"
1007
- },
1008
- {
1009
- inputs: [
1010
- { internalType: "address", name: "asset", type: "address" },
1011
- { internalType: "uint256", name: "amount", type: "uint256" },
1012
- { internalType: "address", name: "onBehalfOf", type: "address" },
1013
- { internalType: "uint16", name: "referralCode", type: "uint16" }
1014
- ],
1015
- name: "supply",
1016
- outputs: [],
1017
- stateMutability: "nonpayable",
1018
- type: "function"
1019
- },
1020
- {
1021
- inputs: [
1022
- { internalType: "address", name: "asset", type: "address" },
1023
- { internalType: "uint256", name: "amount", type: "uint256" },
1024
- { internalType: "uint256", name: "interestRateMode", type: "uint256" },
1025
- { internalType: "uint16", name: "referralCode", type: "uint16" },
1026
- { internalType: "address", name: "onBehalfOf", type: "address" }
1027
- ],
1028
- name: "borrow",
1029
- outputs: [],
1030
- stateMutability: "nonpayable",
1031
- type: "function"
1032
- },
1033
- {
1034
- inputs: [
1035
- { internalType: "address", name: "asset", type: "address" },
1036
- { internalType: "uint256", name: "amount", type: "uint256" },
1037
- { internalType: "uint256", name: "interestRateMode", type: "uint256" },
1038
- { internalType: "address", name: "onBehalfOf", type: "address" }
1039
- ],
1040
- name: "repay",
1041
- outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1042
- stateMutability: "nonpayable",
1043
- type: "function"
1044
- },
1045
- {
1046
- inputs: [
1047
- { internalType: "address", name: "asset", type: "address" },
1048
- { internalType: "uint256", name: "amount", type: "uint256" },
1049
- { internalType: "address", name: "to", type: "address" }
1050
- ],
1051
- name: "withdraw",
1052
- outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1053
- stateMutability: "nonpayable",
1054
- type: "function"
1055
- },
1056
- {
1057
- inputs: [
1058
- { internalType: "address", name: "asset", type: "address" },
1059
- { internalType: "bool", name: "useAsCollateral", type: "bool" }
1060
- ],
1061
- name: "setUserUseReserveAsCollateral",
1062
- outputs: [],
1063
- stateMutability: "nonpayable",
1064
- type: "function"
1065
- }
1066
- ]);
1067
- var tokens = Object.freeze({
1068
- LINK: {
1069
- [Chains.Sepolia]: "0xf8Fb3713D459D7C1018BD0A49D19b4C44290EBE5"
1070
- }
1071
- });
1072
- var aaveV3 = Object.freeze({
1073
- pool,
1074
- oracle,
1075
- wethGateway,
1076
- eventTopics,
1077
- poolEventsAbi,
1078
- poolMethodsAbi,
1079
- tokens
1080
- });
1081
-
1082
- // src/v4/protocols/aerodrome.ts
1083
- var router = {
1084
- [Chains.BaseMainnet]: "0xcF77a3Ba9A5CA399B7c97c74d54e5b1Beb874E43"
1085
- };
1086
- var aerodrome = Object.freeze({
1087
- router
1088
- });
1089
-
1090
- // src/v4/protocols/common.ts
1091
- var aggregatorV3Abi = Object.freeze([
1092
- {
1093
- inputs: [],
1094
- name: "latestRoundData",
1095
- outputs: [
1096
- { internalType: "uint80", name: "roundId", type: "uint80" },
1097
- { internalType: "int256", name: "answer", type: "int256" },
1098
- { internalType: "uint256", name: "startedAt", type: "uint256" },
1099
- { internalType: "uint256", name: "updatedAt", type: "uint256" },
1100
- { internalType: "uint80", name: "answeredInRound", type: "uint80" }
1101
- ],
1102
- stateMutability: "view",
1103
- type: "function"
1104
- },
1105
- {
1106
- inputs: [],
1107
- name: "decimals",
1108
- outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
1109
- stateMutability: "view",
1110
- type: "function"
1111
- }
1112
- ]);
1113
- var erc4626VaultAbi = Object.freeze([
1114
- {
1115
- inputs: [
1116
- { internalType: "uint256", name: "assets", type: "uint256" },
1117
- { internalType: "address", name: "receiver", type: "address" }
1118
- ],
1119
- name: "deposit",
1120
- outputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
1121
- stateMutability: "nonpayable",
1122
- type: "function"
1123
- },
1124
- {
1125
- inputs: [
1126
- { internalType: "uint256", name: "shares", type: "uint256" },
1127
- { internalType: "address", name: "receiver", type: "address" },
1128
- { internalType: "address", name: "owner", type: "address" }
1129
- ],
1130
- name: "redeem",
1131
- outputs: [{ internalType: "uint256", name: "assets", type: "uint256" }],
1132
- stateMutability: "nonpayable",
1133
- type: "function"
1134
- },
1135
- {
1136
- inputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
1137
- name: "previewRedeem",
1138
- outputs: [{ internalType: "uint256", name: "assets", type: "uint256" }],
1139
- stateMutability: "view",
1140
- type: "function"
1141
- },
1142
- {
1143
- inputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
1144
- name: "convertToAssets",
1145
- outputs: [{ internalType: "uint256", name: "assets", type: "uint256" }],
1146
- stateMutability: "view",
1147
- type: "function"
1148
- }
1149
- ]);
1150
-
1151
- // src/v4/protocols/chainlink.ts
1152
- var ethUsdFeed = {
1153
- [Chains.EthereumMainnet]: "0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419",
1154
- [Chains.Sepolia]: "0x694AA1769357215DE4FAC081bf1f309aDC325306"
1155
- };
1156
- var btcUsdFeed = {
1157
- [Chains.EthereumMainnet]: "0xF4030086522a5bEEa4988F8cA5B36dbC97BeE88c"
1158
- };
1159
- var chainlink = Object.freeze({
1160
- ethUsdFeed,
1161
- btcUsdFeed,
1162
- /** Shared AggregatorV3 ABI — works for any Chainlink feed. */
1163
- aggregatorV3Abi
1164
- });
1165
-
1166
- // src/v4/protocols/compound-v3.ts
1167
- var cometUsdc = {
1168
- [Chains.EthereumMainnet]: "0xc3d688B66703497DAA19211EEdff47f25384cdc3",
1169
- [Chains.BaseMainnet]: "0xb125E6687d4313864e53df431d5425969c15Eb2F"
1170
- };
1171
- var compoundV3 = Object.freeze({
1172
- cometUsdc
1173
- });
1174
-
1175
- // src/v4/protocols/erc20.ts
1176
- var erc20 = Object.freeze({
1177
- approveAbi: Object.freeze([
1178
- {
1179
- inputs: [
1180
- { internalType: "address", name: "spender", type: "address" },
1181
- { internalType: "uint256", name: "amount", type: "uint256" }
1182
- ],
1183
- name: "approve",
1184
- outputs: [{ internalType: "bool", name: "", type: "bool" }],
1185
- stateMutability: "nonpayable",
1186
- type: "function"
1187
- }
1188
- ])
1189
- });
1190
-
1191
- // src/v4/protocols/ethena.ts
1192
- var susde = {
1193
- [Chains.EthereumMainnet]: "0x9D39A5DE30e57443BfF2A8307A4256c8797A3497"
1194
- };
1195
- var usde = {
1196
- [Chains.EthereumMainnet]: "0x4c9EDD5852cd905f086C759E8383e09bff1E68B3"
1197
- };
1198
- var susdeAbi = Object.freeze([
1199
- {
1200
- inputs: [
1201
- { internalType: "uint256", name: "assets", type: "uint256" },
1202
- { internalType: "address", name: "receiver", type: "address" }
1203
- ],
1204
- name: "deposit",
1205
- outputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
1206
- stateMutability: "nonpayable",
1207
- type: "function"
1208
- },
1209
- {
1210
- inputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
1211
- name: "cooldownShares",
1212
- outputs: [{ internalType: "uint256", name: "assets", type: "uint256" }],
1213
- stateMutability: "nonpayable",
1214
- type: "function"
1215
- },
1216
- {
1217
- inputs: [{ internalType: "address", name: "receiver", type: "address" }],
1218
- name: "unstake",
1219
- outputs: [],
1220
- stateMutability: "nonpayable",
1221
- type: "function"
1222
- },
1223
- {
1224
- inputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
1225
- name: "previewRedeem",
1226
- outputs: [{ internalType: "uint256", name: "assets", type: "uint256" }],
1227
- stateMutability: "view",
1228
- type: "function"
1229
- },
1230
- {
1231
- inputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
1232
- name: "convertToAssets",
1233
- outputs: [{ internalType: "uint256", name: "assets", type: "uint256" }],
1234
- stateMutability: "view",
1235
- type: "function"
1236
- }
1237
- ]);
1238
- var ethena = Object.freeze({
1239
- susde,
1240
- usde,
1241
- susdeAbi
1242
- });
1243
-
1244
- // src/v4/protocols/frax-ether.ts
1245
- var sfrxeth = {
1246
- [Chains.EthereumMainnet]: "0xac3E018457B222d93114458476f3E3416Abbe38F"
1247
- };
1248
- var frxeth = {
1249
- [Chains.EthereumMainnet]: "0x5E8422345238F34275888049021821E8E08CAa1f"
1250
- };
1251
- var fraxEther = Object.freeze({
1252
- sfrxeth,
1253
- frxeth,
1254
- /** Standard ERC-4626 surface — sfrxETH conforms exactly. */
1255
- vaultAbi: erc4626VaultAbi
1256
- });
1257
-
1258
- // src/v4/protocols/lido.ts
1259
- var wsteth = {
1260
- [Chains.EthereumMainnet]: "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0",
1261
- [Chains.BaseMainnet]: "0xc1CBa3fCea344f92D9239c08C0568f6F2F0ee452"
1262
- };
1263
- var steth = {
1264
- [Chains.EthereumMainnet]: "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84"
1265
- };
1266
- var wstethAbi = Object.freeze([
1267
- {
1268
- inputs: [{ internalType: "uint256", name: "_stETHAmount", type: "uint256" }],
1269
- name: "wrap",
1270
- outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1271
- stateMutability: "nonpayable",
1272
- type: "function"
1273
- },
1274
- {
1275
- inputs: [{ internalType: "uint256", name: "_wstETHAmount", type: "uint256" }],
1276
- name: "unwrap",
1277
- outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1278
- stateMutability: "nonpayable",
1279
- type: "function"
1280
- },
1281
- {
1282
- inputs: [{ internalType: "uint256", name: "_wstETHAmount", type: "uint256" }],
1283
- name: "getStETHByWstETH",
1284
- outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1285
- stateMutability: "view",
1286
- type: "function"
1287
- }
1288
- ]);
1289
- var lido = Object.freeze({
1290
- wsteth,
1291
- steth,
1292
- wstethAbi
1293
- });
1294
-
1295
- // src/v4/protocols/morpho.ts
1296
- var morpho = {
1297
- [Chains.EthereumMainnet]: "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb",
1298
- [Chains.BaseMainnet]: "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb"
1299
- };
1300
- var morphoAbi = Object.freeze([
1301
- {
1302
- inputs: [
1303
- {
1304
- components: [
1305
- { internalType: "address", name: "loanToken", type: "address" },
1306
- { internalType: "address", name: "collateralToken", type: "address" },
1307
- { internalType: "address", name: "oracle", type: "address" },
1308
- { internalType: "address", name: "irm", type: "address" },
1309
- { internalType: "uint256", name: "lltv", type: "uint256" }
1310
- ],
1311
- internalType: "struct MarketParams",
1312
- name: "marketParams",
1313
- type: "tuple"
1314
- },
1315
- { internalType: "uint256", name: "assets", type: "uint256" },
1316
- { internalType: "uint256", name: "shares", type: "uint256" },
1317
- { internalType: "address", name: "onBehalf", type: "address" },
1318
- { internalType: "bytes", name: "data", type: "bytes" }
1319
- ],
1320
- name: "supply",
1321
- outputs: [
1322
- { internalType: "uint256", name: "assetsSupplied", type: "uint256" },
1323
- { internalType: "uint256", name: "sharesSupplied", type: "uint256" }
1324
- ],
1325
- stateMutability: "nonpayable",
1326
- type: "function"
1327
- },
1328
- {
1329
- inputs: [
1330
- {
1331
- components: [
1332
- { internalType: "address", name: "loanToken", type: "address" },
1333
- { internalType: "address", name: "collateralToken", type: "address" },
1334
- { internalType: "address", name: "oracle", type: "address" },
1335
- { internalType: "address", name: "irm", type: "address" },
1336
- { internalType: "uint256", name: "lltv", type: "uint256" }
1337
- ],
1338
- internalType: "struct MarketParams",
1339
- name: "marketParams",
1340
- type: "tuple"
1341
- },
1342
- { internalType: "uint256", name: "assets", type: "uint256" },
1343
- { internalType: "uint256", name: "shares", type: "uint256" },
1344
- { internalType: "address", name: "onBehalf", type: "address" },
1345
- { internalType: "address", name: "receiver", type: "address" }
1346
- ],
1347
- name: "borrow",
1348
- outputs: [
1349
- { internalType: "uint256", name: "assetsBorrowed", type: "uint256" },
1350
- { internalType: "uint256", name: "sharesBorrowed", type: "uint256" }
1351
- ],
1352
- stateMutability: "nonpayable",
1353
- type: "function"
1354
- },
1355
- {
1356
- inputs: [
1357
- { internalType: "bytes32", name: "id", type: "bytes32" },
1358
- { internalType: "address", name: "user", type: "address" }
1359
- ],
1360
- name: "position",
1361
- outputs: [
1362
- { internalType: "uint256", name: "supplyShares", type: "uint256" },
1363
- { internalType: "uint128", name: "borrowShares", type: "uint128" },
1364
- { internalType: "uint128", name: "collateral", type: "uint128" }
1365
- ],
1366
- stateMutability: "view",
1367
- type: "function"
1368
- }
1369
- ]);
1370
- var morphoBlue = Object.freeze({
1371
- morpho,
1372
- morphoAbi
1373
- });
1374
-
1375
- // src/v4/protocols/rocket-pool.ts
1376
- var reth = {
1377
- [Chains.EthereumMainnet]: "0xae78736Cd615f374D3085123A210448E74Fc6393",
1378
- [Chains.BaseMainnet]: "0xB6fe221Fe9EeF5aBa221c348bA20A1Bf5e73624c"
1379
- };
1380
- var rethAbi = Object.freeze([
1381
- {
1382
- inputs: [{ internalType: "uint256", name: "_rethAmount", type: "uint256" }],
1383
- name: "burn",
1384
- outputs: [],
1385
- stateMutability: "nonpayable",
1386
- type: "function"
1387
- },
1388
- {
1389
- inputs: [],
1390
- name: "getExchangeRate",
1391
- outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1392
- stateMutability: "view",
1393
- type: "function"
1394
- },
1395
- {
1396
- inputs: [{ internalType: "uint256", name: "_rethAmount", type: "uint256" }],
1397
- name: "getEthValue",
1398
- outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1399
- stateMutability: "view",
1400
- type: "function"
1401
- }
1402
- ]);
1403
- var rocketPool = Object.freeze({
1404
- reth,
1405
- rethAbi
1406
- });
1407
-
1408
- // src/v4/protocols/sky.ts
1409
- var sdai = {
1410
- [Chains.EthereumMainnet]: "0x83F20F44975D03b1b09e64809B757c47f942BEeA"
1411
- };
1412
- var sky = Object.freeze({
1413
- sdai,
1414
- /** Standard ERC-4626 surface — sDAI conforms exactly. */
1415
- vaultAbi: erc4626VaultAbi
1416
- });
1417
-
1418
- // src/v4/protocols/spark.ts
1419
- var pool2 = {
1420
- [Chains.EthereumMainnet]: "0xC13e21B648A5Ee794902342038FF3aDAB66BE987"
1421
- };
1422
- var spark = Object.freeze({
1423
- pool: pool2
1424
- });
1425
-
1426
- // src/v4/protocols/superfluid.ts
1427
- var cfaForwarder = {
1428
- [Chains.EthereumMainnet]: "0xcfA132E353cB4E398080B9700609bb008eceB125",
1429
- [Chains.BaseMainnet]: "0xcfA132E353cB4E398080B9700609bb008eceB125"
1430
- };
1431
- var cfaForwarderAbi = Object.freeze([
1432
- {
1433
- inputs: [
1434
- { internalType: "address", name: "token", type: "address" },
1435
- { internalType: "address", name: "receiver", type: "address" },
1436
- { internalType: "int96", name: "flowrate", type: "int96" }
1437
- ],
1438
- name: "setFlowrate",
1439
- outputs: [{ internalType: "bool", name: "", type: "bool" }],
1440
- stateMutability: "nonpayable",
1441
- type: "function"
1442
- },
1443
- {
1444
- inputs: [
1445
- { internalType: "address", name: "token", type: "address" },
1446
- { internalType: "address", name: "sender", type: "address" },
1447
- { internalType: "address", name: "receiver", type: "address" },
1448
- { internalType: "int96", name: "flowrate", type: "int96" },
1449
- { internalType: "bytes", name: "userData", type: "bytes" }
1450
- ],
1451
- name: "createFlow",
1452
- outputs: [{ internalType: "bool", name: "", type: "bool" }],
1453
- stateMutability: "nonpayable",
1454
- type: "function"
1455
- }
1456
- ]);
1457
- var superfluid = Object.freeze({
1458
- cfaForwarder,
1459
- cfaForwarderAbi
1460
- });
1461
-
1462
- // src/v4/protocols/uniswap-v3.ts
1463
- var swapRouter02 = {
1464
- [Chains.EthereumMainnet]: "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",
1465
- [Chains.Sepolia]: "0x3bFA4769FB09eefC5a80d6E87c3B9C650f7Ae48E",
1466
- [Chains.BaseMainnet]: "0x2626664c2603336E57B271c5C0b26F421741e481",
1467
- [Chains.BaseSepolia]: "0x94cC0AaC535CCDB3C01d6787D6413C739ae12bc4"
1468
- };
1469
- var quoterV2 = {
1470
- [Chains.EthereumMainnet]: "0x61fFE014bA17989E743c5F6cB21bF9697530B21e",
1471
- [Chains.Sepolia]: "0xEd1f6473345F45b75F8179591dd5bA1888cf2FB3",
1472
- [Chains.BaseMainnet]: "0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a",
1473
- [Chains.BaseSepolia]: "0xC5290058841028F1614F3A6F0F5816cAd0df5E27"
1474
- };
1475
- var permit2 = {
1476
- [Chains.EthereumMainnet]: "0x000000000022d473030F116dDEE9F6B43aC78BA3",
1477
- [Chains.Sepolia]: "0x000000000022d473030F116dDEE9F6B43aC78BA3",
1478
- [Chains.BaseMainnet]: "0x000000000022d473030F116dDEE9F6B43aC78BA3",
1479
- [Chains.BaseSepolia]: "0x000000000022d473030F116dDEE9F6B43aC78BA3"
1480
- };
1481
- var factory = {
1482
- [Chains.EthereumMainnet]: "0x1F98431c8aD98523631AE4a59f267346ea31F984",
1483
- [Chains.Sepolia]: "0x0227628f3F023bb0B980b67D528571c95c6DaC1c",
1484
- [Chains.BaseMainnet]: "0x33128a8fC17869897dcE68Ed026d694621f6FDfD",
1485
- [Chains.BaseSepolia]: "0x4752ba5DBc23f44D87826276BF6Fd6b1C372aD24"
1486
- };
1487
- var nonfungiblePositionManager = {
1488
- [Chains.EthereumMainnet]: "0xC36442b4a4522E871399CD717aBDD847Ab11FE88",
1489
- [Chains.Sepolia]: "0x1238536071E1c677A632429e3655c799b22cDA52",
1490
- [Chains.BaseMainnet]: "0x03a520b32C04BF3bEEf7BEb72E919cf822Ed34f1",
1491
- [Chains.BaseSepolia]: "0x27F971cb582BF9E50F397e4d29a5C7A34f11faA2"
1492
- };
1493
- var universalRouter = {
1494
- [Chains.EthereumMainnet]: "0x66a9893cc07d91d95644aedd05d03f95e1dba8af",
1495
- [Chains.Sepolia]: "0x3A9D48AB9751398BbFa63ad67599Bb04e4BdF98b",
1496
- [Chains.BaseMainnet]: "0x6ff5693b99212da76ad316178a184ab56d299b43",
1497
- [Chains.BaseSepolia]: "0x492e6456d9528771018deb9e87ef7750ef184104"
1498
- };
1499
- var swapRouter02Abi = Object.freeze([
1500
- {
1501
- inputs: [
1502
- {
1503
- components: [
1504
- { internalType: "address", name: "tokenIn", type: "address" },
1505
- { internalType: "address", name: "tokenOut", type: "address" },
1506
- { internalType: "uint24", name: "fee", type: "uint24" },
1507
- { internalType: "address", name: "recipient", type: "address" },
1508
- { internalType: "uint256", name: "amountIn", type: "uint256" },
1509
- { internalType: "uint256", name: "amountOutMinimum", type: "uint256" },
1510
- { internalType: "uint160", name: "sqrtPriceLimitX96", type: "uint160" }
1511
- ],
1512
- internalType: "struct IV3SwapRouter.ExactInputSingleParams",
1513
- name: "params",
1514
- type: "tuple"
1515
- }
1516
- ],
1517
- name: "exactInputSingle",
1518
- outputs: [{ internalType: "uint256", name: "amountOut", type: "uint256" }],
1519
- stateMutability: "payable",
1520
- type: "function"
1521
- },
1522
- {
1523
- inputs: [
1524
- {
1525
- components: [
1526
- { internalType: "address", name: "tokenIn", type: "address" },
1527
- { internalType: "address", name: "tokenOut", type: "address" },
1528
- { internalType: "uint24", name: "fee", type: "uint24" },
1529
- { internalType: "address", name: "recipient", type: "address" },
1530
- { internalType: "uint256", name: "amountOut", type: "uint256" },
1531
- { internalType: "uint256", name: "amountInMaximum", type: "uint256" },
1532
- { internalType: "uint160", name: "sqrtPriceLimitX96", type: "uint160" }
1533
- ],
1534
- internalType: "struct IV3SwapRouter.ExactOutputSingleParams",
1535
- name: "params",
1536
- type: "tuple"
1537
- }
1538
- ],
1539
- name: "exactOutputSingle",
1540
- outputs: [{ internalType: "uint256", name: "amountIn", type: "uint256" }],
1541
- stateMutability: "payable",
1542
- type: "function"
1543
- }
1544
- ]);
1545
- var quoterV2Abi = Object.freeze([
1546
- {
1547
- inputs: [
1548
- {
1549
- components: [
1550
- { internalType: "address", name: "tokenIn", type: "address" },
1551
- { internalType: "address", name: "tokenOut", type: "address" },
1552
- { internalType: "uint256", name: "amountIn", type: "uint256" },
1553
- { internalType: "uint24", name: "fee", type: "uint24" },
1554
- { internalType: "uint160", name: "sqrtPriceLimitX96", type: "uint160" }
1555
- ],
1556
- internalType: "struct IQuoterV2.QuoteExactInputSingleParams",
1557
- name: "params",
1558
- type: "tuple"
1559
- }
1560
- ],
1561
- name: "quoteExactInputSingle",
1562
- outputs: [
1563
- { internalType: "uint256", name: "amountOut", type: "uint256" },
1564
- { internalType: "uint160", name: "sqrtPriceX96After", type: "uint160" },
1565
- { internalType: "uint32", name: "initializedTicksCrossed", type: "uint32" },
1566
- { internalType: "uint256", name: "gasEstimate", type: "uint256" }
1567
- ],
1568
- stateMutability: "nonpayable",
1569
- type: "function"
1570
- }
1571
- ]);
1572
- var factoryAbi = Object.freeze([
1573
- {
1574
- inputs: [
1575
- { internalType: "address", name: "tokenA", type: "address" },
1576
- { internalType: "address", name: "tokenB", type: "address" },
1577
- { internalType: "uint24", name: "fee", type: "uint24" }
1578
- ],
1579
- name: "getPool",
1580
- outputs: [{ internalType: "address", name: "pool", type: "address" }],
1581
- stateMutability: "view",
1582
- type: "function"
1583
- }
1584
- ]);
1585
- var tokens2 = Object.freeze({
1586
- WETH: {
1587
- [Chains.Sepolia]: "0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14",
1588
- [Chains.EthereumMainnet]: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
1589
- [Chains.BaseMainnet]: "0x4200000000000000000000000000000000000006",
1590
- [Chains.BaseSepolia]: "0x4200000000000000000000000000000000000006"
1591
- },
1592
- USDC: {
1593
- [Chains.Sepolia]: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
1594
- [Chains.EthereumMainnet]: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
1595
- [Chains.BaseMainnet]: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
1596
- [Chains.BaseSepolia]: "0x036CbD53842c5426634e7929541eC2318f3dCF7e"
1597
- }
1598
- });
1599
- var uniswapV3 = Object.freeze({
1600
- swapRouter02,
1601
- quoterV2,
1602
- permit2,
1603
- factory,
1604
- nonfungiblePositionManager,
1605
- universalRouter,
1606
- swapRouter02Abi,
1607
- quoterV2Abi,
1608
- factoryAbi,
1609
- tokens: tokens2
1610
- });
1611
-
1612
- // src/v4/protocols/wrapped.ts
1613
- var weth = {
1614
- [Chains.EthereumMainnet]: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
1615
- [Chains.Sepolia]: "0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14",
1616
- [Chains.BaseMainnet]: "0x4200000000000000000000000000000000000006",
1617
- [Chains.BaseSepolia]: "0x4200000000000000000000000000000000000006"
1618
- };
1619
- var wethAbi = Object.freeze([
1620
- {
1621
- inputs: [],
1622
- name: "deposit",
1623
- outputs: [],
1624
- stateMutability: "payable",
1625
- type: "function"
1626
- },
1627
- {
1628
- inputs: [{ internalType: "uint256", name: "wad", type: "uint256" }],
1629
- name: "withdraw",
1630
- outputs: [],
1631
- stateMutability: "nonpayable",
1632
- type: "function"
1633
- },
1634
- {
1635
- inputs: [
1636
- { internalType: "address", name: "guy", type: "address" },
1637
- { internalType: "uint256", name: "wad", type: "uint256" }
1638
- ],
1639
- name: "approve",
1640
- outputs: [{ internalType: "bool", name: "", type: "bool" }],
1641
- stateMutability: "nonpayable",
1642
- type: "function"
1643
- },
1644
- {
1645
- inputs: [{ internalType: "address", name: "", type: "address" }],
1646
- name: "balanceOf",
1647
- outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1648
- stateMutability: "view",
1649
- type: "function"
1650
- }
1651
- ]);
1652
- var wrapped = Object.freeze({
1653
- weth,
1654
- wethAbi
1655
- });
1656
-
1657
902
  // src/v4/protocols/index.ts
1658
- var Protocols = Object.freeze({
1659
- aaveV3,
1660
- aerodrome,
1661
- chainlink,
1662
- compoundV3,
1663
- erc20,
1664
- ethena,
1665
- fraxEther,
1666
- lido,
1667
- morphoBlue,
1668
- rocketPool,
1669
- sky,
1670
- spark,
1671
- superfluid,
1672
- uniswapV3,
1673
- wrapped
1674
- });
903
+ import { Protocols } from "@avaprotocol/protocols";
1675
904
  export {
1676
905
  APIError,
1677
906
  AUTH_TEMPLATE,