Asset Divident: no data returned if startTime and endTime parameter are set

Hi,

I am using the ‘asset/assetDividend’ to get asset dividend history.

If I use without any argument I got a partail list.

    allDividend = self._client.get_asset_dividend_history()

{‘total’: 20, ‘rows’: [{‘tranId’: 11143093852, ‘asset’: ‘WING’, ‘amount’: ‘0.00188169’, ‘divTime’: 1600999816000, ‘enInfo’: ‘WING distribution’}, {‘tranId’: 11142847206, ‘asset’: ‘WING’, ‘amount’: ‘0.00071116’, ‘divTime’: 1600999197000, ‘enInfo’: ‘WING distribution’}, {‘tranId’: 11142596485, ‘asset’: ‘BEL’, ‘amount’: ‘0.0492346’, ‘divTime’: 1600998327000, ‘enInfo’: ‘BEL distribution’}, {‘tranId’: 11123569609, ‘asset’: ‘WING’, ‘amount’: ‘0.00178874’, ‘divTime’: 1600910992000, ‘enInfo’: ‘WING distribution’}, {‘tranId’: 11123368442, ‘asset’: ‘WING’, ‘amount’: ‘0.00070803’, ‘divTime’: 1600910378000, ‘enInfo’: ‘WING distribution’}, {‘tranId’: 11123035524, ‘asset’: ‘BEL’, ‘amount’: ‘0.04901758’, ‘divTime’: 1600909501000, ‘enInfo’: ‘BEL distribution’}, {‘tranId’: 11103010990, ‘asset’: ‘WING’, ‘amount’: ‘0.00176359’, ‘divTime’: 1600823960000, ‘enInfo’: ‘WING distribution’}, {‘tranId’: 11102847511, ‘asset’: ‘WING’, ‘amount’: ‘0.00071019’, ‘divTime’: 1600823376000, ‘enInfo’: ‘WING distribution’}, {‘tranId’: 11102598545, ‘asset’: ‘BEL’, ‘amount’: ‘0.04916757’, ‘divTime’: 1600822521000, ‘enInfo’: ‘BEL distribution’}, {‘tranId’: 11088466695, ‘asset’: ‘SXP’, ‘amount’: ‘0.09359488’, ‘divTime’: 1600756792000, ‘enInfo’: ‘SXP distribution’}, {‘tranId’: 11084043409, ‘asset’: ‘WING’, ‘amount’: ‘0.00172556’, ‘divTime’: 1600738162000, ‘enInfo’: ‘WING distribution’}, {‘tranId’: 11083831933, ‘asset’: ‘WING’, ‘amount’: ‘0.00071062’, ‘divTime’: 1600737578000, ‘enInfo’: ‘WING distribution’}, {‘tranId’: 11083560229, ‘asset’: ‘BEL’, ‘amount’: ‘0.0491973’, ‘divTime’: 1600736707000, ‘enInfo’: ‘BEL distribution’}, {‘tranId’: 11058749188, ‘asset’: ‘WING’, ‘amount’: ‘0.00191749’, ‘divTime’: 1600651158000, ‘enInfo’: ‘WING distribution’}, {‘tranId’: 11058535227, ‘asset’: ‘WING’, ‘amount’: ‘0.00071444’, ‘divTime’: 1600650567000, ‘enInfo’: ‘WING distribution’}, {‘tranId’: 11058215391, ‘asset’: ‘BEL’, ‘amount’: ‘0.04946191’, ‘divTime’: 1600649711000, ‘enInfo’: ‘BEL distribution’}, {‘tranId’: 11049292429, ‘asset’: ‘XTZ’, ‘amount’: ‘0.34362477’, ‘divTime’: 1600608087000, ‘enInfo’: ‘XTZ distribution’}, {‘tranId’: 11047460169, ‘asset’: ‘KNC’, ‘amount’: ‘0.00662434’, ‘divTime’: 1600604012000, ‘enInfo’: ‘KNC distribution’}, {‘tranId’: 11040806336, ‘asset’: ‘WING’, ‘amount’: ‘0.00221171’, ‘divTime’: 1600564751000, ‘enInfo’: ‘WING distribution’}, {‘tranId’: 11040611281, ‘asset’: ‘WING’, ‘amount’: ‘0.00071549’, ‘divTime’: 1600564169000, ‘enInfo’: ‘WING distribution’}]}

If I use startTime and endTime, I got an empty list. I tried to switch fin and debut: same result.

    fin  = int(datetime(2020, 9, 21, 0, 0, 0, 0).timestamp())
    debut= int(datetime(2020, 9, 20, 0, 0, 0, 0).timestamp())

    allDividend = self._client.get_asset_dividend_history(startTime=debut,endTime=fin)

{‘total’: 0, ‘rows’: }

Does any body can tell me if I am missing something or there is a bug?

I found my mistake. I must multiple by 1000 the generated time stamp.

It is fine with

fin  = int(datetime(2020, 9, 21, 0, 0, 0, 0).timestamp())*1000
debut= int(datetime(2020, 9, 20, 0, 0, 0, 0).timestamp())*1000

Thanks for the reading…

nice one :slight_smile: