Documentation ¶
Index ¶
- func DecodeAlgoSignResponse(response AlgoSignResponse) ([][]byte, error)
- func MakeClient(meta SessionRequestPeerMeta, opts ...ClientOption) (*Client, *SessionRequestResponseResult, error)
- func MakeIV() ([]byte, error)
- func MakeKey() ([]byte, error)
- func MakeTopic() string
- func WithServerDebug(debug bool) func(*Server)
- type AlgoSignParams
- type AlgoSignRequest
- type AlgoSignResponse
- type Client
- type ClientOption
- type Conn
- type ConnOption
- type Error
- type Header
- type Incoming
- type Message
- type Msg
- type OutgoingResponse
- type Request
- type Server
- type ServerOption
- type SessionRequestParams
- type SessionRequestPeerMeta
- type SessionRequestRequest
- type SessionRequestResponse
- type SessionRequestResponseResult
- type SessionUpdateParams
- type SessionUpdateRequest
- type Signer
- type Uri
- type WC
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeAlgoSignResponse ¶
func DecodeAlgoSignResponse(response AlgoSignResponse) ([][]byte, error)
func MakeClient ¶
func MakeClient(meta SessionRequestPeerMeta, opts ...ClientOption) (*Client, *SessionRequestResponseResult, error)
func WithServerDebug ¶
Types ¶
type AlgoSignParams ¶
type AlgoSignRequest ¶
type AlgoSignRequest struct {
Params [][]AlgoSignParams `json:"params"`
}
type AlgoSignResponse ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Sign ¶
func (c *Client) Sign(ctx context.Context, request AlgoSignRequest) (*AlgoSignResponse, error)
type ClientOption ¶
type ClientOption func(c *Client)
func WithClientConn ¶
func WithClientConn(conn *Conn) ClientOption
func WithClientDebug ¶
func WithClientDebug(debug bool) ClientOption
func WithClientUrlHandler ¶
func WithClientUrlHandler(handler func(uri Uri) error) ClientOption
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func MakeConn ¶
func MakeConn(opts ...ConnOption) (*Conn, error)
type ConnOption ¶
type ConnOption func(*Conn)
func WithConnDebug ¶
func WithConnDebug(enabled bool) ConnOption
func WithConnHost ¶
func WithConnHost(host string) ConnOption
func WithConnKey ¶
func WithConnKey(key []byte) ConnOption
type Header ¶
type Header struct { Id uint64 `json:"id"` JsonRPC string `json:"jsonrpc"` Method string `json:"method,omitempty"` Error *Error `json:"error,omitempty"` }
func MakeRequestHeader ¶
func MakeResponseHeader ¶
type OutgoingResponse ¶
type Request ¶
type Request struct { Header Params []interface{} `json:"params"` }
func MakeRequestSession ¶
func MakeRequestSession(id uint64, peer string, meta SessionRequestPeerMeta) (Request, error)
func MakeSignTransactions ¶
func MakeSignTransactions(id uint64, req AlgoSignRequest) (Request, error)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func MakeServer ¶
func MakeServer(uri Uri, signer Signer, opts ...ServerOption) (*Server, error)
type ServerOption ¶
type ServerOption func(s *Server)
type SessionRequestParams ¶
type SessionRequestParams struct { PeerId string `json:"peerId"` PeerMeta SessionRequestPeerMeta `json:"peerMeta"` ChainId int `json:"chainId"` }
type SessionRequestPeerMeta ¶
type SessionRequestRequest ¶
type SessionRequestRequest struct {
Params []SessionRequestParams `json:"params"`
}
type SessionRequestResponse ¶
type SessionRequestResponse struct { Error *Error `json:"error,omitempty"` Result SessionRequestResponseResult `json:"result"` }
type SessionRequestResponseResult ¶
type SessionRequestResponseResult struct { PeerId string `json:"peerId"` PeerMeta SessionRequestPeerMeta `json:"peerMeta"` Approved bool `json:"approved"` ChainId int `json:"chainId"` Accounts []string `json:"accounts"` }
type SessionUpdateParams ¶
type SessionUpdateRequest ¶
type SessionUpdateRequest struct { Header Params []SessionUpdateParams `json:"params"` }
type Signer ¶
type Signer interface { Sign(AlgoSignRequest) (*AlgoSignResponse, error) Address() string }
Click to show internal directories.
Click to hide internal directories.