ethkey

package
v2.12.0-rc0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EncryptedEthKeyExport

type EncryptedEthKeyExport struct {
	KeyType string              `json:"keyType"`
	Address types.EIP55Address  `json:"address"`
	Crypto  keystore.CryptoJSON `json:"crypto"`
}

type Key

type Key struct {
	ID        int32
	Address   types.EIP55Address
	JSON      sqlutil.JSON `json:"-"`
	CreatedAt time.Time    `json:"-"`
	UpdatedAt time.Time    `json:"-"`
	DeletedAt *time.Time   `json:"-"`
	// IsFunding marks the address as being used for rescuing the  node and the pending transactions
	// Only one key can be IsFunding=true at a time.
	IsFunding bool
}

NOTE: This model refers to the OLD key and is only used for migrations

Key holds the private key metadata for a given address that is used to unlock said key when given a password.

By default, a key is assumed to represent an ethereum account.

func (Key) Type

func (k Key) Type() string

Type returns type of key

type KeyV2

type KeyV2 struct {
	Address      common.Address
	EIP55Address types.EIP55Address
	// contains filtered or unexported fields
}

func FromPrivateKey

func FromPrivateKey(privKey *ecdsa.PrivateKey) (key KeyV2)

func NewV2

func NewV2() (KeyV2, error)

func (KeyV2) Cmp

func (key KeyV2) Cmp(key2 KeyV2) int

Cmp uses byte-order address comparison to give a stable comparison between two keys

func (KeyV2) GoString

func (key KeyV2) GoString() string

func (KeyV2) ID

func (key KeyV2) ID() string

func (KeyV2) Raw

func (key KeyV2) Raw() Raw

func (KeyV2) String

func (key KeyV2) String() string

func (KeyV2) ToEcdsaPrivKey

func (key KeyV2) ToEcdsaPrivKey() *ecdsa.PrivateKey

func (KeyV2) ToEncryptedJSON

func (key KeyV2) ToEncryptedJSON(password string, scryptParams utils.ScryptParams) (export []byte, err error)

type Raw

type Raw []byte

func (Raw) GoString

func (raw Raw) GoString() string

func (Raw) Key

func (raw Raw) Key() KeyV2

func (Raw) String

func (raw Raw) String() string

type State

type State struct {
	ID         int32
	Address    types.EIP55Address
	EVMChainID big.Big
	Disabled   bool
	CreatedAt  time.Time
	UpdatedAt  time.Time
	// contains filtered or unexported fields
}

func (State) KeyID

func (s State) KeyID() string

func (State) LastUsed

func (s State) LastUsed() time.Time

lastUsed is an internal field and ought not be persisted to the database or exposed outside of the application

func (*State) WasUsed

func (s *State) WasUsed()

Jump to

Keyboard shortcuts

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