neodix42 / ton4j

Java libraries for interacting with TON blockchain.
GNU General Public License v3.0
76 stars 27 forks source link

tell me how to see the number of tokens in an address, for example NOTcoins #14

Closed farsait-lt closed 3 months ago

farsait-lt commented 5 months ago

tell me how to see the number of tokens in an address, for example NOTcoins

neodix42 commented 5 months ago

Have you looked at this example? https://github.com/neodix42/ton4j/blob/1f5e473b7bf562412790c33c6d983b8197c48eca/smartcontract/src/test/java/org/ton/java/smartcontract/integrationtests/TestJetton.java#L143 You have to know the jetton wallet address of token you want to manipulate.

neodix42 commented 3 months ago
Tonlib tonlib = Tonlib.builder()
        .ignoreCache(false)
        .build();

log.info("balance: {}", ContractUtils.getJettonBalance(
        tonlib,
        Address.of("EQAvlWFDxGF2lXm67y4yzC17wYKD9A0guwPkMs1gOsM__NOT"),
        Address.of(<your-address-here>)
));