diff --git a/src/FiatAssetAdapter.ts b/src/FiatAssetAdapter.ts index 1166443..8eba646 100644 --- a/src/FiatAssetAdapter.ts +++ b/src/FiatAssetAdapter.ts @@ -3,9 +3,11 @@ import { AssetAdapter, FiatSwapAsset, SwapAsset, Transaction } from './IAssetAda export type HtlcDetails = OasisHtlc; +type SettleHtlcTokens = { authorization: string, smsApi: string }; + export interface OasisClient { getHtlc(id: string): Promise; - settleHtlc(id: string, secret: string, settlementJWS: string, authorizationToken?: string): Promise; + settleHtlc(id: string, secret: string, settlementJWS: string, tokens?: SettleHtlcTokens): Promise; } export class FiatAssetAdapter implements AssetAdapter { @@ -101,7 +103,7 @@ export class FiatAssetAdapter implements AssetAdapter { settlementJWS: string, secret: string, hash: string, - authorizationToken?: string, + tokens?: SettleHtlcTokens, ): Promise { if (this.stopped) throw new Error('FiatAssetAdapter called while stopped'); @@ -112,7 +114,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(