Documentation
¶
Index ¶
- Variables
- type CancelHoldInvoiceParams
- type Capability
- type Client
- func (cl *Client) CancelHoldInvoice(c context.T, chi *CancelHoldInvoiceParams, noUnmarshal bool) (raw []byte, err error)
- func (cl *Client) CreateConnection(c context.T, cc *CreateConnectionParams, noUnmarshal bool) (raw []byte, err error)
- func (cl *Client) GetBalance(c context.T, noUnmarshal bool) (gb *GetBalanceResult, raw []byte, err error)
- func (cl *Client) GetBudget(c context.T, noUnmarshal bool) (gb *GetBudgetResult, raw []byte, err error)
- func (cl *Client) GetInfo(c context.T, noUnmarshal bool) (gi *GetInfoResult, raw []byte, err error)
- func (cl *Client) GetWalletServiceInfo(c context.T, noUnmarshal bool) (wsi *WalletServiceInfo, raw []byte, err error)
- func (cl *Client) ListTransactions(c context.T, params *ListTransactionsParams, noUnmarshal bool) (lt *ListTransactionsResult, raw []byte, err error)
- func (cl *Client) LookupInvoice(c context.T, params *LookupInvoiceParams, noUnmarshal bool) (li *LookupInvoiceResult, raw []byte, err error)
- func (cl *Client) MakeHoldInvoice(c context.T, mhi *MakeHoldInvoiceParams, noUnmarshal bool) (mi *MakeInvoiceResult, raw []byte, err error)
- func (cl *Client) MakeInvoice(c context.T, params *MakeInvoiceParams, noUnmarshal bool) (mi *MakeInvoiceResult, raw []byte, err error)
- func (cl *Client) PayInvoice(c context.T, params *PayInvoiceParams, noUnmarshal bool) (pi *PayInvoiceResult, raw []byte, err error)
- func (cl *Client) PayKeysend(c context.T, params *PayKeysendParams, noUnmarshal bool) (pk *PayKeysendResult, raw []byte, err error)
- func (cl *Client) RPC(c context.T, method Capability, params, result any, noUnmarshal bool, ...) (raw []byte, err error)
- func (cl *Client) SettleHoldInvoice(c context.T, shi *SettleHoldInvoiceParams, noUnmarshal bool) (raw []byte, err error)
- func (cl *Client) SignMessage(c context.T, sm *SignMessageParams, noUnmarshal bool) (res *SignMessageResult, raw []byte, err error)
- type ConnectionParams
- type CreateConnectionParams
- type EncryptionType
- type GetBalanceResult
- type GetBudgetResult
- type GetInfoResult
- type ListTransactionsParams
- type ListTransactionsResult
- type LookupInvoiceParams
- type LookupInvoiceResult
- type MakeHoldInvoiceParams
- type MakeInvoiceParams
- type MakeInvoiceResult
- type NotificationType
- type PayInvoiceMetadata
- type PayInvoiceParams
- type PayInvoicePayerData
- type PayInvoiceResult
- type PayKeysendParams
- type PayKeysendResult
- type PayKeysendTLVRecord
- type Request
- type Response
- type ResponseError
- type SettleHoldInvoiceParams
- type SignMessageParams
- type SignMessageResult
- type Transaction
- type WalletServiceInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CancelHoldInvoice = Capability("cancel_hold_invoice") CreateConnection = Capability("create_connection") GetBalance = Capability("get_balance") GetBudget = Capability("get_budget") GetInfo = Capability("get_info") ListTransactions = Capability("list_transactions") LookupInvoice = Capability("lookup_invoice") MakeHoldInvoice = Capability("make_hold_invoice") MakeInvoice = Capability("make_invoice") MultiPayInvoice = Capability("multi_pay_invoice") MultiPayKeysend = Capability("multi_pay_keysend") PayInvoice = Capability("pay_invoice") PayKeysend = Capability("pay_keysend") SettleHoldInvoice = Capability("settle_hold_invoice") SignMessage = Capability("sign_message") )
View Source
var ( EncryptionTag = []byte("encryption") Nip04 = EncryptionType("nip04") Nip44V2 = EncryptionType("nip44_v2") )
View Source
var ( PaymentReceived = NotificationType("payment_received") PaymentSent = NotificationType("payment_sent") )
Functions ¶
This section is empty.
Types ¶
type CancelHoldInvoiceParams ¶ added in v0.5.0
type CancelHoldInvoiceParams struct {
PaymentHash string `json:"payment_hash"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CancelHoldInvoice ¶ added in v0.5.0
func (*Client) CreateConnection ¶ added in v0.5.0
func (*Client) GetBalance ¶
func (*Client) GetWalletServiceInfo ¶ added in v0.4.15
func (*Client) ListTransactions ¶
func (cl *Client) ListTransactions( c context.T, params *ListTransactionsParams, noUnmarshal bool, ) (lt *ListTransactionsResult, raw []byte, err error)
func (*Client) LookupInvoice ¶
func (cl *Client) LookupInvoice( c context.T, params *LookupInvoiceParams, noUnmarshal bool, ) (li *LookupInvoiceResult, raw []byte, err error)
func (*Client) MakeHoldInvoice ¶ added in v0.5.0
func (cl *Client) MakeHoldInvoice( c context.T, mhi *MakeHoldInvoiceParams, noUnmarshal bool, ) (mi *MakeInvoiceResult, raw []byte, err error)
func (*Client) MakeInvoice ¶
func (cl *Client) MakeInvoice( c context.T, params *MakeInvoiceParams, noUnmarshal bool, ) (mi *MakeInvoiceResult, raw []byte, err error)
func (*Client) PayInvoice ¶
func (cl *Client) PayInvoice( c context.T, params *PayInvoiceParams, noUnmarshal bool, ) (pi *PayInvoiceResult, raw []byte, err error)
func (*Client) PayKeysend ¶
func (cl *Client) PayKeysend( c context.T, params *PayKeysendParams, noUnmarshal bool, ) (pk *PayKeysendResult, raw []byte, err error)
func (*Client) SettleHoldInvoice ¶ added in v0.5.0
func (*Client) SignMessage ¶
func (cl *Client) SignMessage( c context.T, sm *SignMessageParams, noUnmarshal bool, ) (res *SignMessageResult, raw []byte, err error)
type ConnectionParams ¶ added in v0.4.15
type ConnectionParams struct {
// contains filtered or unexported fields
}
func ParseConnectionURI ¶ added in v0.4.15
func ParseConnectionURI(nwcUri string) (parts *ConnectionParams, err error)
func (*ConnectionParams) GetWalletPublicKey ¶ added in v0.5.0
func (c *ConnectionParams) GetWalletPublicKey() []byte
GetWalletPublicKey returns the wallet public key from the ConnectionParams.
type CreateConnectionParams ¶ added in v0.5.0
type CreateConnectionParams struct {
Pubkey string `json:"pubkey"`
Name string `json:"name"`
RequestMethods []string `json:"request_methods"`
NotificationTypes []string `json:"notification_types"`
MaxAmount *uint64 `json:"max_amount,omitempty"`
BudgetRenewal *string `json:"budget_renewal,omitempty"`
ExpiresAt *int64 `json:"expires_at,omitempty"`
}
type EncryptionType ¶
type EncryptionType []byte
EncryptionType represents the encryption type used for NIP-47 messages
type GetBalanceResult ¶ added in v0.4.15
type GetBalanceResult struct {
Balance uint64 `json:"balance"`
}
type GetBudgetResult ¶ added in v0.5.0
type GetInfoResult ¶ added in v0.4.15
type GetInfoResult struct {
Alias string `json:"alias"`
Color string `json:"color"`
Pubkey string `json:"pubkey"`
Network string `json:"network"`
BlockHeight uint64 `json:"block_height"`
BlockHash string `json:"block_hash"`
Methods []string `json:"methods"`
Notifications []string `json:"notifications,omitempty"`
Metadata any `json:"metadata,omitempty"`
LUD16 string `json:"lud16,omitempty"`
}
type ListTransactionsParams ¶ added in v0.4.15
type ListTransactionsParams struct {
From *int64 `json:"from,omitempty"`
Until *int64 `json:"until,omitempty"`
Limit *uint16 `json:"limit,omitempty"`
Offset *uint32 `json:"offset,omitempty"`
Unpaid *bool `json:"unpaid,omitempty"`
UnpaidOutgoing *bool `json:"unpaid_outgoing,omitempty"`
UnpaidIncoming *bool `json:"unpaid_incoming,omitempty"`
Type *string `json:"type,omitempty"`
}
type ListTransactionsResult ¶ added in v0.4.15
type ListTransactionsResult struct {
Transactions []Transaction `json:"transactions"`
TotalCount uint32 `json:"total_count"`
}
type LookupInvoiceParams ¶ added in v0.4.15
type LookupInvoiceResult ¶ added in v0.4.15
type LookupInvoiceResult = Transaction
type MakeHoldInvoiceParams ¶ added in v0.5.0
type MakeInvoiceParams ¶ added in v0.4.15
type MakeInvoiceResult ¶ added in v0.4.15
type MakeInvoiceResult = Transaction
type NotificationType ¶
type NotificationType []byte
type PayInvoiceMetadata ¶ added in v0.5.0
type PayInvoiceMetadata struct {
Comment *string `json:"comment"`
PayerData *PayInvoicePayerData `json:"payer_data"`
Other any
}
type PayInvoiceParams ¶ added in v0.4.15
type PayInvoiceParams struct {
Invoice string `json:"invoice"`
Amount *uint64 `json:"amount,omitempty"`
Metadata *PayInvoiceMetadata `json:"metadata,omitempty"`
}
type PayInvoicePayerData ¶ added in v0.5.0
type PayInvoiceResult ¶ added in v0.4.15
type PayKeysendParams ¶ added in v0.5.0
type PayKeysendParams struct {
Amount uint64 `json:"amount"`
Pubkey string `json:"pubkey"`
Preimage *string `json:"preimage,omitempty"`
TLVRecords []PayKeysendTLVRecord `json:"tlv_records,omitempty"`
}
type PayKeysendResult ¶ added in v0.5.0
type PayKeysendResult = PayInvoiceResult
type PayKeysendTLVRecord ¶ added in v0.5.0
type Response ¶ added in v0.4.15
type Response struct {
ResultType string `json:"result_type"`
Error *ResponseError `json:"error"`
Result any `json:"result"`
}
type ResponseError ¶ added in v0.4.15
func (*ResponseError) Error ¶ added in v0.4.15
func (err *ResponseError) Error() string
type SettleHoldInvoiceParams ¶ added in v0.5.0
type SettleHoldInvoiceParams struct {
Preimage string `json:"preimage"`
}
type SignMessageParams ¶ added in v0.5.0
type SignMessageParams struct {
Message string `json:"message"`
}
type SignMessageResult ¶ added in v0.5.0
type Transaction ¶
type Transaction struct {
Type string `json:"type"`
State string `json:"state"`
Invoice string `json:"invoice"`
Description string `json:"description"`
DescriptionHash string `json:"description_hash"`
Preimage string `json:"preimage"`
PaymentHash string `json:"payment_hash"`
Amount uint64 `json:"amount"`
FeesPaid uint64 `json:"fees_paid"`
CreatedAt int64 `json:"created_at"`
ExpiresAt int64 `json:"expires_at"`
SettledDeadline *uint64 `json:"settled_deadline,omitempty"`
Metadata any `json:"metadata,omitempty"`
}
type WalletServiceInfo ¶ added in v0.4.15
type WalletServiceInfo struct {
EncryptionTypes []EncryptionType
Capabilities []Capability
NotificationTypes []NotificationType
}
Click to show internal directories.
Click to hide internal directories.