0x-mesh: github.com/0xProject/0x-mesh/ethereum/signer Index | Files

package signer

import "github.com/0xProject/0x-mesh/ethereum/signer"

Index

Package Files

sign.go

type ECSignature Uses

type ECSignature struct {
    V   byte
    R   common.Hash
    S   common.Hash
}

ECSignature contains the parameters of an elliptic curve signature

type EthRPCSigner Uses

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

EthRPCSigner is a signer that uses a call to Ethereum JSON-RPC method `eth_call` to produce a signature

func (*EthRPCSigner) EthSign Uses

func (e *EthRPCSigner) EthSign(message []byte, signerAddress common.Address) (*ECSignature, error)

EthSign signs a message via the `eth_sign` Ethereum JSON-RPC call

type LocalSigner Uses

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

LocalSigner is a signer that produces an `eth_sign`-compatible signature locally using a private key

func (*LocalSigner) EthSign Uses

func (l *LocalSigner) EthSign(message []byte, signerAddress common.Address) (*ECSignature, error)

EthSign mimicks the signing of `eth_sign` locally its supplied private key

func (*LocalSigner) GetSignerAddress Uses

func (l *LocalSigner) GetSignerAddress() common.Address

GetSignerAddress returns the signerAddress corresponding to LocalSigner's private key

type Signer Uses

type Signer interface {
    EthSign(message []byte, signerAddress common.Address) (*ECSignature, error)
}

Signer defines the methods needed to act as a elliptic curve signer

func NewEthRPCSigner Uses

func NewEthRPCSigner(rpcClient *rpc.Client) Signer

NewEthRPCSigner instantiates a new EthRPCSigner

func NewLocalSigner Uses

func NewLocalSigner(privateKey *ecdsa.PrivateKey) Signer

NewLocalSigner instantiates a new LocalSigner

func NewTestSigner Uses

func NewTestSigner() Signer

NewTestSigner instantiates a new LocalSigner

type TestSigner Uses

type TestSigner struct{}

TestSigner generates `eth_sign` signatures for test accounts available on the test Ethereum node Ganache

func (*TestSigner) EthSign Uses

func (t *TestSigner) EthSign(message []byte, signerAddress common.Address) (*ECSignature, error)

EthSign generates an `eth_sign` equivalent signature using an public/private key pair hard-coded in the constants package.

func (*TestSigner) SignTx Uses

func (t *TestSigner) SignTx(message []byte, signerAddress common.Address) ([]byte, error)

SignTx signs an Ethereum transaction with a public/private key pair hard-coded in the constants package. It returns the transaction signature.

Package signer imports 8 packages (graph) and is imported by 2 packages. Updated 2019-11-06. Refresh now. Tools for package owners.