Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Request ¶
func (*Client) SubscribeNotifications ¶
func (cl *Client) SubscribeNotifications( c context.Context, handler NotificationHandler, ) (err error)
SubscribeNotifications subscribes to NWC notification events (kinds 23197/23196) and handles them with the provided callback. It maintains a persistent connection with auto-reconnection on disconnect.
type ConnectionParams ¶
type ConnectionParams struct {
// contains filtered or unexported fields
}
func ParseConnectionURI ¶
func ParseConnectionURI(nwcUri string) (parts *ConnectionParams, err error)
func (*ConnectionParams) GetConversationKey ¶
func (c *ConnectionParams) GetConversationKey() []byte
GetConversationKey returns the conversation key from the ConnectionParams.
func (*ConnectionParams) GetWalletPublicKey ¶
func (c *ConnectionParams) GetWalletPublicKey() []byte
GetWalletPublicKey returns the wallet public key from the ConnectionParams.
type MockWalletService ¶
type MockWalletService struct {
// contains filtered or unexported fields
}
MockWalletService implements a mock NIP-47 wallet service for testing
func NewMockWalletService ¶
func NewMockWalletService( relay string, initialBalance int64, ) (service *MockWalletService, err error)
NewMockWalletService creates a new mock wallet service
func (*MockWalletService) GetWalletPublicKey ¶
func (m *MockWalletService) GetWalletPublicKey() []byte
GetWalletPublicKey returns the wallet's public key
func (*MockWalletService) SimulateIncomingPayment ¶
func (m *MockWalletService) SimulateIncomingPayment( pubkey []byte, amount int64, description string, ) (err error)
SimulateIncomingPayment simulates an incoming payment for testing
func (*MockWalletService) Start ¶
func (m *MockWalletService) Start() (err error)
Start begins the mock wallet service
func (*MockWalletService) Stop ¶
func (m *MockWalletService) Stop()
Stop stops the mock wallet service
Source Files
¶
- client.go
- mock_wallet_service.go
- uri.go