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

feat(network): add moonbeam network #5842

Closed
Closed
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
b759e35
feat(network): add moonbeam network
developerfred Mar 8, 2022
375be3c
feat(moonbeam): add BeamSwap and StellaSwap #5826 #5827
developerfred Mar 9, 2022
c80d16a
chore(moonbeam): add json infos
developerfred Mar 9, 2022
eb34de0
feat(moonbeam): add padswap dex
developerfred Mar 9, 2022
d3f1475
chore(moonbeam): add brand image
developerfred Mar 9, 2022
130c04e
Merge remote-tracking branch 'upstream/develop' into feat/moonbean-ne…
developerfred Mar 24, 2022
2117010
Merge remote-tracking branch 'upstream/develop' into feat/moonbean-ne…
developerfred Mar 24, 2022
8afbd43
Merge remote-tracking branch 'upstream/develop' into feat/moonbean-ne…
developerfred Mar 25, 2022
99df5b4
Merge remote-tracking branch 'upstream/develop' into feat/moonbean-ne…
developerfred Apr 6, 2022
90006f9
chore(moonbeam): add contracts address
developerfred Apr 6, 2022
95add97
Merge branch 'main' into feat/moonbean-network
Jack-Works Apr 7, 2022
d3494cd
Update packages/web3-constants/evm/explorer.json
developerfred Apr 7, 2022
a50a9e6
Merge remote-tracking branch 'upstream/develop' into feat/moonbean-ne…
developerfred Apr 22, 2022
aa69fa1
chore(moonbeam): add pr url on docs
developerfred Apr 22, 2022
289e65b
chore(moonbeam): add multicall address
developerfred Apr 22, 2022
3fa8cee
chore(moonbeam): update token address
developerfred Apr 22, 2022
41b0580
chore(moonbeam): add EIP1559 feature on moonbeam network
developerfred Apr 22, 2022
f3fee32
feat(moonbeam): add solflare and zenlink dex
developerfred Apr 22, 2022
29f26dd
chore(moonbeam): code review fixed chains and docs
developerfred Apr 24, 2022
a89ff4c
Merge branch 'develop' into feat/moonbean-network
developerfred Apr 28, 2022
d007485
Merge remote-tracking branch 'upstream/develop' into feat/moonbean-ne…
developerfred May 2, 2022
9ad9ce4
fix(moonbeam): fixed chainId
developerfred May 2, 2022
dd0d43a
chore(Moonbeam): update dexs tokens address
developerfred May 2, 2022
1835f9e
Merge remote-tracking branch 'upstream/develop' into feat/moonbean-ne…
developerfred May 7, 2022
0a4ec3c
Merge remote-tracking branch 'upstream/develop' into feat/moonbean-ne…
developerfred May 13, 2022
b9fa155
Merge remote-tracking branch 'upstream/develop' into feat/moonbean-ne…
developerfred May 13, 2022
5a9991f
Merge remote-tracking branch 'upstream/develop' into feat/moonbean-ne…
developerfred May 16, 2022
fdc5403
chore(moonbeam): change native token address
developerfred May 16, 2022
5acc3f0
chore(moonbeam): add GLINT beamSwap token
developerfred May 16, 2022
bfeb569
chore(moonbeam): add zenlink dex on getContractOwnerDomain
developerfred May 16, 2022
7f9452d
Merge branch 'develop' into feat/moonbean-network
developerfred May 20, 2022
e305534
Merge remote-tracking branch 'codingsh/feat/moonbean-network' into fe…
developerfred May 23, 2022
14b576e
chore(moonbeam): update rpcs and enalbe 1559
developerfred May 23, 2022
6e185f5
fix: add missing deps (#6356)
nuanyang233 May 26, 2022
836f5f5
fix(ui): claim button && mind fb tool box hint (#6337)
zhouhanseng May 26, 2022
0bf326e
refactor: update promote text for plugins. (#6217)
UncleBill May 26, 2022
eb3883e
Merge remote-tracking branch 'upstream/develop' into feat/moonbean-ne…
developerfred May 27, 2022
6e3d3c8
chore(moonbeam): add balanceChecker contract
developerfred May 27, 2022
526a359
Merge remote-tracking branch 'upstream/develop' into feat/moonbean-ne…
developerfred May 30, 2022
65d22be
Merge remote-tracking branch 'upstream/develop' into feat/moonbean-ne…
developerfred Jun 5, 2022
f74ae55
Merge remote-tracking branch 'upstream/develop' into feat/moonbean-ne…
developerfred Jun 14, 2022
8b9dfc7
chore(spell): fixed cspell
developerfred Jun 14, 2022
fdb51db
Merge remote-tracking branch 'upstream/develop' into feat/moonbean-ne…
developerfred Jun 30, 2022
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
5 changes: 5 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
"arweave",
"avalanche",
"avax",
"beamshare",
"beamswap",
"betanet",
"bgcolor",
"bignumber",
Expand Down Expand Up @@ -98,6 +100,7 @@
"futuna",
"gasnow",
"geckoview",
"glmr",
"gltf",
"goodghosting",
"gundb",
Expand Down Expand Up @@ -171,6 +174,7 @@
"opensea",
"overridable",
"overscan",
"padswap",
"pageable",
"pagelet",
"pancakeswap",
Expand Down Expand Up @@ -224,6 +228,7 @@
"steganographic",
"steganography",
"stego",
"stellaswap",
"subrepo",
"superrare",
"sushiswap",
Expand Down
1 change: 1 addition & 0 deletions docs/evm-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,4 @@ Here is the chain abilities checklist. If you are working on a bounty task, plea
| xDai | <https://github.com/DimensionDev/Maskbook/pull/4140> |
| Arbitrum | <https://github.com/DimensionDev/Maskbook/pull/3558> |
| Avalanche | <https://github.com/DimensionDev/Maskbook/pull/5289> |
| Moonbeam | <#> |
1 change: 1 addition & 0 deletions packages/mask/shared/flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const Flags = {
fantom_enabled: true,
celo_enabled: true,
aurora_enabled: true,
moonbeam_enabled: true,
nft_airdrop_enabled: false,
post_actions_enabled: true,
next_id_tip_enabled: true,
Expand Down
Binary file added packages/mask/src/plugins/EVM/assets/moonbeam.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions packages/mask/src/plugins/EVM/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,16 @@ export const PLUGIN_NETWORKS: Web3Plugin.NetworkDescriptor[] = [
iconColor: 'rgb(112, 212, 74)',
isMainnet: true,
},
{
ID: `${PLUGIN_ID}_moonbeam`,
networkSupporterPluginID: PLUGIN_ID,
chainId: ChainId.Moonbeam,
type: NetworkType.Moonbeam,
name: 'Moonbeam',
icon: new URL('./assets/moonbeam.png', import.meta.url),
iconColor: 'rgb(127, 39, 88)',
isMainnet: true,
},
{
ID: `${PLUGIN_ID}_conflux`,
networkSupporterPluginID: PLUGIN_ID,
Expand Down
1 change: 1 addition & 0 deletions packages/mask/src/plugins/ITO/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const base: Plugin.Shared.Definition = {
ChainId.Aurora,
ChainId.Avalanche,
ChainId.Fantom,
ChainId.Moonbeam,
],
},
[NetworkPluginID.PLUGIN_FLOW]: { supportedChainIds: [] },
Expand Down
1 change: 1 addition & 0 deletions packages/mask/src/plugins/NextID/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const base: Plugin.Shared.Definition = {
ChainId.Aurora,
ChainId.Avalanche,
ChainId.Fantom,
ChainId.Moonbeam,
ChainId.Conflux,
],
},
Expand Down
1 change: 1 addition & 0 deletions packages/mask/src/plugins/RedPacket/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const base: Plugin.Shared.Definition = {
ChainId.Fantom,
ChainId.Avalanche,
ChainId.Aurora,
ChainId.Moonbeam,
ChainId.Conflux,
],
},
Expand Down
3 changes: 3 additions & 0 deletions packages/mask/src/plugins/Trader/apis/trader/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export async function getAvailableTraderProviders(chainId: ChainId) {
TradeProvider.DODO,
TradeProvider.ZRX,
TradeProvider.OPENOCEAN,
TradeProvider.PADSWAP,
TradeProvider.MDEX,
]
case NetworkType.Arbitrum:
Expand All @@ -52,6 +53,8 @@ export async function getAvailableTraderProviders(chainId: ChainId) {
return [TradeProvider.SUSHISWAP]
case NetworkType.Aurora:
return [TradeProvider.DODO, TradeProvider.WANNASWAP, TradeProvider.TRISOLARIS]
case NetworkType.Moonbeam:
return [TradeProvider.SUSHISWAP, TradeProvider.BEAMSWAP, TradeProvider.STELLASWAP, TradeProvider.PADSWAP]
case NetworkType.Boba:
case NetworkType.Fuse:
case NetworkType.Metis:
Expand Down
1 change: 1 addition & 0 deletions packages/mask/src/plugins/Trader/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const base: Plugin.Shared.Definition = {
ChainId.Aurora,
ChainId.Avalanche,
ChainId.Fantom,
ChainId.Moonbeam,
],
},
[NetworkPluginID.PLUGIN_FLOW]: { supportedChainIds: [] },
Expand Down
1 change: 1 addition & 0 deletions packages/mask/src/plugins/Trader/constants/0x.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const ZRX_BASE_URL: Record<NetworkType, string> = {
[NetworkType.Fuse]: '',
[NetworkType.Metis]: '',
[NetworkType.Optimistic]: '',
[NetworkType.Moonbeam]: '',
[NetworkType.Conflux]: '',
}

Expand Down
13 changes: 13 additions & 0 deletions packages/mask/src/plugins/Trader/constants/beamswap.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { DAI, USDC, USDT, WBTC, SHARE, WNATIVE, WNATIVE_ONLY, ChainId } from '@masknet/web3-shared-evm'
import type { ERC20AgainstToken, ERC20TokenCustomizedBase } from './types'

/**
* Some tokens can only be swapped via certain pairs,
* so we override the list of bases that are considered for these tokens.
*/
export const BEAMSWAP_CUSTOM_BASES: ERC20TokenCustomizedBase = {}

export const BEAMSWAP_BASE_AGAINST_TOKENS: ERC20AgainstToken = {
...WNATIVE_ONLY,
[ChainId.Moonbeam]: [WNATIVE, DAI, SHARE, USDT, USDC, WBTC].map((x) => x[ChainId.Moonbeam]),
}
1 change: 1 addition & 0 deletions packages/mask/src/plugins/Trader/constants/dodo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ export const networkNames: Record<NetworkType, string> = {
[NetworkType.Fuse]: '',
[NetworkType.Metis]: '',
[NetworkType.Optimistic]: '',
[NetworkType.Moonbeam]: '',
[NetworkType.Conflux]: '',
}
3 changes: 3 additions & 0 deletions packages/mask/src/plugins/Trader/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@ export * from './traderjoe'
export * from './pangolindex'
export * from './wannaswap'
export * from './trisolaris'
export * from './beamswap'
export * from './stellaswap'
export * from './padswap'
export * from './mdex'
export type { ERC20TokenCustomizedBase, ERC20AgainstToken } from './types'
1 change: 1 addition & 0 deletions packages/mask/src/plugins/Trader/constants/openocean.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ export const networkNames: Record<NetworkType, string> = {
[NetworkType.Fuse]: '',
[NetworkType.Metis]: '',
[NetworkType.Optimistic]: '',
[NetworkType.Moonbeam]: '',
[NetworkType.Conflux]: '',
}
14 changes: 14 additions & 0 deletions packages/mask/src/plugins/Trader/constants/padswap.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { DAI, USDC, USDT, PAD, WBTC, WNATIVE, WNATIVE_ONLY, ChainId } from '@masknet/web3-shared-evm'
import type { ERC20AgainstToken, ERC20TokenCustomizedBase } from './types'

/**
* Some tokens can only be swapped via certain pairs,
* so we override the list of bases that are considered for these tokens.
*/
export const PADSWAP_CUSTOM_BASES: ERC20TokenCustomizedBase = {}

export const PADSWAP_BASE_AGAINST_TOKENS: ERC20AgainstToken = {
...WNATIVE_ONLY,
[ChainId.Moonbeam]: [WNATIVE, DAI, PAD, USDT, USDC, WBTC].map((x) => x[ChainId.Moonbeam]),
[ChainId.BSC]: [WNATIVE, DAI, PAD, USDT, USDC, WBTC].map((x) => x[ChainId.BSC]),
}
13 changes: 13 additions & 0 deletions packages/mask/src/plugins/Trader/constants/stellaswap.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { DAI, USDC, STELLA, USDT, WBTC, WNATIVE, WNATIVE_ONLY, ChainId } from '@masknet/web3-shared-evm'
import type { ERC20AgainstToken, ERC20TokenCustomizedBase } from './types'

/**
* Some tokens can only be swapped via certain pairs,
* so we override the list of bases that are considered for these tokens.
*/
export const STELLASWAP_CUSTOM_BASES: ERC20TokenCustomizedBase = {}

export const STELLASWAP_BASE_AGAINST_TOKENS: ERC20AgainstToken = {
...WNATIVE_ONLY,
[ChainId.Moonbeam]: [WNATIVE, STELLA, DAI, USDT, USDC, WBTC].map((x) => x[ChainId.Moonbeam]),
}
1 change: 1 addition & 0 deletions packages/mask/src/plugins/Trader/constants/sushiswap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ export const SUSHISWAP_BASE_AGAINST_TOKENS: ERC20AgainstToken = {
[ChainId.Celo]: [WNATIVE, CUSD, CEUR].map((x) => x[ChainId.Celo]),
[ChainId.Fantom]: [WNATIVE, DAI, USDC, fUSDT, WBTC].map((x) => x[ChainId.Fantom]),
[ChainId.Avalanche]: [WNATIVE, DAI, USDC, WBTC, USDT].map((x) => x[ChainId.Avalanche]),
[ChainId.Moonbeam]: [WNATIVE, DAI, USDC, WBTC, USDT].map((x) => x[ChainId.Moonbeam]),
}
3 changes: 3 additions & 0 deletions packages/mask/src/plugins/Trader/pipes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ export const resolveTradeProviderName = createLookupTableResolver<TradeProvider,
[TradeProvider.PANGOLIN]: 'PangolinDex',
[TradeProvider.TRISOLARIS]: 'Trisolaris',
[TradeProvider.WANNASWAP]: 'WannaSwap',
[TradeProvider.BEAMSWAP]: 'BeamSwap',
[TradeProvider.STELLASWAP]: 'StellaSwap',
[TradeProvider.PADSWAP]: 'PADSwap',
[TradeProvider.MDEX]: 'Mdex',
},
(tradeProvider) => {
Expand Down
1 change: 1 addition & 0 deletions packages/mask/src/plugins/Trader/trader/0x/useTrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export function getNativeTokenLabel(networkType: NetworkType) {
case NetworkType.Metis:
case NetworkType.Avalanche:
case NetworkType.Optimistic:
case NetworkType.Moonbeam:
case NetworkType.Conflux:
return NATIVE_TOKEN_ADDRESS
default:
Expand Down
24 changes: 24 additions & 0 deletions packages/mask/src/plugins/Trader/trader/useAllTradeComputed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,27 @@ export function useAllTradeComputed(
traderEstimateGas: mdexEstimateGas,
} = useUniswapV2Like(tradeProviders, TradeProvider.MDEX, inputAmount_, inputToken, outputToken)

// StellaSwap
const {
trader_: stellaswap_,
trader: stellaswap,
traderEstimateGas: stellaswapEstimateGas,
} = useUniswapV2Like(tradeProviders, TradeProvider.STELLASWAP, inputAmount_, inputToken, outputToken)

// BeamSwap
const {
trader_: beamswap_,
trader: beamswap,
traderEstimateGas: beamswapEstimateGas,
} = useUniswapV2Like(tradeProviders, TradeProvider.BEAMSWAP, inputAmount_, inputToken, outputToken)

// PADSwap
const {
trader_: padswap_,
trader: padswap,
traderEstimateGas: padswapEstimateGas,
} = useUniswapV2Like(tradeProviders, TradeProvider.PADSWAP, inputAmount_, inputToken, outputToken)

const allTradeResult = [
{ provider: TradeProvider.UNISWAP_V2, ...uniswapV2_, value: uniswapV2, gas: uniswapV2EstimateGas },
{ provider: TradeProvider.SUSHISWAP, ...sushiSwap_, value: sushiSwap, gas: sushiSwapEstimateGas },
Expand All @@ -222,6 +243,9 @@ export function useAllTradeComputed(
{ provider: TradeProvider.OPENOCEAN, ...openocean_, value: openocean, gas: openoceanSwapEstimateGas },
{ provider: TradeProvider.WANNASWAP, ...wannaswap_, value: wannaswap, gas: wannaSwapEstimateGas },
{ provider: TradeProvider.TRISOLARIS, ...trisolaris_, value: trisolaris, gas: trisolarisEstimateGas },
{ provider: TradeProvider.STELLASWAP, ...stellaswap_, value: stellaswap, gas: stellaswapEstimateGas },
{ provider: TradeProvider.BEAMSWAP, ...beamswap_, value: beamswap, gas: beamswapEstimateGas },
{ provider: TradeProvider.PADSWAP, ...padswap_, value: padswap, gas: padswapEstimateGas },
{ provider: TradeProvider.MDEX, ...mdex_, value: mdex, gas: mdexEstimateGas },
]

Expand Down
42 changes: 42 additions & 0 deletions packages/mask/src/plugins/Trader/trader/useGetTradeContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ import {
WANNASWAP_CUSTOM_BASES,
TRISOLARIS_BASE_AGAINST_TOKENS,
TRISOLARIS_CUSTOM_BASES,
BEAMSWAP_BASE_AGAINST_TOKENS,
BEAMSWAP_CUSTOM_BASES,
STELLASWAP_BASE_AGAINST_TOKENS,
STELLASWAP_CUSTOM_BASES,
PADSWAP_BASE_AGAINST_TOKENS,
PADSWAP_CUSTOM_BASES,
MDEX_BASE_AGAINST_TOKENS,
MDEX_CUSTOM_BASES,
} from '../constants'
Expand Down Expand Up @@ -152,6 +158,42 @@ export function useGetTradeContext(tradeProvider?: TradeProvider) {
ADDITIONAL_TOKENS: {},
CUSTOM_TOKENS: TRISOLARIS_CUSTOM_BASES,
}
case TradeProvider.BEAMSWAP:
return {
TYPE: tradeProvider,
IS_UNISWAP_V2_LIKE: true,
GRAPH_API: DEX_TRADE.BEAMSWAP_THEGRAPH,
INIT_CODE_HASH: DEX_TRADE.BEAMSWAP_INIT_CODE_HASH,
ROUTER_CONTRACT_ADDRESS: DEX_TRADE.BEAMSWAP_ROUTER_ADDRESS,
FACTORY_CONTRACT_ADDRESS: DEX_TRADE.BEAMSWAP_FACTORY_ADDRESS,
AGAINST_TOKENS: BEAMSWAP_BASE_AGAINST_TOKENS,
ADDITIONAL_TOKENS: {},
CUSTOM_TOKENS: BEAMSWAP_CUSTOM_BASES,
}
case TradeProvider.STELLASWAP:
return {
TYPE: tradeProvider,
IS_UNISWAP_V2_LIKE: true,
GRAPH_API: DEX_TRADE.STELLASWAP_THEGRAPH,
INIT_CODE_HASH: DEX_TRADE.STELLASWAP_INIT_CODE_HASH,
ROUTER_CONTRACT_ADDRESS: DEX_TRADE.STELLASWAP_ROUTER_ADDRESS,
FACTORY_CONTRACT_ADDRESS: DEX_TRADE.STELLASWAP_FACTORY_ADDRESS,
AGAINST_TOKENS: STELLASWAP_BASE_AGAINST_TOKENS,
ADDITIONAL_TOKENS: {},
CUSTOM_TOKENS: STELLASWAP_CUSTOM_BASES,
}
case TradeProvider.PADSWAP:
return {
TYPE: tradeProvider,
IS_UNISWAP_V2_LIKE: true,
GRAPH_API: DEX_TRADE.PADSWAP_THEGRAPH,
INIT_CODE_HASH: DEX_TRADE.PADSWAP_INIT_CODE_HASH,
ROUTER_CONTRACT_ADDRESS: DEX_TRADE.PADSWAP_ROUTER_ADDRESS,
FACTORY_CONTRACT_ADDRESS: DEX_TRADE.PADSWAP_FACTORY_ADDRESS,
AGAINST_TOKENS: PADSWAP_BASE_AGAINST_TOKENS,
ADDITIONAL_TOKENS: {},
CUSTOM_TOKENS: PADSWAP_CUSTOM_BASES,
}
case TradeProvider.MDEX:
return {
TYPE: tradeProvider,
Expand Down
6 changes: 6 additions & 0 deletions packages/mask/src/plugins/Trader/trader/useTradeCallback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ export function useTradeCallback(
return uniswapV2Like
case TradeProvider.OPENOCEAN:
return openocean
case TradeProvider.BEAMSWAP:
return uniswapV2Like
case TradeProvider.STELLASWAP:
return uniswapV2Like
case TradeProvider.PADSWAP:
return uniswapV2Like
default:
if (provider) unreachable(provider)
return []
Expand Down
42 changes: 42 additions & 0 deletions packages/mask/src/plugins/Trader/trader/useTradeContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ import {
WANNASWAP_CUSTOM_BASES,
TRISOLARIS_CUSTOM_BASES,
TRISOLARIS_BASE_AGAINST_TOKENS,
BEAMSWAP_CUSTOM_BASES,
BEAMSWAP_BASE_AGAINST_TOKENS,
STELLASWAP_BASE_AGAINST_TOKENS,
STELLASWAP_CUSTOM_BASES,
PADSWAP_BASE_AGAINST_TOKENS,
PADSWAP_CUSTOM_BASES,
MDEX_CUSTOM_BASES,
MDEX_BASE_AGAINST_TOKENS,
} from '../constants'
Expand Down Expand Up @@ -130,6 +136,42 @@ export function useTradeContext(tradeProvider: TradeProvider) {
ADDITIONAL_TOKENS: {},
CUSTOM_TOKENS: TRISOLARIS_CUSTOM_BASES,
}
case TradeProvider.BEAMSWAP:
return {
TYPE: tradeProvider,
IS_UNISWAP_V2_LIKE: true,
GRAPH_API: DEX_TRADE.BEAMSWAP_THEGRAPH,
INIT_CODE_HASH: DEX_TRADE.BEAMSWAP_INIT_CODE_HASH,
ROUTER_CONTRACT_ADDRESS: DEX_TRADE.BEAMSWAP_ROUTER_ADDRESS,
FACTORY_CONTRACT_ADDRESS: DEX_TRADE.BEAMSWAP_FACTORY_ADDRESS,
AGAINST_TOKENS: BEAMSWAP_BASE_AGAINST_TOKENS,
ADDITIONAL_TOKENS: {},
CUSTOM_TOKENS: BEAMSWAP_CUSTOM_BASES,
}
case TradeProvider.STELLASWAP:
return {
TYPE: tradeProvider,
IS_UNISWAP_V2_LIKE: true,
GRAPH_API: DEX_TRADE.STELLASWAP_THEGRAPH,
INIT_CODE_HASH: DEX_TRADE.STELLASWAP_INIT_CODE_HASH,
ROUTER_CONTRACT_ADDRESS: DEX_TRADE.STELLASWAP_ROUTER_ADDRESS,
FACTORY_CONTRACT_ADDRESS: DEX_TRADE.STELLASWAP_FACTORY_ADDRESS,
AGAINST_TOKENS: STELLASWAP_BASE_AGAINST_TOKENS,
ADDITIONAL_TOKENS: {},
CUSTOM_TOKENS: STELLASWAP_CUSTOM_BASES,
}
case TradeProvider.PADSWAP:
return {
TYPE: tradeProvider,
IS_UNISWAP_V2_LIKE: true,
GRAPH_API: DEX_TRADE.PADSWAP_THEGRAPH,
INIT_CODE_HASH: DEX_TRADE.PADSWAP_INIT_CODE_HASH,
ROUTER_CONTRACT_ADDRESS: DEX_TRADE.PADSWAP_ROUTER_ADDRESS,
FACTORY_CONTRACT_ADDRESS: DEX_TRADE.PADSWAP_FACTORY_ADDRESS,
AGAINST_TOKENS: PADSWAP_BASE_AGAINST_TOKENS,
ADDITIONAL_TOKENS: {},
CUSTOM_TOKENS: PADSWAP_CUSTOM_BASES,
}
case TradeProvider.MDEX:
return {
TYPE: tradeProvider,
Expand Down
3 changes: 3 additions & 0 deletions packages/mask/src/plugins/Trader/types/trader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ export enum ZrxTradePool {
PangolinDex = 'PangolinDex',
Trisolaris = 'Trisolaris',
WannaSwap = 'WannaSwap',
StellaSwap = 'StellaSwap',
BeamSwap = 'BeamSwap',
PADSwap = 'PADSwap',
Mdex = 'Mdex',
}

Expand Down
1 change: 1 addition & 0 deletions packages/mask/src/plugins/Wallet/services/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,5 +128,6 @@ export async function getSupportedNetworks() {
Flags.fantom_enabled ? NetworkType.Fantom : undefined,
Flags.avalanche_enabled ? NetworkType.Avalanche : undefined,
Flags.aurora_enabled ? NetworkType.Aurora : undefined,
Flags.moonbeam_enabled ? NetworkType.Moonbeam : undefined,
].filter(Boolean) as NetworkType[]
}
Loading