@subwallet/extension-base 1.0.2-2 → 1.0.3-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.
- package/background/KoniTypes.d.ts +56 -40
- package/background/KoniTypes.js +11 -9
- package/background/errors/TransactionError.js +25 -1
- package/background/types.d.ts +10 -5
- package/cjs/background/KoniTypes.js +11 -9
- package/cjs/background/errors/TransactionError.js +24 -0
- package/cjs/constants/index.js +8 -26
- package/cjs/koni/api/dotsama/balance.js +49 -224
- package/cjs/koni/api/dotsama/transfer.js +34 -39
- package/cjs/koni/api/nft/acala_nft/index.js +7 -7
- package/cjs/koni/api/nft/bit.country/index.js +7 -6
- package/cjs/koni/api/nft/evm_nft/index.js +8 -3
- package/cjs/koni/api/nft/index.js +3 -6
- package/cjs/koni/api/nft/karura_nft/index.js +7 -6
- package/cjs/koni/api/nft/rmrk_nft/index.js +11 -1
- package/cjs/koni/api/nft/statemine_nft/index.js +7 -6
- package/cjs/koni/api/nft/unique_nft/index.js +5 -1
- package/cjs/koni/api/nft/wasm_nft/index.js +170 -111
- package/cjs/koni/api/nft/wasm_nft/utils.js +11 -7
- package/cjs/koni/api/staking/bonding/amplitude.js +13 -9
- package/cjs/koni/api/staking/bonding/astar.js +15 -13
- package/cjs/koni/api/staking/bonding/index.js +22 -10
- package/cjs/koni/api/staking/bonding/paraChain.js +85 -2
- package/cjs/koni/api/staking/bonding/relayChain.js +122 -16
- package/cjs/koni/api/staking/bonding/utils.js +27 -8
- package/cjs/koni/api/tokens/wasm/index.js +5 -4
- package/cjs/koni/api/tokens/wasm/utils.js +63 -0
- package/cjs/koni/api/xcm/polkadotXcm.js +1 -1
- package/cjs/koni/api/xcm/utils.js +18 -13
- package/cjs/koni/api/xcm/xTokens.js +1 -1
- package/cjs/koni/api/xcm/xcmPallet.js +9 -6
- package/cjs/koni/background/cron.js +171 -61
- package/cjs/koni/background/handlers/Extension.js +391 -207
- package/cjs/koni/background/handlers/State.js +49 -34
- package/cjs/koni/background/handlers/Tabs.js +50 -17
- package/cjs/koni/background/subscription.js +53 -28
- package/cjs/packageInfo.js +1 -1
- package/cjs/services/base/types.js +20 -0
- package/cjs/services/chain-service/handler/SubstrateChainHandler.js +13 -8
- package/cjs/services/chain-service/index.js +73 -49
- package/cjs/services/event-service/index.js +5 -1
- package/cjs/services/event-service/types.js +11 -1
- package/cjs/services/history-service/index.js +101 -50
- package/cjs/services/history-service/subsquid-multi-chain-history.js +13 -10
- package/cjs/services/keyring-service/index.js +11 -13
- package/cjs/services/migration-service/scripts/MigrateImportedToken.js +2 -1
- package/cjs/services/price-service/coingecko.js +0 -1
- package/cjs/services/price-service/index.js +71 -24
- package/cjs/services/request-service/handler/AuthRequestHandler.js +13 -7
- package/cjs/services/request-service/handler/EvmRequestHandler.js +8 -12
- package/cjs/services/request-service/index.js +14 -5
- package/cjs/services/storage-service/DatabaseService.js +66 -34
- package/cjs/services/storage-service/db-stores/Nft.js +7 -15
- package/cjs/services/storage-service/db-stores/Transaction.js +6 -10
- package/cjs/services/transaction-service/event-parser/index.js +20 -48
- package/cjs/services/transaction-service/index.js +104 -48
- package/cjs/services/transaction-service/utils.js +10 -8
- package/cjs/utils/address.js +10 -1
- package/cjs/utils/index.js +9 -15
- package/cjs/utils/promise.js +26 -0
- package/constants/index.d.ts +7 -13
- package/constants/index.js +7 -13
- package/koni/api/dotsama/balance.d.ts +0 -1
- package/koni/api/dotsama/balance.js +22 -197
- package/koni/api/dotsama/transfer.js +11 -16
- package/koni/api/nft/acala_nft/index.js +7 -7
- package/koni/api/nft/bit.country/index.js +7 -6
- package/koni/api/nft/evm_nft/index.js +7 -3
- package/koni/api/nft/index.d.ts +1 -2
- package/koni/api/nft/index.js +3 -6
- package/koni/api/nft/karura_nft/index.js +7 -6
- package/koni/api/nft/nft.d.ts +1 -0
- package/koni/api/nft/rmrk_nft/index.js +11 -1
- package/koni/api/nft/statemine_nft/index.js +7 -6
- package/koni/api/nft/unique_nft/index.js +5 -1
- package/koni/api/nft/wasm_nft/index.d.ts +0 -2
- package/koni/api/nft/wasm_nft/index.js +168 -109
- package/koni/api/nft/wasm_nft/utils.d.ts +7 -5
- package/koni/api/nft/wasm_nft/utils.js +7 -5
- package/koni/api/staking/bonding/amplitude.d.ts +0 -1
- package/koni/api/staking/bonding/amplitude.js +15 -10
- package/koni/api/staking/bonding/astar.js +8 -6
- package/koni/api/staking/bonding/index.d.ts +4 -1
- package/koni/api/staking/bonding/index.js +23 -13
- package/koni/api/staking/bonding/paraChain.d.ts +3 -0
- package/koni/api/staking/bonding/paraChain.js +86 -5
- package/koni/api/staking/bonding/relayChain.d.ts +5 -1
- package/koni/api/staking/bonding/relayChain.js +121 -18
- package/koni/api/staking/bonding/utils.d.ts +3 -2
- package/koni/api/staking/bonding/utils.js +27 -9
- package/koni/api/tokens/wasm/index.js +5 -4
- package/koni/api/tokens/wasm/utils.d.ts +6 -0
- package/koni/api/tokens/wasm/utils.js +54 -0
- package/koni/api/xcm/polkadotXcm.js +2 -2
- package/koni/api/xcm/utils.d.ts +5 -6
- package/koni/api/xcm/utils.js +15 -10
- package/koni/api/xcm/xTokens.js +2 -2
- package/koni/api/xcm/xcmPallet.js +10 -9
- package/koni/background/cron.d.ts +6 -1
- package/koni/background/cron.js +172 -62
- package/koni/background/handlers/Extension.d.ts +9 -3
- package/koni/background/handlers/Extension.js +306 -126
- package/koni/background/handlers/State.d.ts +5 -6
- package/koni/background/handlers/State.js +51 -34
- package/koni/background/handlers/Tabs.js +50 -17
- package/koni/background/subscription.d.ts +2 -0
- package/koni/background/subscription.js +51 -29
- package/package.json +29 -14
- package/packageInfo.js +1 -1
- package/services/base/types.d.ts +34 -0
- package/services/base/types.js +15 -0
- package/services/chain-service/handler/SubstrateChainHandler.js +14 -9
- package/services/chain-service/helper/psp22_abi.json +1041 -881
- package/services/chain-service/helper/psp34_abi.json +2963 -1807
- package/services/chain-service/index.d.ts +5 -2
- package/services/chain-service/index.js +68 -45
- package/services/chain-service/types.d.ts +1 -0
- package/services/event-service/index.js +5 -1
- package/services/event-service/types.d.ts +5 -9
- package/services/event-service/types.js +4 -1
- package/services/history-service/index.d.ts +28 -7
- package/services/history-service/index.js +101 -50
- package/services/history-service/subsquid-multi-chain-history.js +16 -12
- package/services/keyring-service/index.d.ts +4 -2
- package/services/keyring-service/index.js +11 -13
- package/services/migration-service/scripts/MigrateImportedToken.js +2 -1
- package/services/price-service/coingecko.js +0 -1
- package/services/price-service/index.d.ts +22 -1
- package/services/price-service/index.js +71 -24
- package/services/request-service/handler/AuthRequestHandler.d.ts +3 -1
- package/services/request-service/handler/AuthRequestHandler.js +13 -7
- package/services/request-service/handler/EvmRequestHandler.js +8 -12
- package/services/request-service/index.d.ts +3 -1
- package/services/request-service/index.js +14 -5
- package/services/storage-service/DatabaseService.d.ts +2 -0
- package/services/storage-service/DatabaseService.js +66 -34
- package/services/storage-service/db-stores/Nft.d.ts +2 -2
- package/services/storage-service/db-stores/Nft.js +7 -14
- package/services/storage-service/db-stores/Transaction.d.ts +2 -0
- package/services/storage-service/db-stores/Transaction.js +6 -10
- package/services/transaction-service/event-parser/index.js +21 -49
- package/services/transaction-service/index.d.ts +2 -0
- package/services/transaction-service/index.js +86 -32
- package/services/transaction-service/types.d.ts +2 -0
- package/services/transaction-service/utils.js +10 -8
- package/utils/address.d.ts +3 -0
- package/utils/address.js +8 -1
- package/utils/index.d.ts +2 -2
- package/utils/index.js +7 -13
- package/utils/promise.d.ts +6 -0
- package/utils/promise.js +20 -0
|
@@ -82,6 +82,7 @@ class EvmNftApi extends _nft.BaseNftApi {
|
|
|
82
82
|
const contract = new this.evmApi.api.eth.Contract(_helper._ERC721_ABI, smartContract);
|
|
83
83
|
let ownItem = false;
|
|
84
84
|
let collectionImage;
|
|
85
|
+
const nftOwnerMap = {};
|
|
85
86
|
await Promise.all(this.addresses.map(async address => {
|
|
86
87
|
if (!(0, _utilCrypto.isEthereumAddress)(address)) {
|
|
87
88
|
return;
|
|
@@ -91,6 +92,7 @@ class EvmNftApi extends _nft.BaseNftApi {
|
|
|
91
92
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
|
|
92
93
|
const balance = await contract.methods.balanceOf(address).call();
|
|
93
94
|
if (Number(balance) === 0) {
|
|
95
|
+
nftParams.cleanUpNfts(this.chain, address, [smartContract], []);
|
|
94
96
|
return;
|
|
95
97
|
}
|
|
96
98
|
const itemIndexes = [];
|
|
@@ -132,8 +134,9 @@ class EvmNftApi extends _nft.BaseNftApi {
|
|
|
132
134
|
}
|
|
133
135
|
}
|
|
134
136
|
}));
|
|
137
|
+
nftOwnerMap[address] = nftIds;
|
|
135
138
|
} catch (e) {
|
|
136
|
-
console.error('
|
|
139
|
+
console.error('EVM NFT error', e);
|
|
137
140
|
}
|
|
138
141
|
}));
|
|
139
142
|
if (ownItem) {
|
|
@@ -145,10 +148,12 @@ class EvmNftApi extends _nft.BaseNftApi {
|
|
|
145
148
|
originAsset: tokenInfo.slug
|
|
146
149
|
};
|
|
147
150
|
nftParams.updateCollection(this.chain, nftCollection);
|
|
148
|
-
|
|
151
|
+
Object.entries(nftOwnerMap).forEach(_ref => {
|
|
152
|
+
let [owner, nftIds] = _ref;
|
|
153
|
+
nftParams.cleanUpNfts(this.chain, owner, [smartContract], nftIds);
|
|
154
|
+
});
|
|
149
155
|
}
|
|
150
156
|
}
|
|
151
|
-
|
|
152
157
|
async handleNfts(params) {
|
|
153
158
|
if (!this.evmContracts || this.evmContracts.length === 0) {
|
|
154
159
|
return;
|
|
@@ -132,19 +132,16 @@ class NftHandler {
|
|
|
132
132
|
console.error('error setting up nft handlers', e);
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
-
async handleNfts(nftContracts, updateItem, updateCollection) {
|
|
135
|
+
async handleNfts(nftContracts, updateItem, updateCollection, cleanUpNfts) {
|
|
136
136
|
this.setupApi();
|
|
137
137
|
this.setupNftContracts(nftContracts);
|
|
138
138
|
await Promise.all(this.handlers.map(async handler => {
|
|
139
139
|
await handler.fetchNfts({
|
|
140
140
|
updateItem,
|
|
141
|
-
updateCollection
|
|
141
|
+
updateCollection,
|
|
142
|
+
cleanUpNfts
|
|
142
143
|
});
|
|
143
144
|
}));
|
|
144
145
|
}
|
|
145
|
-
parseAssetId(id) {
|
|
146
|
-
const numberId = parseInt(id);
|
|
147
|
-
return numberId.toString();
|
|
148
|
-
}
|
|
149
146
|
}
|
|
150
147
|
exports.NftHandler = NftHandler;
|
|
@@ -90,17 +90,18 @@ class KaruraNftApi extends _nft.BaseNftApi {
|
|
|
90
90
|
const assetIds = await this.getNfts([address]);
|
|
91
91
|
try {
|
|
92
92
|
if (!assetIds || assetIds.length === 0) {
|
|
93
|
+
params.cleanUpNfts(this.chain, address, [], [], true);
|
|
93
94
|
return;
|
|
94
95
|
}
|
|
95
|
-
const
|
|
96
|
+
const collectionIds = [];
|
|
97
|
+
const nftIds = [];
|
|
96
98
|
await Promise.all(assetIds.map(async assetId => {
|
|
97
99
|
const parsedClassId = this.parseTokenId(assetId.classId);
|
|
98
100
|
const parsedTokenId = this.parseTokenId(assetId.tokenId);
|
|
99
|
-
if (
|
|
100
|
-
|
|
101
|
-
} else {
|
|
102
|
-
collectionNftIds[parsedClassId] = [parsedTokenId];
|
|
101
|
+
if (!collectionIds.includes(parsedClassId)) {
|
|
102
|
+
collectionIds.push(parsedClassId);
|
|
103
103
|
}
|
|
104
|
+
nftIds.push(parsedTokenId);
|
|
104
105
|
const [tokenInfo, collectionMeta] = await Promise.all([this.getTokenDetails(assetId), this.getCollectionDetails(parseInt(parsedClassId))]);
|
|
105
106
|
const parsedNft = {
|
|
106
107
|
id: parsedTokenId,
|
|
@@ -122,8 +123,8 @@ class KaruraNftApi extends _nft.BaseNftApi {
|
|
|
122
123
|
};
|
|
123
124
|
params.updateItem(this.chain, parsedNft, address);
|
|
124
125
|
params.updateCollection(this.chain, parsedCollection);
|
|
125
|
-
// params.updateReady(true);
|
|
126
126
|
}));
|
|
127
|
+
params.cleanUpNfts(this.chain, address, collectionIds, nftIds);
|
|
127
128
|
} catch (e) {
|
|
128
129
|
console.error('Failed to fetch karura nft', e);
|
|
129
130
|
}
|
|
@@ -139,6 +139,7 @@ class RmrkNftApi extends _nft.BaseNftApi {
|
|
|
139
139
|
const kusamaAddress = (0, _utils.reformatAddress)(address, 2);
|
|
140
140
|
allNfts = await this.getAllByAccount(kusamaAddress);
|
|
141
141
|
if (allNfts.length <= 0) {
|
|
142
|
+
params.cleanUpNfts(this.chain, address, [], [], true);
|
|
142
143
|
return;
|
|
143
144
|
}
|
|
144
145
|
const collectionInfoUrl = [];
|
|
@@ -238,9 +239,18 @@ class RmrkNftApi extends _nft.BaseNftApi {
|
|
|
238
239
|
image: allCollectionMeta[item.collectionId] ? this.parseUrl(allCollectionMeta[item.collectionId].image) : null,
|
|
239
240
|
chain: this.chain
|
|
240
241
|
};
|
|
242
|
+
const nftIds = [];
|
|
243
|
+
allNfts.forEach(nft => {
|
|
244
|
+
const nftCollectionId = nft === null || nft === void 0 ? void 0 : nft.collectionId;
|
|
245
|
+
if (nftCollectionId === item.collectionId) {
|
|
246
|
+
nftIds.push(nft === null || nft === void 0 ? void 0 : nft.id);
|
|
247
|
+
}
|
|
248
|
+
});
|
|
241
249
|
params.updateCollection(this.chain, parsedCollection);
|
|
242
|
-
// params.updateReady(true);
|
|
243
250
|
});
|
|
251
|
+
const allCollectionIds = allCollections.map(item => item.collectionId);
|
|
252
|
+
const allNftIds = allNfts.map(nft => nft === null || nft === void 0 ? void 0 : nft.id);
|
|
253
|
+
params.cleanUpNfts(this.chain, address, allCollectionIds, allNftIds);
|
|
244
254
|
} catch (e) {
|
|
245
255
|
console.error('Failed to fetch rmrk nft', e);
|
|
246
256
|
}
|
|
@@ -93,17 +93,18 @@ class StatemineNftApi extends _nft.BaseNftApi {
|
|
|
93
93
|
const assetIds = await this.getNfts([address]);
|
|
94
94
|
try {
|
|
95
95
|
if (!assetIds || assetIds.length === 0) {
|
|
96
|
+
params.cleanUpNfts(this.chain, address, [], [], true);
|
|
96
97
|
return;
|
|
97
98
|
}
|
|
98
|
-
const
|
|
99
|
+
const collectionIds = [];
|
|
100
|
+
const nftIds = [];
|
|
99
101
|
await Promise.all(assetIds.map(async assetId => {
|
|
100
102
|
const parsedClassId = this.parseTokenId(assetId.classId);
|
|
101
103
|
const parsedTokenId = this.parseTokenId(assetId.tokenId);
|
|
102
|
-
if (
|
|
103
|
-
|
|
104
|
-
} else {
|
|
105
|
-
collectionNftIds[parsedClassId] = [parsedTokenId];
|
|
104
|
+
if (!collectionIds.includes(parsedClassId)) {
|
|
105
|
+
collectionIds.push(parsedClassId);
|
|
106
106
|
}
|
|
107
|
+
nftIds.push(parsedTokenId);
|
|
107
108
|
const [tokenInfo, collectionMeta] = await Promise.all([this.getTokenDetails(assetId), this.getCollectionDetail(parseInt(parsedClassId))]);
|
|
108
109
|
const parsedNft = {
|
|
109
110
|
id: parsedTokenId,
|
|
@@ -122,8 +123,8 @@ class StatemineNftApi extends _nft.BaseNftApi {
|
|
|
122
123
|
image: collectionMeta && collectionMeta.image ? this.parseUrl(collectionMeta === null || collectionMeta === void 0 ? void 0 : collectionMeta.image) : undefined
|
|
123
124
|
};
|
|
124
125
|
params.updateCollection(this.chain, parsedCollection);
|
|
125
|
-
// params.updateReady(true);
|
|
126
126
|
}));
|
|
127
|
+
params.cleanUpNfts(this.chain, address, collectionIds, nftIds);
|
|
127
128
|
} catch (e) {
|
|
128
129
|
console.error('Failed to fetch statemine nft', e);
|
|
129
130
|
}
|
|
@@ -141,6 +141,8 @@ class UniqueNftApi extends _nft.BaseNftApi {
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
}));
|
|
144
|
+
const collectionIds = [];
|
|
145
|
+
let allNftIds = [];
|
|
144
146
|
await Promise.all(allCollectionId.map(async collectionId => {
|
|
145
147
|
const collectionIdStr = collectionId.toString();
|
|
146
148
|
|
|
@@ -148,6 +150,8 @@ class UniqueNftApi extends _nft.BaseNftApi {
|
|
|
148
150
|
const collection = (await this.substrateApi.api.query.nft.collectionById(collectionId)).toJSON();
|
|
149
151
|
collectionMap[collectionIdStr] = collection;
|
|
150
152
|
const nftIds = Object.entries(nftMap).filter(item => item[1] === collectionId).map(item => item[0]);
|
|
153
|
+
collectionIds.push(collectionIdStr);
|
|
154
|
+
allNftIds = allNftIds.concat(nftIds);
|
|
151
155
|
const parsedCollection = {
|
|
152
156
|
collectionId: collectionIdStr,
|
|
153
157
|
chain: this.chain
|
|
@@ -174,10 +178,10 @@ class UniqueNftApi extends _nft.BaseNftApi {
|
|
|
174
178
|
}
|
|
175
179
|
params.updateItem(this.chain, parsedItem, address);
|
|
176
180
|
params.updateCollection(this.chain, parsedCollection);
|
|
177
|
-
// params.updateReady(true);
|
|
178
181
|
}
|
|
179
182
|
}));
|
|
180
183
|
}));
|
|
184
|
+
params.cleanUpNfts(this.chain, address, collectionIds, allNftIds);
|
|
181
185
|
} catch (e) {
|
|
182
186
|
console.error('Failed to fetch unique nft', e);
|
|
183
187
|
}
|
|
@@ -9,12 +9,44 @@ var _types = require("@subwallet/chain-list/types");
|
|
|
9
9
|
var _nft = require("@subwallet/extension-base/koni/api/nft/nft");
|
|
10
10
|
var _utils = require("@subwallet/extension-base/koni/api/nft/wasm_nft/utils");
|
|
11
11
|
var _wasm = require("@subwallet/extension-base/koni/api/tokens/wasm");
|
|
12
|
-
var _utils2 = require("@subwallet/extension-base/
|
|
12
|
+
var _utils2 = require("@subwallet/extension-base/koni/api/tokens/wasm/utils");
|
|
13
|
+
var _utils3 = require("@subwallet/extension-base/services/chain-service/utils");
|
|
14
|
+
var _axios = _interopRequireDefault(require("axios"));
|
|
13
15
|
var _crossFetch = _interopRequireDefault(require("cross-fetch"));
|
|
14
16
|
var _utilCrypto = require("@polkadot/util-crypto");
|
|
15
17
|
// Copyright 2019-2022 @subwallet/extension-koni authors & contributors
|
|
16
18
|
// SPDX-License-Identifier: Apache-2.0
|
|
17
19
|
|
|
20
|
+
// interface CollectionAttributes {
|
|
21
|
+
// storedOnChain: boolean,
|
|
22
|
+
// attributeList: string[] // list of attribute names
|
|
23
|
+
// }
|
|
24
|
+
|
|
25
|
+
async function isArtZeroFeaturedCollection(networkKey, contractAddress) {
|
|
26
|
+
const timeout = new Promise(resolve => {
|
|
27
|
+
const id = setTimeout(() => {
|
|
28
|
+
clearTimeout(id);
|
|
29
|
+
resolve(null);
|
|
30
|
+
}, 3000);
|
|
31
|
+
});
|
|
32
|
+
const urlencoded = new URLSearchParams();
|
|
33
|
+
urlencoded.append('collection_address', contractAddress);
|
|
34
|
+
const collectionInfoPromise = new Promise(function (resolve) {
|
|
35
|
+
(0, _crossFetch.default)(`${networkKey === 'alephTest' ? _utils.ART_ZERO_TESTNET_COLLECTION_API : _utils.ART_ZERO_COLLECTION_API}`, {
|
|
36
|
+
method: 'POST',
|
|
37
|
+
headers: {
|
|
38
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
39
|
+
},
|
|
40
|
+
body: urlencoded
|
|
41
|
+
}).then(resp => {
|
|
42
|
+
resolve(resp.json());
|
|
43
|
+
}).catch(console.error);
|
|
44
|
+
});
|
|
45
|
+
const collectionInfo = await Promise.race([timeout, collectionInfoPromise]);
|
|
46
|
+
|
|
47
|
+
// @ts-ignore
|
|
48
|
+
return collectionInfo !== null && (collectionInfo === null || collectionInfo === void 0 ? void 0 : collectionInfo.status) !== 'FAILED';
|
|
49
|
+
}
|
|
18
50
|
class WasmNftApi extends _nft.BaseNftApi {
|
|
19
51
|
wasmContracts = [];
|
|
20
52
|
constructor(api, addresses, chain) {
|
|
@@ -27,31 +59,40 @@ class WasmNftApi extends _nft.BaseNftApi {
|
|
|
27
59
|
if (!tokenUri || tokenUri.length === 0) {
|
|
28
60
|
return undefined;
|
|
29
61
|
}
|
|
62
|
+
if (tokenUri.startsWith('/ipfs/')) {
|
|
63
|
+
return tokenUri;
|
|
64
|
+
}
|
|
65
|
+
if (tokenUri.startsWith('ipfs://')) {
|
|
66
|
+
return `/ipfs/${tokenUri.split('ipfs://')[1]}`;
|
|
67
|
+
}
|
|
30
68
|
if (!tokenUri.includes('ipfs://') && !tokenUri.includes('ipfs://ipfs/')) {
|
|
31
|
-
return
|
|
69
|
+
return `/ipfs/${tokenUri}`;
|
|
32
70
|
}
|
|
33
71
|
if (tokenUri.includes('ipfs://ipfs/')) {
|
|
34
|
-
return
|
|
72
|
+
return `/ipfs/${tokenUri.split('ipfs://ipfs/')[1]}`;
|
|
35
73
|
}
|
|
36
74
|
return tokenUri;
|
|
37
75
|
}
|
|
38
|
-
parseFeaturedNftImage(tokenUri) {
|
|
76
|
+
async parseFeaturedNftImage(tokenUri) {
|
|
39
77
|
const parsedTokenUri = this.parseFeaturedTokenUri(tokenUri);
|
|
40
78
|
if (!parsedTokenUri) {
|
|
41
79
|
return undefined;
|
|
42
80
|
}
|
|
43
|
-
|
|
81
|
+
const nftItemImageSrc = `${this.chain === 'alephTest' ? _utils.ART_ZERO_TESTNET_IMAGE_API : _utils.ART_ZERO_IMAGE_API}?input=${parsedTokenUri}&size=500`;
|
|
82
|
+
const collectionImageUrl = await (0, _axios.default)(nftItemImageSrc, {
|
|
83
|
+
method: 'GET'
|
|
84
|
+
});
|
|
85
|
+
return collectionImageUrl.data;
|
|
44
86
|
}
|
|
45
87
|
async parseFeaturedCollectionImage(smartContract) {
|
|
46
|
-
const
|
|
88
|
+
const urlencoded = new URLSearchParams();
|
|
89
|
+
urlencoded.append('collection_address', smartContract);
|
|
90
|
+
const resp = await (0, _crossFetch.default)(this.chain === 'alephTest' ? _utils.ART_ZERO_TESTNET_COLLECTION_API : _utils.ART_ZERO_COLLECTION_API, {
|
|
47
91
|
method: 'POST',
|
|
48
92
|
headers: {
|
|
49
|
-
|
|
50
|
-
'Content-Type': 'application/json'
|
|
93
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
51
94
|
},
|
|
52
|
-
body:
|
|
53
|
-
collection_address: smartContract
|
|
54
|
-
})
|
|
95
|
+
body: urlencoded
|
|
55
96
|
});
|
|
56
97
|
const result = resp && resp.ok && (await resp.json());
|
|
57
98
|
if (!result) {
|
|
@@ -65,82 +106,91 @@ class WasmNftApi extends _nft.BaseNftApi {
|
|
|
65
106
|
if (!parsedCollectionImage) {
|
|
66
107
|
return;
|
|
67
108
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const _onChainAttributeCount = await contractPromise.query['psp34Traits::getAttributeCount'](this.addresses[0], {
|
|
72
|
-
gasLimit: -1
|
|
109
|
+
const collectionImageSrc = `${this.chain === 'alephTest' ? _utils.ART_ZERO_TESTNET_IMAGE_API : _utils.ART_ZERO_IMAGE_API}?input=${parsedCollectionImage}&size=500`;
|
|
110
|
+
const collectionImageUrl = await (0, _axios.default)(collectionImageSrc, {
|
|
111
|
+
method: 'GET'
|
|
73
112
|
});
|
|
74
|
-
|
|
75
|
-
if (parseInt(onChainAttributeCount) === 0) {
|
|
76
|
-
return {
|
|
77
|
-
storedOnChain: false,
|
|
78
|
-
attributeList: []
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
const attributeList = [];
|
|
82
|
-
const attributeIndexes = [];
|
|
83
|
-
for (let i = 0; i < parseInt(onChainAttributeCount); i++) {
|
|
84
|
-
attributeIndexes.push(i);
|
|
85
|
-
}
|
|
86
|
-
await Promise.all(attributeIndexes.map(async i => {
|
|
87
|
-
const _attributeByIndex = await contractPromise.query['psp34Traits::getAttributeName'](this.addresses[0], {
|
|
88
|
-
gasLimit: -1
|
|
89
|
-
}, i);
|
|
90
|
-
if (_attributeByIndex.output) {
|
|
91
|
-
const attributeName = _attributeByIndex.output.toString();
|
|
92
|
-
if (attributeName !== '') {
|
|
93
|
-
attributeList.push(attributeName);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}));
|
|
97
|
-
return {
|
|
98
|
-
storedOnChain: true,
|
|
99
|
-
attributeList
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
async processOnChainMetadata(contractPromise, address, tokenIdObj, collectionAttributes, isFeatured) {
|
|
103
|
-
const nftItem = {
|
|
104
|
-
chain: '',
|
|
105
|
-
collectionId: '',
|
|
106
|
-
id: '',
|
|
107
|
-
owner: ''
|
|
108
|
-
};
|
|
109
|
-
const _attributeValues = await contractPromise.query['psp34Traits::getAttributes'](address, {
|
|
110
|
-
gasLimit: -1
|
|
111
|
-
}, tokenIdObj, collectionAttributes);
|
|
112
|
-
if (_attributeValues.output) {
|
|
113
|
-
const attributeValues = _attributeValues.output.toHuman();
|
|
114
|
-
const attributeDict = {};
|
|
115
|
-
for (let i = 0; i < collectionAttributes.length; i++) {
|
|
116
|
-
const attributeName = collectionAttributes[i];
|
|
117
|
-
const attributeValue = attributeValues[i] ? attributeValues[i] : '';
|
|
118
|
-
if (attributeName.toLowerCase() === 'nft_name') {
|
|
119
|
-
nftItem.name = attributeValue;
|
|
120
|
-
} else if (attributeName.toLowerCase() === 'description') {
|
|
121
|
-
nftItem.description = attributeValue;
|
|
122
|
-
} else if (attributeName.toLowerCase() === 'avatar') {
|
|
123
|
-
if (isFeatured) {
|
|
124
|
-
nftItem.image = this.parseFeaturedNftImage(attributeValue);
|
|
125
|
-
} else {
|
|
126
|
-
nftItem.image = this.parseUrl(attributeValue);
|
|
127
|
-
}
|
|
128
|
-
} else {
|
|
129
|
-
if (attributeValue !== '') {
|
|
130
|
-
attributeDict[attributeName] = {
|
|
131
|
-
value: attributeValue
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
nftItem.properties = attributeDict;
|
|
137
|
-
}
|
|
138
|
-
if (isFeatured) {
|
|
139
|
-
nftItem.externalUrl = _utils.ART_ZERO_EXTERNAL_URL;
|
|
140
|
-
}
|
|
141
|
-
return nftItem;
|
|
113
|
+
return collectionImageUrl.data;
|
|
142
114
|
}
|
|
115
|
+
|
|
116
|
+
// private async getCollectionAttributes (contractPromise: ContractPromise): Promise<CollectionAttributes> {
|
|
117
|
+
// const _onChainAttributeCount = await contractPromise.query['psp34Traits::getAttributeCount'](this.addresses[0], { gasLimit: getDefaultWeightV2(this.substrateApi?.api as ApiPromise) });
|
|
118
|
+
// const onChainAttributeCount = _onChainAttributeCount.output ? _onChainAttributeCount.output.toString() : '0';
|
|
119
|
+
//
|
|
120
|
+
// if (parseInt(onChainAttributeCount) === 0) {
|
|
121
|
+
// return {
|
|
122
|
+
// storedOnChain: false,
|
|
123
|
+
// attributeList: []
|
|
124
|
+
// };
|
|
125
|
+
// }
|
|
126
|
+
//
|
|
127
|
+
// const attributeList: string[] = [];
|
|
128
|
+
// const attributeIndexes: number[] = [];
|
|
129
|
+
//
|
|
130
|
+
// for (let i = 0; i < parseInt(onChainAttributeCount); i++) {
|
|
131
|
+
// attributeIndexes.push(i);
|
|
132
|
+
// }
|
|
133
|
+
//
|
|
134
|
+
// await Promise.all(attributeIndexes.map(async (i) => {
|
|
135
|
+
// const _attributeByIndex = await contractPromise.query['psp34Traits::getAttributeName'](this.addresses[0], { gasLimit: getDefaultWeightV2(this.substrateApi?.api as ApiPromise) }, i);
|
|
136
|
+
//
|
|
137
|
+
// if (_attributeByIndex.output) {
|
|
138
|
+
// const attributeName = _attributeByIndex.output.toString();
|
|
139
|
+
//
|
|
140
|
+
// if (attributeName !== '') {
|
|
141
|
+
// attributeList.push(attributeName);
|
|
142
|
+
// }
|
|
143
|
+
// }
|
|
144
|
+
// }));
|
|
145
|
+
//
|
|
146
|
+
// return {
|
|
147
|
+
// storedOnChain: true,
|
|
148
|
+
// attributeList
|
|
149
|
+
// };
|
|
150
|
+
// }
|
|
151
|
+
|
|
152
|
+
// private async processOnChainMetadata (contractPromise: ContractPromise, address: string, tokenIdObj: Record<string, string>, collectionAttributes: string[], isFeatured: boolean): Promise<NftItem> {
|
|
153
|
+
// const nftItem: NftItem = { chain: '', collectionId: '', id: '', owner: '' };
|
|
154
|
+
// const _attributeValues = await contractPromise.query['psp34Traits::getAttributes'](address, { gasLimit: getDefaultWeightV2(this.substrateApi?.api as ApiPromise) }, tokenIdObj, collectionAttributes);
|
|
155
|
+
//
|
|
156
|
+
// if (_attributeValues.output) {
|
|
157
|
+
// const attributeValues = _attributeValues.output.toHuman() as string[];
|
|
158
|
+
//
|
|
159
|
+
// const attributeDict: Record<string, any> = {};
|
|
160
|
+
//
|
|
161
|
+
// for (let i = 0; i < collectionAttributes.length; i++) {
|
|
162
|
+
// const attributeName = collectionAttributes[i];
|
|
163
|
+
// const attributeValue = attributeValues[i] ? attributeValues[i] : '';
|
|
164
|
+
//
|
|
165
|
+
// if (attributeName.toLowerCase() === 'nft_name') {
|
|
166
|
+
// nftItem.name = attributeValue;
|
|
167
|
+
// } else if (attributeName.toLowerCase() === 'description') {
|
|
168
|
+
// nftItem.description = attributeValue;
|
|
169
|
+
// } else if (attributeName.toLowerCase() === 'avatar') {
|
|
170
|
+
// if (isFeatured) {
|
|
171
|
+
// nftItem.image = await this.parseFeaturedNftImage(attributeValue);
|
|
172
|
+
// } else {
|
|
173
|
+
// nftItem.image = this.parseUrl(attributeValue);
|
|
174
|
+
// }
|
|
175
|
+
// } else {
|
|
176
|
+
// if (attributeValue !== '') {
|
|
177
|
+
// attributeDict[attributeName] = { value: attributeValue };
|
|
178
|
+
// }
|
|
179
|
+
// }
|
|
180
|
+
// }
|
|
181
|
+
//
|
|
182
|
+
// nftItem.properties = attributeDict;
|
|
183
|
+
// }
|
|
184
|
+
//
|
|
185
|
+
// if (isFeatured) {
|
|
186
|
+
// nftItem.externalUrl = ART_ZERO_EXTERNAL_URL;
|
|
187
|
+
// }
|
|
188
|
+
//
|
|
189
|
+
// return nftItem;
|
|
190
|
+
// }
|
|
191
|
+
|
|
143
192
|
async processOffChainMetadata(contractPromise, address, tokenId, isFeatured) {
|
|
193
|
+
var _this$substrateApi;
|
|
144
194
|
const nftItem = {
|
|
145
195
|
chain: '',
|
|
146
196
|
collectionId: '',
|
|
@@ -149,19 +199,23 @@ class WasmNftApi extends _nft.BaseNftApi {
|
|
|
149
199
|
name: tokenId
|
|
150
200
|
};
|
|
151
201
|
const _tokenUri = await contractPromise.query['psp34Traits::tokenUri'](address, {
|
|
152
|
-
gasLimit:
|
|
202
|
+
gasLimit: (0, _utils2.getDefaultWeightV2)((_this$substrateApi = this.substrateApi) === null || _this$substrateApi === void 0 ? void 0 : _this$substrateApi.api)
|
|
153
203
|
}, tokenId);
|
|
154
204
|
if (_tokenUri.output) {
|
|
155
205
|
let itemDetail = false;
|
|
156
|
-
|
|
206
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
207
|
+
const _tokenUriObj = _tokenUri.output.toJSON();
|
|
208
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
209
|
+
const tokenUri = _tokenUriObj.Ok || _tokenUriObj.ok;
|
|
157
210
|
if (isFeatured) {
|
|
158
211
|
const parsedTokenUri = this.parseFeaturedTokenUri(tokenUri);
|
|
159
212
|
if (parsedTokenUri) {
|
|
160
|
-
const resp = await (0, _crossFetch.default)(`${_utils.ART_ZERO_IPFS_API}?input=${parsedTokenUri}`);
|
|
213
|
+
const resp = await (0, _crossFetch.default)(`${this.chain === 'alephTest' ? _utils.ART_ZERO_TESTNET_IPFS_API : _utils.ART_ZERO_IPFS_API}?input=${parsedTokenUri}`);
|
|
161
214
|
itemDetail = resp && resp.ok && (await resp.json());
|
|
162
215
|
}
|
|
163
216
|
} else {
|
|
164
|
-
const
|
|
217
|
+
const parsedTokenUri = this.parseFeaturedTokenUri(tokenUri);
|
|
218
|
+
const detailUrl = this.parseUrl(parsedTokenUri);
|
|
165
219
|
if (detailUrl) {
|
|
166
220
|
const resp = await (0, _crossFetch.default)(detailUrl);
|
|
167
221
|
itemDetail = resp && resp.ok && (await resp.json());
|
|
@@ -176,7 +230,7 @@ class WasmNftApi extends _nft.BaseNftApi {
|
|
|
176
230
|
nftItem.externalUrl = itemDetail.external_url;
|
|
177
231
|
const rawImageSrc = itemDetail.image ? itemDetail.image : itemDetail.image_url;
|
|
178
232
|
if (isFeatured) {
|
|
179
|
-
nftItem.image = this.parseFeaturedNftImage(rawImageSrc);
|
|
233
|
+
nftItem.image = await this.parseFeaturedNftImage(rawImageSrc);
|
|
180
234
|
nftItem.externalUrl = _utils.ART_ZERO_EXTERNAL_URL;
|
|
181
235
|
} else {
|
|
182
236
|
nftItem.image = this.parseUrl(rawImageSrc);
|
|
@@ -194,21 +248,26 @@ class WasmNftApi extends _nft.BaseNftApi {
|
|
|
194
248
|
}
|
|
195
249
|
return nftItem;
|
|
196
250
|
}
|
|
197
|
-
async getItemsByCollection(contractPromise,
|
|
251
|
+
async getItemsByCollection(contractPromise, tokenInfo, collectionName, nftParams, isFeatured) {
|
|
198
252
|
let ownItem = false;
|
|
199
253
|
let collectionImage;
|
|
200
|
-
const smartContract = (0,
|
|
201
|
-
const
|
|
254
|
+
const smartContract = (0, _utils3._getContractAddressOfToken)(tokenInfo);
|
|
255
|
+
const nftOwnerMap = {};
|
|
202
256
|
await Promise.all(this.addresses.map(async address => {
|
|
257
|
+
var _this$substrateApi2, _balance$output;
|
|
203
258
|
if ((0, _utilCrypto.isEthereumAddress)(address)) {
|
|
204
259
|
return;
|
|
205
260
|
}
|
|
206
261
|
const nftIds = [];
|
|
207
262
|
const _balance = await contractPromise.query['psp34::balanceOf'](address, {
|
|
208
|
-
gasLimit:
|
|
263
|
+
gasLimit: (0, _utils2.getDefaultWeightV2)((_this$substrateApi2 = this.substrateApi) === null || _this$substrateApi2 === void 0 ? void 0 : _this$substrateApi2.api)
|
|
209
264
|
}, address);
|
|
210
|
-
|
|
265
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
266
|
+
const balanceJson = _balance === null || _balance === void 0 ? void 0 : (_balance$output = _balance.output) === null || _balance$output === void 0 ? void 0 : _balance$output.toJSON();
|
|
267
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
268
|
+
const balance = _balance.output ? balanceJson.ok || balanceJson.Ok : '0';
|
|
211
269
|
if (parseInt(balance) === 0) {
|
|
270
|
+
nftParams.cleanUpNfts(this.chain, address, [smartContract], []);
|
|
212
271
|
return;
|
|
213
272
|
}
|
|
214
273
|
const itemIndexes = [];
|
|
@@ -217,20 +276,17 @@ class WasmNftApi extends _nft.BaseNftApi {
|
|
|
217
276
|
}
|
|
218
277
|
try {
|
|
219
278
|
await Promise.all(itemIndexes.map(async i => {
|
|
279
|
+
var _this$substrateApi3;
|
|
220
280
|
const _tokenByIndexResp = await contractPromise.query['psp34Enumerable::ownersTokenByIndex'](address, {
|
|
221
|
-
gasLimit:
|
|
281
|
+
gasLimit: (0, _utils2.getDefaultWeightV2)((_this$substrateApi3 = this.substrateApi) === null || _this$substrateApi3 === void 0 ? void 0 : _this$substrateApi3.api)
|
|
222
282
|
}, address, i);
|
|
223
283
|
if (_tokenByIndexResp.output) {
|
|
224
284
|
const rawTokenId = _tokenByIndexResp.output.toHuman();
|
|
225
|
-
|
|
226
|
-
const
|
|
285
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
286
|
+
const tokenIdObj = rawTokenId.Ok.Ok || rawTokenId.ok.ok; // capital O, not normal o
|
|
287
|
+
const tokenId = Object.values(tokenIdObj)[0].replaceAll(',', '');
|
|
227
288
|
nftIds.push(tokenId);
|
|
228
|
-
|
|
229
|
-
if (isMetadataOnchain) {
|
|
230
|
-
nftItem = await this.processOnChainMetadata(contractPromise, address, tokenIdObj, collectionAttributes, isFeatured);
|
|
231
|
-
} else {
|
|
232
|
-
nftItem = await this.processOffChainMetadata(contractPromise, address, tokenId, isFeatured);
|
|
233
|
-
}
|
|
289
|
+
const nftItem = await this.processOffChainMetadata(contractPromise, address, tokenId, isFeatured);
|
|
234
290
|
nftItem.collectionId = smartContract;
|
|
235
291
|
nftItem.chain = this.chain;
|
|
236
292
|
nftItem.type = _types._AssetType.PSP34;
|
|
@@ -245,6 +301,8 @@ class WasmNftApi extends _nft.BaseNftApi {
|
|
|
245
301
|
}
|
|
246
302
|
}
|
|
247
303
|
}));
|
|
304
|
+
|
|
305
|
+
nftOwnerMap[address] = nftIds;
|
|
248
306
|
} catch (e) {
|
|
249
307
|
console.error(`error parsing item for ${this.chain} nft`, e);
|
|
250
308
|
}
|
|
@@ -264,6 +322,10 @@ class WasmNftApi extends _nft.BaseNftApi {
|
|
|
264
322
|
originAsset: tokenInfo.slug
|
|
265
323
|
};
|
|
266
324
|
nftParams.updateCollection(this.chain, nftCollection);
|
|
325
|
+
Object.entries(nftOwnerMap).forEach(_ref => {
|
|
326
|
+
let [owner, nftIds] = _ref;
|
|
327
|
+
nftParams.cleanUpNfts(this.chain, owner, [smartContract], nftIds);
|
|
328
|
+
});
|
|
267
329
|
}
|
|
268
330
|
}
|
|
269
331
|
async fetchNfts(params) {
|
|
@@ -275,20 +337,17 @@ class WasmNftApi extends _nft.BaseNftApi {
|
|
|
275
337
|
return 1;
|
|
276
338
|
}
|
|
277
339
|
async handleNfts(params) {
|
|
278
|
-
var _this$
|
|
340
|
+
var _this$substrateApi4;
|
|
279
341
|
if (!this.wasmContracts || this.wasmContracts.length === 0) {
|
|
280
342
|
return;
|
|
281
343
|
}
|
|
282
344
|
await this.connect(); // might not be necessary
|
|
283
345
|
|
|
284
|
-
const apiPromise = (_this$
|
|
346
|
+
const apiPromise = (_this$substrateApi4 = this.substrateApi) === null || _this$substrateApi4 === void 0 ? void 0 : _this$substrateApi4.api;
|
|
285
347
|
await Promise.all(this.wasmContracts.map(async tokenInfo => {
|
|
286
|
-
const contractPromise = (0, _wasm.getPSP34ContractPromise)(apiPromise, (0,
|
|
287
|
-
const
|
|
288
|
-
|
|
289
|
-
storedOnChain
|
|
290
|
-
} = await this.getCollectionAttributes(contractPromise);
|
|
291
|
-
return await this.getItemsByCollection(contractPromise, attributeList, storedOnChain, tokenInfo, tokenInfo.name, params);
|
|
348
|
+
const contractPromise = (0, _wasm.getPSP34ContractPromise)(apiPromise, (0, _utils3._getContractAddressOfToken)(tokenInfo));
|
|
349
|
+
const isCollectionFeatured = await isArtZeroFeaturedCollection(this.chain, (0, _utils3._getContractAddressOfToken)(tokenInfo));
|
|
350
|
+
return await this.getItemsByCollection(contractPromise, tokenInfo, tokenInfo.name, params, isCollectionFeatured);
|
|
292
351
|
}));
|
|
293
352
|
}
|
|
294
353
|
}
|
|
@@ -3,17 +3,21 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.ART_ZERO_TESTNET_IPFS_API = exports.ART_ZERO_TESTNET_IMAGE_API = exports.ART_ZERO_TESTNET_COLLECTION_API = exports.ART_ZERO_IPFS_API = exports.ART_ZERO_IMAGE_API = exports.ART_ZERO_EXTERNAL_URL = exports.ART_ZERO_COLLECTION_API = void 0;
|
|
7
7
|
// Copyright 2019-2022 @subwallet/extension-koni authors & contributors
|
|
8
8
|
// SPDX-License-Identifier: Apache-2.0
|
|
9
9
|
|
|
10
|
-
const
|
|
11
|
-
exports.
|
|
12
|
-
const
|
|
10
|
+
const ART_ZERO_TESTNET_IMAGE_API = 'https://a0-test-api.artzero.io/getImage';
|
|
11
|
+
exports.ART_ZERO_TESTNET_IMAGE_API = ART_ZERO_TESTNET_IMAGE_API;
|
|
12
|
+
const ART_ZERO_TESTNET_IPFS_API = 'https://a0-test-api.artzero.io/getJSON';
|
|
13
|
+
exports.ART_ZERO_TESTNET_IPFS_API = ART_ZERO_TESTNET_IPFS_API;
|
|
14
|
+
const ART_ZERO_TESTNET_COLLECTION_API = 'https://a0-test-api.artzero.io/getCollectionByAddress';
|
|
15
|
+
exports.ART_ZERO_TESTNET_COLLECTION_API = ART_ZERO_TESTNET_COLLECTION_API;
|
|
16
|
+
const ART_ZERO_IMAGE_API = 'https://a0-api.artzero.io/getImage';
|
|
13
17
|
exports.ART_ZERO_IMAGE_API = ART_ZERO_IMAGE_API;
|
|
14
|
-
const ART_ZERO_IPFS_API = 'https://api.artzero.io/getJSON';
|
|
18
|
+
const ART_ZERO_IPFS_API = 'https://a0-api.artzero.io/getJSON';
|
|
15
19
|
exports.ART_ZERO_IPFS_API = ART_ZERO_IPFS_API;
|
|
16
|
-
const ART_ZERO_COLLECTION_API = 'https://api.artzero.io/getCollectionByAddress';
|
|
20
|
+
const ART_ZERO_COLLECTION_API = 'https://a0-api.artzero.io/getCollectionByAddress';
|
|
17
21
|
exports.ART_ZERO_COLLECTION_API = ART_ZERO_COLLECTION_API;
|
|
18
|
-
const ART_ZERO_EXTERNAL_URL = 'https://artzero.io
|
|
22
|
+
const ART_ZERO_EXTERNAL_URL = 'https://a0.artzero.io/#/marketplace';
|
|
19
23
|
exports.ART_ZERO_EXTERNAL_URL = ART_ZERO_EXTERNAL_URL;
|