libkaspawallet

package
v0.11.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: ISC Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const (
	SingleSignerPurpose = 44
	// Note: this is not entirely compatible to BIP 45 since
	// BIP 45 doesn't have a coin type in its derivation path.
	MultiSigPurpose = 45
	// TODO: Register the coin type in https://github.com/satoshilabs/slips/blob/master/slip-0044.md
	CoinType = 111111
)

Purpose and CoinType constants

Variables

This section is empty.

Functions

func Address

func Address(params *dagconfig.Params, extendedPublicKeys []string, minimumSignatures uint32, path string, ecdsa bool) (util.Address, error)

Address returns the address associated with the given public keys and minimum signatures parameters.

func CreateKeyPair

func CreateKeyPair(ecdsa bool) ([]byte, []byte, error)

CreateKeyPair generates a private-public key pair

func CreateMnemonic added in v0.11.0

func CreateMnemonic() (string, error)

CreateMnemonic creates a new bip-39 compatible mnemonic

func CreateUnsignedTransaction

func CreateUnsignedTransaction(
	extendedPublicKeys []string,
	minimumSignatures uint32,
	payments []*Payment,
	selectedUTXOs []*UTXO) ([]byte, error)

CreateUnsignedTransaction creates an unsigned transaction

func ExtractTransaction

func ExtractTransaction(partiallySignedTransactionBytes []byte, ecdsa bool) (*externalapi.DomainTransaction, error)

ExtractTransaction extracts a domain transaction from partially signed transaction after all of the relevant parties have signed it.

func IsTransactionFullySigned

func IsTransactionFullySigned(partiallySignedTransactionBytes []byte) (bool, error)

IsTransactionFullySigned returns whether the transaction is fully signed and ready to broadcast.

func MasterPublicKeyFromMnemonic added in v0.11.0

func MasterPublicKeyFromMnemonic(params *dagconfig.Params, mnemonic string, isMultisig bool) (string, error)

MasterPublicKeyFromMnemonic returns the master public key with the correct derivation for the given mnemonic.

func MinimumCosignerIndex added in v0.11.0

func MinimumCosignerIndex(cosignerExtendedPublicKeys, allExtendedPublicKeys []string) (uint32, error)

MinimumCosignerIndex returns the minimum index for the cosigner from the set of all extended public keys.

func PublicKeyFromPrivateKey

func PublicKeyFromPrivateKey(privateKeyBytes []byte) ([]byte, error)

PublicKeyFromPrivateKey returns the public key associated with a private key

func Sign

func Sign(params *dagconfig.Params, mnemonics []string, serializedPSTx []byte, ecdsa bool) ([]byte, error)

Sign signs the transaction with the given private keys

Types

type Payment

type Payment struct {
	Address util.Address
	Amount  uint64
}

Payment contains a recipient payment details

type UTXO added in v0.11.0

type UTXO struct {
	Outpoint       *externalapi.DomainOutpoint
	UTXOEntry      externalapi.UTXOEntry
	DerivationPath string
}

UTXO is a type that stores a UTXO and meta data that is needed in order to sign it and create transactions with it.

Directories

Path Synopsis
base58
Package base58 provides an API for working with modified base58 and Base58Check encodings.
Package base58 provides an API for working with modified base58 and Base58Check encodings.

Jump to

Keyboard shortcuts

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