-
Notifications
You must be signed in to change notification settings - Fork 196
Connector API
Michael Bumann edited this page Mar 25, 2022
·
3 revisions
Currently the connectors roughly implement the WebLN spec. This will change in the future as we will need more functionality and response data internally.
Every connector must implement the following methods. You can find the detailed TypeScript interface here.
none
interface GetInfoResponse = {
alias: string;
pubkey?: string;
color?: string;
}
none
interface GetBalanceResponse = {
balance: number; // in satoshi
}
return {
data: {
balance: data.balance,
},
};
interface SendPaymentParams {
paymentRequest: string;
}
interface SendPaymentResponse {
preimage: string;
paymentHash: string;
route: Route;
}
// TODO capitalize Route attributes (total_amt => totalAmt)
interface Route {
total_amt: string;
total_fees: number;
}
return {
data: {
preimage: data.payment_preimage,
paymentHash: data.payment_hash,
route: data.payment_route,
},
};
interface KeysendArgs {
pubkey: string;
amount: number;
customRecords: Record<string, string>;
}
interface SendPaymentResponse {
preimage: string;
paymentHash: string;
route: Route;
}
// TODO capitalize Route attributes (total_amt => totalAmt)
interface Route {
total_amt: string;
total_fees: number;
}
return {
data: {
preimage: data.payment_preimage,
paymentHash: data.payment_hash,
route: data.payment_route,
},
};
interface MakeInvoiceParams {
amount: number;
memo: string;
}
interface MakeInvoiceResponse {
paymentRequest: string;
rHash: string;
}
- Home
- Bounties
- Calls
- Connector API
- Internationalization i18n (Developer Guide)
- Lightning Monetization meta tag
- Lightning Node Connect
- Making Payment Transactions Smart With Structured Metadata
- Open Design
- Test Setup
- Image Compression Tutorial