Sur cette page
getInfo
Obtenir les informations du nœud et les méthodes prises en charge.
Méthode
declare function getInfo(): Promise<GetInfoResponse>;Réponse
interface GetInfoResponse {
node: {
alias: string;
pubkey: string;
color?: string;
};
// "request.*" methods are not supported by all connectors
// (see webln.request for more info)
methods: string[]; // e.g. "makeInvoice", "sendPayment", "request.openchannel", ...
}Exemple
const provider = (window.$onekey && window.$onekey.webln) || window.webln;
await provider.enable();
const info = await provider.getInfo();Démonstration
Dernière mise à jour le