gomav

package module
v2.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

README

gomav

Gomav is a support module focused on Mavryk binary protocol.

Contents

Package Description
github.com/mavryk-network/gomav/v2 Mavryk primitives
github.com/mavryk-network/gomav/v2/b58 Base58 encoding for Mavryk primitives
github.com/mavryk-network/gomav/v2/client Very limited Mavryk RPC client library
github.com/mavryk-network/gomav/v2/crypt A wrapper around standard and 3rd party signature algorithms which adds a support of Mavryk encodings of keys and signatures
github.com/mavryk-network/gomav/v2/encoding Mavryk binary encoding library
github.com/mavryk-network/gomav/v2/protocol Mavryk binary protocol library
github.com/mavryk-network/gomav/v2/mavtool Operation injection helper

Documentation

Index

Constants

View Source
const (
	Ed25519PublicKeyBytesLen             = 32
	Secp256k1PublicKeyBytesLen           = 33
	P256PublicKeyBytesLen                = 33
	BLSPublicKeyBytesLen                 = 48
	Ed25519SeedBytesLen                  = 32
	Secp256k1PrivateKeyBytesLen          = 32
	P256PrivateKeyBytesLen               = 32
	BLSPrivateKeyBytesLen                = 32
	Ed25519EncryptedSeedBytesLen         = 56
	Secp256k1EncryptedPrivateKeyBytesLen = 56
	P256EncryptedPrivateKeyBytesLen      = 56
	BLSEncryptedPrivateKeyBytesLen       = 56
)
View Source
const (
	ProofOfWorkNonceBytesLen = 8
	ChainIdBytesLen          = 4
	SecretBytesLen           = 20
	AddressBytesLen          = 20
	ContractHashBytesLen     = 20
	SeedNonceBytesLen        = 32
	CycleNonceBytesLen       = 32
	HashBytesLen             = 32
	SlotHeaderBytesLen       = 48
	GenericSignatureBytesLen = 64
	BLSSignatureBytesLen     = 96
)
View Source
const PKHBytesLen = AddressBytesLen

Variables

View Source
var (
	ErrInvalidDecryptedLen = errors.New("gomav: invalid decrypted key length")
	ErrInvalidKeyLen       = errors.New("gomav: invalid key length")
)
View Source
var (
	ErrPrivateKeyDecrypt = errors.New("gomav: unable to decrypt the private key")
)

Functions

This section is empty.

Types

type AnySignature

type AnySignature []byte

func (AnySignature) MarshalJSON

func (sig AnySignature) MarshalJSON() ([]byte, error)

func (AnySignature) MarshalText

func (sig AnySignature) MarshalText() ([]byte, error)

func (AnySignature) Signature

func (sig AnySignature) Signature() (Signature, error)

func (AnySignature) String

func (sig AnySignature) String() string

type BLSEncryptedPrivateKey

type BLSEncryptedPrivateKey [BLSEncryptedPrivateKeyBytesLen]byte

func (*BLSEncryptedPrivateKey) Decrypt

func (pk *BLSEncryptedPrivateKey) Decrypt(passCb func() ([]byte, error)) (PrivateKey, error)

func (BLSEncryptedPrivateKey) MarshalText

func (self BLSEncryptedPrivateKey) MarshalText() ([]byte, error)

func (BLSEncryptedPrivateKey) String

func (self BLSEncryptedPrivateKey) String() string

func (*BLSEncryptedPrivateKey) ToBase58

func (self *BLSEncryptedPrivateKey) ToBase58() []byte

func (*BLSEncryptedPrivateKey) UnmarshalText

func (self *BLSEncryptedPrivateKey) UnmarshalText(src []byte) error

type BLSPrivateKey

type BLSPrivateKey [BLSPrivateKeyBytesLen]byte

func NewBLSPrivateKey

func NewBLSPrivateKey(scalar []byte) (*BLSPrivateKey, error)

func (*BLSPrivateKey) Decrypt

func (pk *BLSPrivateKey) Decrypt(func() ([]byte, error)) (PrivateKey, error)

stub

func (BLSPrivateKey) MarshalText

func (self BLSPrivateKey) MarshalText() ([]byte, error)

func (*BLSPrivateKey) PrivateKey

func (priv *BLSPrivateKey) PrivateKey()

func (BLSPrivateKey) String

func (self BLSPrivateKey) String() string

func (*BLSPrivateKey) ToBase58

func (self *BLSPrivateKey) ToBase58() []byte

func (*BLSPrivateKey) UnmarshalText

func (self *BLSPrivateKey) UnmarshalText(src []byte) error

type BLSPublicKey

type BLSPublicKey [BLSPublicKeyBytesLen]byte

func NewBLSPublicKey

func NewBLSPublicKey(compressedPoint []byte) (*BLSPublicKey, error)

func (*BLSPublicKey) Hash

func (pk *BLSPublicKey) Hash() PublicKeyHash

func (BLSPublicKey) MarshalText

func (self BLSPublicKey) MarshalText() ([]byte, error)

