@subwallet/extension-base 1.1.3-0 → 1.1.4-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.UNIQUE_SCAN_ENDPOINT = exports.UNIQUE_IPFS_GATEWAY = exports.TRANSFER_CHAIN_ID = exports.SUPPORTED_TRANSFER_SUBSTRATE_CHAIN_NAME = exports.SUPPORTED_TRANSFER_EVM_CHAIN_NAME = exports.SUPPORTED_TRANSFER_EVM_CHAIN = exports.SUPPORTED_NFT_NETWORKS = exports.SINGULAR_V2_ENDPOINT = exports.SINGULAR_V2_COLLECTION_ENDPOINT = exports.SINGULAR_V1_ENDPOINT = exports.SINGULAR_V1_COLLECTION_ENDPOINT = exports.RMRK_PINATA_SERVER = exports.QUARTZ_SCAN_ENDPOINT = exports.PINATA_IPFS_GATEWAY = exports.NFT_STORAGE_GATEWAY = exports.KANARIA_EXTERNAL_SERVER = exports.KANARIA_ENDPOINT = exports.IPFS_TELOS_MIAMI = exports.IPFS_IO_GATEWAY = exports.IPFS_GATEWAY_CLOUD = exports.IPFS_FLEEK = exports.GATEWAY_IPFS_IO = exports.DWEB_LINK = exports.CLOUDFLARE_PINATA_SERVER = exports.CF_IPFS_GATEWAY = exports.BIT_COUNTRY_THUMBNAIL_RESOLVER = exports.BIT_COUNTRY_LAND_ESTATE_METADATA_API = exports.BIT_COUNTRY_IPFS_SERVER = void 0;
6
+ exports.UNIQUE_SCAN_ENDPOINT = exports.UNIQUE_IPFS_GATEWAY = exports.TRANSFER_CHAIN_ID = exports.SUPPORTED_TRANSFER_SUBSTRATE_CHAIN_NAME = exports.SUPPORTED_TRANSFER_EVM_CHAIN_NAME = exports.SUPPORTED_TRANSFER_EVM_CHAIN = exports.SUPPORTED_NFT_NETWORKS = exports.SINGULAR_V2_ENDPOINT = exports.SINGULAR_V2_COLLECTION_ENDPOINT = exports.SINGULAR_V1_ENDPOINT = exports.SINGULAR_V1_COLLECTION_ENDPOINT = exports.RMRK_PINATA_SERVER = exports.QUARTZ_SCAN_ENDPOINT = exports.PINATA_IPFS_GATEWAY = exports.NFT_STORAGE_GATEWAY = exports.KANARIA_EXTERNAL_SERVER = exports.KANARIA_ENDPOINT = exports.IPFS_W3S_LINK = exports.IPFS_HARDBIN = exports.IPFS_GATEWAY_4EVERLAND = exports.IPFS_FLEEK = exports.GATEWAY_IPFS_IO = exports.DWEB_LINK = exports.CLOUDFLARE_PINATA_SERVER = exports.CF_IPFS_GATEWAY = exports.BIT_COUNTRY_THUMBNAIL_RESOLVER = exports.BIT_COUNTRY_LAND_ESTATE_METADATA_API = exports.BIT_COUNTRY_IPFS_SERVER = void 0;
7
7
  exports.getRandomIpfsGateway = getRandomIpfsGateway;
8
8
  var _utils = require("@subwallet/extension-base/utils");
9
9
  // Copyright 2019-2022 @subwallet/extension-koni authors & contributors
@@ -43,18 +43,18 @@ const UNIQUE_IPFS_GATEWAY = 'https://ipfs.unique.network/ipfs/';
43
43
  exports.UNIQUE_IPFS_GATEWAY = UNIQUE_IPFS_GATEWAY;
44
44
  const NFT_STORAGE_GATEWAY = 'https://nftstorage.link/ipfs/';
45
45
  exports.NFT_STORAGE_GATEWAY = NFT_STORAGE_GATEWAY;
