@curvefi/api 2.54.9 → 2.55.1

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/README.md CHANGED
@@ -27,7 +27,9 @@ import curve from "@curvefi/api";
27
27
  await curve.crvUSDFactory.fetchPools();
28
28
  await curve.EYWAFactory.fetchPools();
29
29
  await curve.cryptoFactory.fetchPools();
30
+ await curve.twocryptoFactory.fetchPools();
30
31
  await curve.tricryptoFactory.fetchPools();
32
+ await curve.stableNgFactory.fetchPools();
31
33
  })()
32
34
  ```
33
35
  **Note 1.** ```chainId``` parameter is optional, but you must specify it in the case you use Metamask on localhost network, because Metamask has that [bug](https://hardhat.org/metamask-issue.html)
@@ -191,7 +193,9 @@ import curve from "@curvefi/api";
191
193
  await curve.crvUSDFactory.fetchPools();
192
194
  await curve.EYWAFactory.fetchPools();
193
195
  await curve.cryptoFactory.fetchPools();
196
+ await curve.twocryptoFactory.fetchPools();
194
197
  await curve.tricryptoFactory.fetchPools();
198
+ await curve.stableNgFactory.fetchPools();
195
199
 
196
200
  curve.getMainPoolList();
197
201
  // [
@@ -272,9 +276,15 @@ import curve from "@curvefi/api";
272
276
  // 'factory-crypto-60', 'factory-crypto-61', 'factory-crypto-62'
273
277
  // ]
274
278
 
279
+ curve.twocryptoFactory.getPoolList();
280
+ // ['factory-twocrypto-0', 'factory-twocrypto-1']
281
+
275
282
  curve.tricryptoFactory.getPoolList();
276
283
  // ['factory-tricrypto-0', 'factory-tricrypto-1']
277
284
 
285
+ curve.stableNgFactory.getPoolList();
286
+ // ['factory-stable-ng-0', 'factory-stable-ng-1']
287
+
278
288
  curve.getPoolList();
279
289
  // [
280
290
  // 'compound', 'usdt', 'y', 'busd',
@@ -317,8 +327,10 @@ import curve from "@curvefi/api";
317
327
  await curve.crvUSDFactory.fetchPools();
318
328
  await curve.EYWAFactory.fetchPools();
319
329
  await curve.cryptoFactory.fetchPools();
330
+ await curve.twocryptoFactory.fetchPools();
320
331
  await curve.tricryptoFactory.fetchPools();
321
-
332
+ await curve.stableNgFactory.fetchPools();
333
+
322
334
  const pool = curve.getPool('factory-v2-11');
323
335
 
324
336
  pool.id;
@@ -1047,7 +1059,9 @@ import curve from "@curvefi/api";
1047
1059
  await curve.crvUSDFactory.fetchPools();
1048
1060
  await curve.EYWAFactory.fetchPools();
1049
1061
  await curve.cryptoFactory.fetchPools();
1062
+ await curve.twocryptoFactory.fetchPools();
1050
1063
  await curve.tricryptoFactory.fetchPools();
1064
+ await curve.stableNgFactory.fetchPools();
1051
1065
 
1052
1066
  curve.hasRouter();
1053
1067
  // true
@@ -1509,16 +1523,24 @@ import curve from "@curvefi/api";
1509
1523
 
1510
1524
  // Fetch pools from api (if false arg is not passed)
1511
1525
  await curve.factory.fetchPools();
1526
+ await curve.crvUSDFactory.fetchPools();
1527
+ await curve.EYWAFactory.fetchPools();
1512
1528
  await curve.cryptoFactory.fetchPools();
1529
+ await curve.twocryptoFactory.fetchPools();
1513
1530
  await curve.tricryptoFactory.fetchPools();
1531
+ await curve.stableNgFactory.fetchPools();
1514
1532
 
1515
1533
  // Fetch very new pools (that haven't been added to api yet) from blockchain
1516
1534
  await curve.factory.fetchNewPools();
1517
1535
  // [ 'factory-v2-285' ]
1518
1536
  await curve.cryptoFactory.fetchNewPools();
1519
1537
  // [ 'factory-crypto-232' ]
1538
+ await curve.twocryptoFactory.fetchNewPools();
1539
+ // [ 'factory-twocrypto-2' ]
1520
1540
  await curve.tricryptoFactory.fetchNewPools();
1521
1541
  // [ 'factory-tricrypto-2' ]
1542
+ await curve.stableNgFactory.fetchNewPools();
1543
+ // [ 'factory-stable-ng-2' ]
1522
1544
  })()
1523
1545
  ```
1524
1546
 
@@ -1877,6 +1899,58 @@ import curve from "@curvefi/api";
1877
1899
  })()
1878
1900
  ```
1879
1901
 
1902
+ ### Deploy twocrypto pool
1903
+
1904
+ ```ts
1905
+ import curve from "@curvefi/api";
1906
+
1907
+ (async () => {
1908
+ await curve.init('JsonRpc', {}, { gasPrice: 0 });
1909
+
1910
+ const coins = [
1911
+ "0xC581b735A1688071A1746c968e0798D642EDE491", // EURT
1912
+ "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", // WETH
1913
+ ];
1914
+
1915
+ // Deploy pool
1916
+
1917
+ const deployPoolTx = await curve.twocryptoFactory.deployPool(
1918
+ "Test crypto pool",
1919
+ "TCP",
1920
+ coins,
1921
+ 400000,
1922
+ 0.0000725,
1923
+ 0.25,
1924
+ 0.45,
1925
+ 0.000002,
1926
+ 0.00023,
1927
+ 0.000146,
1928
+ 600,
1929
+ 1500
1930
+ );
1931
+ // {
1932
+ // hash: '0x406900448e537f2fd5c833a4f62a81305b9567e71f870772e10c72271bd78c37',
1933
+ // type: 0,
1934
+ // accessList: null,
1935
+ // ...
1936
+ // }
1937
+ const poolAddress = await curve.twocryptoFactory.getDeployedPoolAddress(deployPoolTx);
1938
+ // 0xe01a9ecdb0aaabe2f12a25a0d289480debf09e89
1939
+
1940
+ // Deposit & Stake
1941
+
1942
+ const poolId = await curve.twocryptoFactory.fetchRecentlyDeployedPool(poolAddress);
1943
+ // factory-twocrypto-155
1944
+ const pool = curve.getPool(poolId);
1945
+
1946
+ const amounts = await pool.cryptoSeedAmounts(30); // Initial amounts for crypto pools must have the ratio corresponding to initialPrice
1947
+ // [ '30', '0.02' ]
1948
+ await pool.depositAndStake(amounts);
1949
+ const underlyingBalances = await pool.stats.underlyingBalances();
1950
+ // [ '30.0', '0.02' ]
1951
+ })()
1952
+ ```
1953
+
1880
1954
  ### Deploy tricrypto pool
1881
1955
 
1882
1956
  ```ts