Documentation
¶
Index ¶
- type MORRPCMessage
- func (m *MORRPCMessage) AuthError(privateKeyHex lib.HexString, requestId string) (*RpcResponse, error)
- func (m *MORRPCMessage) InitiateSessionRequest(user common.Address, provider common.Address, spend *big.Int, ...) (*RPCMessage, error)
- func (m *MORRPCMessage) InitiateSessionResponse(providerPubKey lib.HexString, userAddr common.Address, bidID common.Hash, ...) (*RpcResponse, error)
- func (m *MORRPCMessage) OutOfCapacityError(privateKeyHex lib.HexString, requestId string) (*RpcResponse, error)
- func (m *MORRPCMessage) ResponseError(message string, privateKeyHex lib.HexString, requestId string) (*RpcResponse, error)
- func (m *MORRPCMessage) SessionCloseRequest(sessionID common.Hash, userPrivateKeyHex lib.HexString, requestId string) (*RPCMessage, error)
- func (m *MORRPCMessage) SessionClosedError(privateKeyHex lib.HexString, requestId string) (*RpcResponse, error)
- func (m *MORRPCMessage) SessionPromptRequest(sessionID common.Hash, prompt interface{}, providerPubKey lib.HexString, ...) (*RPCMessage, error)
- func (m *MORRPCMessage) SessionPromptResponse(message string, providerPrivateKeyHex lib.HexString, requestId string) (*RpcResponse, error)
- func (m *MORRPCMessage) SessionReport(sessionID string, start uint, end uint, prompts uint, tokens uint, ...) (*RpcResponse, error)
- func (m *MORRPCMessage) SpendLimitError(privateKeyHex lib.HexString, requestId string) (*RpcResponse, error)
- func (m *MORRPCMessage) VerifySignature(params any, signature lib.HexString, publicKey lib.HexString, ...) bool
- type RPCErrorData
- type RPCMessage
- type ReportRes
- type ReqObject
- type RpcError
- type RpcResponse
- type SessionCloseReq
- type SessionPromptReq
- type SessionPromptRes
- type SessionReport
- type SessionReq
- type SessionRes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MORRPCMessage ¶
type MORRPCMessage struct{}
func NewMorRpc ¶
func NewMorRpc() *MORRPCMessage
func (*MORRPCMessage) AuthError ¶
func (m *MORRPCMessage) AuthError(privateKeyHex lib.HexString, requestId string) (*RpcResponse, error)
func (*MORRPCMessage) InitiateSessionRequest ¶
func (*MORRPCMessage) InitiateSessionResponse ¶
func (*MORRPCMessage) OutOfCapacityError ¶
func (m *MORRPCMessage) OutOfCapacityError(privateKeyHex lib.HexString, requestId string) (*RpcResponse, error)
func (*MORRPCMessage) ResponseError ¶
func (m *MORRPCMessage) ResponseError(message string, privateKeyHex lib.HexString, requestId string) (*RpcResponse, error)
func (*MORRPCMessage) SessionCloseRequest ¶
func (m *MORRPCMessage) SessionCloseRequest(sessionID common.Hash, userPrivateKeyHex lib.HexString, requestId string) (*RPCMessage, error)
func (*MORRPCMessage) SessionClosedError ¶
func (m *MORRPCMessage) SessionClosedError(privateKeyHex lib.HexString, requestId string) (*RpcResponse, error)
func (*MORRPCMessage) SessionPromptRequest ¶
func (m *MORRPCMessage) SessionPromptRequest(sessionID common.Hash, prompt interface{}, providerPubKey lib.HexString, userPrivateKeyHex lib.HexString, requestId string) (*RPCMessage, error)
func (*MORRPCMessage) SessionPromptResponse ¶
func (m *MORRPCMessage) SessionPromptResponse(message string, providerPrivateKeyHex lib.HexString, requestId string) (*RpcResponse, error)
func (*MORRPCMessage) SessionReport ¶
func (*MORRPCMessage) SpendLimitError ¶
func (m *MORRPCMessage) SpendLimitError(privateKeyHex lib.HexString, requestId string) (*RpcResponse, error)
type RPCErrorData ¶
type RPCMessage ¶
type RPCMessage struct { ID string `json:"id"` Method string `json:"method"` Params json.RawMessage `json:"params"` }
type ReportRes ¶
type ReportRes struct { Signature lib.HexString `json:"signature,omitempty" validate:"required,hexadecimal"` Message *SessionReport `json:"message" validate:"required"` Timestamp uint64 `json:"timestamp" validate:"required,number"` }
type RpcError ¶
type RpcError struct { Message string `json:"message"` Code int `json:"code"` Data RPCErrorData `json:"data"` }
type RpcResponse ¶
type RpcResponse struct { ID string `json:"id"` Result *json.RawMessage `json:"result"` Error *RpcError `json:"error,omitempty"` }
type SessionCloseReq ¶
type SessionPromptReq ¶
type SessionPromptRes ¶
type SessionReport ¶
type SessionReport struct { SessionID string `json:"sessionid"` Start uint `json:"start"` End uint `json:"end"` Prompts uint `json:"prompts"` Tokens uint `json:"tokens"` Reqs []ReqObject `json:"reqs"` }
SessionReport represents the detailed session report
type SessionReq ¶
type SessionReq struct { Signature lib.HexString `json:"signature,omitempty" validate:"required,hexadecimal"` User common.Address `json:"user" validate:"required,eth_addr"` Key lib.HexString `json:"key" validate:"required,hexadecimal"` Spend lib.BigInt `json:"spend" validate:"required"` Timestamp uint64 `json:"timestamp" validate:"required,number"` BidID common.Hash `json:"bidid" validate:"required,hex32"` }
type SessionRes ¶
type SessionRes struct { PubKey lib.HexString `json:"message" validate:"required,hexadecimal"` Approval lib.HexString `json:"approval" validate:"required,hexadecimal"` ApprovalSig lib.HexString `json:"approvalSig" validate:"required,hexadecimal"` User common.Address `json:"user" validate:"required,eth_addr"` Timestamp uint64 `json:"timestamp" validate:"required,timestamp"` Signature lib.HexString `json:"signature,omitempty" validate:"required,hexadecimal"` }
Click to show internal directories.
Click to hide internal directories.