Documentation ¶
Index ¶
- func BigIntToU256(bigInt *big.Int) types.U256
- func BytesToHex(bytes []byte) string
- func DecodeBlock(data []byte) (*types.Block, error)
- func DecodeExtrinsic(data []byte) (*types.Extrinsic, error)
- func EncodeBlock(block *types.Block) ([]byte, error)
- func EncodeExtrinsic(ext *types.Extrinsic) ([]byte, error)
- func GenerateKey() (*ecdsa.PrivateKey, *ecdsa.PublicKey, error)
- func GetAccountAddressFromPrivateKey(privateKey *ecdsa.PrivateKey) common.Address
- func GetAccountAddressFromPublicKey(publicKey *ecdsa.PublicKey) common.Address
- func HexToBytes(hexString string) ([]byte, error)
- func SignMessage(privateKey *ecdsa.PrivateKey, message []byte) ([]byte, error)
- func U256ToBigInt(u256 types.U256) *big.Int
- func VerifySignature(publicKey *ecdsa.PublicKey, message []byte, signature []byte) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BigIntToU256 ¶
BigIntToU256 converts a big.Int to a U256
func BytesToHex ¶
BytesToHex converts a byte slice to a hex string
func DecodeBlock ¶
DecodeBlock decodes a block from JSON
func DecodeExtrinsic ¶
DecodeExtrinsic decodes an extrinsic from JSON
func EncodeBlock ¶
EncodeBlock encodes a block to JSON
func EncodeExtrinsic ¶
EncodeExtrinsic encodes an extrinsic to JSON
func GenerateKey ¶
func GenerateKey() (*ecdsa.PrivateKey, *ecdsa.PublicKey, error)
GenerateKey generates a new ECDSA key pair
func GetAccountAddressFromPrivateKey ¶
func GetAccountAddressFromPrivateKey(privateKey *ecdsa.PrivateKey) common.Address
GetAccountAddressFromPrivateKey gets the account address from a private key
func GetAccountAddressFromPublicKey ¶
GetAccountAddressFromPublicKey gets the account address from a public key
func HexToBytes ¶
HexToBytes converts a hex string to a byte slice
func SignMessage ¶
func SignMessage(privateKey *ecdsa.PrivateKey, message []byte) ([]byte, error)
SignMessage signs a message with a private key
func U256ToBigInt ¶
U256ToBigInt converts a U256 to a big.Int
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.