Skip to content

Commit

Permalink
REF: lnurl class to ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Overtorment committed Sep 8, 2024
1 parent a61f8fc commit ff6b412
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions class/lnurl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import bolt11 from 'bolt11';
import createHash from 'create-hash';
import { createHmac } from 'crypto';
import CryptoJS from 'crypto-js';
// @ts-ignore
// @ts-ignore theres no types for secp256k1
import secp256k1 from 'secp256k1';
import { parse } from 'url'; // eslint-disable-line n/no-deprecated-api

Expand Down Expand Up @@ -62,8 +62,8 @@ export default class Lnurl {
private _AsyncStorage: any;
private _preimage: string | false;

constructor(url: string, AsyncStorage?: any) {
this._lnurl = url;
constructor(url: string | false, AsyncStorage?: any) {
this._lnurl = url || '';
this._lnurlPayServiceBolt11Payload = false;
this._lnurlPayServicePayload = false;
this._AsyncStorage = AsyncStorage;
Expand Down
3 changes: 3 additions & 0 deletions screen/lnd/lnurlPaySuccess.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ const LnurlPaySuccess: React.FC = () => {
switch (successAction.tag) {
case 'aes': {
const preimage = lnurl.getPreimage();
if (!preimage) {
break;
}
setMessage(Lnurl.decipherAES(successAction.ciphertext, preimage, successAction.iv));
setPreamble(successAction.description);
break;
Expand Down

0 comments on commit ff6b412

Please sign in to comment.