File tree Expand file tree Collapse file tree 4 files changed +44
-27
lines changed
packages/thirdweb/src/extensions/marketplace Expand file tree Collapse file tree 4 files changed +44
-27
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " thirdweb " : patch
3
+ ---
4
+
5
+ Filters invalid listings and auctions from marketplace
Original file line number Diff line number Diff line change @@ -67,13 +67,17 @@ export async function getAllListings(
67
67
} ) ,
68
68
] ) ;
69
69
70
- return await Promise . all (
71
- rawListings . map ( ( rawListing ) =>
72
- mapDirectListing ( {
73
- contract : options . contract ,
74
- latestBlock,
75
- rawListing,
76
- } ) ,
77
- ) ,
78
- ) ;
70
+ const listings = (
71
+ await Promise . all (
72
+ rawListings . map ( ( rawListing ) =>
73
+ mapDirectListing ( {
74
+ contract : options . contract ,
75
+ latestBlock,
76
+ rawListing,
77
+ } ) . catch ( ( ) => null ) ,
78
+ ) ,
79
+ )
80
+ ) . filter ( ( listing ) => listing !== null ) ;
81
+
82
+ return listings as DirectListing [ ] ; // TODO: Fix when TS 5.5 is out
79
83
}
Original file line number Diff line number Diff line change @@ -71,13 +71,17 @@ export async function getAllValidListings(
71
71
} ) ,
72
72
] ) ;
73
73
74
- return await Promise . all (
75
- rawListings . map ( ( rawListing ) =>
76
- mapDirectListing ( {
77
- contract : options . contract ,
78
- latestBlock,
79
- rawListing,
80
- } ) ,
81
- ) ,
82
- ) ;
74
+ const listings = (
75
+ await Promise . all (
76
+ rawListings . map ( ( rawListing ) =>
77
+ mapDirectListing ( {
78
+ contract : options . contract ,
79
+ latestBlock,
80
+ rawListing,
81
+ } ) . catch ( ( ) => null ) ,
82
+ ) ,
83
+ )
84
+ ) . filter ( ( listing ) => listing !== null ) ;
85
+
86
+ return listings as DirectListing [ ] ; // TODO: Fix when TS 5.5 is out
83
87
}
Original file line number Diff line number Diff line change @@ -71,13 +71,17 @@ export async function getAllValidAuctions(
71
71
} ) ,
72
72
] ) ;
73
73
74
- return await Promise . all (
75
- rawAuctions . map ( ( rawAuction ) =>
76
- mapEnglishAuction ( {
77
- contract : options . contract ,
78
- latestBlock,
79
- rawAuction,
80
- } ) ,
81
- ) ,
82
- ) ;
74
+ const auctions = (
75
+ await Promise . all (
76
+ rawAuctions . map ( ( rawAuction ) =>
77
+ mapEnglishAuction ( {
78
+ contract : options . contract ,
79
+ latestBlock,
80
+ rawAuction,
81
+ } ) ,
82
+ ) ,
83
+ )
84
+ ) . filter ( ( auction ) => auction !== null ) ;
85
+
86
+ return auctions as EnglishAuction [ ] ; // TODO: Fix when TS 5.5 is out
83
87
}
You can’t perform that action at this time.
0 commit comments