Nwc class

Main entry point for the NWC (Nostr Wallet Connect - NIP47 ) usecase

Constructors

Nwc({required Requests requests, required Broadcast broadcast})
main constructor

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

connect(String uri, {bool doGetInfoMethod = false, dynamic onError(String?)?}) Future<NwcConnection>
Connects to a given nostr+walletconnect:// uri, checking for 13194 event info, and optionally doing a get_info request (default false). It subscribes for notifications
disconnect(NwcConnection connection) → dynamic
Disconnects everything related to this connection, i.e.: closes response & notification subscription and streams
disconnectAll() → dynamic
Disconnects all NWC connections
getBalance(NwcConnection connection) Future<GetBalanceResponse>
Does a get_balance request
getInfo(NwcConnection connection) Future<GetInfoResponse>
Does a get_info request for returning node detailed info
listTransactions(NwcConnection connection, {int? from, int? until, int? limit, int? offset, required bool unpaid, TransactionType? type}) Future<ListTransactionsResponse>
Does a list_transactions request
lookupInvoice(NwcConnection connection, {String? paymentHash, String? invoice}) Future<LookupInvoiceResponse>
Does a lookup_invoice request
makeInvoice(NwcConnection connection, {required int amountSats, String? description, String? descriptionHash, int? expiry}) Future<MakeInvoiceResponse>
Does a make_invoie request
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
payInvoice(NwcConnection connection, {required String invoice}) Future<PayInvoiceResponse>
Does a pay_invoice request
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

NWC_PROTOCOL_PREFIX → const String