/
types.go
37 lines (29 loc) · 996 Bytes
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package liteclient
import "github.com/xssnick/tonutils-go/tl"
func init() {
tl.Register(LiteServerQuery{}, "liteServer.query data:bytes = Object")
tl.Register(TCPPing{}, "tcp.ping random_id:long = tcp.Pong")
tl.Register(TCPPong{}, "tcp.pong random_id:long = tcp.Pong")
tl.Register(TCPAuthenticate{}, "tcp.authentificate nonce:bytes = tcp.Message")
tl.Register(TCPAuthenticationNonce{}, "tcp.authentificationNonce nonce:bytes = tcp.Message")
tl.Register(TCPAuthenticationComplete{}, "tcp.authentificationComplete key:PublicKey signature:bytes = tcp.Message")
}
type LiteServerQuery struct {
Data any `tl:"bytes struct boxed"`
}
type TCPPing struct {
RandomID int64 `tl:"long"`
}
type TCPPong struct {
RandomID int64 `tl:"long"`
}
type TCPAuthenticate struct {
Nonce []byte `tl:"bytes"`
}
type TCPAuthenticationNonce struct {
Nonce []byte `tl:"bytes"`
}
type TCPAuthenticationComplete struct {
PublicKey any `tl:"struct boxed [pub.ed25519]"`
Signature []byte `tl:"bytes"`
}