Skip to content

Commit

Permalink
implement getInfo method.
Browse files Browse the repository at this point in the history
  • Loading branch information
fiatjaf committed May 2, 2019
1 parent 667294b commit 5fa7a46
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/interfaces/eclair.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ const fetch = window.fetch
const WebSocket = window.WebSocket
const URLSearchParams = window.URLSearchParams

export function getInfo() {
return rpcCall('getinfo').then(({nodeId, alias}) => ({id: nodeId, alias}))
}

export function summary() {
return Promise.all([
rpcCall('getinfo').then(
Expand Down
4 changes: 4 additions & 0 deletions src/interfaces/lightningd_spark.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import {getRpcParams, normalizeURL} from '../utils'
const fetch = window.fetch
const EventSource = window.EventSource

export function getInfo() {
return rpcCall('getinfo').then(({id, alias, color}) => ({id, alias, color}))
}

export function summary() {
return Promise.all([
rpcCall('getinfo').then(({blockheight, id, alias, color, address}) => {
Expand Down
4 changes: 4 additions & 0 deletions src/interfaces/ptarmigan.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import {getRpcParams, normalizeURL} from '../utils'

const fetch = window.fetch

export function getInfo() {
return rpcCall('getinfo').then(info => ({id: info.node_id}))
}

export function summary() {
return Promise.all([
rpcCall('getinfo'),
Expand Down

0 comments on commit 5fa7a46

Please sign in to comment.