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

rename bahamut dex #684

Merged
merged 4 commits into from
Aug 2, 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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rubic-sdk",
"version": "5.32.7",
"version": "5.32.8",
"description": "Simplify dApp creation",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ import { WagyuSwapProvider } from 'src/features/on-chain/calculation-manager/pro
import { EddyFinanceProvider } from 'src/features/on-chain/calculation-manager/providers/dexes/zetachain/eddy-finance/eddy-finance-provider';
import { MuteSwapProvider } from 'src/features/on-chain/calculation-manager/providers/dexes/zksync/mute-swap/mute-swap-provider';

import { UniswapV2BahamutProvider } from '../../providers/dexes/bahamut/uniswap-v2-bahamut/uniswap-v2-bahamut-provider';
import { SilkSwapBahamutProvider } from '../../providers/dexes/bahamut/silk-swap-bahamut/silk-swap-bahamut-provider';
import { SushiSwapZetachainProvider } from '../../providers/dexes/zetachain/sushi-swap-zetachain/sushi-swap-zetachain-provider';

export const UniswapV2TradeProviders = [
Expand Down Expand Up @@ -157,5 +157,5 @@ export const UniswapV2TradeProviders = [
// Sei
DragonSwapProvider,
//Bahamut
UniswapV2BahamutProvider
SilkSwapBahamutProvider
] as const;
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export const ON_CHAIN_TRADE_TYPE = {
SUSHI_SWAP: 'SUSHI_SWAP',
SYNAPSE: 'SYNAPSE',
SYNC_SWAP: 'SYNC_SWAP',
SILK_SWAP: 'SILK_SWAP',

SYMBIOSIS_SWAP: 'SYMBIOSIS_SWAP', // Fake to show swap via unknown symbiosis dex

Expand All @@ -139,7 +140,6 @@ export const ON_CHAIN_TRADE_TYPE = {
UBE_SWAP: 'UBE_SWAP',
UNISWAP_V2: 'UNISWAP_V2',
UNI_SWAP_V3: 'UNI_SWAP_V3',
UNISWAP_BAHAMUT: 'UNISWAP_BAHAMUT',

VERSE: 'VERSE',
VIPER_SWAP: 'VIPER_SWAP',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { defaultBahamutProviderConfiguration } from '../default-constants';

export const SILK_SWAP_BAHAMUT_CONTRACT_ADDRESS = '0xF660558a4757Fb5953d269FF32E228Ae3d5f6c68';

export const SILK_SWAP_BAHAMUT_PROVIDER_CONFIGURATION = defaultBahamutProviderConfiguration;
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { BLOCKCHAIN_NAME } from 'src/core/blockchain/models/blockchain-name';
import { evmProviderDefaultOptions } from '../../common/on-chain-provider/evm-on-chain-provider/constants/evm-provider-default-options';
import { UniswapV2CalculationOptions } from '../../common/uniswap-v2-abstract/models/uniswap-v2-calculation-options';
import { UniswapV2AbstractProvider } from '../../common/uniswap-v2-abstract/uniswap-v2-abstract-provider';
import { UNISWAP_V2_BAHAMUT_PROVIDER_CONFIGURATION } from './constants';
import { UniswapV2BahamutTrade } from './uniswap-v2-bahamut-trade';
import { SILK_SWAP_BAHAMUT_PROVIDER_CONFIGURATION } from './constants';
import { SilkSwapBahamutTrade } from './silk-swap-bahamut-trade';

export class UniswapV2BahamutProvider extends UniswapV2AbstractProvider<UniswapV2BahamutTrade> {
export class SilkSwapBahamutProvider extends UniswapV2AbstractProvider<SilkSwapBahamutTrade> {
public readonly blockchain = BLOCKCHAIN_NAME.BAHAMUT;

protected readonly defaultOptions: UniswapV2CalculationOptions = {
Expand All @@ -15,7 +15,7 @@ export class UniswapV2BahamutProvider extends UniswapV2AbstractProvider<UniswapV
disableMultihops: false
};

public readonly UniswapV2TradeClass = UniswapV2BahamutTrade;
public readonly UniswapV2TradeClass = SilkSwapBahamutTrade;

public readonly providerSettings = UNISWAP_V2_BAHAMUT_PROVIDER_CONFIGURATION;
public readonly providerSettings = SILK_SWAP_BAHAMUT_PROVIDER_CONFIGURATION;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import { checkUnsupportedReceiverAddress } from 'src/features/common/utils/check

import { ON_CHAIN_TRADE_TYPE, OnChainTradeType } from '../../../common/models/on-chain-trade-type';
import { UniswapV2AbstractTrade } from '../../common/uniswap-v2-abstract/uniswap-v2-abstract-trade';
import { UNISWAP_V2_BAHAMUT_CONTRACT_ADDRESS } from './constants';
import { SILK_SWAP_BAHAMUT_CONTRACT_ADDRESS } from './constants';

export class UniswapV2BahamutTrade extends UniswapV2AbstractTrade {
export class SilkSwapBahamutTrade extends UniswapV2AbstractTrade {
public static get type(): OnChainTradeType {
return ON_CHAIN_TRADE_TYPE.UNISWAP_BAHAMUT;
return ON_CHAIN_TRADE_TYPE.SILK_SWAP;
}

public readonly dexContractAddress = UNISWAP_V2_BAHAMUT_CONTRACT_ADDRESS;
public readonly dexContractAddress = SILK_SWAP_BAHAMUT_CONTRACT_ADDRESS;

public async encode(options: EncodeTransactionOptions): Promise<EvmEncodeConfig> {
await checkUnsupportedReceiverAddress(options.receiverAddress, this.walletAddress);
Expand Down

This file was deleted.

Loading