common

package
v0.24.3 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Localhost = "127.0.0.1"

	JSONKeyAddress         = "address"
	JSONKeyID              = "id"
	JSONKeyMethod          = "method"
	JSONKeyParams          = "params"
	JSONKeyRPCVersion      = "jsonrpc"
	JSONKeySignature       = "signature"
	JSONKeyType            = "type"
	JSONKeyEncryptionToken = "encryptionToken"
	JSONKeyFormats         = "formats"
)
View Source
const (
	PathStatic                          = "/static/"
	PathReady                           = "/ready/"
	PathJoin                            = "/join/"
	PathGetMessage                      = "/getmessage/"
	PathAuthenticate                    = "/authenticate/"
	PathQuery                           = "/query/"
	PathRevoke                          = "/revoke/"
	PathHealth                          = "/health/"
	PathNetworkHealth                   = "/network-health/"
	WSProtocol                          = "ws://"
	HTTPProtocol                        = "http://"
	EncryptedTokenQueryParameter        = "token"
	AddressQueryParameter               = "a"
	MessageUserIDLen                    = 40
	MessageUserIDLenWithPrefix          = 42
	EthereumAddressLen                  = 42
	GetStorageAtUserIDRequestMethodName = "0x0000000000000000000000000000000000000000"
	SuccessMsg                          = "success"
	APIVersion1                         = "/v1"
	PathVersion                         = "/version/"
	DeduplicationBufferSize             = 20
	DefaultGatewayAuthMessageType       = "EIP712"
)

Variables

This section is empty.

Functions

func BytesToPrivateKey

func BytesToPrivateKey(keyBytes []byte) (*ecies.PrivateKey, error)

BytesToPrivateKey converts []bytes to *ecies.PrivateKey

func CreateEncClient

func CreateEncClient(
	conn *gethrpc.Client,
	addressBytes []byte,
	privateKeyBytes []byte,
	signature []byte,
	signatureType viewingkey.SignatureType,
	logger gethlog.Logger,
) (*rpc.EncRPCClient, error)

func NewFileLogger added in v0.21.0

func NewFileLogger() gethlog.Logger

NewFileLogger is a logger factory function

func PrivateKeyToCompressedPubKey

func PrivateKeyToCompressedPubKey(prvKey *ecies.PrivateKey) []byte

PrivateKeyToCompressedPubKey converts *ecies.PrivateKey to compressed PubKey ([]byte with length 33)

Types

type AccountDB

type AccountDB struct {
	AccountAddress []byte
	Signature      []byte
	SignatureType  int
}

type Config added in v0.24.0

type Config struct {
	WalletExtensionHost     string
	WalletExtensionPortHTTP int
	WalletExtensionPortWS   int
	NodeRPCHTTPAddress      string
	NodeRPCWebsocketAddress string
	LogPath                 string
	DBPathOverride          string // Overrides the database file location. Used in tests.
	VerboseFlag             bool
	DBType                  string
	DBConnectionURL         string
	TenChainID              int
	StoreIncomingTxs        bool
}

Config contains the configuration required by the WalletExtension.

type RPCRequest

type RPCRequest struct {
	ID     json.RawMessage
	Method string
	Params []interface{}
}

func (*RPCRequest) Clone

func (r *RPCRequest) Clone() *RPCRequest

Clone returns a new instance of the *RPCRequest

type UserDB

type UserDB struct {
	UserID     []byte
	PrivateKey []byte
}

Jump to

Keyboard shortcuts

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