common

package
v0.26.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: AGPL-3.0 Imports: 10 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/"
	PathNetworkConfig             = "/network-config/"
	WSProtocol                    = "ws://"
	HTTPProtocol                  = "http://"
	EncryptedTokenQueryParameter  = "token"
	AddressQueryParameter         = "a"
	MessageUserIDLen              = 40
	MessageUserIDLenWithPrefix    = 42
	EthereumAddressLen            = 42
	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 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
	RateLimitUserComputeTime       time.Duration
	RateLimitWindow                time.Duration
	RateLimitMaxConcurrentRequests int
}

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