multisig

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: GPL-2.0, GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxSignerInMultisig = 10
	MinSignerInMultisig = 1
)

Variables

This section is empty.

Functions

func AsIndices

func AsIndices(bitmap uint16) ([]byte, error)

func PublicKeyFromSuiBytes

func PublicKeyFromSuiBytes[T string | []byte](publicKey T) (pk cryptography.PublicKey, err error)

Types

type MultiSigPublicKey

type MultiSigPublicKey struct {
	cryptography.BasePublicKey
	// contains filtered or unexported fields
}

func NewMultiSigPublicKey

func NewMultiSigPublicKey[T string | []byte | cryptography.MultiSigPublicKeyStruct](value T) (multisig *MultiSigPublicKey, err error)

func (*MultiSigPublicKey) CombinePartialSignatures

func (multisig *MultiSigPublicKey) CombinePartialSignatures(signatures []cryptography.SerializedSignature) (cryptography.SerializedSignature, error)

func (*MultiSigPublicKey) Equals

func (key *MultiSigPublicKey) Equals(publicKey cryptography.PublicKey) bool

Checks if two MultiSig public keys are equal

func (*MultiSigPublicKey) Flag

func (multisig *MultiSigPublicKey) Flag() uint8

Return the Sui address associated with this MultiSig public key

func (*MultiSigPublicKey) FromPublicKeys

func (multisig *MultiSigPublicKey) FromPublicKeys(publicKeys []PublicKeyWeightPair, threshold uint16) (*MultiSigPublicKey, error)

func (*MultiSigPublicKey) GetPublicKeys

func (multisig *MultiSigPublicKey) GetPublicKeys() []cryptography.MultiSigPublicKeyPair

func (*MultiSigPublicKey) GetThreshold

func (multisig *MultiSigPublicKey) GetThreshold() uint16

func (*MultiSigPublicKey) ToRawBytes

func (multisig *MultiSigPublicKey) ToRawBytes() []byte

Return the byte array representation of the MultiSig public key

func (*MultiSigPublicKey) ToSuiAddress

func (multisig *MultiSigPublicKey) ToSuiAddress() string

Return the Sui address associated with this MultiSig public key

func (*MultiSigPublicKey) Verify

func (multisig *MultiSigPublicKey) Verify(message []byte, multisigSignature cryptography.SerializedSignature) (bool, error)

Verifies that the signature is valid for for the provided message

type ParsedPartialMultiSigSignature

type ParsedPartialMultiSigSignature struct {
	SignatureScheme cryptography.SignatureScheme
	Signature       []byte
	PublicKey       cryptography.PublicKey
	Weight          uint8
}

func ParsePartialSignatures

func ParsePartialSignatures(multisig *cryptography.MultiSigStruct) ([]ParsedPartialMultiSigSignature, error)

Parse multisig structure into an array of individual signatures: signature scheme, the actual individual signature, public key and its weight.

type PublicKeyWeightPair

type PublicKeyWeightPair struct {
	PublicKey cryptography.PublicKey
	Weight    uint8
}

type StringPubKeyEnumWeightPair

type StringPubKeyEnumWeightPair struct {
	PubKey string `json:"pubKey"`
	Weight uint8  `json:"weight"`
}

Jump to

Keyboard shortcuts

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