l402
Version:
L402 client and tools for Javascript.
24 lines • 787 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.AlbyWallet = void 0;
const wallet_1 = require("./wallet");
class AlbyWallet extends wallet_1.Wallet {
constructor(client) {
super();
this.client = client;
}
async payInvoice(invoice) {
try {
const response = await this.client.sendPayment({
invoice: invoice,
});
return new wallet_1.PaymentResult(response.payment_preimage || '', true);
}
catch (error) {
const errorMessage = error instanceof Error ? error.message : String(error);
return new wallet_1.PaymentResult('', false, errorMessage);
}
}
}
exports.AlbyWallet = AlbyWallet;
//# sourceMappingURL=alby.js.map
;