Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseStateInit ¶ added in v1.1.0
func StaticDomain ¶ added in v1.3.1
func StaticDomain(domain string) checkFunc
Types ¶
type Proof ¶
func CreateSignedProof ¶ added in v1.2.1
func CreateSignedProof(payload string, accountID tongo.AccountID, privateKey ed25519.PrivateKey, stateInit tlb.StateInit, options ProofOptions) (*Proof, error)
CreateSignedProof returns a proof that the caller posses a private key of a particular account. This can be used on the client side, when the server side runs tonconnect.Server or any other server implementation of ton-connect.
type ProofOptions ¶ added in v1.2.1
ProofOptions configures particular aspects of a proof.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewTonConnect ¶
func (*Server) CheckPayload ¶ added in v1.3.1
func (*Server) CheckProof ¶
func (s *Server) CheckProof(ctx context.Context, tp *Proof, checkPayload, checkDomain checkFunc) (bool, ed25519.PublicKey, error)
CheckProof aggregated with ready-made data from TonConnect 2.0 1) Client fetches payload from GeneratePayload to be signed by wallet 2) Client connects to the wallet via TonConnect 2.0 and passes ton_proof request with specified payload, for more details see the frontend SDK: https://github.com/ton-connect/sdk/tree/main/packages/sdk 3) User approves connection and client receives signed payload with additional prefixes. 4) Client sends signed result (Proof) to the backend and CheckProof checks correctness of the all prefixes and signature correctness
func (*Server) GeneratePayload ¶
GeneratePayload this is the first stage of the authorization process. Client fetches payload to be signed by wallet