Documentation ¶
Index ¶
- Constants
- Variables
- func AddEmergencyKitMetadata(metadataText string, srcFile string, dstFile string) error
- func DetermineUserActivatedFeatureStatus(feature UserActivatedFeature, blockHeight int, exportedKitVersions *IntList, ...) string
- func ErrorCode(err error) int64
- func GenerateRecoveryCode() string
- func GetInvoiceMetadata(paymentHash []byte) (string, error)
- func GetRecoveryCodeVersion(code string) (int, error)
- func Init(c *Config)
- func KeyEncrypt(privKey *HDPrivateKey, passphrase string) (string, error)
- func LNURLValidate(qr string) bool
- func LNURLWithdraw(invoiceBuilder *InvoiceBuilder, qr string, listener LNURLListener)
- func PersistInvoiceSecrets(list *InvoiceSecretsList) error
- func SHA256(data []byte) []byte
- func Scrypt256(data, salt []byte) []byte
- func SignWithPrivateKey(key *HDPrivateKey, data []byte) ([]byte, error)
- func ValidateRecoveryCode(code string) error
- func ValidateSubmarineSwap(rawInvoice string, userPublicKey *HDPublicKey, muunPublicKey *HDPublicKey, ...) error
- type BestRouteFees
- type BestRouteFeesList
- type ChallengePrivateKey
- func (k *ChallengePrivateKey) DecryptKey(decodedInfo *EncryptedPrivateKeyInfo, network *Network) (*DecryptedPrivateKey, error)
- func (k *ChallengePrivateKey) DecryptRawKey(encryptedKey string, network *Network) (*DecryptedPrivateKey, error)
- func (k *ChallengePrivateKey) PubKey() *ChallengePublicKey
- func (k *ChallengePrivateKey) PubKeyHex() string
- func (k *ChallengePrivateKey) SignSha(payload []byte) ([]byte, error)
- type ChallengePublicKey
- type Config
- type DecryptOperation
- type DecryptedKey
- type DecryptedPrivateKey
- type Decrypter
- type EKInput
- type EKOutput
- type EncryptOperation
- type EncryptedPrivateKeyInfo
- type Encrypter
- type FundingOutputPolicies
- type HDPrivateKey
- func (p *HDPrivateKey) Decrypter() Decrypter
- func (p *HDPrivateKey) DecrypterFrom(senderKey *PublicKey) Decrypter
- func (p *HDPrivateKey) DeriveTo(path string) (*HDPrivateKey, error)
- func (p *HDPrivateKey) DerivedAt(index int64, hardened bool) (*HDPrivateKey, error)
- func (p *HDPrivateKey) Encrypter() Encrypter
- func (p *HDPrivateKey) EncrypterTo(receiver *HDPublicKey) Encrypter
- func (p *HDPrivateKey) PublicKey() *HDPublicKey
- func (p *HDPrivateKey) Sign(data []byte) ([]byte, error)
- func (p *HDPrivateKey) String() string
- type HDPublicKey
- type IncomingSwap
- func (s *IncomingSwap) Fulfill(data *IncomingSwapFulfillmentData, userKey *HDPrivateKey, muunKey *HDPublicKey, ...) (*IncomingSwapFulfillmentResult, error)
- func (s *IncomingSwap) FulfillFullDebt() (*IncomingSwapFulfillmentResult, error)
- func (s *IncomingSwap) VerifyFulfillable(userKey *HDPrivateKey, net *Network) error
- type IncomingSwapFulfillmentData
- type IncomingSwapFulfillmentResult
- type IncomingSwapHtlc
- type Input
- type InputIncomingSwap
- type InputList
- type InputSubmarineSwapV1
- type InputSubmarineSwapV2
- type IntList
- type Invoice
- type InvoiceBuilder
- func (i *InvoiceBuilder) AddRouteHints(routeHints *RouteHints) *InvoiceBuilder
- func (i *InvoiceBuilder) AmountMSat(amountMSat int64) *InvoiceBuilder
- func (i *InvoiceBuilder) AmountSat(amountSat int64) *InvoiceBuilder
- func (i *InvoiceBuilder) Build() (string, error)
- func (i *InvoiceBuilder) Description(description string) *InvoiceBuilder
- func (i *InvoiceBuilder) Metadata(metadata *OperationMetadata) *InvoiceBuilder
- func (i *InvoiceBuilder) Network(net *Network) *InvoiceBuilder
- func (i *InvoiceBuilder) UserKey(userKey *HDPrivateKey) *InvoiceBuilder
- type InvoiceOptions
- type InvoiceSecrets
- type InvoiceSecretsList
- type LNURLEvent
- type LNURLEventMetadata
- type LNURLListener
- type Listener
- type MusigNonces
- type MuunAddress
- func CreateAddressV1(publicKey *HDPublicKey) (MuunAddress, error)
- func CreateAddressV2(userKey, muunKey *HDPublicKey) (MuunAddress, error)
- func CreateAddressV3(userKey, muunKey *HDPublicKey) (MuunAddress, error)
- func CreateAddressV4(userKey, muunKey *HDPublicKey) (MuunAddress, error)
- func CreateAddressV5(userKey, muunKey *HDPublicKey) (MuunAddress, error)
- type MuunPaymentURI
- type Network
- type OperationMetadata
- type Outpoint
- type Output
- type PartiallySignedTransaction
- func (p *PartiallySignedTransaction) FullySign(userKey, muunKey *HDPrivateKey) (*Transaction, error)
- func (p *PartiallySignedTransaction) Sign(userKey *HDPrivateKey, muunKey *HDPublicKey) (*Transaction, error)
- func (p *PartiallySignedTransaction) Verify(expectations *SigningExpectations, userPublicKey *HDPublicKey, ...) error
- type Payment
- type PaymentACK
- type PaymentDetails
- func (*PaymentDetails) Descriptor() ([]byte, []int)deprecated
- func (x *PaymentDetails) GetExpires() uint64
- func (x *PaymentDetails) GetOutputs() []*Output
- func (x *PaymentDetails) GetTime() uint64
- func (*PaymentDetails) ProtoMessage()
- func (x *PaymentDetails) ProtoReflect() protoreflect.Message
- func (x *PaymentDetails) Reset()
- func (x *PaymentDetails) String() string
- type PaymentRequest
- type PublicKey
- type RouteHints
- type SigningExpectations
- type StringList
- type SubmarineSwap
- type SubmarineSwapFundingOutput
- type SubmarineSwapReceiver
- type SwapFees
- type Transaction
- type UserActivatedFeature
- type X509Certificates
Constants ¶
const ( AddressVersionV1 = addresses.V1 AddressVersionV2 = addresses.V2 AddressVersionV3 = addresses.V3 AddressVersionV4 = addresses.V4 AddressVersionV5 = addresses.V5 AddressVersionSwapsV1 = addresses.SubmarineSwapV1 AddressVersionSwapsV2 = addresses.SubmarineSwapV2 )
These constants are here for clients usage.
const ( // EncodedKeyLength is the size of a modern encoded key, as exported by the clients. EncodedKeyLength = 147 // EncodedKeyLengthLegacy is the size of a legacy key, when salt resided only in the 2nd key. EncodedKeyLengthLegacy = 136 )
const ( EKVersionNeverExported = -1 // EKVersionOnlyKeys is the encrypted keys to be written down / emailed EKVersionOnlyKeys = 1 // EKVersionDescriptors is the first PDF including the descriptors EKVersionDescriptors = 2 // EKVersionMusig add the musig descriptors EKVersionMusig = 3 )
const ( ErrUnknown = 1 ErrInvalidURI = 2 ErrNetwork = 3 ErrInvalidPrivateKey = 4 ErrInvalidDerivationPath = 5 ErrInvalidInvoice = 6 )
const ( BackendFeatureTaproot = "TAPROOT" BackendFeatureTaprootPreactivation = "TAPROOT_PREACTIVATION" BackendFeatureApolloBiometrics = "APOLLO_BIOMETRICS" UserActivatedFeatureStatusOff = "off" UserActivatedFeatureStatusCanPreactivate = "can_preactivate" UserActivatedFeatureStatusCanActivate = "can_activate" UserActivatedFeatureStatusPreactivated = "preactivated" UserActivatedFeatureStatusScheduledActivation = "scheduled_activation" UserActivatedFeatureStatusActive = "active" )
const ( LNURLErrDecode = lnurl.ErrDecode LNURLErrUnsafeURL = lnurl.ErrUnsafeURL LNURLErrUnreachable = lnurl.ErrUnreachable LNURLErrInvalidResponse = lnurl.ErrInvalidResponse LNURLErrResponse = lnurl.ErrResponse LNURLErrUnknown = lnurl.ErrUnknown LNURLErrWrongTag = lnurl.ErrWrongTag LNURLErrNoAvailableBalance = lnurl.ErrNoAvailableBalance LNURLErrRequestExpired = lnurl.ErrRequestExpired LNURLErrNoRoute = lnurl.ErrNoRoute LNURLErrTorNotSupported = lnurl.ErrTorNotSupported LNURLErrAlreadyUsed = lnurl.ErrAlreadyUsed LNURLErrForbidden = lnurl.ErrForbidden LNURLErrCountryNotSupported = lnurl.ErrCountryNotSupported LNURLStatusContacting = lnurl.StatusContacting LNURLStatusInvoiceCreated = lnurl.StatusInvoiceCreated LNURLStatusReceiving = lnurl.StatusReceiving )
const MaxUnusedSecrets = 5
const PKEncryptionVersion = 1
const RecoveryCodeAlphabet = recoverycode.Alphabet
RecoveryCodeAlphabet contains all upper-case characters except for numbers/letters that look alike.
Variables ¶
var File_bip70_proto protoreflect.FileDescriptor
Functions ¶
func AddEmergencyKitMetadata ¶
AddEmergencyKitMetadata produces a copy of the PDF file at `srcFile` with embedded metadata, writing it into `dstFile`. The provided metadata must be the same opaque string produced by `GenerateEmergencyKitHTML`.
func DetermineUserActivatedFeatureStatus ¶ added in v0.9.0
func DetermineUserActivatedFeatureStatus( feature UserActivatedFeature, blockHeight int, exportedKitVersions *IntList, backendFeatures *StringList, network *Network, ) string
func GenerateRecoveryCode ¶
func GenerateRecoveryCode() string
GenerateRecoveryCode generates a new random recovery code using a cryptographically secure random number generator.
func GetInvoiceMetadata ¶ added in v0.9.0
func GetRecoveryCodeVersion ¶
GetRecoveryCodeVersion returns the version for the recovery code given. If no version can be recognized, it returns an error.
func KeyEncrypt ¶
func KeyEncrypt(privKey *HDPrivateKey, passphrase string) (string, error)
KeyEncrypt encrypts an HD priv key using a user-provided secret into a string We use SCrypt256 for key derivation and AES-CBC-PKCS7 for encryption. The returned string has information about version, derivation path, scrypt and AES parameters.
func LNURLValidate ¶ added in v0.9.0
func LNURLWithdraw ¶ added in v0.9.0
func LNURLWithdraw(invoiceBuilder *InvoiceBuilder, qr string, listener LNURLListener)
Withdraw will parse an LNURL withdraw QR and begin a withdraw process. Caller must wait for the actual payment after this function has notified success.
func PersistInvoiceSecrets ¶
func PersistInvoiceSecrets(list *InvoiceSecretsList) error
PersistInvoiceSecrets stores secrets registered with the remote server in the device local database. These secrets can be used to craft new Lightning invoices.
func SignWithPrivateKey ¶ added in v0.9.0
func SignWithPrivateKey(key *HDPrivateKey, data []byte) ([]byte, error)
func ValidateRecoveryCode ¶
ValidateRecoveryCode returns an error if the recovery code is not valid or nil otherwise.
func ValidateSubmarineSwap ¶
func ValidateSubmarineSwap(rawInvoice string, userPublicKey *HDPublicKey, muunPublicKey *HDPublicKey, swap SubmarineSwap, originalExpirationInBlocks int64, network *Network) error
Types ¶
type BestRouteFees ¶
type BestRouteFeesList ¶
type BestRouteFeesList struct {
// contains filtered or unexported fields
}
func (*BestRouteFeesList) Add ¶
func (l *BestRouteFeesList) Add(f *BestRouteFees)
type ChallengePrivateKey ¶
type ChallengePrivateKey struct {
// contains filtered or unexported fields
}
func NewChallengePrivateKey ¶
func NewChallengePrivateKey(input, salt []byte) *ChallengePrivateKey
func RecoveryCodeToKey ¶
func RecoveryCodeToKey(code, salt string) (*ChallengePrivateKey, error)
RecoveryCodeToKey generates a challenge private key using the recovery code as a seed.
The salt parameter is only used for version 1 codes. It will be ignored for version 2+ codes.
func (*ChallengePrivateKey) DecryptKey ¶
func (k *ChallengePrivateKey) DecryptKey(decodedInfo *EncryptedPrivateKeyInfo, network *Network) (*DecryptedPrivateKey, error)
func (*ChallengePrivateKey) DecryptRawKey ¶
func (k *ChallengePrivateKey) DecryptRawKey(encryptedKey string, network *Network) (*DecryptedPrivateKey, error)
func (*ChallengePrivateKey) PubKey ¶
func (k *ChallengePrivateKey) PubKey() *ChallengePublicKey
func (*ChallengePrivateKey) PubKeyHex ¶
func (k *ChallengePrivateKey) PubKeyHex() string
type ChallengePublicKey ¶
type ChallengePublicKey struct {
// contains filtered or unexported fields
}
func NewChallengePublicKeyFromSerialized ¶
func NewChallengePublicKeyFromSerialized(serializedKey []byte) (*ChallengePublicKey, error)
func (*ChallengePublicKey) EncryptKey ¶
func (k *ChallengePublicKey) EncryptKey(privKey *HDPrivateKey, recoveryCodeSalt []byte, birthday int) (string, error)
type DecryptOperation ¶ added in v0.9.0
type DecryptOperation struct {
// contains filtered or unexported fields
}
func NewDecryptOperation ¶ added in v0.9.0
func NewDecryptOperation(key *HDPrivateKey, payload string) *DecryptOperation
func NewDecryptOperationFrom ¶ added in v0.9.0
func NewDecryptOperationFrom(sender *PublicKey, key *HDPrivateKey, payload string) *DecryptOperation
func (*DecryptOperation) Decrypt ¶ added in v0.9.0
func (o *DecryptOperation) Decrypt() ([]byte, error)
type DecryptedKey ¶
type DecryptedKey struct { Key *HDPrivateKey Path string }
func KeyDecrypt ¶
func KeyDecrypt(value, passphrase string, network *Network) (*DecryptedKey, error)
KeyDecrypt decrypts a key encrypted with KeyEncrypt
type DecryptedPrivateKey ¶
type DecryptedPrivateKey struct { Key *HDPrivateKey Birthday int }
type EKInput ¶
type EKInput struct { FirstEncryptedKey string FirstFingerprint string SecondEncryptedKey string SecondFingerprint string }
EKInput input struct to fill the PDF
type EKOutput ¶
EKOutput with the html as string and the verification code
func GenerateEmergencyKitHTML ¶
GenerateEmergencyKitHTML returns the translated html as a string along with the verification code and the kit metadata, represented in an opaque string. After calling this method, clients should use their Chromium/WebKit implementations to render the HTML into a PDF (better done there), and then come back to call `AddEmergencyKitMetadata` and produce the final PDF (better done here).
type EncryptOperation ¶ added in v0.9.0
type EncryptOperation struct {
// contains filtered or unexported fields
}
func NewEncryptOperation ¶ added in v0.9.0
func NewEncryptOperation(key *HDPrivateKey, payload []byte) *EncryptOperation
func (*EncryptOperation) Encrypt ¶ added in v0.9.0
func (o *EncryptOperation) Encrypt() (string, error)
type EncryptedPrivateKeyInfo ¶
type EncryptedPrivateKeyInfo struct { Version int Birthday int EphPublicKey string CipherText string Salt string }
EncryptedPrivateKeyInfo is a Gomobile-compatible version of EncryptedPrivateKey using hex-encoding.
func DecodeEncryptedPrivateKey ¶
func DecodeEncryptedPrivateKey(encodedKey string) (*EncryptedPrivateKeyInfo, error)
type FundingOutputPolicies ¶
type HDPrivateKey ¶
HDPrivateKey is an HD capable priv key
func NewHDPrivateKey ¶
func NewHDPrivateKey(seed []byte, network *Network) (*HDPrivateKey, error)
NewHDPrivateKey builds an HD priv key from a seed for a given network
func NewHDPrivateKeyFromBytes ¶
func NewHDPrivateKeyFromBytes(rawKey, chainCode []byte, network *Network) (*HDPrivateKey, error)
NewHDPrivateKeyFromBytes builds an HD priv key from the compress priv and chain code for a given network
func NewHDPrivateKeyFromString ¶
func NewHDPrivateKeyFromString(str, path string, network *Network) (*HDPrivateKey, error)
NewHDPrivateKeyFromString creates an HD priv key from a base58-encoded string If the parsed key is public, it returns an error
func (*HDPrivateKey) Decrypter ¶
func (p *HDPrivateKey) Decrypter() Decrypter
func (*HDPrivateKey) DecrypterFrom ¶
func (p *HDPrivateKey) DecrypterFrom(senderKey *PublicKey) Decrypter
func (*HDPrivateKey) DeriveTo ¶
func (p *HDPrivateKey) DeriveTo(path string) (*HDPrivateKey, error)
func (*HDPrivateKey) DerivedAt ¶
func (p *HDPrivateKey) DerivedAt(index int64, hardened bool) (*HDPrivateKey, error)
DerivedAt derives a new child priv key, which may be hardened index should be uint32 but for java compat we use int64
func (*HDPrivateKey) Encrypter ¶
func (p *HDPrivateKey) Encrypter() Encrypter
func (*HDPrivateKey) EncrypterTo ¶
func (p *HDPrivateKey) EncrypterTo(receiver *HDPublicKey) Encrypter
func (*HDPrivateKey) PublicKey ¶
func (p *HDPrivateKey) PublicKey() *HDPublicKey
PublicKey returns the matching pub key
func (*HDPrivateKey) Sign ¶
func (p *HDPrivateKey) Sign(data []byte) ([]byte, error)
Sign a payload using the backing EC key
func (*HDPrivateKey) String ¶
func (p *HDPrivateKey) String() string
String return the key base58-encoded
type HDPublicKey ¶
HDPublicKey is an HD capable pub key
func NewHDPublicKeyFromString ¶
func NewHDPublicKeyFromString(str, path string, network *Network) (*HDPublicKey, error)
NewHDPublicKeyFromString creates an HD pub key from a base58-encoded string If the parsed key is private, it returns an error
func (*HDPublicKey) DeriveTo ¶
func (p *HDPublicKey) DeriveTo(path string) (*HDPublicKey, error)
func (*HDPublicKey) DerivedAt ¶
func (p *HDPublicKey) DerivedAt(index int64) (*HDPublicKey, error)
DerivedAt derives a new child pub key index should be uint32 but for java compat we use int64
func (*HDPublicKey) Fingerprint ¶
func (p *HDPublicKey) Fingerprint() []byte
Fingerprint returns the 4-byte fingerprint for this pubkey
func (*HDPublicKey) Raw ¶
func (p *HDPublicKey) Raw() []byte
Raw returns the backing EC compressed raw key
func (*HDPublicKey) String ¶
func (p *HDPublicKey) String() string
String return the key base58-encoded
type IncomingSwap ¶
type IncomingSwap struct { Htlc *IncomingSwapHtlc SphinxPacket []byte PaymentHash []byte PaymentAmountSat int64 CollectSat int64 }
func (*IncomingSwap) Fulfill ¶ added in v0.9.0
func (s *IncomingSwap) Fulfill( data *IncomingSwapFulfillmentData, userKey *HDPrivateKey, muunKey *HDPublicKey, net *Network) (*IncomingSwapFulfillmentResult, error)
Fulfill validates and creates a fulfillment tx for the incoming swap. It returns the fullfillment tx and the preimage.
func (*IncomingSwap) FulfillFullDebt ¶ added in v0.9.0
func (s *IncomingSwap) FulfillFullDebt() (*IncomingSwapFulfillmentResult, error)
FulfillFullDebt gives the preimage matching a payment hash if we have it
func (*IncomingSwap) VerifyFulfillable ¶ added in v0.9.0
func (s *IncomingSwap) VerifyFulfillable(userKey *HDPrivateKey, net *Network) error
VerifyFulfillable checks that an incoming swap is fulfillable.
type IncomingSwapFulfillmentData ¶ added in v0.9.0
type IncomingSwapFulfillmentResult ¶ added in v0.9.0
type IncomingSwapHtlc ¶ added in v0.9.0
type Input ¶
type Input interface { OutPoint() Outpoint Address() MuunAddress UserSignature() []byte MuunSignature() []byte SubmarineSwapV1() InputSubmarineSwapV1 SubmarineSwapV2() InputSubmarineSwapV2 IncomingSwap() InputIncomingSwap MuunPublicNonce() []byte }
type InputIncomingSwap ¶
type InputSubmarineSwapV1 ¶
type InputSubmarineSwapV2 ¶
type IntList ¶ added in v0.9.0
type IntList struct {
// contains filtered or unexported fields
}
func NewIntList ¶ added in v0.9.0
func NewIntList() *IntList
type Invoice ¶
type Invoice struct { RawInvoice string FallbackAddress *MuunPaymentURI Network *Network MilliSat string Destination []byte PaymentHash []byte Expiry int64 Description string Sats int64 }
Invoice is muun's invoice struct
type InvoiceBuilder ¶ added in v0.11.0
type InvoiceBuilder struct {
// contains filtered or unexported fields
}
func (*InvoiceBuilder) AddRouteHints ¶ added in v0.11.0
func (i *InvoiceBuilder) AddRouteHints(routeHints *RouteHints) *InvoiceBuilder
func (*InvoiceBuilder) AmountMSat ¶ added in v0.11.0
func (i *InvoiceBuilder) AmountMSat(amountMSat int64) *InvoiceBuilder
func (*InvoiceBuilder) AmountSat ¶ added in v0.11.0
func (i *InvoiceBuilder) AmountSat(amountSat int64) *InvoiceBuilder
func (*InvoiceBuilder) Build ¶ added in v0.11.0
func (i *InvoiceBuilder) Build() (string, error)
func (*InvoiceBuilder) Description ¶ added in v0.11.0
func (i *InvoiceBuilder) Description(description string) *InvoiceBuilder
func (*InvoiceBuilder) Metadata ¶ added in v0.11.0
func (i *InvoiceBuilder) Metadata(metadata *OperationMetadata) *InvoiceBuilder
func (*InvoiceBuilder) Network ¶ added in v0.11.0
func (i *InvoiceBuilder) Network(net *Network) *InvoiceBuilder
func (*InvoiceBuilder) UserKey ¶ added in v0.11.0
func (i *InvoiceBuilder) UserKey(userKey *HDPrivateKey) *InvoiceBuilder
type InvoiceOptions ¶
type InvoiceOptions struct { Description string AmountSat int64 // deprecated AmountMSat int64 Metadata *OperationMetadata }
InvoiceOptions defines additional options that can be configured when creating a new invoice.
type InvoiceSecrets ¶
type InvoiceSecrets struct { PaymentHash []byte IdentityKey *HDPublicKey UserHtlcKey *HDPublicKey MuunHtlcKey *HDPublicKey ShortChanId int64 // contains filtered or unexported fields }
InvoiceSecrets represents a bundle of secrets required to generate invoices from the client. These secrets must be registered with the remote server and persisted in the client database before use.
type InvoiceSecretsList ¶
type InvoiceSecretsList struct {
// contains filtered or unexported fields
}
InvoiceSecretsList is a wrapper around an InvoiceSecrets slice to be able to pass through the gomobile bridge.
func GenerateInvoiceSecrets ¶
func GenerateInvoiceSecrets(userKey, muunKey *HDPublicKey) (*InvoiceSecretsList, error)
GenerateInvoiceSecrets returns a slice of new secrets to register with the remote server. Once registered, those invoices should be stored with the PersistInvoiceSecrets method.
func (*InvoiceSecretsList) Get ¶
func (l *InvoiceSecretsList) Get(i int) *InvoiceSecrets
Get returns the secret at the given index.
func (*InvoiceSecretsList) Length ¶
func (l *InvoiceSecretsList) Length() int
Length returns the number of secrets in the list.
type LNURLEvent ¶ added in v0.9.0
type LNURLEvent struct { Code int Message string Metadata *LNURLEventMetadata }
type LNURLEventMetadata ¶ added in v0.9.0
type LNURLListener ¶ added in v0.9.0
type LNURLListener interface { OnUpdate(e *LNURLEvent) OnError(e *LNURLEvent) }
type Listener ¶
type Listener interface {
OnDataChanged(tag string)
}
Listener is an interface implemented by the apps to receive notifications of data changes from the libwallet code. Each change is reported with a string tag identifying the type of change.
type MusigNonces ¶ added in v0.9.0
type MusigNonces struct {
// contains filtered or unexported fields
}
func GenerateMusigNonces ¶ added in v0.9.0
func GenerateMusigNonces(count int) *MusigNonces
func (*MusigNonces) GetPubnonceHex ¶ added in v0.9.0
func (m *MusigNonces) GetPubnonceHex(index int) string
type MuunAddress ¶
func CreateAddressV1 ¶
func CreateAddressV1(publicKey *HDPublicKey) (MuunAddress, error)
CreateAddressV1 returns a P2PKH MuunAddress from a publicKey for use in TransactionSchemeV1
func CreateAddressV2 ¶
func CreateAddressV2(userKey, muunKey *HDPublicKey) (MuunAddress, error)
func CreateAddressV3 ¶
func CreateAddressV3(userKey, muunKey *HDPublicKey) (MuunAddress, error)
func CreateAddressV4 ¶
func CreateAddressV4(userKey, muunKey *HDPublicKey) (MuunAddress, error)
CreateAddressV4 returns a P2WSH MuunAddress from a user HD-pubkey and a Muun co-signing HD-pubkey.
func CreateAddressV5 ¶ added in v0.9.0
func CreateAddressV5(userKey, muunKey *HDPublicKey) (MuunAddress, error)
CreateAddressV5 returns a P2TR MuunAddress using Musig with the signing and cosigning keys.
type MuunPaymentURI ¶
type MuunPaymentURI struct { Address string Label string Message string Amount string Uri string Bip70Url string CreationTime string ExpiresTime string Invoice *Invoice }
MuunPaymentURI is muun's uri struct
func DoPaymentRequestCall ¶
func DoPaymentRequestCall(url string, network *Network) (*MuunPaymentURI, error)
DoPaymentRequestCall builds a MuunPaymentUri from a url and a network. Handling BIP70 to 72
func GetPaymentURI ¶
func GetPaymentURI(rawInput string, network *Network) (*MuunPaymentURI, error)
GetPaymentURI builds a MuunPaymentURI from text (Bitcoin Uri, Muun Uri or address) and a network
type Network ¶
type Network struct {
// contains filtered or unexported fields
}
Network has the parameters for operating in a given Bitcoin network
type OperationMetadata ¶ added in v0.9.0
type Output ¶
type Output struct { Amount uint64 `protobuf:"varint,1,opt,name=amount,proto3" json:"amount,omitempty"` // amount is integer-number-of-satoshis Script []byte `protobuf:"bytes,2,opt,name=script,proto3" json:"script,omitempty"` // usually one of the standard Script forms // contains filtered or unexported fields }
Generalized form of "send payment to this/these bitcoin addresses"
func (*Output) Descriptor
deprecated
func (*Output) ProtoMessage ¶
func (*Output) ProtoMessage()
func (*Output) ProtoReflect ¶
func (x *Output) ProtoReflect() protoreflect.Message
type PartiallySignedTransaction ¶
type PartiallySignedTransaction struct {
// contains filtered or unexported fields
}
func NewPartiallySignedTransaction ¶
func NewPartiallySignedTransaction( inputs *InputList, rawTx []byte, nonces *MusigNonces, ) (*PartiallySignedTransaction, error)
func (*PartiallySignedTransaction) FullySign ¶
func (p *PartiallySignedTransaction) FullySign(userKey, muunKey *HDPrivateKey) (*Transaction, error)
func (*PartiallySignedTransaction) Sign ¶
func (p *PartiallySignedTransaction) Sign(userKey *HDPrivateKey, muunKey *HDPublicKey) (*Transaction, error)
func (*PartiallySignedTransaction) Verify ¶
func (p *PartiallySignedTransaction) Verify(expectations *SigningExpectations, userPublicKey *HDPublicKey, muunPublickKey *HDPublicKey) error
type Payment ¶
type Payment struct { MerchantData []byte `protobuf:"bytes,1,opt,name=merchant_data,json=merchantData,proto3" json:"merchant_data,omitempty"` // From PaymentDetails.merchant_data Transactions [][]byte `protobuf:"bytes,2,rep,name=transactions,proto3" json:"transactions,omitempty"` // Signed transactions that satisfy PaymentDetails.outputs RefundTo []*Output `protobuf:"bytes,3,rep,name=refund_to,json=refundTo,proto3" json:"refund_to,omitempty"` // Where to send refunds, if a refund is necessary Memo string `protobuf:"bytes,4,opt,name=memo,proto3" json:"memo,omitempty"` // Human-readable message for the merchant // contains filtered or unexported fields }
func (*Payment) Descriptor
deprecated
func (*Payment) GetRefundTo ¶ added in v0.11.0
func (*Payment) GetTransactions ¶ added in v0.11.0
func (*Payment) ProtoMessage ¶
func (*Payment) ProtoMessage()
func (*Payment) ProtoReflect ¶
func (x *Payment) ProtoReflect() protoreflect.Message
type PaymentACK ¶
type PaymentACK struct { Payment *Payment `protobuf:"bytes,1,opt,name=payment,proto3" json:"payment,omitempty"` // Payment message that triggered this ACK Memo string `protobuf:"bytes,2,opt,name=memo,proto3" json:"memo,omitempty"` // human-readable message for customer // contains filtered or unexported fields }
func (*PaymentACK) Descriptor
deprecated
func (*PaymentACK) Descriptor() ([]byte, []int)
Deprecated: Use PaymentACK.ProtoReflect.Descriptor instead.
func (*PaymentACK) ProtoMessage ¶
func (*PaymentACK) ProtoMessage()
func (*PaymentACK) ProtoReflect ¶
func (x *PaymentACK) ProtoReflect() protoreflect.Message
func (*PaymentACK) Reset ¶
func (x *PaymentACK) Reset()
func (*PaymentACK) String ¶
func (x *PaymentACK) String() string
type PaymentDetails ¶
type PaymentDetails struct { Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` // "main" or "test" Outputs []*Output `protobuf:"bytes,2,rep,name=outputs,proto3" json:"outputs,omitempty"` // Where payment should be sent Time uint64 `protobuf:"varint,3,opt,name=time,proto3" json:"time,omitempty"` // Timestamp; when payment request created Expires uint64 `protobuf:"varint,4,opt,name=expires,proto3" json:"expires,omitempty"` // Timestamp; when this request should be considered invalid Memo string `protobuf:"bytes,5,opt,name=memo,proto3" json:"memo,omitempty"` // Human-readable description of request for the customer PaymentUrl string `protobuf:"bytes,6,opt,name=payment_url,json=paymentUrl,proto3" json:"payment_url,omitempty"` // URL to send Payment and get PaymentACK MerchantData []byte `protobuf:"bytes,7,opt,name=merchant_data,json=merchantData,proto3" json:"merchant_data,omitempty"` // Arbitrary data to include in the Payment message // contains filtered or unexported fields }
func (*PaymentDetails) Descriptor
deprecated
func (*PaymentDetails) Descriptor() ([]byte, []int)
Deprecated: Use PaymentDetails.ProtoReflect.Descriptor instead.
func (*PaymentDetails) GetExpires ¶ added in v0.11.0
func (x *PaymentDetails) GetExpires() uint64
func (*PaymentDetails) GetOutputs ¶ added in v0.11.0
func (x *PaymentDetails) GetOutputs() []*Output
func (*PaymentDetails) GetTime ¶ added in v0.11.0
func (x *PaymentDetails) GetTime() uint64
func (*PaymentDetails) ProtoMessage ¶
func (*PaymentDetails) ProtoMessage()
func (*PaymentDetails) ProtoReflect ¶
func (x *PaymentDetails) ProtoReflect() protoreflect.Message
func (*PaymentDetails) Reset ¶
func (x *PaymentDetails) Reset()
func (*PaymentDetails) String ¶
func (x *PaymentDetails) String() string
type PaymentRequest ¶
type PaymentRequest struct { PaymentDetailsVersion uint32 `` /* 127-byte string literal not displayed */ PkiType string `protobuf:"bytes,2,opt,name=pki_type,json=pkiType,proto3" json:"pki_type,omitempty"` // none / x509+sha256 / x509+sha1 PkiData []byte `protobuf:"bytes,3,opt,name=pki_data,json=pkiData,proto3" json:"pki_data,omitempty"` // depends on pki_type SerializedPaymentDetails []byte `` // PaymentDetails /* 135-byte string literal not displayed */ Signature []byte `protobuf:"bytes,5,opt,name=signature,proto3" json:"signature,omitempty"` // pki-dependent signature // contains filtered or unexported fields }
func (*PaymentRequest) Descriptor
deprecated
func (*PaymentRequest) Descriptor() ([]byte, []int)
Deprecated: Use PaymentRequest.ProtoReflect.Descriptor instead.
func (*PaymentRequest) GetPaymentDetailsVersion ¶ added in v0.11.0
func (x *PaymentRequest) GetPaymentDetailsVersion() uint32
func (*PaymentRequest) ProtoMessage ¶
func (*PaymentRequest) ProtoMessage()
func (*PaymentRequest) ProtoReflect ¶
func (x *PaymentRequest) ProtoReflect() protoreflect.Message
func (*PaymentRequest) Reset ¶
func (x *PaymentRequest) Reset()
func (*PaymentRequest) String ¶
func (x *PaymentRequest) String() string
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
func NewPublicKeyFromBytes ¶
type RouteHints ¶
type RouteHints struct { Pubkey string FeeBaseMsat int64 FeeProportionalMillionths int64 CltvExpiryDelta int32 }
RouteHints is a struct returned by the remote server containing the data necessary for constructing an invoice locally.
type SigningExpectations ¶
type SigningExpectations struct {
// contains filtered or unexported fields
}
func NewSigningExpectations ¶
func NewSigningExpectations(destination string, amount int64, change MuunAddress, fee int64) *SigningExpectations
type StringList ¶ added in v0.9.0
type StringList struct {
// contains filtered or unexported fields
}
func NewStringList ¶ added in v0.9.0
func NewStringList() *StringList
func NewStringListWithElements ¶ added in v0.10.0
func NewStringListWithElements(elems []string) *StringList
func (*StringList) Add ¶ added in v0.9.0
func (l *StringList) Add(s string)
func (*StringList) Contains ¶ added in v0.9.0
func (l *StringList) Contains(s string) bool
func (*StringList) Get ¶ added in v0.9.0
func (l *StringList) Get(index int) string
func (*StringList) Length ¶ added in v0.9.0
func (l *StringList) Length() int
type SubmarineSwap ¶
type SubmarineSwap interface { Invoice() string Receiver() SubmarineSwapReceiver FundingOutput() SubmarineSwapFundingOutput PreimageInHex() string }
type SubmarineSwapFundingOutput ¶
type SubmarineSwapFundingOutput interface { ScriptVersion() int64 OutputAddress() string OutputAmount() int64 ConfirmationsNeeded() int ServerPaymentHashInHex() string ServerPublicKeyInHex() string UserLockTime() int64 // v1 only UserRefundAddress() MuunAddress // v2 only ExpirationInBlocks() int64 UserPublicKey() *HDPublicKey MuunPublicKey() *HDPublicKey }
type SubmarineSwapReceiver ¶
type SwapFees ¶
type SwapFees struct { RoutingFee int64 SweepFee int64 // TODO: this should be called outputPadding, keeping name for retrocompat for now DebtType string DebtAmount int64 ConfirmationsNeeded int64 }
func ComputeSwapFees ¶
func ComputeSwapFees(amount int64, bestRouteFees *BestRouteFeesList, policies *FundingOutputPolicies) *SwapFees
type Transaction ¶
type UserActivatedFeature ¶ added in v0.9.0
type UserActivatedFeature interface { Blockheight(*Network) int RequiredKitVersion() int BackendFeature() string BackendPreactivationFeature() string }
var UserActivatedFeatureTaproot UserActivatedFeature = &taprootUserActivatedFeature{}
type X509Certificates ¶
type X509Certificates struct { Certificate [][]byte `protobuf:"bytes,1,rep,name=certificate,proto3" json:"certificate,omitempty"` // DER-encoded X.509 certificate chain // contains filtered or unexported fields }
func (*X509Certificates) Descriptor
deprecated
func (*X509Certificates) Descriptor() ([]byte, []int)
Deprecated: Use X509Certificates.ProtoReflect.Descriptor instead.
func (*X509Certificates) GetCertificate ¶ added in v0.11.0
func (x *X509Certificates) GetCertificate() [][]byte
func (*X509Certificates) ProtoMessage ¶
func (*X509Certificates) ProtoMessage()
func (*X509Certificates) ProtoReflect ¶
func (x *X509Certificates) ProtoReflect() protoreflect.Message
func (*X509Certificates) Reset ¶
func (x *X509Certificates) Reset()
func (*X509Certificates) String ¶
func (x *X509Certificates) String() string
Source Files ¶
- V1.go
- V2.go
- V3.go
- V4.go
- V5.go
- address.go
- bip70.pb.go
- bridge.go
- challenge_keys.go
- challenge_public_key.go
- emergency_kit.go
- encodings.go
- encrypt.go
- errors.go
- features.go
- fees.go
- hashes.go
- hdprivatekey.go
- hdpublickey.go
- incoming_swap.go
- init.go
- invoice.go
- invoices.go
- keycrypter.go
- lnurl.go
- network.go
- partiallysignedtransaction.go
- publickey.go
- recoverycode.go
- ripemd160.go
- scrypt.go
- segwit.go
- submarineSwap.go
- submarineSwapV1.go
- submarineSwapV2.go