Skip to content

Commit 14de23b

Browse files
authored
Refactor CLN function signatures (#1726)
1 parent 3cdfe62 commit 14de23b

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

lib/cln.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import crypto from 'crypto'
33
import { getAgent } from '@/lib/proxy'
44
import { assertContentTypeJson, assertResponseOk } from './url'
55

6-
export const createInvoice = async ({ socket, rune, cert, label, description, msats, expiry }) => {
6+
export const createInvoice = async ({ msats, description, expiry }, { socket, rune, cert }) => {
77
const agent = getAgent({ hostname: socket, cert })
88

99
const url = `${agent.protocol}//${socket}/v1/invoice`

wallets/cln/server.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,20 @@ export const testCreateInvoice = async ({ socket, rune, cert }) => {
77
}
88

99
export const createInvoice = async (
10-
{ msats, description, descriptionHash, expiry },
10+
{ msats, description, expiry },
1111
{ socket, rune, cert }
1212
) => {
13-
const inv = await clnCreateInvoice({
14-
socket,
15-
rune,
16-
cert,
17-
description,
18-
descriptionHash,
19-
msats,
20-
expiry
21-
})
13+
const inv = await clnCreateInvoice(
14+
{
15+
msats,
16+
description,
17+
expiry
18+
},
19+
{
20+
socket,
21+
rune,
22+
cert
23+
})
2224

2325
return inv.bolt11
2426
}

0 commit comments

Comments
 (0)