0.3.0 • Published 6 months ago

nutjar.js v0.3.0

Weekly downloads
-
License
-
Repository
-
Last release
6 months ago

nutjar.js

The easiest way to receive permissionless Lightning donations on a website!

Usage

Check out dev.ts for a full example

import { Nutjar } from "./src/main";

const jar = new Nutjar(
  "https://testnut.cashu.space",
  "npub1mhcr4j594hsrnen594d7700n2t03n8gdx83zhxzculk6sh9nhwlq7uc226",
  ["wss://relay.damus.io"],
);

jar.tip(21, "Test tip!", {
  onInvoice: (i) => {
    console.log(i);
  },
  onSuccess: () => {
    console.log("Donation sent!");
  },
  onError: (e: Error) => {
    console.error(e);
  },
});

Installation

nutjar can be installed using a package manager or by loading the bundled version from a CDN

npm

npm i nutjar
0.3.0

6 months ago

0.2.7

7 months ago

0.2.6

7 months ago

0.2.5

7 months ago

0.2.4

7 months ago

0.2.3

7 months ago

0.2.2

7 months ago

0.2.1

7 months ago

0.2.0

7 months ago

0.1.4

7 months ago

0.1.3

7 months ago

0.1.2

7 months ago

0.1.1

7 months ago

0.1.0

7 months ago