46
- const IPFS_IO_GATEWAY = 'https://ipfs.io/ipfs/';
47
- exports.IPFS_IO_GATEWAY = IPFS_IO_GATEWAY;
46
+ const IPFS_W3S_LINK = 'https://w3s.link/ipfs/';
47
+ exports.IPFS_W3S_LINK = IPFS_W3S_LINK;
48
48
  const GATEWAY_IPFS_IO = 'https://gateway.ipfs.io/ipfs/';
49
49
  exports.GATEWAY_IPFS_IO = GATEWAY_IPFS_IO;
50
50
  const DWEB_LINK = 'https://dweb.link/ipfs/';
51
51
  exports.DWEB_LINK = DWEB_LINK;
52
- const IPFS_GATEWAY_CLOUD = 'https://ipfs-gateway.cloud/ipfs/';
53
- exports.IPFS_GATEWAY_CLOUD = IPFS_GATEWAY_CLOUD;
52
+ const IPFS_GATEWAY_4EVERLAND = 'https://4everland.io/ipfs/';
53
+ exports.IPFS_GATEWAY_4EVERLAND = IPFS_GATEWAY_4EVERLAND;
54
54
  const IPFS_FLEEK = 'https://ipfs.fleek.co/ipfs/';
55
55
  exports.IPFS_FLEEK = IPFS_FLEEK;
56
- const IPFS_TELOS_MIAMI = 'https://ipfs.telos.miami/ipfs';
57
- exports.IPFS_TELOS_MIAMI = IPFS_TELOS_MIAMI;
56
+ const IPFS_HARDBIN = 'https://hardbin.com/ipfs';
57
+ exports.IPFS_HARDBIN = IPFS_HARDBIN;
58
58
  let SUPPORTED_NFT_NETWORKS;
59
59
  exports.SUPPORTED_NFT_NETWORKS = SUPPORTED_NFT_NETWORKS;
60
60
  (function (SUPPORTED_NFT_NETWORKS) {
@@ -103,8 +103,8 @@ exports.SUPPORTED_TRANSFER_SUBSTRATE_CHAIN_NAME = SUPPORTED_TRANSFER_SUBSTRATE_C
103
103
  SUPPORTED_TRANSFER_SUBSTRATE_CHAIN_NAME["pioneer"] = "pioneer";
104
104
  })(SUPPORTED_TRANSFER_SUBSTRATE_CHAIN_NAME || (exports.SUPPORTED_TRANSFER_SUBSTRATE_CHAIN_NAME = SUPPORTED_TRANSFER_SUBSTRATE_CHAIN_NAME = {}));
105
105
  const RANDOM_IPFS_GATEWAY_SETTING = [{
106
- provider: IPFS_IO_GATEWAY,
107
- weight: 0 // Not stable
106
+ provider: IPFS_W3S_LINK,
107
+ weight: 1
108
108
  }, {
109
109
  provider: CF_IPFS_GATEWAY,
110
110
  weight: 4
@@ -121,11 +121,11 @@ const RANDOM_IPFS_GATEWAY_SETTING = [{
121
121
  provider: DWEB_LINK,
122
122
  weight: 5
123
123
  }, {
124
- provider: IPFS_GATEWAY_CLOUD,
125
- weight: 0 // Deceptive site warning
124
+ provider: IPFS_GATEWAY_4EVERLAND,
125
+ weight: 2
126
126
  }, {
127
- provider: IPFS_TELOS_MIAMI,
128
- weight: 0
127
+ provider: IPFS_HARDBIN,
128
+ weight: 1
129
129
  }];
130
130
  if (!_utils.RuntimeInfo.protocol || _utils.RuntimeInfo.protocol && !_utils.RuntimeInfo.protocol.startsWith('http')) {
131
131
  RANDOM_IPFS_GATEWAY_SETTING.push({
@@ -74,7 +74,7 @@ class BaseNftApi {
74
74
  if (!input || input.length === 0) {
75
75
  return undefined;
76
76
  }
77
- if ((0, _utils.isUrl)(input)) {
77
+ if ((0, _utils.isUrl)(input) || input.includes('https://') || input.includes('http')) {
78
78
  return input;
79
79
  }
80
80
  if (input.startsWith('/ipfs/')) {
@@ -24,18 +24,23 @@ class RmrkNftApi extends _nft.BaseNftApi {
24
24
  constructor(addresses, chain) {
25
25
  super(chain, null, addresses);
26
26
  }
27
- parseUrl(input) {
28
- if (!input || input.length === 0) {
29
- return undefined;
30
- }
31
- if ((0, _utils.isUrl)(input) || input.includes('https://') || input.includes('http')) {
32
- return input;
33
- }
34
- if (!input.includes('ipfs://ipfs/')) {
35
- return (0, _config.getRandomIpfsGateway)() + input;
36
- }
37
- return (0, _config.getRandomIpfsGateway)() + input.split('ipfs://ipfs/')[1];
38
- }
27
+
28
+ // override parseUrl (input: string): string | undefined {
29
+ // if (!input || input.length === 0) {
30
+ // return undefined;
31
+ // }
32
+ //
33
+ // if (isUrl(input) || input.includes('https://') || input.includes('http')) {
34
+ // return input;
35
+ // }
36
+ //
37
+ // if (!input.includes('ipfs://ipfs/')) {
38
+ // return getRandomIpfsGateway() + input;
39
+ // }
40
+ //
41
+ // return getRandomIpfsGateway() + input.split('ipfs://ipfs/')[1];
42
+ // }
43
+
39
44
  async getMetadata(metadataUrl) {
40
45
  let url = metadataUrl;
41
46
  if (!(0, _utils.isUrl)(metadataUrl)) {
@@ -76,53 +81,57 @@ class RmrkNftApi extends _nft.BaseNftApi {
76
81
  }));
77
82
  const nfts = [];
78
83
  await Promise.all(data.map(async item => {
79
- const primaryResource = item.primaryResource ? item.primaryResource : null;
80
- const metadataUri = primaryResource && primaryResource.metadata ? primaryResource.metadata : item.metadata;
81
- const nftMetadata = await this.getMetadata(metadataUri);
82
- if (item.source === RMRK_SOURCE.BIRD_KANARIA) {
83
- nfts.push({
84
- ...item,
85
- metadata: nftMetadata,
86
- owner: account
87
- });
88
- } else if (item.source === RMRK_SOURCE.KANARIA) {
89
- nfts.push({
90
- ...item,
91
- metadata: {
92
- ...nftMetadata,
93
- image: this.parseUrl(nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.image)
94
- },
95
- owner: account
96
- });
97
- } else if (item.source === RMRK_SOURCE.SINGULAR_V1) {
98
- nfts.push({
99
- ...item,
100
- metadata: {
101
- description: nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.description,
102
- name: nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.name,
103
- attributes: nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.attributes,
104
- animation_url: this.parseUrl(nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.animation_url),
105
- image: this.parseUrl(nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.image)
106
- },
107
- owner: account
108
- });
109
- } else if (item.source === RMRK_SOURCE.SINGULAR_V2) {
110
- const id = item.id;
111
- if (!id.toLowerCase().includes(KANBIRD_KEYWORD)) {
112
- // excludes kanaria bird, already handled above
84
+ try {
85
+ const primaryResource = item.primaryResource ? item.primaryResource : null;
86
+ const metadataUri = primaryResource && primaryResource.metadata ? primaryResource.metadata : item.metadata;
87
+ const nftMetadata = await this.getMetadata(metadataUri);
88
+ if (item.source === RMRK_SOURCE.BIRD_KANARIA) {
89
+ nfts.push({
90
+ ...item,
91
+ metadata: nftMetadata,
92
+ owner: account
93
+ });
94
+ } else if (item.source === RMRK_SOURCE.KANARIA) {
95
+ nfts.push({
96
+ ...item,
97
+ metadata: {
98
+ ...nftMetadata,
99
+ image: this.parseUrl(nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.image)
100
+ },
101
+ owner: account
102
+ });
103
+ } else if (item.source === RMRK_SOURCE.SINGULAR_V1) {
113
104
  nfts.push({
114
105
  ...item,
115
106
  metadata: {
116
107
  description: nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.description,
117
108
  name: nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.name,
118
109
  attributes: nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.attributes,
119
- properties: nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.properties,
120
110
  animation_url: this.parseUrl(nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.animation_url),
121
- image: this.parseUrl(nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.mediaUri)
111
+ image: this.parseUrl(nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.image)
122
112
  },
123
113
  owner: account
124
114
  });
115
+ } else if (item.source === RMRK_SOURCE.SINGULAR_V2) {
116
+ const id = item.id;
117
+ if (!id.toLowerCase().includes(KANBIRD_KEYWORD)) {
118
+ // excludes kanaria bird, already handled above
119
+ nfts.push({
120
+ ...item,
121
+ metadata: {
122
+ description: nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.description,
123
+ name: nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.name,
124
+ attributes: nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.attributes,
125
+ properties: nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.properties,
126
+ animation_url: this.parseUrl(nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.animation_url),
127
+ image: this.parseUrl(nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.mediaUri)
128
+ },
129
+ owner: account
130
+ });
131
+ }
125
132
  }
133
+ } catch (e) {
134
+ console.log('error fetching RMRK NFT', e);
126
135
  }
127
136
  }));
128
137
  return nfts;
@@ -13,6 +13,6 @@ const packageInfo = {
13
13
  name: '@subwallet/extension-base',
14
14
  path: typeof __dirname === 'string' ? __dirname : 'auto',
15
15
  type: 'cjs',
16
- version: '1.1.3-0'
16
+ version: '1.1.4-0'
17
17
  };
18
18
  exports.packageInfo = packageInfo;
@@ -714,6 +714,15 @@ class ChainService {
714
714
  async initAssetRegistry(deprecatedCustomChainMap) {
715
715
  const storedAssetRegistry = await this.dbService.getAllAssetStore();
716
716
  const latestAssetRegistry = await this.fetchLatestData(_constants._CHAIN_ASSET_SRC, _chainList.ChainAssetMap);
717
+
718
+ // Fill out zk assets from latestAssetRegistry if not supported
719
+ if (!_utils2.MODULE_SUPPORT.MANTA_ZK) {
720
+ Object.keys(latestAssetRegistry).forEach(slug => {
721
+ if ((0, _utils._isMantaZkAsset)(latestAssetRegistry[slug])) {
722
+ delete latestAssetRegistry[slug];
723
+ }
724
+ });
725
+ }
717
726
  if (storedAssetRegistry.length === 0) {
718
727
  this.dataMap.assetRegistry = latestAssetRegistry;
719
728
  } else {
@@ -15,12 +15,12 @@ export declare const UNIQUE_SCAN_ENDPOINT = "https://explorer-api.unique.network
15
15
  export declare const QUARTZ_SCAN_ENDPOINT = "https://hasura-quartz.unique.network/v1/graphql";
16
16
  export declare const UNIQUE_IPFS_GATEWAY = "https://ipfs.unique.network/ipfs/";
17
17
  export declare const NFT_STORAGE_GATEWAY = "https://nftstorage.link/ipfs/";
18
- export declare const IPFS_IO_GATEWAY = "https://ipfs.io/ipfs/";
18
+ export declare const IPFS_W3S_LINK = "https://w3s.link/ipfs/";
19
19
  export declare const GATEWAY_IPFS_IO = "https://gateway.ipfs.io/ipfs/";
20
20
  export declare const DWEB_LINK = "https://dweb.link/ipfs/";
21
- export declare const IPFS_GATEWAY_CLOUD = "https://ipfs-gateway.cloud/ipfs/";
21
+ export declare const IPFS_GATEWAY_4EVERLAND = "https://4everland.io/ipfs/";
22
22
  export declare const IPFS_FLEEK = "https://ipfs.fleek.co/ipfs/";
23
- export declare const IPFS_TELOS_MIAMI = "https://ipfs.telos.miami/ipfs";
23
+ export declare const IPFS_HARDBIN = "https://hardbin.com/ipfs";
24
24
  export declare enum SUPPORTED_NFT_NETWORKS {
25
25
  karura = "karura",
26
26
  acala = "acala",
@@ -19,12 +19,12 @@ export const UNIQUE_SCAN_ENDPOINT = 'https://explorer-api.unique.network/v1/grap
19
19
  export const QUARTZ_SCAN_ENDPOINT = 'https://hasura-quartz.unique.network/v1/graphql';
20
20
  export const UNIQUE_IPFS_GATEWAY = 'https://ipfs.unique.network/ipfs/';
21
21
  export const NFT_STORAGE_GATEWAY = 'https://nftstorage.link/ipfs/';
22
- export const IPFS_IO_GATEWAY = 'https://ipfs.io/ipfs/';
22
+ export const IPFS_W3S_LINK = 'https://w3s.link/ipfs/';
23
23
  export const GATEWAY_IPFS_IO = 'https://gateway.ipfs.io/ipfs/';
24
24
  export const DWEB_LINK = 'https://dweb.link/ipfs/';
25
- export const IPFS_GATEWAY_CLOUD = 'https://ipfs-gateway.cloud/ipfs/';
25
+ export const IPFS_GATEWAY_4EVERLAND = 'https://4everland.io/ipfs/';
26
26
  export const IPFS_FLEEK = 'https://ipfs.fleek.co/ipfs/';
27
- export const IPFS_TELOS_MIAMI = 'https://ipfs.telos.miami/ipfs';
27
+ export const IPFS_HARDBIN = 'https://hardbin.com/ipfs';
28
28
  export let SUPPORTED_NFT_NETWORKS;
29
29
  (function (SUPPORTED_NFT_NETWORKS) {
30
30
  SUPPORTED_NFT_NETWORKS["karura"] = "karura";
@@ -68,8 +68,8 @@ export let SUPPORTED_TRANSFER_SUBSTRATE_CHAIN_NAME;
68
68
  SUPPORTED_TRANSFER_SUBSTRATE_CHAIN_NAME["pioneer"] = "pioneer";
69
69
  })(SUPPORTED_TRANSFER_SUBSTRATE_CHAIN_NAME || (SUPPORTED_TRANSFER_SUBSTRATE_CHAIN_NAME = {}));
70
70
  const RANDOM_IPFS_GATEWAY_SETTING = [{
71
- provider: IPFS_IO_GATEWAY,
72
- weight: 0 // Not stable
71
+ provider: IPFS_W3S_LINK,
72
+ weight: 1
73
73
  }, {
74
74
  provider: CF_IPFS_GATEWAY,
75
75
  weight: 4
@@ -86,11 +86,11 @@ const RANDOM_IPFS_GATEWAY_SETTING = [{
86
86
  provider: DWEB_LINK,
87
87
  weight: 5
88
88
  }, {
89
- provider: IPFS_GATEWAY_CLOUD,
90
- weight: 0 // Deceptive site warning
89
+ provider: IPFS_GATEWAY_4EVERLAND,
90
+ weight: 2
91
91
  }, {
92
- provider: IPFS_TELOS_MIAMI,
93
- weight: 0
92
+ provider: IPFS_HARDBIN,
93
+ weight: 1
94
94
  }];
95
95
  if (!RuntimeInfo.protocol || RuntimeInfo.protocol && !RuntimeInfo.protocol.startsWith('http')) {
96
96
  RANDOM_IPFS_GATEWAY_SETTING.push({
@@ -68,7 +68,7 @@ export class BaseNftApi {
68
68
  if (!input || input.length === 0) {
69
69
  return undefined;
70
70
  }
71
- if (isUrl(input)) {
71
+ if (isUrl(input) || input.includes('https://') || input.includes('http')) {
72
72
  return input;
73
73
  }
74
74
  if (input.startsWith('/ipfs/')) {
@@ -1,7 +1,6 @@
1
1
  import { BaseNftApi, HandleNftParams } from '@subwallet/extension-base/koni/api/nft/nft';
2
2
  export declare class RmrkNftApi extends BaseNftApi {
3
3
  constructor(addresses: string[], chain: string);
4
- parseUrl(input: string): string | undefined;
5
4
  private getMetadata;
6
5
  private getAllByAccount;
7
6
  handleNft(address: string, params: HandleNftParams): Promise<void>;
@@ -5,7 +5,7 @@ import { RMRK_VER } from '@subwallet/extension-base/background/KoniTypes';
5
5
  import { BaseNftApi } from '@subwallet/extension-base/koni/api/nft/nft';
6
6
  import { isUrl, reformatAddress } from '@subwallet/extension-base/utils';
7
7
  import fetch from 'cross-fetch';
8
- import { getRandomIpfsGateway, SINGULAR_V1_COLLECTION_ENDPOINT, SINGULAR_V2_COLLECTION_ENDPOINT, SINGULAR_V2_ENDPOINT } from "../config.js";
8
+ import { SINGULAR_V1_COLLECTION_ENDPOINT, SINGULAR_V2_COLLECTION_ENDPOINT, SINGULAR_V2_ENDPOINT } from "../config.js";
9
9
  var RMRK_SOURCE;
10
10
  (function (RMRK_SOURCE) {
11
11
  RMRK_SOURCE["BIRD_KANARIA"] = "bird_kanaria";
@@ -18,18 +18,23 @@ export class RmrkNftApi extends BaseNftApi {
18
18
  constructor(addresses, chain) {
19
19
  super(chain, null, addresses);
20
20
  }
21
- parseUrl(input) {
22
- if (!input || input.length === 0) {
23
- return undefined;
24
- }
25
- if (isUrl(input) || input.includes('https://') || input.includes('http')) {
26
- return input;
27
- }
28
- if (!input.includes('ipfs://ipfs/')) {
29
- return getRandomIpfsGateway() + input;
30
- }
31
- return getRandomIpfsGateway() + input.split('ipfs://ipfs/')[1];
32
- }
21
+
22
+ // override parseUrl (input: string): string | undefined {
23
+ // if (!input || input.length === 0) {
24
+ // return undefined;
25
+ // }
26
+ //
27
+ // if (isUrl(input) || input.includes('https://') || input.includes('http')) {
28
+ // return input;
29
+ // }
30
+ //
31
+ // if (!input.includes('ipfs://ipfs/')) {
32
+ // return getRandomIpfsGateway() + input;
33
+ // }
34
+ //
35
+ // return getRandomIpfsGateway() + input.split('ipfs://ipfs/')[1];
36
+ // }
37
+
33
38
  async getMetadata(metadataUrl) {
34
39
  let url = metadataUrl;
35
40
  if (!isUrl(metadataUrl)) {
@@ -69,53 +74,57 @@ export class RmrkNftApi extends BaseNftApi {
69
74
  }));
70
75
  const nfts = [];
71
76
  await Promise.all(data.map(async item => {
72
- const primaryResource = item.primaryResource ? item.primaryResource : null;
73
- const metadataUri = primaryResource && primaryResource.metadata ? primaryResource.metadata : item.metadata;
74
- const nftMetadata = await this.getMetadata(metadataUri);
75
- if (item.source === RMRK_SOURCE.BIRD_KANARIA) {
76
- nfts.push({
77
- ...item,
78
- metadata: nftMetadata,
79
- owner: account
80
- });
81
- } else if (item.source === RMRK_SOURCE.KANARIA) {
82
- nfts.push({
83
- ...item,
84
- metadata: {
85
- ...nftMetadata,
86
- image: this.parseUrl(nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.image)
87
- },
88
- owner: account
89
- });
90
- } else if (item.source === RMRK_SOURCE.SINGULAR_V1) {
91
- nfts.push({
92
- ...item,
93
- metadata: {
94
- description: nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.description,
95
- name: nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.name,
96
- attributes: nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.attributes,
97
- animation_url: this.parseUrl(nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.animation_url),
98
- image: this.parseUrl(nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.image)
99
- },
100
- owner: account
101
- });
102
- } else if (item.source === RMRK_SOURCE.SINGULAR_V2) {
103
- const id = item.id;
104
- if (!id.toLowerCase().includes(KANBIRD_KEYWORD)) {
105
- // excludes kanaria bird, already handled above
77
+ try {
78
+ const primaryResource = item.primaryResource ? item.primaryResource : null;
79
+ const metadataUri = primaryResource && primaryResource.metadata ? primaryResource.metadata : item.metadata;
80
+ const nftMetadata = await this.getMetadata(metadataUri);
81
+ if (item.source === RMRK_SOURCE.BIRD_KANARIA) {
82
+ nfts.push({
83
+ ...item,
84
+ metadata: nftMetadata,
85
+ owner: account
86
+ });
87
+ } else if (item.source === RMRK_SOURCE.KANARIA) {
88
+ nfts.push({
89
+ ...item,
90
+ metadata: {
91
+ ...nftMetadata,
92
+ image: this.parseUrl(nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.image)
93
+ },
94
+ owner: account
95
+ });
96
+ } else if (item.source === RMRK_SOURCE.SINGULAR_V1) {
106
97
  nfts.push({
107
98
  ...item,
108
99
  metadata: {
109
100
  description: nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.description,
110
101
  name: nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.name,
111
102
  attributes: nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.attributes,
112
- properties: nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.properties,
113
103
  animation_url: this.parseUrl(nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.animation_url),
114
- image: this.parseUrl(nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.mediaUri)
104
+ image: this.parseUrl(nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.image)
115
105
  },
116
106
  owner: account
117
107
  });
108
+ } else if (item.source === RMRK_SOURCE.SINGULAR_V2) {
109
+ const id = item.id;
110
+ if (!id.toLowerCase().includes(KANBIRD_KEYWORD)) {
111
+ // excludes kanaria bird, already handled above
112
+ nfts.push({
113
+ ...item,
114
+ metadata: {
115
+ description: nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.description,
116
+ name: nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.name,
117
+ attributes: nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.attributes,
118
+ properties: nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.properties,
119
+ animation_url: this.parseUrl(nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.animation_url),
120
+ image: this.parseUrl(nftMetadata === null || nftMetadata === void 0 ? void 0 : nftMetadata.mediaUri)
121
+ },
122
+ owner: account
123
+ });
124
+ }
118
125
  }
126
+ } catch (e) {
127
+ console.log('error fetching RMRK NFT', e);
119
128
  }
120
129
  }));
121
130
  return nfts;
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "./cjs/detectPackage.js"
18
18
  ],
19
19
  "type": "module",
20
- "version": "1.1.3-0",
20
+ "version": "1.1.4-0",
21
21
  "main": "./cjs/index.js",
22
22
  "module": "./index.js",
23
23
  "types": "./index.d.ts",
@@ -1174,10 +1174,10 @@
1174
1174
  "@sora-substrate/type-definitions": "^1.17.7",
1175
1175
  "@substrate/connect": "^0.7.26",
1176
1176
  "@subwallet/chain-list": "^0.2.7",
1177
- "@subwallet/extension-base": "^1.1.3-0",
1178
- "@subwallet/extension-chains": "^1.1.3-0",
1179
- "@subwallet/extension-dapp": "^1.1.3-0",
1180
- "@subwallet/extension-inject": "^1.1.3-0",
1177
+ "@subwallet/extension-base": "^1.1.4-0",
1178
+ "@subwallet/extension-chains": "^1.1.4-0",
1179
+ "@subwallet/extension-dapp": "^1.1.4-0",
1180
+ "@subwallet/extension-inject": "^1.1.4-0",
1181
1181
  "@subwallet/keyring": "^0.0.10",
1182
1182
  "@subwallet/ui-keyring": "^0.0.10",
1183
1183
  "@walletconnect/sign-client": "^2.8.4",
package/packageInfo.js CHANGED
@@ -7,5 +7,5 @@ export const packageInfo = {
7
7
  name: '@subwallet/extension-base',
8
8
  path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto',
9
9
  type: 'esm',
10
- version: '1.1.3-0'
10
+ version: '1.1.4-0'
11
11
  };
@@ -697,6 +697,15 @@ export class ChainService {
697
697
  async initAssetRegistry(deprecatedCustomChainMap) {
698
698
  const storedAssetRegistry = await this.dbService.getAllAssetStore();
699
699
  const latestAssetRegistry = await this.fetchLatestData(_CHAIN_ASSET_SRC, ChainAssetMap);
700
+
701
+ // Fill out zk assets from latestAssetRegistry if not supported
702
+ if (!MODULE_SUPPORT.MANTA_ZK) {
703
+ Object.keys(latestAssetRegistry).forEach(slug => {
704
+ if (_isMantaZkAsset(latestAssetRegistry[slug])) {
705
+ delete latestAssetRegistry[slug];
706
+ }
707
+ });
708
+ }
700
709
  if (storedAssetRegistry.length === 0) {
701
710
  this.dataMap.assetRegistry = latestAssetRegistry;
702
711
  } else {