Versions in this module Expand all Collapse all v1 v1.2.0 Mar 8, 2026 Changes in this version + const AppSessionsV1CreateAppSessionMethod + const AppSessionsV1GetAppDefinitionMethod + const AppSessionsV1GetAppSessionsMethod + const AppSessionsV1GetLastKeyStatesMethod + const AppSessionsV1Group + const AppSessionsV1RebalanceAppSessionsMethod + const AppSessionsV1SubmitAppStateMethod + const AppSessionsV1SubmitDepositStateMethod + const AppSessionsV1SubmitSessionKeyStateMethod + const AppsV1GetAppsMethod + const AppsV1Group + const AppsV1SubmitAppVersionMethod + const ChannelV1Group + const ChannelsV1GetChannelsMethod + const ChannelsV1GetEscrowChannelMethod + const ChannelsV1GetHomeChannelMethod + const ChannelsV1GetLastKeyStatesMethod + const ChannelsV1GetLatestStateMethod + const ChannelsV1GetStatesMethod + const ChannelsV1RequestCreationMethod + const ChannelsV1SubmitSessionKeyStateMethod + const ChannelsV1SubmitStateMethod + const NodeV1GetAssetsMethod + const NodeV1GetConfigMethod + const NodeV1Group + const NodeV1PingMethod + const UserV1GetActionAllowancesMethod + const UserV1GetBalancesMethod + const UserV1GetTransactionsMethod + const UserV1Group + var DefaultWebsocketDialerConfig = WebsocketDialerConfig + var ErrAlreadyConnected = fmt.Errorf("already connected") + var ErrConnectionTimeout = fmt.Errorf("websocket connection timeout") + var ErrDialingWebsocket = fmt.Errorf("error dialing websocket server") + var ErrInvalidRequestMethod = fmt.Errorf("invalid request method") + var ErrMarshalingRequest = fmt.Errorf("error marshaling request") + var ErrNilRequest = fmt.Errorf("nil request") + var ErrNoResponse = fmt.Errorf("no response received") + var ErrNotConnected = fmt.Errorf("not connected to server") + var ErrReadingMessage = fmt.Errorf("error reading message") + var ErrSendingPing = fmt.Errorf("error sending ping") + var ErrSendingRequest = fmt.Errorf("error sending request") + type ActionAllowanceV1 struct + Allowance string + GatedAction core.GatedAction + TimeWindow string + Used string + type AppAllocationV1 struct + Amount string + Asset string + Participant string + type AppDefinitionV1 struct + Application string + Nonce string + Participants []AppParticipantV1 + Quorum uint8 + type AppInfoV1 struct + CreatedAt string + UpdatedAt string + type AppParticipantV1 struct + SignatureWeight uint8 + WalletAddress string + type AppSessionInfoV1 struct + Allocations []AppAllocationV1 + AppDefinitionV1 AppDefinitionV1 + AppSessionID string + SessionData *string + Status string + Version string + type AppSessionKeyStateV1 struct + AppSessionIDs []string + ApplicationIDs []string + ExpiresAt string + SessionKey string + UserAddress string + UserSig string + Version string + type AppSessionsV1CreateAppSessionRequest struct + Definition AppDefinitionV1 + OwnerSig string + QuorumSigs []string + SessionData string + type AppSessionsV1CreateAppSessionResponse struct + AppSessionID string + Status string + Version string + type AppSessionsV1GetAppDefinitionRequest struct + AppSessionID string + type AppSessionsV1GetAppDefinitionResponse struct + Definition AppDefinitionV1 + type AppSessionsV1GetAppSessionsRequest struct + AppSessionID *string + Pagination *PaginationParamsV1 + Participant *string + Status *string + type AppSessionsV1GetAppSessionsResponse struct + AppSessions []AppSessionInfoV1 + Metadata PaginationMetadataV1 + type AppSessionsV1GetLastKeyStatesRequest struct + SessionKey *string + UserAddress string + type AppSessionsV1GetLastKeyStatesResponse struct + States []AppSessionKeyStateV1 + type AppSessionsV1RebalanceAppSessionsRequest struct + SignedUpdates []SignedAppStateUpdateV1 + type AppSessionsV1RebalanceAppSessionsResponse struct + BatchID string + type AppSessionsV1SubmitAppStateRequest struct + AppStateUpdate AppStateUpdateV1 + QuorumSigs []string + type AppSessionsV1SubmitAppStateResponse struct + type AppSessionsV1SubmitDepositStateRequest struct + AppStateUpdate AppStateUpdateV1 + QuorumSigs []string + UserState StateV1 + type AppSessionsV1SubmitDepositStateResponse struct + StateNodeSig string + type AppSessionsV1SubmitSessionKeyStateRequest struct + State AppSessionKeyStateV1 + type AppSessionsV1SubmitSessionKeyStateResponse struct + type AppStateUpdateV1 struct + Allocations []AppAllocationV1 + AppSessionID string + Intent app.AppStateUpdateIntent + SessionData string + Version string + type AppV1 struct + CreationApprovalNotRequired bool + ID string + Metadata string + OwnerWallet string + Version string + type AppsV1GetAppsRequest struct + AppID *string + OwnerWallet *string + Pagination *PaginationParamsV1 + type AppsV1GetAppsResponse struct + Apps []AppInfoV1 + Metadata PaginationMetadataV1 + type AppsV1SubmitAppVersionRequest struct + App AppV1 + OwnerSig string + type AppsV1SubmitAppVersionResponse struct + type AssetV1 struct + Decimals uint8 + Name string + SuggestedBlockchainID string + Symbol string + Tokens []TokenV1 + type BalanceEntryV1 struct + Amount string + Asset string + type BlockchainInfoV1 struct + BlockchainID string + ChannelHubAddress string + LockingContractAddress string + Name string + type ChannelDefinitionV1 struct + ApprovedSigValidators string + Challenge uint32 + Nonce string + type ChannelSessionKeyStateV1 struct + Assets []string + ExpiresAt string + SessionKey string + UserAddress string + UserSig string + Version string + type ChannelV1 struct + ApprovedSigValidators string + Asset string + BlockchainID string + ChallengeDuration uint32 + ChallengeExpiresAt *time.Time + ChannelID string + Nonce string + StateVersion string + Status string + TokenAddress string + Type string + UserWallet string + type ChannelsV1GetChannelsRequest struct + Asset *string + ChannelType *string + Pagination *PaginationParamsV1 + Status *string + Wallet string + type ChannelsV1GetChannelsResponse struct + Channels []ChannelV1 + Metadata PaginationMetadataV1 + type ChannelsV1GetEscrowChannelRequest struct + EscrowChannelID string + type ChannelsV1GetEscrowChannelResponse struct + Channel ChannelV1 + type ChannelsV1GetHomeChannelRequest struct + Asset string + Wallet string + type ChannelsV1GetHomeChannelResponse struct + Channel ChannelV1 + type ChannelsV1GetLastKeyStatesRequest struct + SessionKey *string + UserAddress string + type ChannelsV1GetLastKeyStatesResponse struct + States []ChannelSessionKeyStateV1 + type ChannelsV1GetLatestStateRequest struct + Asset string + OnlySigned bool + Wallet string + type ChannelsV1GetLatestStateResponse struct + State StateV1 + type ChannelsV1GetStatesRequest struct + Asset string + ChannelID *string + Epoch *string + OnlySigned bool + Pagination *PaginationParamsV1 + Wallet string + type ChannelsV1GetStatesResponse struct + Metadata PaginationMetadataV1 + States []StateV1 + type ChannelsV1HomeChannelCreatedEvent struct + Channel ChannelV1 + InitialState StateV1 + type ChannelsV1RequestCreationRequest struct + ChannelDefinition ChannelDefinitionV1 + State StateV1 + type ChannelsV1RequestCreationResponse struct + Signature string + type ChannelsV1SubmitSessionKeyStateRequest struct + State ChannelSessionKeyStateV1 + type ChannelsV1SubmitSessionKeyStateResponse struct + type ChannelsV1SubmitStateRequest struct + State StateV1 + type ChannelsV1SubmitStateResponse struct + Signature string + type Client struct + func NewClient(dialer Dialer) *Client + func (c *Client) AppSessionsV1CreateAppSession(ctx context.Context, req AppSessionsV1CreateAppSessionRequest) (AppSessionsV1CreateAppSessionResponse, error) + func (c *Client) AppSessionsV1GetAppDefinition(ctx context.Context, req AppSessionsV1GetAppDefinitionRequest) (AppSessionsV1GetAppDefinitionResponse, error) + func (c *Client) AppSessionsV1GetAppSessions(ctx context.Context, req AppSessionsV1GetAppSessionsRequest) (AppSessionsV1GetAppSessionsResponse, error) + func (c *Client) AppSessionsV1GetLastKeyStates(ctx context.Context, req AppSessionsV1GetLastKeyStatesRequest) (AppSessionsV1GetLastKeyStatesResponse, error) + func (c *Client) AppSessionsV1RebalanceAppSessions(ctx context.Context, req AppSessionsV1RebalanceAppSessionsRequest) (AppSessionsV1RebalanceAppSessionsResponse, error) + func (c *Client) AppSessionsV1SubmitAppState(ctx context.Context, req AppSessionsV1SubmitAppStateRequest) (AppSessionsV1SubmitAppStateResponse, error) + func (c *Client) AppSessionsV1SubmitDepositState(ctx context.Context, req AppSessionsV1SubmitDepositStateRequest) (AppSessionsV1SubmitDepositStateResponse, error) + func (c *Client) AppSessionsV1SubmitSessionKeyState(ctx context.Context, req AppSessionsV1SubmitSessionKeyStateRequest) (AppSessionsV1SubmitSessionKeyStateRequest, error) + func (c *Client) AppsV1GetApps(ctx context.Context, req AppsV1GetAppsRequest) (AppsV1GetAppsResponse, error) + func (c *Client) AppsV1SubmitAppVersion(ctx context.Context, req AppsV1SubmitAppVersionRequest) (AppsV1SubmitAppVersionResponse, error) + func (c *Client) ChannelsV1GetChannels(ctx context.Context, req ChannelsV1GetChannelsRequest) (ChannelsV1GetChannelsResponse, error) + func (c *Client) ChannelsV1GetEscrowChannel(ctx context.Context, req ChannelsV1GetEscrowChannelRequest) (ChannelsV1GetEscrowChannelResponse, error) + func (c *Client) ChannelsV1GetHomeChannel(ctx context.Context, req ChannelsV1GetHomeChannelRequest) (ChannelsV1GetHomeChannelResponse, error) + func (c *Client) ChannelsV1GetLastKeyStates(ctx context.Context, req ChannelsV1GetLastKeyStatesRequest) (ChannelsV1GetLastKeyStatesResponse, error) + func (c *Client) ChannelsV1GetLatestState(ctx context.Context, req ChannelsV1GetLatestStateRequest) (ChannelsV1GetLatestStateResponse, error) + func (c *Client) ChannelsV1GetStates(ctx context.Context, req ChannelsV1GetStatesRequest) (ChannelsV1GetStatesResponse, error) + func (c *Client) ChannelsV1RequestCreation(ctx context.Context, req ChannelsV1RequestCreationRequest) (ChannelsV1RequestCreationResponse, error) + func (c *Client) ChannelsV1SubmitSessionKeyState(ctx context.Context, req ChannelsV1SubmitSessionKeyStateRequest) (ChannelsV1SubmitSessionKeyStateResponse, error) + func (c *Client) ChannelsV1SubmitState(ctx context.Context, req ChannelsV1SubmitStateRequest) (ChannelsV1SubmitStateResponse, error) + func (c *Client) NodeV1GetAssets(ctx context.Context, req NodeV1GetAssetsRequest) (NodeV1GetAssetsResponse, error) + func (c *Client) NodeV1GetConfig(ctx context.Context) (NodeV1GetConfigResponse, error) + func (c *Client) NodeV1Ping(ctx context.Context) error + func (c *Client) Start(ctx context.Context, url string, handleClosure func(err error)) error + func (c *Client) UserV1GetActionAllowances(ctx context.Context, req UserV1GetActionAllowancesRequest) (UserV1GetActionAllowancesResponse, error) + func (c *Client) UserV1GetBalances(ctx context.Context, req UserV1GetBalancesRequest) (UserV1GetBalancesResponse, error) + func (c *Client) UserV1GetTransactions(ctx context.Context, req UserV1GetTransactionsRequest) (UserV1GetTransactionsResponse, error) + type Connection interface + ConnectionID func() string + Origin func() string + RawRequests func() <-chan []byte + Serve func(parentCtx context.Context, handleClosure func(error)) + WriteRawResponse func(message []byte) bool + type ConnectionHub struct + func NewConnectionHub(observeConnections ObserveConnectionsFn) *ConnectionHub + func (hub *ConnectionHub) Add(conn Connection) error + func (hub *ConnectionHub) Get(connID string) Connection + func (hub *ConnectionHub) Publish(userID string, response []byte) + func (hub *ConnectionHub) Remove(connID string) + type Context struct + Context context.Context + Request Message + Response Message + Storage *SafeStorage + func (c *Context) Fail(err error, fallbackMessage string) + func (c *Context) Next() + func (c *Context) Succeed(method string, payload Payload) + type Dialer interface + Call func(ctx context.Context, req *Message) (*Message, error) + Dial func(ctx context.Context, url string, handleClosure func(err error)) error + EventCh func() <-chan *Message + IsConnected func() bool + type Error struct + func Errorf(format string, args ...any) Error + func NewError(err error) Error + func (e Error) Error() string + type Event string + func (e Event) String() string + type GorillaWsConnectionAdapter interface + Close func() error + NextWriter func(messageType int) (io.WriteCloser, error) + ReadMessage func() (messageType int, p []byte, err error) + SetPongHandler func(h func(appData string) error) + SetReadDeadline func(t time.Time) error + WriteControl func(messageType int, data []byte, deadline time.Time) error + type Group string + func (g Group) String() string + type Handler func(c *Context) + type HandlerGroup interface + Handle func(method string, handler Handler) + NewGroup func(name string) HandlerGroup + Use func(middleware Handler) + type LedgerV1 struct + BlockchainID string + NodeBalance string + NodeNetFlow string + TokenAddress string + UserBalance string + UserNetFlow string + type Message struct + Method string + Payload Payload + RequestID uint64 + Timestamp uint64 + Type MsgType + func NewErrorResponse(requestID uint64, method string, errMsg string) Message + func NewEvent(requestID uint64, method string, params Payload) Message + func NewMessage(typ MsgType, id uint64, method string, params Payload) Message + func NewRequest(requestID uint64, method string, params Payload) Message + func NewResponse(requestID uint64, method string, params Payload) Message + func (p *Message) UnmarshalJSON(data []byte) error + func (p Message) MarshalJSON() ([]byte, error) + func (r Message) Error() error + type Method string + func (m Method) String() string + type MsgType uint8 + var MsgTypeEvent MsgType = 3 + var MsgTypeReq MsgType = 1 + var MsgTypeResp MsgType = 2 + var MsgTypeRespErr MsgType = 4 + func (t MsgType) String() string + type Node interface + Handle func(method string, handler Handler) + NewGroup func(name string) HandlerGroup + Notify func(userID string, method string, params Payload) + ServeHTTP func(w http.ResponseWriter, r *http.Request) + Use func(middleware Handler) + type NodeV1GetAssetsRequest struct + BlockchainID *string + type NodeV1GetAssetsResponse struct + Assets []AssetV1 + type NodeV1GetConfigRequest struct + type NodeV1GetConfigResponse struct + Blockchains []BlockchainInfoV1 + NodeAddress string + NodeVersion string + SupportedSigValidators []core.ChannelSignerType + type NodeV1PingRequest struct + type NodeV1PingResponse struct + type ObserveConnectionsFn func(region, origin string, count uint32) + type PaginationMetadataV1 struct + Page uint32 + PageCount uint32 + PerPage uint32 + TotalCount uint32 + type PaginationParamsV1 struct + Limit *uint32 + Offset *uint32 + Sort *string + type Payload map[string]json.RawMessage + func NewErrorPayload(errMsg string) Payload + func NewPayload(v any) (Payload, error) + func (p Payload) Error() error + func (p Payload) Translate(v any) error + type SafeStorage struct + func NewSafeStorage() *SafeStorage + func (s *SafeStorage) Get(key string) (any, bool) + func (s *SafeStorage) Set(key string, value any) + type SendResponseFunc func(method string, params Payload) + type SignedAppStateUpdateV1 struct + AppStateUpdate AppStateUpdateV1 + QuorumSigs []string + type StateV1 struct + Asset string + Epoch string + EscrowChannelID *string + EscrowLedger *LedgerV1 + HomeChannelID *string + HomeLedger LedgerV1 + ID string + NodeSig *string + Transition TransitionV1 + UserSig *string + UserWallet string + Version string + type TokenV1 struct + Address string + BlockchainID string + Decimals uint8 + Name string + Symbol string + type TransactionV1 struct + Amount string + Asset string + CreatedAt string + FromAccount string + ID string + ReceiverNewStateID *string + SenderNewStateID *string + ToAccount string + TxType core.TransactionType + type TransitionV1 struct + AccountID string + Amount string + TxID string + Type core.TransitionType + type UserV1GetActionAllowancesRequest struct + Wallet string + type UserV1GetActionAllowancesResponse struct + Allowances []ActionAllowanceV1 + type UserV1GetBalancesRequest struct + Wallet string + type UserV1GetBalancesResponse struct + Balances []BalanceEntryV1 + type UserV1GetTransactionsRequest struct + Asset *string + FromTime *uint64 + Pagination *PaginationParamsV1 + ToTime *uint64 + TxType *core.TransactionType + Wallet string + type UserV1GetTransactionsResponse struct + Metadata PaginationMetadataV1 + Transactions []TransactionV1 + type WebsocketConnection struct + func NewWebsocketConnection(config WebsocketConnectionConfig) (*WebsocketConnection, error) + func (conn *WebsocketConnection) ConnectionID() string + func (conn *WebsocketConnection) Origin() string + func (conn *WebsocketConnection) RawRequests() <-chan []byte + func (conn *WebsocketConnection) Serve(parentCtx context.Context, handleClosure func(error)) + func (conn *WebsocketConnection) WriteRawResponse(message []byte) bool + type WebsocketConnectionConfig struct + ConnectionID string + Logger log.Logger + OnMessageSentHandler func([]byte) + Origin string + PingInterval time.Duration + PongTimeout time.Duration + ProcessBufferSize int + WebsocketConn GorillaWsConnectionAdapter + WriteBufferSize int + WriteTimeout time.Duration + type WebsocketDialer struct + func NewWebsocketDialer(cfg WebsocketDialerConfig) *WebsocketDialer + func (d *WebsocketDialer) Call(ctx context.Context, req *Message) (*Message, error) + func (d *WebsocketDialer) Dial(parentCtx context.Context, url string, handleClosure func(err error)) error + func (d *WebsocketDialer) EventCh() <-chan *Message + func (d *WebsocketDialer) IsConnected() bool + type WebsocketDialerConfig struct + EventChanSize int + HandshakeTimeout time.Duration + PingTimeout time.Duration + type WebsocketHandlerGroup struct + func (hg *WebsocketHandlerGroup) Handle(method string, handler Handler) + func (hg *WebsocketHandlerGroup) NewGroup(name string) HandlerGroup + func (hg *WebsocketHandlerGroup) Use(middleware Handler) + type WebsocketNode struct + func NewWebsocketNode(config WebsocketNodeConfig) (*WebsocketNode, error) + func (wn *WebsocketNode) Handle(method string, handler Handler) + func (wn *WebsocketNode) NewGroup(name string) HandlerGroup + func (wn *WebsocketNode) Notify(userID, method string, params Payload) + func (wn *WebsocketNode) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (wn *WebsocketNode) Use(middleware Handler) + type WebsocketNodeConfig struct + Logger log.Logger + ObserveConnections ObserveConnectionsFn + WsConnProcessBufferSize int + WsConnWriteBufferSize int + WsConnWriteTimeout time.Duration + WsUpgraderCheckOrigin func(r *http.Request) bool + WsUpgraderReadBufferSize int + WsUpgraderWriteBufferSize int