@kimafinance/kima-transaction-widget 1.2.55-beta.1 → 1.2.56-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) {
|
|
@@ -7919,11 +7921,12 @@ function useCurrencyOptions() {
|
|
|
7919
7921
|
var _useState = React.useState('USDK'),
|
|
7920
7922
|
options = _useState[0],
|
|
7921
7923
|
setOptions = _useState[1];
|
|
7924
|
+
var transactionOption = reactRedux.useSelector(selectTransactionOption);
|
|
7922
7925
|
var nodeProviderQuery = reactRedux.useSelector(selectNodeProviderQuery);
|
|
7923
7926
|
var originNetwork = reactRedux.useSelector(selectSourceChain);
|
|
7924
7927
|
var targetNetwork = reactRedux.useSelector(selectTargetChain);
|
|
7925
7928
|
React.useEffect(function () {
|
|
7926
|
-
if (!nodeProviderQuery || !originNetwork || !targetNetwork) return;
|
|
7929
|
+
if (!nodeProviderQuery || !originNetwork || !targetNetwork || !transactionOption) return;
|
|
7927
7930
|
(function () {
|
|
7928
7931
|
try {
|
|
7929
7932
|
return _catch(function () {
|
|
@@ -7938,9 +7941,17 @@ function useCurrencyOptions() {
|
|
|
7938
7941
|
if (originNetwork === exports.SupportNetworks.BTC || targetNetwork === exports.SupportNetworks.BTC) {
|
|
7939
7942
|
tokenList = ['WBTC'];
|
|
7940
7943
|
}
|
|
7941
|
-
|
|
7944
|
+
console.log(tokenList, transactionOption);
|
|
7945
|
+
if (transactionOption.currency && tokenList.findIndex(function (item) {
|
|
7946
|
+
return item === transactionOption.currency;
|
|
7947
|
+
}) >= 0) {
|
|
7948
|
+
dispatch(setSelectedToken(transactionOption.currency));
|
|
7949
|
+
setOptions(transactionOption.currency);
|
|
7950
|
+
} else {
|
|
7951
|
+
dispatch(setSelectedToken(tokenList[0]));
|
|
7952
|
+
setOptions(tokenList[0]);
|
|
7953
|
+
}
|
|
7942
7954
|
dispatch(setAvailableTokenList(tokenList));
|
|
7943
|
-
setOptions(tokenList[0]);
|
|
7944
7955
|
});
|
|
7945
7956
|
}, function (e) {
|
|
7946
7957
|
console.log('rpc disconnected', e);
|
|
@@ -7950,7 +7961,7 @@ function useCurrencyOptions() {
|
|
|
7950
7961
|
Promise.reject(e);
|
|
7951
7962
|
}
|
|
7952
7963
|
})();
|
|
7953
|
-
}, [nodeProviderQuery, originNetwork, targetNetwork]);
|
|
7964
|
+
}, [nodeProviderQuery, originNetwork, targetNetwork, transactionOption]);
|
|
7954
7965
|
return React.useMemo(function () {
|
|
7955
7966
|
return {
|
|
7956
7967
|
options: options
|
|
@@ -12764,8 +12775,6 @@ var KimaTransactionWidget = function KimaTransactionWidget(_ref) {
|
|
|
12764
12775
|
txId = _ref.txId,
|
|
12765
12776
|
_ref$autoSwitchChain = _ref.autoSwitchChain,
|
|
12766
12777
|
autoSwitchChain = _ref$autoSwitchChain === void 0 ? true : _ref$autoSwitchChain,
|
|
12767
|
-
_ref$defaultToken = _ref.defaultToken,
|
|
12768
|
-
defaultToken = _ref$defaultToken === void 0 ? 'USDT' : _ref$defaultToken,
|
|
12769
12778
|
_ref$networkOption = _ref.networkOption,
|
|
12770
12779
|
networkOption = _ref$networkOption === void 0 ? exports.NetworkOptions.testnet : _ref$networkOption,
|
|
12771
12780
|
provider = _ref.provider,
|
|
@@ -12828,7 +12837,6 @@ var KimaTransactionWidget = function KimaTransactionWidget(_ref) {
|
|
|
12828
12837
|
dispatch(setProvider(provider));
|
|
12829
12838
|
dispatch(setDappOption(dAppOption));
|
|
12830
12839
|
dispatch(setWalletAutoConnect(autoSwitchChain));
|
|
12831
|
-
dispatch(setSelectedToken(defaultToken));
|
|
12832
12840
|
dispatch(setUseFIAT(useFIAT));
|
|
12833
12841
|
dispatch(setNetworkOption(networkOption));
|
|
12834
12842
|
if (useFIAT) {
|