func (*BLSPublicKey) PublicKey

func (pk *BLSPublicKey) PublicKey()

func (BLSPublicKey) String

func (self BLSPublicKey) String() string

func (*BLSPublicKey) ToBase58

func (self *BLSPublicKey) ToBase58() []byte

func (*BLSPublicKey) UnmarshalText

func (self *BLSPublicKey) UnmarshalText(src []byte) error

type BLSPublicKeyHash

type BLSPublicKeyHash [AddressBytesLen]byte

func (*BLSPublicKeyHash) Eq

func (pkh *BLSPublicKeyHash) Eq(other PublicKeyHash) bool

func (BLSPublicKeyHash) MarshalText

func (self BLSPublicKeyHash) MarshalText() ([]byte, error)

func (*BLSPublicKeyHash) PublicKeyHash

func (pkh *BLSPublicKeyHash) PublicKeyHash() []byte

func (BLSPublicKeyHash) String

func (self BLSPublicKeyHash) String() string

func (*BLSPublicKeyHash) ToBase58

func (self *BLSPublicKeyHash) ToBase58() []byte

func (*BLSPublicKeyHash) ToComparable

func (pkh *BLSPublicKeyHash) ToComparable() (out EncodedPublicKeyHash)

func (*BLSPublicKeyHash) UnmarshalText

func (self *BLSPublicKeyHash) UnmarshalText(src []byte) error

type BLSSignature

type BLSSignature [BLSSignatureBytesLen]byte

func NewBLSSignature

func NewBLSSignature(compressedPoint []byte) *BLSSignature

func (BLSSignature) MarshalText

func (self BLSSignature) MarshalText() ([]byte, error)

func (*BLSSignature) Signature

func (sig *BLSSignature) Signature()

func (*BLSSignature) Split

func (sig *BLSSignature) Split() (prefix *[32]byte, suffix *GenericSignature)

func (BLSSignature) String

func (self BLSSignature) String() string

func (*BLSSignature) ToBase58

func (self *BLSSignature) ToBase58() []byte

func (*BLSSignature) UnmarshalText

func (self *BLSSignature) UnmarshalText(src []byte) error

type Base58Encoder

type Base58Encoder interface {
	ToBase58() []byte
	String() string
}

type BigInt

type BigInt []byte

func BigZero

func BigZero() BigInt

func NewBigInt

func NewBigInt(value *big.Int) BigInt

func NewBigInt64

func NewBigInt64(val int64) BigInt

func ParseBigInt

func ParseBigInt(str string, base int) (BigInt, error)

func (*BigInt) DecodeMV

func (b *BigInt) DecodeMV(data []byte, ctx *encoding.Context) (rest []byte, err error)

func (BigInt) Int

func (b BigInt) Int() *big.Int

func (BigInt) MarshalText

func (b BigInt) MarshalText() (text []byte, err error)

func (BigInt) Sign

func (b BigInt) Sign() int

func (BigInt) String

func (b BigInt) String() string

type BigUint

type BigUint []byte

func BigUZero

func BigUZero() BigUint

func NewBigUint

func NewBigUint(value *big.Int) (BigUint, error)

func NewBigUint64

func NewBigUint64(val uint64) BigUint

func ParseBigUint

func ParseBigUint(str string, base int) (BigUint, error)

func (*BigUint) DecodeMV

func (b *BigUint) DecodeMV(data []byte, ctx *encoding.Context) (rest []byte, err error)

func (BigUint) Int

func (b BigUint) Int() *big.Int

func (BigUint) IsZero

func (b BigUint) IsZero() bool

func (BigUint) MarshalText

func (b BigUint) MarshalText() (text []byte, err error)

func (BigUint) String

func (b BigUint) String() string

type BlindedPublicKeyHash

type BlindedPublicKeyHash [AddressBytesLen]byte

func (BlindedPublicKeyHash) MarshalText

func (self BlindedPublicKeyHash) MarshalText() ([]byte, error)

func (BlindedPublicKeyHash) String

func (self BlindedPublicKeyHash) String() string

func (*BlindedPublicKeyHash) ToBase58

func (self *BlindedPublicKeyHash) ToBase58() []byte

func (*BlindedPublicKeyHash) UnmarshalText

func (self *BlindedPublicKeyHash) UnmarshalText(src []byte) error

type BlockHash

type BlockHash [HashBytesLen]byte

func (BlockHash) MarshalText

func (self BlockHash) MarshalText() ([]byte, error)

func (BlockHash) String

func (self BlockHash) String() string

func (*BlockHash) ToBase58

func (self *BlockHash) ToBase58() []byte

func (*BlockHash) UnmarshalText

func (self *BlockHash) UnmarshalText(src []byte) error

type BlockPayloadHash

type BlockPayloadHash [HashBytesLen]byte

func (BlockPayloadHash) MarshalText

func (self BlockPayloadHash) MarshalText() ([]byte, error)

func (BlockPayloadHash) String

func (self BlockPayloadHash) String() string

func (*BlockPayloadHash) ToBase58

