ws

package
v0.0.0-...-7d1b45a Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const WEB3PRO_PORT = 9323 // WEB3 mnemonics

Variables

View Source
var WSConnections = make([]*ConContext, 0)
View Source
var WSConnectionsMutex = sync.Mutex{}

Functions

func AddConnection

func AddConnection(conn *ConContext)

func Init

func Init()

func RemoveConnection

func RemoveConnection(conn *ConContext)

Types

type BroadcastParams

type BroadcastParams struct {
	Subscription string `json:"subscription,omitempty"`
	Result       any    `json:"result,omitempty"`
}

type ConContext

type ConContext struct {
	Agent      string
	Connection *websocket.Conn
	SM         *subManger
}

type RPCBroadcast

type RPCBroadcast struct {
	JSONRPC       string          `json:"jsonrpc"`
	Method        string          `json:"method"`
	Params        BroadcastParams `json:"params"`
	Web3ProOrigin string          `json:"__web3proOrigin,omitempty"`
}

type RPCError

type RPCError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Result  string `json:"result"`
}

type RPCRequest

type RPCRequest struct {
	JSONRPC       string `json:"jsonrpc"`
	ID            int64  `json:"id"`
	Method        string `json:"method"`
	Params        any    `json:"params"` // Params as a slice of interface{}
	Web3ProOrigin string `json:"__web3proOrigin,omitempty"`
}

type RPCResponse

type RPCResponse struct {
	JSONRPC string      `json:"jsonrpc"`
	ID      int64       `json:"id"`
	Result  interface{} `json:"result"`
	Error   *RPCError   `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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