@merkl/api 0.20.51 → 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.
- package/dist/src/eden/index.d.ts +909 -905
- package/dist/src/engine/erc20SubTypeProcessors/helpers/tokenType.d.ts +2 -1
- package/dist/src/engine/erc20SubTypeProcessors/helpers/tokenType.js +5 -0
- package/dist/src/engine/erc20SubTypeProcessors/implementations/processorMapping.js +1 -0
- package/dist/src/engine/erc20SubTypeProcessors/subtypesRound1.js +2 -0
- package/dist/src/engine/opportunityMetadata/implementations/Erc20.js +1 -1
- package/dist/src/index.d.ts +174 -170
- package/dist/src/modules/v4/campaign/campaign.controller.d.ts +0 -169
- package/dist/src/modules/v4/campaign/campaign.controller.js +1 -65
- package/dist/src/modules/v4/campaign/campaign.test.controller.d.ts +193 -0
- package/dist/src/modules/v4/campaign/campaign.test.controller.js +71 -0
- package/dist/src/modules/v4/programPayload/programPayload.repository.d.ts +67 -2
- package/dist/src/modules/v4/programPayload/programPayload.repository.js +67 -0
- package/dist/src/modules/v4/protocol/protocol.controller.d.ts +1 -1
- package/dist/src/modules/v4/protocol/protocol.controller.js +2 -2
- package/dist/src/modules/v4/protocol/protocol.repository.d.ts +1 -9
- package/dist/src/modules/v4/protocol/protocol.repository.js +1 -4
- package/dist/src/modules/v4/protocol/protocol.service.d.ts +1 -2
- package/dist/src/modules/v4/protocol/protocol.service.js +2 -6
- package/dist/src/modules/v4/router.d.ts +174 -170
- package/dist/src/modules/v4/router.js +2 -0
- package/dist/src/utils/decodeCalls.js +10 -1
- package/dist/src/utils/encodeCalls.js +3 -0
- package/dist/src/utils/generateCardName.js +5 -0
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -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" | "xlend" | "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" | "xlend" | "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
|
-
}
|
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);
|
@@ -135,6 +136,8 @@ export function decodeReturnValue(returnData, key, type) {
|
|
135
136
|
return EulerInterface.decodeFunctionResult("asset", returnData)[0];
|
136
137
|
case tokenType.hourglass:
|
137
138
|
return HourglassVedaLockDepositorV2Interface.decodeFunctionResult("getUnderlying", returnData)[0];
|
139
|
+
case tokenType.curve_gauge:
|
140
|
+
return BalancerGaugeInterface.decodeFunctionResult("lp_token", returnData)[0];
|
138
141
|
default:
|
139
142
|
throw new Error(`Need tokenType for this key ${key}, or type ${type} not matched`);
|
140
143
|
}
|
@@ -166,6 +169,7 @@ export function decodeReturnValue(returnData, key, type) {
|
|
166
169
|
case "lp_price":
|
167
170
|
switch (type) {
|
168
171
|
case tokenType.curve:
|
172
|
+
case tokenType.curve_gauge:
|
169
173
|
return CurveInterface.decodeFunctionResult("lp_price", returnData)[0];
|
170
174
|
case tokenType.curve_2:
|
171
175
|
case tokenType.maha:
|
@@ -233,7 +237,12 @@ export function decodeReturnValue(returnData, key, type) {
|
|
233
237
|
BalancerVaultInterface.decodeFunctionResult("getPoolTokens", returnData)[1],
|
234
238
|
];
|
235
239
|
case "convertToAssets":
|
236
|
-
|
240
|
+
switch (type) {
|
241
|
+
case tokenType.curve_gauge:
|
242
|
+
return BigNumber.from("1000000000000000000");
|
243
|
+
default:
|
244
|
+
return FluidInterface.decodeFunctionResult("convertToAssets", returnData)[0];
|
245
|
+
}
|
237
246
|
case "tokenPrice":
|
238
247
|
return TorosInterface.decodeFunctionResult("tokenPrice", returnData)[0];
|
239
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:
|
@@ -134,6 +134,11 @@ export function generateCardName(type, typeInfo, campaign, symbols = [""], displ
|
|
134
134
|
return `Provide liquidity to ${capitalize(typeInfo.protocol)} ${typeInfo.symbolToken0}-${typeInfo.symbolToken1}-${typeInfo.symbolToken2}`;
|
135
135
|
case tokenType.maha:
|
136
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)}`;
|
137
142
|
case tokenType.tempest:
|
138
143
|
case tokenType.tempestStaking:
|
139
144
|
return `Deposit into ${typeInfo.symbolToken0}-${typeInfo.symbolToken1} vault on ${capitalize(typeInfo.protocol)}`;
|