@merkl/api 0.20.50 → 0.20.52

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 (32) hide show
  1. package/dist/src/eden/index.d.ts +925 -921
  2. package/dist/src/engine/erc20SubTypeProcessors/helpers/tokenType.d.ts +4 -1
  3. package/dist/src/engine/erc20SubTypeProcessors/helpers/tokenType.js +15 -0
  4. package/dist/src/engine/erc20SubTypeProcessors/implementations/processorMapping.js +3 -0
  5. package/dist/src/engine/erc20SubTypeProcessors/subtypesRound1.js +6 -0
  6. package/dist/src/engine/opportunityMetadata/implementations/Erc20.js +1 -1
  7. package/dist/src/engine/opportunityMetadata/implementations/JsonAirdrop.d.ts +2 -2
  8. package/dist/src/index.d.ts +175 -171
  9. package/dist/src/modules/v4/campaign/campaign.controller.d.ts +0 -169
  10. package/dist/src/modules/v4/campaign/campaign.controller.js +1 -65
  11. package/dist/src/modules/v4/campaign/campaign.test.controller.d.ts +193 -0
  12. package/dist/src/modules/v4/campaign/campaign.test.controller.js +71 -0
  13. package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +1 -1
  14. package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +2 -2
  15. package/dist/src/modules/v4/programPayload/programPayload.repository.d.ts +67 -2
  16. package/dist/src/modules/v4/programPayload/programPayload.repository.js +67 -0
  17. package/dist/src/modules/v4/protocol/protocol.controller.d.ts +1 -1
  18. package/dist/src/modules/v4/protocol/protocol.controller.js +2 -2
  19. package/dist/src/modules/v4/protocol/protocol.model.d.ts +1 -1
  20. package/dist/src/modules/v4/protocol/protocol.model.js +1 -0
  21. package/dist/src/modules/v4/protocol/protocol.repository.d.ts +1 -9
  22. package/dist/src/modules/v4/protocol/protocol.repository.js +1 -4
  23. package/dist/src/modules/v4/protocol/protocol.service.d.ts +1 -2
  24. package/dist/src/modules/v4/protocol/protocol.service.js +2 -6
  25. package/dist/src/modules/v4/reward/reward.model.d.ts +1 -1
  26. package/dist/src/modules/v4/router.d.ts +175 -171
  27. package/dist/src/modules/v4/router.js +2 -0
  28. package/dist/src/utils/decodeCalls.js +12 -1
  29. package/dist/src/utils/encodeCalls.js +5 -0
  30. package/dist/src/utils/generateCardName.js +9 -0
  31. package/dist/tsconfig.package.tsbuildinfo +1 -1
  32. package/package.json +1 -1
@@ -188,7 +188,7 @@ export declare const v4: Elysia<"/v4", false, {
188
188
  } & {
189
189
  price?: number | null | undefined;
190
190
  })[];
191
- mainProtocol: "splice" | "morpho" | "quickswap" | "euler" | "ambient" | "uniswap" | "arthswap" | "base-swap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancake-swap" | "ramses" | "retro" | "stryke" | "sushi-swap" | "swapr" | "thruster" | "voltage" | "zero" | "koi" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap" | "neptune" | "zkSwapThreePool" | "rfx" | "ra" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "fraxlend" | "ironclad" | "gearbox" | "compound" | "sturdy" | "frax" | "ionic" | "moonwell" | "fluid" | "silo" | "dolomite" | "badger" | "ajna" | "layerbank" | "ion" | "venus" | "woofi" | "reactor_fusion" | "eigenlayer" | "vest" | "zerolend" | "hyperdrive" | "gamma" | "oku" | "hourglass" | "veda" | "kyo" | "sonex" | "lendle" | "tako-tako" | "equalizer" | "spectra" | "beraborrow" | "superlend" | "avalon" | "iguana" | "angles" | "enzyme" | "toros" | "vicuna" | "bunni" | "beratrax" | "concrete" | "cian" | "pendle" | "yei" | "filament" | "gammaswap" | "maha" | "tempest" | "uranium" | "holdstation" | "katana" | "satlayer" | undefined;
191
+ mainProtocol: "splice" | "morpho" | "quickswap" | "euler" | "ambient" | "uniswap" | "arthswap" | "base-swap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancake-swap" | "ramses" | "retro" | "stryke" | "sushi-swap" | "swapr" | "thruster" | "voltage" | "zero" | "koi" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap" | "neptune" | "zkSwapThreePool" | "rfx" | "ra" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "fraxlend" | "ironclad" | "gearbox" | "compound" | "sturdy" | "frax" | "ionic" | "moonwell" | "fluid" | "silo" | "dolomite" | "badger" | "ajna" | "layerbank" | "ion" | "venus" | "woofi" | "reactor_fusion" | "eigenlayer" | "vest" | "zerolend" | "hyperdrive" | "gamma" | "oku" | "hourglass" | "veda" | "kyo" | "sonex" | "lendle" | "tako-tako" | "equalizer" | "spectra" | "beraborrow" | "superlend" | "avalon" | "iguana" | "xlend" | "angles" | "enzyme" | "toros" | "vicuna" | "bunni" | "beratrax" | "concrete" | "cian" | "pendle" | "yei" | "filament" | "gammaswap" | "maha" | "tempest" | "uranium" | "holdstation" | "katana" | "satlayer" | undefined;
192
192
  depositUrl: any;
