-
-
Save TrueCarry/cac00bfae051f7028085aa018c2a05c6 to your computer and use it in GitHub Desktop.
https://github.com/ton-connect/demo-dapp-with-react-ui/blob/master/src/server/services/ton-proof-service.ts |
how to parse state init
How to create and send ton_proof message from front-end?
Well, tonapi returns 404 on that address. Is there a new approach to check the tonproof?
Well, tonapi returns 404 on that address. Is there a new approach to check the tonproof?
You need to use ton api v2
https://docs.tonconsole.com/tonapi/api-v2
use
v2/accounts/{account_id}/publickey
public_key can be obtained using v2/tonconnect/stateinit
const { data } = await axios(
`https://${
body.network === '-3' ? 'testnet.' : ''
}tonapi.io/v2/tonconnect/stateinit`,
{
method: 'POST',
data: {
state_init: body.proof.state_init,
},
}
)
@peng-xiao-shuai thanks, that works!
Is there any other methods to get public key instead of tonapi.io? It is proprietary project and they can shutdown v2 api in few years how did they did it with v1
@peng-xiao-shuai thanks, that works!
Is there any other methods to get public key instead of tonapi.io? It is proprietary project and they can shutdown v2 api in few years how did they did it with v1
-
Get the wallet pubkey via the contract wallet's get method. (https://tonapi.io/api-v2#operations-Connect-getTonConnectPayload) /v2/tonconnect/stateinit
-
If the contract is inactive, this method will not work; you'll need to parse the walletStateInit provided by the frontend.
parse state init example on GO:
https://github.com/ton-connect/demo-dapp-backend/blob/master/state_init.go
nice.
So can we say we still have Wallet Signing to trigged the external message in TON>?