func (self *BlockPayloadHash) ToBase58() []byte

func (*BlockPayloadHash) UnmarshalText

func (self *BlockPayloadHash) UnmarshalText(src []byte) error

type Bytes

type Bytes []byte

func (Bytes) MarshalText

func (b Bytes) MarshalText() (text []byte, err error)

func (*Bytes) UnmarshalText

func (b *Bytes) UnmarshalText(text []byte) error

type Bytes20

type Bytes20 [20]byte

func (Bytes20) MarshalText

func (self Bytes20) MarshalText() ([]byte, error)

func (Bytes20) String

func (self Bytes20) String() string

func (*Bytes20) UnmarshalText

func (self *Bytes20) UnmarshalText(src []byte) error

type Bytes32

type Bytes32 [32]byte

func (Bytes32) MarshalText

func (self Bytes32) MarshalText() ([]byte, error)

func (Bytes32) String

func (self Bytes32) String() string

func (*Bytes32) UnmarshalText

func (self *Bytes32) UnmarshalText(src []byte) error

type Bytes48

type Bytes48 [48]byte

func (Bytes48) MarshalText

func (self Bytes48) MarshalText() ([]byte, error)

func (Bytes48) String

func (self Bytes48) String() string

func (*Bytes48) UnmarshalText

func (self *Bytes48) UnmarshalText(src []byte) error

type Bytes8

type Bytes8 [8]byte

func (Bytes8) MarshalText

func (self Bytes8) MarshalText() ([]byte, error)

func (Bytes8) String

func (self Bytes8) String() string

func (*Bytes8) UnmarshalText

func (self *Bytes8) UnmarshalText(src []byte) error

type Bytes96

type Bytes96 [96]byte

func (Bytes96) MarshalText

func (self Bytes96) MarshalText() ([]byte, error)

func (Bytes96) String

func (self Bytes96) String() string

func (*Bytes96) UnmarshalText

func (self *Bytes96) UnmarshalText(src []byte) error

type ChainID

type ChainID [ChainIdBytesLen]byte

func (ChainID) MarshalText

func (self ChainID) MarshalText() ([]byte, error)

func (ChainID) String

func (self ChainID) String() string

func (*ChainID) ToBase58

func (self *ChainID) ToBase58() []byte

func (*ChainID) UnmarshalText

func (self *ChainID) UnmarshalText(src []byte) error

type Comparable

type Comparable[K any] interface {
	comparable
	ToKey() K
}

type ContextHash

type ContextHash [HashBytesLen]byte

func (ContextHash) MarshalText

func (self ContextHash) MarshalText() ([]byte, error)

func (ContextHash) String

func (self ContextHash) String() string

func (*ContextHash) ToBase58

func (self *ContextHash) ToBase58() []byte

func (*ContextHash) UnmarshalText

func (self *ContextHash) UnmarshalText(src []byte) error

type ContractHash

type ContractHash [AddressBytesLen]byte

func (ContractHash) MarshalText

func (self ContractHash) MarshalText() ([]byte, error)

func (ContractHash) String

func (self ContractHash) String() string

func (*ContractHash) ToBase58

func (self *ContractHash) ToBase58() []byte

func (*ContractHash) UnmarshalText

func (self *ContractHash) UnmarshalText(src []byte) error

type ConventionalSignature

type ConventionalSignature interface {
	Signature
	Generic() *GenericSignature
}

type CycleNonce

type CycleNonce [CycleNonceBytesLen]byte

func (CycleNonce) MarshalText

func (self CycleNonce) MarshalText() ([]byte, error)

func (CycleNonce) String

func (self CycleNonce) String() string

func (*CycleNonce) UnmarshalText

func (self *CycleNonce) UnmarshalText(src []byte) error

type CycleNonceHash

type CycleNonceHash [CycleNonceBytesLen]byte

func (CycleNonceHash) MarshalText

func (self CycleNonceHash) MarshalText() ([]byte, error)

func (CycleNonceHash) String

func (self CycleNonceHash) String() string

func (*CycleNonceHash) ToBase58

func (self *CycleNonceHash) ToBase58() []byte

func (*CycleNonceHash) UnmarshalText

func (self *CycleNonceHash) UnmarshalText(src []byte) error

type DALCommitment

type DALCommitment [SlotHeaderBytesLen]byte

func (DALCommitment) MarshalText

func (self DALCommitment) MarshalText() ([]byte, error)

func (DALCommitment) String

func (self DALCommitment) String() string

func (*DALCommitment) ToBase58

func (self *DALCommitment) ToBase58() []byte

func (*DALCommitment) UnmarshalText

func (self *DALCommitment) UnmarshalText(src []byte) error

type Ed25519EncryptedPrivateKey

type Ed25519EncryptedPrivateKey [Ed25519EncryptedSeedBytesLen]byte

func (*Ed25519EncryptedPrivateKey) Decrypt

func (pk *Ed25519EncryptedPrivateKey) Decrypt(passCb func() ([]byte, error)) (PrivateKey, error)