193
193
  explorerAddress: string | undefined;
194
194
  tags: string[];
@@ -1217,175 +1217,6 @@ export declare const v4: Elysia<"/v4", false, {
1217
1217
  };
1218
1218
  };
1219
1219
  };
1220
- } & {
1221
- "dry-run": {
1222
- ":campaignId": {
1223
- "dynamic-data": {
1224
- get: {
1225
- body: unknown;
1226
- params: {
1227
- campaignId: string;
1228
- };
1229
- query: unknown;
1230
- headers: {
1231
- authorization: string;
1232
- };
1233
- response: {
1234
- 200: unknown[];
1235
- };
1236
- };
1237
- };
1238
- };
1239
- };
1240
- } & {
1241
- "dry-run": {
1242
- "dynamic-data": {
1243
- list: {
1244
- post: {
1245
- body: string[];
1246
- params: {};
1247
- query: unknown;
1248
- headers: {
1249
- authorization: string;
1250
- };
1251
- response: {
1252
- 200: unknown[];
1253
- };
1254
- };
1255
- };
1256
- };
1257
- };
1258
- } & {
1259
- "dry-run": {
1260
- "dynamic-data": {
1261
- post: {
1262
- body: {
1263
- id?: string | undefined;
1264
- subType?: number | undefined;
1265
- campaignId?: string | undefined;
1266
- amount?: string | undefined;
1267
- creatorAddress?: string | undefined;
1268
- type: string;
1269
- params: any;
1270
- computeChainId: number;
1271
- distributionChainId: number;
1272
- startTimestamp: number;
1273
- endTimestamp: number;
1274
- rewardToken: string;
1275
- };
1276
- params: {};
1277
- query: unknown;
1278
- headers: {
1279
- authorization: string;
1280
- };
1281
- response: {
1282
- 200: unknown[];
1283
- };
1284
- };
1285
- };
1286
- };
1287
- } & {
1288
- "dry-run": {
1289
- metadata: {
1290
- post: {
1291
- body: {
1292
- id?: string | undefined;
1293
- subType?: number | undefined;
1294
- campaignId?: string | undefined;
1295
- amount?: string | undefined;
1296
- creatorAddress?: string | undefined;
1297
- type: string;
1298
- params: any;
1299
- computeChainId: number;
1300
- distributionChainId: number;
1301
- startTimestamp: number;
1302
- endTimestamp: number;
1303
- rewardToken: string;
1304
- };
1305
- params: {};
1306
- query: unknown;
1307
- headers: {
1308
- authorization: string;
1309
- };
1310
- response: {
1311
- 200: {
1312
- id: string;
1313
- chainId: number;
1314
- type: string;
1315
- identifier: string;
1316
- name: string;
1317
- status: "PAST" | "LIVE" | "SOON";
1318
- action: any;
1319
- tokens: ({
1320
- symbol: string;
1321
- id: string;
1322
- name: string | null;
1323
- icon: string;
1324
- address: string;
1325
- chainId: number;
1326
- decimals: number;
1327
- verified: boolean;
1328
- isTest: boolean;
1329
- isPoint: boolean;
1330
- isNative: boolean;
1331
- } & {
1332
- price?: number | null | undefined;
1333
- })[];
1334
- mainProtocol: "splice" | "morpho" | "quickswap" | "euler" | "ambient" | "uniswap" | "arthswap" | "base-swap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancake-swap" | "ramses" | "retro" | "stryke" | "sushi-swap" | "swapr" | "thruster" | "voltage" | "zero" | "koi" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap" | "neptune" | "zkSwapThreePool" | "rfx" | "ra" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "fraxlend" | "ironclad" | "gearbox" | "compound" | "sturdy" | "frax" | "ionic" | "moonwell" | "fluid" | "silo" | "dolomite" | "badger" | "ajna" | "layerbank" | "ion" | "venus" | "woofi" | "reactor_fusion" | "eigenlayer" | "vest" | "zerolend" | "hyperdrive" | "gamma" | "oku" | "hourglass" | "veda" | "kyo" | "sonex" | "lendle" | "tako-tako" | "equalizer" | "spectra" | "beraborrow" | "superlend" | "avalon" | "iguana" | "angles" | "enzyme" | "toros" | "vicuna" | "bunni" | "beratrax" | "concrete" | "cian" | "pendle" | "yei" | "filament" | "gammaswap" | "maha" | "tempest" | "uranium" | "holdstation" | "katana" | "satlayer" | undefined;
1335
- depositUrl: any;
1336
- explorerAddress: string | undefined;
1337
- tags: string[];
1338
- };
1339
- };
1340
- };
1341
- };
1342
- };
1343
- } & {
1344
- "dry-run": {
1345
- metadata: {
1346
- get: {
1347
- body: unknown;
1348
- params: {};
1349
- query: {
1350
- campaignId: string;
1351
- distributionChain: number;
1352
- };
1353
- headers: {
1354
- authorization: string;
1355
- };
1356
- response: {
1357
- 200: {
1358
- id: string;
1359
- chainId: number;
1360
- type: string;
1361
- identifier: string;
1362
- name: string;
1363
- status: "PAST" | "LIVE" | "SOON";
1364
- action: any;
1365
- tokens: ({
1366
- symbol: string;
1367
- id: string;
1368
- name: string | null;
1369
- icon: string;
1370
- address: string;
1371
- chainId: number;
1372
- decimals: number;
1373
- verified: boolean;
1374
- isTest: boolean;
1375
- isPoint: boolean;
1376
- isNative: boolean;
1377
- } & {
1378
- price?: number | null | undefined;
1379
- })[];
1380
- mainProtocol: "splice" | "morpho" | "quickswap" | "euler" | "ambient" | "uniswap" | "arthswap" | "base-swap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancake-swap" | "ramses" | "retro" | "stryke" | "sushi-swap" | "swapr" | "thruster" | "voltage" | "zero" | "koi" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap" | "neptune" | "zkSwapThreePool" | "rfx" | "ra" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "fraxlend" | "ironclad" | "gearbox" | "compound" | "sturdy" | "frax" | "ionic" | "moonwell" | "fluid" | "silo" | "dolomite" | "badger" | "ajna" | "layerbank" | "ion" | "venus" | "woofi" | "reactor_fusion" | "eigenlayer" | "vest" | "zerolend" | "hyperdrive" | "gamma" | "oku" | "hourglass" | "veda" | "kyo" | "sonex" | "lendle" | "tako-tako" | "equalizer" | "spectra" | "beraborrow" | "superlend" | "avalon" | "iguana" | "angles" | "enzyme" | "toros" | "vicuna" | "bunni" | "beratrax" | "concrete" | "cian" | "pendle" | "yei" | "filament" | "gammaswap" | "maha" | "tempest" | "uranium" | "holdstation" | "katana" | "satlayer" | undefined;
1381
- depositUrl: any;
1382
- explorerAddress: string | undefined;
1383
- tags: string[];
1384
- };
1385
- };
1386
- };
1387
- };
1388
- };
1389
1220
  } & {
1390
1221
  index: {
1391
1222
  get: {
@@ -1929,6 +1760,179 @@ export declare const v4: Elysia<"/v4", false, {
1929
1760
  };
1930
1761
  };
1931
1762
  };
1763
+ } & {
1764
+ v4: {
1765
+ campaigns: {
1766
+ "dry-run": {
1767
+ ":campaignId": {
1768
+ "dynamic-data": {
1769
+ get: {
1770
+ body: unknown;
1771
+ params: {
1772
+ campaignId: string;
1773
+ };
1774
+ query: unknown;
1775
+ headers: {
1776
+ authorization: string;
1777
+ };
1778
+ response: {
1779
+ 200: unknown[];
1780
+ };
1781
+ };
1782
+ };
1783
+ };
1784
+ };
1785
+ } & {
1786
+ "dry-run": {
1787
+ "dynamic-data": {
1788
+ list: {
1789
+ post: {
1790
+ body: string[];
1791
+ params: {};
1792
+ query: unknown;
1793
+ headers: {
1794
+ authorization: string;
1795
+ };
1796
+ response: {
1797
+ 200: unknown[];
1798
+ };
1799
+ };
1800
+ };
1801
+ };
1802
+ };
1803
+ } & {
1804
+ "dry-run": {
1805
+ "dynamic-data": {
1806
+ post: {
1807
+ body: {
1808
+ id?: string | undefined;
1809
+ subType?: number | undefined;
1810
+ campaignId?: string | undefined;
1811
+ amount?: string | undefined;
1812
+ creatorAddress?: string | undefined;
1813
+ type: string;
1814
+ params: any;
1815
+ computeChainId: number;
1816
+ distributionChainId: number;
1817
+ startTimestamp: number;
1818
+ endTimestamp: number;
1819
+ rewardToken: string;
1820
+ };
1821
+ params: {};
1822
+ query: unknown;
1823
+ headers: {
1824
+ authorization: string;
1825
+ };
1826
+ response: {
1827
+ 200: unknown[];
1828
+ };
1829
+ };
1830
+ };
1831
+ };
1832
+ } & {
1833
+ "dry-run": {
1834
+ metadata: {
1835
+ post: {
1836
+ body: {
1837
+ id?: string | undefined;
1838
+ subType?: number | undefined;
1839
+ campaignId?: string | undefined;
1840
+ amount?: string | undefined;
1841
+ creatorAddress?: string | undefined;
1842
+ type: string;
1843
+ params: any;
1844
+ computeChainId: number;
1845
+ distributionChainId: number;
1846
+ startTimestamp: number;
1847
+ endTimestamp: number;
1848
+ rewardToken: string;
1849
+ };
1850
+ params: {};
1851
+ query: unknown;
1852
+ headers: {
1853
+ authorization: string;
1854
+ };
1855
+ response: {
1856
+ 200: {
1857
+ id: string;
1858
+ chainId: number;
1859
+ type: string;
1860
+ identifier: string;
1861
+ name: string;
1862
+ status: "PAST" | "LIVE" | "SOON";
1863
+ action: any;
1864
+ tokens: ({
1865
+ symbol: string;
1866
+ id: string;
1867
+ name: string | null;
1868
+ icon: string;
1869
+ address: string;
1870
+ chainId: number;
1871
+ decimals: number;
1872
+ verified: boolean;
1873
+ isTest: boolean;
1874
+ isPoint: boolean;
1875
+ isNative: boolean;
1876
+ } & {
1877
+ price?: number | null | undefined;
1878
+ })[];
1879
+ mainProtocol: "splice" | "morpho" | "quickswap" | "euler" | "ambient" | "uniswap" | "arthswap" | "base-swap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancake-swap" | "ramses" | "retro" | "stryke" | "sushi-swap" | "swapr" | "thruster" | "voltage" | "zero" | "koi" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap" | "neptune" | "zkSwapThreePool" | "rfx" | "ra" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "fraxlend" | "ironclad" | "gearbox" | "compound" | "sturdy" | "frax" | "ionic" | "moonwell" | "fluid" | "silo" | "dolomite" | "badger" | "ajna" | "layerbank" | "ion" | "venus" | "woofi" | "reactor_fusion" | "eigenlayer" | "vest" | "zerolend" | "hyperdrive" | "gamma" | "oku" | "hourglass" | "veda" | "kyo" | "sonex" | "lendle" | "tako-tako" | "equalizer" | "spectra" | "beraborrow" | "superlend" | "avalon" | "iguana" | "xlend" | "angles" | "enzyme" | "toros" | "vicuna" | "bunni" | "beratrax" | "concrete" | "cian" | "pendle" | "yei" | "filament" | "gammaswap" | "maha" | "tempest" | "uranium" | "holdstation" | "katana" | "satlayer" | undefined;
1880
+ depositUrl: any;
1881
+ explorerAddress: string | undefined;
1882
+ tags: string[];
1883
+ };
1884
+ };
1885
+ };
1886
+ };
1887
+ };
1888
+ } & {
1889
+ "dry-run": {
1890
+ metadata: {
1891
+ get: {
1892
+ body: unknown;
1893
+ params: {};
1894
+ query: {
1895
+ campaignId: string;
1896
+ distributionChain: number;
1897
+ };
1898
+ headers: {
1899
+ authorization: string;
1900
+ };
1901
+ response: {
1902
+ 200: {
1903
+ id: string;
1904
+ chainId: number;
1905
+ type: string;
1906
+ identifier: string;
1907
+ name: string;
1908
+ status: "PAST" | "LIVE" | "SOON";
1909
+ action: any;
1910
+ tokens: ({
1911
+ symbol: string;
1912
+ id: string;
1913
+ name: string | null;
1914
+ icon: string;
1915
+ address: string;
1916
+ chainId: number;
1917
+ decimals: number;
1918
+ verified: boolean;
1919
+ isTest: boolean;
1920
+ isPoint: boolean;
1921
+ isNative: boolean;
1922
+ } & {
1923
+ price?: number | null | undefined;
1924
+ })[];
1925
+ mainProtocol: "splice" | "morpho" | "quickswap" | "euler" | "ambient" | "uniswap" | "arthswap" | "base-swap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancake-swap" | "ramses" | "retro" | "stryke" | "sushi-swap" | "swapr" | "thruster" | "voltage" | "zero" | "koi" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap" | "neptune" | "zkSwapThreePool" | "rfx" | "ra" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "fraxlend" | "ironclad" | "gearbox" | "compound" | "sturdy" | "frax" | "ionic" | "moonwell" | "fluid" | "silo" | "dolomite" | "badger" | "ajna" | "layerbank" | "ion" | "venus" | "woofi" | "reactor_fusion" | "eigenlayer" | "vest" | "zerolend" | "hyperdrive" | "gamma" | "oku" | "hourglass" | "veda" | "kyo" | "sonex" | "lendle" | "tako-tako" | "equalizer" | "spectra" | "beraborrow" | "superlend" | "avalon" | "iguana" | "xlend" | "angles" | "enzyme" | "toros" | "vicuna" | "bunni" | "beratrax" | "concrete" | "cian" | "pendle" | "yei" | "filament" | "gammaswap" | "maha" | "tempest" | "uranium" | "holdstation" | "katana" | "satlayer" | undefined;
1926
+ depositUrl: any;
1927
+ explorerAddress: string | undefined;
1928
+ tags: string[];
1929
+ };
1930
+ };
1931
+ };
1932
+ };
1933
+ };
1934
+ };
1935
+ };
1932
1936
  } & {
1933
1937
  v4: {
1934
1938
  protocols: {
@@ -2008,7 +2012,7 @@ export declare const v4: Elysia<"/v4", false, {
2008
2012
  dailyRewards?: number | undefined;
2009
2013
  numberOfLiveCampaigns?: number | undefined;
2010
2014
  opportunityLiveTags?: string[] | undefined;
2011
- } | null;
2015
+ };
2012
2016
  };
2013
2017
  };
