corekeys

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptySha256Hash = new(Sha256Hash)
View Source
var ErrInvalidChainType error

ErrInvalidChainType is an error to indicate an unsupported chain type

View Source
var SupportedChainTypes = ChainTypes{EVM, Cosmos, Solana, StarkNet, Aptos, Tron, TON, Sui}

SupportedChainTypes contain all chains that are supported

Functions

func IsSupportedChainType added in v1.0.2

func IsSupportedChainType(chainType ChainType) bool

IsSupportedChainType checks to see if the chain is supported

func NewErrInvalidChainType added in v1.0.2

func NewErrInvalidChainType(chainType ChainType) error

NewErrInvalidChainType returns an error wrapping ErrInvalidChainType for an unsupported chain

func RequireEqualKeys added in v1.0.2

func RequireEqualKeys(t *testing.T, a, b interface {
	ID() string
	Raw() internal.Raw
})

func RunKeyExportImportTestcase added in v1.0.2

func RunKeyExportImportTestcase(t *testing.T, createKey CreateKeyFunc, decrypt DecryptFunc)

RunKeyExportImportTestcase executes a testcase to validate keys import/export functionality

Types

type ChainType added in v1.0.2

type ChainType string

ChainType denotes the chain or network to work with

const (
	// EVM for Ethereum or other chains supporting the EVM
	EVM ChainType = "evm"
	// Cosmos for the Cosmos chain
	Cosmos ChainType = "cosmos"
	// Solana for the Solana chain
	Solana ChainType = "solana"
	// StarkNet for the StarkNet chain
	StarkNet ChainType = "starknet"
	// Aptos for the Aptos chain
	Aptos ChainType = "aptos"
	// Tron for the Tron chain
	Tron ChainType = "tron"
	// TON for the TON chain
	TON ChainType = "ton"
	// Sui for the Sui chain
	Sui ChainType = "sui"
	// Offchain is used by the MultichainKeyringAdapter when we are signing for offchain (eg. for DKG).
	Offchain ChainType = "offchain"
)

func NewChainType added in v1.0.2

func NewChainType(typ uint8) (ChainType, error)

func (ChainType) Type added in v1.0.2

func (c ChainType) Type() (uint8, error)

type ChainTypes added in v1.0.2

type ChainTypes []ChainType

func (ChainTypes) String added in v1.0.2

func (c ChainTypes) String() (out string)

type CreateKeyFunc added in v1.0.2

type CreateKeyFunc func() (KeyType, error)

CreateKeyFunc represents a function to create a key

type DecryptFunc added in v1.0.2

type DecryptFunc func(keyJSON []byte, password string) (KeyType, error)

DecryptFunc represents a function to decrypt a key

type KeyType added in v1.0.2

type KeyType interface {
	ToEncryptedJSON(password string, scryptParams commonkeystore.ScryptParams) (export []byte, err error)
	Raw() internal.Raw
	ID() string
}

KeyType represents a key type for keys testing

type Sha256Hash added in v1.0.2

type Sha256Hash [32]byte

Explicit type indicating a 32-byte sha256 hash

func MustSha256HashFromHex added in v1.0.2

func MustSha256HashFromHex(x string) Sha256Hash

func Sha256HashFromHex added in v1.0.2

func Sha256HashFromHex(x string) (Sha256Hash, error)

func (Sha256Hash) MarshalJSON added in v1.0.2

func (s Sha256Hash) MarshalJSON() ([]byte, error)

MarshalJSON converts a Sha256Hash to a JSON byte slice.

func (*Sha256Hash) MarshalText added in v1.0.2

func (s *Sha256Hash) MarshalText() ([]byte, error)

func (*Sha256Hash) Scan added in v1.0.2

func (s *Sha256Hash) Scan(value any) error

func (Sha256Hash) String added in v1.0.2

func (s Sha256Hash) String() string

func (*Sha256Hash) UnmarshalJSON added in v1.0.2

func (s *Sha256Hash) UnmarshalJSON(input []byte) error

UnmarshalJSON converts a bytes slice of JSON to a TaskType.

func (*Sha256Hash) UnmarshalText added in v1.0.2

func (s *Sha256Hash) UnmarshalText(bs []byte) (err error)

func (Sha256Hash) Value added in v1.0.2

func (s Sha256Hash) Value() (driver.Value, error)

Directories

Path Synopsis
secp256k1
Package secp256k1 is an implementation of the kyber.{Group,Point,Scalar} //////////////////////////////////////////////////////////////////////////////
Package secp256k1 is an implementation of the kyber.{Group,Point,Scalar} //////////////////////////////////////////////////////////////////////////////

Jump to

Keyboard shortcuts

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