example

package module
v0.0.0-...-c4e539a Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalTxHash

func CalTxHash(rawTx string) string

func DecodeTx

func DecodeTx(rawTx string) (string, error)

func EcRecover

func EcRecover(signature, message string, addPrefix bool) string

func GenerateMnemonic

func GenerateMnemonic() (string, error)

func GenerateRawTransactionWithSignature

func GenerateRawTransactionWithSignature(txType int, chainId, unsignedRawTx, r, s, v string) (string, error)

func GetDerivedPath

func GetDerivedPath(index int) string

func GetDerivedPrivateKey

func GetDerivedPrivateKey(mnemonic string, hdPath string) (string, error)

func GetEthereumMessagePrefix

func GetEthereumMessagePrefix(message string) string

func GetNewAddress

func GetNewAddress(prvHex string) string

func MessageHash

func MessageHash(data string) string

func SignEip1559Transaction

func SignEip1559Transaction(chainId *big.Int, tx *types.Transaction, prvKey *ecdsa.PrivateKey) ([]byte, string, error)

func SignTransaction

func SignTransaction(txJson, prvHex string) (string, error)

func ValidAddress

func ValidAddress(address string) bool

Types

type SignParams

type SignParams struct {
	Type                 int    `json:"type"`
	ChainId              string `json:"chainId"`
	Nonce                string `json:"nonce"`
	MaxPriorityFeePerGas string `json:"maxPriorityFeePerGas"`
	MaxFeePerGas         string `json:"maxFeePerGas"`
	GasLimit             string `json:"gasLimit"`
	To                   string `json:"to"`
	Value                string `json:"value"`
	Data                 string `json:"data"`
	// contains filtered or unexported fields
}

type SignedTx

type SignedTx struct {
	Hash string `json:"hash"`
	Hex  string `json:"hex"`
}

Jump to

Keyboard shortcuts

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