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