Skip to content

Commit

Permalink
fix: curve.estimateGas.exchange using tricrypto2
Browse files Browse the repository at this point in the history
  • Loading branch information
Makeev Ivan committed Nov 8, 2021
1 parent 09e5bb3 commit 49d08ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@curvefi/api",
"version": "1.8.0",
"version": "1.8.1",
"description": "JavaScript library for curve.fi",
"main": "lib/index.js",
"scripts": {
Expand Down
4 changes: 3 additions & 1 deletion src/pools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1745,7 +1745,9 @@ export const exchangeEstimateGas = async (inputCoin: string, outputCoin: string,

const pool = new Pool(poolName);

if (isUnderlying) {
if (poolName === "tricrypto2") {
return await pool.estimateGas.exchangeTricrypto(i, j, amount, maxSlippage);
} else if (isUnderlying) {
return await pool.estimateGas.exchange(i, j, amount, maxSlippage);
} else {
return await pool.estimateGas.exchangeWrapped(i, j, amount, maxSlippage);
Expand Down

0 comments on commit 49d08ed

Please sign in to comment.