Decode opcodes and message bodies. Opcodes can be in hex (with or without 0x prefix) or decimal format. Bodies should be in base64 or hex format. Use POST method for long parameters that may be truncated in GET requests.
cURL
curl --request POST \ --url https://toncenter.com/api/v3/decode \ --header 'Content-Type: application/json' \ --data ' { "bodies": [ "<string>" ], "opcodes": [ "<string>" ] } '
{ "bodies": [ {} ], "opcodes": [ "<string>" ] }
import asyncio from toncenter.rest import ToncenterRestClient from toncenter.types import Network from toncenter.rest.v3.models import DecodeRequest OPCODES = ["0x0f8a7ea5"] async def main() -> None: async with ToncenterRestClient(network=Network.MAINNET) as client: result = await client.v3.utils.post_decode( body=DecodeRequest(opcodes=OPCODES), ) print(result.model_dump_json(indent=4)) if __name__ == "__main__": asyncio.run(main())
OK