2014
2018
  };
@@ -2,6 +2,7 @@ import { AccountingController } from "@/modules/v4/accounting/accounting.control
2
2
  import { BlacklistController } from "@/modules/v4/blacklist/blacklist.controller";
3
3
  import { BoostController } from "@/modules/v4/boost/boost.controller";
4
4
  import { CampaignController } from "@/modules/v4/campaign/campaign.controller";
5
+ import { CampaignTestController } from "@/modules/v4/campaign/campaign.test.controller";
5
6
  import { ChainController } from "@/modules/v4/chain/chain.controller";
6
7
  import { ClaimController } from "@/modules/v4/claims/claims.controller";
7
8
  import { ComputedValueController } from "@/modules/v4/computedValue/computedValue.controller";
@@ -55,6 +56,7 @@ export const v4 = new Elysia({ tags: ["v4"], prefix: "/v4" })
55
56
  // ─── Route Controllers ───────────────────────────────────────────────
56
57
  .use(OpportunityController)
57
58
  .use(CampaignController)
59
+ .use(CampaignTestController)
58
60
  .use(ProtocolController)
59
61
  .use(ExplorerController)
60
62
  .use(TokenController)
@@ -1,5 +1,6 @@
1
1
  import { tokenType } from "@/engine/erc20SubTypeProcessors/helpers/tokenType";
