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 @@ -94,7 +94,7 @@
"@polkadot/types-codec": "10.10.1",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"@subwallet/chain-list": "0.2.68-beta.1",
"@subwallet/chain-list": "0.2.70-beta.6",
"@subwallet/keyring": "file:./local-libs/keyring",
"@subwallet/ui-keyring": "file:./local-libs/ui-keyring",
"babel-core": "^7.0.0-bridge.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@ export const _ALWAYS_ACTIVE_CHAINS: string[] = [
export const EVM_PASS_CONNECT_STATUS: Record<string, string[]> = {
arbitrum_one: ['*'],
okxTest: ['*'],
merlinEvm: ['*']
merlinEvm: ['*'],
layerEdge_testnet: ['*']
};

export const EVM_REFORMAT_DECIMALS = {
Expand Down
4 changes: 3 additions & 1 deletion packages/extension-base/src/services/chain-service/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ const openbitChainInfoMap = (() => {
'bobMainnet',
'merlinEvm',
'botanixEvmTest',
'bounceBitEvm'
'bounceBitEvm',
'bounceBitEvmTest',
'layerEdge_testnet'
];
const enableList = nativeList.concat(bitcoinL2List);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import useTranslation from '@subwallet/extension-koni-ui/hooks/common/useTransla
import { loadMoreInscription } from '@subwallet/extension-koni-ui/messaging';
import { InscriptionGalleryWrapper } from '@subwallet/extension-koni-ui/Popup/Home/Nfts/component/InscriptionGalleryWrapper';
import { NftGalleryWrapper } from '@subwallet/extension-koni-ui/Popup/Home/Nfts/component/NftGalleryWrapper';
import { getTotalCollectionItems, INftCollectionDetail, INftItemDetail } from '@subwallet/extension-koni-ui/Popup/Home/Nfts/utils';
import { getTotalCollectionItems, INftCollectionDetail, INftItemDetail, isValidJson } from '@subwallet/extension-koni-ui/Popup/Home/Nfts/utils';
import { RootState } from '@subwallet/extension-koni-ui/stores';
import { ThemeProps } from '@subwallet/extension-koni-ui/types';
import { Input, SwList } from '@subwallet/react-ui';
Expand Down Expand Up @@ -102,7 +102,7 @@ function Component ({ className = '' }: Props): React.ReactElement<Props> {
const renderNft = useCallback((nftItem: NftItem) => {
const routingParams = { collectionInfo, nftItem } as INftItemDetail;

if (nftItem.description) {
if (nftItem.description && isValidJson(nftItem.description)) {
const ordinalNftItem = JSON.parse(nftItem.description) as OrdinalRemarkData;

if ('p' in ordinalNftItem && 'op' in ordinalNftItem && 'tick' in ordinalNftItem && 'amt' in ordinalNftItem) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import useDefaultNavigate from '@subwallet/extension-koni-ui/hooks/router/useDef
import useGetChainInfo from '@subwallet/extension-koni-ui/hooks/screen/common/useFetchChainInfo';
import useGetAccountInfoByAddress from '@subwallet/extension-koni-ui/hooks/screen/common/useGetAccountInfoByAddress';
import InscriptionImage from '@subwallet/extension-koni-ui/Popup/Home/Nfts/component/InscriptionImage';
import { INftItemDetail } from '@subwallet/extension-koni-ui/Popup/Home/Nfts/utils';
import { INftItemDetail, isValidJson } from '@subwallet/extension-koni-ui/Popup/Home/Nfts/utils';
import { RootState } from '@subwallet/extension-koni-ui/stores';
import { Theme, ThemeProps } from '@subwallet/extension-koni-ui/types';
import { BackgroundIcon, Field, Icon, Image, Logo, ModalContext, SwModal } from '@subwallet/react-ui';
Expand Down Expand Up @@ -137,7 +137,7 @@ function Component ({ className = '' }: Props): React.ReactElement<Props> {
}, [nftItem.externalUrl]);

const show3DModel = SHOW_3D_MODELS_CHAIN.includes(nftItem.chain);
const ordinalNftItem = nftItem.description && JSON.parse(nftItem.description) as OrdinalRemarkData;
const ordinalNftItem = nftItem.description && isValidJson(nftItem.description) && JSON.parse(nftItem.description) as OrdinalRemarkData;
const isInscription = useMemo(() => {
if (ordinalNftItem && 'p' in ordinalNftItem && 'op' in ordinalNftItem && 'tick' in ordinalNftItem && 'amt' in ordinalNftItem) {
return true;
Expand Down
10 changes: 10 additions & 0 deletions packages/extension-koni-ui/src/Popup/Home/Nfts/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,13 @@ export function getTotalCollectionItems (

return itemsLength;
}

export const isValidJson = (str: string): boolean => {
try {
JSON.parse(str);

return true;
} catch {
return false;
}
};
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6241,14 +6241,14 @@ __metadata:
languageName: node
linkType: hard

"@subwallet/chain-list@npm:0.2.68-beta.1":
version: 0.2.68-beta.1
resolution: "@subwallet/chain-list@npm:0.2.68-beta.1"
"@subwallet/chain-list@npm:0.2.70-beta.6":
version: 0.2.70-beta.6
resolution: "@subwallet/chain-list@npm:0.2.70-beta.6"
dependencies:
"@polkadot/dev": 0.67.167
"@polkadot/util": ^12.5.1
eventemitter3: ^5.0.1
checksum: d34f43df3a6ebd3b83bde7d4bcf73966b156c1b5d166c1cceae415c1c1363e4c4a0b933d9c9649907ae2c2aadb612cc52ed4f966a01cd75164e115c8c3cc41d0
checksum: d4e5085eb6501555202879233cdbc23c37e4926fb0488ab3691c7b5e0354e763f6e34c3029918944346cc3f1eaa3e201a3e9eec78f01d1332c41a8d10c2331e2
languageName: node
linkType: hard

Expand Down