Skip to content
This repository was archived by the owner on Apr 8, 2025. It is now read-only.

get getton data the url return method is modify #25

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions TonTools/Providers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,17 @@ def is_hex(str):


def process_jetton_data(data):
if not len(Cell.one_from_boc(b64decode(data)).refs):
url = Cell.one_from_boc(b64decode(data)).bits.get_top_upped_array().decode().split('\x01')[-1]
return url
else:
symbol = Cell.one_from_boc(b64decode(data)).refs[0].refs[1].refs[0].refs[1].refs[0].bits.get_top_upped_array().decode().split('\x00')[-1]
desc1 = unicodedata.normalize("NFKD", Cell.one_from_boc(b64decode(data)).refs[0].refs[1].refs[1].refs[0].refs[0].bits.get_top_upped_array().decode().split('\x00')[-1]) # Cell.one_from_boc(b64decode(data)).refs[0].refs[1].refs[1].refs[0].refs
desc2 = unicodedata.normalize("NFKD", Cell.one_from_boc(b64decode(data)).refs[0].refs[1].refs[1].refs[0].refs[0].refs[0].bits.get_top_upped_array().decode().split('\x00')[-1]) if len(Cell.one_from_boc(b64decode(data)).refs[0].refs[1].refs[1].refs[0].refs[0].refs) else ''
decimals = Cell.one_from_boc(b64decode(data)).refs[0].refs[1].refs[1].refs[1].refs[0].bits.get_top_upped_array().decode().split('\x00')[-1]
name = Cell.one_from_boc(b64decode(data)).refs[0].refs[1].refs[0].refs[0].refs[0].bits.get_top_upped_array().decode().split('\x00')[-1]
image = Cell.one_from_boc(b64decode(data)).refs[0].refs[0].refs[0].bits.get_top_upped_array().decode().split('\x00')[-1]
try:
if Cell.one_from_boc(b64decode(data)).refs[0].refs[0].refs[0].bits:
url = Cell.one_from_boc(b64decode(data)).refs[0].refs[0].refs[0].bits.get_top_upped_array().decode().split('\x00')[-1]
return url
except:
symbol = Cell.one_from_boc(b64decode(data)).refs[0].refs[0].refs[1].refs[0].bits.get_top_upped_array().decode().split('\x00')[-1]
desc1 = unicodedata.normalize("NFKD", Cell.one_from_boc(b64decode(data)).refs[0].refs[1].refs[0].refs[0].bits.get_top_upped_array().decode().split('\x00')[-1]) # Cell.one_from_boc(b64decode(data)).refs[0].refs[1].refs[1].refs[0].refs
desc2 = unicodedata.normalize("NFKD", Cell.one_from_boc(b64decode(data)).refs[0].refs[1].refs[0].refs[0].refs[0].bits.get_top_upped_array().decode().split('\x00')[-1]) if len(Cell.one_from_boc(b64decode(data)).refs[0].refs[1].refs[0].refs[0].refs) else ''
decimals = Cell.one_from_boc(b64decode(data)).refs[0].refs[1].refs[1].refs[0].bits.get_top_upped_array().decode().split('\x00')[-1]
name = Cell.one_from_boc(b64decode(data)).refs[0].refs[0].refs[0].refs[0].bits.get_top_upped_array().decode().split('\x00')[-1]
image = ""
return {
'name': name,
'description': desc1 + desc2,
Expand Down