signer

package
v0.0.0-...-58829ec Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SigntureFlagEd25519     = 0x0
	SigntureFlagSecp256k1   = 0x1
	AddressLength           = 64
	DerivationPathEd25519   = `m/44'/784'/0'/0'/0'`
	DerivationPathSecp256k1 = `m/54'/784'/0'/0/0`
)
View Source
const (
	FirstHardenedIndex = uint32(0x80000000)
)

Variables

View Source
var (
	ErrInvalidPath        = errors.New("invalid derivation path")
	ErrNoPublicDerivation = errors.New("no public derivation for ed25519")
)

Functions

func IntentWithScope

func IntentWithScope(intentScope IntentScope) []int

Types

type AppId

type AppId int
const (
	Sui AppId = 0
)

type AwsSigner

type AwsSigner struct {
	KmsService      *kms.KMS
	PublicKey       []byte
	PublicKeyStr    string
	PublicKeyBase64 string
	Address         string
	KmsId           string
}

func GetAwsSigner

func GetAwsSigner(KeyId string, Region string) (*AwsSigner, error)

type ECDSAPubKeyAlgorithm

type ECDSAPubKeyAlgorithm struct {
	Algorithm  asn1.ObjectIdentifier
	Parameters asn1.ObjectIdentifier
}

type EcdsaPubKey

type EcdsaPubKey struct {
	Algo   ECDSAPubKeyAlgorithm
	PubKey asn1.BitString
}

type IntentScope

type IntentScope int
const (
	TransactionData    IntentScope = 0
	TransactionEffects IntentScope = 1
	CheckpointSummary  IntentScope = 2
	PersonalMessage    IntentScope = 3
)

type IntentVersion

type IntentVersion int
const (
	V0 IntentVersion = 0
)

type Key

type Key struct {
	Key       []byte
	ChainCode []byte
}

func DeriveForPath

func DeriveForPath(path string, seed []byte) (*Key, error)

DeriveForPath derives key for a path in BIP-44 format and a seed. Ed25119 derivation operated on hardened keys only.

func NewMasterKey

func NewMasterKey(seed []byte) (*Key, error)

NewMasterKey generates a new master key from seed.

func (*Key) Derive

func (k *Key) Derive(i uint32) (*Key, error)

func (*Key) PublicKey

func (k *Key) PublicKey() ([]byte, error)

PublicKey returns public key for a derived private key.

func (*Key) RawSeed

func (k *Key) RawSeed() [32]byte

RawSeed returns raw seed bytes

type PublicKey

type PublicKey []byte

type Signer

type Signer struct {
	PriKey  ed25519.PrivateKey
	PubKey  ed25519.PublicKey
	Address string
}

func NewSigner

func NewSigner(seed []byte) *Signer

func NewSignertWithMnemonic

func NewSignertWithMnemonic(mnemonic string) (*Signer, error)

Jump to

Keyboard shortcuts

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