Skip to content

Instantly share code, notes, and snippets.

@TrueCarry
Last active May 22, 2024 22:16
Show Gist options
  • Save TrueCarry/cac00bfae051f7028085aa018c2a05c6 to your computer and use it in GitHub Desktop.
Save TrueCarry/cac00bfae051f7028085aa018c2a05c6 to your computer and use it in GitHub Desktop.
TON Connect V2 Proof verification
https://github.com/ton-connect/demo-dapp-with-react-ui/blob/master/src/server/services/ton-proof-service.ts
@howardpen9
Copy link

nice.

So can we say we still have Wallet Signing to trigged the external message in TON>?

@huuduynvc
Copy link

how to parse state init

@y0unghe
Copy link

y0unghe commented Dec 5, 2023

How to create and send ton_proof message from front-end?

@0dd-b1t
Copy link

0dd-b1t commented Feb 11, 2024

Well, tonapi returns 404 on that address. Is there a new approach to check the tonproof?

@petrosyan52
Copy link

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

@peng-xiao-shuai
Copy link

1712115842224
1712115842237
Figure 1 shows me making a request on the test network and getting public_key
Figure 2 shows that I made a request on the mainnet and couldn't get publick_key

I used the tonkeeper Google Wallet to get the address.
Does anyone know why?

@peng-xiao-shuai
Copy link

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,
      },
    }
  )

@AlexBSoft
Copy link

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment