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

[UI-REACT]: Send USDT follow official docs not work #217

Open
EF09FE opened this issue Jul 30, 2024 · 1 comment
Open

[UI-REACT]: Send USDT follow official docs not work #217

EF09FE opened this issue Jul 30, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@EF09FE
Copy link

EF09FE commented Jul 30, 2024

Describe the bug

Follow the official docs to prepare jetton transfer transaction: https://docs.ton.org/develop/dapps/ton-connect/message-builders#jetton-transfer

// get user USDT wallet address from USDT Jetton Master
const userUSDTAddress = await getUserJettonWalletAddress(walletAddress, USDTJettonMasterAddress)

const body = beginCell()
            .storeUint(0xf8a7ea5, 32)                 // jetton transfer op code
            .storeUint(0, 64)                         // query_id:uint64
            .storeCoins(1000000)                      // amount:(VarUInteger 16) -  Jetton amount for transfer (decimals = 6 - jUSDT, 9 - default)
            .storeAddress(Address.parse(to))  // destination:MsgAddress
            .storeAddress(Address.parse(walletAddress))  // response_destination:MsgAddress
            .storeUint(0, 1)                          // custom_payload:(Maybe ^Cell)
            .storeCoins(toNano(0.05))                 // forward_ton_amount:(VarUInteger 16) - if >0, will send notification message
            .storeUint(0,1)                           // forward_payload:(Either Cell ^Cell)
            .endCell();

        const transaction = {
            validUntil: Math.floor(Date.now() / 1000) + 360,
            messages: [
                {
                    address: userUSDTAddress.toRawString(), // sender jetton wallet
                    amount: toNano(0.05).toString(), // for commission fees, excess will be returned
                    payload: body.toBoc().toString("base64") // payload with jetton transfer and comment body
                }
            ]
        }

      const txRes = await tonConnectUI.sendTransaction(transaction as SendTransactionRequest)

Expected behavior

Launch Ton Wallet miniapp and confirm to send transaction

Current behavior

Launch Ton Wallet miniapp but it's keep loading, and then toast a message: Unable to verify transaction

Here is console log:
image

Steps to Reproduce

see describe code

Environment

MacOS

Additional context

No response

@EF09FE EF09FE added the bug Something isn't working label Jul 30, 2024
@heydarbadirli
Copy link

Hi @thekiba
Is there any update on the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants