@@ -562,6 +562,12 @@ class _TICKER(_CSTRUCT):
562
562
("data_size" , ctypes .c_uint ),
563
563
]
564
564
565
+ class _FUNDING (_CSTRUCT ):
566
+ _fields_ = [("Time" , ctypes .c_ulonglong ),
567
+ ("Rate" , ctypes .c_double ),
568
+ ("Period" , ctypes .c_uint ),
569
+ ("Symbol" , ctypes .c_char * 31 )]
570
+
565
571
class _RECORD (_CSTRUCT ):
566
572
_fields_ = [("Time" , ctypes .c_ulonglong ),
567
573
("Open" , ctypes .c_double ),
@@ -782,6 +788,24 @@ def GetTicker(self, symbol=''):
782
788
return None
783
789
EOF ()
784
790
791
+ def GetFundings (self , symbol = '' ):
792
+ r_len = ctypes .c_uint (0 )
793
+ buf_ptr = ctypes .c_void_p ()
794
+ ret = self .lib .api_Exchange_GetFundings (self .ctx , self .idx , safe_str (symbol ), ctypes .byref (r_len ), ctypes .byref (buf_ptr ))
795
+
796
+ if ret == API_ERR_SUCCESS :
797
+ n = r_len .value
798
+ eles = []
799
+ if n > 0 :
800
+ group_array = (_FUNDING * n ).from_address (buf_ptr .value )
801
+ for i in range (0 , n ):
802
+ eles .append (group_array [i ].toObj ())
803
+ self .lib .api_free (buf_ptr )
804
+ return eles
805
+ elif ret == API_ERR_FAILED :
806
+ return None
807
+ EOF ()
808
+
785
809
def IO (self , k , v = 0 ):
786
810
if k == 'currency' :
787
811
return self .SetCurrency (v )
@@ -1427,7 +1451,7 @@ def __init__(self, task = None, autoRun=False, gApis = None, progressCallback=No
1427
1451
js = os .path .join (tmpCache , crcFile )
1428
1452
if os .path .exists (js ):
1429
1453
b = open (js , 'rb' ).read ()
1430
- if os .getenv ("BOTVS_TASK_UUID" ) is None or "4968fee289f3e793110db9f76d6abc0c " in str (b ):
1454
+ if os .getenv ("BOTVS_TASK_UUID" ) is None or "9d352eb2a1590a560bcb54111e5c9c9e " in str (b ):
1431
1455
hdic = json_loads (b )
1432
1456
loader = os .path .join (tmpCache , soName )
1433
1457
update = False
0 commit comments