@kimafinance/kima-transaction-widget 1.2.26-beta.1 → 1.2.28-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 -61
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +0 -47
- 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;
|
|
@@ -8707,64 +8705,6 @@ var TransferWidget = function TransferWidget(_ref) {
|
|
|
8707
8705
|
React.useEffect(function () {
|
|
8708
8706
|
dispatch(setTheme(theme));
|
|
8709
8707
|
}, [theme]);
|
|
8710
|
-
var updatePendingTxs = React.useCallback(function () {
|
|
8711
|
-
try {
|
|
8712
|
-
if (!nodeProviderQuery || !walletAddress) return Promise.resolve();
|
|
8713
|
-
var _temp9 = _catch(function () {
|
|
8714
|
-
return Promise.resolve(fetchWrapper.get(nodeProviderQuery + "/kima-finance/kima-blockchain/transaction/get_htlc_transaction/" + walletAddress)).then(function (result) {
|
|
8715
|
-
var data = result === null || result === void 0 ? void 0 : result.htlcLockingTransaction;
|
|
8716
|
-
var txData = [];
|
|
8717
|
-
if (data.length > 0) {
|
|
8718
|
-
for (var _iterator5 = _createForOfIteratorHelperLoose(data), _step5; !(_step5 = _iterator5()).done;) {
|
|
8719
|
-
var tx = _step5.value;
|
|
8720
|
-
var status = '';
|
|
8721
|
-
if (tx.status !== 'Completed') {
|
|
8722
|
-
status = 'Confirming';
|
|
8723
|
-
} else if (tx.pull_status === 'htlc_pull_available') {
|
|
8724
|
-
status = 'Pending';
|
|
8725
|
-
} else if (tx.pull_status === 'htlc_pull_in_progress') {
|
|
8726
|
-
status = 'In Progress';
|
|
8727
|
-
} else if (tx.pull_status === 'htlc_pull_succeed') {
|
|
8728
|
-
status = 'Completed';
|
|
8729
|
-
} else if (tx.pull_status === 'htlc_pull_failed') {
|
|
8730
|
-
status = 'Failed';
|
|
8731
|
-
}
|
|
8732
|
-
txData.push({
|
|
8733
|
-
hash: tx.txHash,
|
|
8734
|
-
amount: tx.amount,
|
|
8735
|
-
expireTime: tx.htlcTimestamp,
|
|
8736
|
-
status: status
|
|
8737
|
-
});
|
|
8738
|
-
}
|
|
8739
|
-
dispatch(setPendingTxData([].concat(txData)));
|
|
8740
|
-
dispatch(setPendingTxs(txData.filter(function (tx) {
|
|
8741
|
-
return tx.status === 'Pending' || tx.status === 'Confirming';
|
|
8742
|
-
}).length));
|
|
8743
|
-
console.log(txData.filter(function (tx) {
|
|
8744
|
-
return tx.status === 'Pending' || tx.status === 'Confirming';
|
|
8745
|
-
}).length, txData);
|
|
8746
|
-
}
|
|
8747
|
-
});
|
|
8748
|
-
}, function (e) {
|
|
8749
|
-
console.log(e);
|
|
8750
|
-
});
|
|
8751
|
-
return Promise.resolve(_temp9 && _temp9.then ? _temp9.then(function () {}) : void 0);
|
|
8752
|
-
} catch (e) {
|
|
8753
|
-
return Promise.reject(e);
|
|
8754
|
-
}
|
|
8755
|
-
}, [nodeProviderQuery, walletAddress]);
|
|
8756
|
-
React.useEffect(function () {
|
|
8757
|
-
if (sourceChain !== exports.SupportNetworks.BTC) return;
|
|
8758
|
-
updatePendingTxs();
|
|
8759
|
-
var timerId = setInterval(function () {
|
|
8760
|
-
updatePendingTxs();
|
|
8761
|
-
}, 10000);
|
|
8762
|
-
console.log(timerId);
|
|
8763
|
-
return function () {
|
|
8764
|
-
console.log('clearInterval', timerId);
|
|
8765
|
-
clearInterval(timerId);
|
|
8766
|
-
};
|
|
8767
|
-
}, [updatePendingTxs, sourceChain]);
|
|
8768
8708
|
return React__default.createElement("div", {
|
|
8769
8709
|
className: "kima-card " + theme.colorMode + " font-" + theme.fontSize,
|
|
8770
8710
|
style: {
|