Refactor CLN function signatures (#1726)

This commit is contained in:
ekzyis 2024-12-14 17:32:51 +01:00 committed by GitHub
parent 3cdfe620d0
commit 14de23b21d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 11 deletions

View File

@ -3,7 +3,7 @@ import crypto from 'crypto'
import { getAgent } from '@/lib/proxy' import { getAgent } from '@/lib/proxy'
import { assertContentTypeJson, assertResponseOk } from './url' 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 agent = getAgent({ hostname: socket, cert })
const url = `${agent.protocol}//${socket}/v1/invoice` const url = `${agent.protocol}//${socket}/v1/invoice`

View File

@ -7,18 +7,20 @@ export const testCreateInvoice = async ({ socket, rune, cert }) => {
} }
export const createInvoice = async ( export const createInvoice = async (
{ msats, description, descriptionHash, expiry }, { msats, description, expiry },
{ socket, rune, cert } { socket, rune, cert }
) => { ) => {
const inv = await clnCreateInvoice({ const inv = await clnCreateInvoice(
socket, {
rune, msats,
cert, description,
description, expiry
descriptionHash, },
msats, {
expiry socket,
}) rune,
cert
})
return inv.bolt11 return inv.bolt11
} }