@kimafinance/kima-transaction-widget 1.2.55-beta.1 → 1.2.57-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.
|
@@ -7,7 +7,6 @@ interface Props {
|
|
|
7
7
|
mode: ModeOptions;
|
|
8
8
|
txId?: number;
|
|
9
9
|
useFIAT?: boolean;
|
|
10
|
-
defaultToken?: string;
|
|
11
10
|
autoSwitchChain?: boolean;
|
|
12
11
|
dAppOption?: DAppOptions;
|
|
13
12
|
provider?: Web3Provider;
|
|
@@ -27,5 +26,5 @@ interface Props {
|
|
|
27
26
|
switchChainHandler?: (chainId: number) => void;
|
|
28
27
|
keplrHandler?: (e: any) => void;
|
|
29
28
|
}
|
|
30
|
-
export declare const KimaTransactionWidget: ({ mode, txId, autoSwitchChain,
|
|
29
|
+
export declare const KimaTransactionWidget: ({ mode, txId, autoSwitchChain, networkOption, provider, dAppOption, theme, titleOption, paymentTitleOption, useFIAT, helpURL, compliantOption, transactionOption, kimaBackendUrl, kimaNodeProviderQuery, kimaExplorer, feeURL, errorHandler, closeHandler, successHandler, switchChainHandler, keplrHandler }: Props) => React.JSX.Element;
|
|
31
30
|
export {};
|
package/dist/index.js
CHANGED
|
@@ -978,7 +978,9 @@ var TRON_USDK_OWNER_ADDRESS = 'TBVn4bsBN4DhtZ7D3vEVpAyqkvdFn7zmpU';
|
|
|
978
978
|
})(exports.ModeOptions || (exports.ModeOptions = {}));
|
|
979
979
|
(function (CurrencyOptions) {
|
|
980
980
|
CurrencyOptions["USDK"] = "USDK";
|
|
981
|
+
CurrencyOptions["USDC"] = "USDC";
|
|
981
982
|
CurrencyOptions["USDT"] = "USDT";
|
|
983
|
+
CurrencyOptions["WBTC"] = "WBTC";
|
|
982
984
|
CurrencyOptions["G$"] = "GDOLLAR";
|
|
983
985
|
})(exports.CurrencyOptions || (exports.CurrencyOptions = {}));
|
|
984
986
|
(function (ColorModeOptions) {
|
|
@@ -3274,7 +3276,7 @@ var StepBox = function StepBox(_ref) {
|
|
|
3274
3276
|
}) : step >= index ? index === errorStep ? React__default.createElement(Warning, null) : React__default.createElement(Check, null) : null, React__default.createElement("p", null, item.title)), index === 0 && data !== null && data !== void 0 && data.kimaTxHash ? React__default.createElement("div", {
|
|
3275
3277
|
className: 'info-item'
|
|
3276
3278
|
}, React__default.createElement("p", null, "Kima TX ID:", ' ', React__default.createElement(ExternalLink, {
|
|
3277
|
-
to:
|
|
3279
|
+
to: explorerUrl + "/transactions/" + (data === null || data === void 0 ? void 0 : data.kimaTxHash)
|
|
3278
3280
|
}, getShortenedAddress((data === null || data === void 0 ? void 0 : data.kimaTxHash) || '')), React__default.createElement(CopyButton, {
|
|
3279
3281
|
text: data === null || data === void 0 ? void 0 : data.kimaTxHash
|
|
3280
3282
|
}))) : null, index === 1 && data !== null && data !== void 0 && data.tssPullHash ? React__default.createElement("div", {
|
|
@@ -3797,9 +3799,11 @@ function useServiceFee(isConfirming, feeURL) {
|
|
|
3797
3799
|
var sourceFee = 0;
|
|
3798
3800
|
var targetFee = 0;
|
|
3799
3801
|
return Promise.resolve(fetchWrapper.get(feeURL + "/fee/" + sourceChain)).then(function (sourceChainResult) {
|
|
3800
|
-
|
|
3802
|
+
var _sourceChainResult$fe;
|
|
3803
|
+
sourceFee = sourceChainResult === null || sourceChainResult === void 0 ? void 0 : (_sourceChainResult$fe = sourceChainResult.fee) === null || _sourceChainResult$fe === void 0 ? void 0 : _sourceChainResult$fe.split('-')[0];
|
|
3801
3804
|
return Promise.resolve(fetchWrapper.get(feeURL + "/fee/" + targetChain)).then(function (targetChainResult) {
|
|
3802
|
-
|
|
3805
|
+
var _targetChainResult$fe;
|
|
3806
|
+
targetFee = targetChainResult === null || targetChainResult === void 0 ? void 0 : (_targetChainResult$fe = targetChainResult.fee) === null || _targetChainResult$fe === void 0 ? void 0 : _targetChainResult$fe.split('-')[0];
|
|
3803
3807
|
var fee = +sourceFee + +targetFee;
|
|
3804
3808
|
dispatch(setServiceFee(fee));
|
|
3805
3809
|
});
|
|
@@ -7919,11 +7923,12 @@ function useCurrencyOptions() {
|
|
|
7919
7923
|
var _useState = React.useState('USDK'),
|
|
7920
7924
|
options = _useState[0],
|
|
7921
7925
|
setOptions = _useState[1];
|
|
7926
|
+
var transactionOption = reactRedux.useSelector(selectTransactionOption);
|
|
7922
7927
|
var nodeProviderQuery = reactRedux.useSelector(selectNodeProviderQuery);
|
|
7923
7928
|
var originNetwork = reactRedux.useSelector(selectSourceChain);
|
|
7924
7929
|
var targetNetwork = reactRedux.useSelector(selectTargetChain);
|
|
7925
7930
|
React.useEffect(function () {
|
|
7926
|
-
if (!nodeProviderQuery || !originNetwork || !targetNetwork) return;
|
|
7931
|
+
if (!nodeProviderQuery || !originNetwork || !targetNetwork || !transactionOption) return;
|
|
7927
7932
|
(function () {
|
|
7928
7933
|
try {
|
|
7929
7934
|
return _catch(function () {
|
|
@@ -7938,9 +7943,16 @@ function useCurrencyOptions() {
|
|
|
7938
7943
|
if (originNetwork === exports.SupportNetworks.BTC || targetNetwork === exports.SupportNetworks.BTC) {
|
|
7939
7944
|
tokenList = ['WBTC'];
|
|
7940
7945
|
}
|
|
7941
|
-
|
|
7946
|
+
if (transactionOption.currency && tokenList.findIndex(function (item) {
|
|
7947
|
+
return item === transactionOption.currency;
|
|
7948
|
+
}) >= 0) {
|
|
7949
|
+
dispatch(setSelectedToken(transactionOption.currency));
|
|
7950
|
+
setOptions(transactionOption.currency);
|
|
7951
|
+
} else {
|
|
7952
|
+
dispatch(setSelectedToken(tokenList[0]));
|
|
7953
|
+
setOptions(tokenList[0]);
|
|
7954
|
+
}
|
|
7942
7955
|
dispatch(setAvailableTokenList(tokenList));
|
|
7943
|
-
setOptions(tokenList[0]);
|
|
7944
7956
|
});
|
|
7945
7957
|
}, function (e) {
|
|
7946
7958
|
console.log('rpc disconnected', e);
|
|
@@ -7950,7 +7962,7 @@ function useCurrencyOptions() {
|
|
|
7950
7962
|
Promise.reject(e);
|
|
7951
7963
|
}
|
|
7952
7964
|
})();
|
|
7953
|
-
}, [nodeProviderQuery, originNetwork, targetNetwork]);
|
|
7965
|
+
}, [nodeProviderQuery, originNetwork, targetNetwork, transactionOption]);
|
|
7954
7966
|
return React.useMemo(function () {
|
|
7955
7967
|
return {
|
|
7956
7968
|
options: options
|
|
@@ -12764,8 +12776,6 @@ var KimaTransactionWidget = function KimaTransactionWidget(_ref) {
|
|
|
12764
12776
|
txId = _ref.txId,
|
|
12765
12777
|
_ref$autoSwitchChain = _ref.autoSwitchChain,
|
|
12766
12778
|
autoSwitchChain = _ref$autoSwitchChain === void 0 ? true : _ref$autoSwitchChain,
|
|
12767
|
-
_ref$defaultToken = _ref.defaultToken,
|
|
12768
|
-
defaultToken = _ref$defaultToken === void 0 ? 'USDT' : _ref$defaultToken,
|
|
12769
12779
|
_ref$networkOption = _ref.networkOption,
|
|
12770
12780
|
networkOption = _ref$networkOption === void 0 ? exports.NetworkOptions.testnet : _ref$networkOption,
|
|
12771
12781
|
provider = _ref.provider,
|
|
@@ -12828,7 +12838,6 @@ var KimaTransactionWidget = function KimaTransactionWidget(_ref) {
|
|
|
12828
12838
|
dispatch(setProvider(provider));
|
|
12829
12839
|
dispatch(setDappOption(dAppOption));
|
|
12830
12840
|
dispatch(setWalletAutoConnect(autoSwitchChain));
|
|
12831
|
-
dispatch(setSelectedToken(defaultToken));
|
|
12832
12841
|
dispatch(setUseFIAT(useFIAT));
|
|
12833
12842
|
dispatch(setNetworkOption(networkOption));
|
|
12834
12843
|
if (useFIAT) {
|