func (Ed25519EncryptedPrivateKey) MarshalText

func (self Ed25519EncryptedPrivateKey) MarshalText() ([]byte, error)

func (Ed25519EncryptedPrivateKey) String

func (self Ed25519EncryptedPrivateKey) String() string

func (*Ed25519EncryptedPrivateKey) ToBase58

func (self *Ed25519EncryptedPrivateKey) ToBase58() []byte

func (*Ed25519EncryptedPrivateKey) UnmarshalText

func (self *Ed25519EncryptedPrivateKey) UnmarshalText(src []byte) error

type Ed25519PrivateKey

type Ed25519PrivateKey [Ed25519SeedBytesLen]byte

func NewEd25519PrivateKey

func NewEd25519PrivateKey(key []byte) (*Ed25519PrivateKey, error)

func (*Ed25519PrivateKey) Decrypt

func (pk *Ed25519PrivateKey) Decrypt(func() ([]byte, error)) (PrivateKey, error)

stub

func (Ed25519PrivateKey) MarshalText

func (self Ed25519PrivateKey) MarshalText() ([]byte, error)

func (*Ed25519PrivateKey) PrivateKey

func (priv *Ed25519PrivateKey) PrivateKey()

func (Ed25519PrivateKey) String

func (self Ed25519PrivateKey) String() string

func (*Ed25519PrivateKey) ToBase58

func (self *Ed25519PrivateKey) ToBase58() []byte

func (*Ed25519PrivateKey) UnmarshalText

func (self *Ed25519PrivateKey) UnmarshalText(src []byte) error

type Ed25519PublicKey

type Ed25519PublicKey [Ed25519PublicKeyBytesLen]byte

func NewEd25519PublicKey

func NewEd25519PublicKey(key []byte) (*Ed25519PublicKey, error)

func (*Ed25519PublicKey) Hash

func (pk *Ed25519PublicKey) Hash() PublicKeyHash

func (Ed25519PublicKey) MarshalText

func (self Ed25519PublicKey) MarshalText() ([]byte, error)

func (*Ed25519PublicKey) PublicKey

func (pk *Ed25519PublicKey) PublicKey()

func (Ed25519PublicKey) String

func (self Ed25519PublicKey) String() string

func (*Ed25519PublicKey) ToBase58

func (self *Ed25519PublicKey) ToBase58() []byte

func (*Ed25519PublicKey) UnmarshalText

func (self *Ed25519PublicKey) UnmarshalText(src []byte) error

type Ed25519PublicKeyHash

type Ed25519PublicKeyHash [AddressBytesLen]byte

func (*Ed25519PublicKeyHash) Eq

func (pkh *Ed25519PublicKeyHash) Eq(other PublicKeyHash) bool

func (Ed25519PublicKeyHash) MarshalText

func (self Ed25519PublicKeyHash) MarshalText() ([]byte, error)

func (*Ed25519PublicKeyHash) PublicKeyHash

func (pkh *Ed25519PublicKeyHash) PublicKeyHash() []byte

func (Ed25519PublicKeyHash) String

func (self Ed25519PublicKeyHash) String() string

func (*Ed25519PublicKeyHash) ToBase58

func (self *Ed25519PublicKeyHash) ToBase58() []byte

func (*Ed25519PublicKeyHash) ToComparable

func (pkh *Ed25519PublicKeyHash) ToComparable() (out EncodedPublicKeyHash)

func (*Ed25519PublicKeyHash) UnmarshalText

func (self *Ed25519PublicKeyHash) UnmarshalText(src []byte) error

type Ed25519Signature

type Ed25519Signature [GenericSignatureBytesLen]byte

func NewEd25519Signature

func NewEd25519Signature(sig []byte) *Ed25519Signature

func (*Ed25519Signature) Generic

func (sig *Ed25519Signature) Generic() *GenericSignature

func (Ed25519Signature) MarshalText

func (self Ed25519Signature) MarshalText() ([]byte, error)

func (*Ed25519Signature) Signature

func (sig *Ed25519Signature) Signature()

func (Ed25519Signature) String

func (self Ed25519Signature) String() string

func (*Ed25519Signature) ToBase58

func (self *Ed25519Signature) ToBase58() []byte

func (*Ed25519Signature) UnmarshalText

func (self *Ed25519Signature) UnmarshalText(src []byte) error

type EncodedPublicKeyHash

type EncodedPublicKeyHash [publicKeyHashComparableKeyLen]byte

func (EncodedPublicKeyHash) MarshalText

func (k EncodedPublicKeyHash) MarshalText() (text []byte, err error)

func (EncodedPublicKeyHash) ToKey

func (*EncodedPublicKeyHash) UnmarshalText

func (k *EncodedPublicKeyHash) UnmarshalText(text []byte) error

type EncryptedPrivateKey

type EncryptedPrivateKey interface {
	Base58Encoder
	Decrypt(passCb func() ([]byte, error)) (PrivateKey, error)
}

type GenericSignature

type GenericSignature [GenericSignatureBytesLen]byte

func (*GenericSignature) Generic

