@@ -178,12 +178,12 @@ async fn handler_internal(
178
178
}
179
179
} else {
180
180
state. validate_project_access_and_quota ( & project_id) . await ?;
181
- history_provider_kind = ProviderKind :: Zerion ;
182
181
let provider = state
183
182
. providers
184
183
. history_providers
185
184
. get ( & namespace)
186
185
. ok_or_else ( || RpcError :: UnsupportedNamespace ( namespace) ) ?;
186
+ history_provider_kind = provider. provider_kind ( ) ;
187
187
provider
188
188
. get_transactions ( address. clone ( ) , query. 0 . clone ( ) , state. metrics . clone ( ) )
189
189
. await
@@ -207,9 +207,46 @@ async fn handler_internal(
207
207
. map ( |geo| ( geo. country , geo. continent , geo. region ) )
208
208
. unwrap_or ( ( None , None , None ) ) ;
209
209
210
- // Different analytics for different history providers
210
+ // Analytics schema exception for Coinbase Onramp
211
211
match history_provider_kind {
212
- ProviderKind :: Zerion => {
212
+ ProviderKind :: Coinbase => {
213
+ for transaction in response. clone ( ) . data {
214
+ state
215
+ . analytics
216
+ . onramp_history_lookup ( OnrampHistoryLookupInfo :: new (
217
+ transaction. id ,
218
+ latency_tracker,
219
+ address. clone ( ) ,
220
+ project_id. clone ( ) ,
221
+ origin. clone ( ) ,
222
+ region. clone ( ) ,
223
+ country. clone ( ) ,
224
+ continent. clone ( ) ,
225
+ transaction. metadata . status ,
226
+ transaction
227
+ . transfers
228
+ . as_ref ( )
229
+ . map ( |v| {
230
+ v. first ( )
231
+ . and_then ( |item| {
232
+ item. fungible_info . as_ref ( ) . map ( |info| info. name . clone ( ) )
233
+ } )
234
+ . unwrap_or_default ( )
235
+ } )
236
+ . unwrap_or ( None )
237
+ . unwrap_or_default ( ) ,
238
+ transaction. metadata . chain . clone ( ) . unwrap_or_default ( ) ,
239
+ transaction
240
+ . transfers
241
+ . as_ref ( )
242
+ . map ( |v| v[ 0 ] . quantity . numeric . clone ( ) )
243
+ . unwrap_or_default ( ) ,
244
+ query. sdk_info . sv . clone ( ) ,
245
+ query. sdk_info . st . clone ( ) ,
246
+ ) ) ;
247
+ }
248
+ }
249
+ _ => {
213
250
state. analytics . history_lookup ( HistoryLookupInfo :: new (
214
251
address,
215
252
project_id,
@@ -250,6 +287,7 @@ async fn handler_internal(
250
287
. unwrap_or ( 0 )
251
288
} )
252
289
. sum ( ) ,
290
+ & history_provider_kind,
253
291
origin,
254
292
region,
255
293
country,
@@ -258,44 +296,6 @@ async fn handler_internal(
258
296
query. sdk_info . st . clone ( ) ,
259
297
) ) ;
260
298
}
261
- ProviderKind :: Coinbase => {
262
- for transaction in response. clone ( ) . data {
263
- state
264
- . analytics
265
- . onramp_history_lookup ( OnrampHistoryLookupInfo :: new (
266
- transaction. id ,
267
- latency_tracker,
268
- address. clone ( ) ,
269
- project_id. clone ( ) ,
270
- origin. clone ( ) ,
271
- region. clone ( ) ,
272
- country. clone ( ) ,
273
- continent. clone ( ) ,
274
- transaction. metadata . status ,
275
- transaction
276
- . transfers
277
- . as_ref ( )
278
- . map ( |v| {
279
- v. first ( )
280
- . and_then ( |item| {
281
- item. fungible_info . as_ref ( ) . map ( |info| info. name . clone ( ) )
282
- } )
283
- . unwrap_or_default ( )
284
- } )
285
- . unwrap_or ( None )
286
- . unwrap_or_default ( ) ,
287
- transaction. metadata . chain . clone ( ) . unwrap_or_default ( ) ,
288
- transaction
289
- . transfers
290
- . as_ref ( )
291
- . map ( |v| v[ 0 ] . quantity . numeric . clone ( ) )
292
- . unwrap_or_default ( ) ,
293
- query. sdk_info . sv . clone ( ) ,
294
- query. sdk_info . st . clone ( ) ,
295
- ) ) ;
296
- }
297
- }
298
- _ => { }
299
299
}
300
300
301
301
let latency_tracker = latency_tracker_start
0 commit comments