edit blockchain payload encoding
This commit is contained in:
parent
cb04ccfa83
commit
df66b95e0a
|
|
@ -95,7 +95,7 @@ async def s_api_v1_blockchain_send_new_content_message(request):
|
||||||
return response.json({
|
return response.json({
|
||||||
'address': platform.address.to_string(1, 1, 1),
|
'address': platform.address.to_string(1, 1, 1),
|
||||||
'amount': str(int(0.15 * 10 ** 9)),
|
'amount': str(int(0.15 * 10 ** 9)),
|
||||||
'payload': (
|
'payload': b64encode(
|
||||||
begin_cell()
|
begin_cell()
|
||||||
.store_uint(0x5491d08c, 32)
|
.store_uint(0x5491d08c, 32)
|
||||||
.store_uint(int.from_bytes(encrypted_content_cid.content_hash, "big", signed=False), 256)
|
.store_uint(int.from_bytes(encrypted_content_cid.content_hash, "big", signed=False), 256)
|
||||||
|
|
@ -129,7 +129,7 @@ async def s_api_v1_blockchain_send_new_content_message(request):
|
||||||
.end_cell()
|
.end_cell()
|
||||||
)
|
)
|
||||||
.end_cell().to_boc(False)
|
.end_cell().to_boc(False)
|
||||||
).hex()
|
).decode()
|
||||||
})
|
})
|
||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
make_log("Blockchain", f"Error while sending new content message: {e}" + '\n' + traceback.format_exc(), level='error')
|
make_log("Blockchain", f"Error while sending new content message: {e}" + '\n' + traceback.format_exc(), level='error')
|
||||||
|
|
@ -155,7 +155,7 @@ async def s_api_v1_blockchain_send_purchase_content_message(request):
|
||||||
return response.json({
|
return response.json({
|
||||||
'address': request.json['content_address'],
|
'address': request.json['content_address'],
|
||||||
'amount': str(int(licenses_cost['resale']['price'])),
|
'amount': str(int(licenses_cost['resale']['price'])),
|
||||||
'payload': (
|
'payload': b64encode((
|
||||||
begin_cell()
|
begin_cell()
|
||||||
.store_uint(0x2a319593, 32)
|
.store_uint(0x2a319593, 32)
|
||||||
.store_uint(0, 64)
|
.store_uint(0, 64)
|
||||||
|
|
@ -166,5 +166,5 @@ async def s_api_v1_blockchain_send_purchase_content_message(request):
|
||||||
# }[request.json['license_type']], 8)
|
# }[request.json['license_type']], 8)
|
||||||
.store_uint(0, 256)
|
.store_uint(0, 256)
|
||||||
.end_cell()
|
.end_cell()
|
||||||
).to_boc(False).hex()
|
).to_boc(False)).decode()
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue