Skip to content

Commit

Permalink
chore: minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rolznz committed Nov 18, 2023
1 parent 51d7624 commit d172ac9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/zaps-nwc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { webln } from "alby-js-sdk";
import "websocket-polyfill";
import * as crypto from "crypto";
import { finishEvent, getPublicKey } from "nostr-tools";
/*global globalThis*/
globalThis.crypto = crypto;

// your private key is required to sign zap request events
Expand Down
7 changes: 7 additions & 0 deletions src/podcasting2/boostagrams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ export const boost = async (args: BoostArguments, options?: BoostOptions) => {
}
const webln: WebLNProvider = options.webln || globalThis.webln;

if (!webln) {
throw new Error("WebLN not available");
}
if (!webln.keysend) {
throw new Error("Keysend not available in current WebLN provider");
}

const amount = args.amount || Math.floor(boost.value_msat / 1000);

const weblnParams: WeblnBoostParams = {
Expand Down

0 comments on commit d172ac9

Please sign in to comment.