2
2
  import { AaveInterface, AccountantWithRateProvidersInterface, AuraInterface, AuraOperatorInterface, BalancerGaugeInterface, BalancerPoolInterface, BalancerV3StablePoolInterface, BalancerVaultInterface, BeefyInterface, BunniV2HubInterface, BunniV2TokenInterface, CPMMGammaPoolMainInterface, CompoundInterface, CurveInterface, CurveLPTokenInterface, CurveStableSwapNGInterface, DefutureVaultInterface, ERC20Interface, ERC4626Interface, EnzymeInterface, EulerInterface, FactoryInterface, FluidInterface, FraxlendInterface, GearboxVaultInterface, HourglassERC20TBTInterface, HourglassVedaLockDepositorV2Interface, IonicInterface, LPManagerHelperInterface, LPManagerInterface, LayerBankERC20Interface, LayerBankInterface, LendleInterface, MaverickBPLensInterface, MetamorphoInterface, MoonwellInterface, OneInchStakingInterface, PendleInterface, PendleYTInterface, RadiantInterface, RfxInterface, RswEthStrategyInterface, SpectraYTInterface, SturdyInterface, SymetricAmbientStrategyInterface, SyncSwapClassicPoolInterface, TorosInterface, UniswapV2PoolInterface, UniswapV3PoolInterface, VePufferInterface, ZFStableLPINterface, ZFStableSwapThreePoolInterface, } from "@sdk";
