tonconnect

package
v1.0.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2023 License: MIT Imports: 20 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(o *Options)

func WithLifeTimePayload

func WithLifeTimePayload(lifeTimePayload int64) Option

func WithLifeTimeProof

func WithLifeTimeProof(lifeTimeProof int64) Option

type Options

type Options struct {
	// contains filtered or unexported fields
}

type Proof

type Proof struct {
	Address string    `json:"address"`
	Proof   ProofData `json:"proof"`
}

type ProofData

type ProofData struct {
	Timestamp int64  `json:"timestamp"`
	Domain    string `json:"domain"`
	Signature string `json:"signature"`
	Payload   string `json:"payload"`
	StateInit string `json:"state_init"`
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewTonConnect

func NewTonConnect(executor abi.Executor, secret string, opts ...Option) (*Server, error)

func (*Server) CheckProof

func (s *Server) CheckProof(tp *Proof) (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

func (s *Server) GeneratePayload() (string, error)

GeneratePayload this is the first stage of the authorization process. Client fetches payload to be signed by wallet

func (*Server) GetSecret

func (s *Server) GetSecret() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL