Documentation ¶
Index ¶
- Constants
- func Address(params *dagconfig.Params, extendedPublicKeys []string, ...) (util.Address, error)
- func AppMessageUTXOToKashwalletdUTXO(appUTXOsByAddressesEntry *appmessage.UTXOsByAddressesEntry) *pb.UtxosByAddressesEntry
- func CreateKeyPair(ecdsa bool) ([]byte, []byte, error)
- func CreateMnemonic() (string, error)
- func CreateUnsignedTransaction(extendedPublicKeys []string, minimumSignatures uint32, payments []*Payment, ...) ([]byte, error)
- func ExtractTransaction(partiallySignedTransactionBytes []byte, ecdsa bool) (*externalapi.DomainTransaction, error)
- func ExtractTransactionDeserialized(partiallySignedTransaction *serialization.PartiallySignedTransaction, ...) (*externalapi.DomainTransaction, error)
- func IsTransactionFullySigned(partiallySignedTransactionBytes []byte) (bool, error)
- func MasterPublicKeyFromMnemonic(params *dagconfig.Params, mnemonic string, isMultisig bool) (string, error)
- func MinimumCosignerIndex(cosignerExtendedPublicKeys, allExtendedPublicKeys []string) (uint32, error)
- func PublicKeyFromPrivateKey(privateKeyBytes []byte) ([]byte, error)
- func Sign(params *dagconfig.Params, mnemonics []string, serializedPSTx []byte, ...) ([]byte, error)
- type Payment
- type UTXO
Constants ¶
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
const ( // ExternalKeychain is the key chain that is used to create receive addresses ExternalKeychain = 0 // InternalKeychain is used to create change addresses InternalKeychain = 1 )
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 AppMessageUTXOToKashwalletdUTXO ¶
func AppMessageUTXOToKashwalletdUTXO(appUTXOsByAddressesEntry *appmessage.UTXOsByAddressesEntry) *pb.UtxosByAddressesEntry
AppMessageUTXOToKashwalletdUTXO converts an appmessage.UTXOsByAddressesEntry to a pb.UtxosByAddressesEntry
func CreateKeyPair ¶
CreateKeyPair generates a private-public key pair
func CreateMnemonic ¶
CreateMnemonic creates a new bip-39 compatible mnemonic
func CreateUnsignedTransaction ¶
func CreateUnsignedTransaction( extendedPublicKeys []string, minimumSignatures uint32, payments []*Payment, selectedUTXOs []*UTXO, txType externalapi.DomainTransactionType) ([]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 ExtractTransactionDeserialized ¶
func ExtractTransactionDeserialized(partiallySignedTransaction *serialization.PartiallySignedTransaction, ecdsa bool) ( *externalapi.DomainTransaction, error)
ExtractTransactionDeserialized does the same thing ExtractTransaction does, only receives the PartiallySignedTransaction in an already deserialized format
func IsTransactionFullySigned ¶
IsTransactionFullySigned returns whether the transaction is fully signed and ready to broadcast.
func MasterPublicKeyFromMnemonic ¶
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 ¶
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 ¶
PublicKeyFromPrivateKey returns the public key associated with a private key
Types ¶
type Payment ¶
type Payment struct { Address util.Address AssetType externalapi.AssetType Amount uint64 }
Payment contains a recipient payment details
type UTXO ¶
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.
func KashwalletdUTXOsTolibkashwalletUTXOs ¶
func KashwalletdUTXOsTolibkashwalletUTXOs(kashwalletdUtxoEntires []*pb.UtxosByAddressesEntry) ([]*UTXO, error)
KashwalletdUTXOsTolibkashwalletUTXOs converts a []*pb.UtxosByAddressesEntry to a []*libkashwallet.UTXO