crosslightning-sdk-base
Advanced tools
Comparing version 9.2.0-beta27 to 9.2.0-beta28
@@ -263,3 +263,3 @@ "use strict"; | ||
let resp = { code: IntermediaryAPI_1.RefundAuthorizationResponseCodes.PENDING, msg: "" }; | ||
while (!abortSignal.aborted && resp.code === IntermediaryAPI_1.RefundAuthorizationResponseCodes.PENDING) { | ||
while (!abortSignal.aborted && (resp.code === IntermediaryAPI_1.RefundAuthorizationResponseCodes.PENDING || resp.code === IntermediaryAPI_1.RefundAuthorizationResponseCodes.NOT_FOUND)) { | ||
resp = yield IntermediaryAPI_1.IntermediaryAPI.getRefundAuthorization(this.url, this.data.getHash(), this.data.getSequence()); | ||
@@ -269,3 +269,4 @@ if (resp.code === IntermediaryAPI_1.RefundAuthorizationResponseCodes.PAID && !(yield this._setPaymentResult(resp.data, true))) { | ||
} | ||
if (resp.code === IntermediaryAPI_1.RefundAuthorizationResponseCodes.PENDING) | ||
if (resp.code === IntermediaryAPI_1.RefundAuthorizationResponseCodes.PENDING || | ||
resp.code === IntermediaryAPI_1.RefundAuthorizationResponseCodes.NOT_FOUND) | ||
yield (0, Utils_1.timeoutPromise)(checkIntervalSeconds * 1000, abortSignal); | ||
@@ -272,0 +273,0 @@ } |
@@ -267,3 +267,3 @@ "use strict"; | ||
pr: invoice, | ||
reqId: resp.reqId, | ||
reqId: prepareResp.reqId, | ||
feeRate: preFetches.feeRatePromise, | ||
@@ -270,0 +270,0 @@ additionalParams |
{ | ||
"name": "crosslightning-sdk-base", | ||
"version": "9.2.0-beta27", | ||
"version": "9.2.0-beta28", | ||
"description": "CrossLightning SDK chain-agnostic base", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
import {IToBTCWrapper} from "./IToBTCWrapper"; | ||
import {Fee, isISwapInit, ISwap, ISwapInit, Token} from "../ISwap"; | ||
import {Fee, isISwapInit, ISwap, ISwapInit} from "../ISwap"; | ||
import * as BN from "bn.js"; | ||
@@ -324,3 +324,5 @@ import {SignatureVerificationError, SwapCommitStatus, SwapData, TokenAddress} from "crosslightning-base"; | ||
let resp: RefundAuthorizationResponse = {code: RefundAuthorizationResponseCodes.PENDING, msg: ""}; | ||
while(!abortSignal.aborted && resp.code===RefundAuthorizationResponseCodes.PENDING) { | ||
while(!abortSignal.aborted && ( | ||
resp.code===RefundAuthorizationResponseCodes.PENDING || resp.code===RefundAuthorizationResponseCodes.NOT_FOUND | ||
)) { | ||
resp = await IntermediaryAPI.getRefundAuthorization(this.url, this.data.getHash(), this.data.getSequence()); | ||
@@ -330,3 +332,6 @@ if(resp.code===RefundAuthorizationResponseCodes.PAID && !await this._setPaymentResult(resp.data, true)) { | ||
} | ||
if(resp.code===RefundAuthorizationResponseCodes.PENDING) await timeoutPromise(checkIntervalSeconds*1000, abortSignal); | ||
if( | ||
resp.code===RefundAuthorizationResponseCodes.PENDING || | ||
resp.code===RefundAuthorizationResponseCodes.NOT_FOUND | ||
) await timeoutPromise(checkIntervalSeconds*1000, abortSignal); | ||
} | ||
@@ -333,0 +338,0 @@ return resp; |
@@ -372,3 +372,3 @@ import {decode as bolt11Decode, PaymentRequestObject, TagsObject} from "bolt11"; | ||
pr: invoice, | ||
reqId: resp.reqId, | ||
reqId: prepareResp.reqId, | ||
feeRate: preFetches.feeRatePromise, | ||
@@ -375,0 +375,0 @@ additionalParams |
893092
20472