From a8b3bde4873211dd9852dea7e27b6feb14c6c546 Mon Sep 17 00:00:00 2001 From: Maxi Date: Wed, 5 Jun 2024 19:13:20 +0200 Subject: [PATCH] feat: settleHtlc now accepts an object for tokens --- src/FiatAssetAdapter.ts | 7 +++++-- src/IAssetAdapter.ts | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/FiatAssetAdapter.ts b/src/FiatAssetAdapter.ts index 1166443..a460027 100644 --- a/src/FiatAssetAdapter.ts +++ b/src/FiatAssetAdapter.ts @@ -101,7 +101,10 @@ export class FiatAssetAdapter implements AssetAdapter { settlementJWS: string, secret: string, hash: string, - authorizationToken?: string, + tokens?: { + authorization: string, + smsApi: string + } ): Promise { if (this.stopped) throw new Error('FiatAssetAdapter called while stopped'); @@ -112,7 +115,7 @@ export class FiatAssetAdapter implements AssetAdapter { let htlc: HtlcDetails; try { - htlc = await this.client.settleHtlc(payload.contractId, secret, settlementJWS, { authorization: authorizationToken }); + htlc = await this.client.settleHtlc(payload.contractId, secret, settlementJWS, tokens); } catch (error) { console.error(error); // eslint-disable-line no-console htlc = await this.client.getHtlc(payload.contractId); diff --git a/src/IAssetAdapter.ts b/src/IAssetAdapter.ts index 868a9d5..0d77934 100644 --- a/src/IAssetAdapter.ts +++ b/src/IAssetAdapter.ts @@ -65,7 +65,10 @@ export interface AssetAdapter { serializedTx: string, secret: string, hash: string, - authorizationToken?: string, + tokens?: { + authorization: string, + smsApi: string + } ): Promise>; awaitSettlementConfirmation(