@@ -23,15 +23,15 @@ GoldRushDecoder.on(
23
23
24
24
enum SIDE {
25
25
"BUY" = 0 ,
26
- "SELL" = 1
26
+ "SELL" = 1 ,
27
27
}
28
28
29
29
const { args : decoded } = decodeEventLog ( {
30
30
abi : ABI ,
31
31
topics : raw_log_topics as [ ] ,
32
32
data : raw_log_data as `0x${string } `,
33
33
eventName : "OrdersMatched" ,
34
- } ) as {
34
+ } ) as {
35
35
eventName : "OrdersMatched" ;
36
36
args : {
37
37
maker : string ;
@@ -53,9 +53,9 @@ GoldRushDecoder.on(
53
53
} [ ] ;
54
54
salt : bigint ;
55
55
extraParams : string ;
56
- } ;
57
- sellHash : string ;
58
- buy : {
56
+ } ;
57
+ sellHash : string ;
58
+ buy : {
59
59
trader : string ;
60
60
side : SIDE ;
61
61
matchingPolicy : string ;
@@ -72,8 +72,8 @@ GoldRushDecoder.on(
72
72
} [ ] ;
73
73
salt : bigint ;
74
74
extraParams : string ;
75
- } ;
76
- buyHash : string ;
75
+ } ;
76
+ buyHash : string ;
77
77
}
78
78
} ;
79
79
@@ -104,14 +104,14 @@ GoldRushDecoder.on(
104
104
105
105
const date = TimestampParser ( block_signed_at , "YYYY-MM-DD" ) ;
106
106
const { data : tokenPriceData } = await covalent_client . PricingService . getTokenPrices (
107
- chain_name ,
108
- "USD" ,
109
- decoded . sell . collection || decoded . buy . collection ,
110
- {
111
- from : date ,
112
- to : date ,
113
- }
114
- ) ;
107
+ chain_name ,
108
+ "USD" ,
109
+ decoded . sell . collection || decoded . buy . collection ,
110
+ {
111
+ from : date ,
112
+ to : date ,
113
+ }
114
+ ) ;
115
115
tokens . push ( {
116
116
heading : `Matched to ${ decoded . buy . trader } ` ,
117
117
value : decoded . sell . amount . toString ( ) || decoded . buy . amount . toString ( ) ,
@@ -120,12 +120,12 @@ GoldRushDecoder.on(
120
120
?. contract_decimals ?? 18 ,
121
121
pretty_quote : prettifyCurrency (
122
122
tokenPriceData ?. [ 0 ] ?. items ?. [ 0 ] ?. price *
123
- ( Number ( decoded . sell . amount . toString ( ) || decoded . buy . amount . toString ( ) ) /
124
- Math . pow (
125
- 10 ,
126
- tokenPriceData ?. [ 0 ] ?. items ?. [ 0 ] ?. contract_metadata
127
- ?. contract_decimals ?? 18
128
- ) )
123
+ ( Number ( decoded . sell . amount . toString ( ) || decoded . buy . amount . toString ( ) ) /
124
+ Math . pow (
125
+ 10 ,
126
+ tokenPriceData ?. [ 0 ] ?. items ?. [ 0 ] ?. contract_metadata
127
+ ?. contract_decimals ?? 18
128
+ ) )
129
129
) ,
130
130
ticker_symbol :
131
131
tokenPriceData ?. [ 0 ] ?. items ?. [ 0 ] ?. contract_metadata
@@ -143,30 +143,30 @@ GoldRushDecoder.on(
143
143
withUncached : true ,
144
144
}
145
145
) ;
146
- nfts . push ( {
147
- heading : `Matched to ${ decoded . buy . trader } ` ,
148
- collection_address : data ?. items ?. [ 0 ] ?. contract_address ,
149
- collection_name :
150
- data ?. items ?. [ 0 ] ?. nft_data ?. external_data ?. name ||
151
- null ,
152
- token_identifier :
153
- data ?. items ?. [ 0 ] ?. nft_data ?. token_id ?. toString ( ) ||
154
- null ,
155
- images : {
156
- "1024" :
157
- data ?. items ?. [ 0 ] ?. nft_data ?. external_data
158
- ?. image_1024 || null ,
159
- "512" :
160
- data ?. items ?. [ 0 ] ?. nft_data ?. external_data
161
- ?. image_512 || null ,
162
- "256" :
163
- data ?. items ?. [ 0 ] ?. nft_data ?. external_data
164
- ?. image_256 || null ,
165
- default :
166
- data ?. items ?. [ 0 ] ?. nft_data ?. external_data
167
- ?. image || null ,
168
- } ,
169
- } ) ;
146
+ nfts . push ( {
147
+ heading : `Matched to ${ decoded . buy . trader } ` ,
148
+ collection_address : data ?. items ?. [ 0 ] ?. contract_address ,
149
+ collection_name :
150
+ data ?. items ?. [ 0 ] ?. nft_data ?. external_data ?. name ||
151
+ null ,
152
+ token_identifier :
153
+ data ?. items ?. [ 0 ] ?. nft_data ?. token_id ?. toString ( ) ||
154
+ null ,
155
+ images : {
156
+ "1024" :
157
+ data ?. items ?. [ 0 ] ?. nft_data ?. external_data
158
+ ?. image_1024 || null ,
159
+ "512" :
160
+ data ?. items ?. [ 0 ] ?. nft_data ?. external_data
161
+ ?. image_512 || null ,
162
+ "256" :
163
+ data ?. items ?. [ 0 ] ?. nft_data ?. external_data
164
+ ?. image_256 || null ,
165
+ default :
166
+ data ?. items ?. [ 0 ] ?. nft_data ?. external_data
167
+ ?. image || null ,
168
+ } ,
169
+ } ) ;
170
170
171
171
return {
172
172
action : DECODED_ACTION . SWAPPED ,
0 commit comments