Documentation ¶
Index ¶
- Constants
- func ComputeEthereumSignedMessageHash(message []byte) []byte
- func RecoverEthMessageSigner(signature Signature, message []byte) (*ecdsa.PublicKey, error)
- func RecoverEthMessageSignerAddress(signature Signature, message []byte) (common.Address, error)
- func SignerFnFactory(signer Signer, chainID *big.Int) func(common.Address, *types.Transaction) (*types.Transaction, error)
- type LocalSigner
- type Signature
- func (s1 Signature) Equal(s2 Signature) bool
- func (s Signature) MarshalJSON() ([]byte, error)
- func (sig Signature) Raw() (concatenatedSignature []byte)
- func (sig Signature) RecoverPublicKey(msg []byte) (*ecdsa.PublicKey, error)
- func (sig Signature) String() string
- func (s *Signature) UnmarshalJSON(b []byte) error
- type Signer
Constants ¶
View Source
const (
ERC1271MagicValue = "0x1626ba7e"
)
Variables ¶
This section is empty.
Functions ¶
func ComputeEthereumSignedMessageHash ¶
computeEthereumSignedMessageHash accepts an arbitrary message, prepends a known message, and hashes the result using keccak256. The known message added to the input before hashing is "\x19Ethereum Signed Message:\n" + len(message).
func RecoverEthMessageSigner ¶
func SignerFnFactory ¶
func SignerFnFactory(signer Signer, chainID *big.Int) func(common.Address, *types.Transaction) (*types.Transaction, error)
Types ¶
type LocalSigner ¶
type LocalSigner struct {
// contains filtered or unexported fields
}
func NewLocalSigner ¶
func NewLocalSigner(privateKey *ecdsa.PrivateKey) LocalSigner
func (LocalSigner) CommonAddress ¶
func (s LocalSigner) CommonAddress() common.Address
func (LocalSigner) PublicKey ¶
func (s LocalSigner) PublicKey() *ecdsa.PublicKey
type Signature ¶
func NewSignature ¶
func NewSignatureFromBytes ¶
func (Signature) MarshalJSON ¶ added in v0.0.42
func (Signature) RecoverPublicKey ¶
func (*Signature) UnmarshalJSON ¶ added in v0.0.42
Click to show internal directories.
Click to hide internal directories.