-
-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #247 from vic-en/feat/pancake_swap_v3
Feat/pancake swap v3
- Loading branch information
Showing
21 changed files
with
1,760 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,43 @@ | ||
import { buildConfig, NetworkConfig } from '../../network/network.utils'; | ||
import { | ||
buildConfig, | ||
NetworkConfig as V2NetworkConfig, | ||
} from '../../network/network.utils'; | ||
import { ConfigManagerV2 } from '../../services/config-manager-v2'; | ||
|
||
export namespace PancakeSwapConfig { | ||
export const config: NetworkConfig = buildConfig( | ||
export interface NetworkConfig extends Omit<V2NetworkConfig, 'tradingTypes'> { | ||
maximumHops: number; | ||
pancakeswapV3SmartOrderRouterAddress: (network: string) => string; | ||
pancakeswapV3NftManagerAddress: (network: string) => string; | ||
tradingTypes: (type: string) => Array<string>; | ||
useRouter?: boolean; | ||
feeTier?: string; | ||
} | ||
|
||
export const v2Config: V2NetworkConfig = buildConfig( | ||
'pancakeswap', | ||
['AMM'], | ||
[{ chain: 'binance-smart-chain', networks: ['mainnet', 'testnet'] }], | ||
'EVM' | ||
); | ||
|
||
export const config: NetworkConfig = { | ||
...v2Config, | ||
...{ | ||
maximumHops: ConfigManagerV2.getInstance().get(`pancakeswap.maximumHops`), | ||
pancakeswapV3SmartOrderRouterAddress: (network: string) => | ||
ConfigManagerV2.getInstance().get( | ||
`pancakeswap.contractAddresses.${network}.pancakeswapV3SmartOrderRouterAddress` | ||
), | ||
pancakeswapV3NftManagerAddress: (network: string) => | ||
ConfigManagerV2.getInstance().get( | ||
`pancakeswap.contractAddresses.${network}.pancakeswapV3NftManagerAddress` | ||
), | ||
tradingTypes: (type: string) => { | ||
return type === 'swap' ? ['AMM'] : ['AMM_LP']; | ||
}, | ||
useRouter: ConfigManagerV2.getInstance().get(`pancakeswap.useRouter`), | ||
feeTier: ConfigManagerV2.getInstance().get(`pancakeswap.feeTier`), | ||
}, | ||
}; | ||
} |
Oops, something went wrong.