Hey! i'm building a react app and wondering if there is any way to handle error from contract using tonconnect
Apr 14, 2023, 3:34 AM
I believe that TonCenter has an API that can return the result of the data you prepare to send to the smart contract. It works similarly to TonKeeper, where it displays the result of your transaction before submitting it to the blockchain.
You can use the /tryLocateResultTx API, but I have not personally used it before.
You can use the /tryLocateResultTx API, but I have not personally used it before.
Apr 14, 2023, 3:59 AM
thanks
Apr 14, 2023, 4:00 AM
Once you get the exit code, you can pivot the issued based on the smart contract code to fine out.
Apr 14, 2023, 4:00 AM
So, if others encounter the same problem as me, here is the solution:
1. Get the transaction hash from https://testnet.toncenter.com/api/v2/#/transactions/get_transactions_getTransactions_get
2. Use this API, somehow not listed in their docs, to get exit codes https://testnet.toncenter.com/api/index/getTransactionByHash?tx_hash=ZexL39jdgYx0YHwEhemtrH2dWpbMEPoj4sWc7Lfdu5g=&include_msg_body=true
1. Get the transaction hash from https://testnet.toncenter.com/api/v2/#/transactions/get_transactions_getTransactions_get
2. Use this API, somehow not listed in their docs, to get exit codes https://testnet.toncenter.com/api/index/getTransactionByHash?tx_hash=ZexL39jdgYx0YHwEhemtrH2dWpbMEPoj4sWc7Lfdu5g=&include_msg_body=true
tonscan uses this api
is there any way to match wallet address in tonkeeper with the one obtained by tonconnect ui?
Apr 14, 2023, 5:15 AM
Why do I sometimes get an "unknown lite server" error when using toncenter web api
@slavafomin
@slavafomin
How can I avoid this error?
It is interesting that the toncenter interface 'try it' also sometimes gets this error.
Apr 14, 2023, 10:55 AM
@ruslixag
Apr 14, 2023, 10:57 AM