diff --git a/.github/workflows/reusable_swap_functional_tests.yml b/.github/workflows/reusable_swap_functional_tests.yml index 4dde2f8d..f8ab0d19 100644 --- a/.github/workflows/reusable_swap_functional_tests.yml +++ b/.github/workflows/reusable_swap_functional_tests.yml @@ -93,6 +93,15 @@ on: default: 'LedgerHQ/app-tron' type: string + branch_for_ton: + required: false + default: 'develop' + type: string + repo_for_ton: + required: false + default: 'LedgerHQ/app-ton' + type: string + test_filter: required: false default: '""' @@ -146,6 +155,9 @@ jobs: - name: tron repo: ${{ inputs.repo_for_tron }} branch: ${{ inputs.branch_for_tron }} + - name: ton + repo: ${{ inputs.repo_for_ton }} + branch: ${{ inputs.branch_for_ton }} uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1 with: diff --git a/test/python/apps/cal.py b/test/python/apps/cal.py index 2ad1c807..f057f10d 100644 --- a/test/python/apps/cal.py +++ b/test/python/apps/cal.py @@ -18,6 +18,7 @@ from .xrp import XRP_PACKED_DERIVATION_PATH, XRP_CONF from .tezos import XTZ_PACKED_DERIVATION_PATH, XTZ_CONF from .polkadot import DOT_PACKED_DERIVATION_PATH, DOT_CONF +from .ton import TON_PACKED_DERIVATION_PATH, TON_CONF from .tron import TRX_PACKED_DERIVATION_PATH, TRX_CONF from .tron import TRX_USDT_CONF, TRX_USDC_CONF, TRX_TUSD_CONF, TRX_USDD_CONF @@ -46,6 +47,8 @@ def get_conf_for_ticker(self, overload_signer: Optional[SigningAuthority]=None) BNB_LEGACY_CURRENCY_CONFIGURATION = CurrencyConfiguration(ticker="BNB", conf=BSC_CONF_LEGACY, packed_derivation_path=BSC_PACKED_DERIVATION_PATH) DAI_CURRENCY_CONFIGURATION = CurrencyConfiguration(ticker="DAI", conf=DAI_CONF, packed_derivation_path=DAI_PACKED_DERIVATION_PATH) DOT_CURRENCY_CONFIGURATION = CurrencyConfiguration(ticker="DOT", conf=DOT_CONF, packed_derivation_path=DOT_PACKED_DERIVATION_PATH) +TON_CURRENCY_CONFIGURATION = CurrencyConfiguration(ticker="TON", conf=TON_CONF, packed_derivation_path=TON_PACKED_DERIVATION_PATH) +TON_USDT_CURRENCY_CONFIGURATION = CurrencyConfiguration(ticker="TON", conf=TON_CONF, packed_derivation_path=TON_PACKED_DERIVATION_PATH) TRX_CURRENCY_CONFIGURATION = CurrencyConfiguration(ticker="TRX", conf=TRX_CONF, packed_derivation_path=TRX_PACKED_DERIVATION_PATH) USDT_CURRENCY_CONFIGURATION = CurrencyConfiguration(ticker="USDT", conf=TRX_USDT_CONF, packed_derivation_path=TRX_PACKED_DERIVATION_PATH) USDC_CURRENCY_CONFIGURATION = CurrencyConfiguration(ticker="USDC", conf=TRX_USDC_CONF, packed_derivation_path=TRX_PACKED_DERIVATION_PATH) diff --git a/test/python/apps/ton.py b/test/python/apps/ton.py new file mode 100644 index 00000000..080d4b33 --- /dev/null +++ b/test/python/apps/ton.py @@ -0,0 +1,37 @@ +import sys +import base64 +from pathlib import Path +from fastcrc import crc16 +from enum import IntEnum + +from ragger.backend.interface import BackendInterface, RAPDU +from ragger.bip import pack_derivation_path +from ragger.utils import create_currency_config +from ragger.error import ExceptionRAPDU + +TON_CONF = create_currency_config("TON", "TON") + +TON_DERIVATION_PATH = "m/44'/607'/0'/0'/0'/0'" +TON_PACKED_DERIVATION_PATH = pack_derivation_path(TON_DERIVATION_PATH) +DEVICE_PUBLIC_KEY = bytes.fromhex("9aff66dcc01b79787f6038c8070b8f7b9f27e381297c846a59f743bb075ed61c") + +SW_SWAP_FAILURE = 0xB009 + +MAX_APDU_LEN: int = 255 +CLA = 0xE0 + +class Bounceability(IntEnum): + BOUNCEABLE = 0x11 + NON_BOUNCEABLE = 0x51 + +class WorkchainID(IntEnum): + BASE_CHAIN = 0x00 + MASTER_CHAIN = 0xff + +def craft_address(bounceability: Bounceability, workchain_id: WorkchainID, device_public_key: bytes): + payload = b'' + payload += int.to_bytes(bounceability, length=1, byteorder='big') + payload += int.to_bytes(workchain_id, length=1, byteorder='big') + payload += device_public_key + payload += int.to_bytes(crc16.xmodem(payload), length=2, byteorder='big') + return base64.b64encode(payload) diff --git a/test/python/apps/ton_application_client/__init__.py b/test/python/apps/ton_application_client/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/test/python/apps/ton_application_client/my_builder.py b/test/python/apps/ton_application_client/my_builder.py new file mode 100644 index 00000000..c64a1b3c --- /dev/null +++ b/test/python/apps/ton_application_client/my_builder.py @@ -0,0 +1,25 @@ +from tonsdk.boc import Builder + + +class MyBuilder(Builder): + def store_maybe_ref(self, src): + if src is not None: + self.store_bit(1) + self.store_ref(src) + else: + self.store_bit(0) + + return self + + def store_string_tail(self, bs: bytes): + store_max = self.bits.get_free_bits() // 8 + self.store_bytes(bs[:store_max]) + if len(bs) > store_max: + inner = begin_cell().store_string_tail(bs[store_max:]).end_cell() + self.store_ref(inner) + + return self + + +def begin_cell(): + return MyBuilder() diff --git a/test/python/apps/ton_application_client/ton_command_sender.py b/test/python/apps/ton_application_client/ton_command_sender.py new file mode 100644 index 00000000..692cdfe9 --- /dev/null +++ b/test/python/apps/ton_application_client/ton_command_sender.py @@ -0,0 +1,211 @@ +from enum import IntEnum, IntFlag +from typing import Generator, Optional +from contextlib import contextmanager + +from ragger.backend.interface import BackendInterface, RAPDU +from ragger.bip import pack_derivation_path + +from .ton_utils import split_message + + +MAX_APDU_LEN: int = 255 + +CLA: int = 0xE0 + +class P1(IntEnum): + P1_NONE = 0x00 + + P1_CONFIRM = 0x01 + + P1_NON_CONFIRM = 0x00 + +class P2(IntFlag): + P2_NONE = 0x00 + + P2_FIRST = 0x01 + + P2_MORE = 0x02 + +class InsType(IntEnum): + GET_VERSION = 0x03 + GET_APP_NAME = 0x04 + GET_PUBLIC_KEY = 0x05 + SIGN_TX = 0x06 + GET_ADDRESS_PROOF = 0x08 + SIGN_DATA = 0x09 + GET_APP_SETTINGS = 0x0A + +class Errors(IntEnum): + SW_DENY = 0x6985 + SW_WRONG_P1P2 = 0x6A86 + SW_WRONG_DATA_LENGTH = 0x6A87 + SW_INS_NOT_SUPPORTED = 0x6D00 + SW_CLA_NOT_SUPPORTED = 0x6E00 + SW_WRONG_RESPONSE_LENGTH = 0xB000 + SW_DISPLAY_ADDRESS_FAIL = 0xB002 + SW_DISPLAY_AMOUNT_FAIL = 0xB003 + SW_WRONG_TX_LENGTH = 0xB004 + SW_TX_PARSING_FAIL = 0xB010 + SW_WRONG_SIGN_DATA_LENGTH = 0xB005 + SW_SIGN_DATA_PARSING_FAIL = 0xB011 + SW_BAD_STATE = 0xB007 + SW_SIGNATURE_FAIL = 0xB008 + SW_REQUEST_TOO_LONG = 0xB00B + SW_BAD_BIP32_PATH = 0XB0BD + SW_BLIND_SIGNING_DISABLED = 0xBD00 + +class AddressDisplayFlags(IntFlag): + NONE = 0 + TESTNET = 1 + MASTERCHAIN = 2 + + +class BoilerplateCommandSender: + def __init__(self, backend: BackendInterface) -> None: + self.backend = backend + + + def get_app_and_version(self) -> RAPDU: + return self.backend.exchange(cla=0xB0, # specific CLA for BOLOS + ins=0x01, # specific INS for get_app_and_version + p1=P1.P1_NONE, + p2=P2.P2_NONE, + data=b"") + + + def get_version(self) -> RAPDU: + return self.backend.exchange(cla=CLA, + ins=InsType.GET_VERSION, + p1=P1.P1_NONE, + p2=P2.P2_NONE, + data=b"") + + + def get_app_name(self) -> RAPDU: + return self.backend.exchange(cla=CLA, + ins=InsType.GET_APP_NAME, + p1=P1.P1_NONE, + p2=P2.P2_NONE, + data=b"") + + + def get_public_key(self, path: str) -> RAPDU: + return self.backend.exchange(cla=CLA, + ins=InsType.GET_PUBLIC_KEY, + p1=P1.P1_NON_CONFIRM, + p2=AddressDisplayFlags.NONE, + data=pack_derivation_path(path)) + + + def get_app_settings(self) -> RAPDU: + return self.backend.exchange(cla=CLA, + ins=InsType.GET_APP_SETTINGS, + p1=P1.P1_NONE, + p2=P2.P2_NONE, + data=b"") + + + @contextmanager + def get_public_key_with_confirmation(self, + path: str, + display_flags: AddressDisplayFlags, + is_v3r2: bool = False, + subwallet_id: int = 698983191, + ) -> Generator[None, None, None]: + specifiers = bytes([]) + if is_v3r2 or subwallet_id != 698983191: + display_flags |= 4 + specifiers = b"".join([ + bytes([1 if is_v3r2 else 0]), + subwallet_id.to_bytes(4, byteorder="big"), + ]) + with self.backend.exchange_async(cla=CLA, + ins=InsType.GET_PUBLIC_KEY, + p1=P1.P1_CONFIRM, + p2=display_flags, + data=b"".join([ + pack_derivation_path(path), + specifiers, + ])) as response: + yield response + + @contextmanager + def get_address_proof(self, + path: str, + display_flags: AddressDisplayFlags, + domain: str, + timestamp: int, + payload: bytes, + is_v3r2: bool = False, + subwallet_id: int = 698983191) -> Generator[None, None, None]: + domain_b = bytes(domain, "utf8") + specifiers = bytes([]) + if is_v3r2 or subwallet_id != 698983191: + display_flags |= 4 + specifiers = b"".join([ + bytes([1 if is_v3r2 else 0]), + subwallet_id.to_bytes(4, byteorder="big"), + ]) + req_bytes = b"".join([ + pack_derivation_path(path), + specifiers, + bytes([len(domain_b)]), + domain_b, + timestamp.to_bytes(8, byteorder="big"), + payload + ]) + with self.backend.exchange_async(cla=CLA, + ins=InsType.GET_ADDRESS_PROOF, + p1=P1.P1_CONFIRM, + p2=display_flags, + data=req_bytes) as response: + yield response + + @contextmanager + def sign_tx(self, path: str, transaction: bytes) -> Generator[None, None, None]: + self.backend.exchange(cla=CLA, + ins=InsType.SIGN_TX, + p1=P1.P1_NONE, + p2=(P2.P2_FIRST | P2.P2_MORE), + data=pack_derivation_path(path)) + messages = split_message(transaction, MAX_APDU_LEN) + + for msg in messages[:-1]: + self.backend.exchange(cla=CLA, + ins=InsType.SIGN_TX, + p1=P1.P1_NONE, + p2=P2.P2_MORE, + data=msg) + + with self.backend.exchange_async(cla=CLA, + ins=InsType.SIGN_TX, + p1=P1.P1_NONE, + p2=P2.P2_NONE, + data=messages[-1]) as response: + yield response + + @contextmanager + def sign_data(self, path: str, data: bytes) -> Generator[None, None, None]: + self.backend.exchange(cla=CLA, + ins=InsType.SIGN_DATA, + p1=P1.P1_NONE, + p2=(P2.P2_FIRST | P2.P2_MORE), + data=pack_derivation_path(path)) + messages = split_message(data, MAX_APDU_LEN) + + for msg in messages[:-1]: + self.backend.exchange(cla=CLA, + ins=InsType.SIGN_DATA, + p1=P1.P1_NONE, + p2=P2.P2_MORE, + data=msg) + + with self.backend.exchange_async(cla=CLA, + ins=InsType.SIGN_DATA, + p1=P1.P1_NONE, + p2=P2.P2_NONE, + data=messages[-1]) as response: + yield response + + def get_async_response(self) -> Optional[RAPDU]: + return self.backend.last_async_response diff --git a/test/python/apps/ton_application_client/ton_response_unpacker.py b/test/python/apps/ton_application_client/ton_response_unpacker.py new file mode 100644 index 00000000..75e8bb9e --- /dev/null +++ b/test/python/apps/ton_application_client/ton_response_unpacker.py @@ -0,0 +1,76 @@ +from typing import Tuple +from struct import unpack + +# remainder, data_len, data +def pop_sized_buf_from_buffer(buffer:bytes, size:int) -> Tuple[bytes, bytes]: + return buffer[size:], buffer[0:size] + +# remainder, data_len, data +def pop_size_prefixed_buf_from_buf(buffer:bytes) -> Tuple[bytes, int, bytes]: + data_len = buffer[0] + return buffer[1+data_len:], data_len, buffer[1:data_len+1] + +# Unpack from response: +# response = app_name (var) +def unpack_get_app_name_response(response: bytes) -> str: + return response.decode("ascii") + +# Unpack from response: +# response = MAJOR (1) +# MINOR (1) +# PATCH (1) +def unpack_get_version_response(response: bytes) -> Tuple[int, int, int]: + assert len(response) == 3 + major, minor, patch = unpack("BBB", response) + return (major, minor, patch) + +# Unpack from response: +# response = format_id (1) +# app_name_raw_len (1) +# app_name_raw (var) +# version_raw_len (1) +# version_raw (var) +# unused_len (1) +# unused (var) +def unpack_get_app_and_version_response(response: bytes) -> Tuple[str, str]: + response, _ = pop_sized_buf_from_buffer(response, 1) + response, _, app_name_raw = pop_size_prefixed_buf_from_buf(response) + response, _, version_raw = pop_size_prefixed_buf_from_buf(response) + response, _, _ = pop_size_prefixed_buf_from_buf(response) + + assert len(response) == 0 + + return app_name_raw.decode("ascii"), version_raw.decode("ascii") + +def unpack_sign_tx_response(response: bytes) -> Tuple[bytes, bytes]: + response, sig_len, sig = pop_size_prefixed_buf_from_buf(response) + response, hash_len, hash_b = pop_size_prefixed_buf_from_buf(response) + + assert sig_len == len(sig) + assert hash_len == len(hash_b) + + assert len(response) == 0 + + return sig, hash_b + +def unpack_sign_data_response(response: bytes) -> Tuple[bytes, bytes]: + response, sig_len, sig = pop_size_prefixed_buf_from_buf(response) + response, hash_len, hash_b = pop_size_prefixed_buf_from_buf(response) + + assert sig_len == len(sig) + assert hash_len == len(hash_b) + + assert len(response) == 0 + + return sig, hash_b + +def unpack_proof_response(response: bytes) -> Tuple[bytes, bytes]: + response, sig_len, sig = pop_size_prefixed_buf_from_buf(response) + response, hash_len, hash_b = pop_size_prefixed_buf_from_buf(response) + + assert sig_len == len(sig) + assert hash_len == len(hash_b) + + assert len(response) == 0 + + return sig, hash_b diff --git a/test/python/apps/ton_application_client/ton_sign_data.py b/test/python/apps/ton_application_client/ton_sign_data.py new file mode 100644 index 00000000..2614532b --- /dev/null +++ b/test/python/apps/ton_application_client/ton_sign_data.py @@ -0,0 +1,119 @@ +from abc import ABC, abstractmethod +from time import time +from typing import Optional + +from tonsdk.boc import Cell +from tonsdk.utils import Address + +from .my_builder import begin_cell +from .ton_utils import write_address, write_cell + + +class SignDataRequest(ABC): + def __init__(self, timestamp=int(time())): + self.timestamp: int = timestamp + + def common_part(self) -> bytes: + return b"".join([ + self.schema_crc().to_bytes(4, byteorder="big"), + self.timestamp.to_bytes(8, byteorder="big") + ]) + + @abstractmethod + def payload_bytes(self) -> bytes: + return bytes() + + def to_request_bytes(self) -> bytes: + return b"".join([ + self.common_part(), + self.payload_bytes() + ]) + + def to_signed_data(self) -> bytes: + return b"".join([ + self.common_part(), + self.to_cell().bytes_hash() + ]) + + @abstractmethod + def to_cell(self) -> Cell: + return Cell() + + @abstractmethod + def schema_crc(self) -> int: + return 0 + + +class PlaintextSignDataRequest(SignDataRequest): + def __init__(self, text: str, timestamp=int(time())): + super().__init__(timestamp) + self.text: str = text + + def payload_bytes(self) -> bytes: + return bytes(self.text, "utf8") + + def schema_crc(self) -> int: + return 0x754bf91b + + def to_cell(self) -> Cell: + bs = bytes(self.text, "utf8") + return begin_cell().store_string_tail(bs).end_cell() + + +def encode_domain(d: str) -> Cell: + parts = reversed(d.split(".")) + b = begin_cell() + for p in parts: + b.store_string(p) + b.store_uint(0, 8) + return b.end_cell() + + +class AppDataSignDataRequest(SignDataRequest): + def __init__(self, + data: Cell, + address: Optional[Address] = None, + domain: Optional[str] = None, + ext: Optional[Cell] = None, + timestamp=int(time())): + if address is None and domain is None: + raise ValueError("address and domain cannot both be None") + super().__init__(timestamp) + self.data: Cell = data + self.address: Optional[Address] = address + self.domain: Optional[str] = domain + self.ext: Optional[Cell] = ext + + def schema_crc(self) -> int: + return 0x54b58535 + + def to_cell(self) -> Cell: + b = begin_cell() + if self.address is not None: + b.store_bit(1) + b.store_address(self.address) + else: + b.store_bit(0) + b.store_maybe_ref(encode_domain(self.domain) if self.domain is not None else None) + b.store_ref(self.data) + b.store_maybe_ref(self.ext) + return b.end_cell() + + def payload_bytes(self) -> bytes: + db = bytes(self.domain, "utf8") + return b"".join([ + (b"".join([ + bytes([1]), + write_address(self.address) + ]) if self.address is not None else bytes([0])), + (b"".join([ + bytes([1]), + bytes([len(db)]), + db, + ]) if self.domain is not None else bytes([0])), + write_cell(self.data), + (b"".join([ + bytes([1]), + write_cell(self.ext) + ]) if self.ext is not None else bytes([0])) + ]) diff --git a/test/python/apps/ton_application_client/ton_transaction.py b/test/python/apps/ton_application_client/ton_transaction.py new file mode 100644 index 00000000..e7dc9024 --- /dev/null +++ b/test/python/apps/ton_application_client/ton_transaction.py @@ -0,0 +1,694 @@ +from dataclasses import dataclass +from enum import IntFlag, IntEnum +from typing import Optional +from abc import ABC, abstractmethod + +from tonsdk.utils import Address +from tonsdk.boc import Cell + +from .ton_utils import write_varuint, write_address, write_cell +from .my_builder import begin_cell + + +class SendMode(IntFlag): + CARRRY_ALL_REMAINING_BALANCE = 128 + CARRRY_ALL_REMAINING_INCOMING_VALUE = 64 + DESTROY_ACCOUNT_IF_ZERO = 32 + IGNORE_ERRORS = 2 + PAY_GAS_SEPARATLY = 1 + NONE = 0 + + +@dataclass +class StateInit: + code: Cell + data: Cell + + def to_cell(self) -> Cell: + return ( + begin_cell() + .store_uint(0, 2) + .store_maybe_ref(self.code) + .store_maybe_ref(self.data) + .store_uint(0, 1) + .end_cell() + ) + + +class Payload(ABC): + @abstractmethod + def to_request_bytes(self) -> Optional[bytes]: + return bytes() + + @abstractmethod + def to_message_body_cell(self) -> Cell: + return Cell() + + +def is_string_ascii_printable(s: str) -> bool: + for c in bytes(s, encoding="utf8"): + if c < 0x20: + return False + if c >= 0x7f: + return False + return True + + +class PayloadID(IntEnum): + COMMENT = 0 + JETTON_TRANSFER = 1 + NFT_TRANSFER = 2 + JETTON_BURN = 3 + ADD_WHITELIST = 4 + SINGLE_NOMINATOR_WITHDRAW = 5 + SINGLE_NOMINATOR_CHANGE_VALIDATOR = 6 + TONSTAKERS_DEPOSIT = 7 + JETTON_DAO_VOTE = 8 + CHANGE_DNS_RECORD = 9 + TOKEN_BRIDGE_PAY_SWAP = 10 + + +class CommentPayload(Payload): + def __init__(self, comment: str) -> None: + if not is_string_ascii_printable(comment) or len(comment) > 120: + raise ValueError("Comment string must be a printable ASCII string" + "and must be 120 chars or less") + self.comment: str = comment + + def to_request_bytes(self) -> bytes: + return b"".join([ + (PayloadID.COMMENT).to_bytes(4, byteorder="big"), + len(self.comment).to_bytes(2, byteorder="big"), + bytes(self.comment, "utf8") + ]) + + def to_message_body_cell(self) -> Cell: + return begin_cell().store_uint(0, 32).store_bytes(bytes(self.comment, "utf8")).end_cell() + + +# pylint: disable-next=too-many-instance-attributes +class JettonTransferPayload(Payload): + def __init__(self, + amount: int, + to: Address, + response_destination: Optional[Address] = None, + query_id: Optional[int] = None, + custom_payload: Optional[Cell] = None, + forward_amount: int = 0, + forward_payload: Optional[Cell] = None, + jetton_id: Optional[int] = None, + owner_workchain: int = 0) -> None: + self.query_id: int = query_id if query_id is not None else 0 + self.amount: int = amount + self.destination: Address = to + self.response_destionation: Address = ( + response_destination if response_destination is not None else to + ) + self.custom_payload: Optional[Cell] = custom_payload + self.forward_amount: int = forward_amount + self.forward_payload: Optional[Cell] = forward_payload + self.jetton_id: Optional[int] = jetton_id + self.owner_workchain = owner_workchain + + def to_request_bytes(self) -> bytes: + flags = 0 + if self.query_id != 0: + flags |= 1 + if self.jetton_id is not None: + flags |= 2 + + main_body = b"".join([ + bytes([flags]), + self.query_id.to_bytes(8, byteorder="big") if self.query_id != 0 else bytes([]), + (b"".join([ + self.jetton_id.to_bytes(2, byteorder="big"), + bytes([self.owner_workchain]), + ])) if self.jetton_id is not None else bytes([]), + write_varuint(self.amount), + write_address(self.destination), + write_address(self.response_destionation), + (b"".join([ + bytes([1]), + write_cell(self.custom_payload) + ]) if self.custom_payload is not None else bytes([0])), + write_varuint(self.forward_amount), + (b"".join([ + bytes([1]), + write_cell(self.forward_payload) + ]) if self.forward_payload is not None else bytes([0])) + ]) + return b"".join([ + (PayloadID.JETTON_TRANSFER).to_bytes(4, byteorder="big"), + len(main_body).to_bytes(2, byteorder="big"), + main_body + ]) + + def to_message_body_cell(self) -> Cell: + return ( + begin_cell() + .store_uint(0x0f8a7ea5, 32) + .store_uint(self.query_id, 64) + .store_coins(self.amount) + .store_address(self.destination) + .store_address(self.response_destionation) + .store_maybe_ref(self.custom_payload) + .store_coins(self.forward_amount) + .store_maybe_ref(self.forward_payload) + .end_cell() + ) + + +class CustomUnsafePayload(Payload): + def __init__(self, cell: Cell) -> None: + self.cell: Cell = cell + + def to_request_bytes(self) -> Optional[bytes]: + return None + + def to_message_body_cell(self) -> Cell: + return self.cell + + +class NFTTransferPayload(Payload): + def __init__(self, + to: Address, + response_destination: Optional[Address] = None, + query_id: Optional[int] = None, + custom_payload: Optional[Cell] = None, + forward_amount: int = 0, + forward_payload: Optional[Cell] = None) -> None: + self.query_id: int = query_id if query_id is not None else 0 + self.new_owner: Address = to + self.response_destionation: Address = ( + response_destination if response_destination is not None else to + ) + self.custom_payload: Optional[Cell] = custom_payload + self.forward_amount: int = forward_amount + self.forward_payload: Optional[Cell] = forward_payload + + def to_request_bytes(self) -> bytes: + main_body = b"".join([ + (b"".join([ + bytes([1]), + self.query_id.to_bytes(8, byteorder="big") + ]) if self.query_id != 0 else bytes([0])), + write_address(self.new_owner), + write_address(self.response_destionation), + (b"".join([ + bytes([1]), + write_cell(self.custom_payload) + ]) if self.custom_payload is not None else bytes([0])), + write_varuint(self.forward_amount), + (b"".join([ + bytes([1]), + write_cell(self.forward_payload) + ]) if self.forward_payload is not None else bytes([0])) + ]) + return b"".join([ + (PayloadID.NFT_TRANSFER).to_bytes(4, byteorder="big"), + len(main_body).to_bytes(2, byteorder="big"), + main_body + ]) + + def to_message_body_cell(self) -> Cell: + return ( + begin_cell() + .store_uint(0x5fcc3d14, 32) + .store_uint(self.query_id, 64) + .store_address(self.new_owner) + .store_address(self.response_destionation) + .store_maybe_ref(self.custom_payload) + .store_coins(self.forward_amount) + .store_maybe_ref(self.forward_payload) + .end_cell() + ) + + +class JettonBurnPayload(Payload): + def __init__(self, + amount: int, + response_destination: Address, + query_id: Optional[int] = None, + custom_payload: Optional[Cell | bytes] = None) -> None: + self.query_id: int = query_id if query_id is not None else 0 + self.amount: int = amount + self.response_destionation: Address = response_destination + self.custom_payload: Optional[Cell | bytes] = custom_payload + + def to_request_bytes(self) -> bytes: + main_body = b"".join([ + (b"".join([ + bytes([1]), + self.query_id.to_bytes(8, byteorder="big") + ]) if self.query_id != 0 else bytes([0])), + write_varuint(self.amount), + write_address(self.response_destionation), + ((b"".join([ + bytes([2]), + bytes([len(self.custom_payload)]), + self.custom_payload + ]) if isinstance(self.custom_payload, bytes) else b"".join([ + bytes([1]), + write_cell(self.custom_payload) + ])) if self.custom_payload is not None else bytes([0])) + ]) + return b"".join([ + (PayloadID.JETTON_BURN).to_bytes(4, byteorder="big"), + len(main_body).to_bytes(2, byteorder="big"), + main_body + ]) + + def to_message_body_cell(self) -> Cell: + cp = self.custom_payload + if isinstance(self.custom_payload, bytes): + cp = begin_cell().store_bytes(self.custom_payload).end_cell() + + return ( + begin_cell() + .store_uint(0x595f07bc, 32) + .store_uint(self.query_id, 64) + .store_coins(self.amount) + .store_address(self.response_destionation) + .store_maybe_ref(cp) + .end_cell() + ) + + +class AddWhitelistPayload(Payload): + def __init__(self, + address: Address, + query_id: Optional[int] = None) -> None: + self.query_id: int = query_id if query_id is not None else 0 + self.address: Address = address + + def to_request_bytes(self) -> bytes: + main_body = b"".join([ + (b"".join([ + bytes([1]), + self.query_id.to_bytes(8, byteorder="big") + ]) if self.query_id != 0 else bytes([0])), + write_address(self.address) + ]) + return b"".join([ + (PayloadID.ADD_WHITELIST).to_bytes(4, byteorder="big"), + len(main_body).to_bytes(2, byteorder="big"), + main_body + ]) + + def to_message_body_cell(self) -> Cell: + return ( + begin_cell() + .store_uint(0x7258a69b, 32) + .store_uint(self.query_id, 64) + .store_address(self.address) + .end_cell() + ) + + +class SingleNominatorWithdrawPayload(Payload): + def __init__(self, + amount: int, + query_id: Optional[int] = None) -> None: + self.query_id: int = query_id if query_id is not None else 0 + self.amount: int = amount + + def to_request_bytes(self) -> bytes: + main_body = b"".join([ + (b"".join([ + bytes([1]), + self.query_id.to_bytes(8, byteorder="big") + ]) if self.query_id != 0 else bytes([0])), + write_varuint(self.amount) + ]) + return b"".join([ + (PayloadID.SINGLE_NOMINATOR_WITHDRAW).to_bytes(4, byteorder="big"), + len(main_body).to_bytes(2, byteorder="big"), + main_body + ]) + + def to_message_body_cell(self) -> Cell: + return ( + begin_cell() + .store_uint(0x1000, 32) + .store_uint(self.query_id, 64) + .store_coins(self.amount) + .end_cell() + ) + + +class ChangeValidatorPayload(Payload): + def __init__(self, + address: Address, + query_id: Optional[int] = None) -> None: + self.query_id: int = query_id if query_id is not None else 0 + self.address: Address = address + + def to_request_bytes(self) -> bytes: + main_body = b"".join([ + (b"".join([ + bytes([1]), + self.query_id.to_bytes(8, byteorder="big") + ]) if self.query_id != 0 else bytes([0])), + write_address(self.address) + ]) + return b"".join([ + (PayloadID.SINGLE_NOMINATOR_CHANGE_VALIDATOR).to_bytes(4, byteorder="big"), + len(main_body).to_bytes(2, byteorder="big"), + main_body + ]) + + def to_message_body_cell(self) -> Cell: + return ( + begin_cell() + .store_uint(0x1001, 32) + .store_uint(self.query_id, 64) + .store_address(self.address) + .end_cell() + ) + + +class TonstakersDepositPayload(Payload): + def __init__(self, + app_id: Optional[int] = None, + query_id: Optional[int] = None) -> None: + self.query_id: int = query_id if query_id is not None else 0 + self.app_id: Optional[int] = app_id + + def to_request_bytes(self) -> bytes: + main_body = b"".join([ + (b"".join([ + bytes([1]), + self.query_id.to_bytes(8, byteorder="big") + ]) if self.query_id != 0 else bytes([0])), + (b"".join([ + bytes([1]), + self.app_id.to_bytes(8, byteorder="big") + ]) if self.app_id is not None else bytes([0])) + ]) + return b"".join([ + (PayloadID.TONSTAKERS_DEPOSIT).to_bytes(4, byteorder="big"), + len(main_body).to_bytes(2, byteorder="big"), + main_body + ]) + + def to_message_body_cell(self) -> Cell: + b = ( + begin_cell() + .store_uint(0x47d54391, 32) + .store_uint(self.query_id, 64) + ) + + if self.app_id is not None: + b = b.store_uint(self.app_id, 64) + + return b.end_cell() + + +class JettonDAOVotePayload(Payload): + def __init__(self, + voting_address: Address, + expiration_date: int, + vote: bool, + need_confirmation: bool, + query_id: Optional[int] = None) -> None: + self.query_id: int = query_id if query_id is not None else 0 + self.voting_address: Address = voting_address + self.expiration_date: int = expiration_date + self.vote: bool = vote + self.need_confirmation: bool = need_confirmation + + def to_request_bytes(self) -> bytes: + main_body = b"".join([ + (b"".join([ + bytes([1]), + self.query_id.to_bytes(8, byteorder="big") + ]) if self.query_id != 0 else bytes([0])), + write_address(self.voting_address), + self.expiration_date.to_bytes(6, byteorder="big"), + bytes([1 if self.vote else 0]), + bytes([1 if self.need_confirmation else 0]) + ]) + return b"".join([ + (PayloadID.JETTON_DAO_VOTE).to_bytes(4, byteorder="big"), + len(main_body).to_bytes(2, byteorder="big"), + main_body + ]) + + def to_message_body_cell(self) -> Cell: + return ( + begin_cell() + .store_uint(0x69fb306c, 32) + .store_uint(self.query_id, 64) + .store_address(self.voting_address) + .store_uint(self.expiration_date, 48) + .store_bit(self.vote) + .store_bit(self.need_confirmation) + .end_cell() + ) + + +class ChangeDNSWalletPayload(Payload): + def __init__(self, + wallet: Optional[Address], + has_capabilities: bool, + is_wallet: bool, + query_id: Optional[int] = None) -> None: + if is_wallet and not has_capabilities: + raise ValueError("DNS wallet record cannot be a wallet without capabilities") + self.query_id: int = query_id if query_id is not None else 0 + self.wallet: Optional[Address] = wallet + self.has_capabilities: bool = has_capabilities + self.is_wallet: bool = is_wallet + + def to_request_bytes(self) -> bytes: + main_body = b"".join([ + (b"".join([ + bytes([1]), + self.query_id.to_bytes(8, byteorder="big") + ]) if self.query_id != 0 else bytes([0])), + bytes([1 if self.wallet is not None else 0]), + bytes([0]), + (b"".join([ + write_address(self.wallet), + bytes([1 if self.has_capabilities else 0]), + bytes([1 if self.is_wallet else 0]) if self.has_capabilities else bytes([]) + ]) if self.wallet is not None else bytes([])) + ]) + return b"".join([ + (PayloadID.CHANGE_DNS_RECORD).to_bytes(4, byteorder="big"), + len(main_body).to_bytes(2, byteorder="big"), + main_body + ]) + + def to_message_body_cell(self) -> Cell: + b = ( + begin_cell() + .store_uint(0x4eb1f0f9, 32) + .store_uint(self.query_id, 64) + .store_bytes(bytes([0xe8, 0xd4, 0x40, 0x50, 0x87, 0x3d, 0xba, 0x86, 0x5a, 0xa7, 0xc1, + 0x70, 0xab, 0x4c, 0xce, 0x64, 0xd9, 0x08, 0x39, 0xa3, 0x4d, 0xcf, + 0xd6, 0xcf, 0x71, 0xd1, 0x4e, 0x02, 0x05, 0x44, 0x3b, 0x1b])) + ) + + if self.wallet is not None: + rb = ( + begin_cell() + .store_uint(0x9fd3, 16) + .store_address(self.wallet) + .store_uint(1 if self.has_capabilities else 0, 8) + ) + + if self.has_capabilities: + if self.is_wallet: + rb = ( + rb.store_uint(1, 1) + .store_uint(0x2177, 16) + ) + + rb = rb.store_uint(0, 1) + + b = b.store_ref(rb.end_cell()) + + return b.end_cell() + + +class ChangeDNSPayload(Payload): + def __init__(self, + key: bytes, + value: Optional[Cell], + query_id: Optional[int] = None) -> None: + self.query_id: int = query_id if query_id is not None else 0 + self.key: bytes = key + self.value: Optional[Cell] = value + + def to_request_bytes(self) -> bytes: + main_body = b"".join([ + (b"".join([ + bytes([1]), + self.query_id.to_bytes(8, byteorder="big") + ]) if self.query_id != 0 else bytes([0])), + bytes([1 if self.value is not None else 0]), + bytes([1]), + self.key, + write_cell(self.value) if self.value is not None else bytes([]) + ]) + return b"".join([ + (PayloadID.CHANGE_DNS_RECORD).to_bytes(4, byteorder="big"), + len(main_body).to_bytes(2, byteorder="big"), + main_body + ]) + + def to_message_body_cell(self) -> Cell: + b = ( + begin_cell() + .store_uint(0x4eb1f0f9, 32) + .store_uint(self.query_id, 64) + .store_bytes(self.key) + ) + + if self.value is not None: + b = b.store_ref(self.value) + + return b.end_cell() + + +class TokenBridgePaySwapPayload(Payload): + def __init__(self, + swap_id: bytes, + query_id: Optional[int] = None) -> None: + self.query_id: int = query_id if query_id is not None else 0 + self.swap_id: bytes = swap_id + + def to_request_bytes(self) -> bytes: + main_body = b"".join([ + (b"".join([ + bytes([1]), + self.query_id.to_bytes(8, byteorder="big") + ]) if self.query_id != 0 else bytes([0])), + self.swap_id + ]) + return b"".join([ + (PayloadID.TOKEN_BRIDGE_PAY_SWAP).to_bytes(4, byteorder="big"), + len(main_body).to_bytes(2, byteorder="big"), + main_body + ]) + + def to_message_body_cell(self) -> Cell: + return ( + begin_cell() + .store_uint(8, 32) + .store_uint(self.query_id, 64) + .store_bytes(self.swap_id) + .end_cell() + ) + + +# pylint: disable-next=too-many-instance-attributes +class Transaction: + def __init__(self, + to: Address, + send_mode: SendMode, + seqno: int, + timeout: int, + bounce: bool, + amount: int, + state_init: Optional[StateInit] = None, + payload: Optional[Payload] = None, + subwallet_id: Optional[int] = None, + include_wallet_op: bool = True) -> None: + self.to: Address = to + self.send_mode: SendMode = send_mode + self.seqno: int = seqno + self.timeout: int = timeout + self.bounce: bool = bounce + self.amount: int = amount + self.state_init: Optional[StateInit] = state_init + self.payload: Optional[Payload] = payload + self.subwallet_id: Optional[int] = subwallet_id + self.include_wallet_op: bool = include_wallet_op + + def header_bytes(self) -> bytes: + if not self.include_wallet_op or self.subwallet_id is not None: + return b"".join([ + bytes([1]), + ( + (self.subwallet_id if self.subwallet_id is not None else 698983191) + .to_bytes(4, byteorder="big") + ), + bytes([1 if self.include_wallet_op else 0]) + ]) + + return bytes([0]) + + def to_request_bytes(self) -> bytes: + return b"".join([ + self.header_bytes(), + self.seqno.to_bytes(4, byteorder="big"), + self.timeout.to_bytes(4, byteorder="big"), + write_varuint(self.amount), + write_address(self.to), + bytes([1 if self.bounce else 0]), + bytes([self.send_mode]), + self.state_init_part_bytes(), + self.payload_part_bytes() + ]) + + def state_init_part_bytes(self) -> bytes: + if self.state_init is None: + return bytes([0]) + + si_cell = self.state_init.to_cell() + return b"".join([ + bytes([1]), + write_cell(si_cell) + ]) + + def payload_part_bytes(self) -> bytes: + if self.payload is None: + return bytes([0, 0]) + + payload_bytes = self.payload.to_request_bytes() + payload_cell = self.payload.to_message_body_cell() + return b"".join([ + bytes([1]), + write_cell(payload_cell), + (b"".join([ + bytes([1]), + payload_bytes + ]) if payload_bytes is not None else bytes([0])) + ]) + + def order_cell(self) -> Cell: + b = ( + begin_cell() + .store_uint(1, 2) + .store_bit(self.bounce) + .store_uint(0, 3) + .store_address(self.to) + .store_coins(self.amount) + .store_uint(0, 1 + 4 + 4 + 64 + 32) + ) + if self.state_init is None: + b = b.store_bit(0) + else: + b = b.store_uint(3, 2).store_ref(self.state_init.to_cell()) + b = b.store_maybe_ref(None if self.payload is None else self.payload.to_message_body_cell()) + return b.end_cell() + + def transfer_cell(self) -> Cell: + b = ( + begin_cell() + .store_uint(698983191 if self.subwallet_id is None else self.subwallet_id, 32) + .store_uint(self.timeout, 32) + .store_uint(self.seqno, 32) + ) + + if self.include_wallet_op: + b = b.store_uint(0, 8) + + return ( + b + .store_uint(self.send_mode, 8) + .store_ref(self.order_cell()) + .end_cell() + ) diff --git a/test/python/apps/ton_application_client/ton_utils.py b/test/python/apps/ton_application_client/ton_utils.py new file mode 100644 index 00000000..3962a0fd --- /dev/null +++ b/test/python/apps/ton_application_client/ton_utils.py @@ -0,0 +1,87 @@ +from math import ceil +from hashlib import sha256 +from typing import List + +from tonsdk.utils import Address +from tonsdk.boc import Cell +from tonsdk.contract.wallet import WalletV4ContractR2, WalletV3ContractR2 + + +TON_PROOF_PREFIX = b"ton-proof-item-v2/" +TON_CONNECT_PREFIX = b"\xff\xffton-connect" + + +def write_varuint(n: int) -> bytes: + bitlen = len(bin(n)) - 2 + bytelen = ceil(bitlen / 8) + return b"".join([bytes([bytelen]), n.to_bytes(bytelen, byteorder="big")]) + + +def write_address(addr: Address) -> bytes: + return b"".join([ + bytes([0xff if addr.wc == -1 else 0]), + bytes(addr.hash_part) + ]) + + +def write_cell(cell: Cell) -> bytes: + return b"".join([ + bytes(cell.get_max_depth_as_array()), + cell.bytes_hash() + ]) + + +def build_ton_proof_message(workchain: int, + pubkey: bytes, + domain: str, + timestamp: int, + payload: bytes) -> bytes: + # we don't have private_key but the lib is buggy and requires it anyway + wallet = WalletV4ContractR2(public_key=pubkey, wc=workchain, private_key=bytes()) + + addr = wallet.address + domain_b = bytes(domain, "utf8") + inner = b"".join([ + TON_PROOF_PREFIX, + addr.wc.to_bytes(4, byteorder="big"), + bytes(addr.hash_part), + len(domain_b).to_bytes(4, byteorder="little"), + domain_b, + timestamp.to_bytes(8, byteorder="little"), + payload + ]) + inner_hash = sha256(inner).digest() + return sha256(b"".join([ + TON_CONNECT_PREFIX, + inner_hash + ])).digest() + + +def build_ton_proof_message_v3r2(workchain: int, + pubkey: bytes, + domain: str, + timestamp: int, + payload: bytes) -> bytes: + # we don't have private_key but the lib is buggy and requires it anyway + wallet = WalletV3ContractR2(public_key=pubkey, wc=workchain, private_key=bytes()) + + addr = wallet.address + domain_b = bytes(domain, "utf8") + inner = b"".join([ + TON_PROOF_PREFIX, + addr.wc.to_bytes(4, byteorder="big"), + bytes(addr.hash_part), + len(domain_b).to_bytes(4, byteorder="little"), + domain_b, + timestamp.to_bytes(8, byteorder="little"), + payload + ]) + inner_hash = sha256(inner).digest() + return sha256(b"".join([ + TON_CONNECT_PREFIX, + inner_hash + ])).digest() + + +def split_message(message: bytes, max_size: int) -> List[bytes]: + return [message[x:x + max_size] for x in range(0, len(message), max_size)] diff --git a/test/python/apps/ton_utils.py b/test/python/apps/ton_utils.py new file mode 100644 index 00000000..a754927e --- /dev/null +++ b/test/python/apps/ton_utils.py @@ -0,0 +1,13 @@ +from hashlib import sha512 +from ecdsa.curves import Ed25519 +from ecdsa.keys import VerifyingKey + +# Check if a signature of a given message is valid +def check_signature_validity(public_key: bytes, signature: bytes, message: bytes) -> bool: + pk: VerifyingKey = VerifyingKey.from_string( + public_key, + curve=Ed25519 + ) + return pk.verify(signature=signature, + data=message, + hashfunc=sha512) diff --git a/test/python/conftest.py b/test/python/conftest.py index df123d5a..233cb6f4 100644 --- a/test/python/conftest.py +++ b/test/python/conftest.py @@ -25,6 +25,7 @@ "solana": "Solana", "DOT": "Polkadot", "tron": "Tron", + "ton": "TON", } configuration.OPTIONAL.SIDELOADED_APPS_DIR = "test/python/lib_binaries/" diff --git a/test/python/requirements.txt b/test/python/requirements.txt index 6d674fa8..91cdfff4 100644 --- a/test/python/requirements.txt +++ b/test/python/requirements.txt @@ -6,4 +6,6 @@ xrpl-py scalecodec bip32 embit +fastcrc ledger_app_clients.ethereum @ https://github.com/LedgerHQ/app-ethereum/archive/develop.zip#subdirectory=client +tonsdk diff --git a/test/python/snapshots/flex/test_ton_fund_valid_1/post_sign/00000.png b/test/python/snapshots/flex/test_ton_fund_valid_1/post_sign/00000.png new file mode 100644 index 00000000..be51a9d5 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_fund_valid_1/post_sign/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_fund_valid_1/post_sign/00001.png b/test/python/snapshots/flex/test_ton_fund_valid_1/post_sign/00001.png new file mode 100644 index 00000000..5d892c4d Binary files /dev/null and b/test/python/snapshots/flex/test_ton_fund_valid_1/post_sign/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_fund_valid_1/review/00000.png b/test/python/snapshots/flex/test_ton_fund_valid_1/review/00000.png new file mode 100644 index 00000000..f37d56d2 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_fund_valid_1/review/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_fund_valid_1/review/00001.png b/test/python/snapshots/flex/test_ton_fund_valid_1/review/00001.png new file mode 100644 index 00000000..5906730c Binary files /dev/null and b/test/python/snapshots/flex/test_ton_fund_valid_1/review/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_fund_valid_1/review/00002.png b/test/python/snapshots/flex/test_ton_fund_valid_1/review/00002.png new file mode 100644 index 00000000..be64c0bc Binary files /dev/null and b/test/python/snapshots/flex/test_ton_fund_valid_1/review/00002.png differ diff --git a/test/python/snapshots/flex/test_ton_fund_valid_2/post_sign/00000.png b/test/python/snapshots/flex/test_ton_fund_valid_2/post_sign/00000.png new file mode 100644 index 00000000..be51a9d5 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_fund_valid_2/post_sign/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_fund_valid_2/post_sign/00001.png b/test/python/snapshots/flex/test_ton_fund_valid_2/post_sign/00001.png new file mode 100644 index 00000000..5d892c4d Binary files /dev/null and b/test/python/snapshots/flex/test_ton_fund_valid_2/post_sign/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_fund_valid_2/review/00000.png b/test/python/snapshots/flex/test_ton_fund_valid_2/review/00000.png new file mode 100644 index 00000000..f37d56d2 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_fund_valid_2/review/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_fund_valid_2/review/00001.png b/test/python/snapshots/flex/test_ton_fund_valid_2/review/00001.png new file mode 100644 index 00000000..765c6d1f Binary files /dev/null and b/test/python/snapshots/flex/test_ton_fund_valid_2/review/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_fund_valid_2/review/00002.png b/test/python/snapshots/flex/test_ton_fund_valid_2/review/00002.png new file mode 100644 index 00000000..be64c0bc Binary files /dev/null and b/test/python/snapshots/flex/test_ton_fund_valid_2/review/00002.png differ diff --git a/test/python/snapshots/flex/test_ton_fund_wrong_amount/post_sign/00000.png b/test/python/snapshots/flex/test_ton_fund_wrong_amount/post_sign/00000.png new file mode 100644 index 00000000..55f70ff1 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_fund_wrong_amount/post_sign/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_fund_wrong_amount/post_sign/00001.png b/test/python/snapshots/flex/test_ton_fund_wrong_amount/post_sign/00001.png new file mode 100644 index 00000000..5d892c4d Binary files /dev/null and b/test/python/snapshots/flex/test_ton_fund_wrong_amount/post_sign/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_fund_wrong_amount/review/00000.png b/test/python/snapshots/flex/test_ton_fund_wrong_amount/review/00000.png new file mode 100644 index 00000000..f37d56d2 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_fund_wrong_amount/review/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_fund_wrong_amount/review/00001.png b/test/python/snapshots/flex/test_ton_fund_wrong_amount/review/00001.png new file mode 100644 index 00000000..5906730c Binary files /dev/null and b/test/python/snapshots/flex/test_ton_fund_wrong_amount/review/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_fund_wrong_amount/review/00002.png b/test/python/snapshots/flex/test_ton_fund_wrong_amount/review/00002.png new file mode 100644 index 00000000..be64c0bc Binary files /dev/null and b/test/python/snapshots/flex/test_ton_fund_wrong_amount/review/00002.png differ diff --git a/test/python/snapshots/flex/test_ton_fund_wrong_destination/post_sign/00000.png b/test/python/snapshots/flex/test_ton_fund_wrong_destination/post_sign/00000.png new file mode 100644 index 00000000..55f70ff1 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_fund_wrong_destination/post_sign/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_fund_wrong_destination/post_sign/00001.png b/test/python/snapshots/flex/test_ton_fund_wrong_destination/post_sign/00001.png new file mode 100644 index 00000000..5d892c4d Binary files /dev/null and b/test/python/snapshots/flex/test_ton_fund_wrong_destination/post_sign/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_fund_wrong_destination/review/00000.png b/test/python/snapshots/flex/test_ton_fund_wrong_destination/review/00000.png new file mode 100644 index 00000000..f37d56d2 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_fund_wrong_destination/review/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_fund_wrong_destination/review/00001.png b/test/python/snapshots/flex/test_ton_fund_wrong_destination/review/00001.png new file mode 100644 index 00000000..5906730c Binary files /dev/null and b/test/python/snapshots/flex/test_ton_fund_wrong_destination/review/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_fund_wrong_destination/review/00002.png b/test/python/snapshots/flex/test_ton_fund_wrong_destination/review/00002.png new file mode 100644 index 00000000..be64c0bc Binary files /dev/null and b/test/python/snapshots/flex/test_ton_fund_wrong_destination/review/00002.png differ diff --git a/test/python/snapshots/flex/test_ton_sell_valid_1/post_sign/00000.png b/test/python/snapshots/flex/test_ton_sell_valid_1/post_sign/00000.png new file mode 100644 index 00000000..be51a9d5 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_sell_valid_1/post_sign/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_sell_valid_1/post_sign/00001.png b/test/python/snapshots/flex/test_ton_sell_valid_1/post_sign/00001.png new file mode 100644 index 00000000..5d892c4d Binary files /dev/null and b/test/python/snapshots/flex/test_ton_sell_valid_1/post_sign/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_sell_valid_1/review/00000.png b/test/python/snapshots/flex/test_ton_sell_valid_1/review/00000.png new file mode 100644 index 00000000..088a6d1b Binary files /dev/null and b/test/python/snapshots/flex/test_ton_sell_valid_1/review/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_sell_valid_1/review/00001.png b/test/python/snapshots/flex/test_ton_sell_valid_1/review/00001.png new file mode 100644 index 00000000..25ae19e7 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_sell_valid_1/review/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_sell_valid_1/review/00002.png b/test/python/snapshots/flex/test_ton_sell_valid_1/review/00002.png new file mode 100644 index 00000000..e8580839 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_sell_valid_1/review/00002.png differ diff --git a/test/python/snapshots/flex/test_ton_sell_valid_1/review/00003.png b/test/python/snapshots/flex/test_ton_sell_valid_1/review/00003.png new file mode 100644 index 00000000..289a7498 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_sell_valid_1/review/00003.png differ diff --git a/test/python/snapshots/flex/test_ton_sell_valid_2/post_sign/00000.png b/test/python/snapshots/flex/test_ton_sell_valid_2/post_sign/00000.png new file mode 100644 index 00000000..be51a9d5 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_sell_valid_2/post_sign/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_sell_valid_2/post_sign/00001.png b/test/python/snapshots/flex/test_ton_sell_valid_2/post_sign/00001.png new file mode 100644 index 00000000..5d892c4d Binary files /dev/null and b/test/python/snapshots/flex/test_ton_sell_valid_2/post_sign/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_sell_valid_2/review/00000.png b/test/python/snapshots/flex/test_ton_sell_valid_2/review/00000.png new file mode 100644 index 00000000..088a6d1b Binary files /dev/null and b/test/python/snapshots/flex/test_ton_sell_valid_2/review/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_sell_valid_2/review/00001.png b/test/python/snapshots/flex/test_ton_sell_valid_2/review/00001.png new file mode 100644 index 00000000..2690558f Binary files /dev/null and b/test/python/snapshots/flex/test_ton_sell_valid_2/review/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_sell_valid_2/review/00002.png b/test/python/snapshots/flex/test_ton_sell_valid_2/review/00002.png new file mode 100644 index 00000000..87e69c4c Binary files /dev/null and b/test/python/snapshots/flex/test_ton_sell_valid_2/review/00002.png differ diff --git a/test/python/snapshots/flex/test_ton_sell_valid_2/review/00003.png b/test/python/snapshots/flex/test_ton_sell_valid_2/review/00003.png new file mode 100644 index 00000000..289a7498 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_sell_valid_2/review/00003.png differ diff --git a/test/python/snapshots/flex/test_ton_sell_wrong_amount/post_sign/00000.png b/test/python/snapshots/flex/test_ton_sell_wrong_amount/post_sign/00000.png new file mode 100644 index 00000000..55f70ff1 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_sell_wrong_amount/post_sign/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_sell_wrong_amount/post_sign/00001.png b/test/python/snapshots/flex/test_ton_sell_wrong_amount/post_sign/00001.png new file mode 100644 index 00000000..5d892c4d Binary files /dev/null and b/test/python/snapshots/flex/test_ton_sell_wrong_amount/post_sign/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_sell_wrong_amount/review/00000.png b/test/python/snapshots/flex/test_ton_sell_wrong_amount/review/00000.png new file mode 100644 index 00000000..088a6d1b Binary files /dev/null and b/test/python/snapshots/flex/test_ton_sell_wrong_amount/review/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_sell_wrong_amount/review/00001.png b/test/python/snapshots/flex/test_ton_sell_wrong_amount/review/00001.png new file mode 100644 index 00000000..25ae19e7 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_sell_wrong_amount/review/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_sell_wrong_amount/review/00002.png b/test/python/snapshots/flex/test_ton_sell_wrong_amount/review/00002.png new file mode 100644 index 00000000..e8580839 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_sell_wrong_amount/review/00002.png differ diff --git a/test/python/snapshots/flex/test_ton_sell_wrong_amount/review/00003.png b/test/python/snapshots/flex/test_ton_sell_wrong_amount/review/00003.png new file mode 100644 index 00000000..289a7498 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_sell_wrong_amount/review/00003.png differ diff --git a/test/python/snapshots/flex/test_ton_sell_wrong_destination/post_sign/00000.png b/test/python/snapshots/flex/test_ton_sell_wrong_destination/post_sign/00000.png new file mode 100644 index 00000000..55f70ff1 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_sell_wrong_destination/post_sign/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_sell_wrong_destination/post_sign/00001.png b/test/python/snapshots/flex/test_ton_sell_wrong_destination/post_sign/00001.png new file mode 100644 index 00000000..5d892c4d Binary files /dev/null and b/test/python/snapshots/flex/test_ton_sell_wrong_destination/post_sign/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_sell_wrong_destination/review/00000.png b/test/python/snapshots/flex/test_ton_sell_wrong_destination/review/00000.png new file mode 100644 index 00000000..088a6d1b Binary files /dev/null and b/test/python/snapshots/flex/test_ton_sell_wrong_destination/review/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_sell_wrong_destination/review/00001.png b/test/python/snapshots/flex/test_ton_sell_wrong_destination/review/00001.png new file mode 100644 index 00000000..25ae19e7 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_sell_wrong_destination/review/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_sell_wrong_destination/review/00002.png b/test/python/snapshots/flex/test_ton_sell_wrong_destination/review/00002.png new file mode 100644 index 00000000..e8580839 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_sell_wrong_destination/review/00002.png differ diff --git a/test/python/snapshots/flex/test_ton_sell_wrong_destination/review/00003.png b/test/python/snapshots/flex/test_ton_sell_wrong_destination/review/00003.png new file mode 100644 index 00000000..289a7498 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_sell_wrong_destination/review/00003.png differ diff --git a/test/python/snapshots/flex/test_ton_swap_valid_1/post_sign/00000.png b/test/python/snapshots/flex/test_ton_swap_valid_1/post_sign/00000.png new file mode 100644 index 00000000..be51a9d5 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_swap_valid_1/post_sign/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_swap_valid_1/post_sign/00001.png b/test/python/snapshots/flex/test_ton_swap_valid_1/post_sign/00001.png new file mode 100644 index 00000000..5d892c4d Binary files /dev/null and b/test/python/snapshots/flex/test_ton_swap_valid_1/post_sign/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_swap_valid_1/review/00000.png b/test/python/snapshots/flex/test_ton_swap_valid_1/review/00000.png new file mode 100644 index 00000000..4595916d Binary files /dev/null and b/test/python/snapshots/flex/test_ton_swap_valid_1/review/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_swap_valid_1/review/00001.png b/test/python/snapshots/flex/test_ton_swap_valid_1/review/00001.png new file mode 100644 index 00000000..b32d2765 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_swap_valid_1/review/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_swap_valid_1/review/00002.png b/test/python/snapshots/flex/test_ton_swap_valid_1/review/00002.png new file mode 100644 index 00000000..f1d05a26 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_swap_valid_1/review/00002.png differ diff --git a/test/python/snapshots/flex/test_ton_swap_valid_2/post_sign/00000.png b/test/python/snapshots/flex/test_ton_swap_valid_2/post_sign/00000.png new file mode 100644 index 00000000..be51a9d5 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_swap_valid_2/post_sign/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_swap_valid_2/post_sign/00001.png b/test/python/snapshots/flex/test_ton_swap_valid_2/post_sign/00001.png new file mode 100644 index 00000000..5d892c4d Binary files /dev/null and b/test/python/snapshots/flex/test_ton_swap_valid_2/post_sign/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_swap_valid_2/review/00000.png b/test/python/snapshots/flex/test_ton_swap_valid_2/review/00000.png new file mode 100644 index 00000000..4595916d Binary files /dev/null and b/test/python/snapshots/flex/test_ton_swap_valid_2/review/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_swap_valid_2/review/00001.png b/test/python/snapshots/flex/test_ton_swap_valid_2/review/00001.png new file mode 100644 index 00000000..ed8d3735 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_swap_valid_2/review/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_swap_valid_2/review/00002.png b/test/python/snapshots/flex/test_ton_swap_valid_2/review/00002.png new file mode 100644 index 00000000..f1d05a26 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_swap_valid_2/review/00002.png differ diff --git a/test/python/snapshots/flex/test_ton_swap_wrong_amount/post_sign/00000.png b/test/python/snapshots/flex/test_ton_swap_wrong_amount/post_sign/00000.png new file mode 100644 index 00000000..55f70ff1 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_swap_wrong_amount/post_sign/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_swap_wrong_amount/post_sign/00001.png b/test/python/snapshots/flex/test_ton_swap_wrong_amount/post_sign/00001.png new file mode 100644 index 00000000..5d892c4d Binary files /dev/null and b/test/python/snapshots/flex/test_ton_swap_wrong_amount/post_sign/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_swap_wrong_amount/review/00000.png b/test/python/snapshots/flex/test_ton_swap_wrong_amount/review/00000.png new file mode 100644 index 00000000..4595916d Binary files /dev/null and b/test/python/snapshots/flex/test_ton_swap_wrong_amount/review/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_swap_wrong_amount/review/00001.png b/test/python/snapshots/flex/test_ton_swap_wrong_amount/review/00001.png new file mode 100644 index 00000000..b32d2765 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_swap_wrong_amount/review/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_swap_wrong_amount/review/00002.png b/test/python/snapshots/flex/test_ton_swap_wrong_amount/review/00002.png new file mode 100644 index 00000000..f1d05a26 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_swap_wrong_amount/review/00002.png differ diff --git a/test/python/snapshots/flex/test_ton_swap_wrong_destination/post_sign/00000.png b/test/python/snapshots/flex/test_ton_swap_wrong_destination/post_sign/00000.png new file mode 100644 index 00000000..55f70ff1 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_swap_wrong_destination/post_sign/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_swap_wrong_destination/post_sign/00001.png b/test/python/snapshots/flex/test_ton_swap_wrong_destination/post_sign/00001.png new file mode 100644 index 00000000..5d892c4d Binary files /dev/null and b/test/python/snapshots/flex/test_ton_swap_wrong_destination/post_sign/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_swap_wrong_destination/review/00000.png b/test/python/snapshots/flex/test_ton_swap_wrong_destination/review/00000.png new file mode 100644 index 00000000..4595916d Binary files /dev/null and b/test/python/snapshots/flex/test_ton_swap_wrong_destination/review/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_swap_wrong_destination/review/00001.png b/test/python/snapshots/flex/test_ton_swap_wrong_destination/review/00001.png new file mode 100644 index 00000000..b32d2765 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_swap_wrong_destination/review/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_swap_wrong_destination/review/00002.png b/test/python/snapshots/flex/test_ton_swap_wrong_destination/review/00002.png new file mode 100644 index 00000000..f1d05a26 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_swap_wrong_destination/review/00002.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_fund_valid_1/post_sign/00000.png b/test/python/snapshots/flex/test_ton_usdt_fund_valid_1/post_sign/00000.png new file mode 100644 index 00000000..55f70ff1 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_fund_valid_1/post_sign/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_fund_valid_1/post_sign/00001.png b/test/python/snapshots/flex/test_ton_usdt_fund_valid_1/post_sign/00001.png new file mode 100644 index 00000000..5d892c4d Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_fund_valid_1/post_sign/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_fund_valid_1/review/00000.png b/test/python/snapshots/flex/test_ton_usdt_fund_valid_1/review/00000.png new file mode 100644 index 00000000..f37d56d2 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_fund_valid_1/review/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_fund_valid_1/review/00001.png b/test/python/snapshots/flex/test_ton_usdt_fund_valid_1/review/00001.png new file mode 100644 index 00000000..5906730c Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_fund_valid_1/review/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_fund_valid_1/review/00002.png b/test/python/snapshots/flex/test_ton_usdt_fund_valid_1/review/00002.png new file mode 100644 index 00000000..be64c0bc Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_fund_valid_1/review/00002.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_fund_valid_2/post_sign/00000.png b/test/python/snapshots/flex/test_ton_usdt_fund_valid_2/post_sign/00000.png new file mode 100644 index 00000000..55f70ff1 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_fund_valid_2/post_sign/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_fund_valid_2/post_sign/00001.png b/test/python/snapshots/flex/test_ton_usdt_fund_valid_2/post_sign/00001.png new file mode 100644 index 00000000..5d892c4d Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_fund_valid_2/post_sign/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_fund_valid_2/review/00000.png b/test/python/snapshots/flex/test_ton_usdt_fund_valid_2/review/00000.png new file mode 100644 index 00000000..f37d56d2 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_fund_valid_2/review/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_fund_valid_2/review/00001.png b/test/python/snapshots/flex/test_ton_usdt_fund_valid_2/review/00001.png new file mode 100644 index 00000000..765c6d1f Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_fund_valid_2/review/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_fund_valid_2/review/00002.png b/test/python/snapshots/flex/test_ton_usdt_fund_valid_2/review/00002.png new file mode 100644 index 00000000..be64c0bc Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_fund_valid_2/review/00002.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_fund_wrong_amount/post_sign/00000.png b/test/python/snapshots/flex/test_ton_usdt_fund_wrong_amount/post_sign/00000.png new file mode 100644 index 00000000..55f70ff1 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_fund_wrong_amount/post_sign/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_fund_wrong_amount/post_sign/00001.png b/test/python/snapshots/flex/test_ton_usdt_fund_wrong_amount/post_sign/00001.png new file mode 100644 index 00000000..5d892c4d Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_fund_wrong_amount/post_sign/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_fund_wrong_amount/review/00000.png b/test/python/snapshots/flex/test_ton_usdt_fund_wrong_amount/review/00000.png new file mode 100644 index 00000000..f37d56d2 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_fund_wrong_amount/review/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_fund_wrong_amount/review/00001.png b/test/python/snapshots/flex/test_ton_usdt_fund_wrong_amount/review/00001.png new file mode 100644 index 00000000..5906730c Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_fund_wrong_amount/review/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_fund_wrong_amount/review/00002.png b/test/python/snapshots/flex/test_ton_usdt_fund_wrong_amount/review/00002.png new file mode 100644 index 00000000..be64c0bc Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_fund_wrong_amount/review/00002.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_fund_wrong_destination/post_sign/00000.png b/test/python/snapshots/flex/test_ton_usdt_fund_wrong_destination/post_sign/00000.png new file mode 100644 index 00000000..55f70ff1 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_fund_wrong_destination/post_sign/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_fund_wrong_destination/post_sign/00001.png b/test/python/snapshots/flex/test_ton_usdt_fund_wrong_destination/post_sign/00001.png new file mode 100644 index 00000000..5d892c4d Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_fund_wrong_destination/post_sign/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_fund_wrong_destination/review/00000.png b/test/python/snapshots/flex/test_ton_usdt_fund_wrong_destination/review/00000.png new file mode 100644 index 00000000..f37d56d2 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_fund_wrong_destination/review/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_fund_wrong_destination/review/00001.png b/test/python/snapshots/flex/test_ton_usdt_fund_wrong_destination/review/00001.png new file mode 100644 index 00000000..5906730c Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_fund_wrong_destination/review/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_fund_wrong_destination/review/00002.png b/test/python/snapshots/flex/test_ton_usdt_fund_wrong_destination/review/00002.png new file mode 100644 index 00000000..be64c0bc Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_fund_wrong_destination/review/00002.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_sell_valid_1/post_sign/00000.png b/test/python/snapshots/flex/test_ton_usdt_sell_valid_1/post_sign/00000.png new file mode 100644 index 00000000..55f70ff1 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_sell_valid_1/post_sign/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_sell_valid_1/post_sign/00001.png b/test/python/snapshots/flex/test_ton_usdt_sell_valid_1/post_sign/00001.png new file mode 100644 index 00000000..5d892c4d Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_sell_valid_1/post_sign/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_sell_valid_1/review/00000.png b/test/python/snapshots/flex/test_ton_usdt_sell_valid_1/review/00000.png new file mode 100644 index 00000000..088a6d1b Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_sell_valid_1/review/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_sell_valid_1/review/00001.png b/test/python/snapshots/flex/test_ton_usdt_sell_valid_1/review/00001.png new file mode 100644 index 00000000..25ae19e7 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_sell_valid_1/review/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_sell_valid_1/review/00002.png b/test/python/snapshots/flex/test_ton_usdt_sell_valid_1/review/00002.png new file mode 100644 index 00000000..e8580839 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_sell_valid_1/review/00002.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_sell_valid_1/review/00003.png b/test/python/snapshots/flex/test_ton_usdt_sell_valid_1/review/00003.png new file mode 100644 index 00000000..289a7498 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_sell_valid_1/review/00003.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_sell_valid_2/post_sign/00000.png b/test/python/snapshots/flex/test_ton_usdt_sell_valid_2/post_sign/00000.png new file mode 100644 index 00000000..55f70ff1 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_sell_valid_2/post_sign/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_sell_valid_2/post_sign/00001.png b/test/python/snapshots/flex/test_ton_usdt_sell_valid_2/post_sign/00001.png new file mode 100644 index 00000000..5d892c4d Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_sell_valid_2/post_sign/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_sell_valid_2/review/00000.png b/test/python/snapshots/flex/test_ton_usdt_sell_valid_2/review/00000.png new file mode 100644 index 00000000..088a6d1b Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_sell_valid_2/review/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_sell_valid_2/review/00001.png b/test/python/snapshots/flex/test_ton_usdt_sell_valid_2/review/00001.png new file mode 100644 index 00000000..2690558f Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_sell_valid_2/review/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_sell_valid_2/review/00002.png b/test/python/snapshots/flex/test_ton_usdt_sell_valid_2/review/00002.png new file mode 100644 index 00000000..87e69c4c Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_sell_valid_2/review/00002.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_sell_valid_2/review/00003.png b/test/python/snapshots/flex/test_ton_usdt_sell_valid_2/review/00003.png new file mode 100644 index 00000000..289a7498 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_sell_valid_2/review/00003.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_sell_wrong_amount/post_sign/00000.png b/test/python/snapshots/flex/test_ton_usdt_sell_wrong_amount/post_sign/00000.png new file mode 100644 index 00000000..55f70ff1 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_sell_wrong_amount/post_sign/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_sell_wrong_amount/post_sign/00001.png b/test/python/snapshots/flex/test_ton_usdt_sell_wrong_amount/post_sign/00001.png new file mode 100644 index 00000000..5d892c4d Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_sell_wrong_amount/post_sign/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_sell_wrong_amount/review/00000.png b/test/python/snapshots/flex/test_ton_usdt_sell_wrong_amount/review/00000.png new file mode 100644 index 00000000..088a6d1b Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_sell_wrong_amount/review/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_sell_wrong_amount/review/00001.png b/test/python/snapshots/flex/test_ton_usdt_sell_wrong_amount/review/00001.png new file mode 100644 index 00000000..25ae19e7 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_sell_wrong_amount/review/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_sell_wrong_amount/review/00002.png b/test/python/snapshots/flex/test_ton_usdt_sell_wrong_amount/review/00002.png new file mode 100644 index 00000000..e8580839 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_sell_wrong_amount/review/00002.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_sell_wrong_amount/review/00003.png b/test/python/snapshots/flex/test_ton_usdt_sell_wrong_amount/review/00003.png new file mode 100644 index 00000000..289a7498 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_sell_wrong_amount/review/00003.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_sell_wrong_destination/post_sign/00000.png b/test/python/snapshots/flex/test_ton_usdt_sell_wrong_destination/post_sign/00000.png new file mode 100644 index 00000000..55f70ff1 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_sell_wrong_destination/post_sign/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_sell_wrong_destination/post_sign/00001.png b/test/python/snapshots/flex/test_ton_usdt_sell_wrong_destination/post_sign/00001.png new file mode 100644 index 00000000..5d892c4d Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_sell_wrong_destination/post_sign/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_sell_wrong_destination/review/00000.png b/test/python/snapshots/flex/test_ton_usdt_sell_wrong_destination/review/00000.png new file mode 100644 index 00000000..088a6d1b Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_sell_wrong_destination/review/00000.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_sell_wrong_destination/review/00001.png b/test/python/snapshots/flex/test_ton_usdt_sell_wrong_destination/review/00001.png new file mode 100644 index 00000000..25ae19e7 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_sell_wrong_destination/review/00001.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_sell_wrong_destination/review/00002.png b/test/python/snapshots/flex/test_ton_usdt_sell_wrong_destination/review/00002.png new file mode 100644 index 00000000..e8580839 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_sell_wrong_destination/review/00002.png differ diff --git a/test/python/snapshots/flex/test_ton_usdt_sell_wrong_destination/review/00003.png b/test/python/snapshots/flex/test_ton_usdt_sell_wrong_destination/review/00003.png new file mode 100644 index 00000000..289a7498 Binary files /dev/null and b/test/python/snapshots/flex/test_ton_usdt_sell_wrong_destination/review/00003.png differ diff --git a/test/python/snapshots/nanosp/test_ton_fund_valid_1/00000.png b/test/python/snapshots/nanosp/test_ton_fund_valid_1/00000.png new file mode 100644 index 00000000..487ea10f Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_fund_valid_1/00000.png differ diff --git a/test/python/snapshots/nanosp/test_ton_fund_valid_1/00001.png b/test/python/snapshots/nanosp/test_ton_fund_valid_1/00001.png new file mode 100644 index 00000000..28a5f8e3 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_fund_valid_1/00001.png differ diff --git a/test/python/snapshots/nanosp/test_ton_fund_valid_1/00002.png b/test/python/snapshots/nanosp/test_ton_fund_valid_1/00002.png new file mode 100644 index 00000000..54415dd8 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_fund_valid_1/00002.png differ diff --git a/test/python/snapshots/nanosp/test_ton_fund_valid_1/00003.png b/test/python/snapshots/nanosp/test_ton_fund_valid_1/00003.png new file mode 100644 index 00000000..66adf0b4 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_fund_valid_1/00003.png differ diff --git a/test/python/snapshots/nanosp/test_ton_fund_valid_1/00004.png b/test/python/snapshots/nanosp/test_ton_fund_valid_1/00004.png new file mode 100644 index 00000000..ef969d3d Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_fund_valid_1/00004.png differ diff --git a/test/python/snapshots/nanosp/test_ton_fund_valid_1/00005.png b/test/python/snapshots/nanosp/test_ton_fund_valid_1/00005.png new file mode 100644 index 00000000..570ce28d Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_fund_valid_1/00005.png differ diff --git a/test/python/snapshots/nanosp/test_ton_fund_valid_1/00006.png b/test/python/snapshots/nanosp/test_ton_fund_valid_1/00006.png new file mode 100644 index 00000000..6c4d06b4 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_fund_valid_1/00006.png differ diff --git a/test/python/snapshots/nanosp/test_ton_fund_valid_2/00000.png b/test/python/snapshots/nanosp/test_ton_fund_valid_2/00000.png new file mode 100644 index 00000000..487ea10f Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_fund_valid_2/00000.png differ diff --git a/test/python/snapshots/nanosp/test_ton_fund_valid_2/00001.png b/test/python/snapshots/nanosp/test_ton_fund_valid_2/00001.png new file mode 100644 index 00000000..28a5f8e3 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_fund_valid_2/00001.png differ diff --git a/test/python/snapshots/nanosp/test_ton_fund_valid_2/00002.png b/test/python/snapshots/nanosp/test_ton_fund_valid_2/00002.png new file mode 100644 index 00000000..5ae3139b Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_fund_valid_2/00002.png differ diff --git a/test/python/snapshots/nanosp/test_ton_fund_valid_2/00003.png b/test/python/snapshots/nanosp/test_ton_fund_valid_2/00003.png new file mode 100644 index 00000000..66adf0b4 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_fund_valid_2/00003.png differ diff --git a/test/python/snapshots/nanosp/test_ton_fund_valid_2/00004.png b/test/python/snapshots/nanosp/test_ton_fund_valid_2/00004.png new file mode 100644 index 00000000..117a70ad Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_fund_valid_2/00004.png differ diff --git a/test/python/snapshots/nanosp/test_ton_fund_valid_2/00005.png b/test/python/snapshots/nanosp/test_ton_fund_valid_2/00005.png new file mode 100644 index 00000000..570ce28d Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_fund_valid_2/00005.png differ diff --git a/test/python/snapshots/nanosp/test_ton_fund_valid_2/00006.png b/test/python/snapshots/nanosp/test_ton_fund_valid_2/00006.png new file mode 100644 index 00000000..6c4d06b4 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_fund_valid_2/00006.png differ diff --git a/test/python/snapshots/nanosp/test_ton_fund_wrong_amount/00000.png b/test/python/snapshots/nanosp/test_ton_fund_wrong_amount/00000.png new file mode 100644 index 00000000..487ea10f Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_fund_wrong_amount/00000.png differ diff --git a/test/python/snapshots/nanosp/test_ton_fund_wrong_amount/00001.png b/test/python/snapshots/nanosp/test_ton_fund_wrong_amount/00001.png new file mode 100644 index 00000000..28a5f8e3 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_fund_wrong_amount/00001.png differ diff --git a/test/python/snapshots/nanosp/test_ton_fund_wrong_amount/00002.png b/test/python/snapshots/nanosp/test_ton_fund_wrong_amount/00002.png new file mode 100644 index 00000000..54415dd8 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_fund_wrong_amount/00002.png differ diff --git a/test/python/snapshots/nanosp/test_ton_fund_wrong_amount/00003.png b/test/python/snapshots/nanosp/test_ton_fund_wrong_amount/00003.png new file mode 100644 index 00000000..66adf0b4 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_fund_wrong_amount/00003.png differ diff --git a/test/python/snapshots/nanosp/test_ton_fund_wrong_amount/00004.png b/test/python/snapshots/nanosp/test_ton_fund_wrong_amount/00004.png new file mode 100644 index 00000000..ef969d3d Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_fund_wrong_amount/00004.png differ diff --git a/test/python/snapshots/nanosp/test_ton_fund_wrong_amount/00005.png b/test/python/snapshots/nanosp/test_ton_fund_wrong_amount/00005.png new file mode 100644 index 00000000..570ce28d Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_fund_wrong_amount/00005.png differ diff --git a/test/python/snapshots/nanosp/test_ton_fund_wrong_amount/00006.png b/test/python/snapshots/nanosp/test_ton_fund_wrong_amount/00006.png new file mode 100644 index 00000000..6c4d06b4 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_fund_wrong_amount/00006.png differ diff --git a/test/python/snapshots/nanosp/test_ton_fund_wrong_destination/00000.png b/test/python/snapshots/nanosp/test_ton_fund_wrong_destination/00000.png new file mode 100644 index 00000000..487ea10f Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_fund_wrong_destination/00000.png differ diff --git a/test/python/snapshots/nanosp/test_ton_fund_wrong_destination/00001.png b/test/python/snapshots/nanosp/test_ton_fund_wrong_destination/00001.png new file mode 100644 index 00000000..28a5f8e3 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_fund_wrong_destination/00001.png differ diff --git a/test/python/snapshots/nanosp/test_ton_fund_wrong_destination/00002.png b/test/python/snapshots/nanosp/test_ton_fund_wrong_destination/00002.png new file mode 100644 index 00000000..54415dd8 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_fund_wrong_destination/00002.png differ diff --git a/test/python/snapshots/nanosp/test_ton_fund_wrong_destination/00003.png b/test/python/snapshots/nanosp/test_ton_fund_wrong_destination/00003.png new file mode 100644 index 00000000..66adf0b4 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_fund_wrong_destination/00003.png differ diff --git a/test/python/snapshots/nanosp/test_ton_fund_wrong_destination/00004.png b/test/python/snapshots/nanosp/test_ton_fund_wrong_destination/00004.png new file mode 100644 index 00000000..ef969d3d Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_fund_wrong_destination/00004.png differ diff --git a/test/python/snapshots/nanosp/test_ton_fund_wrong_destination/00005.png b/test/python/snapshots/nanosp/test_ton_fund_wrong_destination/00005.png new file mode 100644 index 00000000..570ce28d Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_fund_wrong_destination/00005.png differ diff --git a/test/python/snapshots/nanosp/test_ton_fund_wrong_destination/00006.png b/test/python/snapshots/nanosp/test_ton_fund_wrong_destination/00006.png new file mode 100644 index 00000000..6c4d06b4 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_fund_wrong_destination/00006.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_valid_1/00000.png b/test/python/snapshots/nanosp/test_ton_sell_valid_1/00000.png new file mode 100644 index 00000000..487ea10f Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_valid_1/00000.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_valid_1/00001.png b/test/python/snapshots/nanosp/test_ton_sell_valid_1/00001.png new file mode 100644 index 00000000..c9dacd5c Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_valid_1/00001.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_valid_1/00002.png b/test/python/snapshots/nanosp/test_ton_sell_valid_1/00002.png new file mode 100644 index 00000000..60ee7698 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_valid_1/00002.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_valid_1/00003.png b/test/python/snapshots/nanosp/test_ton_sell_valid_1/00003.png new file mode 100644 index 00000000..54415dd8 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_valid_1/00003.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_valid_1/00004.png b/test/python/snapshots/nanosp/test_ton_sell_valid_1/00004.png new file mode 100644 index 00000000..6749f273 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_valid_1/00004.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_valid_1/00005.png b/test/python/snapshots/nanosp/test_ton_sell_valid_1/00005.png new file mode 100644 index 00000000..ef969d3d Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_valid_1/00005.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_valid_1/00006.png b/test/python/snapshots/nanosp/test_ton_sell_valid_1/00006.png new file mode 100644 index 00000000..570ce28d Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_valid_1/00006.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_valid_1/00007.png b/test/python/snapshots/nanosp/test_ton_sell_valid_1/00007.png new file mode 100644 index 00000000..6c4d06b4 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_valid_1/00007.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_valid_2/00000.png b/test/python/snapshots/nanosp/test_ton_sell_valid_2/00000.png new file mode 100644 index 00000000..487ea10f Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_valid_2/00000.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_valid_2/00001.png b/test/python/snapshots/nanosp/test_ton_sell_valid_2/00001.png new file mode 100644 index 00000000..c9dacd5c Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_valid_2/00001.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_valid_2/00002.png b/test/python/snapshots/nanosp/test_ton_sell_valid_2/00002.png new file mode 100644 index 00000000..60ee7698 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_valid_2/00002.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_valid_2/00003.png b/test/python/snapshots/nanosp/test_ton_sell_valid_2/00003.png new file mode 100644 index 00000000..5ae3139b Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_valid_2/00003.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_valid_2/00004.png b/test/python/snapshots/nanosp/test_ton_sell_valid_2/00004.png new file mode 100644 index 00000000..6749f273 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_valid_2/00004.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_valid_2/00005.png b/test/python/snapshots/nanosp/test_ton_sell_valid_2/00005.png new file mode 100644 index 00000000..117a70ad Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_valid_2/00005.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_valid_2/00006.png b/test/python/snapshots/nanosp/test_ton_sell_valid_2/00006.png new file mode 100644 index 00000000..570ce28d Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_valid_2/00006.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_valid_2/00007.png b/test/python/snapshots/nanosp/test_ton_sell_valid_2/00007.png new file mode 100644 index 00000000..6c4d06b4 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_valid_2/00007.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_wrong_amount/00000.png b/test/python/snapshots/nanosp/test_ton_sell_wrong_amount/00000.png new file mode 100644 index 00000000..487ea10f Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_wrong_amount/00000.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_wrong_amount/00001.png b/test/python/snapshots/nanosp/test_ton_sell_wrong_amount/00001.png new file mode 100644 index 00000000..c9dacd5c Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_wrong_amount/00001.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_wrong_amount/00002.png b/test/python/snapshots/nanosp/test_ton_sell_wrong_amount/00002.png new file mode 100644 index 00000000..60ee7698 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_wrong_amount/00002.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_wrong_amount/00003.png b/test/python/snapshots/nanosp/test_ton_sell_wrong_amount/00003.png new file mode 100644 index 00000000..54415dd8 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_wrong_amount/00003.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_wrong_amount/00004.png b/test/python/snapshots/nanosp/test_ton_sell_wrong_amount/00004.png new file mode 100644 index 00000000..6749f273 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_wrong_amount/00004.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_wrong_amount/00005.png b/test/python/snapshots/nanosp/test_ton_sell_wrong_amount/00005.png new file mode 100644 index 00000000..ef969d3d Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_wrong_amount/00005.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_wrong_amount/00006.png b/test/python/snapshots/nanosp/test_ton_sell_wrong_amount/00006.png new file mode 100644 index 00000000..570ce28d Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_wrong_amount/00006.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_wrong_amount/00007.png b/test/python/snapshots/nanosp/test_ton_sell_wrong_amount/00007.png new file mode 100644 index 00000000..6c4d06b4 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_wrong_amount/00007.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_wrong_destination/00000.png b/test/python/snapshots/nanosp/test_ton_sell_wrong_destination/00000.png new file mode 100644 index 00000000..487ea10f Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_wrong_destination/00000.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_wrong_destination/00001.png b/test/python/snapshots/nanosp/test_ton_sell_wrong_destination/00001.png new file mode 100644 index 00000000..c9dacd5c Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_wrong_destination/00001.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_wrong_destination/00002.png b/test/python/snapshots/nanosp/test_ton_sell_wrong_destination/00002.png new file mode 100644 index 00000000..60ee7698 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_wrong_destination/00002.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_wrong_destination/00003.png b/test/python/snapshots/nanosp/test_ton_sell_wrong_destination/00003.png new file mode 100644 index 00000000..54415dd8 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_wrong_destination/00003.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_wrong_destination/00004.png b/test/python/snapshots/nanosp/test_ton_sell_wrong_destination/00004.png new file mode 100644 index 00000000..6749f273 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_wrong_destination/00004.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_wrong_destination/00005.png b/test/python/snapshots/nanosp/test_ton_sell_wrong_destination/00005.png new file mode 100644 index 00000000..ef969d3d Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_wrong_destination/00005.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_wrong_destination/00006.png b/test/python/snapshots/nanosp/test_ton_sell_wrong_destination/00006.png new file mode 100644 index 00000000..570ce28d Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_wrong_destination/00006.png differ diff --git a/test/python/snapshots/nanosp/test_ton_sell_wrong_destination/00007.png b/test/python/snapshots/nanosp/test_ton_sell_wrong_destination/00007.png new file mode 100644 index 00000000..6c4d06b4 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_sell_wrong_destination/00007.png differ diff --git a/test/python/snapshots/nanosp/test_ton_swap_valid_1/00000.png b/test/python/snapshots/nanosp/test_ton_swap_valid_1/00000.png new file mode 100644 index 00000000..487ea10f Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_swap_valid_1/00000.png differ diff --git a/test/python/snapshots/nanosp/test_ton_swap_valid_1/00001.png b/test/python/snapshots/nanosp/test_ton_swap_valid_1/00001.png new file mode 100644 index 00000000..c9dacd5c Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_swap_valid_1/00001.png differ diff --git a/test/python/snapshots/nanosp/test_ton_swap_valid_1/00002.png b/test/python/snapshots/nanosp/test_ton_swap_valid_1/00002.png new file mode 100644 index 00000000..54415dd8 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_swap_valid_1/00002.png differ diff --git a/test/python/snapshots/nanosp/test_ton_swap_valid_1/00003.png b/test/python/snapshots/nanosp/test_ton_swap_valid_1/00003.png new file mode 100644 index 00000000..2d2fc70b Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_swap_valid_1/00003.png differ diff --git a/test/python/snapshots/nanosp/test_ton_swap_valid_1/00004.png b/test/python/snapshots/nanosp/test_ton_swap_valid_1/00004.png new file mode 100644 index 00000000..ef969d3d Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_swap_valid_1/00004.png differ diff --git a/test/python/snapshots/nanosp/test_ton_swap_valid_1/00005.png b/test/python/snapshots/nanosp/test_ton_swap_valid_1/00005.png new file mode 100644 index 00000000..570ce28d Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_swap_valid_1/00005.png differ diff --git a/test/python/snapshots/nanosp/test_ton_swap_valid_1/00006.png b/test/python/snapshots/nanosp/test_ton_swap_valid_1/00006.png new file mode 100644 index 00000000..6c4d06b4 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_swap_valid_1/00006.png differ diff --git a/test/python/snapshots/nanosp/test_ton_swap_valid_2/00000.png b/test/python/snapshots/nanosp/test_ton_swap_valid_2/00000.png new file mode 100644 index 00000000..487ea10f Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_swap_valid_2/00000.png differ diff --git a/test/python/snapshots/nanosp/test_ton_swap_valid_2/00001.png b/test/python/snapshots/nanosp/test_ton_swap_valid_2/00001.png new file mode 100644 index 00000000..c9dacd5c Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_swap_valid_2/00001.png differ diff --git a/test/python/snapshots/nanosp/test_ton_swap_valid_2/00002.png b/test/python/snapshots/nanosp/test_ton_swap_valid_2/00002.png new file mode 100644 index 00000000..5ae3139b Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_swap_valid_2/00002.png differ diff --git a/test/python/snapshots/nanosp/test_ton_swap_valid_2/00003.png b/test/python/snapshots/nanosp/test_ton_swap_valid_2/00003.png new file mode 100644 index 00000000..2d2fc70b Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_swap_valid_2/00003.png differ diff --git a/test/python/snapshots/nanosp/test_ton_swap_valid_2/00004.png b/test/python/snapshots/nanosp/test_ton_swap_valid_2/00004.png new file mode 100644 index 00000000..117a70ad Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_swap_valid_2/00004.png differ diff --git a/test/python/snapshots/nanosp/test_ton_swap_valid_2/00005.png b/test/python/snapshots/nanosp/test_ton_swap_valid_2/00005.png new file mode 100644 index 00000000..570ce28d Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_swap_valid_2/00005.png differ diff --git a/test/python/snapshots/nanosp/test_ton_swap_valid_2/00006.png b/test/python/snapshots/nanosp/test_ton_swap_valid_2/00006.png new file mode 100644 index 00000000..6c4d06b4 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_swap_valid_2/00006.png differ diff --git a/test/python/snapshots/nanosp/test_ton_swap_wrong_amount/00000.png b/test/python/snapshots/nanosp/test_ton_swap_wrong_amount/00000.png new file mode 100644 index 00000000..487ea10f Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_swap_wrong_amount/00000.png differ diff --git a/test/python/snapshots/nanosp/test_ton_swap_wrong_amount/00001.png b/test/python/snapshots/nanosp/test_ton_swap_wrong_amount/00001.png new file mode 100644 index 00000000..c9dacd5c Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_swap_wrong_amount/00001.png differ diff --git a/test/python/snapshots/nanosp/test_ton_swap_wrong_amount/00002.png b/test/python/snapshots/nanosp/test_ton_swap_wrong_amount/00002.png new file mode 100644 index 00000000..54415dd8 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_swap_wrong_amount/00002.png differ diff --git a/test/python/snapshots/nanosp/test_ton_swap_wrong_amount/00003.png b/test/python/snapshots/nanosp/test_ton_swap_wrong_amount/00003.png new file mode 100644 index 00000000..2d2fc70b Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_swap_wrong_amount/00003.png differ diff --git a/test/python/snapshots/nanosp/test_ton_swap_wrong_amount/00004.png b/test/python/snapshots/nanosp/test_ton_swap_wrong_amount/00004.png new file mode 100644 index 00000000..ef969d3d Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_swap_wrong_amount/00004.png differ diff --git a/test/python/snapshots/nanosp/test_ton_swap_wrong_amount/00005.png b/test/python/snapshots/nanosp/test_ton_swap_wrong_amount/00005.png new file mode 100644 index 00000000..570ce28d Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_swap_wrong_amount/00005.png differ diff --git a/test/python/snapshots/nanosp/test_ton_swap_wrong_amount/00006.png b/test/python/snapshots/nanosp/test_ton_swap_wrong_amount/00006.png new file mode 100644 index 00000000..6c4d06b4 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_swap_wrong_amount/00006.png differ diff --git a/test/python/snapshots/nanosp/test_ton_swap_wrong_destination/00000.png b/test/python/snapshots/nanosp/test_ton_swap_wrong_destination/00000.png new file mode 100644 index 00000000..487ea10f Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_swap_wrong_destination/00000.png differ diff --git a/test/python/snapshots/nanosp/test_ton_swap_wrong_destination/00001.png b/test/python/snapshots/nanosp/test_ton_swap_wrong_destination/00001.png new file mode 100644 index 00000000..c9dacd5c Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_swap_wrong_destination/00001.png differ diff --git a/test/python/snapshots/nanosp/test_ton_swap_wrong_destination/00002.png b/test/python/snapshots/nanosp/test_ton_swap_wrong_destination/00002.png new file mode 100644 index 00000000..54415dd8 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_swap_wrong_destination/00002.png differ diff --git a/test/python/snapshots/nanosp/test_ton_swap_wrong_destination/00003.png b/test/python/snapshots/nanosp/test_ton_swap_wrong_destination/00003.png new file mode 100644 index 00000000..2d2fc70b Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_swap_wrong_destination/00003.png differ diff --git a/test/python/snapshots/nanosp/test_ton_swap_wrong_destination/00004.png b/test/python/snapshots/nanosp/test_ton_swap_wrong_destination/00004.png new file mode 100644 index 00000000..ef969d3d Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_swap_wrong_destination/00004.png differ diff --git a/test/python/snapshots/nanosp/test_ton_swap_wrong_destination/00005.png b/test/python/snapshots/nanosp/test_ton_swap_wrong_destination/00005.png new file mode 100644 index 00000000..570ce28d Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_swap_wrong_destination/00005.png differ diff --git a/test/python/snapshots/nanosp/test_ton_swap_wrong_destination/00006.png b/test/python/snapshots/nanosp/test_ton_swap_wrong_destination/00006.png new file mode 100644 index 00000000..6c4d06b4 Binary files /dev/null and b/test/python/snapshots/nanosp/test_ton_swap_wrong_destination/00006.png differ diff --git a/test/python/snapshots/nanox/test_ton_fund_valid_1/00000.png b/test/python/snapshots/nanox/test_ton_fund_valid_1/00000.png new file mode 100644 index 00000000..487ea10f Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_fund_valid_1/00000.png differ diff --git a/test/python/snapshots/nanox/test_ton_fund_valid_1/00001.png b/test/python/snapshots/nanox/test_ton_fund_valid_1/00001.png new file mode 100644 index 00000000..28a5f8e3 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_fund_valid_1/00001.png differ diff --git a/test/python/snapshots/nanox/test_ton_fund_valid_1/00002.png b/test/python/snapshots/nanox/test_ton_fund_valid_1/00002.png new file mode 100644 index 00000000..54415dd8 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_fund_valid_1/00002.png differ diff --git a/test/python/snapshots/nanox/test_ton_fund_valid_1/00003.png b/test/python/snapshots/nanox/test_ton_fund_valid_1/00003.png new file mode 100644 index 00000000..66adf0b4 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_fund_valid_1/00003.png differ diff --git a/test/python/snapshots/nanox/test_ton_fund_valid_1/00004.png b/test/python/snapshots/nanox/test_ton_fund_valid_1/00004.png new file mode 100644 index 00000000..ef969d3d Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_fund_valid_1/00004.png differ diff --git a/test/python/snapshots/nanox/test_ton_fund_valid_1/00005.png b/test/python/snapshots/nanox/test_ton_fund_valid_1/00005.png new file mode 100644 index 00000000..570ce28d Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_fund_valid_1/00005.png differ diff --git a/test/python/snapshots/nanox/test_ton_fund_valid_1/00006.png b/test/python/snapshots/nanox/test_ton_fund_valid_1/00006.png new file mode 100644 index 00000000..6c4d06b4 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_fund_valid_1/00006.png differ diff --git a/test/python/snapshots/nanox/test_ton_fund_valid_2/00000.png b/test/python/snapshots/nanox/test_ton_fund_valid_2/00000.png new file mode 100644 index 00000000..487ea10f Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_fund_valid_2/00000.png differ diff --git a/test/python/snapshots/nanox/test_ton_fund_valid_2/00001.png b/test/python/snapshots/nanox/test_ton_fund_valid_2/00001.png new file mode 100644 index 00000000..28a5f8e3 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_fund_valid_2/00001.png differ diff --git a/test/python/snapshots/nanox/test_ton_fund_valid_2/00002.png b/test/python/snapshots/nanox/test_ton_fund_valid_2/00002.png new file mode 100644 index 00000000..5ae3139b Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_fund_valid_2/00002.png differ diff --git a/test/python/snapshots/nanox/test_ton_fund_valid_2/00003.png b/test/python/snapshots/nanox/test_ton_fund_valid_2/00003.png new file mode 100644 index 00000000..66adf0b4 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_fund_valid_2/00003.png differ diff --git a/test/python/snapshots/nanox/test_ton_fund_valid_2/00004.png b/test/python/snapshots/nanox/test_ton_fund_valid_2/00004.png new file mode 100644 index 00000000..117a70ad Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_fund_valid_2/00004.png differ diff --git a/test/python/snapshots/nanox/test_ton_fund_valid_2/00005.png b/test/python/snapshots/nanox/test_ton_fund_valid_2/00005.png new file mode 100644 index 00000000..570ce28d Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_fund_valid_2/00005.png differ diff --git a/test/python/snapshots/nanox/test_ton_fund_valid_2/00006.png b/test/python/snapshots/nanox/test_ton_fund_valid_2/00006.png new file mode 100644 index 00000000..6c4d06b4 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_fund_valid_2/00006.png differ diff --git a/test/python/snapshots/nanox/test_ton_fund_wrong_amount/00000.png b/test/python/snapshots/nanox/test_ton_fund_wrong_amount/00000.png new file mode 100644 index 00000000..487ea10f Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_fund_wrong_amount/00000.png differ diff --git a/test/python/snapshots/nanox/test_ton_fund_wrong_amount/00001.png b/test/python/snapshots/nanox/test_ton_fund_wrong_amount/00001.png new file mode 100644 index 00000000..28a5f8e3 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_fund_wrong_amount/00001.png differ diff --git a/test/python/snapshots/nanox/test_ton_fund_wrong_amount/00002.png b/test/python/snapshots/nanox/test_ton_fund_wrong_amount/00002.png new file mode 100644 index 00000000..54415dd8 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_fund_wrong_amount/00002.png differ diff --git a/test/python/snapshots/nanox/test_ton_fund_wrong_amount/00003.png b/test/python/snapshots/nanox/test_ton_fund_wrong_amount/00003.png new file mode 100644 index 00000000..66adf0b4 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_fund_wrong_amount/00003.png differ diff --git a/test/python/snapshots/nanox/test_ton_fund_wrong_amount/00004.png b/test/python/snapshots/nanox/test_ton_fund_wrong_amount/00004.png new file mode 100644 index 00000000..ef969d3d Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_fund_wrong_amount/00004.png differ diff --git a/test/python/snapshots/nanox/test_ton_fund_wrong_amount/00005.png b/test/python/snapshots/nanox/test_ton_fund_wrong_amount/00005.png new file mode 100644 index 00000000..570ce28d Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_fund_wrong_amount/00005.png differ diff --git a/test/python/snapshots/nanox/test_ton_fund_wrong_amount/00006.png b/test/python/snapshots/nanox/test_ton_fund_wrong_amount/00006.png new file mode 100644 index 00000000..6c4d06b4 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_fund_wrong_amount/00006.png differ diff --git a/test/python/snapshots/nanox/test_ton_fund_wrong_destination/00000.png b/test/python/snapshots/nanox/test_ton_fund_wrong_destination/00000.png new file mode 100644 index 00000000..487ea10f Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_fund_wrong_destination/00000.png differ diff --git a/test/python/snapshots/nanox/test_ton_fund_wrong_destination/00001.png b/test/python/snapshots/nanox/test_ton_fund_wrong_destination/00001.png new file mode 100644 index 00000000..28a5f8e3 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_fund_wrong_destination/00001.png differ diff --git a/test/python/snapshots/nanox/test_ton_fund_wrong_destination/00002.png b/test/python/snapshots/nanox/test_ton_fund_wrong_destination/00002.png new file mode 100644 index 00000000..54415dd8 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_fund_wrong_destination/00002.png differ diff --git a/test/python/snapshots/nanox/test_ton_fund_wrong_destination/00003.png b/test/python/snapshots/nanox/test_ton_fund_wrong_destination/00003.png new file mode 100644 index 00000000..66adf0b4 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_fund_wrong_destination/00003.png differ diff --git a/test/python/snapshots/nanox/test_ton_fund_wrong_destination/00004.png b/test/python/snapshots/nanox/test_ton_fund_wrong_destination/00004.png new file mode 100644 index 00000000..ef969d3d Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_fund_wrong_destination/00004.png differ diff --git a/test/python/snapshots/nanox/test_ton_fund_wrong_destination/00005.png b/test/python/snapshots/nanox/test_ton_fund_wrong_destination/00005.png new file mode 100644 index 00000000..570ce28d Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_fund_wrong_destination/00005.png differ diff --git a/test/python/snapshots/nanox/test_ton_fund_wrong_destination/00006.png b/test/python/snapshots/nanox/test_ton_fund_wrong_destination/00006.png new file mode 100644 index 00000000..6c4d06b4 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_fund_wrong_destination/00006.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_valid_1/00000.png b/test/python/snapshots/nanox/test_ton_sell_valid_1/00000.png new file mode 100644 index 00000000..487ea10f Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_valid_1/00000.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_valid_1/00001.png b/test/python/snapshots/nanox/test_ton_sell_valid_1/00001.png new file mode 100644 index 00000000..c9dacd5c Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_valid_1/00001.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_valid_1/00002.png b/test/python/snapshots/nanox/test_ton_sell_valid_1/00002.png new file mode 100644 index 00000000..60ee7698 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_valid_1/00002.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_valid_1/00003.png b/test/python/snapshots/nanox/test_ton_sell_valid_1/00003.png new file mode 100644 index 00000000..54415dd8 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_valid_1/00003.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_valid_1/00004.png b/test/python/snapshots/nanox/test_ton_sell_valid_1/00004.png new file mode 100644 index 00000000..6749f273 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_valid_1/00004.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_valid_1/00005.png b/test/python/snapshots/nanox/test_ton_sell_valid_1/00005.png new file mode 100644 index 00000000..ef969d3d Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_valid_1/00005.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_valid_1/00006.png b/test/python/snapshots/nanox/test_ton_sell_valid_1/00006.png new file mode 100644 index 00000000..570ce28d Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_valid_1/00006.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_valid_1/00007.png b/test/python/snapshots/nanox/test_ton_sell_valid_1/00007.png new file mode 100644 index 00000000..6c4d06b4 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_valid_1/00007.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_valid_2/00000.png b/test/python/snapshots/nanox/test_ton_sell_valid_2/00000.png new file mode 100644 index 00000000..487ea10f Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_valid_2/00000.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_valid_2/00001.png b/test/python/snapshots/nanox/test_ton_sell_valid_2/00001.png new file mode 100644 index 00000000..c9dacd5c Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_valid_2/00001.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_valid_2/00002.png b/test/python/snapshots/nanox/test_ton_sell_valid_2/00002.png new file mode 100644 index 00000000..60ee7698 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_valid_2/00002.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_valid_2/00003.png b/test/python/snapshots/nanox/test_ton_sell_valid_2/00003.png new file mode 100644 index 00000000..5ae3139b Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_valid_2/00003.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_valid_2/00004.png b/test/python/snapshots/nanox/test_ton_sell_valid_2/00004.png new file mode 100644 index 00000000..6749f273 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_valid_2/00004.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_valid_2/00005.png b/test/python/snapshots/nanox/test_ton_sell_valid_2/00005.png new file mode 100644 index 00000000..117a70ad Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_valid_2/00005.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_valid_2/00006.png b/test/python/snapshots/nanox/test_ton_sell_valid_2/00006.png new file mode 100644 index 00000000..570ce28d Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_valid_2/00006.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_valid_2/00007.png b/test/python/snapshots/nanox/test_ton_sell_valid_2/00007.png new file mode 100644 index 00000000..6c4d06b4 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_valid_2/00007.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_wrong_amount/00000.png b/test/python/snapshots/nanox/test_ton_sell_wrong_amount/00000.png new file mode 100644 index 00000000..487ea10f Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_wrong_amount/00000.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_wrong_amount/00001.png b/test/python/snapshots/nanox/test_ton_sell_wrong_amount/00001.png new file mode 100644 index 00000000..c9dacd5c Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_wrong_amount/00001.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_wrong_amount/00002.png b/test/python/snapshots/nanox/test_ton_sell_wrong_amount/00002.png new file mode 100644 index 00000000..60ee7698 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_wrong_amount/00002.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_wrong_amount/00003.png b/test/python/snapshots/nanox/test_ton_sell_wrong_amount/00003.png new file mode 100644 index 00000000..54415dd8 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_wrong_amount/00003.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_wrong_amount/00004.png b/test/python/snapshots/nanox/test_ton_sell_wrong_amount/00004.png new file mode 100644 index 00000000..6749f273 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_wrong_amount/00004.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_wrong_amount/00005.png b/test/python/snapshots/nanox/test_ton_sell_wrong_amount/00005.png new file mode 100644 index 00000000..ef969d3d Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_wrong_amount/00005.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_wrong_amount/00006.png b/test/python/snapshots/nanox/test_ton_sell_wrong_amount/00006.png new file mode 100644 index 00000000..570ce28d Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_wrong_amount/00006.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_wrong_amount/00007.png b/test/python/snapshots/nanox/test_ton_sell_wrong_amount/00007.png new file mode 100644 index 00000000..6c4d06b4 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_wrong_amount/00007.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_wrong_destination/00000.png b/test/python/snapshots/nanox/test_ton_sell_wrong_destination/00000.png new file mode 100644 index 00000000..487ea10f Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_wrong_destination/00000.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_wrong_destination/00001.png b/test/python/snapshots/nanox/test_ton_sell_wrong_destination/00001.png new file mode 100644 index 00000000..c9dacd5c Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_wrong_destination/00001.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_wrong_destination/00002.png b/test/python/snapshots/nanox/test_ton_sell_wrong_destination/00002.png new file mode 100644 index 00000000..60ee7698 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_wrong_destination/00002.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_wrong_destination/00003.png b/test/python/snapshots/nanox/test_ton_sell_wrong_destination/00003.png new file mode 100644 index 00000000..54415dd8 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_wrong_destination/00003.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_wrong_destination/00004.png b/test/python/snapshots/nanox/test_ton_sell_wrong_destination/00004.png new file mode 100644 index 00000000..6749f273 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_wrong_destination/00004.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_wrong_destination/00005.png b/test/python/snapshots/nanox/test_ton_sell_wrong_destination/00005.png new file mode 100644 index 00000000..ef969d3d Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_wrong_destination/00005.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_wrong_destination/00006.png b/test/python/snapshots/nanox/test_ton_sell_wrong_destination/00006.png new file mode 100644 index 00000000..570ce28d Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_wrong_destination/00006.png differ diff --git a/test/python/snapshots/nanox/test_ton_sell_wrong_destination/00007.png b/test/python/snapshots/nanox/test_ton_sell_wrong_destination/00007.png new file mode 100644 index 00000000..6c4d06b4 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_sell_wrong_destination/00007.png differ diff --git a/test/python/snapshots/nanox/test_ton_swap_valid_1/00000.png b/test/python/snapshots/nanox/test_ton_swap_valid_1/00000.png new file mode 100644 index 00000000..487ea10f Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_swap_valid_1/00000.png differ diff --git a/test/python/snapshots/nanox/test_ton_swap_valid_1/00001.png b/test/python/snapshots/nanox/test_ton_swap_valid_1/00001.png new file mode 100644 index 00000000..c9dacd5c Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_swap_valid_1/00001.png differ diff --git a/test/python/snapshots/nanox/test_ton_swap_valid_1/00002.png b/test/python/snapshots/nanox/test_ton_swap_valid_1/00002.png new file mode 100644 index 00000000..54415dd8 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_swap_valid_1/00002.png differ diff --git a/test/python/snapshots/nanox/test_ton_swap_valid_1/00003.png b/test/python/snapshots/nanox/test_ton_swap_valid_1/00003.png new file mode 100644 index 00000000..2d2fc70b Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_swap_valid_1/00003.png differ diff --git a/test/python/snapshots/nanox/test_ton_swap_valid_1/00004.png b/test/python/snapshots/nanox/test_ton_swap_valid_1/00004.png new file mode 100644 index 00000000..ef969d3d Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_swap_valid_1/00004.png differ diff --git a/test/python/snapshots/nanox/test_ton_swap_valid_1/00005.png b/test/python/snapshots/nanox/test_ton_swap_valid_1/00005.png new file mode 100644 index 00000000..570ce28d Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_swap_valid_1/00005.png differ diff --git a/test/python/snapshots/nanox/test_ton_swap_valid_1/00006.png b/test/python/snapshots/nanox/test_ton_swap_valid_1/00006.png new file mode 100644 index 00000000..6c4d06b4 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_swap_valid_1/00006.png differ diff --git a/test/python/snapshots/nanox/test_ton_swap_valid_2/00000.png b/test/python/snapshots/nanox/test_ton_swap_valid_2/00000.png new file mode 100644 index 00000000..487ea10f Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_swap_valid_2/00000.png differ diff --git a/test/python/snapshots/nanox/test_ton_swap_valid_2/00001.png b/test/python/snapshots/nanox/test_ton_swap_valid_2/00001.png new file mode 100644 index 00000000..c9dacd5c Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_swap_valid_2/00001.png differ diff --git a/test/python/snapshots/nanox/test_ton_swap_valid_2/00002.png b/test/python/snapshots/nanox/test_ton_swap_valid_2/00002.png new file mode 100644 index 00000000..5ae3139b Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_swap_valid_2/00002.png differ diff --git a/test/python/snapshots/nanox/test_ton_swap_valid_2/00003.png b/test/python/snapshots/nanox/test_ton_swap_valid_2/00003.png new file mode 100644 index 00000000..2d2fc70b Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_swap_valid_2/00003.png differ diff --git a/test/python/snapshots/nanox/test_ton_swap_valid_2/00004.png b/test/python/snapshots/nanox/test_ton_swap_valid_2/00004.png new file mode 100644 index 00000000..117a70ad Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_swap_valid_2/00004.png differ diff --git a/test/python/snapshots/nanox/test_ton_swap_valid_2/00005.png b/test/python/snapshots/nanox/test_ton_swap_valid_2/00005.png new file mode 100644 index 00000000..570ce28d Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_swap_valid_2/00005.png differ diff --git a/test/python/snapshots/nanox/test_ton_swap_valid_2/00006.png b/test/python/snapshots/nanox/test_ton_swap_valid_2/00006.png new file mode 100644 index 00000000..6c4d06b4 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_swap_valid_2/00006.png differ diff --git a/test/python/snapshots/nanox/test_ton_swap_wrong_amount/00000.png b/test/python/snapshots/nanox/test_ton_swap_wrong_amount/00000.png new file mode 100644 index 00000000..487ea10f Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_swap_wrong_amount/00000.png differ diff --git a/test/python/snapshots/nanox/test_ton_swap_wrong_amount/00001.png b/test/python/snapshots/nanox/test_ton_swap_wrong_amount/00001.png new file mode 100644 index 00000000..c9dacd5c Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_swap_wrong_amount/00001.png differ diff --git a/test/python/snapshots/nanox/test_ton_swap_wrong_amount/00002.png b/test/python/snapshots/nanox/test_ton_swap_wrong_amount/00002.png new file mode 100644 index 00000000..54415dd8 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_swap_wrong_amount/00002.png differ diff --git a/test/python/snapshots/nanox/test_ton_swap_wrong_amount/00003.png b/test/python/snapshots/nanox/test_ton_swap_wrong_amount/00003.png new file mode 100644 index 00000000..2d2fc70b Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_swap_wrong_amount/00003.png differ diff --git a/test/python/snapshots/nanox/test_ton_swap_wrong_amount/00004.png b/test/python/snapshots/nanox/test_ton_swap_wrong_amount/00004.png new file mode 100644 index 00000000..ef969d3d Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_swap_wrong_amount/00004.png differ diff --git a/test/python/snapshots/nanox/test_ton_swap_wrong_amount/00005.png b/test/python/snapshots/nanox/test_ton_swap_wrong_amount/00005.png new file mode 100644 index 00000000..570ce28d Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_swap_wrong_amount/00005.png differ diff --git a/test/python/snapshots/nanox/test_ton_swap_wrong_amount/00006.png b/test/python/snapshots/nanox/test_ton_swap_wrong_amount/00006.png new file mode 100644 index 00000000..6c4d06b4 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_swap_wrong_amount/00006.png differ diff --git a/test/python/snapshots/nanox/test_ton_swap_wrong_destination/00000.png b/test/python/snapshots/nanox/test_ton_swap_wrong_destination/00000.png new file mode 100644 index 00000000..487ea10f Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_swap_wrong_destination/00000.png differ diff --git a/test/python/snapshots/nanox/test_ton_swap_wrong_destination/00001.png b/test/python/snapshots/nanox/test_ton_swap_wrong_destination/00001.png new file mode 100644 index 00000000..c9dacd5c Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_swap_wrong_destination/00001.png differ diff --git a/test/python/snapshots/nanox/test_ton_swap_wrong_destination/00002.png b/test/python/snapshots/nanox/test_ton_swap_wrong_destination/00002.png new file mode 100644 index 00000000..54415dd8 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_swap_wrong_destination/00002.png differ diff --git a/test/python/snapshots/nanox/test_ton_swap_wrong_destination/00003.png b/test/python/snapshots/nanox/test_ton_swap_wrong_destination/00003.png new file mode 100644 index 00000000..2d2fc70b Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_swap_wrong_destination/00003.png differ diff --git a/test/python/snapshots/nanox/test_ton_swap_wrong_destination/00004.png b/test/python/snapshots/nanox/test_ton_swap_wrong_destination/00004.png new file mode 100644 index 00000000..ef969d3d Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_swap_wrong_destination/00004.png differ diff --git a/test/python/snapshots/nanox/test_ton_swap_wrong_destination/00005.png b/test/python/snapshots/nanox/test_ton_swap_wrong_destination/00005.png new file mode 100644 index 00000000..570ce28d Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_swap_wrong_destination/00005.png differ diff --git a/test/python/snapshots/nanox/test_ton_swap_wrong_destination/00006.png b/test/python/snapshots/nanox/test_ton_swap_wrong_destination/00006.png new file mode 100644 index 00000000..6c4d06b4 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_swap_wrong_destination/00006.png differ diff --git a/test/python/snapshots/nanox/test_ton_usdt_fund_valid_1/00000.png b/test/python/snapshots/nanox/test_ton_usdt_fund_valid_1/00000.png new file mode 100644 index 00000000..487ea10f Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_usdt_fund_valid_1/00000.png differ diff --git a/test/python/snapshots/nanox/test_ton_usdt_fund_valid_1/00001.png b/test/python/snapshots/nanox/test_ton_usdt_fund_valid_1/00001.png new file mode 100644 index 00000000..28a5f8e3 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_usdt_fund_valid_1/00001.png differ diff --git a/test/python/snapshots/nanox/test_ton_usdt_fund_valid_1/00002.png b/test/python/snapshots/nanox/test_ton_usdt_fund_valid_1/00002.png new file mode 100644 index 00000000..54415dd8 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_usdt_fund_valid_1/00002.png differ diff --git a/test/python/snapshots/nanox/test_ton_usdt_fund_valid_1/00003.png b/test/python/snapshots/nanox/test_ton_usdt_fund_valid_1/00003.png new file mode 100644 index 00000000..66adf0b4 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_usdt_fund_valid_1/00003.png differ diff --git a/test/python/snapshots/nanox/test_ton_usdt_fund_valid_1/00004.png b/test/python/snapshots/nanox/test_ton_usdt_fund_valid_1/00004.png new file mode 100644 index 00000000..ef969d3d Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_usdt_fund_valid_1/00004.png differ diff --git a/test/python/snapshots/nanox/test_ton_usdt_fund_valid_1/00005.png b/test/python/snapshots/nanox/test_ton_usdt_fund_valid_1/00005.png new file mode 100644 index 00000000..570ce28d Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_usdt_fund_valid_1/00005.png differ diff --git a/test/python/snapshots/nanox/test_ton_usdt_fund_valid_1/00006.png b/test/python/snapshots/nanox/test_ton_usdt_fund_valid_1/00006.png new file mode 100644 index 00000000..6c4d06b4 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_usdt_fund_valid_1/00006.png differ diff --git a/test/python/snapshots/nanox/test_ton_usdt_swap_valid_1/00000.png b/test/python/snapshots/nanox/test_ton_usdt_swap_valid_1/00000.png new file mode 100644 index 00000000..487ea10f Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_usdt_swap_valid_1/00000.png differ diff --git a/test/python/snapshots/nanox/test_ton_usdt_swap_valid_1/00001.png b/test/python/snapshots/nanox/test_ton_usdt_swap_valid_1/00001.png new file mode 100644 index 00000000..c9dacd5c Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_usdt_swap_valid_1/00001.png differ diff --git a/test/python/snapshots/nanox/test_ton_usdt_swap_valid_1/00002.png b/test/python/snapshots/nanox/test_ton_usdt_swap_valid_1/00002.png new file mode 100644 index 00000000..54415dd8 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_usdt_swap_valid_1/00002.png differ diff --git a/test/python/snapshots/nanox/test_ton_usdt_swap_valid_1/00003.png b/test/python/snapshots/nanox/test_ton_usdt_swap_valid_1/00003.png new file mode 100644 index 00000000..2d2fc70b Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_usdt_swap_valid_1/00003.png differ diff --git a/test/python/snapshots/nanox/test_ton_usdt_swap_valid_1/00004.png b/test/python/snapshots/nanox/test_ton_usdt_swap_valid_1/00004.png new file mode 100644 index 00000000..ef969d3d Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_usdt_swap_valid_1/00004.png differ diff --git a/test/python/snapshots/nanox/test_ton_usdt_swap_valid_1/00005.png b/test/python/snapshots/nanox/test_ton_usdt_swap_valid_1/00005.png new file mode 100644 index 00000000..570ce28d Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_usdt_swap_valid_1/00005.png differ diff --git a/test/python/snapshots/nanox/test_ton_usdt_swap_valid_1/00006.png b/test/python/snapshots/nanox/test_ton_usdt_swap_valid_1/00006.png new file mode 100644 index 00000000..6c4d06b4 Binary files /dev/null and b/test/python/snapshots/nanox/test_ton_usdt_swap_valid_1/00006.png differ diff --git a/test/python/snapshots/stax/test_ton_fund_valid_1/post_sign/00000.png b/test/python/snapshots/stax/test_ton_fund_valid_1/post_sign/00000.png new file mode 100644 index 00000000..392165d4 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_fund_valid_1/post_sign/00000.png differ diff --git a/test/python/snapshots/stax/test_ton_fund_valid_1/post_sign/00001.png b/test/python/snapshots/stax/test_ton_fund_valid_1/post_sign/00001.png new file mode 100644 index 00000000..ff2891d5 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_fund_valid_1/post_sign/00001.png differ diff --git a/test/python/snapshots/stax/test_ton_fund_valid_1/review/00000.png b/test/python/snapshots/stax/test_ton_fund_valid_1/review/00000.png new file mode 100644 index 00000000..45bd32e3 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_fund_valid_1/review/00000.png differ diff --git a/test/python/snapshots/stax/test_ton_fund_valid_1/review/00001.png b/test/python/snapshots/stax/test_ton_fund_valid_1/review/00001.png new file mode 100644 index 00000000..c2850820 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_fund_valid_1/review/00001.png differ diff --git a/test/python/snapshots/stax/test_ton_fund_valid_1/review/00002.png b/test/python/snapshots/stax/test_ton_fund_valid_1/review/00002.png new file mode 100644 index 00000000..b90cca53 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_fund_valid_1/review/00002.png differ diff --git a/test/python/snapshots/stax/test_ton_fund_valid_2/post_sign/00000.png b/test/python/snapshots/stax/test_ton_fund_valid_2/post_sign/00000.png new file mode 100644 index 00000000..392165d4 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_fund_valid_2/post_sign/00000.png differ diff --git a/test/python/snapshots/stax/test_ton_fund_valid_2/post_sign/00001.png b/test/python/snapshots/stax/test_ton_fund_valid_2/post_sign/00001.png new file mode 100644 index 00000000..ff2891d5 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_fund_valid_2/post_sign/00001.png differ diff --git a/test/python/snapshots/stax/test_ton_fund_valid_2/review/00000.png b/test/python/snapshots/stax/test_ton_fund_valid_2/review/00000.png new file mode 100644 index 00000000..45bd32e3 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_fund_valid_2/review/00000.png differ diff --git a/test/python/snapshots/stax/test_ton_fund_valid_2/review/00001.png b/test/python/snapshots/stax/test_ton_fund_valid_2/review/00001.png new file mode 100644 index 00000000..ef35fc40 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_fund_valid_2/review/00001.png differ diff --git a/test/python/snapshots/stax/test_ton_fund_valid_2/review/00002.png b/test/python/snapshots/stax/test_ton_fund_valid_2/review/00002.png new file mode 100644 index 00000000..b90cca53 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_fund_valid_2/review/00002.png differ diff --git a/test/python/snapshots/stax/test_ton_fund_wrong_amount/post_sign/00000.png b/test/python/snapshots/stax/test_ton_fund_wrong_amount/post_sign/00000.png new file mode 100644 index 00000000..0be82826 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_fund_wrong_amount/post_sign/00000.png differ diff --git a/test/python/snapshots/stax/test_ton_fund_wrong_amount/post_sign/00001.png b/test/python/snapshots/stax/test_ton_fund_wrong_amount/post_sign/00001.png new file mode 100644 index 00000000..ff2891d5 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_fund_wrong_amount/post_sign/00001.png differ diff --git a/test/python/snapshots/stax/test_ton_fund_wrong_amount/review/00000.png b/test/python/snapshots/stax/test_ton_fund_wrong_amount/review/00000.png new file mode 100644 index 00000000..45bd32e3 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_fund_wrong_amount/review/00000.png differ diff --git a/test/python/snapshots/stax/test_ton_fund_wrong_amount/review/00001.png b/test/python/snapshots/stax/test_ton_fund_wrong_amount/review/00001.png new file mode 100644 index 00000000..c2850820 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_fund_wrong_amount/review/00001.png differ diff --git a/test/python/snapshots/stax/test_ton_fund_wrong_amount/review/00002.png b/test/python/snapshots/stax/test_ton_fund_wrong_amount/review/00002.png new file mode 100644 index 00000000..b90cca53 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_fund_wrong_amount/review/00002.png differ diff --git a/test/python/snapshots/stax/test_ton_fund_wrong_destination/post_sign/00000.png b/test/python/snapshots/stax/test_ton_fund_wrong_destination/post_sign/00000.png new file mode 100644 index 00000000..0be82826 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_fund_wrong_destination/post_sign/00000.png differ diff --git a/test/python/snapshots/stax/test_ton_fund_wrong_destination/post_sign/00001.png b/test/python/snapshots/stax/test_ton_fund_wrong_destination/post_sign/00001.png new file mode 100644 index 00000000..ff2891d5 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_fund_wrong_destination/post_sign/00001.png differ diff --git a/test/python/snapshots/stax/test_ton_fund_wrong_destination/review/00000.png b/test/python/snapshots/stax/test_ton_fund_wrong_destination/review/00000.png new file mode 100644 index 00000000..45bd32e3 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_fund_wrong_destination/review/00000.png differ diff --git a/test/python/snapshots/stax/test_ton_fund_wrong_destination/review/00001.png b/test/python/snapshots/stax/test_ton_fund_wrong_destination/review/00001.png new file mode 100644 index 00000000..c2850820 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_fund_wrong_destination/review/00001.png differ diff --git a/test/python/snapshots/stax/test_ton_fund_wrong_destination/review/00002.png b/test/python/snapshots/stax/test_ton_fund_wrong_destination/review/00002.png new file mode 100644 index 00000000..b90cca53 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_fund_wrong_destination/review/00002.png differ diff --git a/test/python/snapshots/stax/test_ton_sell_valid_1/post_sign/00000.png b/test/python/snapshots/stax/test_ton_sell_valid_1/post_sign/00000.png new file mode 100644 index 00000000..392165d4 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_sell_valid_1/post_sign/00000.png differ diff --git a/test/python/snapshots/stax/test_ton_sell_valid_1/post_sign/00001.png b/test/python/snapshots/stax/test_ton_sell_valid_1/post_sign/00001.png new file mode 100644 index 00000000..ff2891d5 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_sell_valid_1/post_sign/00001.png differ diff --git a/test/python/snapshots/stax/test_ton_sell_valid_1/review/00000.png b/test/python/snapshots/stax/test_ton_sell_valid_1/review/00000.png new file mode 100644 index 00000000..5b0d5a40 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_sell_valid_1/review/00000.png differ diff --git a/test/python/snapshots/stax/test_ton_sell_valid_1/review/00001.png b/test/python/snapshots/stax/test_ton_sell_valid_1/review/00001.png new file mode 100644 index 00000000..e88ffaf2 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_sell_valid_1/review/00001.png differ diff --git a/test/python/snapshots/stax/test_ton_sell_valid_1/review/00002.png b/test/python/snapshots/stax/test_ton_sell_valid_1/review/00002.png new file mode 100644 index 00000000..4c7da491 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_sell_valid_1/review/00002.png differ diff --git a/test/python/snapshots/stax/test_ton_sell_valid_2/post_sign/00000.png b/test/python/snapshots/stax/test_ton_sell_valid_2/post_sign/00000.png new file mode 100644 index 00000000..392165d4 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_sell_valid_2/post_sign/00000.png differ diff --git a/test/python/snapshots/stax/test_ton_sell_valid_2/post_sign/00001.png b/test/python/snapshots/stax/test_ton_sell_valid_2/post_sign/00001.png new file mode 100644 index 00000000..ff2891d5 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_sell_valid_2/post_sign/00001.png differ diff --git a/test/python/snapshots/stax/test_ton_sell_valid_2/review/00000.png b/test/python/snapshots/stax/test_ton_sell_valid_2/review/00000.png new file mode 100644 index 00000000..5b0d5a40 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_sell_valid_2/review/00000.png differ diff --git a/test/python/snapshots/stax/test_ton_sell_valid_2/review/00001.png b/test/python/snapshots/stax/test_ton_sell_valid_2/review/00001.png new file mode 100644 index 00000000..e8b9883a Binary files /dev/null and b/test/python/snapshots/stax/test_ton_sell_valid_2/review/00001.png differ diff --git a/test/python/snapshots/stax/test_ton_sell_valid_2/review/00002.png b/test/python/snapshots/stax/test_ton_sell_valid_2/review/00002.png new file mode 100644 index 00000000..4c7da491 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_sell_valid_2/review/00002.png differ diff --git a/test/python/snapshots/stax/test_ton_sell_wrong_amount/post_sign/00000.png b/test/python/snapshots/stax/test_ton_sell_wrong_amount/post_sign/00000.png new file mode 100644 index 00000000..0be82826 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_sell_wrong_amount/post_sign/00000.png differ diff --git a/test/python/snapshots/stax/test_ton_sell_wrong_amount/post_sign/00001.png b/test/python/snapshots/stax/test_ton_sell_wrong_amount/post_sign/00001.png new file mode 100644 index 00000000..ff2891d5 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_sell_wrong_amount/post_sign/00001.png differ diff --git a/test/python/snapshots/stax/test_ton_sell_wrong_amount/review/00000.png b/test/python/snapshots/stax/test_ton_sell_wrong_amount/review/00000.png new file mode 100644 index 00000000..5b0d5a40 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_sell_wrong_amount/review/00000.png differ diff --git a/test/python/snapshots/stax/test_ton_sell_wrong_amount/review/00001.png b/test/python/snapshots/stax/test_ton_sell_wrong_amount/review/00001.png new file mode 100644 index 00000000..e88ffaf2 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_sell_wrong_amount/review/00001.png differ diff --git a/test/python/snapshots/stax/test_ton_sell_wrong_amount/review/00002.png b/test/python/snapshots/stax/test_ton_sell_wrong_amount/review/00002.png new file mode 100644 index 00000000..4c7da491 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_sell_wrong_amount/review/00002.png differ diff --git a/test/python/snapshots/stax/test_ton_sell_wrong_destination/post_sign/00000.png b/test/python/snapshots/stax/test_ton_sell_wrong_destination/post_sign/00000.png new file mode 100644 index 00000000..0be82826 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_sell_wrong_destination/post_sign/00000.png differ diff --git a/test/python/snapshots/stax/test_ton_sell_wrong_destination/post_sign/00001.png b/test/python/snapshots/stax/test_ton_sell_wrong_destination/post_sign/00001.png new file mode 100644 index 00000000..ff2891d5 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_sell_wrong_destination/post_sign/00001.png differ diff --git a/test/python/snapshots/stax/test_ton_sell_wrong_destination/review/00000.png b/test/python/snapshots/stax/test_ton_sell_wrong_destination/review/00000.png new file mode 100644 index 00000000..5b0d5a40 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_sell_wrong_destination/review/00000.png differ diff --git a/test/python/snapshots/stax/test_ton_sell_wrong_destination/review/00001.png b/test/python/snapshots/stax/test_ton_sell_wrong_destination/review/00001.png new file mode 100644 index 00000000..e88ffaf2 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_sell_wrong_destination/review/00001.png differ diff --git a/test/python/snapshots/stax/test_ton_sell_wrong_destination/review/00002.png b/test/python/snapshots/stax/test_ton_sell_wrong_destination/review/00002.png new file mode 100644 index 00000000..4c7da491 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_sell_wrong_destination/review/00002.png differ diff --git a/test/python/snapshots/stax/test_ton_swap_valid_1/post_sign/00000.png b/test/python/snapshots/stax/test_ton_swap_valid_1/post_sign/00000.png new file mode 100644 index 00000000..392165d4 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_swap_valid_1/post_sign/00000.png differ diff --git a/test/python/snapshots/stax/test_ton_swap_valid_1/post_sign/00001.png b/test/python/snapshots/stax/test_ton_swap_valid_1/post_sign/00001.png new file mode 100644 index 00000000..ff2891d5 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_swap_valid_1/post_sign/00001.png differ diff --git a/test/python/snapshots/stax/test_ton_swap_valid_1/review/00000.png b/test/python/snapshots/stax/test_ton_swap_valid_1/review/00000.png new file mode 100644 index 00000000..07536412 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_swap_valid_1/review/00000.png differ diff --git a/test/python/snapshots/stax/test_ton_swap_valid_1/review/00001.png b/test/python/snapshots/stax/test_ton_swap_valid_1/review/00001.png new file mode 100644 index 00000000..4e194f46 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_swap_valid_1/review/00001.png differ diff --git a/test/python/snapshots/stax/test_ton_swap_valid_1/review/00002.png b/test/python/snapshots/stax/test_ton_swap_valid_1/review/00002.png new file mode 100644 index 00000000..98278a22 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_swap_valid_1/review/00002.png differ diff --git a/test/python/snapshots/stax/test_ton_swap_valid_2/post_sign/00000.png b/test/python/snapshots/stax/test_ton_swap_valid_2/post_sign/00000.png new file mode 100644 index 00000000..392165d4 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_swap_valid_2/post_sign/00000.png differ diff --git a/test/python/snapshots/stax/test_ton_swap_valid_2/post_sign/00001.png b/test/python/snapshots/stax/test_ton_swap_valid_2/post_sign/00001.png new file mode 100644 index 00000000..ff2891d5 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_swap_valid_2/post_sign/00001.png differ diff --git a/test/python/snapshots/stax/test_ton_swap_valid_2/review/00000.png b/test/python/snapshots/stax/test_ton_swap_valid_2/review/00000.png new file mode 100644 index 00000000..07536412 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_swap_valid_2/review/00000.png differ diff --git a/test/python/snapshots/stax/test_ton_swap_valid_2/review/00001.png b/test/python/snapshots/stax/test_ton_swap_valid_2/review/00001.png new file mode 100644 index 00000000..55bc529a Binary files /dev/null and b/test/python/snapshots/stax/test_ton_swap_valid_2/review/00001.png differ diff --git a/test/python/snapshots/stax/test_ton_swap_valid_2/review/00002.png b/test/python/snapshots/stax/test_ton_swap_valid_2/review/00002.png new file mode 100644 index 00000000..98278a22 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_swap_valid_2/review/00002.png differ diff --git a/test/python/snapshots/stax/test_ton_swap_wrong_amount/post_sign/00000.png b/test/python/snapshots/stax/test_ton_swap_wrong_amount/post_sign/00000.png new file mode 100644 index 00000000..0be82826 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_swap_wrong_amount/post_sign/00000.png differ diff --git a/test/python/snapshots/stax/test_ton_swap_wrong_amount/post_sign/00001.png b/test/python/snapshots/stax/test_ton_swap_wrong_amount/post_sign/00001.png new file mode 100644 index 00000000..ff2891d5 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_swap_wrong_amount/post_sign/00001.png differ diff --git a/test/python/snapshots/stax/test_ton_swap_wrong_amount/review/00000.png b/test/python/snapshots/stax/test_ton_swap_wrong_amount/review/00000.png new file mode 100644 index 00000000..07536412 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_swap_wrong_amount/review/00000.png differ diff --git a/test/python/snapshots/stax/test_ton_swap_wrong_amount/review/00001.png b/test/python/snapshots/stax/test_ton_swap_wrong_amount/review/00001.png new file mode 100644 index 00000000..4e194f46 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_swap_wrong_amount/review/00001.png differ diff --git a/test/python/snapshots/stax/test_ton_swap_wrong_amount/review/00002.png b/test/python/snapshots/stax/test_ton_swap_wrong_amount/review/00002.png new file mode 100644 index 00000000..98278a22 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_swap_wrong_amount/review/00002.png differ diff --git a/test/python/snapshots/stax/test_ton_swap_wrong_destination/post_sign/00000.png b/test/python/snapshots/stax/test_ton_swap_wrong_destination/post_sign/00000.png new file mode 100644 index 00000000..0be82826 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_swap_wrong_destination/post_sign/00000.png differ diff --git a/test/python/snapshots/stax/test_ton_swap_wrong_destination/post_sign/00001.png b/test/python/snapshots/stax/test_ton_swap_wrong_destination/post_sign/00001.png new file mode 100644 index 00000000..ff2891d5 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_swap_wrong_destination/post_sign/00001.png differ diff --git a/test/python/snapshots/stax/test_ton_swap_wrong_destination/review/00000.png b/test/python/snapshots/stax/test_ton_swap_wrong_destination/review/00000.png new file mode 100644 index 00000000..07536412 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_swap_wrong_destination/review/00000.png differ diff --git a/test/python/snapshots/stax/test_ton_swap_wrong_destination/review/00001.png b/test/python/snapshots/stax/test_ton_swap_wrong_destination/review/00001.png new file mode 100644 index 00000000..4e194f46 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_swap_wrong_destination/review/00001.png differ diff --git a/test/python/snapshots/stax/test_ton_swap_wrong_destination/review/00002.png b/test/python/snapshots/stax/test_ton_swap_wrong_destination/review/00002.png new file mode 100644 index 00000000..98278a22 Binary files /dev/null and b/test/python/snapshots/stax/test_ton_swap_wrong_destination/review/00002.png differ diff --git a/test/python/test_ton.py b/test/python/test_ton.py new file mode 100644 index 00000000..9114e406 --- /dev/null +++ b/test/python/test_ton.py @@ -0,0 +1,90 @@ +import pytest +import os + +from .apps.ton_application_client.ton_transaction import Transaction, SendMode, CommentPayload, Payload, JettonTransferPayload, NFTTransferPayload, CustomUnsafePayload, JettonBurnPayload, AddWhitelistPayload, SingleNominatorWithdrawPayload, ChangeValidatorPayload, TonstakersDepositPayload, JettonDAOVotePayload, ChangeDNSWalletPayload, ChangeDNSPayload, TokenBridgePaySwapPayload +from .apps.ton_application_client.ton_command_sender import BoilerplateCommandSender, Errors +from .apps.ton_application_client.ton_response_unpacker import unpack_sign_tx_response +from .apps.ton_utils import check_signature_validity + +from tonsdk.utils import Address + +from .apps.exchange_test_runner import ExchangeTestRunner, ALL_TESTS_EXCEPT_MEMO_THORSWAP_AND_FEES +from .apps.ton import DEVICE_PUBLIC_KEY, Bounceability, WorkchainID, craft_address, SW_SWAP_FAILURE, TON_DERIVATION_PATH +from .apps import cal as cal + +# ExchangeTestRunner implementation for Ton +class TonTests(ExchangeTestRunner): + currency_configuration = cal.TON_CURRENCY_CONFIGURATION + valid_destination_1 = "EQD0sKn8DbS12U015TWOSpYmyJYYDC_7sxg1upaMxnBvTiX8" + valid_destination_2 = "EQANxfGN1EgFPawYB1fhPqebKe1Nb6FIsaiekEecJ6R-3kYF" + # valid_refund = craft_address(Bounceability.NON_BOUNCEABLE, WorkchainID.BASE_CHAIN, DEVICE_PUBLIC_KEY).decode('utf-8') + valid_refund = "UQDWey_FGPhd3phmerdVXi-zUIujfyO4-29y_VT1yD0meY1n" + valid_send_amount_1 = 12345670000 + valid_send_amount_2 = 446739662 + valid_fees_1 = 100000000 + valid_fees_2 = 10000123 + fake_refund = "EQD0sKn8DbS12U015TWOSpYmyJYYDC_7sxg1upaMxnBvTiX8" + fake_payout = "EQD0sKn8DbS12U015TWOSpYmyJYYDC_7sxg1upaMxnBvTiX8" + wrong_method_error_code = SW_SWAP_FAILURE + wrong_destination_error_code = SW_SWAP_FAILURE + wrong_amount_error_code = SW_SWAP_FAILURE + + def perform_final_tx(self, destination, send_amount, fees, memo): + # Use the app interface instead of raw interface + client = BoilerplateCommandSender(self.backend) + + # First we need to get the public key of the device in order to build the transaction + pubkey = client.get_public_key(path=TON_DERIVATION_PATH).data + + # Create the transaction that will be sent to the device for signing + tx = Transaction(Address(destination), SendMode.PAY_GAS_SEPARATLY, 0, 1686176000, True, send_amount) + tx_bytes = tx.to_request_bytes() + + # Send the sign device instruction. + # As it requires on-screen validation, the function is asynchronous. + # It will yield the result when the navigation is done + with client.sign_tx(path=TON_DERIVATION_PATH, transaction=tx_bytes): + pass + + # The device as yielded the result, parse it and ensure that the signature is correct + response = client.get_async_response().data + sig, hash_b = unpack_sign_tx_response(response) + assert hash_b == tx.transfer_cell().bytes_hash() + assert check_signature_validity(pubkey, sig, hash_b) + +class TonUSDTTests(TonTests): + currency_configuration = cal.TON_CURRENCY_CONFIGURATION + def perform_final_tx(self, destination, send_amount, fees, memo): + # Use the app interface instead of raw interface + client = BoilerplateCommandSender(self.backend) + + # First we need to get the public key of the device in order to build the transaction + pubkey = client.get_public_key(path=TON_DERIVATION_PATH).data + + payload = JettonTransferPayload(100, Address("0:" + "0" * 64), forward_amount=1) + + tx = Transaction(Address("0:" + "0" * 64), SendMode.PAY_GAS_SEPARATLY, 0, 1686176000, True, 100000000, payload=payload) + tx_bytes = tx.to_request_bytes() + + with client.sign_tx(path=TON_DERIVATION_PATH, transaction=tx_bytes): + pass + + # The device as yielded the result, parse it and ensure that the signature is correct + response = client.get_async_response().data + sig, hash_b = unpack_sign_tx_response(response) + assert hash_b == tx.transfer_cell().bytes_hash() + assert check_signature_validity(pubkey, sig, hash_b) + + +# Use a class to reuse the same Speculos instance +class TestsTon: + + @pytest.mark.parametrize('test_to_run', ALL_TESTS_EXCEPT_MEMO_THORSWAP_AND_FEES) + def test_ton(self, backend, exchange_navigation_helper, test_to_run): + if backend.firmware.device == "nanos": + pytest.skip("Polkadot swap is not supported on NanoS device") + TonTests(backend, exchange_navigation_helper).run_test(test_to_run) + + # @pytest.mark.parametrize('test_to_run', ALL_TESTS_EXCEPT_MEMO_THORSWAP_AND_FEES) + # def test_ton_usdt(self, backend, exchange_navigation_helper, test_to_run): + # TonUSDTTests(backend, exchange_navigation_helper).run_test(test_to_run)