Documentation ¶
Index ¶
- Variables
- func FormatAccountAddressToResponse(address types.Address) []string
- func PersistDAppData(db *sql.DB, dApp signal.ConnectorDApp, sharedAccount types.Address, ...) error
- func SetupTestDB(t *testing.T) (db *sql.DB, close func())
- type AccountsCommand
- type ChainIDCommand
- type ClientSideHandler
- func (c *ClientSideHandler) RequestAccountsAccepted(args RequestAccountsAcceptedArgs) error
- func (c *ClientSideHandler) RequestAccountsRejected(args RejectedArgs) error
- func (c *ClientSideHandler) RequestSendTransaction(dApp signal.ConnectorDApp, chainID uint64, txArgs *transactions.SendTxArgs) (types.Hash, error)
- func (c *ClientSideHandler) RequestShareAccountForDApp(dApp signal.ConnectorDApp) (types.Address, uint64, error)
- func (c *ClientSideHandler) SendTransactionAccepted(args SendTransactionAcceptedArgs) error
- func (c *ClientSideHandler) SendTransactionRejected(args RejectedArgs) error
- type ClientSideHandlerInterface
- type EventType
- type Message
- type MessageType
- type NetworkManagerInterface
- type NetworkManagerMock
- type Permission
- type RPCClientInterface
- type RPCClientMock
- type RPCCommand
- type RPCRequest
- type RawAccountsResponse
- type RejectedArgs
- type RequestAccountsAcceptedArgs
- type RequestAccountsCommand
- type RequestPermissionsCommand
- type RevokePermissionsCommand
- type SendTransactionAcceptedArgs
- type SendTransactionCommand
- type SwitchEthereumChainCommand
Constants ¶
This section is empty.
Variables ¶
View Source
var ( WalletResponseMaxInterval = 20 * time.Minute ErrWalletResponseTimeout = fmt.Errorf("timeout waiting for wallet response") ErrRequestAccountsRejectedByUser = fmt.Errorf("request accounts was rejected by user") ErrSendTransactionRejectedByUser = fmt.Errorf("send transaction was rejected by user") ErrEmptyRequestID = fmt.Errorf("empty requestID") ErrAnotherConnectorOperationIsAwaitingFor = fmt.Errorf("another connector operation is awaiting for user input") )
View Source
var ( ErrAccountsRequestDeniedByUser = errors.New("accounts request denied by user") ErrNoAccountsAvailable = errors.New("no accounts available") )
errors
View Source
var ( ErrNoRequestPermissionsParamsFound = errors.New("no request permission params found") ErrMultipleKeysFound = errors.New("multiple methodNames found in request permissions params") ErrInvalidParamType = errors.New("invalid parameter type") )
View Source
var ( ErrRequestMissingDAppData = errors.New("request missing dApp data") ErrDAppIsNotPermittedByUser = errors.New("dApp is not permitted by user") ErrEmptyRPCParams = errors.New("empty rpc params") )
errors
View Source
var ( ErrNoTransactionParamsFound = errors.New("no transaction in params found") )
View Source
var ( ErrNoActiveNetworks = errors.New("no active networks") ErrUnsupportedNetwork = errors.New("unsupported network") ErrNoChainIDParamsFound = errors.New("no chain id in params found") )
errors
Functions ¶
func FormatAccountAddressToResponse ¶ added in v0.182.41
func PersistDAppData ¶
Types ¶
type AccountsCommand ¶
func (*AccountsCommand) Execute ¶
func (c *AccountsCommand) Execute(request RPCRequest) (interface{}, error)
type ChainIDCommand ¶
type ChainIDCommand struct { NetworkManager NetworkManagerInterface Db *sql.DB }
func (*ChainIDCommand) Execute ¶
func (c *ChainIDCommand) Execute(request RPCRequest) (interface{}, error)
type ClientSideHandler ¶
type ClientSideHandler struct {
// contains filtered or unexported fields
}
func NewClientSideHandler ¶
func NewClientSideHandler() *ClientSideHandler
func (*ClientSideHandler) RequestAccountsAccepted ¶
func (c *ClientSideHandler) RequestAccountsAccepted(args RequestAccountsAcceptedArgs) error
func (*ClientSideHandler) RequestAccountsRejected ¶
func (c *ClientSideHandler) RequestAccountsRejected(args RejectedArgs) error
func (*ClientSideHandler) RequestSendTransaction ¶
func (c *ClientSideHandler) RequestSendTransaction(dApp signal.ConnectorDApp, chainID uint64, txArgs *transactions.SendTxArgs) (types.Hash, error)
func (*ClientSideHandler) RequestShareAccountForDApp ¶
func (c *ClientSideHandler) RequestShareAccountForDApp(dApp signal.ConnectorDApp) (types.Address, uint64, error)
func (*ClientSideHandler) SendTransactionAccepted ¶
func (c *ClientSideHandler) SendTransactionAccepted(args SendTransactionAcceptedArgs) error
func (*ClientSideHandler) SendTransactionRejected ¶
func (c *ClientSideHandler) SendTransactionRejected(args RejectedArgs) error
type ClientSideHandlerInterface ¶
type ClientSideHandlerInterface interface { RequestSendTransaction(dApp signal.ConnectorDApp, chainID uint64, txArgs *transactions.SendTxArgs) (types.Hash, error) RequestAccountsAccepted(args RequestAccountsAcceptedArgs) error RequestAccountsRejected(args RejectedArgs) error SendTransactionAccepted(args SendTransactionAcceptedArgs) error SendTransactionRejected(args RejectedArgs) error }
type EventType ¶
type EventType struct { Type string `json:"type"` Event json.RawMessage `json:"event"` }
type Message ¶
type Message struct { Type MessageType Data interface{} }
type MessageType ¶
type MessageType int
const ( RequestAccountsAccepted MessageType = iota SendTransactionAccepted Rejected )
type NetworkManagerInterface ¶
type NetworkManagerMock ¶
type NetworkManagerMock struct {
// contains filtered or unexported fields
}
func (*NetworkManagerMock) GetActiveNetworks ¶
func (nm *NetworkManagerMock) GetActiveNetworks() ([]*params.Network, error)
func (*NetworkManagerMock) SetNetworks ¶
func (nm *NetworkManagerMock) SetNetworks(networks []*params.Network)
type Permission ¶ added in v0.182.39
type RPCClientInterface ¶
type RPCClientMock ¶
type RPCClientMock struct {
// contains filtered or unexported fields
}
func (*RPCClientMock) CallRaw ¶
func (c *RPCClientMock) CallRaw(request string) string
func (*RPCClientMock) SetResponse ¶
func (c *RPCClientMock) SetResponse(response string)
type RPCCommand ¶
type RPCCommand interface {
Execute(request RPCRequest) (interface{}, error)
}
type RPCRequest ¶
type RPCRequest struct { JSONRPC string `json:"jsonrpc"` ID int `json:"id"` Method string `json:"method"` Params []interface{} `json:"params"` URL string `json:"url"` Name string `json:"name"` IconURL string `json:"iconUrl"` }
func ConstructRPCRequest ¶
func ConstructRPCRequest(method string, params []interface{}, dApp *signal.ConnectorDApp) (RPCRequest, error)
func RPCRequestFromJSON ¶
func RPCRequestFromJSON(inputJSON string) (RPCRequest, error)
func (*RPCRequest) Validate ¶
func (r *RPCRequest) Validate() error
type RawAccountsResponse ¶
type RejectedArgs ¶
type RejectedArgs struct {
RequestID string `json:"requestId"`
}
type RequestAccountsCommand ¶
type RequestAccountsCommand struct { ClientHandler ClientSideHandlerInterface AccountsCommand }
func (*RequestAccountsCommand) Execute ¶
func (c *RequestAccountsCommand) Execute(request RPCRequest) (interface{}, error)
type RequestPermissionsCommand ¶ added in v0.182.39
type RequestPermissionsCommand struct{}
func (*RequestPermissionsCommand) Execute ¶ added in v0.182.39
func (c *RequestPermissionsCommand) Execute(request RPCRequest) (interface{}, error)
type RevokePermissionsCommand ¶ added in v0.182.41
func (*RevokePermissionsCommand) Execute ¶ added in v0.182.41
func (c *RevokePermissionsCommand) Execute(request RPCRequest) (interface{}, error)
type SendTransactionCommand ¶
type SendTransactionCommand struct { Db *sql.DB ClientHandler ClientSideHandlerInterface }
func (*SendTransactionCommand) Execute ¶
func (c *SendTransactionCommand) Execute(request RPCRequest) (interface{}, error)
type SwitchEthereumChainCommand ¶
type SwitchEthereumChainCommand struct { NetworkManager NetworkManagerInterface Db *sql.DB }
func (*SwitchEthereumChainCommand) Execute ¶
func (c *SwitchEthereumChainCommand) Execute(request RPCRequest) (interface{}, error)
Click to show internal directories.
Click to hide internal directories.