forked from coracle/flotilla
Replace lightning toolkit with wallet adapter
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import {debounce} from "throttle-debounce"
|
||||
import {nwc} from "@getalby/sdk"
|
||||
import {nwc} from "@lib/lightning"
|
||||
import {sleep, assoc} from "@welshman/lib"
|
||||
import type {NWCInfo} from "@welshman/util"
|
||||
import {pubkey, userProfile, updateSession} from "@welshman/app"
|
||||
@@ -33,8 +33,14 @@
|
||||
loading = true
|
||||
|
||||
try {
|
||||
await Promise.all([sleep(800), getWebLn().enable()])
|
||||
const info = await getWebLn().getInfo()
|
||||
const webLn = getWebLn()
|
||||
|
||||
if (!webLn) {
|
||||
throw new Error("WebLN not available")
|
||||
}
|
||||
|
||||
await Promise.all([sleep(800), webLn.enable()])
|
||||
const info = (await webLn.getInfo?.()) || {}
|
||||
|
||||
if (!info?.supports?.includes("lightning")) {
|
||||
pushToast({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import {Invoice} from "@getalby/lightning-tools/bolt11"
|
||||
import {Invoice} from "@lib/lightning/bolt11"
|
||||
import {debounce} from "throttle-debounce"
|
||||
import {session} from "@welshman/app"
|
||||
import Bolt from "@assets/icons/bolt.svg?dataurl"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import {Invoice} from "@getalby/lightning-tools/bolt11"
|
||||
import {Invoice} from "@lib/lightning/bolt11"
|
||||
import AltArrowLeft from "@assets/icons/alt-arrow-left.svg?dataurl"
|
||||
import Bolt from "@assets/icons/bolt.svg?dataurl"
|
||||
import Refresh from "@assets/icons/refresh.svg?dataurl"
|
||||
|
||||
Reference in New Issue
Block a user