func (sig *GenericSignature) Generic() *GenericSignature

func (GenericSignature) MarshalText

func (self GenericSignature) MarshalText() ([]byte, error)

func (*GenericSignature) Signature

func (sig *GenericSignature) Signature()

func (GenericSignature) String

func (self GenericSignature) String() string

func (*GenericSignature) ToBase58

func (self *GenericSignature) ToBase58() []byte

func (*GenericSignature) UnmarshalText

func (self *GenericSignature) UnmarshalText(src []byte) error

type OperationHash

type OperationHash [HashBytesLen]byte

func (OperationHash) MarshalText

func (self OperationHash) MarshalText() ([]byte, error)

func (OperationHash) String

func (self OperationHash) String() string

func (*OperationHash) ToBase58

func (self *OperationHash) ToBase58() []byte

func (*OperationHash) UnmarshalText

func (self *OperationHash) UnmarshalText(src []byte) error

type OperationsHash

type OperationsHash [HashBytesLen]byte

func (OperationsHash) MarshalText

func (self OperationsHash) MarshalText() ([]byte, error)

func (OperationsHash) String

func (self OperationsHash) String() string

func (*OperationsHash) ToBase58

func (self *OperationsHash) ToBase58() []byte

func (*OperationsHash) UnmarshalText

func (self *OperationsHash) UnmarshalText(src []byte) error

type Option

type Option[T any] struct {
	// contains filtered or unexported fields
}

func None

func None[T any]() Option[T]

func Some

func Some[T any](val T) Option[T]

func (Option[T]) CheckUnwrap

func (op Option[T]) CheckUnwrap() (T, bool)

func (*Option[T]) CheckUnwrapPtr

func (op *Option[T]) CheckUnwrapPtr() (*T, bool)

func (*Option[T]) DecodeMV

func (op *Option[T]) DecodeMV(data []byte, ctx *encoding.Context) (rest []byte, err error)

func (*Option[T]) EncodeMV

func (op *Option[T]) EncodeMV(ctx *encoding.Context) ([]byte, error)

func (Option[T]) GoString

func (op Option[T]) GoString() string

func (Option[T]) IsNone

func (op Option[T]) IsNone() bool

func (Option[T]) IsSome

func (op Option[T]) IsSome() bool

func (*Option[T]) MarshalJSON

func (op *Option[T]) MarshalJSON() ([]byte, error)

func (Option[T]) Or

func (op Option[T]) Or(val Option[T]) Option[T]

func (Option[T]) OrElse

func (op Option[T]) OrElse(f func() Option[T]) Option[T]

func (*Option[T]) UnmarshalJSON

func (op *Option[T]) UnmarshalJSON(data []byte) error

func (Option[T]) Unwrap

func (op Option[T]) Unwrap() T

func (Option[T]) UnwrapOr

func (op Option[T]) UnwrapOr(def T) T

func (Option[T]) UnwrapOrElse

func (op Option[T]) UnwrapOrElse(f func() T) T

func (Option[T]) UnwrapOrZero

func (op Option[T]) UnwrapOrZero() T

func (*Option[T]) UnwrapPtr

func (op *Option[T]) UnwrapPtr() *T

func (Option[T]) UnwrapUnchecked

func (op Option[T]) UnwrapUnchecked() T

type Option1

type Option1[T any] struct {
	Option[T]
}

func (*Option1[T]) EncodeMV

func (op *Option1[T]) EncodeMV(ctx *encoding.Context) ([]byte, error)

type P256EncryptedPrivateKey

type P256EncryptedPrivateKey [P256EncryptedPrivateKeyBytesLen]byte

func (*P256EncryptedPrivateKey) Decrypt

func (pk *P256EncryptedPrivateKey) Decrypt(passCb func() ([]byte, error)) (PrivateKey, error)

func (P256EncryptedPrivateKey) MarshalText

func (self P256EncryptedPrivateKey) MarshalText() ([]byte, error)

func (P256EncryptedPrivateKey) String

func (self P256EncryptedPrivateKey) String() string

func (*P256EncryptedPrivateKey) ToBase58

func (self *P256EncryptedPrivateKey) ToBase58() []byte

func (*P256EncryptedPrivateKey) UnmarshalText

func (self *P256EncryptedPrivateKey) UnmarshalText(src []byte) error

type P256PrivateKey

type P256PrivateKey [P256PrivateKeyBytesLen]byte

func NewP256PrivateKey

func NewP256PrivateKey(scalar *big.Int) (*P256PrivateKey, error)

func (*P256PrivateKey) Decrypt

func (pk *P256PrivateKey) Decrypt(func() ([]byte, error)) (PrivateKey, error)

stub

func (P256PrivateKey) MarshalText

func (self P256PrivateKey) MarshalText() ([]byte, error)

func (*P256PrivateKey) PrivateKey

func (priv *P256PrivateKey) PrivateKey()

func (P256PrivateKey) String

func (self P256PrivateKey) String() string

func (*P256PrivateKey) ToBase58

