Skip to content

Commit

Permalink
Refactor CLN function signatures (#1726)
Browse files Browse the repository at this point in the history
  • Loading branch information
ekzyis authored Dec 14, 2024
1 parent 3cdfe62 commit 14de23b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/cln.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import crypto from 'crypto'
import { getAgent } from '@/lib/proxy'
import { assertContentTypeJson, assertResponseOk } from './url'

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

const url = `${agent.protocol}//${socket}/v1/invoice`
Expand Down
22 changes: 12 additions & 10 deletions wallets/cln/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@ export const testCreateInvoice = async ({ socket, rune, cert }) => {
}

export const createInvoice = async (
{ msats, description, descriptionHash, expiry },
{ msats, description, expiry },
{ socket, rune, cert }
) => {
const inv = await clnCreateInvoice({
socket,
rune,
cert,
description,
descriptionHash,
msats,
expiry
})
const inv = await clnCreateInvoice(
{
msats,
description,
expiry
},
{
socket,
rune,
cert
})

return inv.bolt11
}

0 comments on commit 14de23b

Please sign in to comment.