3
+ import { BigNumber } from "ethers";
3
4
  export function decodeCall(calls, index, key, type) {
4
5
  const returnData = calls[index];
5
6
  return decodeReturnValue(returnData, key, type);
@@ -107,6 +108,8 @@ export function decodeReturnValue(returnData, key, type) {
107
108
  case tokenType.lendle_borrowing:
108
109
  case tokenType.yei_borrowing:
109
110
  case tokenType.yei_lending:
111
+ case tokenType.xlend_lending:
112
+ case tokenType.xlend_borrowing:
110
113
  return AaveInterface.decodeFunctionResult("UNDERLYING_ASSET_ADDRESS", returnData)[0];
111
114
  case tokenType.radiant_borrow:
112
115
  case tokenType.radiant_lend:
@@ -133,6 +136,8 @@ export function decodeReturnValue(returnData, key, type) {
133
136
  return EulerInterface.decodeFunctionResult("asset", returnData)[0];
134
137
  case tokenType.hourglass:
135
138
  return HourglassVedaLockDepositorV2Interface.decodeFunctionResult("getUnderlying", returnData)[0];
139
+ case tokenType.curve_gauge:
140
+ return BalancerGaugeInterface.decodeFunctionResult("lp_token", returnData)[0];
136
141
  default:
137
142
  throw new Error(`Need tokenType for this key ${key}, or type ${type} not matched`);
138
143
  }
@@ -164,6 +169,7 @@ export function decodeReturnValue(returnData, key, type) {
164
169
  case "lp_price":
165
170
  switch (type) {
166
171
  case tokenType.curve:
172
+ case tokenType.curve_gauge:
167
173
  return CurveInterface.decodeFunctionResult("lp_price", returnData)[0];
168
174
  case tokenType.curve_2:
169
175
  case tokenType.maha:
@@ -231,7 +237,12 @@ export function decodeReturnValue(returnData, key, type) {
231
237
  BalancerVaultInterface.decodeFunctionResult("getPoolTokens", returnData)[1],
232
238
  ];
233
239
  case "convertToAssets":
234
- return FluidInterface.decodeFunctionResult("convertToAssets", returnData)[0];
240
+ switch (type) {
241
+ case tokenType.curve_gauge:
242
+ return BigNumber.from("1000000000000000000");
243
+ default:
244
+ return FluidInterface.decodeFunctionResult("convertToAssets", returnData)[0];
245
+ }
235
246
  case "tokenPrice":
236
247
  return TorosInterface.decodeFunctionResult("tokenPrice", returnData)[0];
237
248
  case "readTokens0":
@@ -23,6 +23,7 @@ export function createCall(target, key, type, metaData) {
23
23
  case "lp_price":
24
24
  switch (type) {
25
25
  case tokenType.curve:
26
+ case tokenType.curve_gauge:
26
27
  return { allowFailure: true, callData: CurveInterface.encodeFunctionData("lp_price"), target };
27
28
  case tokenType.curve_2:
28
29
  case tokenType.maha:
@@ -114,6 +115,8 @@ export function createCall(target, key, type, metaData) {
114
115
  callData: EulerInterface.encodeFunctionData("asset"),
115
116
  target,
116
117
  };
118
+ case tokenType.curve_gauge:
119
+ return { allowFailure: true, callData: BalancerGaugeInterface.encodeFunctionData("lp_token"), target };
117
120
  case tokenType.fraxlend:
118
121
  case tokenType.sturdy_aggregator:
119
122
  case tokenType.sturdy_silo:
@@ -165,6 +168,8 @@ export function createCall(target, key, type, metaData) {
165
168
  case tokenType.yei_lending:
166
169
  case tokenType.vicuna_borrowing:
167
170
  case tokenType.vicuna_lending:
171
+ case tokenType.xlend_lending:
172
+ case tokenType.xlend_borrowing:
168
173
  return { allowFailure: true, callData: AaveInterface.encodeFunctionData("UNDERLYING_ASSET_ADDRESS"), target };
169
174
  case tokenType.hourglass:
170
175
  return {
@@ -101,6 +101,10 @@ export function generateCardName(type, typeInfo, campaign, symbols = [""], displ
101
101
  case tokenType.euler_lend:
102
102
  case tokenType.fluid:
103
103
  return `Lend ${typeInfo.symbolUnderlyingToken} on ${capitalize(typeInfo.protocol)}`;
104
+ case tokenType.xlend_lending:
105
+ return `Lend ${typeInfo.symbolUnderlyingToken} on Extrafi XLend`;
106
+ case tokenType.xlend_borrowing:
107
+ return `Borrow ${typeInfo.symbolUnderlyingToken} on Extrafi XLend`;
104
108
  case tokenType.metamorpho:
105
109
  return `Supply to ${typeInfo.name} on ${capitalize(typeInfo.protocol)}`;
106
110
  case tokenType.sturdy_aggregator:
@@ -130,6 +134,11 @@ export function generateCardName(type, typeInfo, campaign, symbols = [""], displ
130
134
  return `Provide liquidity to ${capitalize(typeInfo.protocol)} ${typeInfo.symbolToken0}-${typeInfo.symbolToken1}-${typeInfo.symbolToken2}`;
131
135
  case tokenType.maha:
132
136
  return `Stake ${typeInfo.symbolToken0}-${typeInfo.symbolToken1} LP on ${capitalize(typeInfo.protocol)}`;
137
+ case tokenType.curve_gauge:
138
+ if (!!typeInfo.symbolToken2) {
139
+ return `Stake ${typeInfo.symbolToken0}-${typeInfo.symbolToken1}-${typeInfo.symbolToken2} LP on ${capitalize(typeInfo.protocol)}`;
140
+ }
141
+ return `Stake ${typeInfo.symbolToken0}-${typeInfo.symbolToken1} LP on ${capitalize(typeInfo.protocol)}`;
133
142
  case tokenType.tempest:
134
143
  case tokenType.tempestStaking:
135
144
  return `Deposit into ${typeInfo.symbolToken0}-${typeInfo.symbolToken1} vault on ${capitalize(typeInfo.protocol)}`;