Skip to content

Commit

Permalink
feat: add lnd wallet calls to get and list onchain addresses (#2938)
Browse files Browse the repository at this point in the history
  • Loading branch information
bumi authored Dec 17, 2023
1 parent ec419a5 commit e9232a4
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/extension/background-script/connectors/lnc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ const methods: Record<string, string> = {
sendtoroute: "lnd.lightning.SendToRouteSync",
verifymessage: "lnd.lightning.VerifyMessage",
walletbalance: "lnd.lightning.WalletBalance",
newaddress: "lnd.lightning.NewAddress",
nextaddr: "lnd.walletKit.nextAddr",
listaddresses: "lnd.walletKit.ListAddresses",
listunspent: "lnd.walletKit.ListUnspent",
};

const DEFAULT_SERVER_HOST = "mailbox.terminal.lightning.today:443";
Expand Down
16 changes: 16 additions & 0 deletions src/extension/background-script/connectors/lnd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,22 @@ const methods: Record<string, Record<string, string>> = {
path: "/v2/invoices/settle",
httpMethod: "POST",
},
newaddress: {
path: "/v1/newaddress",
httpMethod: "GET",
},
nextaddr: {
path: "/v2/wallet/address/next",
httpMethod: "POST",
},
listaddresses: {
path: "/v2/wallet/addresses",
httpMethod: "GET",
},
listunspent: {
path: "/v2/wallet/utxos",
httpMethod: "POST",
},
};

const pathTemplateParser = (
Expand Down
12 changes: 10 additions & 2 deletions src/i18n/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,11 @@
"routermc": "Read the internal mission control state",
"addinvoice": "Create new invoices",
"addholdinvoice": "Create new HODL invoices",
"settleinvoice": "Settle an accepted invoice"
"settleinvoice": "Settle an accepted invoice",
"newaddress": "Get a new onchain address",
"nextaddr": "Get the next unused address within the wallet",
"listaddresses": "Get all the addresses along with their balance",
"listunspent": "Get a list of all utxos spendable by the wallet"
},
"lnc": {
"getinfo": "Get the node information",
Expand All @@ -1237,7 +1241,11 @@
"routermc": "Read the internal mission control state",
"addinvoice": "Create new invoices",
"addholdinvoice": "Create new HODL invoices",
"settleinvoice": "Settle an accepted invoice"
"settleinvoice": "Settle an accepted invoice",
"newaddress": "Get a new onchain address",
"nextaddr": "Get the next unused onchain address within the wallet",
"listaddresses": "Get all the onchain addresses along with their balance",
"listunspent": "Get a list of all utxos spendable by the wallet"
}
}
}

0 comments on commit e9232a4

Please sign in to comment.