eth

package
v0.0.1-build.39 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseDefaultResponse

func ParseDefaultResponse(meta map[string]interface{}) (goauth.IResponse, error)

func ParseDefaultSession

func ParseDefaultSession(meta map[string]interface{}) (goauth.ISession, error)

Types

type ClassicDocument

type ClassicDocument struct {
	Parameters []*ClassicParameter
}

func NewClassicDocument

func NewClassicDocument() *ClassicDocument

func (*ClassicDocument) Append

func (doc *ClassicDocument) Append(params ...*ClassicParameter)

func (*ClassicDocument) GetHash

func (doc *ClassicDocument) GetHash() []byte

type ClassicParameter

type ClassicParameter struct {
	Type  string
	Value interface{}
}

type EthSession

type EthSession struct {
	SessionID     goauth.SessionID `json:"SessionID"`
	Address       string           `json:"Address"`
	VerifyMessage string           `json:"VerifyMessage"`
}

func NewSession

func NewSession(sessionID goauth.SessionID, address string) *EthSession

func (*EthSession) GetClientAccountID

func (session *EthSession) GetClientAccountID() goauth.AccountID

func (*EthSession) GetClientType

func (session *EthSession) GetClientType() goauth.ClientType

func (*EthSession) GetSessionID

func (session *EthSession) GetSessionID() goauth.SessionID

type OwnerClient

type OwnerClient struct {
	// contains filtered or unexported fields
}

func NewOwnerClient

func NewOwnerClient(privateKeyShadow string) (*OwnerClient, error)

func (*OwnerClient) Authenticate

func (client *OwnerClient) Authenticate(clientID goauth.AccountID, response goauth.IResponse) (bool, error)

func (*OwnerClient) BeginSession

func (client *OwnerClient) BeginSession(clientID goauth.AccountID, adapter goauth.IAdapter) (goauth.ISession, error)

func (*OwnerClient) GetClientType

func (client *OwnerClient) GetClientType() goauth.ClientType

MARK: implement IAuthClient

func (*OwnerClient) GetEtherJSSignature

func (client *OwnerClient) GetEtherJSSignature(message []byte) ([]byte, error)

func (*OwnerClient) GetSignature

func (client *OwnerClient) GetSignature(message []byte) ([]byte, error)

func (*OwnerClient) RenewSession

func (client *OwnerClient) RenewSession(refreshToken string) (goauth.ISession, error)

renew the session

func (*OwnerClient) Verify

func (client *OwnerClient) Verify(session goauth.ISession, response goauth.IResponse, adapter goauth.IAdapter) (bool, error)

func (*OwnerClient) VerifyMessageSignature

func (client *OwnerClient) VerifyMessageSignature(message []byte, signature []byte) (bool, error)

func (*OwnerClient) VerifySignature

func (client *OwnerClient) VerifySignature(address string, title string, verifyMessage string, verifySignature []byte) (bool, error)

type Response

type Response struct {
	MessageTitle  string `json:"MessageTitle"` //the title use in typed sign
	VerifyMessage string `json:"VerifyMessage"`
	Signature     string `json:"Signature"`
}

type StackVerifyClient

type StackVerifyClient struct {
	Addresses map[string]string //map[user_name]address
	// contains filtered or unexported fields
}

func (*StackVerifyClient) AddAddress

func (client *StackVerifyClient) AddAddress(username string, address string)

func (*StackVerifyClient) GetClientType

func (client *StackVerifyClient) GetClientType() goauth.ClientType

func (*StackVerifyClient) VerifySignature

func (client *StackVerifyClient) VerifySignature(doc goauth.Document, signature []byte) (bool, error)

type TypedDocument

type TypedDocument struct {
	Parameters []*TypedParameter
}

func NewTypedDocument

func NewTypedDocument() *TypedDocument

func (*TypedDocument) Append

func (doc *TypedDocument) Append(params ...*TypedParameter)

func (*TypedDocument) GetHash

func (doc *TypedDocument) GetHash() []byte

type TypedParameter

type TypedParameter struct {
	Type  string
	Name  string
	Value string
}

type VerifyClient

type VerifyClient struct {
	// contains filtered or unexported fields
}

func NewVerifyClient

func NewVerifyClient(walletAddress string) (*VerifyClient, error)

func (*VerifyClient) BeginSession

func (client *VerifyClient) BeginSession(clientID goauth.AccountID, adapter goauth.IAdapter) (goauth.ISession, error)

func (*VerifyClient) GetClientType

func (client *VerifyClient) GetClientType() goauth.ClientType

func (*VerifyClient) RenewSession

func (client *VerifyClient) RenewSession(refreshToken string) (goauth.ISession, error)

func (*VerifyClient) Verify

func (client *VerifyClient) Verify(session goauth.ISession, adapter goauth.IAdapter) (bool, error)

func (*VerifyClient) VerifySignature

func (client *VerifyClient) VerifySignature(doc goauth.Document, signature []byte) (bool, error)

Jump to

Keyboard shortcuts

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