Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix / revised uniswap-base support #329

Merged
merged 10 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@
"osmojs": "16.5.1",
"promise-retry": "^2.0.1",
"quickswap-sdk": "^3.0.8",
"quipuswap-v3-sdk": "^0.0.7",
"swagger-ui-express": "^4.1.6",
"swap-router-sdk": "^1.21.1",
"tslib": "^2.3.1",
Expand Down
24 changes: 6 additions & 18 deletions src/amm/amm.controllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,6 @@ import {
trade as plentyTrade,
estimateGas as plentyEstimateGas,
} from '../connectors/plenty/plenty.controllers';
import {
price as quipuPrice,
trade as quipuTrade,
estimateGas as quipuEstimateGas,
} from '../connectors/quipuswap/quipuswap.controllers';
import {
getInitializedChain,
getConnector,
Expand All @@ -85,7 +80,6 @@ import {
import { Algorand } from '../chains/algorand/algorand';
import { Tinyman } from '../connectors/tinyman/tinyman';
import { Plenty } from '../connectors/plenty/plenty';
import { QuipuSwap } from '../connectors/quipuswap/quipuswap';
import { Osmosis } from '../chains/osmosis/osmosis';
import { Carbonamm } from '../connectors/carbon/carbonAMM';

Expand All @@ -97,17 +91,15 @@ export async function price(req: PriceRequest): Promise<PriceResponse> {
return chain.controller.price(chain as unknown as Osmosis, req);
}

const connector: Uniswapish | RefAMMish | Tinyman | Plenty | QuipuSwap =
await getConnector<Uniswapish | RefAMMish | Tinyman | Plenty | QuipuSwap>(
const connector: Uniswapish | RefAMMish | Tinyman | Plenty =
await getConnector<Uniswapish | RefAMMish | Tinyman | Plenty>(
req.chain,
req.network,
req.connector
);

if (connector instanceof Plenty) {
return plentyPrice(<Tezosish>chain, connector, req);
} else if (connector instanceof QuipuSwap) {
return quipuPrice(<Tezosish>chain, connector, req);
} else if (connector instanceof Carbonamm) {
return carbonPrice(<Ethereumish>chain, connector, req);
} else if ('routerAbi' in connector) {
Expand All @@ -128,17 +120,15 @@ export async function trade(req: TradeRequest): Promise<TradeResponse> {
return chain.controller.trade(chain as unknown as Osmosis, req);
}

const connector: Uniswapish | RefAMMish | Tinyman | Plenty | QuipuSwap =
await getConnector<Uniswapish | RefAMMish | Tinyman | Plenty | QuipuSwap>(
const connector: Uniswapish | RefAMMish | Tinyman | Plenty =
await getConnector<Uniswapish | RefAMMish | Tinyman | Plenty>(
req.chain,
req.network,
req.connector
);

if (connector instanceof Plenty) {
return plentyTrade(<Tezosish>chain, connector, req);
} else if (connector instanceof QuipuSwap) {
return quipuTrade(<Tezosish>chain, connector, req);
} else if (connector instanceof Carbonamm) {
return carbonTrade(<Ethereumish>chain, connector, req);
} else if ('routerAbi' in connector) {
Expand Down Expand Up @@ -238,17 +228,15 @@ export async function estimateGas(
return chain.controller.estimateGas(chain as unknown as Osmosis);
}

const connector: Uniswapish | RefAMMish | Tinyman | Plenty | QuipuSwap =
await getConnector<Uniswapish | RefAMMish | Plenty | QuipuSwap>(
const connector: Uniswapish | RefAMMish | Tinyman | Plenty =
await getConnector<Uniswapish | RefAMMish | Plenty>(
req.chain,
req.network,
req.connector
);

if (connector instanceof Plenty) {
return plentyEstimateGas(<Tezosish>chain, connector);
} else if (connector instanceof QuipuSwap) {
return quipuEstimateGas(<Tezosish>chain, connector);
} else if (connector instanceof Carbonamm) {
return carbonEstimateGas(<Ethereumish>chain, connector);
} else if ('routerAbi' in connector) {
Expand Down
3 changes: 0 additions & 3 deletions src/chains/tezos/tezos.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,6 @@ export class TezosBase {
if (spender === 'plenty') {
// plenty doesn't need an allowance
return { value: constants.MaxUint256, decimals: tokenDecimals };
} else if (spender === 'quipuswap') {
// quipuswap doesn't need an allowance
return { value: constants.MaxUint256, decimals: tokenDecimals };
}

let value = BigNumber.from(0);
Expand Down
7 changes: 0 additions & 7 deletions src/connectors/connectors.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { CurveConfig } from './curve/curveswap.config';
import { PlentyConfig } from './plenty/plenty.config';
import { XRPLCLOBConfig } from './xrpl/xrpl.clob.config';
import { KujiraConfig } from './kujira/kujira.config';
import { QuipuswapConfig } from './quipuswap/quipuswap.config';
import { OsmosisConfig } from '../chains/osmosis/osmosis.config';
import { CarbonConfig } from './carbon/carbon.config';
import { BalancerConfig } from './balancer/balancer.config';
Expand Down Expand Up @@ -166,12 +165,6 @@ export namespace ConnectorsRoutes {
'Enter your kujira account number (input 0 if unsure) >>> ',
},
},
{
name: 'quipuswap',
trading_type: QuipuswapConfig.config.tradingTypes,
chain_type: QuipuswapConfig.config.chainType,
available_networks: QuipuswapConfig.config.availableNetworks,
},
{
name: 'osmosis',
trading_type: OsmosisConfig.config.tradingTypes('swap'),
Expand Down
31 changes: 0 additions & 31 deletions src/connectors/quipuswap/quipuswap.config.ts

This file was deleted.

Loading
Loading