4
4
from datamaxi .lib .utils import check_required_parameter
5
5
from datamaxi .lib .utils import check_required_parameters
6
6
from datamaxi .lib .utils import check_required_parameter_list
7
+ from datamaxi .lib .utils import check_at_least_one_set_parameters
7
8
from datamaxi .lib .utils import encode_string_list
8
9
from datamaxi .lib .utils import make_list
9
10
from datamaxi .lib .utils import postprocess
@@ -438,7 +439,11 @@ def revenue(
438
439
439
440
@postprocess (num_index = 4 )
440
441
def fee_detail (
441
- self , protocol : str , chain : str = None , daily : bool = True , pandas : bool = True
442
+ self ,
443
+ protocol : str = None ,
444
+ chain : str = None ,
445
+ daily : bool = True ,
446
+ pandas : bool = True ,
442
447
) -> Union [List , pd .DataFrame ]:
443
448
"""Get fee detail for given protocol and chain
444
449
@@ -448,26 +453,34 @@ def fee_detail(
448
453
449
454
Args:
450
455
protocol (str): Protocol name
451
- chain (str): Chain name (optional)
456
+ chain (str): Chain name
452
457
daily (bool): Daily fee or total fee
453
458
pandas (bool): Return data as pandas DataFrame
454
459
455
460
Returns:
456
461
Timeseries of fee detail for a given protocol and chain
457
462
"""
458
- check_required_parameters ([[ protocol , "protocol" ], [ daily , "daily" ]] )
463
+ check_required_parameter ( daily , "daily" )
459
464
params = {
460
- "protocol" : protocol ,
461
465
"daily" : str (daily ).lower (),
462
466
}
467
+
468
+ check_at_least_one_set_parameters ([[protocol , "protocol" ], [chain , "chain" ]])
469
+ if protocol is not None :
470
+ params ["protocol" ] = protocol
471
+
463
472
if chain is not None :
464
473
params ["chain" ] = chain
465
474
466
475
return self .query ("/v1/defillama/fee/detail" , params )
467
476
468
477
@postprocess (num_index = 4 )
469
478
def revenue_detail (
470
- self , protocol : str , chain : str = None , daily : bool = True , pandas : bool = True
479
+ self ,
480
+ protocol : str = None ,
481
+ chain : str = None ,
482
+ daily : bool = True ,
483
+ pandas : bool = True ,
471
484
) -> Union [List , pd .DataFrame ]:
472
485
"""Get revenue detail for given protocol and chain
473
486
@@ -477,18 +490,22 @@ def revenue_detail(
477
490
478
491
Args:
479
492
protocol (str): Protocol name
480
- chain (str): Chain name (optional)
493
+ chain (str): Chain name
481
494
daily (bool): Daily revenue or total revenue
482
495
pandas (bool): Return data as pandas DataFrame
483
496
484
497
Returns:
485
498
Timeseries of revenue detail for a given protocol and chain
486
499
"""
487
- check_required_parameters ([[ protocol , "protocol" ], [ daily , "daily" ]] )
500
+ check_required_parameter ( daily , "daily" )
488
501
params = {
489
- "protocol" : protocol ,
490
502
"daily" : str (daily ).lower (),
491
503
}
504
+
505
+ check_at_least_one_set_parameters ([[protocol , "protocol" ], [chain , "chain" ]])
506
+ if protocol is not None :
507
+ params ["protocol" ] = protocol
508
+
492
509
if chain is not None :
493
510
params ["chain" ] = chain
494
511
0 commit comments