Skip to content
Closed
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
7 changes: 6 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
"fileservice",
"formating",
"fullfilled",
"furucombo",
"gasnow",
"geckoview",
"gltf",
Expand All @@ -102,6 +103,7 @@
"immer",
"importmap",
"imtokenv2",
"investables",
"ipfs",
"ipfsurl",
"ittr",
Expand Down Expand Up @@ -205,6 +207,7 @@
"webextension",
"webm",
"withdrawed",
"wmatic",
"wnative",
"xdai",
"xlarge",
Expand Down Expand Up @@ -292,7 +295,9 @@
"gamification",
"Defi",
"powah",
"Switcher"
"Switcher",
"drawed",
"DRAWED"
],
"ignoreRegExpList": ["/@servie/"],
"ignorePaths": [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "maskbook",
"version": "1.37.6",
"version": "1.37.7",
"private": true,
"license": "AGPL-3.0-or-later",
"scripts": {
Expand Down
1 change: 0 additions & 1 deletion packages/backup-format/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "@masknet/backup-format",
"version": "0.0.0",
"private": true,
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { memo, useCallback, useEffect, useMemo, useState } from 'react'
import BigNumber from 'bignumber.js'
import { EthereumAddress } from 'wallet.ts'
import { MaskTextField } from '@masknet/theme'
import { Box, Button, Stack } from '@material-ui/core'
import { memo, useCallback, useEffect, useMemo, useState } from 'react'
import {
EthereumTokenType,
FungibleTokenDetailed,
Expand All @@ -12,11 +14,9 @@ import {
useGasPrice,
useTokenTransferCallback,
} from '@masknet/web3-shared'
import BigNumber from 'bignumber.js'
import { TokenAmountPanel } from '@masknet/shared'
import { SelectTokenDialog } from '../SelectTokenDialog'
import { useDashboardI18N } from '../../../../locales'
import { EthereumAddress } from 'wallet.ts'

interface TransferERC20Props {
token: FungibleTokenDetailed
Expand Down
1 change: 1 addition & 0 deletions packages/maskbook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
"react-virtualized-auto-sizer": "^1.0.6",
"react-window": "^1.8.6",
"remarkable": "^2.0.1",
"rss3-next": "0.6.17",
"safari-14-idb-fix": "^2.0.3",
"scrypt-js": "^3.0.1",
"socket.io-client": "2.4.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useStylesExtends } from '@masknet/shared'
import { getMaskColor, makeStyles } from '@masknet/theme'
import { formatEthereumAddress, resolveAddressLinkOnExplorer, ChainId } from '@masknet/web3-shared'
import { formatEthereumAddress, resolveAddressLinkOnExplorer, ChainId, EthereumNameType } from '@masknet/web3-shared'
import { Box, Link, Typography } from '@material-ui/core'
import InfoOutlinedIcon from '@material-ui/icons/InfoOutlined'
import { useState, useEffect } from 'react'
import { CollectibleListAddress } from '../../extension/options-page/DashboardComponents/CollectibleList'
import { useEthereumAddress } from '../../social-network-adaptor/twitter.com/injection/useEthereumName'
import { useEthereumAddress } from '@masknet/web3-shared'
import { MaskMessage, useI18N } from '../../utils'
import { useLocationChange } from '../../utils/hooks/useLocationChange'

Expand Down Expand Up @@ -81,7 +81,7 @@ export function EnhancedProfilePage(props: EnhancedProfilePageProps) {
href={resolveAddressLinkOnExplorer(ChainId.Mainnet, address)}
target="_blank"
rel="noopener noreferrer">
{type === 'address' ? formatEthereumAddress(address, 4) : name}
{type === EthereumNameType.DEFAULT ? formatEthereumAddress(address, 4) : name}
</Link>
</Typography>
<Typography
Expand Down
5 changes: 3 additions & 2 deletions packages/maskbook/src/components/shared/TokenPrice.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import type { FC, HTMLProps } from 'react'
import BigNumber from 'bignumber.js'
import { ChainId, CurrencyType } from '@masknet/web3-shared'
import { useTokenPrice } from '../../plugins/Wallet/hooks/useTokenPrice'

interface TokenPriceProps extends Omit<HTMLProps<HTMLSpanElement>, 'children'> {
chainId: ChainId
contractAddress: string | undefined
amount: number
amount: BigNumber.Value
currencyType?: CurrencyType
}

Expand All @@ -17,5 +18,5 @@ export const TokenPrice: FC<TokenPriceProps> = ({
...rest
}) => {
const price = useTokenPrice(chainId, contractAddress, currencyType)
return <span {...rest}>${(price * amount).toFixed(2)}</span>
return <span {...rest}>${new BigNumber(amount).multipliedBy(price).toFixed(2)}</span>
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function DebounceButton(_props: DebounceButtonProps) {
)
}

interface ActionButtonProps extends ButtonProps {
export interface ActionButtonProps extends ButtonProps {
width?: number | string
loading?: boolean
component?: keyof JSX.IntrinsicElements | React.ComponentType<any>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ const useStyles = makeStyles()((theme) => ({
justifyContent: 'center',
},
label: {
color: '#1C68F3',
color: theme.palette.primary.main,
fontSize: 12,
lineHeight: '16px',
margin: '10px 0',
},
selected: {
backgroundColor: '#1C68F3',
backgroundColor: theme.palette.primary.main,
'& > *': {
color: '#ffffff!important',
color: theme.palette.primary.contrastText,
},
},
button: {
Expand Down Expand Up @@ -132,14 +132,14 @@ export const GasSetting1559 = memo(() => {
.object({
gasLimit: zod
.string()
.min(1, t('wallet_transfer_error_gasLimit_absence'))
.min(1, t('wallet_transfer_error_gas_limit_absence'))
.refine(
(gasLimit) => new BigNumber(gasLimit).isGreaterThanOrEqualTo(gas),
`Gas limit must be at least ${gas}.`,
),
maxPriorityFeePerGas: zod
.string()
.min(1, t('wallet_transfer_error_maxPriority_fee_absence'))
.min(1, t('wallet_transfer_error_max_priority_fee_absence'))
.refine(
(value) => new BigNumber(value).isPositive(),
t('wallet_transfer_error_max_priority_gas_fee_positive'),
Expand All @@ -160,7 +160,7 @@ export const GasSetting1559 = memo(() => {
),
maxFeePerGas: zod
.string()
.min(1, t('wallet_transfer_error_maxFee_absence'))
.min(1, t('wallet_transfer_error_max_fee_absence'))
.refine(
(value) =>
new BigNumber(value).isGreaterThanOrEqualTo(gasNow?.slow?.suggestedMaxFeePerGas ?? 0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ const useStyles = makeStyles()((theme) => ({
justifyContent: 'center',
},
label: {
color: '#1C68F3',
color: theme.palette.primary.main,
fontSize: 12,
lineHeight: '16px',
margin: '10px 0',
},
selected: {
backgroundColor: '#1C68F3',
backgroundColor: theme.palette.primary.main,
'& > *': {
color: '#ffffff!important',
color: theme.palette.primary.contrastText,
},
},
button: {
Expand Down Expand Up @@ -136,12 +136,12 @@ export const Prior1559GasSetting = memo(() => {
return zod.object({
gasLimit: zod
.string()
.min(1, t('wallet_transfer_error_gasLimit_absence'))
.min(1, t('wallet_transfer_error_gas_limit_absence'))
.refine(
(gasLimit) => new BigNumber(gasLimit).isGreaterThanOrEqualTo(gas),
`Gas limit must be at least ${gas}.`,
),
gasPrice: zod.string().min(1, t('wallet_transfer_error_gasPrice_absence')),
gasPrice: zod.string().min(1, t('wallet_transfer_error_gas_price_absence')),
})
}, [gas])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,12 @@ export const Prior1559Transfer = memo<Prior1559TransferProps>(({ selectedAsset,
}, t('wallet_transfer_error_insufficient_balance', { token: selectedAsset?.token.symbol })),
gasLimit: zod
.string()
.min(1, t('wallet_transfer_error_gasLimit_absence'))
.min(1, t('wallet_transfer_error_gas_limit_absence'))
.refine(
(gasLimit) => new BigNumber(gasLimit).isGreaterThanOrEqualTo(minGasLimitContext),
` Gas limit must be at least ${minGasLimitContext}.`,
),
gasPrice: zod.string().min(1, t('wallet_transfer_error_gasPrice_absence')),
gasPrice: zod.string().min(1, t('wallet_transfer_error_gas_price_absence')),
})
}, [selectedAsset, minGasLimitContext])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,14 @@ export const Transfer1559 = memo<Transfer1559Props>(({ selectedAsset, openAssetM
}, t('wallet_transfer_error_insufficient_balance', { token: selectedAsset?.token.symbol })),
gasLimit: zod
.string()
.min(1, t('wallet_transfer_error_gasLimit_absence'))
.min(1, t('wallet_transfer_error_gas_limit_absence'))
.refine(
(gasLimit) => new BigNumber(gasLimit).isGreaterThanOrEqualTo(minGasLimitContext),
` Gas limit must be at least ${minGasLimitContext}.`,
),
maxPriorityFeePerGas: zod
.string()
.min(1, t('wallet_transfer_error_maxPriority_fee_absence'))
.min(1, t('wallet_transfer_error_max_priority_fee_absence'))
.refine(
(value) => new BigNumber(value).isPositive(),
t('wallet_transfer_error_max_priority_gas_fee_positive'),
Expand All @@ -205,7 +205,7 @@ export const Transfer1559 = memo<Transfer1559Props>(({ selectedAsset, openAssetM
),
maxFeePerGas: zod
.string()
.min(1, t('wallet_transfer_error_maxFee_absence'))
.min(1, t('wallet_transfer_error_max_fee_absence'))
.refine(
(value) =>
new BigNumber(value).isGreaterThanOrEqualTo(
Expand Down
20 changes: 15 additions & 5 deletions packages/maskbook/src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,10 @@
"wallet_transfer_error_address_absence": "Enter recipient address",
"wallet_transfer_error_invalid_address": "Invalid recipient address",
"wallet_transfer_error_insufficient_balance": "Insufficient {{symbol}} balance",
"wallet_transfer_error_gasPrice_absence": "Enter a gas price",
"wallet_transfer_error_gasLimit_absence": "Enter a gas limit",
"wallet_transfer_error_maxFee_absence": "Enter a max fee",
"wallet_transfer_error_maxPriority_fee_absence": "Enter a max priority fee",
"wallet_transfer_error_gas_price_absence": "Enter a gas price",
"wallet_transfer_error_gas_limit_absence": "Enter a gas limit",
"wallet_transfer_error_max_fee_absence": "Enter a max fee",
"wallet_transfer_error_max_priority_fee_absence": "Enter a max priority fee",
"wallet_transfer_error_max_fee_too_low": "Max fee too low for network conditions.",
"wallet_transfer_error_max_fee_too_high": "Max fee is higher than necessary",
"wallet_transfer_error_max_priority_gas_fee_positive": "Max priority fee must be greater than 0 GWEI",
Expand Down Expand Up @@ -860,6 +860,16 @@
"plugin_unlockprotocol_submit_post": "Submit Post",
"plugin_unlockprotocol_title": "Unlock Protocol",
"plugin_unlockprotocol_server_error": "Some Server error occured, Please try again later.",
"plugin_furucombo_tab_pool": "Pool",
"plugin_furucombo_tab_investments": "All investments",
"plugin_furucombo_liquidity": "Liquidity",
"plugin_furucombo_annual_percentage_yield": "Apy",
"plugin_furucombo_rewards": "Rewards",
"plugin_furucombo_invest": "Invest",
"plugin_furucombo_pool_not_found": "Invalid pool address.",
"plugin_furucombo_smt_wrong": "Something went wrong!",
"plugin_furucombo_head_pools": "Pools",
"plugin_furucombo_head_action": "Action",
"popups_welcome": "Welcome",
"popups_wallet_token": "Token",
"popups_wallet_go_back": "Go back",
Expand Down Expand Up @@ -892,7 +902,7 @@
"popups_wallet_gas_fee_settings_high": "High",
"popups_wallet_gas_fee_settings_usd": " ≈ ${{usd}}",
"popups_wallet_gas_fee_settings_or": "or",
"popups_wallet_gas_fee_settings_gas_limit": "Gas limit",
"popups_wallet_gas_fee_settings_gas_limit": "Gas Limit",
"popups_wallet_gas_fee_settings_max_priority_fee": "Max priority fee",
"popups_wallet_gas_fee_settings_max_fee": "Max fee",
"popups_wallet_signature_request": "Signature request",
Expand Down
8 changes: 4 additions & 4 deletions packages/maskbook/src/locales/ko-KR.json
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,10 @@
"wallet_transfer_error_address_absence": "받는 주소 입력",
"wallet_transfer_error_invalid_address": "무효한 받는 주소",
"wallet_transfer_error_insufficient_balance": "{{symbol}} 잔액 부족",
"wallet_transfer_error_gasPrice_absence": "가스비 입력",
"wallet_transfer_error_gasLimit_absence": "기스비 한도 입력",
"wallet_transfer_error_maxFee_absence": "최대 가스비 입력",
"wallet_transfer_error_maxPriority_fee_absence": "최대 우선 가스비 입력",
"wallet_transfer_error_gas_price_absence": "가스비 입력",
"wallet_transfer_error_gas_limit_absence": "기스비 한도 입력",
"wallet_transfer_error_max_fee_absence": "최대 가스비 입력",
"wallet_transfer_error_max_priority_fee_absence": "최대 우선 가스비 입력",
"wallet_transfer_error_max_fee_too_low": "현재 네트워크 컨디션에서 최대 가스비가 너무 낮습니다.",
"wallet_transfer_error_max_fee_too_high": "최대 가스비는 필요한 것보다 높습니다.",
"wallet_transfer_error_max_priority_gas_fee_positive": "최대 우선 가스비는 0 GWEI보다 높아야 합니다",
Expand Down
8 changes: 4 additions & 4 deletions packages/maskbook/src/locales/qya-AA.json
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,10 @@
"wallet_transfer_error_address_absence": "crwdns4545:0crwdne4545:0",
"wallet_transfer_error_invalid_address": "crwdns4547:0crwdne4547:0",
"wallet_transfer_error_insufficient_balance": "crwdns7961:0{{symbol}}crwdne7961:0",
"wallet_transfer_error_gasPrice_absence": "crwdns8035:0crwdne8035:0",
"wallet_transfer_error_gasLimit_absence": "crwdns8037:0crwdne8037:0",
"wallet_transfer_error_maxFee_absence": "crwdns8039:0crwdne8039:0",
"wallet_transfer_error_maxPriority_fee_absence": "crwdns8041:0crwdne8041:0",
"wallet_transfer_error_gas_price_absence": "crwdns8035:0crwdne8035:0",
"wallet_transfer_error_gas_limit_absence": "crwdns8037:0crwdne8037:0",
"wallet_transfer_error_max_fee_absence": "crwdns8039:0crwdne8039:0",
"wallet_transfer_error_max_priority_fee_absence": "crwdns8041:0crwdne8041:0",
"wallet_transfer_error_max_fee_too_low": "crwdns8043:0crwdne8043:0",
"wallet_transfer_error_max_fee_too_high": "crwdns8045:0crwdne8045:0",
"wallet_transfer_error_max_priority_gas_fee_positive": "crwdns8047:0crwdne8047:0",
Expand Down
2 changes: 1 addition & 1 deletion packages/maskbook/src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Mask Network",
"version": "1.37.6",
"version": "1.37.7",
"manifest_version": 2,
"permissions": ["storage", "downloads", "webNavigation", "activeTab"],
"optional_permissions": ["<all_urls>", "notifications", "clipboardRead"],
Expand Down
2 changes: 2 additions & 0 deletions packages/maskbook/src/plugin-infra/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ import '../plugins/dHEDGE'
import '../plugins/PoolTogether'
import '../plugins/GoodGhosting'
import '../plugins/UnlockProtocol'
import '../plugins/Furucombo'
import '../plugins/MaskBox'
// import '../plugins/NFT'
// import '../plugins/Airdrop'
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ export function Collectible(props: CollectibleProps) {
]

const endDate = asset.value?.end_time

return (
<>
<CollectibleCard classes={classes}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const useStyles = makeStyles()({
width: '100%',
height: '100%',
borderRadius: 0,
overflow: 'scroll',
overflow: 'auto',
},
})

Expand Down
4 changes: 1 addition & 3 deletions packages/maskbook/src/plugins/Collectible/apis/opensea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ export async function getAsset(tokenAddress: string, tokenId: string, chainId?:
).json()

const endTime = head<{ closing_date: Date }>(
fetchResponse.orders.filter(
(item: { side: number; closing_extendable: boolean }) => item.side === 1 && item.closing_extendable,
),
fetchResponse.orders.filter((item: { side: number; closing_extendable: boolean }) => item.side === 1),
)?.closing_date

return {
Expand Down
5 changes: 4 additions & 1 deletion packages/maskbook/src/plugins/Collectible/hooks/useAsset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export function useAsset(provider: CollectibleProvider, token?: CollectibleToken
new BigNumber(getOrderUnitPrice(b) ?? 0).toNumber(),
),
)

return {
is_verified: ['approved', 'verified'].includes(
openSeaResponse.collection?.safelist_request_status ?? '',
Expand Down Expand Up @@ -69,7 +70,9 @@ export function useAsset(provider: CollectibleProvider, token?: CollectibleToken
name: openSeaResponse.name ?? openSeaResponse.collection.name,
collection_name: openSeaResponse.collection.name,
animation_url: openSeaResponse.animation_url,
end_time: desktopOrder
end_time: openSeaResponse.endTime
? new Date(openSeaResponse.endTime)
: desktopOrder
? toDate(Number.parseInt(desktopOrder.listingTime as unknown as string, 10))
: null,
order_payment_tokens: desktopOrder?.paymentTokenContract
Expand Down
Loading