Update README.md
This commit is contained in:
1 parent
c4ac3c13dc
commit
4b4d9991ea
1 file changed
+7
-7
@@ -5,7 +5,7 @@ A vanilla javascript library for working with Nostr Wallet Connect and zaps
|
||||
|
||||
Note that nwc_info objects are also stored in nwcjs.nwc_objs so you can manage more than one NWC connection
|
||||
|
||||
```
|
||||
```javascript
|
||||
var nwc_info = nwcjs.processNWCstring( "nostr+walletconnect://2fbe00e6698e717593febba15a68c37de13869b5c304cb8448fa3c541f8620c4?relay=wss://example.relay.com&secret=370d89b58cb4c38fccd4bba520fbbd9397f3682547b66b23a9a6888fef021038&lud16=example@lightning.com" );
|
||||
```
|
||||
|
||||
@@ -13,7 +13,7 @@ var nwc_info = nwcjs.processNWCstring( "nostr+walletconnect://2fbe00e6698e717593
|
||||
|
||||
If there is an error, consider increasing your delay tolerance from 3 seconds to 5 or so
|
||||
|
||||
```
|
||||
```javascript
|
||||
var amnt = 100;
|
||||
var desc = "hello world!";
|
||||
var delay_tolerance = 3;
|
||||
@@ -24,7 +24,7 @@ var invoice_info = await nwcjs.makeInvoice( nwc_info, amnt, desc, delay_toleranc
|
||||
|
||||
If there is an error, consider increasing your delay tolerance from 3 seconds to 5 or so
|
||||
|
||||
```
|
||||
```javascript
|
||||
var invoice = "lntb2500n1pwxlkl5pp5g8hz28tlf950ps942lu3dknfete8yax2ctywpwjs872x9kngvvuqdqage5hyum5yp6x2um5yp5kuan0d93k2cqzyskdc5s2ltgm9kklz42x3e4tggdd9lcep2s9t2yk54gnfxg48wxushayrt52zjmua43gdnxmuc5s0c8g29ja9vnxs6x3kxgsha07htcacpmdyl64";
|
||||
var delay_tolerance = 3;
|
||||
var invoice_info = await nwcjs.checkInvoice( nwc_info, invoice, delay_tolerance );
|
||||
@@ -36,7 +36,7 @@ This method will return false if a payment did not succeed yet. If the payment d
|
||||
|
||||
If there is an error, consider increasing your delay tolerance from 3 seconds to 5 or so
|
||||
|
||||
```
|
||||
```javascript
|
||||
var invoice = "lntb2500n1pwxlkl5pp5g8hz28tlf950ps942lu3dknfete8yax2ctywpwjs872x9kngvvuqdqage5hyum5yp6x2um5yp5kuan0d93k2cqzyskdc5s2ltgm9kklz42x3e4tggdd9lcep2s9t2yk54gnfxg48wxushayrt52zjmua43gdnxmuc5s0c8g29ja9vnxs6x3kxgsha07htcacpmdyl64";
|
||||
var delay_tolerance = 3;
|
||||
var invoice_info = await nwcjs.didPaymentSucceed( nwc_info, invoice, delay_tolerance );
|
||||
@@ -48,7 +48,7 @@ Originally this library had a method called nwcjs.payInvoice() instead of nwcjs.
|
||||
|
||||
If the invoice you're paying is amountless, add an amount to your payment by modifying the variable `var amnt`.
|
||||
|
||||
```
|
||||
```javascript
|
||||
var invoice = "lntb2500n1pwxlkl5pp5g8hz28tlf950ps942lu3dknfete8yax2ctywpwjs872x9kngvvuqdqage5hyum5yp6x2um5yp5kuan0d93k2cqzyskdc5s2ltgm9kklz42x3e4tggdd9lcep2s9t2yk54gnfxg48wxushayrt52zjmua43gdnxmuc5s0c8g29ja9vnxs6x3kxgsha07htcacpmdyl64";
|
||||
var amnt = null;
|
||||
await nwcjs.tryToPayInvoice( nwc_info, invoice, amnt );
|
||||
@@ -58,7 +58,7 @@ await nwcjs.tryToPayInvoice( nwc_info, invoice, amnt );
|
||||
|
||||
This method takes a lightning address and amount of sats as input and returns a lightning invoice and a checking id. You can also optionally specify a list of one or more relays where you want the recipient of the funds to send their zap receipt to. By default, it requests all receipts to be sent to just one relay, nostrue.com.
|
||||
|
||||
```
|
||||
```javascript
|
||||
var lnaddy = "supertestnet@stacker.news";
|
||||
var amount = 500;
|
||||
var relays = ["wss://nostrue.com"];
|
||||
@@ -69,7 +69,7 @@ var [ invoice, checking_id ] = await nwcjs.getZapRequest( lnaddy, amount, relays
|
||||
|
||||
This method takes a lightning invoice and checking id as input and returns either the string "not paid yet" or the zap receipt provided by the recipient of the funds. You can also specify a list of one or more relays where you expect the recipient of the funds to send their zap receipt to. By default, it listens for all zap receipts on just one relay, nostrue.com.
|
||||
|
||||
```
|
||||
```javascript
|
||||
var invoice = "lnbc5u1pn9702rpp5f4llv47d5twpzyguv2ja7dmterschk5ee33e25qhgmc3vr9ttdgqdpuge6kuerfdenjqsrnw4cx2un5v4ehgmn9wssx7m3qwd6xzcmtv4ezumn9waescqzzsxqrrsssp5ss0vw8je6jclg2yzvjxwf5u94ay9dzj0ef40jv6m668247553d9q9qyyssqv7ehg6mal8y8ldhq2aflhmetdhghkxw0xndtprls85qeuve57cxzaaty9zllk7c2c4hn99azsnkc9hr44zvzzq36rcpapgyv4qcw7pspt5yct5";
|
||||
var checking_id = "412e821f8f821402dc9e8e8ce1f1e8203beba95a52807e8102c40d1a42130858";
|
||||
var relays = ["wss://nostrue.com"];
|
||||
|
||||
Reference in new issue
Block a user