Replace lightning toolkit with wallet adapter

This commit is contained in:
2026-02-17 19:54:16 +00:00
parent 6e865fef06
commit ce62cafd59
33 changed files with 1364 additions and 120 deletions
+16
View File
@@ -0,0 +1,16 @@
import {isNWCWallet, isWebLNWallet, type Wallet} from "@welshman/util"
import {NWCWallet} from "./NWCWallet"
import {WebLNWallet, getWebLn} from "./WebLNWallet"
import type {IWallet} from "./IWallet"
export const createWalletAdapter = (wallet: Wallet): IWallet => {
if (isNWCWallet(wallet)) {
return new NWCWallet(wallet.info)
}
if (isWebLNWallet(wallet)) {
return new WebLNWallet(getWebLn())
}
throw new Error("Unsupported wallet type")
}