diff --git a/wrappers/fedimint-ts/src/FedimintClient.ts b/wrappers/fedimint-ts/src/FedimintClient.ts index 7a9606d..ac9145f 100644 --- a/wrappers/fedimint-ts/src/FedimintClient.ts +++ b/wrappers/fedimint-ts/src/FedimintClient.ts @@ -25,7 +25,6 @@ import { MintValidateResponse, OnchainAwaitDepositRequest, OnchainAwaitDepositResponse, - OnchainDepositAddressRequest, OnchainDepositAddressResponse, OnchainWithdrawRequest, OnchainWithdrawResponse, @@ -612,17 +611,13 @@ export class FedimintClient { public onchain = { /** * Creates a new bitcoin deposit address to peg in bitcoin to the federation. - * @param timeout - The number of seconds for the fedimint-clientd to watch for a deposit to the created address */ createDepositAddress: async ( - timeout: number, federationId?: string ): Promise => { - const request: OnchainDepositAddressRequest = { timeout }; - return await this.postWithFederationId( "/onchain/deposit-address", - request, + {}, federationId ); }, diff --git a/wrappers/fedimint-ts/src/types.ts b/wrappers/fedimint-ts/src/types.ts index 2961b51..cc8b7e7 100644 --- a/wrappers/fedimint-ts/src/types.ts +++ b/wrappers/fedimint-ts/src/types.ts @@ -54,13 +54,10 @@ export interface OperationOutput { outcome?: any; } -export interface OnchainDepositAddressRequest { - timeout: number; -} - export interface OnchainDepositAddressResponse { operationId: string; address: string; + tweakIdx: number; } export interface OnchainAwaitDepositRequest { @@ -239,7 +236,7 @@ export interface MintEncodeNotesRequest { } export interface MintEncodeNotesResponse { - notes: string; + notesJson: string; } export interface MintReissueRequest { diff --git a/wrappers/fedimint-ts/tests/test.ts b/wrappers/fedimint-ts/tests/test.ts index ad60439..3095ade 100644 --- a/wrappers/fedimint-ts/tests/test.ts +++ b/wrappers/fedimint-ts/tests/test.ts @@ -196,8 +196,8 @@ async function main() { logInputAndOutput({ notes: mintData.notes }, data); // `/v2/mint/encode-notes` logMethod("/v2/mint/encode-notes"); - data = await fedimintClient.mint.encodeNotes(data.notesJson); - logInputAndOutput({ notesJson: data.notesJson }, data); + const encodeData = await fedimintClient.mint.encodeNotes(data.notesJson); + logInputAndOutput({ notesJson: data.notesJson }, encodeData); // `/v2/mint/validate` logMethod("/v2/mint/validate"); data = await fedimintClient.mint.validate(mintData.notes); @@ -219,12 +219,16 @@ async function main() { // ONCHAIN METHODS // `/v2/onchain/deposit-address` logMethod("/v2/onchain/deposit-address"); - data = await fedimintClient.onchain.createDepositAddress(1000); - logInputAndOutput({ timeout: 1000 }, data); + data = await fedimintClient.onchain.createDepositAddress(); + logInputAndOutput({}, data); // `/v2/onchain/withdraw` logMethod("/v2/onchain/withdraw"); - data = await fedimintClient.onchain.withdraw(data.address, 1000); - logInputAndOutput({ address: data.address, amountSat: 1000 }, data); + const withdrawData = await fedimintClient.onchain.withdraw( + data.address, + 1000 + ); + console.log("Withdrew: ", withdrawData); + logInputAndOutput({ address: data.address, amountSat: 1000 }, withdrawData); // // `/v2/onchain/await-deposit` // logMethod("/v2/onchain/await-deposit"); // data = await fedimintClient.onchain.awaitDeposit(data.operationId);