Skip to content
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
Expand Up @@ -7,7 +7,7 @@
"yarn": ">=999.0.0",
"npm": ">=999.0.0"
},
"version": "2.32.0",
"version": "2.32.1",
"private": true,
"license": "AGPL-3.0-or-later",
"scripts": {
Expand Down
2 changes: 2 additions & 0 deletions packages/mask/.webpack/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ export async function createConfiguration(
MASK_SENTRY: process.env.MASK_SENTRY || JSON.stringify('disabled'),
MASK_MIXPANEL: process.env.MASK_MIXPANEL || JSON.stringify('disabled'),
NEXT_PUBLIC_FIREFLY_API_URL: process.env.NEXT_PUBLIC_FIREFLY_API_URL || '',
SOLANA_DEFAULT_RPC_URL: process.env.SOLANA_DEFAULT_RPC_URL || '',
MASK_ENABLE_EXCHANGE: process.env.MASK_ENABLE_EXCHANGE || '',
}),
new (rspack?.DefinePlugin || webpack.default.DefinePlugin)({
'process.browser': 'true',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const ActionGroup = memo(function ActionGroup({ className, chainId, addre
<Trans>Receive</Trans>
</Typography>
</button>
{supported || isLoading ?
{supported ?
<button
type="button"
className={classes.button}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ import { NetworkPluginID } from '@masknet/shared-base'
import { getConnection } from '@masknet/web3-providers'
import type { Cluster } from '@solana/web3.js'

const SOLANA_ENDPOINT =
process.env.SOLANA_DEFAULT_RPC_URL || 'https://solana-mainnet.g.alchemy.com/v2/7ktku04g0dx9l6ijyba3fy99h0ic0xf3'
export async function getSolanaConnection(cluster: Cluster | undefined) {
const url =
!cluster || cluster === 'mainnet-beta' ?
'https://long-intensive-shard.solana-mainnet.quiknode.pro/bc297481b248232bcd0dc95197d5b32a8981539c'
: SolanaWeb3.clusterApiUrl(cluster)
const url = !cluster || cluster === 'mainnet-beta' ? SOLANA_ENDPOINT : SolanaWeb3.clusterApiUrl(cluster)
return new SolanaWeb3.Connection(url, 'confirmed')
}

Expand Down
82 changes: 44 additions & 38 deletions packages/plugins/Trader/src/SiteAdaptor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,44 +71,50 @@ const site: Plugin.SiteAdaptor.Definition = {
)
},
enhanceTag,
ApplicationEntries: [
(() => {
const icon = <Icons.SwapColorful size={36} />
const name = <Trans>Exchange</Trans>
const iconFilterColor = 'rgba(247, 147, 30, 0.3)'
return {
ApplicationEntryID: base.ID,
RenderEntryComponent(EntryComponentProps) {
return (
<ApplicationEntry
{...EntryComponentProps}
title={name}
icon={icon}
iconFilterColor={iconFilterColor}
onClick={() => {
EntryComponentProps.onClick ? EntryComponentProps.onClick(openDialog) : openDialog()
Telemetry.captureEvent(EventType.Access, EventID.EntryAppSwapOpen)
}}
/>
)
},
appBoardSortingDefaultPriority: 7,
marketListSortingPriority: 7,
icon,
category: 'dapp',
name,
tutorialLink: 'https://realmasknetwork.notion.site/f2e7d081ee38487ca1db958393ac1edc',
description: (
<Trans>
Pop-up trading widget allows you to instantly view prices of the hottest Crypto/Stock and trade,
also invest in the best performing managers.
</Trans>
),
iconFilterColor,
hiddenInList: true,
}
})(),
],
ApplicationEntries:
// temporarily disabled
process.env.MASK_ENABLE_EXCHANGE ?
[
(() => {
const icon = <Icons.SwapColorful size={36} />
const name = <Trans>Exchange</Trans>
const iconFilterColor = 'rgba(247, 147, 30, 0.3)'
return {
ApplicationEntryID: base.ID,
RenderEntryComponent(EntryComponentProps) {
return (
<ApplicationEntry
{...EntryComponentProps}
title={name}
icon={icon}
iconFilterColor={iconFilterColor}
onClick={() => {
EntryComponentProps.onClick ?
EntryComponentProps.onClick(openDialog)
: openDialog()
Telemetry.captureEvent(EventType.Access, EventID.EntryAppSwapOpen)
}}
/>
)
},
appBoardSortingDefaultPriority: 7,
marketListSortingPriority: 7,
icon,
category: 'dapp',
name,
tutorialLink: 'https://realmasknetwork.notion.site/f2e7d081ee38487ca1db958393ac1edc',
description: (
<Trans>
Pop-up trading widget allows you to instantly view prices of the hottest Crypto/Stock
and trade, also invest in the best performing managers.
</Trans>
),
iconFilterColor,
hiddenInList: true,
}
})(),
]
: [],
wrapperProps: {
icon: <Icons.SwapColorful size={24} style={{ filter: 'drop-shadow(0px 6px 12px rgba(254, 156, 0, 0.2))' }} />,
backgroundGradient:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { OKX } from '@masknet/web3-providers'
import { useQuery } from '@tanstack/react-query'

export const getSupportedChainsOptions = {
enabled: false, // TODO: Temporarily disabled due to OKX server downtime.
queryKey: ['okx-swap', 'supported-chains'],
queryFn: async () => {
const chains = await OKX.getSupportedChains()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ export function TrendingView(props: TrendingViewProps) {
const isBRC20 = trending?.coin.tags?.includes('BRC-20')

const isSwappable =
!!process.env.MASK_ENABLE_EXCHANGE &&
!isMinimalMode &&
!isNFT &&
!isBRC20 &&
Expand All @@ -206,7 +207,7 @@ export function TrendingView(props: TrendingViewProps) {
const list = [ContentTab.Market, ContentTab.Price, ContentTab.Exchange]
if (isNFT) list.push(ContentTab.NFTItems)
return list
}, [isSwappable, isNFT])
}, [isNFT])
const [currentTab, , , setTab] = useTabs<ContentTab>(tabs[0], ...tabs)
useLayoutEffect(() => {
setTab(tabs[0])
Expand Down Expand Up @@ -234,7 +235,7 @@ export function TrendingView(props: TrendingViewProps) {
: undefined,
]
return compact(configs).map((x) => <Tab value={x.key} key={x.key} label={x.label} />)
}, [isSwappable, isNFT])
}, [isNFT])
// #endregion

const { classes } = useStyles({ isTokenTagPopper, isCollectionProjectPopper, currentTab })
Expand Down
Loading