Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_usdt_balance #294

Open
khalilmosavi opened this issue Oct 23, 2024 · 0 comments
Open

get_usdt_balance #294

khalilmosavi opened this issue Oct 23, 2024 · 0 comments

Comments

@khalilmosavi
Copy link

async function get_usdt_balance() {
    const tonweb = new TonWeb();
    const jettonMinter = new TonWeb.token.jetton.JettonMinter(tonweb.provider, { address: new TonWeb.utils.Address("EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs") });
    const jettonWalletAddress = await jettonMinter.getJettonWalletAddress(new TonWeb.utils.Address(address));
    console.log(jettonWalletAddress)
   
    const jettonWallet = new TonWeb.token.jetton.JettonWallet(tonweb.provider, {
        address: jettonWalletAddress
    });

    try {
        const jettonBalance = (await jettonWallet.getData()).balance;
        console.log(jettonBalance);
    } catch (error) {
        console.error('error:', error);
    }

    console.log(jettonData)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant