Refactor CLN function signatures (#1726)
This commit is contained in:
parent
3cdfe620d0
commit
14de23b21d
|
@ -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`
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue