It is not possible for one contract on TON to call a method on another smart contract on TON.
The pattern of contracts calling contracts synchronously (within the flow of the same transaction) originates from Solidity and the EVM but this pattern is not applicable to all blockchains. There are several conceptual differences between TON and the EVM - you can read more about them here.
It is better to view smart contracts on TON like micro services that are running on different machines. They can send messages to each other but these messages are asynchronous and not atomic - so they may be handled in different blocks (on different transactions).
You will need to accommodate for this in your contract architecture. Here are some ideas on how to do this:
-
Let's say your contract needs to know its own token balance. You can store this balance on a variable in your own contract. Every time your token wallet receives tokens, you may be able to arrange to have a notification message sent to you, and update this variable when this message is received.
-
To query data from a different contract, you can send it a message and have the other contract reply with a message containing the response. This will break the flow into 3 different transactions, which will bring its own complexities, like undoing any effects of the first if one of the later ones fail.