Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add lnd wallet calls to get and list onchain addresses #2938

Merged
merged 1 commit into from
Dec 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
}
}
}
Loading