dev@locazia: add price index

This commit is contained in:
user 2024-03-12 15:39:46 +03:00
parent ddb554bc80
commit 7d05a3f2c0
1 changed files with 11 additions and 1 deletions

View File

@ -86,6 +86,11 @@ async def indexer_loop(memory, platform_found: bool, seqno: int) -> [bool, int]:
item_values = Cell.one_from_boc(b64decode(item_get_data_result['stack'][6][1]['bytes']))
item_derivates = Cell.one_from_boc(b64decode(item_get_data_result['stack'][7][1]['bytes']))
item_platform_variables = Cell.one_from_boc(b64decode(item_get_data_result['stack'][8][1]['bytes']))
item_distribution = Cell.one_from_boc(b64decode(item_get_data_result['stack'][9][1]['bytes']))
item_distribution_slice = item_distribution.begin_parse()
item_prices_slice = item_distribution_slice.refs[0].begin_parse()
item_listen_license_price = item_prices_slice.read_coins()
item_values_slice = item_values.begin_parse()
item_content_hash_int = item_values_slice.read_uint(256)
@ -109,7 +114,12 @@ async def indexer_loop(memory, platform_found: bool, seqno: int) -> [bool, int]:
'cover_cid': item_content_cover_cid_str,
'metadata_cid': item_content_metadata_cid_str,
'derivates': b58encode(item_derivates.to_boc(False)).decode(),
'platform_variables': b58encode(item_platform_variables.to_boc(False)).decode()
'platform_variables': b58encode(item_platform_variables.to_boc(False)).decode(),
'license': {
'listen': {
'price': str(item_listen_license_price)
}
}
}
user_wallet_connection = None