func (self *P256PrivateKey) ToBase58() []byte

func (*P256PrivateKey) UnmarshalText

func (self *P256PrivateKey) UnmarshalText(src []byte) error

type P256PublicKey

type P256PublicKey [P256PublicKeyBytesLen]byte

func NewP256PublicKey

func NewP256PublicKey(compressedPoint []byte) (*P256PublicKey, error)

func (*P256PublicKey) Hash

func (pk *P256PublicKey) Hash() PublicKeyHash

func (P256PublicKey) MarshalText

func (self P256PublicKey) MarshalText() ([]byte, error)

func (*P256PublicKey) PublicKey

func (pk *P256PublicKey) PublicKey()

func (P256PublicKey) String

func (self P256PublicKey) String() string

func (*P256PublicKey) ToBase58

func (self *P256PublicKey) ToBase58() []byte

func (*P256PublicKey) UnmarshalText

func (self *P256PublicKey) UnmarshalText(src []byte) error

type P256PublicKeyHash

type P256PublicKeyHash [AddressBytesLen]byte

func (*P256PublicKeyHash) Eq

func (pkh *P256PublicKeyHash) Eq(other PublicKeyHash) bool

func (P256PublicKeyHash) MarshalText

func (self P256PublicKeyHash) MarshalText() ([]byte, error)

func (*P256PublicKeyHash) PublicKeyHash

func (pkh *P256PublicKeyHash) PublicKeyHash() []byte

func (P256PublicKeyHash) String

func (self P256PublicKeyHash) String() string

func (*P256PublicKeyHash) ToBase58

func (self *P256PublicKeyHash) ToBase58() []byte

func (*P256PublicKeyHash) ToComparable

func (pkh *P256PublicKeyHash) ToComparable() (out EncodedPublicKeyHash)

func (*P256PublicKeyHash) UnmarshalText

func (self *P256PublicKeyHash) UnmarshalText(src []byte) error

type P256Signature

type P256Signature [GenericSignatureBytesLen]byte

func NewP256Signature

func NewP256Signature(r, s *big.Int) *P256Signature

func (*P256Signature) Generic

func (sig *P256Signature) Generic() *GenericSignature

func (P256Signature) MarshalText

func (self P256Signature) MarshalText() ([]byte, error)

func (*P256Signature) Point

func (sig *P256Signature) Point() (r, s *big.Int)

func (*P256Signature) Signature

func (sig *P256Signature) Signature()

func (P256Signature) String

func (self P256Signature) String() string

func (*P256Signature) ToBase58

func (self *P256Signature) ToBase58() []byte

func (*P256Signature) UnmarshalText

func (self *P256Signature) UnmarshalText(src []byte) error

type PrivateKey

type PrivateKey interface {
	PrivateKey()
	EncryptedPrivateKey
}

type ProtocolHash

type ProtocolHash [HashBytesLen]byte

func (ProtocolHash) MarshalText

func (self ProtocolHash) MarshalText() ([]byte, error)

func (ProtocolHash) String

func (self ProtocolHash) String() string

func (*ProtocolHash) ToBase58

func (self *ProtocolHash) ToBase58() []byte

func (*ProtocolHash) UnmarshalText

func (self *ProtocolHash) UnmarshalText(src []byte) error

type PublicKey

type PublicKey interface {
	Base58Encoder
	PublicKey()
	Hash() PublicKeyHash
}

type PublicKeyHash

type PublicKeyHash interface {
	Base58Encoder
	stdenc.TextMarshaler
	ToComparable[EncodedPublicKeyHash, PublicKeyHash]
	PublicKeyHash() []byte
	Eq(other PublicKeyHash) bool
}

type ScRollupAddress

type ScRollupAddress [AddressBytesLen]byte

func (ScRollupAddress) MarshalText

func (self ScRollupAddress) MarshalText() ([]byte, error)

func (ScRollupAddress) String

func (self ScRollupAddress) String() string

func (*ScRollupAddress) ToBase58

func (self *ScRollupAddress) ToBase58() []byte

func (*ScRollupAddress) UnmarshalText

func (self *ScRollupAddress) UnmarshalText(src []byte) error

type ScRollupCommitmentHash

type ScRollupCommitmentHash [HashBytesLen]byte

func (ScRollupCommitmentHash) MarshalText

func (self ScRollupCommitmentHash) MarshalText() ([]byte, error)

func (ScRollupCommitmentHash) String

func (self ScRollupCommitmentHash) String() string

func (*ScRollupCommitmentHash) ToBase58

func (self *ScRollupCommitmentHash) ToBase58() []byte

func (*ScRollupCommitmentHash) UnmarshalText

func (self *ScRollupCommitmentHash) UnmarshalText(src []byte) error

type ScRollupStateHash

type ScRollupStateHash [HashBytesLen]byte

func (ScRollupStateHash) MarshalText

func (self ScRollupStateHash) MarshalText() ([]byte, error)

func (ScRollupStateHash) String

func (self ScRollupStateHash) String() string

func (*ScRollupStateHash) ToBase58

func (self *ScRollupStateHash) ToBase58() []byte

func (*ScRollupStateHash) UnmarshalText

func (self *ScRollupStateHash) UnmarshalText(src []byte) error

type ScriptExprHash

type ScriptExprHash [HashBytesLen]byte

func (ScriptExprHash) MarshalText

func (self ScriptExprHash) MarshalText() ([]byte, error)

func (ScriptExprHash) String

func (self ScriptExprHash) String() string

func (*ScriptExprHash) ToBase58

func (self *ScriptExprHash) ToBase58() []byte

func (*ScriptExprHash) UnmarshalText

func (self *ScriptExprHash) UnmarshalText(src []byte) error

type Secp256k1EncryptedPrivateKey

type Secp256k1EncryptedPrivateKey [Secp256k1EncryptedPrivateKeyBytesLen]byte

func (*Secp256k1EncryptedPrivateKey) Decrypt

func (pk *Secp256k1EncryptedPrivateKey) Decrypt(passCb func() ([]byte, error)) (PrivateKey, error)

func (Secp256k1EncryptedPrivateKey) MarshalText

func (self Secp256k1EncryptedPrivateKey) MarshalText() ([]byte, error)

func (Secp256k1EncryptedPrivateKey) String

func (self Secp256k1EncryptedPrivateKey) String() string

func (*Secp256k1EncryptedPrivateKey) ToBase58

func (self *Secp256k1EncryptedPrivateKey) ToBase58() []byte

func (*Secp256k1EncryptedPrivateKey) UnmarshalText

func (self *Secp256k1EncryptedPrivateKey) UnmarshalText(src []byte) error

type Secp256k1PrivateKey

type Secp256k1PrivateKey [Secp256k1PrivateKeyBytesLen]byte

func NewSecp256k1PrivateKey

func NewSecp256k1PrivateKey(scalar *big.Int) (*Secp256k1PrivateKey, error)

func (*Secp256k1PrivateKey) Decrypt

func (pk *Secp256k1PrivateKey) Decrypt(func() ([]byte, error)) (PrivateKey, error)

stub

func (Secp256k1PrivateKey) MarshalText

func (self Secp256k1PrivateKey) MarshalText() ([]byte, error)

func (*Secp256k1PrivateKey) PrivateKey

func (priv *Secp256k1PrivateKey) PrivateKey()

func (Secp256k1PrivateKey) String

func (self Secp256k1PrivateKey) String() string

func (*Secp256k1PrivateKey) ToBase58

func (self *Secp256k1PrivateKey) ToBase58() []byte

func (*Secp256k1PrivateKey) UnmarshalText

func (self *Secp256k1PrivateKey) UnmarshalText(src []byte) error

type Secp256k1PublicKey

type Secp256k1PublicKey [Secp256k1PublicKeyBytesLen]byte

func NewSecp256k1PublicKey

func NewSecp256k1PublicKey(compressedPoint []byte) (*Secp256k1PublicKey, error)

func (*Secp256k1PublicKey) Hash

func (pk *Secp256k1PublicKey) Hash() PublicKeyHash

func (Secp256k1PublicKey) MarshalText

func (self Secp256k1PublicKey) MarshalText() ([]byte, error)

func (*Secp256k1PublicKey) PublicKey

func (pk *Secp256k1PublicKey) PublicKey()

func (Secp256k1PublicKey) String

func (self Secp256k1PublicKey) String() string

func (*Secp256k1PublicKey) ToBase58

func (self *Secp256k1PublicKey) ToBase58() []byte

func (*Secp256k1PublicKey) UnmarshalText

func (self *Secp256k1PublicKey) UnmarshalText(src []byte) error

type Secp256k1PublicKeyHash

type Secp256k1PublicKeyHash [AddressBytesLen]byte

func (*Secp256k1PublicKeyHash) Eq

func (pkh *Secp256k1PublicKeyHash) Eq(other PublicKeyHash) bool

func (Secp256k1PublicKeyHash) MarshalText

func (self Secp256k1PublicKeyHash) MarshalText() ([]byte, error)

func (*Secp256k1PublicKeyHash) PublicKeyHash

func (pkh *Secp256k1PublicKeyHash) PublicKeyHash() []byte

func (Secp256k1PublicKeyHash) String

func (self Secp256k1PublicKeyHash) String() string

func (*Secp256k1PublicKeyHash) ToBase58

func (self *Secp256k1PublicKeyHash) ToBase58() []byte

func (*Secp256k1PublicKeyHash) ToComparable

func (pkh *Secp256k1PublicKeyHash) ToComparable() (out EncodedPublicKeyHash)

func (*Secp256k1PublicKeyHash) UnmarshalText

func (self *Secp256k1PublicKeyHash) UnmarshalText(src []byte) error

type Secp256k1Signature

type Secp256k1Signature [GenericSignatureBytesLen]byte

func NewSecp256k1Signature

func NewSecp256k1Signature(r, s *big.Int) *Secp256k1Signature

func (*Secp256k1Signature) Generic

