@kimafinance/kima-transaction-widget 1.2.30-beta.1 → 1.2.31-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -50
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +0 -39
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1204,9 +1204,7 @@ var _optionSlice$actions = optionSlice.actions,
|
|
|
1204
1204
|
setSignature = _optionSlice$actions.setSignature,
|
|
1205
1205
|
setUuid = _optionSlice$actions.setUuid,
|
|
1206
1206
|
setKYCStatus = _optionSlice$actions.setKYCStatus,
|
|
1207
|
-
setExpireTime = _optionSlice$actions.setExpireTime
|
|
1208
|
-
setPendingTxData = _optionSlice$actions.setPendingTxData,
|
|
1209
|
-
setPendingTxs = _optionSlice$actions.setPendingTxs;
|
|
1207
|
+
setExpireTime = _optionSlice$actions.setExpireTime;
|
|
1210
1208
|
var optionReducer = optionSlice.reducer;
|
|
1211
1209
|
|
|
1212
1210
|
var configureStore = toolkitRaw.configureStore;
|
|
@@ -8664,53 +8662,6 @@ var TransferWidget = function TransferWidget(_ref) {
|
|
|
8664
8662
|
React.useEffect(function () {
|
|
8665
8663
|
dispatch(setTheme(theme));
|
|
8666
8664
|
}, [theme]);
|
|
8667
|
-
React.useEffect(function () {
|
|
8668
|
-
if (!nodeProviderQuery || sourceChain !== exports.SupportNetworks.BTC || !walletAddress) return;
|
|
8669
|
-
var updatePendingTxs = function updatePendingTxs() {
|
|
8670
|
-
try {
|
|
8671
|
-
return Promise.resolve(fetchWrapper.get(nodeProviderQuery + "/kima-finance/kima-blockchain/transaction/get_htlc_transaction/" + walletAddress)).then(function (result) {
|
|
8672
|
-
var data = result === null || result === void 0 ? void 0 : result.htlcLockingTransaction;
|
|
8673
|
-
var txData = [];
|
|
8674
|
-
if (data.length > 0) {
|
|
8675
|
-
for (var _iterator5 = _createForOfIteratorHelperLoose(data), _step5; !(_step5 = _iterator5()).done;) {
|
|
8676
|
-
var tx = _step5.value;
|
|
8677
|
-
var status = '';
|
|
8678
|
-
if (tx.status !== 'Completed') {
|
|
8679
|
-
status = 'Confirming';
|
|
8680
|
-
} else if (tx.pull_status === 'htlc_pull_available') {
|
|
8681
|
-
status = 'Pending';
|
|
8682
|
-
} else if (tx.pull_status === 'htlc_pull_in_progress') {
|
|
8683
|
-
status = 'In Progress';
|
|
8684
|
-
} else if (tx.pull_status === 'htlc_pull_succeed') {
|
|
8685
|
-
status = 'Completed';
|
|
8686
|
-
} else if (tx.pull_status === 'htlc_pull_failed') {
|
|
8687
|
-
status = 'Failed';
|
|
8688
|
-
}
|
|
8689
|
-
txData.push({
|
|
8690
|
-
hash: tx.txHash,
|
|
8691
|
-
amount: tx.amount,
|
|
8692
|
-
expireTime: tx.htlcTimestamp,
|
|
8693
|
-
status: status
|
|
8694
|
-
});
|
|
8695
|
-
}
|
|
8696
|
-
dispatch(setPendingTxData([].concat(txData)));
|
|
8697
|
-
dispatch(setPendingTxs(txData.filter(function (tx) {
|
|
8698
|
-
return tx.status === 'Pending' || tx.status === 'Confirming';
|
|
8699
|
-
}).length));
|
|
8700
|
-
}
|
|
8701
|
-
});
|
|
8702
|
-
} catch (e) {
|
|
8703
|
-
return Promise.reject(e);
|
|
8704
|
-
}
|
|
8705
|
-
};
|
|
8706
|
-
var timerId = setInterval(function () {
|
|
8707
|
-
updatePendingTxs();
|
|
8708
|
-
}, 10000);
|
|
8709
|
-
updatePendingTxs();
|
|
8710
|
-
return function () {
|
|
8711
|
-
clearInterval(timerId);
|
|
8712
|
-
};
|
|
8713
|
-
}, [sourceChain, nodeProviderQuery, walletAddress]);
|
|
8714
8665
|
return React__default.createElement("div", {
|
|
8715
8666
|
className: "kima-card " + theme.colorMode + " font-" + theme.fontSize,
|
|
8716
8667
|
style: {
|