Zap splits
This commit is contained in:
@ -92,17 +92,6 @@ export class LNURL {
|
||||
return `${username}@${this.#url.hostname}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a NIP-57 zap tag from this LNURL
|
||||
*/
|
||||
getZapTag() {
|
||||
if (this.isLNAddress) {
|
||||
return ["zap", this.getLNAddress(), "lud16"];
|
||||
} else {
|
||||
return ["zap", this.#url.toString(), "lud06"];
|
||||
}
|
||||
}
|
||||
|
||||
async load() {
|
||||
const rsp = await fetch(this.#url);
|
||||
if (rsp.ok) {
|
||||
|
@ -43,6 +43,10 @@ export function unixNowMs() {
|
||||
return new Date().getTime();
|
||||
}
|
||||
|
||||
export function jitter(n: number) {
|
||||
return n * 2 * Math.random() - n;
|
||||
}
|
||||
|
||||
export function deepClone<T>(obj: T) {
|
||||
if ("structuredClone" in window) {
|
||||
return structuredClone(obj);
|
||||
|
Reference in New Issue
Block a user