crypto

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BytesSigner

type BytesSigner interface {
	GetAddress(prefix string) string
	SignBytes(
		bytesToSign []byte,
	) ([]byte, error)
	GetPublicKey() cryptotypes.PubKey
}

type EthermintKeyPair

type EthermintKeyPair struct {
	Public  cryptotypes.PubKey
	Private cryptotypes.PrivKey
}

func NewEthermintKeyPairFromMnemonic

func NewEthermintKeyPairFromMnemonic(mnemonic string) *EthermintKeyPair

Return a key pair derived from the given mnemonic with

func (*EthermintKeyPair) GetAddress

func (e *EthermintKeyPair) GetAddress(prefix string) string

func (*EthermintKeyPair) GetPublicKey

func (e *EthermintKeyPair) GetPublicKey() cryptotypes.PubKey

func (*EthermintKeyPair) SignBytes

func (e *EthermintKeyPair) SignBytes(
	bytesToSign []byte,
) ([]byte, error)

type KeyPair

type KeyPair struct {
	Public  cryptotypes.PubKey
	Private cryptotypes.PrivKey
}

func NewCosmosKeyPairFromMnemonic

func NewCosmosKeyPairFromMnemonic(mnemonic string) *KeyPair

NewCosmosKeyPairFromMnemonic returns a key pair derived from the given mnemonic, with coin type 118 (cosmos)

func NewKeyPairFromMnemonic

func NewKeyPairFromMnemonic(mnemonic string, coinType uint32) *KeyPair

Return a key pair derived from the given mnemonic with the given coin type

func (*KeyPair) GetAddress

func (kp *KeyPair) GetAddress(prefix string) string

func (*KeyPair) GetPublicKey

func (kp *KeyPair) GetPublicKey() cryptotypes.PubKey

func (*KeyPair) SignBytes

func (kp *KeyPair) SignBytes(
	bytesToSign []byte,
) ([]byte, error)

Jump to

Keyboard shortcuts

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