Skip to content

Commit 46743cd

Browse files
committed
fix: refactor
1 parent e6016cc commit 46743cd

File tree

2 files changed

+3
-31
lines changed

2 files changed

+3
-31
lines changed

packages/assets-controllers/src/NftDetectionController.ts

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -185,37 +185,28 @@ export type TokenResponse = {
185185
chainId: number;
186186
contract: string;
187187
tokenId: string;
188-
/** @description Can be erc721, erc115, etc. */
189188
kind?: string;
190189
name?: string;
191190
image?: string;
192191
imageSmall?: string;
193192
imageLarge?: string;
194193
metadata?: Metadata;
195194
description?: string;
196-
/** @description Can be higher than one if erc1155. */
197195
supply?: number;
198196
remainingSupply?: number;
199-
/** @description No rarity for collections over 100k */
200197
rarityScore?: number;
201198
rarity?: number;
202-
/** @description No rarity rank for collections over 100k */
203199
rarityRank?: number;
204200
media?: string;
205-
/** @default false */
206201
isFlagged?: boolean;
207-
/** @default false */
208202
isSpam?: boolean;
209-
/** @default false */
210203
isNsfw?: boolean;
211-
/** @default false */
212204
metadataDisabled?: boolean;
213205
lastFlagUpdate?: string;
214206
lastFlagChange?: string;
215207
collection?: Collection;
216208
lastSale?: LastSale;
217209
topBid?: TopBid;
218-
/** @description The value of the last sale.Can be null. */
219210
lastAppraisalValue?: number;
220211
attributes?: Attributes[];
221212
};
@@ -233,9 +224,6 @@ export type TopBid = {
233224
};
234225

235226
export type LastSale = {
236-
/** @description Deprecated. Use `saleId` instead. */
237-
id?: string;
238-
/** @description Unique identifier made from txn hash, price, etc. */
239227
saleId?: string;
240228
token?: {
241229
contract?: string;
@@ -248,10 +236,6 @@ export type LastSale = {
248236
};
249237
};
250238
orderSource?: string;
251-
/**
252-
* @description Can be `ask` or `bid`.
253-
* @enum {string}
254-
*/
255239
orderSide?: 'ask' | 'bid';
256240
orderKind?: string;
257241
orderId?: string;
@@ -263,7 +247,6 @@ export type LastSale = {
263247
txHash?: string;
264248
logIndex?: number;
265249
batchIndex?: number;
266-
/** @description Time added on the blockchain */
267250
timestamp?: number;
268251
price?: Price;
269252
washTradingScore?: number;
@@ -272,9 +255,7 @@ export type LastSale = {
272255
paidFullRoyalty?: boolean;
273256
feeBreakdown?: FeeBreakdown[];
274257
isDeleted?: boolean;
275-
/** @description Time when added to indexer */
276258
createdAt?: string;
277-
/** @description Time when updated in indexer */
278259
updatedAt?: string;
279260
};
280261

@@ -287,35 +268,27 @@ export type FeeBreakdown = {
287268
};
288269

289270
export type Attributes = {
290-
/** @description Case sensitive */
291271
key?: string;
292-
/** @description Can be `string`, `number, `date, or `range`. */
293272
kind?: string;
294-
/** @description Case sensitive. */
295273
value: string;
296274
tokenCount?: number;
297275
onSaleCount?: number;
298-
floorAskPrice?: Price;
299-
/** @description Can be null. */
300-
topBidValue?: number;
276+
floorAskPrice?: Price | null;
277+
topBidValue?: number | null;
301278
createdAt?: string;
302279
};
303280

304281
export type Collection = {
305282
id?: string;
306283
name?: string;
307-
/** @description Open Sea slug */
308284
slug?: string;
309285
symbol?: string;
310286
imageUrl?: string;
311287
image?: string;
312-
/** @default false */
313288
isSpam?: boolean;
314-
/** @default false */
315289
isNsfw?: boolean;
316290
creator?: string;
317291
tokenCount?: string;
318-
/** @default false */
319292
metadataDisabled?: boolean;
320293
openseaVerificationStatus?: string;
321294
floorAskPrice?: Price;
@@ -609,7 +582,7 @@ export class NftDetectionController extends StaticIntervalPollingControllerV1<
609582
}
610583

611584
const apiNfts = await this.getOwnerNfts(userAddress);
612-
const addNftPromises = apiNfts.map(async (nft: TokensResponse) => {
585+
const addNftPromises = apiNfts.map(async (nft) => {
613586
const {
614587
tokenId: token_id,
615588
contract,

packages/assets-controllers/src/assetsUtil.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import BN from 'bn.js';
99
import { CID } from 'multiformats/cid';
1010

1111
import type { Nft, NftMetadata } from './NftController';
12-
// import type { ApiNftContract } from './NftDetectionController';
1312
import type { AbstractTokenPricesService } from './token-prices-service';
1413
import { type ContractExchangeRates } from './TokenRatesController';
1514

0 commit comments

Comments
 (0)