Skip to Content
dApp 接入
本页目录

getInfo

获取节点信息以及支持的方法。

方法

declare function getInfo(): Promise<GetInfoResponse>;

响应

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", ... }

示例

const provider = (window.$onekey && window.$onekey.webln) || window.webln; await provider.enable(); const info = await provider.getInfo();

演示

打开示例 

最后更新于