@kimafinance/kima-transaction-widget 1.2.79-beta.1 → 1.2.81-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/assets/icons/Base.d.ts +7 -0
- package/dist/assets/icons/index.d.ts +1 -0
- package/dist/index.js +870 -338
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +871 -333
- package/dist/index.modern.js.map +1 -1
- package/dist/utils/constants.d.ts +6 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -26,7 +26,7 @@ var sha256$1 = _interopDefault(require('crypto-js/sha256.js'));
|
|
|
26
26
|
var Base64 = _interopDefault(require('crypto-js/enc-base64.js'));
|
|
27
27
|
var buffer = require('buffer');
|
|
28
28
|
var bitcoin = require('bitcoinjs-lib');
|
|
29
|
-
var base = require('@scure/base');
|
|
29
|
+
var base$1 = require('@scure/base');
|
|
30
30
|
var btc = require('@kimafinance/btc-signer');
|
|
31
31
|
require('hex64');
|
|
32
32
|
|
|
@@ -775,12 +775,30 @@ var Celo = function Celo(_ref) {
|
|
|
775
775
|
};
|
|
776
776
|
|
|
777
777
|
var _excluded$k = ["width", "height"];
|
|
778
|
+
var Solana$1 = function Solana(_ref) {
|
|
779
|
+
var _ref$width = _ref.width,
|
|
780
|
+
width = _ref$width === void 0 ? 14 : _ref$width,
|
|
781
|
+
_ref$height = _ref.height,
|
|
782
|
+
height = _ref$height === void 0 ? 14 : _ref$height,
|
|
783
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$k);
|
|
784
|
+
return React__default.createElement("svg", Object.assign({
|
|
785
|
+
width: width,
|
|
786
|
+
height: height,
|
|
787
|
+
viewBox: '0 0 111 111',
|
|
788
|
+
xmlns: 'http://www.w3.org/2000/svg'
|
|
789
|
+
}, rest), React__default.createElement("path", {
|
|
790
|
+
d: 'M54.921 110.034C85.359 110.034 110.034 85.402 110.034 55.017C110.034 24.6319 85.359 0 54.921 0C26.0432 0 2.35281 22.1714 0 50.3923H72.8467V59.6416H3.9565e-07C2.35281 87.8625 26.0432 110.034 54.921 110.034Z',
|
|
791
|
+
fill: '#0052FF'
|
|
792
|
+
}));
|
|
793
|
+
};
|
|
794
|
+
|
|
795
|
+
var _excluded$l = ["width", "height"];
|
|
778
796
|
var BTC = function BTC(_ref) {
|
|
779
797
|
var _ref$width = _ref.width,
|
|
780
798
|
width = _ref$width === void 0 ? 59 : _ref$width,
|
|
781
799
|
_ref$height = _ref.height,
|
|
782
800
|
height = _ref$height === void 0 ? 58 : _ref$height,
|
|
783
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
801
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$l);
|
|
784
802
|
return React__default.createElement("svg", Object.assign({
|
|
785
803
|
width: width,
|
|
786
804
|
height: height,
|
|
@@ -824,11 +842,11 @@ var BTC = function BTC(_ref) {
|
|
|
824
842
|
}));
|
|
825
843
|
};
|
|
826
844
|
|
|
827
|
-
var _excluded$
|
|
845
|
+
var _excluded$m = ["width", "height", "fill"];
|
|
828
846
|
var Explorer = function Explorer(_ref) {
|
|
829
847
|
var _ref$fill = _ref.fill,
|
|
830
848
|
fill = _ref$fill === void 0 ? 'black' : _ref$fill,
|
|
831
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
849
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$m);
|
|
832
850
|
return React__default.createElement("svg", Object.assign({
|
|
833
851
|
width: '21',
|
|
834
852
|
height: '24',
|
|
@@ -841,11 +859,11 @@ var Explorer = function Explorer(_ref) {
|
|
|
841
859
|
}));
|
|
842
860
|
};
|
|
843
861
|
|
|
844
|
-
var _excluded$
|
|
862
|
+
var _excluded$n = ["width", "height", "fill"];
|
|
845
863
|
var ExternalUrl = function ExternalUrl(_ref) {
|
|
846
864
|
var _ref$fill = _ref.fill,
|
|
847
865
|
fill = _ref$fill === void 0 ? 'black' : _ref$fill,
|
|
848
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
866
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$n);
|
|
849
867
|
return React__default.createElement("svg", Object.assign({
|
|
850
868
|
width: '40',
|
|
851
869
|
height: '40',
|
|
@@ -888,6 +906,7 @@ var _CHAIN_NAMES_TO_IDS_T, _CHAIN_NAMES_TO_IDS_M, _CHAIN_NAMES_TO_STRIN, _CHAIN_
|
|
|
888
906
|
ChainName["TRON"] = "TRX";
|
|
889
907
|
ChainName["FIAT"] = "FIAT";
|
|
890
908
|
ChainName["BTC"] = "BTC";
|
|
909
|
+
ChainName["BASE"] = "BASE";
|
|
891
910
|
})(exports.SupportNetworks || (exports.SupportNetworks = {}));
|
|
892
911
|
var SupportedChainIdTestnet;
|
|
893
912
|
(function (SupportedChainIdTestnet) {
|
|
@@ -898,8 +917,9 @@ var SupportedChainIdTestnet;
|
|
|
898
917
|
SupportedChainIdTestnet[SupportedChainIdTestnet["ARBITRUM"] = 421614] = "ARBITRUM";
|
|
899
918
|
SupportedChainIdTestnet[SupportedChainIdTestnet["OPTIMISM"] = 11155420] = "OPTIMISM";
|
|
900
919
|
SupportedChainIdTestnet[SupportedChainIdTestnet["POLYGON_ZKEM"] = 2442] = "POLYGON_ZKEM";
|
|
920
|
+
SupportedChainIdTestnet[SupportedChainIdTestnet["BASE"] = 84532] = "BASE";
|
|
901
921
|
})(SupportedChainIdTestnet || (SupportedChainIdTestnet = {}));
|
|
902
|
-
var CHAIN_NAMES_TO_IDS_TESTNET = (_CHAIN_NAMES_TO_IDS_T = {}, _CHAIN_NAMES_TO_IDS_T[exports.SupportNetworks.ETHEREUM] = SupportedChainIdTestnet.ETHEREUM, _CHAIN_NAMES_TO_IDS_T[exports.SupportNetworks.POLYGON] = SupportedChainIdTestnet.POLYGON, _CHAIN_NAMES_TO_IDS_T[exports.SupportNetworks.AVALANCHE] = SupportedChainIdTestnet.AVALANCHE, _CHAIN_NAMES_TO_IDS_T[exports.SupportNetworks.BSC] = SupportedChainIdTestnet.BSC, _CHAIN_NAMES_TO_IDS_T[exports.SupportNetworks.OPTIMISM] = SupportedChainIdTestnet.OPTIMISM, _CHAIN_NAMES_TO_IDS_T[exports.SupportNetworks.ARBITRUM] = SupportedChainIdTestnet.ARBITRUM, _CHAIN_NAMES_TO_IDS_T[exports.SupportNetworks.POLYGON_ZKEVM] = SupportedChainIdTestnet.POLYGON_ZKEM, _CHAIN_NAMES_TO_IDS_T);
|
|
922
|
+
var CHAIN_NAMES_TO_IDS_TESTNET = (_CHAIN_NAMES_TO_IDS_T = {}, _CHAIN_NAMES_TO_IDS_T[exports.SupportNetworks.ETHEREUM] = SupportedChainIdTestnet.ETHEREUM, _CHAIN_NAMES_TO_IDS_T[exports.SupportNetworks.POLYGON] = SupportedChainIdTestnet.POLYGON, _CHAIN_NAMES_TO_IDS_T[exports.SupportNetworks.AVALANCHE] = SupportedChainIdTestnet.AVALANCHE, _CHAIN_NAMES_TO_IDS_T[exports.SupportNetworks.BSC] = SupportedChainIdTestnet.BSC, _CHAIN_NAMES_TO_IDS_T[exports.SupportNetworks.OPTIMISM] = SupportedChainIdTestnet.OPTIMISM, _CHAIN_NAMES_TO_IDS_T[exports.SupportNetworks.ARBITRUM] = SupportedChainIdTestnet.ARBITRUM, _CHAIN_NAMES_TO_IDS_T[exports.SupportNetworks.POLYGON_ZKEVM] = SupportedChainIdTestnet.POLYGON_ZKEM, _CHAIN_NAMES_TO_IDS_T[exports.SupportNetworks.BASE] = SupportedChainIdTestnet.BASE, _CHAIN_NAMES_TO_IDS_T);
|
|
903
923
|
var SupportedChainIdMainnet;
|
|
904
924
|
(function (SupportedChainIdMainnet) {
|
|
905
925
|
SupportedChainIdMainnet[SupportedChainIdMainnet["ETHEREUM"] = 1] = "ETHEREUM";
|
|
@@ -909,14 +929,15 @@ var SupportedChainIdMainnet;
|
|
|
909
929
|
SupportedChainIdMainnet[SupportedChainIdMainnet["ARBITRUM"] = 42161] = "ARBITRUM";
|
|
910
930
|
SupportedChainIdMainnet[SupportedChainIdMainnet["OPTIMISM"] = 10] = "OPTIMISM";
|
|
911
931
|
SupportedChainIdMainnet[SupportedChainIdMainnet["POLYGON_ZKEM"] = 1101] = "POLYGON_ZKEM";
|
|
932
|
+
SupportedChainIdMainnet[SupportedChainIdMainnet["BASE"] = 8453] = "BASE";
|
|
912
933
|
})(SupportedChainIdMainnet || (SupportedChainIdMainnet = {}));
|
|
913
|
-
var CHAIN_NAMES_TO_IDS_MAINNET = (_CHAIN_NAMES_TO_IDS_M = {}, _CHAIN_NAMES_TO_IDS_M[exports.SupportNetworks.ETHEREUM] = SupportedChainIdMainnet.ETHEREUM, _CHAIN_NAMES_TO_IDS_M[exports.SupportNetworks.POLYGON] = SupportedChainIdMainnet.POLYGON, _CHAIN_NAMES_TO_IDS_M[exports.SupportNetworks.AVALANCHE] = SupportedChainIdMainnet.AVALANCHE, _CHAIN_NAMES_TO_IDS_M[exports.SupportNetworks.BSC] = SupportedChainIdMainnet.BSC, _CHAIN_NAMES_TO_IDS_M[exports.SupportNetworks.OPTIMISM] = SupportedChainIdMainnet.OPTIMISM, _CHAIN_NAMES_TO_IDS_M[exports.SupportNetworks.ARBITRUM] = SupportedChainIdMainnet.ARBITRUM, _CHAIN_NAMES_TO_IDS_M[exports.SupportNetworks.POLYGON_ZKEVM] = SupportedChainIdMainnet.POLYGON_ZKEM, _CHAIN_NAMES_TO_IDS_M);
|
|
914
|
-
var CHAIN_NAMES_TO_STRING = (_CHAIN_NAMES_TO_STRIN = {}, _CHAIN_NAMES_TO_STRIN[exports.SupportNetworks.ETHEREUM] = 'Ethereum', _CHAIN_NAMES_TO_STRIN[exports.SupportNetworks.POLYGON] = 'Polygon', _CHAIN_NAMES_TO_STRIN[exports.SupportNetworks.AVALANCHE] = 'Avalanche', _CHAIN_NAMES_TO_STRIN[exports.SupportNetworks.SOLANA] = 'Solana', _CHAIN_NAMES_TO_STRIN[exports.SupportNetworks.BSC] = 'BNB Smart Chain', _CHAIN_NAMES_TO_STRIN[exports.SupportNetworks.OPTIMISM] = 'Optimism', _CHAIN_NAMES_TO_STRIN[exports.SupportNetworks.ARBITRUM] = 'Arbitrum', _CHAIN_NAMES_TO_STRIN[exports.SupportNetworks.POLYGON_ZKEVM] = 'Polygon zkEVM', _CHAIN_NAMES_TO_STRIN[exports.SupportNetworks.TRON] = 'Tron', _CHAIN_NAMES_TO_STRIN[exports.SupportNetworks.FIAT] = 'Pay with FIAT', _CHAIN_NAMES_TO_STRIN[exports.SupportNetworks.BTC] = 'Bitcoin', _CHAIN_NAMES_TO_STRIN);
|
|
915
|
-
var CHAIN_STRING_TO_NAME = (_CHAIN_STRING_TO_NAME = {}, _CHAIN_STRING_TO_NAME['Ethereum'] = exports.SupportNetworks.ETHEREUM, _CHAIN_STRING_TO_NAME['Polygon'] = exports.SupportNetworks.POLYGON, _CHAIN_STRING_TO_NAME['Avalanche'] = exports.SupportNetworks.AVALANCHE, _CHAIN_STRING_TO_NAME['Solana'] = exports.SupportNetworks.SOLANA, _CHAIN_STRING_TO_NAME['Binance'] = exports.SupportNetworks.BSC, _CHAIN_STRING_TO_NAME['Optimism'] = exports.SupportNetworks.OPTIMISM, _CHAIN_STRING_TO_NAME['Arbitrum'] = exports.SupportNetworks.ARBITRUM, _CHAIN_STRING_TO_NAME['Polygon zkEVM'] = exports.SupportNetworks.POLYGON_ZKEVM, _CHAIN_STRING_TO_NAME['Tron'] = exports.SupportNetworks.TRON, _CHAIN_STRING_TO_NAME['Pay with FIAT'] = exports.SupportNetworks.FIAT, _CHAIN_STRING_TO_NAME['Bitcoin'] = exports.SupportNetworks.BTC, _CHAIN_STRING_TO_NAME);
|
|
916
|
-
var CHAIN_NAMES_TO_EXPLORER_TESTNET = (_CHAIN_NAMES_TO_EXPLO = {}, _CHAIN_NAMES_TO_EXPLO[exports.SupportNetworks.ETHEREUM] = 'sepolia.etherscan.io', _CHAIN_NAMES_TO_EXPLO[exports.SupportNetworks.POLYGON] = 'www.oklink.com/amoy', _CHAIN_NAMES_TO_EXPLO[exports.SupportNetworks.AVALANCHE] = 'testnet.snowtrace.io', _CHAIN_NAMES_TO_EXPLO[exports.SupportNetworks.SOLANA] = 'solscan.io', _CHAIN_NAMES_TO_EXPLO[exports.SupportNetworks.BSC] = 'testnet.bscscan.com', _CHAIN_NAMES_TO_EXPLO[exports.SupportNetworks.OPTIMISM] = 'sepolia-optimism.etherscan.io', _CHAIN_NAMES_TO_EXPLO[exports.SupportNetworks.ARBITRUM] = 'sepolia.arbiscan.io', _CHAIN_NAMES_TO_EXPLO[exports.SupportNetworks.POLYGON_ZKEVM] = 'cardona-zkevm.polygonscan.com', _CHAIN_NAMES_TO_EXPLO[exports.SupportNetworks.TRON] = 'nile.tronscan.org/#', _CHAIN_NAMES_TO_EXPLO[exports.SupportNetworks.BTC] = 'mempool.space/testnet', _CHAIN_NAMES_TO_EXPLO);
|
|
917
|
-
var CHAIN_NAMES_TO_EXPLORER_MAINNET = (_CHAIN_NAMES_TO_EXPLO2 = {}, _CHAIN_NAMES_TO_EXPLO2[exports.SupportNetworks.ETHEREUM] = 'etherscan.io', _CHAIN_NAMES_TO_EXPLO2[exports.SupportNetworks.POLYGON] = 'polygonscan.com', _CHAIN_NAMES_TO_EXPLO2[exports.SupportNetworks.AVALANCHE] = 'snowtrace.io', _CHAIN_NAMES_TO_EXPLO2[exports.SupportNetworks.SOLANA] = 'solscan.io', _CHAIN_NAMES_TO_EXPLO2[exports.SupportNetworks.BSC] = 'bscscan.com', _CHAIN_NAMES_TO_EXPLO2[exports.SupportNetworks.OPTIMISM] = 'optimistic.etherscan.io', _CHAIN_NAMES_TO_EXPLO2[exports.SupportNetworks.ARBITRUM] = 'arbiscan.io', _CHAIN_NAMES_TO_EXPLO2[exports.SupportNetworks.POLYGON_ZKEVM] = 'zkevm.polygonscan.com', _CHAIN_NAMES_TO_EXPLO2[exports.SupportNetworks.TRON] = 'tronscan.org/#', _CHAIN_NAMES_TO_EXPLO2[exports.SupportNetworks.BTC] = 'mempool.space', _CHAIN_NAMES_TO_EXPLO2);
|
|
918
|
-
var CHAIN_IDS_TO_NAMES_TESTNET = (_CHAIN_IDS_TO_NAMES_T = {}, _CHAIN_IDS_TO_NAMES_T[SupportedChainIdTestnet.ETHEREUM] = exports.SupportNetworks.ETHEREUM, _CHAIN_IDS_TO_NAMES_T[SupportedChainIdTestnet.POLYGON] = exports.SupportNetworks.POLYGON, _CHAIN_IDS_TO_NAMES_T[SupportedChainIdTestnet.AVALANCHE] = exports.SupportNetworks.AVALANCHE, _CHAIN_IDS_TO_NAMES_T[SupportedChainIdTestnet.BSC] = exports.SupportNetworks.BSC, _CHAIN_IDS_TO_NAMES_T[SupportedChainIdTestnet.OPTIMISM] = exports.SupportNetworks.OPTIMISM, _CHAIN_IDS_TO_NAMES_T[SupportedChainIdTestnet.ARBITRUM] = exports.SupportNetworks.ARBITRUM, _CHAIN_IDS_TO_NAMES_T[SupportedChainIdTestnet.POLYGON_ZKEM] = exports.SupportNetworks.POLYGON_ZKEVM, _CHAIN_IDS_TO_NAMES_T);
|
|
919
|
-
var CHAIN_IDS_TO_NAMES_MAINNET = (_CHAIN_IDS_TO_NAMES_M = {}, _CHAIN_IDS_TO_NAMES_M[SupportedChainIdMainnet.ETHEREUM] = exports.SupportNetworks.ETHEREUM, _CHAIN_IDS_TO_NAMES_M[SupportedChainIdMainnet.POLYGON] = exports.SupportNetworks.POLYGON, _CHAIN_IDS_TO_NAMES_M[SupportedChainIdMainnet.AVALANCHE] = exports.SupportNetworks.AVALANCHE, _CHAIN_IDS_TO_NAMES_M[SupportedChainIdMainnet.BSC] = exports.SupportNetworks.BSC, _CHAIN_IDS_TO_NAMES_M[SupportedChainIdMainnet.OPTIMISM] = exports.SupportNetworks.OPTIMISM, _CHAIN_IDS_TO_NAMES_M[SupportedChainIdMainnet.ARBITRUM] = exports.SupportNetworks.ARBITRUM, _CHAIN_IDS_TO_NAMES_M[SupportedChainIdMainnet.POLYGON_ZKEM] = exports.SupportNetworks.POLYGON_ZKEVM, _CHAIN_IDS_TO_NAMES_M);
|
|
934
|
+
var CHAIN_NAMES_TO_IDS_MAINNET = (_CHAIN_NAMES_TO_IDS_M = {}, _CHAIN_NAMES_TO_IDS_M[exports.SupportNetworks.ETHEREUM] = SupportedChainIdMainnet.ETHEREUM, _CHAIN_NAMES_TO_IDS_M[exports.SupportNetworks.POLYGON] = SupportedChainIdMainnet.POLYGON, _CHAIN_NAMES_TO_IDS_M[exports.SupportNetworks.AVALANCHE] = SupportedChainIdMainnet.AVALANCHE, _CHAIN_NAMES_TO_IDS_M[exports.SupportNetworks.BSC] = SupportedChainIdMainnet.BSC, _CHAIN_NAMES_TO_IDS_M[exports.SupportNetworks.OPTIMISM] = SupportedChainIdMainnet.OPTIMISM, _CHAIN_NAMES_TO_IDS_M[exports.SupportNetworks.ARBITRUM] = SupportedChainIdMainnet.ARBITRUM, _CHAIN_NAMES_TO_IDS_M[exports.SupportNetworks.POLYGON_ZKEVM] = SupportedChainIdMainnet.POLYGON_ZKEM, _CHAIN_NAMES_TO_IDS_M[exports.SupportNetworks.BASE] = SupportedChainIdMainnet.BASE, _CHAIN_NAMES_TO_IDS_M);
|
|
935
|
+
var CHAIN_NAMES_TO_STRING = (_CHAIN_NAMES_TO_STRIN = {}, _CHAIN_NAMES_TO_STRIN[exports.SupportNetworks.ETHEREUM] = 'Ethereum', _CHAIN_NAMES_TO_STRIN[exports.SupportNetworks.POLYGON] = 'Polygon', _CHAIN_NAMES_TO_STRIN[exports.SupportNetworks.AVALANCHE] = 'Avalanche', _CHAIN_NAMES_TO_STRIN[exports.SupportNetworks.SOLANA] = 'Solana', _CHAIN_NAMES_TO_STRIN[exports.SupportNetworks.BSC] = 'BNB Smart Chain', _CHAIN_NAMES_TO_STRIN[exports.SupportNetworks.OPTIMISM] = 'Optimism', _CHAIN_NAMES_TO_STRIN[exports.SupportNetworks.ARBITRUM] = 'Arbitrum', _CHAIN_NAMES_TO_STRIN[exports.SupportNetworks.POLYGON_ZKEVM] = 'Polygon zkEVM', _CHAIN_NAMES_TO_STRIN[exports.SupportNetworks.TRON] = 'Tron', _CHAIN_NAMES_TO_STRIN[exports.SupportNetworks.FIAT] = 'Pay with FIAT', _CHAIN_NAMES_TO_STRIN[exports.SupportNetworks.BTC] = 'Bitcoin', _CHAIN_NAMES_TO_STRIN[exports.SupportNetworks.BASE] = 'Base', _CHAIN_NAMES_TO_STRIN);
|
|
936
|
+
var CHAIN_STRING_TO_NAME = (_CHAIN_STRING_TO_NAME = {}, _CHAIN_STRING_TO_NAME['Ethereum'] = exports.SupportNetworks.ETHEREUM, _CHAIN_STRING_TO_NAME['Polygon'] = exports.SupportNetworks.POLYGON, _CHAIN_STRING_TO_NAME['Avalanche'] = exports.SupportNetworks.AVALANCHE, _CHAIN_STRING_TO_NAME['Solana'] = exports.SupportNetworks.SOLANA, _CHAIN_STRING_TO_NAME['Binance'] = exports.SupportNetworks.BSC, _CHAIN_STRING_TO_NAME['Optimism'] = exports.SupportNetworks.OPTIMISM, _CHAIN_STRING_TO_NAME['Arbitrum'] = exports.SupportNetworks.ARBITRUM, _CHAIN_STRING_TO_NAME['Polygon zkEVM'] = exports.SupportNetworks.POLYGON_ZKEVM, _CHAIN_STRING_TO_NAME['Tron'] = exports.SupportNetworks.TRON, _CHAIN_STRING_TO_NAME['Pay with FIAT'] = exports.SupportNetworks.FIAT, _CHAIN_STRING_TO_NAME['Bitcoin'] = exports.SupportNetworks.BTC, _CHAIN_STRING_TO_NAME['Base'] = exports.SupportNetworks.BASE, _CHAIN_STRING_TO_NAME);
|
|
937
|
+
var CHAIN_NAMES_TO_EXPLORER_TESTNET = (_CHAIN_NAMES_TO_EXPLO = {}, _CHAIN_NAMES_TO_EXPLO[exports.SupportNetworks.ETHEREUM] = 'sepolia.etherscan.io', _CHAIN_NAMES_TO_EXPLO[exports.SupportNetworks.POLYGON] = 'www.oklink.com/amoy', _CHAIN_NAMES_TO_EXPLO[exports.SupportNetworks.AVALANCHE] = 'testnet.snowtrace.io', _CHAIN_NAMES_TO_EXPLO[exports.SupportNetworks.SOLANA] = 'solscan.io', _CHAIN_NAMES_TO_EXPLO[exports.SupportNetworks.BSC] = 'testnet.bscscan.com', _CHAIN_NAMES_TO_EXPLO[exports.SupportNetworks.OPTIMISM] = 'sepolia-optimism.etherscan.io', _CHAIN_NAMES_TO_EXPLO[exports.SupportNetworks.ARBITRUM] = 'sepolia.arbiscan.io', _CHAIN_NAMES_TO_EXPLO[exports.SupportNetworks.POLYGON_ZKEVM] = 'cardona-zkevm.polygonscan.com', _CHAIN_NAMES_TO_EXPLO[exports.SupportNetworks.TRON] = 'nile.tronscan.org/#', _CHAIN_NAMES_TO_EXPLO[exports.SupportNetworks.BTC] = 'mempool.space/testnet', _CHAIN_NAMES_TO_EXPLO[exports.SupportNetworks.BASE] = 'sepolia.basescan.org', _CHAIN_NAMES_TO_EXPLO);
|
|
938
|
+
var CHAIN_NAMES_TO_EXPLORER_MAINNET = (_CHAIN_NAMES_TO_EXPLO2 = {}, _CHAIN_NAMES_TO_EXPLO2[exports.SupportNetworks.ETHEREUM] = 'etherscan.io', _CHAIN_NAMES_TO_EXPLO2[exports.SupportNetworks.POLYGON] = 'polygonscan.com', _CHAIN_NAMES_TO_EXPLO2[exports.SupportNetworks.AVALANCHE] = 'snowtrace.io', _CHAIN_NAMES_TO_EXPLO2[exports.SupportNetworks.SOLANA] = 'solscan.io', _CHAIN_NAMES_TO_EXPLO2[exports.SupportNetworks.BSC] = 'bscscan.com', _CHAIN_NAMES_TO_EXPLO2[exports.SupportNetworks.OPTIMISM] = 'optimistic.etherscan.io', _CHAIN_NAMES_TO_EXPLO2[exports.SupportNetworks.ARBITRUM] = 'arbiscan.io', _CHAIN_NAMES_TO_EXPLO2[exports.SupportNetworks.POLYGON_ZKEVM] = 'zkevm.polygonscan.com', _CHAIN_NAMES_TO_EXPLO2[exports.SupportNetworks.TRON] = 'tronscan.org/#', _CHAIN_NAMES_TO_EXPLO2[exports.SupportNetworks.BTC] = 'mempool.space', _CHAIN_NAMES_TO_EXPLO2[exports.SupportNetworks.BASE] = 'basescan.org', _CHAIN_NAMES_TO_EXPLO2);
|
|
939
|
+
var CHAIN_IDS_TO_NAMES_TESTNET = (_CHAIN_IDS_TO_NAMES_T = {}, _CHAIN_IDS_TO_NAMES_T[SupportedChainIdTestnet.ETHEREUM] = exports.SupportNetworks.ETHEREUM, _CHAIN_IDS_TO_NAMES_T[SupportedChainIdTestnet.POLYGON] = exports.SupportNetworks.POLYGON, _CHAIN_IDS_TO_NAMES_T[SupportedChainIdTestnet.AVALANCHE] = exports.SupportNetworks.AVALANCHE, _CHAIN_IDS_TO_NAMES_T[SupportedChainIdTestnet.BSC] = exports.SupportNetworks.BSC, _CHAIN_IDS_TO_NAMES_T[SupportedChainIdTestnet.OPTIMISM] = exports.SupportNetworks.OPTIMISM, _CHAIN_IDS_TO_NAMES_T[SupportedChainIdTestnet.ARBITRUM] = exports.SupportNetworks.ARBITRUM, _CHAIN_IDS_TO_NAMES_T[SupportedChainIdTestnet.POLYGON_ZKEM] = exports.SupportNetworks.POLYGON_ZKEVM, _CHAIN_IDS_TO_NAMES_T[SupportedChainIdTestnet.BASE] = exports.SupportNetworks.BASE, _CHAIN_IDS_TO_NAMES_T);
|
|
940
|
+
var CHAIN_IDS_TO_NAMES_MAINNET = (_CHAIN_IDS_TO_NAMES_M = {}, _CHAIN_IDS_TO_NAMES_M[SupportedChainIdMainnet.ETHEREUM] = exports.SupportNetworks.ETHEREUM, _CHAIN_IDS_TO_NAMES_M[SupportedChainIdMainnet.POLYGON] = exports.SupportNetworks.POLYGON, _CHAIN_IDS_TO_NAMES_M[SupportedChainIdMainnet.AVALANCHE] = exports.SupportNetworks.AVALANCHE, _CHAIN_IDS_TO_NAMES_M[SupportedChainIdMainnet.BSC] = exports.SupportNetworks.BSC, _CHAIN_IDS_TO_NAMES_M[SupportedChainIdMainnet.OPTIMISM] = exports.SupportNetworks.OPTIMISM, _CHAIN_IDS_TO_NAMES_M[SupportedChainIdMainnet.ARBITRUM] = exports.SupportNetworks.ARBITRUM, _CHAIN_IDS_TO_NAMES_M[SupportedChainIdMainnet.POLYGON_ZKEM] = exports.SupportNetworks.POLYGON_ZKEVM, _CHAIN_IDS_TO_NAMES_M[SupportedChainIdMainnet.BASE] = exports.SupportNetworks.BASE, _CHAIN_IDS_TO_NAMES_M);
|
|
920
941
|
var networkOptions = [{
|
|
921
942
|
id: exports.SupportNetworks.ARBITRUM,
|
|
922
943
|
label: 'Arbitrum',
|
|
@@ -925,6 +946,10 @@ var networkOptions = [{
|
|
|
925
946
|
id: exports.SupportNetworks.AVALANCHE,
|
|
926
947
|
label: 'Avalanche',
|
|
927
948
|
icon: Avalanche
|
|
949
|
+
}, {
|
|
950
|
+
id: exports.SupportNetworks.BASE,
|
|
951
|
+
label: 'Base',
|
|
952
|
+
icon: Solana$1
|
|
928
953
|
}, {
|
|
929
954
|
id: exports.SupportNetworks.BSC,
|
|
930
955
|
label: 'Binance',
|
|
@@ -972,7 +997,7 @@ var getNetworkOption = function getNetworkOption(id) {
|
|
|
972
997
|
var SOLANA_HOST_DEVNET = web3_js.clusterApiUrl('devnet');
|
|
973
998
|
var SOLANA_HOST_MAINNET = web3_js.clusterApiUrl('mainnet-beta');
|
|
974
999
|
var isEVMChain = function isEVMChain(chainId) {
|
|
975
|
-
return chainId === exports.SupportNetworks.ETHEREUM || chainId === exports.SupportNetworks.POLYGON || chainId === exports.SupportNetworks.AVALANCHE || chainId === exports.SupportNetworks.BSC || chainId === exports.SupportNetworks.OPTIMISM || chainId === exports.SupportNetworks.ARBITRUM || chainId === exports.SupportNetworks.POLYGON_ZKEVM;
|
|
1000
|
+
return chainId === exports.SupportNetworks.ETHEREUM || chainId === exports.SupportNetworks.POLYGON || chainId === exports.SupportNetworks.AVALANCHE || chainId === exports.SupportNetworks.BSC || chainId === exports.SupportNetworks.OPTIMISM || chainId === exports.SupportNetworks.ARBITRUM || chainId === exports.SupportNetworks.POLYGON_ZKEVM || chainId === exports.SupportNetworks.BASE;
|
|
976
1001
|
};
|
|
977
1002
|
var COIN_LIST = {
|
|
978
1003
|
USDK: {
|
|
@@ -3122,7 +3147,7 @@ var StepBox = function StepBox(_ref) {
|
|
|
3122
3147
|
}) : 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", {
|
|
3123
3148
|
className: 'info-item'
|
|
3124
3149
|
}, React__default.createElement("p", null, "Kima TX ID:", ' ', React__default.createElement(ExternalLink, {
|
|
3125
|
-
to: explorerUrl + "/transactions
|
|
3150
|
+
to: explorerUrl + "/transactions/?tx=" + (data === null || data === void 0 ? void 0 : data.kimaTxHash)
|
|
3126
3151
|
}, getShortenedAddress((data === null || data === void 0 ? void 0 : data.kimaTxHash) || '')), React__default.createElement(CopyButton, {
|
|
3127
3152
|
text: data === null || data === void 0 ? void 0 : data.kimaTxHash
|
|
3128
3153
|
}))) : null, index === 1 && data !== null && data !== void 0 && data.tssPullHash ? React__default.createElement("div", {
|
|
@@ -7962,7 +7987,7 @@ function output(out, instance) {
|
|
|
7962
7987
|
exports.output = output;
|
|
7963
7988
|
const assert = { number, bool, bytes, hash, exists, output };
|
|
7964
7989
|
exports.default = assert;
|
|
7965
|
-
|
|
7990
|
+
|
|
7966
7991
|
});
|
|
7967
7992
|
|
|
7968
7993
|
unwrapExports(_assert);
|
|
@@ -7971,7 +7996,7 @@ var crypto = createCommonjsModule(function (module, exports) {
|
|
|
7971
7996
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7972
7997
|
exports.crypto = void 0;
|
|
7973
7998
|
exports.crypto = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined;
|
|
7974
|
-
|
|
7999
|
+
|
|
7975
8000
|
});
|
|
7976
8001
|
|
|
7977
8002
|
unwrapExports(crypto);
|
|
@@ -8173,7 +8198,7 @@ function randomBytes(bytesLength = 32) {
|
|
|
8173
8198
|
throw new Error('crypto.getRandomValues must be defined');
|
|
8174
8199
|
}
|
|
8175
8200
|
exports.randomBytes = randomBytes;
|
|
8176
|
-
|
|
8201
|
+
|
|
8177
8202
|
});
|
|
8178
8203
|
|
|
8179
8204
|
unwrapExports(utils);
|
|
@@ -8295,7 +8320,7 @@ class SHA2 extends utils.Hash {
|
|
|
8295
8320
|
}
|
|
8296
8321
|
}
|
|
8297
8322
|
exports.SHA2 = SHA2;
|
|
8298
|
-
|
|
8323
|
+
|
|
8299
8324
|
});
|
|
8300
8325
|
|
|
8301
8326
|
unwrapExports(_sha2);
|
|
@@ -8428,7 +8453,7 @@ class SHA224 extends SHA256 {
|
|
|
8428
8453
|
*/
|
|
8429
8454
|
exports.sha256 = (0, utils.wrapConstructor)(() => new SHA256());
|
|
8430
8455
|
exports.sha224 = (0, utils.wrapConstructor)(() => new SHA224());
|
|
8431
|
-
|
|
8456
|
+
|
|
8432
8457
|
});
|
|
8433
8458
|
|
|
8434
8459
|
unwrapExports(sha256);
|
|
@@ -8504,7 +8529,7 @@ function createReclaimPsbt(reclaimerAddress, htlcAmount, htlcTimeout, htlcScript
|
|
|
8504
8529
|
});
|
|
8505
8530
|
var psbt = tx.toPSBT(0);
|
|
8506
8531
|
console.log('txHex = ' + tx.hex);
|
|
8507
|
-
var psbtB64 = base.base64.encode(psbt);
|
|
8532
|
+
var psbtB64 = base$1.base64.encode(psbt);
|
|
8508
8533
|
return psbtB64;
|
|
8509
8534
|
}
|
|
8510
8535
|
|
|
@@ -8811,6 +8836,8 @@ const isFormData = (thing) => {
|
|
|
8811
8836
|
*/
|
|
8812
8837
|
const isURLSearchParams = kindOfTest('URLSearchParams');
|
|
8813
8838
|
|
|
8839
|
+
const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);
|
|
8840
|
+
|
|
8814
8841
|
/**
|
|
8815
8842
|
* Trim excess whitespace off the beginning and end of a string
|
|
8816
8843
|
*
|
|
@@ -9199,8 +9226,7 @@ const toObjectSet = (arrayOrString, delimiter) => {
|
|
|
9199
9226
|
const noop = () => {};
|
|
9200
9227
|
|
|
9201
9228
|
const toFiniteNumber = (value, defaultValue) => {
|
|
9202
|
-
value = +value;
|
|
9203
|
-
return Number.isFinite(value) ? value : defaultValue;
|
|
9229
|
+
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
|
9204
9230
|
};
|
|
9205
9231
|
|
|
9206
9232
|
const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
|
|
@@ -9270,6 +9296,36 @@ const isAsyncFn = kindOfTest('AsyncFunction');
|
|
|
9270
9296
|
const isThenable = (thing) =>
|
|
9271
9297
|
thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
|
|
9272
9298
|
|
|
9299
|
+
// original code
|
|
9300
|
+
// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
|
|
9301
|
+
|
|
9302
|
+
const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
9303
|
+
if (setImmediateSupported) {
|
|
9304
|
+
return setImmediate;
|
|
9305
|
+
}
|
|
9306
|
+
|
|
9307
|
+
return postMessageSupported ? ((token, callbacks) => {
|
|
9308
|
+
_global.addEventListener("message", ({source, data}) => {
|
|
9309
|
+
if (source === _global && data === token) {
|
|
9310
|
+
callbacks.length && callbacks.shift()();
|
|
9311
|
+
}
|
|
9312
|
+
}, false);
|
|
9313
|
+
|
|
9314
|
+
return (cb) => {
|
|
9315
|
+
callbacks.push(cb);
|
|
9316
|
+
_global.postMessage(token, "*");
|
|
9317
|
+
}
|
|
9318
|
+
})(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
|
|
9319
|
+
})(
|
|
9320
|
+
typeof setImmediate === 'function',
|
|
9321
|
+
isFunction(_global.postMessage)
|
|
9322
|
+
);
|
|
9323
|
+
|
|
9324
|
+
const asap = typeof queueMicrotask !== 'undefined' ?
|
|
9325
|
+
queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate);
|
|
9326
|
+
|
|
9327
|
+
// *********************
|
|
9328
|
+
|
|
9273
9329
|
var utils$1 = {
|
|
9274
9330
|
isArray,
|
|
9275
9331
|
isArrayBuffer,
|
|
@@ -9281,6 +9337,10 @@ var utils$1 = {
|
|
|
9281
9337
|
isBoolean,
|
|
9282
9338
|
isObject,
|
|
9283
9339
|
isPlainObject,
|
|
9340
|
+
isReadableStream,
|
|
9341
|
+
isRequest,
|
|
9342
|
+
isResponse,
|
|
9343
|
+
isHeaders,
|
|
9284
9344
|
isUndefined,
|
|
9285
9345
|
isDate,
|
|
9286
9346
|
isFile,
|
|
@@ -9321,7 +9381,9 @@ var utils$1 = {
|
|
|
9321
9381
|
isSpecCompliantForm,
|
|
9322
9382
|
toJSONObject,
|
|
9323
9383
|
isAsyncFn,
|
|
9324
|
-
isThenable
|
|
9384
|
+
isThenable,
|
|
9385
|
+
setImmediate: _setImmediate,
|
|
9386
|
+
asap
|
|
9325
9387
|
};
|
|
9326
9388
|
|
|
9327
9389
|
/**
|
|
@@ -9349,7 +9411,10 @@ function AxiosError(message, code, config, request, response) {
|
|
|
9349
9411
|
code && (this.code = code);
|
|
9350
9412
|
config && (this.config = config);
|
|
9351
9413
|
request && (this.request = request);
|
|
9352
|
-
|
|
9414
|
+
if (response) {
|
|
9415
|
+
this.response = response;
|
|
9416
|
+
this.status = response.status ? response.status : null;
|
|
9417
|
+
}
|
|
9353
9418
|
}
|
|
9354
9419
|
|
|
9355
9420
|
utils$1.inherits(AxiosError, Error, {
|
|
@@ -9369,7 +9434,7 @@ utils$1.inherits(AxiosError, Error, {
|
|
|
9369
9434
|
// Axios
|
|
9370
9435
|
config: utils$1.toJSONObject(this.config),
|
|
9371
9436
|
code: this.code,
|
|
9372
|
-
status: this.
|
|
9437
|
+
status: this.status
|
|
9373
9438
|
};
|
|
9374
9439
|
}
|
|
9375
9440
|
});
|
|
@@ -9835,6 +9900,8 @@ var platform = {
|
|
|
9835
9900
|
|
|
9836
9901
|
const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
9837
9902
|
|
|
9903
|
+
const _navigator = typeof navigator === 'object' && navigator || undefined;
|
|
9904
|
+
|
|
9838
9905
|
/**
|
|
9839
9906
|
* Determine if we're running in a standard browser environment
|
|
9840
9907
|
*
|
|
@@ -9852,10 +9919,8 @@ const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'unde
|
|
|
9852
9919
|
*
|
|
9853
9920
|
* @returns {boolean}
|
|
9854
9921
|
*/
|
|
9855
|
-
const hasStandardBrowserEnv =
|
|
9856
|
-
(product)
|
|
9857
|
-
return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
|
|
9858
|
-
})(typeof navigator !== 'undefined' && navigator.product);
|
|
9922
|
+
const hasStandardBrowserEnv = hasBrowserEnv &&
|
|
9923
|
+
(!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
|
|
9859
9924
|
|
|
9860
9925
|
/**
|
|
9861
9926
|
* Determine if we're running in a standard browser webWorker environment
|
|
@@ -9875,11 +9940,15 @@ const hasStandardBrowserWebWorkerEnv = (() => {
|
|
|
9875
9940
|
);
|
|
9876
9941
|
})();
|
|
9877
9942
|
|
|
9943
|
+
const origin = hasBrowserEnv && window.location.href || 'http://localhost';
|
|
9944
|
+
|
|
9878
9945
|
var utils$2 = {
|
|
9879
9946
|
__proto__: null,
|
|
9880
9947
|
hasBrowserEnv: hasBrowserEnv,
|
|
9881
9948
|
hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
|
|
9882
|
-
hasStandardBrowserEnv: hasStandardBrowserEnv
|
|
9949
|
+
hasStandardBrowserEnv: hasStandardBrowserEnv,
|
|
9950
|
+
navigator: _navigator,
|
|
9951
|
+
origin: origin
|
|
9883
9952
|
};
|
|
9884
9953
|
|
|
9885
9954
|
var platform$1 = {
|
|
@@ -10019,7 +10088,7 @@ const defaults = {
|
|
|
10019
10088
|
|
|
10020
10089
|
transitional: transitionalDefaults,
|
|
10021
10090
|
|
|
10022
|
-
adapter: ['xhr', 'http'],
|
|
10091
|
+
adapter: ['xhr', 'http', 'fetch'],
|
|
10023
10092
|
|
|
10024
10093
|
transformRequest: [function transformRequest(data, headers) {
|
|
10025
10094
|
const contentType = headers.getContentType() || '';
|
|
@@ -10040,7 +10109,8 @@ const defaults = {
|
|
|
10040
10109
|
utils$1.isBuffer(data) ||
|
|
10041
10110
|
utils$1.isStream(data) ||
|
|
10042
10111
|
utils$1.isFile(data) ||
|
|
10043
|
-
utils$1.isBlob(data)
|
|
10112
|
+
utils$1.isBlob(data) ||
|
|
10113
|
+
utils$1.isReadableStream(data)
|
|
10044
10114
|
) {
|
|
10045
10115
|
return data;
|
|
10046
10116
|
}
|
|
@@ -10083,6 +10153,10 @@ const defaults = {
|
|
|
10083
10153
|
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
10084
10154
|
const JSONRequested = this.responseType === 'json';
|
|
10085
10155
|
|
|
10156
|
+
if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
|
|
10157
|
+
return data;
|
|
10158
|
+
}
|
|
10159
|
+
|
|
10086
10160
|
if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
|
|
10087
10161
|
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
10088
10162
|
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
@@ -10284,6 +10358,10 @@ class AxiosHeaders {
|
|
|
10284
10358
|
setHeaders(header, valueOrRewrite);
|
|
10285
10359
|
} else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
10286
10360
|
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
10361
|
+
} else if (utils$1.isHeaders(header)) {
|
|
10362
|
+
for (const [key, value] of header.entries()) {
|
|
10363
|
+
setHeader(value, key, rewrite);
|
|
10364
|
+
}
|
|
10287
10365
|
} else {
|
|
10288
10366
|
header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
10289
10367
|
}
|
|
@@ -10549,96 +10627,153 @@ function settle(resolve, reject, response) {
|
|
|
10549
10627
|
}
|
|
10550
10628
|
}
|
|
10551
10629
|
|
|
10552
|
-
|
|
10630
|
+
function parseProtocol(url) {
|
|
10631
|
+
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
10632
|
+
return match && match[1] || '';
|
|
10633
|
+
}
|
|
10553
10634
|
|
|
10554
|
-
|
|
10555
|
-
|
|
10556
|
-
|
|
10557
|
-
|
|
10635
|
+
/**
|
|
10636
|
+
* Calculate data maxRate
|
|
10637
|
+
* @param {Number} [samplesCount= 10]
|
|
10638
|
+
* @param {Number} [min= 1000]
|
|
10639
|
+
* @returns {Function}
|
|
10640
|
+
*/
|
|
10641
|
+
function speedometer(samplesCount, min) {
|
|
10642
|
+
samplesCount = samplesCount || 10;
|
|
10643
|
+
const bytes = new Array(samplesCount);
|
|
10644
|
+
const timestamps = new Array(samplesCount);
|
|
10645
|
+
let head = 0;
|
|
10646
|
+
let tail = 0;
|
|
10647
|
+
let firstSampleTS;
|
|
10558
10648
|
|
|
10559
|
-
|
|
10649
|
+
min = min !== undefined ? min : 1000;
|
|
10560
10650
|
|
|
10561
|
-
|
|
10651
|
+
return function push(chunkLength) {
|
|
10652
|
+
const now = Date.now();
|
|
10562
10653
|
|
|
10563
|
-
|
|
10654
|
+
const startedAt = timestamps[tail];
|
|
10564
10655
|
|
|
10565
|
-
|
|
10656
|
+
if (!firstSampleTS) {
|
|
10657
|
+
firstSampleTS = now;
|
|
10658
|
+
}
|
|
10566
10659
|
|
|
10567
|
-
|
|
10568
|
-
|
|
10660
|
+
bytes[head] = chunkLength;
|
|
10661
|
+
timestamps[head] = now;
|
|
10569
10662
|
|
|
10570
|
-
|
|
10571
|
-
|
|
10572
|
-
return (match ? decodeURIComponent(match[3]) : null);
|
|
10573
|
-
},
|
|
10663
|
+
let i = tail;
|
|
10664
|
+
let bytesCount = 0;
|
|
10574
10665
|
|
|
10575
|
-
|
|
10576
|
-
|
|
10666
|
+
while (i !== head) {
|
|
10667
|
+
bytesCount += bytes[i++];
|
|
10668
|
+
i = i % samplesCount;
|
|
10577
10669
|
}
|
|
10578
|
-
}
|
|
10579
10670
|
|
|
10580
|
-
|
|
10671
|
+
head = (head + 1) % samplesCount;
|
|
10581
10672
|
|
|
10582
|
-
|
|
10583
|
-
|
|
10584
|
-
|
|
10585
|
-
read() {
|
|
10586
|
-
return null;
|
|
10587
|
-
},
|
|
10588
|
-
remove() {}
|
|
10589
|
-
};
|
|
10673
|
+
if (head === tail) {
|
|
10674
|
+
tail = (tail + 1) % samplesCount;
|
|
10675
|
+
}
|
|
10590
10676
|
|
|
10591
|
-
|
|
10592
|
-
|
|
10593
|
-
|
|
10594
|
-
* @param {string} url The URL to test
|
|
10595
|
-
*
|
|
10596
|
-
* @returns {boolean} True if the specified URL is absolute, otherwise false
|
|
10597
|
-
*/
|
|
10598
|
-
function isAbsoluteURL(url) {
|
|
10599
|
-
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
|
|
10600
|
-
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
|
|
10601
|
-
// by any combination of letters, digits, plus, period, or hyphen.
|
|
10602
|
-
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
10603
|
-
}
|
|
10677
|
+
if (now - firstSampleTS < min) {
|
|
10678
|
+
return;
|
|
10679
|
+
}
|
|
10604
10680
|
|
|
10605
|
-
|
|
10606
|
-
|
|
10607
|
-
*
|
|
10608
|
-
|
|
10609
|
-
* @param {string} relativeURL The relative URL
|
|
10610
|
-
*
|
|
10611
|
-
* @returns {string} The combined URL
|
|
10612
|
-
*/
|
|
10613
|
-
function combineURLs(baseURL, relativeURL) {
|
|
10614
|
-
return relativeURL
|
|
10615
|
-
? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '')
|
|
10616
|
-
: baseURL;
|
|
10681
|
+
const passed = startedAt && now - startedAt;
|
|
10682
|
+
|
|
10683
|
+
return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
|
|
10684
|
+
};
|
|
10617
10685
|
}
|
|
10618
10686
|
|
|
10619
10687
|
/**
|
|
10620
|
-
*
|
|
10621
|
-
*
|
|
10622
|
-
*
|
|
10623
|
-
*
|
|
10624
|
-
* @param {string} baseURL The base URL
|
|
10625
|
-
* @param {string} requestedURL Absolute or relative URL to combine
|
|
10626
|
-
*
|
|
10627
|
-
* @returns {string} The combined full path
|
|
10688
|
+
* Throttle decorator
|
|
10689
|
+
* @param {Function} fn
|
|
10690
|
+
* @param {Number} freq
|
|
10691
|
+
* @return {Function}
|
|
10628
10692
|
*/
|
|
10629
|
-
function
|
|
10630
|
-
|
|
10631
|
-
|
|
10632
|
-
|
|
10633
|
-
|
|
10693
|
+
function throttle(fn, freq) {
|
|
10694
|
+
let timestamp = 0;
|
|
10695
|
+
let threshold = 1000 / freq;
|
|
10696
|
+
let lastArgs;
|
|
10697
|
+
let timer;
|
|
10698
|
+
|
|
10699
|
+
const invoke = (args, now = Date.now()) => {
|
|
10700
|
+
timestamp = now;
|
|
10701
|
+
lastArgs = null;
|
|
10702
|
+
if (timer) {
|
|
10703
|
+
clearTimeout(timer);
|
|
10704
|
+
timer = null;
|
|
10705
|
+
}
|
|
10706
|
+
fn.apply(null, args);
|
|
10707
|
+
};
|
|
10708
|
+
|
|
10709
|
+
const throttled = (...args) => {
|
|
10710
|
+
const now = Date.now();
|
|
10711
|
+
const passed = now - timestamp;
|
|
10712
|
+
if ( passed >= threshold) {
|
|
10713
|
+
invoke(args, now);
|
|
10714
|
+
} else {
|
|
10715
|
+
lastArgs = args;
|
|
10716
|
+
if (!timer) {
|
|
10717
|
+
timer = setTimeout(() => {
|
|
10718
|
+
timer = null;
|
|
10719
|
+
invoke(lastArgs);
|
|
10720
|
+
}, threshold - passed);
|
|
10721
|
+
}
|
|
10722
|
+
}
|
|
10723
|
+
};
|
|
10724
|
+
|
|
10725
|
+
const flush = () => lastArgs && invoke(lastArgs);
|
|
10726
|
+
|
|
10727
|
+
return [throttled, flush];
|
|
10634
10728
|
}
|
|
10635
10729
|
|
|
10730
|
+
const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
10731
|
+
let bytesNotified = 0;
|
|
10732
|
+
const _speedometer = speedometer(50, 250);
|
|
10733
|
+
|
|
10734
|
+
return throttle(e => {
|
|
10735
|
+
const loaded = e.loaded;
|
|
10736
|
+
const total = e.lengthComputable ? e.total : undefined;
|
|
10737
|
+
const progressBytes = loaded - bytesNotified;
|
|
10738
|
+
const rate = _speedometer(progressBytes);
|
|
10739
|
+
const inRange = loaded <= total;
|
|
10740
|
+
|
|
10741
|
+
bytesNotified = loaded;
|
|
10742
|
+
|
|
10743
|
+
const data = {
|
|
10744
|
+
loaded,
|
|
10745
|
+
total,
|
|
10746
|
+
progress: total ? (loaded / total) : undefined,
|
|
10747
|
+
bytes: progressBytes,
|
|
10748
|
+
rate: rate ? rate : undefined,
|
|
10749
|
+
estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
|
|
10750
|
+
event: e,
|
|
10751
|
+
lengthComputable: total != null,
|
|
10752
|
+
[isDownloadStream ? 'download' : 'upload']: true
|
|
10753
|
+
};
|
|
10754
|
+
|
|
10755
|
+
listener(data);
|
|
10756
|
+
}, freq);
|
|
10757
|
+
};
|
|
10758
|
+
|
|
10759
|
+
const progressEventDecorator = (total, throttled) => {
|
|
10760
|
+
const lengthComputable = total != null;
|
|
10761
|
+
|
|
10762
|
+
return [(loaded) => throttled[0]({
|
|
10763
|
+
lengthComputable,
|
|
10764
|
+
total,
|
|
10765
|
+
loaded
|
|
10766
|
+
}), throttled[1]];
|
|
10767
|
+
};
|
|
10768
|
+
|
|
10769
|
+
const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
|
|
10770
|
+
|
|
10636
10771
|
var isURLSameOrigin = platform$1.hasStandardBrowserEnv ?
|
|
10637
10772
|
|
|
10638
10773
|
// Standard browser envs have full support of the APIs needed to test
|
|
10639
10774
|
// whether the request URL is of the same origin as current location.
|
|
10640
10775
|
(function standardBrowserEnv() {
|
|
10641
|
-
const msie = /(msie|trident)/i.test(navigator.userAgent);
|
|
10776
|
+
const msie = platform$1.navigator && /(msie|trident)/i.test(platform$1.navigator.userAgent);
|
|
10642
10777
|
const urlParsingNode = document.createElement('a');
|
|
10643
10778
|
let originURL;
|
|
10644
10779
|
|
|
@@ -10696,137 +10831,267 @@ var isURLSameOrigin = platform$1.hasStandardBrowserEnv ?
|
|
|
10696
10831
|
};
|
|
10697
10832
|
})();
|
|
10698
10833
|
|
|
10699
|
-
|
|
10700
|
-
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
10701
|
-
return match && match[1] || '';
|
|
10702
|
-
}
|
|
10703
|
-
|
|
10704
|
-
/**
|
|
10705
|
-
* Calculate data maxRate
|
|
10706
|
-
* @param {Number} [samplesCount= 10]
|
|
10707
|
-
* @param {Number} [min= 1000]
|
|
10708
|
-
* @returns {Function}
|
|
10709
|
-
*/
|
|
10710
|
-
function speedometer(samplesCount, min) {
|
|
10711
|
-
samplesCount = samplesCount || 10;
|
|
10712
|
-
const bytes = new Array(samplesCount);
|
|
10713
|
-
const timestamps = new Array(samplesCount);
|
|
10714
|
-
let head = 0;
|
|
10715
|
-
let tail = 0;
|
|
10716
|
-
let firstSampleTS;
|
|
10717
|
-
|
|
10718
|
-
min = min !== undefined ? min : 1000;
|
|
10834
|
+
var cookies = platform$1.hasStandardBrowserEnv ?
|
|
10719
10835
|
|
|
10720
|
-
|
|
10721
|
-
|
|
10836
|
+
// Standard browser envs support document.cookie
|
|
10837
|
+
{
|
|
10838
|
+
write(name, value, expires, path, domain, secure) {
|
|
10839
|
+
const cookie = [name + '=' + encodeURIComponent(value)];
|
|
10722
10840
|
|
|
10723
|
-
|
|
10841
|
+
utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
|
|
10724
10842
|
|
|
10725
|
-
|
|
10726
|
-
firstSampleTS = now;
|
|
10727
|
-
}
|
|
10843
|
+
utils$1.isString(path) && cookie.push('path=' + path);
|
|
10728
10844
|
|
|
10729
|
-
|
|
10730
|
-
timestamps[head] = now;
|
|
10845
|
+
utils$1.isString(domain) && cookie.push('domain=' + domain);
|
|
10731
10846
|
|
|
10732
|
-
|
|
10733
|
-
let bytesCount = 0;
|
|
10847
|
+
secure === true && cookie.push('secure');
|
|
10734
10848
|
|
|
10735
|
-
|
|
10736
|
-
|
|
10737
|
-
i = i % samplesCount;
|
|
10738
|
-
}
|
|
10849
|
+
document.cookie = cookie.join('; ');
|
|
10850
|
+
},
|
|
10739
10851
|
|
|
10740
|
-
|
|
10852
|
+
read(name) {
|
|
10853
|
+
const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
|
|
10854
|
+
return (match ? decodeURIComponent(match[3]) : null);
|
|
10855
|
+
},
|
|
10741
10856
|
|
|
10742
|
-
|
|
10743
|
-
|
|
10857
|
+
remove(name) {
|
|
10858
|
+
this.write(name, '', Date.now() - 86400000);
|
|
10744
10859
|
}
|
|
10860
|
+
}
|
|
10745
10861
|
|
|
10746
|
-
|
|
10747
|
-
return;
|
|
10748
|
-
}
|
|
10862
|
+
:
|
|
10749
10863
|
|
|
10750
|
-
|
|
10864
|
+
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
10865
|
+
{
|
|
10866
|
+
write() {},
|
|
10867
|
+
read() {
|
|
10868
|
+
return null;
|
|
10869
|
+
},
|
|
10870
|
+
remove() {}
|
|
10871
|
+
};
|
|
10751
10872
|
|
|
10752
|
-
|
|
10753
|
-
|
|
10873
|
+
/**
|
|
10874
|
+
* Determines whether the specified URL is absolute
|
|
10875
|
+
*
|
|
10876
|
+
* @param {string} url The URL to test
|
|
10877
|
+
*
|
|
10878
|
+
* @returns {boolean} True if the specified URL is absolute, otherwise false
|
|
10879
|
+
*/
|
|
10880
|
+
function isAbsoluteURL(url) {
|
|
10881
|
+
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
|
|
10882
|
+
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
|
|
10883
|
+
// by any combination of letters, digits, plus, period, or hyphen.
|
|
10884
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
10754
10885
|
}
|
|
10755
10886
|
|
|
10756
|
-
|
|
10757
|
-
|
|
10758
|
-
|
|
10887
|
+
/**
|
|
10888
|
+
* Creates a new URL by combining the specified URLs
|
|
10889
|
+
*
|
|
10890
|
+
* @param {string} baseURL The base URL
|
|
10891
|
+
* @param {string} relativeURL The relative URL
|
|
10892
|
+
*
|
|
10893
|
+
* @returns {string} The combined URL
|
|
10894
|
+
*/
|
|
10895
|
+
function combineURLs(baseURL, relativeURL) {
|
|
10896
|
+
return relativeURL
|
|
10897
|
+
? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '')
|
|
10898
|
+
: baseURL;
|
|
10899
|
+
}
|
|
10759
10900
|
|
|
10760
|
-
|
|
10761
|
-
|
|
10762
|
-
|
|
10763
|
-
|
|
10764
|
-
|
|
10765
|
-
|
|
10901
|
+
/**
|
|
10902
|
+
* Creates a new URL by combining the baseURL with the requestedURL,
|
|
10903
|
+
* only when the requestedURL is not already an absolute URL.
|
|
10904
|
+
* If the requestURL is absolute, this function returns the requestedURL untouched.
|
|
10905
|
+
*
|
|
10906
|
+
* @param {string} baseURL The base URL
|
|
10907
|
+
* @param {string} requestedURL Absolute or relative URL to combine
|
|
10908
|
+
*
|
|
10909
|
+
* @returns {string} The combined full path
|
|
10910
|
+
*/
|
|
10911
|
+
function buildFullPath(baseURL, requestedURL) {
|
|
10912
|
+
if (baseURL && !isAbsoluteURL(requestedURL)) {
|
|
10913
|
+
return combineURLs(baseURL, requestedURL);
|
|
10914
|
+
}
|
|
10915
|
+
return requestedURL;
|
|
10916
|
+
}
|
|
10766
10917
|
|
|
10767
|
-
|
|
10918
|
+
const headersToObject = (thing) => thing instanceof AxiosHeaders ? { ...thing } : thing;
|
|
10768
10919
|
|
|
10769
|
-
|
|
10770
|
-
|
|
10771
|
-
|
|
10772
|
-
|
|
10773
|
-
|
|
10774
|
-
|
|
10775
|
-
|
|
10776
|
-
|
|
10777
|
-
|
|
10920
|
+
/**
|
|
10921
|
+
* Config-specific merge-function which creates a new config-object
|
|
10922
|
+
* by merging two configuration objects together.
|
|
10923
|
+
*
|
|
10924
|
+
* @param {Object} config1
|
|
10925
|
+
* @param {Object} config2
|
|
10926
|
+
*
|
|
10927
|
+
* @returns {Object} New object resulting from merging config2 to config1
|
|
10928
|
+
*/
|
|
10929
|
+
function mergeConfig(config1, config2) {
|
|
10930
|
+
// eslint-disable-next-line no-param-reassign
|
|
10931
|
+
config2 = config2 || {};
|
|
10932
|
+
const config = {};
|
|
10778
10933
|
|
|
10779
|
-
|
|
10934
|
+
function getMergedValue(target, source, caseless) {
|
|
10935
|
+
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
|
10936
|
+
return utils$1.merge.call({caseless}, target, source);
|
|
10937
|
+
} else if (utils$1.isPlainObject(source)) {
|
|
10938
|
+
return utils$1.merge({}, source);
|
|
10939
|
+
} else if (utils$1.isArray(source)) {
|
|
10940
|
+
return source.slice();
|
|
10941
|
+
}
|
|
10942
|
+
return source;
|
|
10943
|
+
}
|
|
10780
10944
|
|
|
10781
|
-
|
|
10945
|
+
// eslint-disable-next-line consistent-return
|
|
10946
|
+
function mergeDeepProperties(a, b, caseless) {
|
|
10947
|
+
if (!utils$1.isUndefined(b)) {
|
|
10948
|
+
return getMergedValue(a, b, caseless);
|
|
10949
|
+
} else if (!utils$1.isUndefined(a)) {
|
|
10950
|
+
return getMergedValue(undefined, a, caseless);
|
|
10951
|
+
}
|
|
10952
|
+
}
|
|
10953
|
+
|
|
10954
|
+
// eslint-disable-next-line consistent-return
|
|
10955
|
+
function valueFromConfig2(a, b) {
|
|
10956
|
+
if (!utils$1.isUndefined(b)) {
|
|
10957
|
+
return getMergedValue(undefined, b);
|
|
10958
|
+
}
|
|
10959
|
+
}
|
|
10960
|
+
|
|
10961
|
+
// eslint-disable-next-line consistent-return
|
|
10962
|
+
function defaultToConfig2(a, b) {
|
|
10963
|
+
if (!utils$1.isUndefined(b)) {
|
|
10964
|
+
return getMergedValue(undefined, b);
|
|
10965
|
+
} else if (!utils$1.isUndefined(a)) {
|
|
10966
|
+
return getMergedValue(undefined, a);
|
|
10967
|
+
}
|
|
10968
|
+
}
|
|
10969
|
+
|
|
10970
|
+
// eslint-disable-next-line consistent-return
|
|
10971
|
+
function mergeDirectKeys(a, b, prop) {
|
|
10972
|
+
if (prop in config2) {
|
|
10973
|
+
return getMergedValue(a, b);
|
|
10974
|
+
} else if (prop in config1) {
|
|
10975
|
+
return getMergedValue(undefined, a);
|
|
10976
|
+
}
|
|
10977
|
+
}
|
|
10978
|
+
|
|
10979
|
+
const mergeMap = {
|
|
10980
|
+
url: valueFromConfig2,
|
|
10981
|
+
method: valueFromConfig2,
|
|
10982
|
+
data: valueFromConfig2,
|
|
10983
|
+
baseURL: defaultToConfig2,
|
|
10984
|
+
transformRequest: defaultToConfig2,
|
|
10985
|
+
transformResponse: defaultToConfig2,
|
|
10986
|
+
paramsSerializer: defaultToConfig2,
|
|
10987
|
+
timeout: defaultToConfig2,
|
|
10988
|
+
timeoutMessage: defaultToConfig2,
|
|
10989
|
+
withCredentials: defaultToConfig2,
|
|
10990
|
+
withXSRFToken: defaultToConfig2,
|
|
10991
|
+
adapter: defaultToConfig2,
|
|
10992
|
+
responseType: defaultToConfig2,
|
|
10993
|
+
xsrfCookieName: defaultToConfig2,
|
|
10994
|
+
xsrfHeaderName: defaultToConfig2,
|
|
10995
|
+
onUploadProgress: defaultToConfig2,
|
|
10996
|
+
onDownloadProgress: defaultToConfig2,
|
|
10997
|
+
decompress: defaultToConfig2,
|
|
10998
|
+
maxContentLength: defaultToConfig2,
|
|
10999
|
+
maxBodyLength: defaultToConfig2,
|
|
11000
|
+
beforeRedirect: defaultToConfig2,
|
|
11001
|
+
transport: defaultToConfig2,
|
|
11002
|
+
httpAgent: defaultToConfig2,
|
|
11003
|
+
httpsAgent: defaultToConfig2,
|
|
11004
|
+
cancelToken: defaultToConfig2,
|
|
11005
|
+
socketPath: defaultToConfig2,
|
|
11006
|
+
responseEncoding: defaultToConfig2,
|
|
11007
|
+
validateStatus: mergeDirectKeys,
|
|
11008
|
+
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
|
|
10782
11009
|
};
|
|
11010
|
+
|
|
11011
|
+
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
|
11012
|
+
const merge = mergeMap[prop] || mergeDeepProperties;
|
|
11013
|
+
const configValue = merge(config1[prop], config2[prop], prop);
|
|
11014
|
+
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
11015
|
+
});
|
|
11016
|
+
|
|
11017
|
+
return config;
|
|
10783
11018
|
}
|
|
10784
11019
|
|
|
10785
|
-
|
|
11020
|
+
var resolveConfig = (config) => {
|
|
11021
|
+
const newConfig = mergeConfig({}, config);
|
|
10786
11022
|
|
|
10787
|
-
|
|
10788
|
-
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
10789
|
-
let requestData = config.data;
|
|
10790
|
-
const requestHeaders = AxiosHeaders.from(config.headers).normalize();
|
|
10791
|
-
let {responseType, withXSRFToken} = config;
|
|
10792
|
-
let onCanceled;
|
|
10793
|
-
function done() {
|
|
10794
|
-
if (config.cancelToken) {
|
|
10795
|
-
config.cancelToken.unsubscribe(onCanceled);
|
|
10796
|
-
}
|
|
11023
|
+
let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;
|
|
10797
11024
|
|
|
10798
|
-
|
|
10799
|
-
|
|
10800
|
-
|
|
11025
|
+
newConfig.headers = headers = AxiosHeaders.from(headers);
|
|
11026
|
+
|
|
11027
|
+
newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
|
|
11028
|
+
|
|
11029
|
+
// HTTP basic authentication
|
|
11030
|
+
if (auth) {
|
|
11031
|
+
headers.set('Authorization', 'Basic ' +
|
|
11032
|
+
btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))
|
|
11033
|
+
);
|
|
11034
|
+
}
|
|
11035
|
+
|
|
11036
|
+
let contentType;
|
|
11037
|
+
|
|
11038
|
+
if (utils$1.isFormData(data)) {
|
|
11039
|
+
if (platform$1.hasStandardBrowserEnv || platform$1.hasStandardBrowserWebWorkerEnv) {
|
|
11040
|
+
headers.setContentType(undefined); // Let the browser set it
|
|
11041
|
+
} else if ((contentType = headers.getContentType()) !== false) {
|
|
11042
|
+
// fix semicolon duplication issue for ReactNative FormData implementation
|
|
11043
|
+
const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
|
|
11044
|
+
headers.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
|
|
10801
11045
|
}
|
|
11046
|
+
}
|
|
11047
|
+
|
|
11048
|
+
// Add xsrf header
|
|
11049
|
+
// This is only done if running in a standard browser environment.
|
|
11050
|
+
// Specifically not if we're in a web worker, or react-native.
|
|
10802
11051
|
|
|
10803
|
-
|
|
11052
|
+
if (platform$1.hasStandardBrowserEnv) {
|
|
11053
|
+
withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
|
|
10804
11054
|
|
|
10805
|
-
if (
|
|
10806
|
-
|
|
10807
|
-
|
|
10808
|
-
|
|
10809
|
-
|
|
10810
|
-
|
|
10811
|
-
requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
|
|
11055
|
+
if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {
|
|
11056
|
+
// Add xsrf header
|
|
11057
|
+
const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
|
|
11058
|
+
|
|
11059
|
+
if (xsrfValue) {
|
|
11060
|
+
headers.set(xsrfHeaderName, xsrfValue);
|
|
10812
11061
|
}
|
|
10813
11062
|
}
|
|
11063
|
+
}
|
|
10814
11064
|
|
|
10815
|
-
|
|
11065
|
+
return newConfig;
|
|
11066
|
+
};
|
|
11067
|
+
|
|
11068
|
+
const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
|
|
11069
|
+
|
|
11070
|
+
var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
11071
|
+
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
11072
|
+
const _config = resolveConfig(config);
|
|
11073
|
+
let requestData = _config.data;
|
|
11074
|
+
const requestHeaders = AxiosHeaders.from(_config.headers).normalize();
|
|
11075
|
+
let {responseType, onUploadProgress, onDownloadProgress} = _config;
|
|
11076
|
+
let onCanceled;
|
|
11077
|
+
let uploadThrottled, downloadThrottled;
|
|
11078
|
+
let flushUpload, flushDownload;
|
|
11079
|
+
|
|
11080
|
+
function done() {
|
|
11081
|
+
flushUpload && flushUpload(); // flush events
|
|
11082
|
+
flushDownload && flushDownload(); // flush events
|
|
10816
11083
|
|
|
10817
|
-
|
|
10818
|
-
|
|
10819
|
-
|
|
10820
|
-
const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
|
|
10821
|
-
requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));
|
|
11084
|
+
_config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
|
|
11085
|
+
|
|
11086
|
+
_config.signal && _config.signal.removeEventListener('abort', onCanceled);
|
|
10822
11087
|
}
|
|
10823
11088
|
|
|
10824
|
-
|
|
11089
|
+
let request = new XMLHttpRequest();
|
|
10825
11090
|
|
|
10826
|
-
request.open(
|
|
11091
|
+
request.open(_config.method.toUpperCase(), _config.url, true);
|
|
10827
11092
|
|
|
10828
11093
|
// Set the request timeout in MS
|
|
10829
|
-
request.timeout =
|
|
11094
|
+
request.timeout = _config.timeout;
|
|
10830
11095
|
|
|
10831
11096
|
function onloadend() {
|
|
10832
11097
|
if (!request) {
|
|
@@ -10906,10 +11171,10 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
10906
11171
|
|
|
10907
11172
|
// Handle timeout
|
|
10908
11173
|
request.ontimeout = function handleTimeout() {
|
|
10909
|
-
let timeoutErrorMessage =
|
|
10910
|
-
const transitional =
|
|
10911
|
-
if (
|
|
10912
|
-
timeoutErrorMessage =
|
|
11174
|
+
let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
|
|
11175
|
+
const transitional = _config.transitional || transitionalDefaults;
|
|
11176
|
+
if (_config.timeoutErrorMessage) {
|
|
11177
|
+
timeoutErrorMessage = _config.timeoutErrorMessage;
|
|
10913
11178
|
}
|
|
10914
11179
|
reject(new AxiosError(
|
|
10915
11180
|
timeoutErrorMessage,
|
|
@@ -10921,22 +11186,6 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
10921
11186
|
request = null;
|
|
10922
11187
|
};
|
|
10923
11188
|
|
|
10924
|
-
// Add xsrf header
|
|
10925
|
-
// This is only done if running in a standard browser environment.
|
|
10926
|
-
// Specifically not if we're in a web worker, or react-native.
|
|
10927
|
-
if(platform$1.hasStandardBrowserEnv) {
|
|
10928
|
-
withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
|
|
10929
|
-
|
|
10930
|
-
if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {
|
|
10931
|
-
// Add xsrf header
|
|
10932
|
-
const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
|
|
10933
|
-
|
|
10934
|
-
if (xsrfValue) {
|
|
10935
|
-
requestHeaders.set(config.xsrfHeaderName, xsrfValue);
|
|
10936
|
-
}
|
|
10937
|
-
}
|
|
10938
|
-
}
|
|
10939
|
-
|
|
10940
11189
|
// Remove Content-Type if data is undefined
|
|
10941
11190
|
requestData === undefined && requestHeaders.setContentType(null);
|
|
10942
11191
|
|
|
@@ -10948,26 +11197,31 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
10948
11197
|
}
|
|
10949
11198
|
|
|
10950
11199
|
// Add withCredentials to request if needed
|
|
10951
|
-
if (!utils$1.isUndefined(
|
|
10952
|
-
request.withCredentials = !!
|
|
11200
|
+
if (!utils$1.isUndefined(_config.withCredentials)) {
|
|
11201
|
+
request.withCredentials = !!_config.withCredentials;
|
|
10953
11202
|
}
|
|
10954
11203
|
|
|
10955
11204
|
// Add responseType to request if needed
|
|
10956
11205
|
if (responseType && responseType !== 'json') {
|
|
10957
|
-
request.responseType =
|
|
11206
|
+
request.responseType = _config.responseType;
|
|
10958
11207
|
}
|
|
10959
11208
|
|
|
10960
11209
|
// Handle progress if needed
|
|
10961
|
-
if (
|
|
10962
|
-
|
|
11210
|
+
if (onDownloadProgress) {
|
|
11211
|
+
([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true));
|
|
11212
|
+
request.addEventListener('progress', downloadThrottled);
|
|
10963
11213
|
}
|
|
10964
11214
|
|
|
10965
11215
|
// Not all browsers support upload events
|
|
10966
|
-
if (
|
|
10967
|
-
|
|
11216
|
+
if (onUploadProgress && request.upload) {
|
|
11217
|
+
([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));
|
|
11218
|
+
|
|
11219
|
+
request.upload.addEventListener('progress', uploadThrottled);
|
|
11220
|
+
|
|
11221
|
+
request.upload.addEventListener('loadend', flushUpload);
|
|
10968
11222
|
}
|
|
10969
11223
|
|
|
10970
|
-
if (
|
|
11224
|
+
if (_config.cancelToken || _config.signal) {
|
|
10971
11225
|
// Handle cancellation
|
|
10972
11226
|
// eslint-disable-next-line func-names
|
|
10973
11227
|
onCanceled = cancel => {
|
|
@@ -10979,13 +11233,13 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
10979
11233
|
request = null;
|
|
10980
11234
|
};
|
|
10981
11235
|
|
|
10982
|
-
|
|
10983
|
-
if (
|
|
10984
|
-
|
|
11236
|
+
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
|
11237
|
+
if (_config.signal) {
|
|
11238
|
+
_config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);
|
|
10985
11239
|
}
|
|
10986
11240
|
}
|
|
10987
11241
|
|
|
10988
|
-
const protocol = parseProtocol(
|
|
11242
|
+
const protocol = parseProtocol(_config.url);
|
|
10989
11243
|
|
|
10990
11244
|
if (protocol && platform$1.protocols.indexOf(protocol) === -1) {
|
|
10991
11245
|
reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
|
|
@@ -10998,9 +11252,358 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
10998
11252
|
});
|
|
10999
11253
|
};
|
|
11000
11254
|
|
|
11255
|
+
const composeSignals = (signals, timeout) => {
|
|
11256
|
+
const {length} = (signals = signals ? signals.filter(Boolean) : []);
|
|
11257
|
+
|
|
11258
|
+
if (timeout || length) {
|
|
11259
|
+
let controller = new AbortController();
|
|
11260
|
+
|
|
11261
|
+
let aborted;
|
|
11262
|
+
|
|
11263
|
+
const onabort = function (reason) {
|
|
11264
|
+
if (!aborted) {
|
|
11265
|
+
aborted = true;
|
|
11266
|
+
unsubscribe();
|
|
11267
|
+
const err = reason instanceof Error ? reason : this.reason;
|
|
11268
|
+
controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
|
|
11269
|
+
}
|
|
11270
|
+
};
|
|
11271
|
+
|
|
11272
|
+
let timer = timeout && setTimeout(() => {
|
|
11273
|
+
timer = null;
|
|
11274
|
+
onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT));
|
|
11275
|
+
}, timeout);
|
|
11276
|
+
|
|
11277
|
+
const unsubscribe = () => {
|
|
11278
|
+
if (signals) {
|
|
11279
|
+
timer && clearTimeout(timer);
|
|
11280
|
+
timer = null;
|
|
11281
|
+
signals.forEach(signal => {
|
|
11282
|
+
signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);
|
|
11283
|
+
});
|
|
11284
|
+
signals = null;
|
|
11285
|
+
}
|
|
11286
|
+
};
|
|
11287
|
+
|
|
11288
|
+
signals.forEach((signal) => signal.addEventListener('abort', onabort));
|
|
11289
|
+
|
|
11290
|
+
const {signal} = controller;
|
|
11291
|
+
|
|
11292
|
+
signal.unsubscribe = () => utils$1.asap(unsubscribe);
|
|
11293
|
+
|
|
11294
|
+
return signal;
|
|
11295
|
+
}
|
|
11296
|
+
};
|
|
11297
|
+
|
|
11298
|
+
const streamChunk = function* (chunk, chunkSize) {
|
|
11299
|
+
let len = chunk.byteLength;
|
|
11300
|
+
|
|
11301
|
+
if (!chunkSize || len < chunkSize) {
|
|
11302
|
+
yield chunk;
|
|
11303
|
+
return;
|
|
11304
|
+
}
|
|
11305
|
+
|
|
11306
|
+
let pos = 0;
|
|
11307
|
+
let end;
|
|
11308
|
+
|
|
11309
|
+
while (pos < len) {
|
|
11310
|
+
end = pos + chunkSize;
|
|
11311
|
+
yield chunk.slice(pos, end);
|
|
11312
|
+
pos = end;
|
|
11313
|
+
}
|
|
11314
|
+
};
|
|
11315
|
+
|
|
11316
|
+
const readBytes = async function* (iterable, chunkSize) {
|
|
11317
|
+
for await (const chunk of readStream(iterable)) {
|
|
11318
|
+
yield* streamChunk(chunk, chunkSize);
|
|
11319
|
+
}
|
|
11320
|
+
};
|
|
11321
|
+
|
|
11322
|
+
const readStream = async function* (stream) {
|
|
11323
|
+
if (stream[Symbol.asyncIterator]) {
|
|
11324
|
+
yield* stream;
|
|
11325
|
+
return;
|
|
11326
|
+
}
|
|
11327
|
+
|
|
11328
|
+
const reader = stream.getReader();
|
|
11329
|
+
try {
|
|
11330
|
+
for (;;) {
|
|
11331
|
+
const {done, value} = await reader.read();
|
|
11332
|
+
if (done) {
|
|
11333
|
+
break;
|
|
11334
|
+
}
|
|
11335
|
+
yield value;
|
|
11336
|
+
}
|
|
11337
|
+
} finally {
|
|
11338
|
+
await reader.cancel();
|
|
11339
|
+
}
|
|
11340
|
+
};
|
|
11341
|
+
|
|
11342
|
+
const trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
|
11343
|
+
const iterator = readBytes(stream, chunkSize);
|
|
11344
|
+
|
|
11345
|
+
let bytes = 0;
|
|
11346
|
+
let done;
|
|
11347
|
+
let _onFinish = (e) => {
|
|
11348
|
+
if (!done) {
|
|
11349
|
+
done = true;
|
|
11350
|
+
onFinish && onFinish(e);
|
|
11351
|
+
}
|
|
11352
|
+
};
|
|
11353
|
+
|
|
11354
|
+
return new ReadableStream({
|
|
11355
|
+
async pull(controller) {
|
|
11356
|
+
try {
|
|
11357
|
+
const {done, value} = await iterator.next();
|
|
11358
|
+
|
|
11359
|
+
if (done) {
|
|
11360
|
+
_onFinish();
|
|
11361
|
+
controller.close();
|
|
11362
|
+
return;
|
|
11363
|
+
}
|
|
11364
|
+
|
|
11365
|
+
let len = value.byteLength;
|
|
11366
|
+
if (onProgress) {
|
|
11367
|
+
let loadedBytes = bytes += len;
|
|
11368
|
+
onProgress(loadedBytes);
|
|
11369
|
+
}
|
|
11370
|
+
controller.enqueue(new Uint8Array(value));
|
|
11371
|
+
} catch (err) {
|
|
11372
|
+
_onFinish(err);
|
|
11373
|
+
throw err;
|
|
11374
|
+
}
|
|
11375
|
+
},
|
|
11376
|
+
cancel(reason) {
|
|
11377
|
+
_onFinish(reason);
|
|
11378
|
+
return iterator.return();
|
|
11379
|
+
}
|
|
11380
|
+
}, {
|
|
11381
|
+
highWaterMark: 2
|
|
11382
|
+
})
|
|
11383
|
+
};
|
|
11384
|
+
|
|
11385
|
+
const isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function';
|
|
11386
|
+
const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function';
|
|
11387
|
+
|
|
11388
|
+
// used only inside the fetch adapter
|
|
11389
|
+
const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
|
|
11390
|
+
((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
|
|
11391
|
+
async (str) => new Uint8Array(await new Response(str).arrayBuffer())
|
|
11392
|
+
);
|
|
11393
|
+
|
|
11394
|
+
const test = (fn, ...args) => {
|
|
11395
|
+
try {
|
|
11396
|
+
return !!fn(...args);
|
|
11397
|
+
} catch (e) {
|
|
11398
|
+
return false
|
|
11399
|
+
}
|
|
11400
|
+
};
|
|
11401
|
+
|
|
11402
|
+
const supportsRequestStream = isReadableStreamSupported && test(() => {
|
|
11403
|
+
let duplexAccessed = false;
|
|
11404
|
+
|
|
11405
|
+
const hasContentType = new Request(platform$1.origin, {
|
|
11406
|
+
body: new ReadableStream(),
|
|
11407
|
+
method: 'POST',
|
|
11408
|
+
get duplex() {
|
|
11409
|
+
duplexAccessed = true;
|
|
11410
|
+
return 'half';
|
|
11411
|
+
},
|
|
11412
|
+
}).headers.has('Content-Type');
|
|
11413
|
+
|
|
11414
|
+
return duplexAccessed && !hasContentType;
|
|
11415
|
+
});
|
|
11416
|
+
|
|
11417
|
+
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
11418
|
+
|
|
11419
|
+
const supportsResponseStream = isReadableStreamSupported &&
|
|
11420
|
+
test(() => utils$1.isReadableStream(new Response('').body));
|
|
11421
|
+
|
|
11422
|
+
|
|
11423
|
+
const resolvers = {
|
|
11424
|
+
stream: supportsResponseStream && ((res) => res.body)
|
|
11425
|
+
};
|
|
11426
|
+
|
|
11427
|
+
isFetchSupported && (((res) => {
|
|
11428
|
+
['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
|
|
11429
|
+
!resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res) => res[type]() :
|
|
11430
|
+
(_, config) => {
|
|
11431
|
+
throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
|
|
11432
|
+
});
|
|
11433
|
+
});
|
|
11434
|
+
})(new Response));
|
|
11435
|
+
|
|
11436
|
+
const getBodyLength = async (body) => {
|
|
11437
|
+
if (body == null) {
|
|
11438
|
+
return 0;
|
|
11439
|
+
}
|
|
11440
|
+
|
|
11441
|
+
if(utils$1.isBlob(body)) {
|
|
11442
|
+
return body.size;
|
|
11443
|
+
}
|
|
11444
|
+
|
|
11445
|
+
if(utils$1.isSpecCompliantForm(body)) {
|
|
11446
|
+
const _request = new Request(platform$1.origin, {
|
|
11447
|
+
method: 'POST',
|
|
11448
|
+
body,
|
|
11449
|
+
});
|
|
11450
|
+
return (await _request.arrayBuffer()).byteLength;
|
|
11451
|
+
}
|
|
11452
|
+
|
|
11453
|
+
if(utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
|
|
11454
|
+
return body.byteLength;
|
|
11455
|
+
}
|
|
11456
|
+
|
|
11457
|
+
if(utils$1.isURLSearchParams(body)) {
|
|
11458
|
+
body = body + '';
|
|
11459
|
+
}
|
|
11460
|
+
|
|
11461
|
+
if(utils$1.isString(body)) {
|
|
11462
|
+
return (await encodeText(body)).byteLength;
|
|
11463
|
+
}
|
|
11464
|
+
};
|
|
11465
|
+
|
|
11466
|
+
const resolveBodyLength = async (headers, body) => {
|
|
11467
|
+
const length = utils$1.toFiniteNumber(headers.getContentLength());
|
|
11468
|
+
|
|
11469
|
+
return length == null ? getBodyLength(body) : length;
|
|
11470
|
+
};
|
|
11471
|
+
|
|
11472
|
+
var fetchAdapter = isFetchSupported && (async (config) => {
|
|
11473
|
+
let {
|
|
11474
|
+
url,
|
|
11475
|
+
method,
|
|
11476
|
+
data,
|
|
11477
|
+
signal,
|
|
11478
|
+
cancelToken,
|
|
11479
|
+
timeout,
|
|
11480
|
+
onDownloadProgress,
|
|
11481
|
+
onUploadProgress,
|
|
11482
|
+
responseType,
|
|
11483
|
+
headers,
|
|
11484
|
+
withCredentials = 'same-origin',
|
|
11485
|
+
fetchOptions
|
|
11486
|
+
} = resolveConfig(config);
|
|
11487
|
+
|
|
11488
|
+
responseType = responseType ? (responseType + '').toLowerCase() : 'text';
|
|
11489
|
+
|
|
11490
|
+
let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
|
11491
|
+
|
|
11492
|
+
let request;
|
|
11493
|
+
|
|
11494
|
+
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
|
11495
|
+
composedSignal.unsubscribe();
|
|
11496
|
+
});
|
|
11497
|
+
|
|
11498
|
+
let requestContentLength;
|
|
11499
|
+
|
|
11500
|
+
try {
|
|
11501
|
+
if (
|
|
11502
|
+
onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
|
|
11503
|
+
(requestContentLength = await resolveBodyLength(headers, data)) !== 0
|
|
11504
|
+
) {
|
|
11505
|
+
let _request = new Request(url, {
|
|
11506
|
+
method: 'POST',
|
|
11507
|
+
body: data,
|
|
11508
|
+
duplex: "half"
|
|
11509
|
+
});
|
|
11510
|
+
|
|
11511
|
+
let contentTypeHeader;
|
|
11512
|
+
|
|
11513
|
+
if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
|
|
11514
|
+
headers.setContentType(contentTypeHeader);
|
|
11515
|
+
}
|
|
11516
|
+
|
|
11517
|
+
if (_request.body) {
|
|
11518
|
+
const [onProgress, flush] = progressEventDecorator(
|
|
11519
|
+
requestContentLength,
|
|
11520
|
+
progressEventReducer(asyncDecorator(onUploadProgress))
|
|
11521
|
+
);
|
|
11522
|
+
|
|
11523
|
+
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
|
11524
|
+
}
|
|
11525
|
+
}
|
|
11526
|
+
|
|
11527
|
+
if (!utils$1.isString(withCredentials)) {
|
|
11528
|
+
withCredentials = withCredentials ? 'include' : 'omit';
|
|
11529
|
+
}
|
|
11530
|
+
|
|
11531
|
+
// Cloudflare Workers throws when credentials are defined
|
|
11532
|
+
// see https://github.com/cloudflare/workerd/issues/902
|
|
11533
|
+
const isCredentialsSupported = "credentials" in Request.prototype;
|
|
11534
|
+
request = new Request(url, {
|
|
11535
|
+
...fetchOptions,
|
|
11536
|
+
signal: composedSignal,
|
|
11537
|
+
method: method.toUpperCase(),
|
|
11538
|
+
headers: headers.normalize().toJSON(),
|
|
11539
|
+
body: data,
|
|
11540
|
+
duplex: "half",
|
|
11541
|
+
credentials: isCredentialsSupported ? withCredentials : undefined
|
|
11542
|
+
});
|
|
11543
|
+
|
|
11544
|
+
let response = await fetch(request);
|
|
11545
|
+
|
|
11546
|
+
const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
|
|
11547
|
+
|
|
11548
|
+
if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
|
|
11549
|
+
const options = {};
|
|
11550
|
+
|
|
11551
|
+
['status', 'statusText', 'headers'].forEach(prop => {
|
|
11552
|
+
options[prop] = response[prop];
|
|
11553
|
+
});
|
|
11554
|
+
|
|
11555
|
+
const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
|
|
11556
|
+
|
|
11557
|
+
const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
|
|
11558
|
+
responseContentLength,
|
|
11559
|
+
progressEventReducer(asyncDecorator(onDownloadProgress), true)
|
|
11560
|
+
) || [];
|
|
11561
|
+
|
|
11562
|
+
response = new Response(
|
|
11563
|
+
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
11564
|
+
flush && flush();
|
|
11565
|
+
unsubscribe && unsubscribe();
|
|
11566
|
+
}),
|
|
11567
|
+
options
|
|
11568
|
+
);
|
|
11569
|
+
}
|
|
11570
|
+
|
|
11571
|
+
responseType = responseType || 'text';
|
|
11572
|
+
|
|
11573
|
+
let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
|
|
11574
|
+
|
|
11575
|
+
!isStreamResponse && unsubscribe && unsubscribe();
|
|
11576
|
+
|
|
11577
|
+
return await new Promise((resolve, reject) => {
|
|
11578
|
+
settle(resolve, reject, {
|
|
11579
|
+
data: responseData,
|
|
11580
|
+
headers: AxiosHeaders.from(response.headers),
|
|
11581
|
+
status: response.status,
|
|
11582
|
+
statusText: response.statusText,
|
|
11583
|
+
config,
|
|
11584
|
+
request
|
|
11585
|
+
});
|
|
11586
|
+
})
|
|
11587
|
+
} catch (err) {
|
|
11588
|
+
unsubscribe && unsubscribe();
|
|
11589
|
+
|
|
11590
|
+
if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {
|
|
11591
|
+
throw Object.assign(
|
|
11592
|
+
new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),
|
|
11593
|
+
{
|
|
11594
|
+
cause: err.cause || err
|
|
11595
|
+
}
|
|
11596
|
+
)
|
|
11597
|
+
}
|
|
11598
|
+
|
|
11599
|
+
throw AxiosError.from(err, err && err.code, config, request);
|
|
11600
|
+
}
|
|
11601
|
+
});
|
|
11602
|
+
|
|
11001
11603
|
const knownAdapters = {
|
|
11002
11604
|
http: httpAdapter,
|
|
11003
|
-
xhr: xhrAdapter
|
|
11605
|
+
xhr: xhrAdapter,
|
|
11606
|
+
fetch: fetchAdapter
|
|
11004
11607
|
};
|
|
11005
11608
|
|
|
11006
11609
|
utils$1.forEach(knownAdapters, (fn, value) => {
|
|
@@ -11144,109 +11747,7 @@ function dispatchRequest(config) {
|
|
|
11144
11747
|
});
|
|
11145
11748
|
}
|
|
11146
11749
|
|
|
11147
|
-
const
|
|
11148
|
-
|
|
11149
|
-
/**
|
|
11150
|
-
* Config-specific merge-function which creates a new config-object
|
|
11151
|
-
* by merging two configuration objects together.
|
|
11152
|
-
*
|
|
11153
|
-
* @param {Object} config1
|
|
11154
|
-
* @param {Object} config2
|
|
11155
|
-
*
|
|
11156
|
-
* @returns {Object} New object resulting from merging config2 to config1
|
|
11157
|
-
*/
|
|
11158
|
-
function mergeConfig(config1, config2) {
|
|
11159
|
-
// eslint-disable-next-line no-param-reassign
|
|
11160
|
-
config2 = config2 || {};
|
|
11161
|
-
const config = {};
|
|
11162
|
-
|
|
11163
|
-
function getMergedValue(target, source, caseless) {
|
|
11164
|
-
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
|
11165
|
-
return utils$1.merge.call({caseless}, target, source);
|
|
11166
|
-
} else if (utils$1.isPlainObject(source)) {
|
|
11167
|
-
return utils$1.merge({}, source);
|
|
11168
|
-
} else if (utils$1.isArray(source)) {
|
|
11169
|
-
return source.slice();
|
|
11170
|
-
}
|
|
11171
|
-
return source;
|
|
11172
|
-
}
|
|
11173
|
-
|
|
11174
|
-
// eslint-disable-next-line consistent-return
|
|
11175
|
-
function mergeDeepProperties(a, b, caseless) {
|
|
11176
|
-
if (!utils$1.isUndefined(b)) {
|
|
11177
|
-
return getMergedValue(a, b, caseless);
|
|
11178
|
-
} else if (!utils$1.isUndefined(a)) {
|
|
11179
|
-
return getMergedValue(undefined, a, caseless);
|
|
11180
|
-
}
|
|
11181
|
-
}
|
|
11182
|
-
|
|
11183
|
-
// eslint-disable-next-line consistent-return
|
|
11184
|
-
function valueFromConfig2(a, b) {
|
|
11185
|
-
if (!utils$1.isUndefined(b)) {
|
|
11186
|
-
return getMergedValue(undefined, b);
|
|
11187
|
-
}
|
|
11188
|
-
}
|
|
11189
|
-
|
|
11190
|
-
// eslint-disable-next-line consistent-return
|
|
11191
|
-
function defaultToConfig2(a, b) {
|
|
11192
|
-
if (!utils$1.isUndefined(b)) {
|
|
11193
|
-
return getMergedValue(undefined, b);
|
|
11194
|
-
} else if (!utils$1.isUndefined(a)) {
|
|
11195
|
-
return getMergedValue(undefined, a);
|
|
11196
|
-
}
|
|
11197
|
-
}
|
|
11198
|
-
|
|
11199
|
-
// eslint-disable-next-line consistent-return
|
|
11200
|
-
function mergeDirectKeys(a, b, prop) {
|
|
11201
|
-
if (prop in config2) {
|
|
11202
|
-
return getMergedValue(a, b);
|
|
11203
|
-
} else if (prop in config1) {
|
|
11204
|
-
return getMergedValue(undefined, a);
|
|
11205
|
-
}
|
|
11206
|
-
}
|
|
11207
|
-
|
|
11208
|
-
const mergeMap = {
|
|
11209
|
-
url: valueFromConfig2,
|
|
11210
|
-
method: valueFromConfig2,
|
|
11211
|
-
data: valueFromConfig2,
|
|
11212
|
-
baseURL: defaultToConfig2,
|
|
11213
|
-
transformRequest: defaultToConfig2,
|
|
11214
|
-
transformResponse: defaultToConfig2,
|
|
11215
|
-
paramsSerializer: defaultToConfig2,
|
|
11216
|
-
timeout: defaultToConfig2,
|
|
11217
|
-
timeoutMessage: defaultToConfig2,
|
|
11218
|
-
withCredentials: defaultToConfig2,
|
|
11219
|
-
withXSRFToken: defaultToConfig2,
|
|
11220
|
-
adapter: defaultToConfig2,
|
|
11221
|
-
responseType: defaultToConfig2,
|
|
11222
|
-
xsrfCookieName: defaultToConfig2,
|
|
11223
|
-
xsrfHeaderName: defaultToConfig2,
|
|
11224
|
-
onUploadProgress: defaultToConfig2,
|
|
11225
|
-
onDownloadProgress: defaultToConfig2,
|
|
11226
|
-
decompress: defaultToConfig2,
|
|
11227
|
-
maxContentLength: defaultToConfig2,
|
|
11228
|
-
maxBodyLength: defaultToConfig2,
|
|
11229
|
-
beforeRedirect: defaultToConfig2,
|
|
11230
|
-
transport: defaultToConfig2,
|
|
11231
|
-
httpAgent: defaultToConfig2,
|
|
11232
|
-
httpsAgent: defaultToConfig2,
|
|
11233
|
-
cancelToken: defaultToConfig2,
|
|
11234
|
-
socketPath: defaultToConfig2,
|
|
11235
|
-
responseEncoding: defaultToConfig2,
|
|
11236
|
-
validateStatus: mergeDirectKeys,
|
|
11237
|
-
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
|
|
11238
|
-
};
|
|
11239
|
-
|
|
11240
|
-
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
|
11241
|
-
const merge = mergeMap[prop] || mergeDeepProperties;
|
|
11242
|
-
const configValue = merge(config1[prop], config2[prop], prop);
|
|
11243
|
-
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
11244
|
-
});
|
|
11245
|
-
|
|
11246
|
-
return config;
|
|
11247
|
-
}
|
|
11248
|
-
|
|
11249
|
-
const VERSION = "1.6.7";
|
|
11750
|
+
const VERSION = "1.7.7";
|
|
11250
11751
|
|
|
11251
11752
|
const validators = {};
|
|
11252
11753
|
|
|
@@ -11372,12 +11873,15 @@ class Axios {
|
|
|
11372
11873
|
|
|
11373
11874
|
// slice off the Error: ... line
|
|
11374
11875
|
const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
|
|
11375
|
-
|
|
11376
|
-
|
|
11377
|
-
|
|
11378
|
-
|
|
11379
|
-
|
|
11380
|
-
|
|
11876
|
+
try {
|
|
11877
|
+
if (!err.stack) {
|
|
11878
|
+
err.stack = stack;
|
|
11879
|
+
// match without the 2 top stack lines
|
|
11880
|
+
} else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) {
|
|
11881
|
+
err.stack += '\n' + stack;
|
|
11882
|
+
}
|
|
11883
|
+
} catch (e) {
|
|
11884
|
+
// ignore the case where "stack" is an un-writable property
|
|
11381
11885
|
}
|
|
11382
11886
|
}
|
|
11383
11887
|
|
|
@@ -11648,6 +12152,20 @@ class CancelToken {
|
|
|
11648
12152
|
}
|
|
11649
12153
|
}
|
|
11650
12154
|
|
|
12155
|
+
toAbortSignal() {
|
|
12156
|
+
const controller = new AbortController();
|
|
12157
|
+
|
|
12158
|
+
const abort = (err) => {
|
|
12159
|
+
controller.abort(err);
|
|
12160
|
+
};
|
|
12161
|
+
|
|
12162
|
+
this.subscribe(abort);
|
|
12163
|
+
|
|
12164
|
+
controller.signal.unsubscribe = () => this.unsubscribe(abort);
|
|
12165
|
+
|
|
12166
|
+
return controller.signal;
|
|
12167
|
+
}
|
|
12168
|
+
|
|
11651
12169
|
/**
|
|
11652
12170
|
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
11653
12171
|
* cancels the `CancelToken`.
|
|
@@ -12752,6 +13270,20 @@ var ethereum = {
|
|
|
12752
13270
|
explorerUrl: 'https://etherscan.io',
|
|
12753
13271
|
rpcUrl: 'https://endpoints.omniatech.io/v1/eth/mainnet/public'
|
|
12754
13272
|
};
|
|
13273
|
+
var baseTestnet = {
|
|
13274
|
+
chainId: 84532,
|
|
13275
|
+
name: 'Base Sepolia',
|
|
13276
|
+
currency: 'ETH',
|
|
13277
|
+
explorerUrl: 'https://sepolia.basescan.org',
|
|
13278
|
+
rpcUrl: 'https://sepolia.base.org'
|
|
13279
|
+
};
|
|
13280
|
+
var base = {
|
|
13281
|
+
chainId: 8453,
|
|
13282
|
+
name: 'Base Mainnet',
|
|
13283
|
+
currency: 'ETH',
|
|
13284
|
+
explorerUrl: 'https://basescan.org',
|
|
13285
|
+
rpcUrl: 'https://mainnet.base.org'
|
|
13286
|
+
};
|
|
12755
13287
|
var bscTestnet = {
|
|
12756
13288
|
chainId: 97,
|
|
12757
13289
|
name: 'BNB Smart Chain Testnet',
|
|
@@ -12872,7 +13404,7 @@ var KimaProvider = function KimaProvider(_ref) {
|
|
|
12872
13404
|
ethersConfig: react.defaultConfig({
|
|
12873
13405
|
metadata: metadata
|
|
12874
13406
|
}),
|
|
12875
|
-
chains: networkOption === exports.NetworkOptions.mainnet ? [ethereum, bsc, polygon, arbitrum, optimism, avalanche, zkEVM] : [ethereumSepolia, bscTestnet, polygonAmoy, arbitrumSepolia, optimismSepola, avalancheFuji, zkEVMTestnet],
|
|
13407
|
+
chains: networkOption === exports.NetworkOptions.mainnet ? [ethereum, base, bsc, polygon, arbitrum, optimism, avalanche, zkEVM] : [ethereumSepolia, baseTestnet, bscTestnet, polygonAmoy, arbitrumSepolia, optimismSepola, avalancheFuji, zkEVMTestnet],
|
|
12876
13408
|
projectId: walletConnectProjectId || 'e579511a495b5c312b572b036e60555a',
|
|
12877
13409
|
enableAnalytics: false,
|
|
12878
13410
|
featuredWalletIds: ['c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96', 'a797aa35c0fadbfc1a53e7f675162ed5226968b44a19ee3d24385c64d1d3c393', '4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0']
|