diff --git a/wrappers/fedimint-ts/FedimintClient.ts b/wrappers/fedimint-ts/FedimintClient.ts index c32292c..f84ce4b 100644 --- a/wrappers/fedimint-ts/FedimintClient.ts +++ b/wrappers/fedimint-ts/FedimintClient.ts @@ -7,11 +7,8 @@ import type { DiscoverVersionRequest, DiscoverVersionResponse, JoinRequest, - LnInvoiceExternalPubkeyRequest, - LnInvoiceExternalPubkeyResponse, LnInvoiceExternalPubkeyTweakedRequest, LnInvoiceExternalPubkeyTweakedResponse, - LnClaimPubkeyReceiveRequest, LnClaimPubkeyReceiveTweakedRequest, LnAwaitInvoiceRequest, Gateway, @@ -468,7 +465,7 @@ class FedimintClient { * @param tweaks - The tweaks of the pubkey to claim * @param federationId - The ID of the federation to claim the contracts in. Contracts are on specific federations so this is required. */ - claimPubkeyTweakReceive: async ( + claimPubkeyTweakReceives: async ( privateKey: string, tweaks: number[], federationId: string diff --git a/wrappers/fedimint-ts/test.ts b/wrappers/fedimint-ts/test.ts index 7b4acc7..a85aaff 100644 --- a/wrappers/fedimint-ts/test.ts +++ b/wrappers/fedimint-ts/test.ts @@ -94,11 +94,11 @@ async function main() { // LIGHTNING METHODS // `/v2/ln/list-gateways` logMethod("/v2/ln/list-gateways"); - data = await fedimintClient.ln.listGateways(); + data = await fedimintClient.lightning.listGateways(); logInputAndOutput({}, data); // `/v2/ln/invoice` logMethod("/v2/ln/invoice"); - let { operationId, invoice } = await fedimintClient.ln.createInvoice( + let { operationId, invoice } = await fedimintClient.lightning.createInvoice( 10000, "test" ); @@ -108,36 +108,15 @@ async function main() { ); // `/v2/ln/pay` logMethod("/v2/ln/pay"); - let payResponse = await fedimintClient.ln.pay(invoice); + let payResponse = await fedimintClient.lightning.pay(invoice); logInputAndOutput({ paymentInfo: invoice }, payResponse); // `/v2/ln/await-invoice` logMethod("/v2/ln/await-invoice"); - data = await fedimintClient.ln.awaitInvoice(operationId); + data = await fedimintClient.lightning.awaitInvoice(operationId); logInputAndOutput({ operationId }, data); - // `/v1/ln/invoice-external-pubkey` - logMethod("/v1/ln/invoice-external-pubkey"); - data = await fedimintClient.ln.createInvoiceForPubkey( - keyPair.publicKey, - 1000, - "test" - ); - logInputAndOutput( - { - externalPubkey: keyPair.publicKey, - amountMsat: 10000, - description: "test", - }, - data - ); - // pay the invoice - payResponse = await fedimintClient.ln.pay(data.invoice); - // `/v1/ln/claim-external-pubkey` - logMethod("/v1/ln/claim-external-pubkey"); - data = await fedimintClient.ln.claimPubkeyReceive(keyPair.privateKey); - logInputAndOutput({ privateKey: keyPair.privateKey }, data); // `/v1/ln/invoice-external-pubkey-tweaked` logMethod("/v1/ln/invoice-external-pubkey-tweaked"); - data = await fedimintClient.ln.createInvoiceForPubkeyTweak( + data = await fedimintClient.lightning.createInvoiceForPubkeyTweak( keyPair.publicKey, 1, 1000, @@ -153,12 +132,14 @@ async function main() { data ); // pay the invoice - payResponse = await fedimintClient.ln.pay(data.invoice); + payResponse = await fedimintClient.lightning.pay(data.invoice); // `/v1/ln/claim-external-pubkey-tweaked` logMethod("/v1/ln/claim-external-pubkey-tweaked"); - data = await fedimintClient.ln.claimPubkeyReceiveTweaked(keyPair.privateKey, [ - 1, - ]); + data = await fedimintClient.lightning.claimPubkeyTweakReceives( + keyPair.privateKey, + [1], + fedimintClient.getActiveFederationId() + ); logInputAndOutput({ privateKey: keyPair.privateKey, tweaks: [1] }, data); // MINT METHODS