TON Cookbook
During product development, various questions often arise regarding interactions with different contracts on TON.
This document was created to gather the best practices from all developers and share them with everyone.
Working with contracts' addresses
How to convert (user friendly <-> raw), assemble, and extract addresses from strings?
A TON address uniquely identifies contract in blockchain, indicating its workchain and original state hash. Two common formats are used: raw (workchain and HEX-encoded hash separated by the ":" character) and user-friendly (base64-encoded with certain flags).
User-friendly: EQDKbjIcfM6ezt8KjKJJLshZJJSqX7XOA4ff-W72r5gqPrHF
Raw: 0:ca6e321c7cce9ecedf0a8ca2492ec8592494aa5fb5ce0387dff96ef6af982a3e