Documentation ¶
Index ¶
- Variables
- func WithBackReturnStrategy() linkOption
- func WithFrom(from string) txOpt
- func WithMainnet() txOpt
- func WithMessage(msg Message) txOpt
- func WithNoneReturnStrategy() linkOption
- func WithPayload(payload []byte) msgOpt
- func WithProofRequest(payload string) connReqOpt
- func WithPublicKey(pubkey string) signDataOpt
- func WithStateInit(stateInit []byte) msgOpt
- func WithTTL(ttl uint64) bridgeMessageOption
- func WithTestnet() txOpt
- func WithTimeout(timeout time.Duration) txOpt
- func WithURLReturnStrategy(url string) linkOption
- func WrapDeeplink(link string) string
- type ConnectItem
- type ConnectRequest
- type Message
- type Session
- func (s *Session) Connect(ctx context.Context, wallets ...Wallet) (*connectResponse, error)
- func (s *Session) Disconnect(ctx context.Context, options ...bridgeMessageOption) error
- func (s *Session) GenerateDeeplink(connreq ConnectRequest, options ...linkOption) (string, error)
- func (s *Session) GenerateUniversalLink(wallet Wallet, connreq ConnectRequest, options ...linkOption) (string, error)
- func (s *Session) MarshalJSON() ([]byte, error)
- func (s *Session) SendTransaction(ctx context.Context, tx Transaction, options ...bridgeMessageOption) ([]byte, error)
- func (s *Session) SignData(ctx context.Context, data SignData, options ...bridgeMessageOption) (*signDataResult, error)
- func (s *Session) UnmarshalJSON(data []byte) error
- type SignData
- type Transaction
- type Wallet
Constants ¶
This section is empty.
Variables ¶
View Source
var Wallets = map[string]Wallet{
"telegram-wallet": {
Name: "Wallet",
UniversalURL: "https://t.me/wallet/start?startapp=",
BridgeURL: "https://bridge.ton.space/bridge",
},
"tonkeeper": {
Name: "Tonkeeper",
UniversalURL: "https://app.tonkeeper.com/ton-connect",
BridgeURL: "https://bridge.tonapi.io/bridge",
},
"mytonwallet": {
Name: "MyTonWallet",
UniversalURL: "https://connect.mytonwallet.org/",
BridgeURL: "https://tonconnectbridge.mytonwallet.org/bridge",
},
"tonhub": {
Name: "Tonhub",
UniversalURL: "https://tonhub.com/ton-connect",
BridgeURL: "https://connect.tonhubapi.com/tonconnect",
},
"dewallet": {
Name: "DeWallet",
UniversalURL: "https://t.me/dewallet?attach=wallet",
BridgeURL: "https://sse-bridge.delab.team/bridge",
},
"bitgetTonWallet": {
Name: "Bitget Wallet",
UniversalURL: "https://bkcode.vip/ton-connect",
BridgeURL: "https://bridge.tonapi.io/bridge",
},
"safepalwallet": {
Name: "SafePal",
UniversalURL: "https://link.safepal.io/ton-connect",
BridgeURL: "https://ton-bridge.safepal.com/tonbridge/v1/bridge",
},
}
Functions ¶
func WithBackReturnStrategy ¶
func WithBackReturnStrategy() linkOption
func WithMainnet ¶
func WithMainnet() txOpt
func WithMessage ¶
func WithMessage(msg Message) txOpt
func WithNoneReturnStrategy ¶
func WithNoneReturnStrategy() linkOption
func WithPayload ¶
func WithPayload(payload []byte) msgOpt
func WithProofRequest ¶
func WithProofRequest(payload string) connReqOpt
func WithPublicKey ¶
func WithPublicKey(pubkey string) signDataOpt
func WithStateInit ¶
func WithStateInit(stateInit []byte) msgOpt
func WithTestnet ¶
func WithTestnet() txOpt
func WithTimeout ¶
func WithURLReturnStrategy ¶
func WithURLReturnStrategy(url string) linkOption
func WrapDeeplink ¶
Types ¶
type ConnectItem ¶
type ConnectRequest ¶
type ConnectRequest struct { ManifestURL string `json:"manifestUrl"` Items []ConnectItem `json:"items"` }
func NewConnectRequest ¶
func NewConnectRequest(manifestURL string, options ...connReqOpt) (*ConnectRequest, error)
type Message ¶
type Session ¶
type Session struct { ID nacl.Key `json:"id"` PrivateKey nacl.Key `json:"private_key"` ClientID nacl.Key `json:"client_id,omitempty"` BridgeURL string `json:"brdige_url,omitempty"` LastEventID uint64 `json:"last_event_id,string,omitempty"` LastRequestID uint64 `json:"last_request_id,string,omitempty"` }
func NewSession ¶
func (*Session) Disconnect ¶
func (*Session) GenerateDeeplink ¶
func (s *Session) GenerateDeeplink(connreq ConnectRequest, options ...linkOption) (string, error)
func (*Session) GenerateUniversalLink ¶
func (s *Session) GenerateUniversalLink(wallet Wallet, connreq ConnectRequest, options ...linkOption) (string, error)
func (*Session) MarshalJSON ¶
func (*Session) SendTransaction ¶
func (*Session) UnmarshalJSON ¶
type SignData ¶
type Transaction ¶
type Transaction struct { ValidUntil uint64 `json:"valid_until,omitempty"` Network string `json:"network,omitempty"` From string `json:"from,omitempty"` Messages []Message `json:"messages"` }
func NewTransaction ¶
func NewTransaction(options ...txOpt) (*Transaction, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.