Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
76e90ddb
Commit
76e90ddb
authored
May 28, 2024
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add possibility to change ERC to something else
parent
b5757e40
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
56 additions
and
28 deletions
+56
-28
chain.ts
configs/app/chain.ts
+1
-0
schema.ts
deploy/tools/envs-validator/schema.ts
+1
-0
ENVS.md
docs/ENVS.md
+1
-0
tokenTypes.ts
lib/token/tokenTypes.ts
+19
-11
AddressTokens.tsx
ui/address/AddressTokens.tsx
+2
-1
TokenSelectMenu.tsx
ui/address/tokenSelect/TokenSelectMenu.tsx
+5
-2
NFTItem.tsx
ui/address/tokens/NFTItem.tsx
+2
-1
TokenInstance.tsx
ui/pages/TokenInstance.tsx
+2
-1
TokenTransferListItem.tsx
ui/shared/TokenTransfer/TokenTransferListItem.tsx
+2
-1
TokenTransferTableItem.tsx
ui/shared/TokenTransfer/TokenTransferTableItem.tsx
+2
-1
TokenTypeFilter.tsx
ui/shared/filters/TokenTypeFilter.tsx
+4
-3
utils.ts
ui/shared/search/utils.ts
+2
-2
TokenPageTitle.tsx
ui/token/TokenPageTitle.tsx
+2
-1
TokensListItem.tsx
ui/tokens/TokensListItem.tsx
+2
-1
TokensTableItem.tsx
ui/tokens/TokensTableItem.tsx
+2
-1
AddressFormNotifications.tsx
ui/watchlist/AddressModal/AddressFormNotifications.tsx
+7
-2
No files found.
configs/app/chain.ts
View file @
76e90ddb
...
@@ -15,6 +15,7 @@ const chain = Object.freeze({
...
@@ -15,6 +15,7 @@ const chain = Object.freeze({
secondaryCoin
:
{
secondaryCoin
:
{
symbol
:
getEnvValue
(
'
NEXT_PUBLIC_NETWORK_SECONDARY_COIN_SYMBOL
'
),
symbol
:
getEnvValue
(
'
NEXT_PUBLIC_NETWORK_SECONDARY_COIN_SYMBOL
'
),
},
},
tokenStandard
:
getEnvValue
(
'
NEXT_PUBLIC_NETWORK_TOKEN_STANDARD_NAME
'
)
||
'
ERC
'
,
rpcUrl
:
getEnvValue
(
'
NEXT_PUBLIC_NETWORK_RPC_URL
'
),
rpcUrl
:
getEnvValue
(
'
NEXT_PUBLIC_NETWORK_RPC_URL
'
),
isTestnet
:
getEnvValue
(
'
NEXT_PUBLIC_IS_TESTNET
'
)
===
'
true
'
,
isTestnet
:
getEnvValue
(
'
NEXT_PUBLIC_IS_TESTNET
'
)
===
'
true
'
,
verificationType
:
getEnvValue
(
'
NEXT_PUBLIC_NETWORK_VERIFICATION_TYPE
'
)
||
'
mining
'
,
verificationType
:
getEnvValue
(
'
NEXT_PUBLIC_NETWORK_VERIFICATION_TYPE
'
)
||
'
mining
'
,
...
...
deploy/tools/envs-validator/schema.ts
View file @
76e90ddb
...
@@ -479,6 +479,7 @@ const schema = yup
...
@@ -479,6 +479,7 @@ const schema = yup
NEXT_PUBLIC_NETWORK_CURRENCY_DECIMALS
:
yup
.
number
().
integer
().
positive
(),
NEXT_PUBLIC_NETWORK_CURRENCY_DECIMALS
:
yup
.
number
().
integer
().
positive
(),
NEXT_PUBLIC_NETWORK_SECONDARY_COIN_SYMBOL
:
yup
.
string
(),
NEXT_PUBLIC_NETWORK_SECONDARY_COIN_SYMBOL
:
yup
.
string
(),
NEXT_PUBLIC_NETWORK_VERIFICATION_TYPE
:
yup
.
string
<
NetworkVerificationType
>
().
oneOf
([
'
validation
'
,
'
mining
'
]),
NEXT_PUBLIC_NETWORK_VERIFICATION_TYPE
:
yup
.
string
<
NetworkVerificationType
>
().
oneOf
([
'
validation
'
,
'
mining
'
]),
NEXT_PUBLIC_NETWORK_TOKEN_STANDARD_NAME
:
yup
.
string
(),
NEXT_PUBLIC_IS_TESTNET
:
yup
.
boolean
(),
NEXT_PUBLIC_IS_TESTNET
:
yup
.
boolean
(),
// 3. API configuration
// 3. API configuration
...
...
docs/ENVS.md
View file @
76e90ddb
...
@@ -89,6 +89,7 @@ Please be aware that all environment variables prefixed with `NEXT_PUBLIC_` will
...
@@ -89,6 +89,7 @@ Please be aware that all environment variables prefixed with `NEXT_PUBLIC_` will
| NEXT_PUBLIC_NETWORK_CURRENCY_DECIMALS |
`string`
| Network currency decimals | - |
`18`
|
`6`
|
| NEXT_PUBLIC_NETWORK_CURRENCY_DECIMALS |
`string`
| Network currency decimals | - |
`18`
|
`6`
|
| NEXT_PUBLIC_NETWORK_SECONDARY_COIN_SYMBOL |
`string`
| Network secondary coin symbol. | - | - |
`GNO`
|
| NEXT_PUBLIC_NETWORK_SECONDARY_COIN_SYMBOL |
`string`
| Network secondary coin symbol. | - | - |
`GNO`
|
| NEXT_PUBLIC_NETWORK_VERIFICATION_TYPE |
`validation`
or
`mining`
| Verification type in the network | - |
`mining`
|
`validation`
|
| NEXT_PUBLIC_NETWORK_VERIFICATION_TYPE |
`validation`
or
`mining`
| Verification type in the network | - |
`mining`
|
`validation`
|
| NEXT_PUBLIC_NETWORK_TOKEN_STANDARD_NAME |
`string`
| Name of the standard for creating tokens | - |
`ERC`
|
`BEP`
|
| NEXT_PUBLIC_IS_TESTNET |
`boolean`
| Set to true if network is testnet | - |
`false`
|
`true`
|
| NEXT_PUBLIC_IS_TESTNET |
`boolean`
| Set to true if network is testnet | - |
`false`
|
`true`
|
...
...
lib/token/tokenTypes.ts
View file @
76e90ddb
import
type
{
NFTTokenType
,
TokenType
}
from
'
types/api/token
'
;
import
type
{
NFTTokenType
,
TokenType
}
from
'
types/api/token
'
;
export
const
NFT_TOKEN_TYPES
:
Array
<
{
title
:
string
;
id
:
NFTTokenType
}
>
=
[
import
config
from
'
configs/app
'
;
{
title
:
'
ERC-721
'
,
id
:
'
ERC-721
'
},
{
title
:
'
ERC-1155
'
,
id
:
'
ERC-1155
'
},
const
tokenStandardName
=
config
.
chain
.
tokenStandard
;
{
title
:
'
ERC-404
'
,
id
:
'
ERC-404
'
},
];
export
const
NFT_TOKEN_TYPES
:
Record
<
NFTTokenType
,
string
>
=
{
'
ERC-721
'
:
`
${
tokenStandardName
}
-721`
,
export
const
TOKEN_TYPES
:
Array
<
{
title
:
string
;
id
:
TokenType
}
>
=
[
'
ERC-1155
'
:
`
${
tokenStandardName
}
-1155`
,
{
title
:
'
ERC-20
'
,
id
:
'
ERC-20
'
},
'
ERC-404
'
:
`
${
tokenStandardName
}
-404`
,
};
export
const
TOKEN_TYPES
:
Record
<
TokenType
,
string
>
=
{
'
ERC-20
'
:
`
${
tokenStandardName
}
-20`
,
...
NFT_TOKEN_TYPES
,
...
NFT_TOKEN_TYPES
,
];
};
export
const
NFT_TOKEN_TYPE_IDS
:
Array
<
NFTTokenType
>
=
[
'
ERC-721
'
,
'
ERC-1155
'
,
'
ERC-404
'
];
export
const
TOKEN_TYPE_IDS
:
Array
<
TokenType
>
=
[
'
ERC-20
'
,
...
NFT_TOKEN_TYPE_IDS
];
export
const
NFT_TOKEN_TYPE_IDS
=
NFT_TOKEN_TYPES
.
map
(
i
=>
i
.
id
);
export
function
getTokenTypeName
(
typeId
:
TokenType
)
{
export
const
TOKEN_TYPE_IDS
=
TOKEN_TYPES
.
map
(
i
=>
i
.
id
);
return
TOKEN_TYPES
[
typeId
];
}
ui/address/AddressTokens.tsx
View file @
76e90ddb
...
@@ -5,6 +5,7 @@ import React from 'react';
...
@@ -5,6 +5,7 @@ import React from 'react';
import
type
{
NFTTokenType
}
from
'
types/api/token
'
;
import
type
{
NFTTokenType
}
from
'
types/api/token
'
;
import
type
{
PaginationParams
}
from
'
ui/shared/pagination/types
'
;
import
type
{
PaginationParams
}
from
'
ui/shared/pagination/types
'
;
import
config
from
'
configs/app
'
;
import
{
useAppContext
}
from
'
lib/contexts/app
'
;
import
{
useAppContext
}
from
'
lib/contexts/app
'
;
import
*
as
cookies
from
'
lib/cookies
'
;
import
*
as
cookies
from
'
lib/cookies
'
;
import
getFilterValuesFromQuery
from
'
lib/getFilterValuesFromQuery
'
;
import
getFilterValuesFromQuery
from
'
lib/getFilterValuesFromQuery
'
;
...
@@ -118,7 +119,7 @@ const AddressTokens = ({ shouldRender = true }: Props) => {
...
@@ -118,7 +119,7 @@ const AddressTokens = ({ shouldRender = true }: Props) => {
const hasActiveFilters = Boolean(tokenTypes?.length);
const hasActiveFilters = Boolean(tokenTypes?.length);
const tabs = [
const tabs = [
{
id
:
'
tokens_erc20
'
,
title
:
'
ERC-20
'
,
component
:
<
ERC20Tokens
tokensQuery
=
{
erc20Query
}
/>
}
,
{
id
:
'
tokens_erc20
'
,
title
:
`${ config.chain.tokenStandard }-20`
,
component
:
<
ERC20Tokens
tokensQuery
=
{
erc20Query
}
/>
}
,
{
{
id
:
'
tokens_nfts
'
,
id
:
'
tokens_nfts
'
,
title
:
'
NFTs
'
,
title
:
'
NFTs
'
,
...
...
ui/address/tokenSelect/TokenSelectMenu.tsx
View file @
76e90ddb
...
@@ -6,6 +6,7 @@ import React from 'react';
...
@@ -6,6 +6,7 @@ import React from 'react';
import
type
{
FormattedData
}
from
'
./types
'
;
import
type
{
FormattedData
}
from
'
./types
'
;
import
type
{
TokenType
}
from
'
types/api/token
'
;
import
type
{
TokenType
}
from
'
types/api/token
'
;
import
{
getTokenTypeName
}
from
'
lib/token/tokenTypes
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
type
{
Sort
}
from
'
../utils/tokenUtils
'
;
import
type
{
Sort
}
from
'
../utils/tokenUtils
'
;
...
@@ -73,9 +74,11 @@ const TokenSelectMenu = ({ erc20sort, erc1155sort, erc404sort, filteredData, onI
...
@@ -73,9 +74,11 @@ const TokenSelectMenu = ({ erc20sort, erc1155sort, erc404sort, filteredData, onI
return
(
return
(
<
Box
key=
{
type
}
>
<
Box
key=
{
type
}
>
<
Flex
justifyContent=
"space-between"
>
<
Flex
justifyContent=
"space-between"
>
<
Text
mb=
{
3
}
color=
"gray.500"
fontWeight=
{
600
}
fontSize=
"sm"
>
{
type
}
tokens (
{
numPrefix
}{
tokenInfo
.
items
.
length
}
)
</
Text
>
<
Text
mb=
{
3
}
color=
"gray.500"
fontWeight=
{
600
}
fontSize=
"sm"
>
{
getTokenTypeName
(
type
)
}
tokens (
{
numPrefix
}{
tokenInfo
.
items
.
length
}
)
</
Text
>
{
hasSort
&&
(
{
hasSort
&&
(
<
Link
data
-
type=
{
type
}
onClick=
{
onSortClick
}
aria
-
label=
{
`Sort ${
type
} tokens`
}
>
<
Link
data
-
type=
{
type
}
onClick=
{
onSortClick
}
aria
-
label=
{
`Sort ${
getTokenTypeName(type)
} tokens`
}
>
<
IconSvg
name=
"arrows/east"
boxSize=
{
5
}
transform=
{
arrowTransform
}
transitionDuration=
"faster"
/>
<
IconSvg
name=
"arrows/east"
boxSize=
{
5
}
transform=
{
arrowTransform
}
transitionDuration=
"faster"
/>
</
Link
>
</
Link
>
)
}
)
}
...
...
ui/address/tokens/NFTItem.tsx
View file @
76e90ddb
...
@@ -6,6 +6,7 @@ import type { AddressNFT } from 'types/api/address';
...
@@ -6,6 +6,7 @@ import type { AddressNFT } from 'types/api/address';
import
{
route
}
from
'
nextjs-routes
'
;
import
{
route
}
from
'
nextjs-routes
'
;
import
getCurrencyValue
from
'
lib/getCurrencyValue
'
;
import
getCurrencyValue
from
'
lib/getCurrencyValue
'
;
import
{
getTokenTypeName
}
from
'
lib/token/tokenTypes
'
;
import
NftEntity
from
'
ui/shared/entities/nft/NftEntity
'
;
import
NftEntity
from
'
ui/shared/entities/nft/NftEntity
'
;
import
TokenEntity
from
'
ui/shared/entities/token/TokenEntity
'
;
import
TokenEntity
from
'
ui/shared/entities/token/TokenEntity
'
;
import
NftMedia
from
'
ui/shared/nft/NftMedia
'
;
import
NftMedia
from
'
ui/shared/nft/NftMedia
'
;
...
@@ -23,7 +24,7 @@ const NFTItem = ({ token, value, isLoading, withTokenLink, ...tokenInstance }: P
...
@@ -23,7 +24,7 @@ const NFTItem = ({ token, value, isLoading, withTokenLink, ...tokenInstance }: P
return
(
return
(
<
NFTItemContainer
position=
"relative"
>
<
NFTItemContainer
position=
"relative"
>
<
Skeleton
isLoaded=
{
!
isLoading
}
>
<
Skeleton
isLoaded=
{
!
isLoading
}
>
<
LightMode
><
Tag
background=
"gray.50"
zIndex=
{
1
}
position=
"absolute"
top=
"18px"
right=
"18px"
>
{
token
.
type
}
</
Tag
></
LightMode
>
<
LightMode
><
Tag
background=
"gray.50"
zIndex=
{
1
}
position=
"absolute"
top=
"18px"
right=
"18px"
>
{
getTokenTypeName
(
token
.
type
)
}
</
Tag
></
LightMode
>
</
Skeleton
>
</
Skeleton
>
<
Link
href=
{
isLoading
?
undefined
:
tokenInstanceLink
}
>
<
Link
href=
{
isLoading
?
undefined
:
tokenInstanceLink
}
>
<
NftMedia
<
NftMedia
...
...
ui/pages/TokenInstance.tsx
View file @
76e90ddb
...
@@ -11,6 +11,7 @@ import throwOnResourceLoadError from 'lib/errors/throwOnResourceLoadError';
...
@@ -11,6 +11,7 @@ import throwOnResourceLoadError from 'lib/errors/throwOnResourceLoadError';
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
*
as
metadata
from
'
lib/metadata
'
;
import
*
as
metadata
from
'
lib/metadata
'
;
import
*
as
regexp
from
'
lib/regexp
'
;
import
*
as
regexp
from
'
lib/regexp
'
;
import
{
getTokenTypeName
}
from
'
lib/token/tokenTypes
'
;
import
{
import
{
TOKEN_INSTANCE
,
TOKEN_INSTANCE
,
TOKEN_INFO_ERC_1155
,
TOKEN_INFO_ERC_1155
,
...
@@ -130,7 +131,7 @@ const TokenInstanceContent = () => {
...
@@ -130,7 +131,7 @@ const TokenInstanceContent = () => {
throwOnResourceLoadError
(
tokenInstanceQuery
);
throwOnResourceLoadError
(
tokenInstanceQuery
);
const
tokenTag
=
<
Tag
isLoading=
{
tokenInstanceQuery
.
isPlaceholderData
}
>
{
tokenQuery
.
data
?.
type
}
</
Tag
>
;
const
tokenTag
=
tokenQuery
.
data
?.
type
?
<
Tag
isLoading=
{
tokenInstanceQuery
.
isPlaceholderData
}
>
{
getTokenTypeName
(
tokenQuery
.
data
?.
type
)
}
</
Tag
>
:
null
;
const
address
=
{
const
address
=
{
hash
:
hash
||
''
,
hash
:
hash
||
''
,
...
...
ui/shared/TokenTransfer/TokenTransferListItem.tsx
View file @
76e90ddb
...
@@ -5,6 +5,7 @@ import type { TokenTransfer } from 'types/api/tokenTransfer';
...
@@ -5,6 +5,7 @@ import type { TokenTransfer } from 'types/api/tokenTransfer';
import
getCurrencyValue
from
'
lib/getCurrencyValue
'
;
import
getCurrencyValue
from
'
lib/getCurrencyValue
'
;
import
useTimeAgoIncrement
from
'
lib/hooks/useTimeAgoIncrement
'
;
import
useTimeAgoIncrement
from
'
lib/hooks/useTimeAgoIncrement
'
;
import
{
getTokenTypeName
}
from
'
lib/token/tokenTypes
'
;
import
AddressFromTo
from
'
ui/shared/address/AddressFromTo
'
;
import
AddressFromTo
from
'
ui/shared/address/AddressFromTo
'
;
import
Tag
from
'
ui/shared/chakra/Tag
'
;
import
Tag
from
'
ui/shared/chakra/Tag
'
;
import
NftEntity
from
'
ui/shared/entities/nft/NftEntity
'
;
import
NftEntity
from
'
ui/shared/entities/nft/NftEntity
'
;
...
@@ -54,7 +55,7 @@ const TokenTransferListItem = ({
...
@@ -54,7 +55,7 @@ const TokenTransferListItem = ({
noCopy
noCopy
w=
"auto"
w=
"auto"
/>
/>
<
Tag
flexShrink=
{
0
}
isLoading=
{
isLoading
}
>
{
token
.
type
}
</
Tag
>
<
Tag
flexShrink=
{
0
}
isLoading=
{
isLoading
}
>
{
getTokenTypeName
(
token
.
type
)
}
</
Tag
>
<
Tag
colorScheme=
"orange"
isLoading=
{
isLoading
}
>
{
getTokenTransferTypeText
(
type
)
}
</
Tag
>
<
Tag
colorScheme=
"orange"
isLoading=
{
isLoading
}
>
{
getTokenTransferTypeText
(
type
)
}
</
Tag
>
</
Flex
>
</
Flex
>
{
showTxInfo
&&
txHash
&&
(
{
showTxInfo
&&
txHash
&&
(
...
...
ui/shared/TokenTransfer/TokenTransferTableItem.tsx
View file @
76e90ddb
...
@@ -5,6 +5,7 @@ import type { TokenTransfer } from 'types/api/tokenTransfer';
...
@@ -5,6 +5,7 @@ import type { TokenTransfer } from 'types/api/tokenTransfer';
import
getCurrencyValue
from
'
lib/getCurrencyValue
'
;
import
getCurrencyValue
from
'
lib/getCurrencyValue
'
;
import
useTimeAgoIncrement
from
'
lib/hooks/useTimeAgoIncrement
'
;
import
useTimeAgoIncrement
from
'
lib/hooks/useTimeAgoIncrement
'
;
import
{
getTokenTypeName
}
from
'
lib/token/tokenTypes
'
;
import
AddressFromTo
from
'
ui/shared/address/AddressFromTo
'
;
import
AddressFromTo
from
'
ui/shared/address/AddressFromTo
'
;
import
Tag
from
'
ui/shared/chakra/Tag
'
;
import
Tag
from
'
ui/shared/chakra/Tag
'
;
import
NftEntity
from
'
ui/shared/entities/nft/NftEntity
'
;
import
NftEntity
from
'
ui/shared/entities/nft/NftEntity
'
;
...
@@ -60,7 +61,7 @@ const TokenTransferTableItem = ({
...
@@ -60,7 +61,7 @@ const TokenTransferTableItem = ({
mt=
{
1
}
mt=
{
1
}
/>
/>
<
Flex
columnGap=
{
2
}
rowGap=
{
2
}
mt=
{
2
}
flexWrap=
"wrap"
>
<
Flex
columnGap=
{
2
}
rowGap=
{
2
}
mt=
{
2
}
flexWrap=
"wrap"
>
<
Tag
isLoading=
{
isLoading
}
>
{
token
.
type
}
</
Tag
>
<
Tag
isLoading=
{
isLoading
}
>
{
getTokenTypeName
(
token
.
type
)
}
</
Tag
>
<
Tag
colorScheme=
"orange"
isLoading=
{
isLoading
}
>
{
getTokenTransferTypeText
(
type
)
}
</
Tag
>
<
Tag
colorScheme=
"orange"
isLoading=
{
isLoading
}
>
{
getTokenTransferTypeText
(
type
)
}
</
Tag
>
</
Flex
>
</
Flex
>
</
Td
>
</
Td
>
...
...
ui/shared/filters/TokenTypeFilter.tsx
View file @
76e90ddb
...
@@ -3,7 +3,8 @@ import React from 'react';
...
@@ -3,7 +3,8 @@ import React from 'react';
import
type
{
NFTTokenType
,
TokenType
}
from
'
types/api/token
'
;
import
type
{
NFTTokenType
,
TokenType
}
from
'
types/api/token
'
;
import
{
NFT_TOKEN_TYPES
,
TOKEN_TYPES
}
from
'
lib/token/tokenTypes
'
;
import
{
TOKEN_TYPES
,
TOKEN_TYPE_IDS
,
NFT_TOKEN_TYPE_IDS
}
from
'
lib/token/tokenTypes
'
;
type
Props
<
T
extends
TokenType
|
NFTTokenType
>
=
{
type
Props
<
T
extends
TokenType
|
NFTTokenType
>
=
{
onChange
:
(
nextValue
:
Array
<
T
>
)
=>
void
;
onChange
:
(
nextValue
:
Array
<
T
>
)
=>
void
;
...
@@ -42,9 +43,9 @@ const TokenTypeFilter = <T extends TokenType | NFTTokenType>({ nftOnly, onChange
...
@@ -42,9 +43,9 @@ const TokenTypeFilter = <T extends TokenType | NFTTokenType>({ nftOnly, onChange
</
Link
>
</
Link
>
</
Flex
>
</
Flex
>
<
CheckboxGroup
size=
"lg"
onChange=
{
handleChange
}
value=
{
value
}
>
<
CheckboxGroup
size=
"lg"
onChange=
{
handleChange
}
value=
{
value
}
>
{
(
nftOnly
?
NFT_TOKEN_TYPE
S
:
TOKEN_TYPES
).
map
(({
title
,
id
}
)
=>
(
{
(
nftOnly
?
NFT_TOKEN_TYPE
_IDS
:
TOKEN_TYPE_IDS
).
map
((
id
)
=>
(
<
Checkbox
key=
{
id
}
value=
{
id
}
>
<
Checkbox
key=
{
id
}
value=
{
id
}
>
<
Text
fontSize=
"md"
>
{
title
}
</
Text
>
<
Text
fontSize=
"md"
>
{
TOKEN_TYPES
[
id
]
}
</
Text
>
</
Checkbox
>
</
Checkbox
>
))
}
))
}
</
CheckboxGroup
>
</
CheckboxGroup
>
...
...
ui/shared/search/utils.ts
View file @
76e90ddb
...
@@ -17,8 +17,8 @@ export type SearchResultAppItem = {
...
@@ -17,8 +17,8 @@ export type SearchResultAppItem = {
export
const
searchCategories
:
Array
<
{
id
:
Category
;
title
:
string
}
>
=
[
export
const
searchCategories
:
Array
<
{
id
:
Category
;
title
:
string
}
>
=
[
{
id
:
'
app
'
,
title
:
'
DApps
'
},
{
id
:
'
app
'
,
title
:
'
DApps
'
},
{
id
:
'
token
'
,
title
:
'
Tokens (ERC-20)
'
},
{
id
:
'
token
'
,
title
:
`Tokens (
${
config
.
chain
.
tokenStandard
}
-20)`
},
{
id
:
'
nft
'
,
title
:
'
NFTs (ERC-721 & 1155)
'
},
{
id
:
'
nft
'
,
title
:
`NFTs (
${
config
.
chain
.
tokenStandard
}
-721 & 1155)`
},
{
id
:
'
address
'
,
title
:
'
Addresses
'
},
{
id
:
'
address
'
,
title
:
'
Addresses
'
},
{
id
:
'
public_tag
'
,
title
:
'
Public tags
'
},
{
id
:
'
public_tag
'
,
title
:
'
Public tags
'
},
{
id
:
'
transaction
'
,
title
:
'
Transactions
'
},
{
id
:
'
transaction
'
,
title
:
'
Transactions
'
},
...
...
ui/token/TokenPageTitle.tsx
View file @
76e90ddb
...
@@ -11,6 +11,7 @@ import useAddressMetadataInfoQuery from 'lib/address/useAddressMetadataInfoQuery
...
@@ -11,6 +11,7 @@ import useAddressMetadataInfoQuery from 'lib/address/useAddressMetadataInfoQuery
import
type
{
ResourceError
}
from
'
lib/api/resources
'
;
import
type
{
ResourceError
}
from
'
lib/api/resources
'
;
import
useApiQuery
from
'
lib/api/useApiQuery
'
;
import
useApiQuery
from
'
lib/api/useApiQuery
'
;
import
{
useAppContext
}
from
'
lib/contexts/app
'
;
import
{
useAppContext
}
from
'
lib/contexts/app
'
;
import
{
getTokenTypeName
}
from
'
lib/token/tokenTypes
'
;
import
AddressQrCode
from
'
ui/address/details/AddressQrCode
'
;
import
AddressQrCode
from
'
ui/address/details/AddressQrCode
'
;
import
AccountActionsMenu
from
'
ui/shared/AccountActionsMenu/AccountActionsMenu
'
;
import
AccountActionsMenu
from
'
ui/shared/AccountActionsMenu/AccountActionsMenu
'
;
import
AddressAddToWallet
from
'
ui/shared/address/AddressAddToWallet
'
;
import
AddressAddToWallet
from
'
ui/shared/address/AddressAddToWallet
'
;
...
@@ -67,7 +68,7 @@ const TokenPageTitle = ({ tokenQuery, addressQuery, hash }: Props) => {
...
@@ -67,7 +68,7 @@ const TokenPageTitle = ({ tokenQuery, addressQuery, hash }: Props) => {
const
tags
:
Array
<
EntityTag
>
=
React
.
useMemo
(()
=>
{
const
tags
:
Array
<
EntityTag
>
=
React
.
useMemo
(()
=>
{
return
[
return
[
tokenQuery
.
data
?
{
slug
:
tokenQuery
.
data
?.
type
,
name
:
tokenQuery
.
data
?.
type
,
tagType
:
'
custom
'
as
const
,
ordinal
:
-
20
}
:
undefined
,
tokenQuery
.
data
?
{
slug
:
tokenQuery
.
data
?.
type
,
name
:
getTokenTypeName
(
tokenQuery
.
data
.
type
)
,
tagType
:
'
custom
'
as
const
,
ordinal
:
-
20
}
:
undefined
,
config
.
features
.
bridgedTokens
.
isEnabled
&&
tokenQuery
.
data
?.
is_bridged
?
config
.
features
.
bridgedTokens
.
isEnabled
&&
tokenQuery
.
data
?.
is_bridged
?
{
{
slug
:
'
bridged
'
,
slug
:
'
bridged
'
,
...
...
ui/tokens/TokensListItem.tsx
View file @
76e90ddb
...
@@ -5,6 +5,7 @@ import React from 'react';
...
@@ -5,6 +5,7 @@ import React from 'react';
import
type
{
TokenInfo
}
from
'
types/api/token
'
;
import
type
{
TokenInfo
}
from
'
types/api/token
'
;
import
config
from
'
configs/app
'
;
import
config
from
'
configs/app
'
;
import
{
getTokenTypeName
}
from
'
lib/token/tokenTypes
'
;
import
AddressAddToWallet
from
'
ui/shared/address/AddressAddToWallet
'
;
import
AddressAddToWallet
from
'
ui/shared/address/AddressAddToWallet
'
;
import
Tag
from
'
ui/shared/chakra/Tag
'
;
import
Tag
from
'
ui/shared/chakra/Tag
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
...
@@ -59,7 +60,7 @@ const TokensTableItem = ({
...
@@ -59,7 +60,7 @@ const TokensTableItem = ({
fontWeight=
"700"
fontWeight=
"700"
/>
/>
<
Flex
ml=
{
3
}
flexShrink=
{
0
}
columnGap=
{
1
}
>
<
Flex
ml=
{
3
}
flexShrink=
{
0
}
columnGap=
{
1
}
>
<
Tag
isLoading=
{
isLoading
}
>
{
type
}
</
Tag
>
<
Tag
isLoading=
{
isLoading
}
>
{
getTokenTypeName
(
type
)
}
</
Tag
>
{
bridgedChainTag
&&
<
Tag
isLoading=
{
isLoading
}
>
{
bridgedChainTag
}
</
Tag
>
}
{
bridgedChainTag
&&
<
Tag
isLoading=
{
isLoading
}
>
{
bridgedChainTag
}
</
Tag
>
}
</
Flex
>
</
Flex
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontSize=
"sm"
ml=
"auto"
color=
"text_secondary"
minW=
"24px"
textAlign=
"right"
lineHeight=
{
6
}
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontSize=
"sm"
ml=
"auto"
color=
"text_secondary"
minW=
"24px"
textAlign=
"right"
lineHeight=
{
6
}
>
...
...
ui/tokens/TokensTableItem.tsx
View file @
76e90ddb
...
@@ -5,6 +5,7 @@ import React from 'react';
...
@@ -5,6 +5,7 @@ import React from 'react';
import
type
{
TokenInfo
}
from
'
types/api/token
'
;
import
type
{
TokenInfo
}
from
'
types/api/token
'
;
import
config
from
'
configs/app
'
;
import
config
from
'
configs/app
'
;
import
{
getTokenTypeName
}
from
'
lib/token/tokenTypes
'
;
import
AddressAddToWallet
from
'
ui/shared/address/AddressAddToWallet
'
;
import
AddressAddToWallet
from
'
ui/shared/address/AddressAddToWallet
'
;
import
Tag
from
'
ui/shared/chakra/Tag
'
;
import
Tag
from
'
ui/shared/chakra/Tag
'
;
import
type
{
EntityProps
as
AddressEntityProps
}
from
'
ui/shared/entities/address/AddressEntity
'
;
import
type
{
EntityProps
as
AddressEntityProps
}
from
'
ui/shared/entities/address/AddressEntity
'
;
...
@@ -96,7 +97,7 @@ const TokensTableItem = ({
...
@@ -96,7 +97,7 @@ const TokensTableItem = ({
/>
/>
</
Flex
>
</
Flex
>
<
Flex
columnGap=
{
1
}
>
<
Flex
columnGap=
{
1
}
>
<
Tag
isLoading=
{
isLoading
}
>
{
type
}
</
Tag
>
<
Tag
isLoading=
{
isLoading
}
>
{
getTokenTypeName
(
type
)
}
</
Tag
>
{
bridgedChainTag
&&
<
Tag
isLoading=
{
isLoading
}
>
{
bridgedChainTag
}
</
Tag
>
}
{
bridgedChainTag
&&
<
Tag
isLoading=
{
isLoading
}
>
{
bridgedChainTag
}
</
Tag
>
}
</
Flex
>
</
Flex
>
</
Flex
>
</
Flex
>
...
...
ui/watchlist/AddressModal/AddressFormNotifications.tsx
View file @
76e90ddb
...
@@ -6,9 +6,14 @@ import type { Path, ControllerRenderProps, FieldValues, Control } from 'react-ho
...
@@ -6,9 +6,14 @@ import type { Path, ControllerRenderProps, FieldValues, Control } from 'react-ho
import
config
from
'
configs/app
'
;
import
config
from
'
configs/app
'
;
import
CheckboxInput
from
'
ui/shared/CheckboxInput
'
;
import
CheckboxInput
from
'
ui/shared/CheckboxInput
'
;
// does it depend on the network?
const
tokenStandardName
=
config
.
chain
.
tokenStandard
;
const
NOTIFICATIONS
=
[
'
native
'
,
'
ERC-20
'
,
'
ERC-721
'
,
'
ERC-404
'
]
as
const
;
const
NOTIFICATIONS
=
[
'
native
'
,
'
ERC-20
'
,
'
ERC-721
'
,
'
ERC-404
'
]
as
const
;
const
NOTIFICATIONS_NAMES
=
[
config
.
chain
.
currency
.
symbol
,
'
ERC-20
'
,
'
ERC-721, ERC-1155 (NFT)
'
,
'
ERC-404
'
];
const
NOTIFICATIONS_NAMES
=
[
config
.
chain
.
currency
.
symbol
,
`
${
tokenStandardName
}
-20`
,
`
${
tokenStandardName
}
-721,
${
tokenStandardName
}
-1155 (NFT)`
,
`
${
tokenStandardName
}
-404`
];
type
Props
<
Inputs
extends
FieldValues
>
=
{
type
Props
<
Inputs
extends
FieldValues
>
=
{
control
:
Control
<
Inputs
>
;
control
:
Control
<
Inputs
>
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment