@@ -9,52 +9,68 @@ app.use(express.json());
99app . use ( express . urlencoded ( { extended : true } ) ) ;
1010app . use ( express . static ( __dirname + "/../public" ) ) ;
1111
12+ type Collection = {
13+ name : string ;
14+ contract : string ;
15+ } ;
16+
17+ const COLLECTIONS : { [ collectionName : string ] : Collection } = {
18+ Sublimes : {
19+ name : "Sublimes" ,
20+ contract : "0x116aebbad1c8226c80f9f0cb4e255540a0f7afd9" ,
21+ } ,
22+ } ;
23+
1224const DROPS = [
1325 {
14- id : 0 ,
15- collections : [
16- {
17- name : "Isotile" ,
18- contract : "0x31eaa2e93d7afd237f87f30c0dbd3adeb9934f1b" ,
19- } ,
20- ] ,
26+ name : "#DROP 0" ,
27+ collections : [ COLLECTIONS . Sublimes ] ,
2128 } ,
2229] ;
2330
24- app . get (
25- "/drop/:drop" ,
26- async ( req : Request , res : Response ) : Promise < Response > => {
27- const drop = DROPS [ req . params . drop ] ;
31+ const fakeAnswer = {
32+ Sublimes : [
33+ {
34+ id : 825 ,
35+ img : "https://lh3.googleusercontent.com/iUN-rqbSEW97A_YNFiUeKuIoQRtIP08w8st9GnBqsQiydLaiF68pGDP4gx-URYmEph_SqXumjZj3TRGxPIFQBR9ZWxDZicur50a8hA=s0" ,
36+ } ,
37+ {
38+ id : 437 ,
39+ img : "https://lh3.googleusercontent.com/nlO5vgcrUqgqPlHHrQHrlA5ZsXg2hIxkJkzr72oK9KU9cNojTO8HAxWCOH06xNw0R5_ZocxNuXhLHwbHC282uz63pNnjfQd-mABKEA=s0" ,
40+ } ,
41+ {
42+ id : 108 ,
43+ img : "https://lh3.googleusercontent.com/-JDl1IBKkvQtOJKApygolCMXCV09SDAftc5IhqO585oFXvV-XhpaOFEI_WJFJdTJT6l8ypxMb-FlkQGPRNNPN4enIFJoAIpDA2Y7=s0" ,
44+ } ,
45+ ] ,
46+ } ;
47+
48+ app . get ( "/drop/:drop" , async ( req : Request , res : Response ) : Promise < Response > => {
49+ const drop = DROPS [ req . params . drop ] ;
2850
29- return res . status ( 200 ) . send ( {
30- ...drop ,
31- } ) ;
32- }
33- ) ;
51+ return res . status ( 200 ) . send ( {
52+ ...drop ,
53+ } ) ;
54+ } ) ;
3455
35- app . get (
36- "/drop/:drop/:address" ,
37- async ( req : Request , res : Response ) : Promise < Response > => {
38- const drop = DROPS [ req . params . drop as any as number ] ;
39- const address = req . params . address ;
56+ app . get ( "/drop/:drop/:address" , async ( req : Request , res : Response ) : Promise < Response > => {
57+ const drop = DROPS [ req . params . drop as any as number ] ;
58+ const address = req . params . address ;
4059
41- let data = { } ;
42- for ( let collection of drop . collections ) {
43- const resq = await axios . get (
44- `https://api.opensea.io/api/v1/assets?owner=${ address } &asset_contract_address=${ collection . contract } &order_direction=desc&offset=0&limit=20`
45- ) ;
60+ // let data = {};
61+ // for (let collection of drop.collections) {
62+ // const resq = await axios.get(
63+ // `https://api.opensea.io/api/v1/assets?owner=${address}&asset_contract_address=${collection.contract}&order_direction=desc&offset=0&limit=20`
64+ // );
4665
47- data [ collection . name ] = {
48- ...data [ collection . name ] ,
49- ...resq . data . assets ,
50- } ;
51- }
66+ // data[collection.name] = {
67+ // ...data[collection.name],
68+ // ...resq.data.assets,
69+ // };
70+ // }
5271
53- return res . status ( 200 ) . send ( {
54- ...data ,
55- } ) ;
56- }
57- ) ;
72+ return res . status ( 200 ) . send ( fakeAnswer ) ;
73+ } ) ;
5874
5975app . get ( "/" , async ( req : Request , res : Response ) : Promise < Response > => {
6076 return res . status ( 200 ) . send ( {
0 commit comments