func (sig *Secp256k1Signature) Generic() *GenericSignature

func (Secp256k1Signature) MarshalText

func (self Secp256k1Signature) MarshalText() ([]byte, error)

func (*Secp256k1Signature) Point

func (sig *Secp256k1Signature) Point() (r, s *big.Int)

func (*Secp256k1Signature) Signature

func (sig *Secp256k1Signature) Signature()

func (Secp256k1Signature) String

func (self Secp256k1Signature) String() string

func (*Secp256k1Signature) ToBase58

func (self *Secp256k1Signature) ToBase58() []byte

func (*Secp256k1Signature) UnmarshalText

func (self *Secp256k1Signature) UnmarshalText(src []byte) error

type SeedNonce

type SeedNonce [SeedNonceBytesLen]byte

func (SeedNonce) MarshalText

func (self SeedNonce) MarshalText() ([]byte, error)

func (SeedNonce) String

func (self SeedNonce) String() string

func (*SeedNonce) UnmarshalText

func (self *SeedNonce) UnmarshalText(src []byte) error

type Signature

type Signature interface {
	Base58Encoder
	Signature()
}

type SmartRollupAddress

type SmartRollupAddress [AddressBytesLen]byte

func (SmartRollupAddress) MarshalText

func (self SmartRollupAddress) MarshalText() ([]byte, error)

func (SmartRollupAddress) String

func (self SmartRollupAddress) String() string

func (*SmartRollupAddress) ToBase58

func (self *SmartRollupAddress) ToBase58() []byte

func (*SmartRollupAddress) UnmarshalText

func (self *SmartRollupAddress) UnmarshalText(src []byte) error

type SmartRollupCommitmentHash

type SmartRollupCommitmentHash [HashBytesLen]byte

func (SmartRollupCommitmentHash) MarshalText

func (self SmartRollupCommitmentHash) MarshalText() ([]byte, error)

func (SmartRollupCommitmentHash) String

func (self SmartRollupCommitmentHash) String() string

func (*SmartRollupCommitmentHash) ToBase58

func (self *SmartRollupCommitmentHash) ToBase58() []byte

func (*SmartRollupCommitmentHash) UnmarshalText

func (self *SmartRollupCommitmentHash) UnmarshalText(src []byte) error

type SmartRollupStateHash

type SmartRollupStateHash [HashBytesLen]byte

func (SmartRollupStateHash) MarshalText

func (self SmartRollupStateHash) MarshalText() ([]byte, error)

func (SmartRollupStateHash) String

func (self SmartRollupStateHash) String() string

func (*SmartRollupStateHash) ToBase58

func (self *SmartRollupStateHash) ToBase58() []byte

func (*SmartRollupStateHash) UnmarshalText

func (self *SmartRollupStateHash) UnmarshalText(src []byte) error

type String

type String string

func (*String) DecodeMV

func (str *String) DecodeMV(data []byte, ctx *encoding.Context) ([]byte, error)

func (String) EncodeMV

func (str String) EncodeMV(ctx *encoding.Context) ([]byte, error)

type TXRollupAddress

type TXRollupAddress [AddressBytesLen]byte

func (TXRollupAddress) MarshalText

func (self TXRollupAddress) MarshalText() ([]byte, error)

func (TXRollupAddress) String

func (self TXRollupAddress) String() string

func (*TXRollupAddress) ToBase58

func (self *TXRollupAddress) ToBase58() []byte

func (*TXRollupAddress) UnmarshalText

func (self *TXRollupAddress) UnmarshalText(src []byte) error

type Timestamp

type Timestamp int64

func (Timestamp) String

func (t Timestamp) String() string

func (Timestamp) Time

func (t Timestamp) Time() time.Time

type ToComparable

type ToComparable[H Comparable[K], K any] interface {
	ToComparable() H
}

type ZkRollupAddress

type ZkRollupAddress [AddressBytesLen]byte

func (ZkRollupAddress) MarshalText

func (self ZkRollupAddress) MarshalText() ([]byte, error)

func (ZkRollupAddress) String

func (self ZkRollupAddress) String() string

func (*ZkRollupAddress) ToBase58

func (self *ZkRollupAddress) ToBase58() []byte

func (*ZkRollupAddress) UnmarshalText

func (self *ZkRollupAddress) UnmarshalText(src []byte) error

Directories

Path Synopsis
b58
Package b58 contains Base58 decoding functions of various Mavryk types
Package b58 contains Base58 decoding functions of various Mavryk types
Package client is a very limited Mavryk RPC client library
Package client is a very limited Mavryk RPC client library
Package crypt is a wrapper around standard and 3rd party signature algorithms which adds a support of Mavryk encodings of keys and signatures
Package crypt is a wrapper around standard and 3rd party signature algorithms which adds a support of Mavryk encodings of keys and signatures
Package encoding handles Mavryk binary encoding
Package encoding handles Mavryk binary encoding
Package mavtool is an operation injection helper
Package mavtool is an operation injection helper

Jump to

Keyboard shortcuts

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