Versions in this module Expand all Collapse all v0 v0.7.10 May 9, 2022 v0.7.9 Mar 25, 2022 Changes in this version + const EcdsaMsgLen + const EcdsaRLen + const EcdsaSLen + const EcdsaSignatureLen + const PrivKeyBytesLen + var ErrCurveTypeNotSupported = errors.New("not a supported CurveType") + var ErrKeyGenEdwards25519Failed = errors.New("keygen: error generating key pair for edwards25519 curve type") + var ErrKeyGenPallasFailed = errors.New("keygen: error generating key pair for pallas curve type") + var ErrKeyGenSecp256k1Failed = errors.New("keygen: error generating key pair for secp256k1 curve type") + var ErrKeyGenSecp256r1Failed = errors.New("keygen: error generating key pair for secp256r1 curve type") + var ErrPallasTransactionValidationErr = errors.New("transaction with pallas validation failed") + var ErrPrivKeyLengthInvalid = errors.New("invalid privkey length") + var ErrPrivKeyUndecodable = errors.New("could not decode privkey") + var ErrPrivKeyZero = errors.New("privkey cannot be 0") + var ErrPubKeyNotOnCurve = errors.New("pubkey is not on the curve") + var ErrSignFailed = errors.New("sign: unable to sign") + var ErrSignUnsupportedPayloadSignatureType = errors.New("sign: unexpected payload.SignatureType while signing") + var ErrSignUnsupportedSignatureType = errors.New("sign: unexpected Signature type while signing") + var ErrVerifyFailed = errors.New("verify: verify returned false") + var ErrVerifyUnsupportedPayloadSignatureType = errors.New("verify: unexpected payload.SignatureType while verifying") + var ErrVerifyUnsupportedSignatureType = errors.New("verify: unexpected Signature type while verifying") + func Err(err error) bool + func ParseSigningPayload(rawPayload *types.SigningPayload) (*mina.Transaction, error) + type KeyPair struct + PrivateKey []byte + PublicKey *types.PublicKey + func GenerateKeypair(curve types.CurveType) (*KeyPair, error) + func ImportPrivateKey(privKeyHex string, curve types.CurveType) (*KeyPair, error) + func (k *KeyPair) IsValid() error + func (k *KeyPair) MarshalJSON() ([]byte, error) + func (k *KeyPair) Signer() (Signer, error) + func (k *KeyPair) UnmarshalJSON(b []byte) error + type PayloadFields struct + Amount *string + Fee string + From string + Memo *string + Nonce string + To string + ValidUntil *string + type Signer interface + PublicKey func() *types.PublicKey + Sign func(payload *types.SigningPayload, sigType types.SignatureType) (*types.Signature, error) + Verify func(signature *types.Signature) error + type SignerEdwards25519 struct + KeyPair *KeyPair + func (s *SignerEdwards25519) PublicKey() *types.PublicKey + func (s *SignerEdwards25519) Sign(payload *types.SigningPayload, sigType types.SignatureType) (*types.Signature, error) + func (s *SignerEdwards25519) Verify(signature *types.Signature) error + type SignerPallas struct + KeyPair *KeyPair + func (s *SignerPallas) PublicKey() *types.PublicKey + func (s *SignerPallas) Sign(payload *types.SigningPayload, sigType types.SignatureType) (*types.Signature, error) + func (s *SignerPallas) Verify(signature *types.Signature) error + type SignerSecp256k1 struct + KeyPair *KeyPair + func (s *SignerSecp256k1) PublicKey() *types.PublicKey + func (s *SignerSecp256k1) Sign(payload *types.SigningPayload, sigType types.SignatureType) (*types.Signature, error) + func (s *SignerSecp256k1) Verify(signature *types.Signature) error + type SignerSecp256r1 struct + KeyPair *KeyPair + func (s *SignerSecp256r1) PublicKey() *types.PublicKey + func (s *SignerSecp256r1) Sign(payload *types.SigningPayload, sigType types.SignatureType) (*types.Signature, error) + func (s *SignerSecp256r1) Verify(signature *types.Signature) error + type SigningPayload struct + Payment *PayloadFields