keystore

package
v1.10.17 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2021 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCSAKeyExists = errors.New("CSA key does not exist")
View Source
var ErrLocked = errors.New("Keystore is locked")

Functions

func NewORM added in v1.10.17

func NewORM(db *gorm.DB) ksORM

Types

type CSA

type CSA interface {
	Get(id string) (csakey.KeyV2, error)
	GetAll() ([]csakey.KeyV2, error)
	Create() (csakey.KeyV2, error)
	Add(key csakey.KeyV2) error
	Delete(id string) (csakey.KeyV2, error)
	Import(keyJSON []byte, password string) (csakey.KeyV2, error)
	Export(id string, password string) ([]byte, error)

	GetV1KeysAsV2() ([]csakey.KeyV2, error)
}

type CSAKeystoreInterface interface {

type Eth

type Eth interface {
	Get(id string) (ethkey.KeyV2, error)
	GetAll() ([]ethkey.KeyV2, error)
	Create(chainID *big.Int) (ethkey.KeyV2, error)
	Add(key ethkey.KeyV2, chainID *big.Int) error
	Delete(id string) (ethkey.KeyV2, error)
	Import(keyJSON []byte, password string, chainID *big.Int) (ethkey.KeyV2, error)
	Export(id string, password string) ([]byte, error)

	EnsureKeys(chainID *big.Int) (ethkey.KeyV2, bool, ethkey.KeyV2, bool, error)
	SubscribeToKeyChanges() (ch chan struct{}, unsub func())

	SignTx(fromAddress common.Address, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error)

	SendingKeys() (keys []ethkey.KeyV2, err error)
	FundingKeys() (keys []ethkey.KeyV2, err error)
	GetRoundRobinAddress(addresses ...common.Address) (address common.Address, err error)

	GetState(id string) (ethkey.State, error)
	SetState(ethkey.State) error
	GetStatesForKeys([]ethkey.KeyV2) ([]ethkey.State, error)
	GetStatesForChain(chainID *big.Int) ([]ethkey.State, error)

	GetV1KeysAsV2(chainID *big.Int) ([]ethkey.KeyV2, []ethkey.State, error)
}

Eth is the external interface for EthKeyStore

type Key added in v1.10.17

type Key interface {
	ID() string
}

type Master

type Master interface {
	CSA() CSA
	Eth() Eth
	OCR() OCR
	P2P() P2P
	VRF() VRF
	Unlock(password string) error
	Migrate(vrfPassword string, chainID *big.Int) error
	IsEmpty() (bool, error)
}

func New

func New(db *gorm.DB, scryptParams utils.ScryptParams, lggr logger.Logger) Master

type OCR

type OCR interface {
	Get(id string) (ocrkey.KeyV2, error)
	GetAll() ([]ocrkey.KeyV2, error)
	Create() (ocrkey.KeyV2, error)
	Add(key ocrkey.KeyV2) error
	Delete(id string) (ocrkey.KeyV2, error)
	Import(keyJSON []byte, password string) (ocrkey.KeyV2, error)
	Export(id string, password string) ([]byte, error)
	EnsureKey() (ocrkey.KeyV2, bool, error)

	GetV1KeysAsV2() ([]ocrkey.KeyV2, error)
}

type P2P added in v1.10.17

type P2P interface {
	Get(id string) (p2pkey.KeyV2, error)
	GetAll() ([]p2pkey.KeyV2, error)
	Create() (p2pkey.KeyV2, error)
	Add(key p2pkey.KeyV2) error
	Delete(id string) (p2pkey.KeyV2, error)
	Import(keyJSON []byte, password string) (p2pkey.KeyV2, error)
	Export(id string, password string) ([]byte, error)
	EnsureKey() (p2pkey.KeyV2, bool, error)

	GetV1KeysAsV2() ([]p2pkey.KeyV2, error)

	GetOrFirst(id string) (p2pkey.KeyV2, error)
}

type VRF

type VRF interface {
	Get(id string) (vrfkey.KeyV2, error)
	GetAll() ([]vrfkey.KeyV2, error)
	Create() (vrfkey.KeyV2, error)
	Add(key vrfkey.KeyV2) error
	Delete(id string) (vrfkey.KeyV2, error)
	Import(keyJSON []byte, password string) (vrfkey.KeyV2, error)
	Export(id string, password string) ([]byte, error)

	GenerateProof(id string, seed *big.Int) (vrfkey.Proof, error)

	GetV1KeysAsV2(password string) ([]vrfkey.KeyV2, error)
}

type VRFORM

type VRFORM interface {
	FirstOrCreateEncryptedSecretVRFKey(k *vrfkey.EncryptedVRFKey) error
	ArchiveEncryptedSecretVRFKey(k *vrfkey.EncryptedVRFKey) error
	DeleteEncryptedSecretVRFKey(k *vrfkey.EncryptedVRFKey) error
	FindEncryptedSecretVRFKeys(where ...vrfkey.EncryptedVRFKey) ([]*vrfkey.EncryptedVRFKey, error)
	FindEncryptedSecretVRFKeysIncludingArchived(where ...vrfkey.EncryptedVRFKey) ([]*vrfkey.EncryptedVRFKey, error)
}

func NewVRFORM

func NewVRFORM(db *gorm.DB) VRFORM

Directories

Path Synopsis
keys

Jump to

Keyboard shortcuts

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