@skip-go/widget 3.14.12 → 3.14.13
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/build/{add-DTJ0r9Oc.js → add-CPX_3EXO.js} +1 -1
- package/build/{all-wallets-DRsQQ3Yq.js → all-wallets-DPBg_Lcg.js} +1 -1
- package/build/{app-store-dFm-eWfa.js → app-store-CpBwzfTK.js} +1 -1
- package/build/{apple-QVU9sQTW.js → apple-B9fj2Y96.js} +1 -1
- package/build/{arrow-bottom-CyKT3n7R.js → arrow-bottom-CvwbnYb0.js} +1 -1
- package/build/{arrow-bottom-circle-DeAW-ck-.js → arrow-bottom-circle-C432uVhB.js} +1 -1
- package/build/{arrow-left-D0GhHOhH.js → arrow-left-DR-vGpG9.js} +1 -1
- package/build/{arrow-right-DgOUG74z.js → arrow-right-3CIwGKXF.js} +1 -1
- package/build/{arrow-top-nsivDIGH.js → arrow-top-DVr6J11g.js} +1 -1
- package/build/{bank-Cuu6w5mE.js → bank-DzIjTJGt.js} +1 -1
- package/build/{basic-DVlGV4iV.js → basic-CeZ6-Jc_.js} +2 -2
- package/build/{browser-B1xbBbFQ.js → browser-Ce3U0Kpz.js} +1 -1
- package/build/{card-Bf3TBiLu.js → card-DKrF6Ng5.js} +1 -1
- package/build/{checkmark-Dn1dqa7K.js → checkmark-BXt_kogR.js} +1 -1
- package/build/{checkmark-bold-JUzdcDje.js → checkmark-bold-BxMmgcgC.js} +1 -1
- package/build/{chevron-bottom-B3bRNEiS.js → chevron-bottom-ClPdU3KW.js} +1 -1
- package/build/{chevron-left-XWTPu4D2.js → chevron-left-GVEeH1E0.js} +1 -1
- package/build/{chevron-right-BqT5fkbd.js → chevron-right-zgk945g4.js} +1 -1
- package/build/{chevron-top-8qUA1PR3.js → chevron-top-DaK0UdVy.js} +1 -1
- package/build/{chrome-store-CCH8RTZi.js → chrome-store-BS7bK-1V.js} +1 -1
- package/build/{clock-B6LcxOuL.js → clock-Dz4RK1yC.js} +1 -1
- package/build/{close-2d1qEE5e.js → close-BuqWVnPO.js} +1 -1
- package/build/{coinPlaceholder-wC7gqtCd.js → coinPlaceholder-33MB6KCG.js} +1 -1
- package/build/{compass-CQI_4vFz.js → compass-DMGdirhH.js} +1 -1
- package/build/{copy-BKw_wRcH.js → copy-BVh4Tjq1.js} +1 -1
- package/build/{core-fBWpXu25.js → core-CUCtL-BL.js} +4 -4
- package/build/{cursor-DKRO5imw.js → cursor-BntaOqzq.js} +1 -1
- package/build/{cursor-transparent-DMRH-m90.js → cursor-transparent-Vf0KLXs9.js} +1 -1
- package/build/{desktop-DIlXRgaj.js → desktop-B4X6CKzB.js} +1 -1
- package/build/{disconnect-BCEixwLw.js → disconnect-JU-qSWcG.js} +1 -1
- package/build/{discord-Bzcf-m_Q.js → discord-CgzpdB89.js} +1 -1
- package/build/{etherscan-C_ZI1vR4.js → etherscan-XCNU7ycM.js} +1 -1
- package/build/{exclamation-triangle-Db-FiY_F.js → exclamation-triangle-DDC1FAH7.js} +1 -1
- package/build/{extension-CY2q7Zqx.js → extension-BeUFGuLj.js} +1 -1
- package/build/{external-link-CIBU-S4h.js → external-link-Bs15ghtu.js} +1 -1
- package/build/{facebook-CrrsaIVk.js → facebook-D0JY4sSe.js} +1 -1
- package/build/{farcaster-BB4Np7AW.js → farcaster-_Chn6LJT.js} +1 -1
- package/build/{filters-By8hjheM.js → filters-BOpqDyBv.js} +1 -1
- package/build/{github-ClsQUbnd.js → github-DTr6nI1q.js} +1 -1
- package/build/{google-CmSOKuVv.js → google-DxhL83ry.js} +1 -1
- package/build/{help-circle-D73emoUK.js → help-circle-DwHPZEhw.js} +1 -1
- package/build/{id-ggc1-j_o.js → id-Cx21SPAm.js} +1 -1
- package/build/{image-Bfg6s8Sq.js → image-DiKxemEq.js} +1 -1
- package/build/{index-DrKE3KAh.js → index-BdLPO4Cr.js} +268 -1375
- package/build/{index-DQ1ZpkS3.js → index-BnuT7myn.js} +78 -78
- package/build/{index.es-D3c4GT5j.js → index.es-CbN_imGq.js} +2 -2
- package/build/index.js +1 -1
- package/build/{info-circle-QWFNx6G4.js → info-circle-Dhgwbw5U.js} +1 -1
- package/build/{info-DXQKWU94.js → info-yHny8019.js} +1 -1
- package/build/{lightbulb-CWYuEFWZ.js → lightbulb-D181oqbf.js} +1 -1
- package/build/{mail-DsSasBbi.js → mail-Dw4oZr35.js} +1 -1
- package/build/{mobile-Di-JiWIf.js → mobile-tnHCokvc.js} +1 -1
- package/build/{more-CDmViJ5n.js → more-DEDJSiQi.js} +1 -1
- package/build/{network-placeholder-Bh6NLd6j.js → network-placeholder-C0_Eu29q.js} +1 -1
- package/build/{nftPlaceholder-49yaHP5e.js → nftPlaceholder-CHUPtTXj.js} +1 -1
- package/build/{off-9ezxNSZD.js → off-DEipse2z.js} +1 -1
- package/build/{play-store-Bnnol52Z.js → play-store-BGrnfFuP.js} +1 -1
- package/build/{plus-K01AR696.js → plus-HgA2Py8o.js} +1 -1
- package/build/{qr-code-DDoxrrdh.js → qr-code-CnTrjPhJ.js} +1 -1
- package/build/{recycle-horizontal-DG6nSeii.js → recycle-horizontal-BWWnxTo2.js} +1 -1
- package/build/{refresh-VrKiC1Bd.js → refresh-9WnWB3yk.js} +1 -1
- package/build/{reown-logo-CvBPmYaz.js → reown-logo-vD68bE1j.js} +1 -1
- package/build/{search-EQjPy5lU.js → search-CENqbMW1.js} +1 -1
- package/build/{send-CCpthGTQ.js → send-SqWfjOwm.js} +1 -1
- package/build/{swapHorizontal-B0MDKC0z.js → swapHorizontal-CLuFPiJe.js} +1 -1
- package/build/{swapHorizontalBold-k9I-_6Fl.js → swapHorizontalBold-B3DV5CJ3.js} +1 -1
- package/build/{swapHorizontalMedium-Dwj8Stq0.js → swapHorizontalMedium-CrY6ReN_.js} +1 -1
- package/build/{swapHorizontalRoundedBold-By54ggIB.js → swapHorizontalRoundedBold-D3Uw9TU_.js} +1 -1
- package/build/{swapVertical-DAV0ekXw.js → swapVertical-Cb8baAX_.js} +1 -1
- package/build/{telegram-BNkPZV14.js → telegram-DjlHkff-.js} +1 -1
- package/build/{three-dots-DwrrN6F7.js → three-dots-D2YXni0L.js} +1 -1
- package/build/{twitch-Car9PCN0.js → twitch-Bgb2rWol.js} +1 -1
- package/build/{twitterIcon-BaHvJgQs.js → twitterIcon-D3yBmD5c.js} +1 -1
- package/build/{verify-DCMnzykH.js → verify-BoQNB5GI.js} +1 -1
- package/build/{verify-filled-CsQeRJP9.js → verify-filled-C6KyMBWh.js} +1 -1
- package/build/{w3m-modal-AWZI9QdA.js → w3m-modal-D3B--853.js} +2 -2
- package/build/{wallet-vOG-lPbS.js → wallet-Dg8b2shL.js} +1 -1
- package/build/{wallet-placeholder-CPnf4yeU.js → wallet-placeholder-H2A4rSYP.js} +1 -1
- package/build/{walletconnect-DMlUR-cu.js → walletconnect-BpbX2ppR.js} +1 -1
- package/build/{warning-circle-DiHYSzr4.js → warning-circle-CeJUdygh.js} +1 -1
- package/build/{x-CiQc5EQJ.js → x-NK630Y84.js} +1 -1
- package/package.json +5 -8
|
@@ -5,6 +5,7 @@ import { atom as atom$1, useAtomValue, useAtom, useSetAtom, createStore, Provide
|
|
|
5
5
|
import NiceModal, { useModal } from "@ebay/nice-modal-react";
|
|
6
6
|
import { chains, assets, venues, bridges, ChainType, getSigningStargateClient, route, balances, getRouteWithGasOnReceive, executeMultipleRoutes, executeRoute, BridgeType, FeeType, subscribeToRouteStatus, setClientOptions } from "@skip-go/client";
|
|
7
7
|
import { atomWithQuery, atomWithMutation } from "jotai-tanstack-query";
|
|
8
|
+
import BigNumber$1, { BigNumber } from "bignumber.js";
|
|
8
9
|
import pluralize from "pluralize";
|
|
9
10
|
import { track, init, add, setUserId } from "@amplitude/analytics-browser";
|
|
10
11
|
import { atomEffect } from "jotai-effect";
|
|
@@ -253,8 +254,8 @@ function getAugmentedNamespace(n) {
|
|
|
253
254
|
});
|
|
254
255
|
return a;
|
|
255
256
|
}
|
|
256
|
-
var shallowequal = function shallowEqual(objA, objB,
|
|
257
|
-
var ret =
|
|
257
|
+
var shallowequal = function shallowEqual(objA, objB, compare, compareContext) {
|
|
258
|
+
var ret = compare ? compare.call(compareContext, objA, objB) : void 0;
|
|
258
259
|
if (ret !== void 0) {
|
|
259
260
|
return !!ret;
|
|
260
261
|
}
|
|
@@ -277,7 +278,7 @@ var shallowequal = function shallowEqual(objA, objB, compare2, compareContext) {
|
|
|
277
278
|
}
|
|
278
279
|
var valueA = objA[key];
|
|
279
280
|
var valueB = objB[key];
|
|
280
|
-
ret =
|
|
281
|
+
ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0;
|
|
281
282
|
if (ret === false || ret === void 0 && valueA !== valueB) {
|
|
282
283
|
return false;
|
|
283
284
|
}
|
|
@@ -2808,1337 +2809,6 @@ const ROUTE_PREFERENCE_OPTIONS = [
|
|
|
2808
2809
|
RoutePreference.CHEAPEST
|
|
2809
2810
|
];
|
|
2810
2811
|
const DEFAULT_DECIMAL_PLACES = 6;
|
|
2811
|
-
var isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, mathceil = Math.ceil, mathfloor = Math.floor, bignumberError = "[BigNumber Error] ", tooManyDigits = bignumberError + "Number primitive has more than 15 significant digits: ", BASE = 1e14, LOG_BASE = 14, MAX_SAFE_INTEGER = 9007199254740991, POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], SQRT_BASE = 1e7, MAX = 1e9;
|
|
2812
|
-
function clone(configObject) {
|
|
2813
|
-
var div, convertBase, parseNumeric, P2 = BigNumber2.prototype = { constructor: BigNumber2, toString: null, valueOf: null }, ONE = new BigNumber2(1), DECIMAL_PLACES = 20, ROUNDING_MODE = 4, TO_EXP_NEG = -7, TO_EXP_POS = 21, MIN_EXP = -1e7, MAX_EXP = 1e7, CRYPTO = false, MODULO_MODE = 1, POW_PRECISION = 0, FORMAT = {
|
|
2814
|
-
prefix: "",
|
|
2815
|
-
groupSize: 3,
|
|
2816
|
-
secondaryGroupSize: 0,
|
|
2817
|
-
groupSeparator: ",",
|
|
2818
|
-
decimalSeparator: ".",
|
|
2819
|
-
fractionGroupSize: 0,
|
|
2820
|
-
fractionGroupSeparator: " ",
|
|
2821
|
-
// non-breaking space
|
|
2822
|
-
suffix: ""
|
|
2823
|
-
}, ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz", alphabetHasNormalDecimalDigits = true;
|
|
2824
|
-
function BigNumber2(v2, b) {
|
|
2825
|
-
var alphabet, c, caseChanged, e, i, isNum, len, str, x2 = this;
|
|
2826
|
-
if (!(x2 instanceof BigNumber2)) return new BigNumber2(v2, b);
|
|
2827
|
-
if (b == null) {
|
|
2828
|
-
if (v2 && v2._isBigNumber === true) {
|
|
2829
|
-
x2.s = v2.s;
|
|
2830
|
-
if (!v2.c || v2.e > MAX_EXP) {
|
|
2831
|
-
x2.c = x2.e = null;
|
|
2832
|
-
} else if (v2.e < MIN_EXP) {
|
|
2833
|
-
x2.c = [x2.e = 0];
|
|
2834
|
-
} else {
|
|
2835
|
-
x2.e = v2.e;
|
|
2836
|
-
x2.c = v2.c.slice();
|
|
2837
|
-
}
|
|
2838
|
-
return;
|
|
2839
|
-
}
|
|
2840
|
-
if ((isNum = typeof v2 == "number") && v2 * 0 == 0) {
|
|
2841
|
-
x2.s = 1 / v2 < 0 ? (v2 = -v2, -1) : 1;
|
|
2842
|
-
if (v2 === ~~v2) {
|
|
2843
|
-
for (e = 0, i = v2; i >= 10; i /= 10, e++) ;
|
|
2844
|
-
if (e > MAX_EXP) {
|
|
2845
|
-
x2.c = x2.e = null;
|
|
2846
|
-
} else {
|
|
2847
|
-
x2.e = e;
|
|
2848
|
-
x2.c = [v2];
|
|
2849
|
-
}
|
|
2850
|
-
return;
|
|
2851
|
-
}
|
|
2852
|
-
str = String(v2);
|
|
2853
|
-
} else {
|
|
2854
|
-
if (!isNumeric.test(str = String(v2))) return parseNumeric(x2, str, isNum);
|
|
2855
|
-
x2.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1;
|
|
2856
|
-
}
|
|
2857
|
-
if ((e = str.indexOf(".")) > -1) str = str.replace(".", "");
|
|
2858
|
-
if ((i = str.search(/e/i)) > 0) {
|
|
2859
|
-
if (e < 0) e = i;
|
|
2860
|
-
e += +str.slice(i + 1);
|
|
2861
|
-
str = str.substring(0, i);
|
|
2862
|
-
} else if (e < 0) {
|
|
2863
|
-
e = str.length;
|
|
2864
|
-
}
|
|
2865
|
-
} else {
|
|
2866
|
-
intCheck(b, 2, ALPHABET.length, "Base");
|
|
2867
|
-
if (b == 10 && alphabetHasNormalDecimalDigits) {
|
|
2868
|
-
x2 = new BigNumber2(v2);
|
|
2869
|
-
return round(x2, DECIMAL_PLACES + x2.e + 1, ROUNDING_MODE);
|
|
2870
|
-
}
|
|
2871
|
-
str = String(v2);
|
|
2872
|
-
if (isNum = typeof v2 == "number") {
|
|
2873
|
-
if (v2 * 0 != 0) return parseNumeric(x2, str, isNum, b);
|
|
2874
|
-
x2.s = 1 / v2 < 0 ? (str = str.slice(1), -1) : 1;
|
|
2875
|
-
if (BigNumber2.DEBUG && str.replace(/^0\.0*|\./, "").length > 15) {
|
|
2876
|
-
throw Error(tooManyDigits + v2);
|
|
2877
|
-
}
|
|
2878
|
-
} else {
|
|
2879
|
-
x2.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1;
|
|
2880
|
-
}
|
|
2881
|
-
alphabet = ALPHABET.slice(0, b);
|
|
2882
|
-
e = i = 0;
|
|
2883
|
-
for (len = str.length; i < len; i++) {
|
|
2884
|
-
if (alphabet.indexOf(c = str.charAt(i)) < 0) {
|
|
2885
|
-
if (c == ".") {
|
|
2886
|
-
if (i > e) {
|
|
2887
|
-
e = len;
|
|
2888
|
-
continue;
|
|
2889
|
-
}
|
|
2890
|
-
} else if (!caseChanged) {
|
|
2891
|
-
if (str == str.toUpperCase() && (str = str.toLowerCase()) || str == str.toLowerCase() && (str = str.toUpperCase())) {
|
|
2892
|
-
caseChanged = true;
|
|
2893
|
-
i = -1;
|
|
2894
|
-
e = 0;
|
|
2895
|
-
continue;
|
|
2896
|
-
}
|
|
2897
|
-
}
|
|
2898
|
-
return parseNumeric(x2, String(v2), isNum, b);
|
|
2899
|
-
}
|
|
2900
|
-
}
|
|
2901
|
-
isNum = false;
|
|
2902
|
-
str = convertBase(str, b, 10, x2.s);
|
|
2903
|
-
if ((e = str.indexOf(".")) > -1) str = str.replace(".", "");
|
|
2904
|
-
else e = str.length;
|
|
2905
|
-
}
|
|
2906
|
-
for (i = 0; str.charCodeAt(i) === 48; i++) ;
|
|
2907
|
-
for (len = str.length; str.charCodeAt(--len) === 48; ) ;
|
|
2908
|
-
if (str = str.slice(i, ++len)) {
|
|
2909
|
-
len -= i;
|
|
2910
|
-
if (isNum && BigNumber2.DEBUG && len > 15 && (v2 > MAX_SAFE_INTEGER || v2 !== mathfloor(v2))) {
|
|
2911
|
-
throw Error(tooManyDigits + x2.s * v2);
|
|
2912
|
-
}
|
|
2913
|
-
if ((e = e - i - 1) > MAX_EXP) {
|
|
2914
|
-
x2.c = x2.e = null;
|
|
2915
|
-
} else if (e < MIN_EXP) {
|
|
2916
|
-
x2.c = [x2.e = 0];
|
|
2917
|
-
} else {
|
|
2918
|
-
x2.e = e;
|
|
2919
|
-
x2.c = [];
|
|
2920
|
-
i = (e + 1) % LOG_BASE;
|
|
2921
|
-
if (e < 0) i += LOG_BASE;
|
|
2922
|
-
if (i < len) {
|
|
2923
|
-
if (i) x2.c.push(+str.slice(0, i));
|
|
2924
|
-
for (len -= LOG_BASE; i < len; ) {
|
|
2925
|
-
x2.c.push(+str.slice(i, i += LOG_BASE));
|
|
2926
|
-
}
|
|
2927
|
-
i = LOG_BASE - (str = str.slice(i)).length;
|
|
2928
|
-
} else {
|
|
2929
|
-
i -= len;
|
|
2930
|
-
}
|
|
2931
|
-
for (; i--; str += "0") ;
|
|
2932
|
-
x2.c.push(+str);
|
|
2933
|
-
}
|
|
2934
|
-
} else {
|
|
2935
|
-
x2.c = [x2.e = 0];
|
|
2936
|
-
}
|
|
2937
|
-
}
|
|
2938
|
-
BigNumber2.clone = clone;
|
|
2939
|
-
BigNumber2.ROUND_UP = 0;
|
|
2940
|
-
BigNumber2.ROUND_DOWN = 1;
|
|
2941
|
-
BigNumber2.ROUND_CEIL = 2;
|
|
2942
|
-
BigNumber2.ROUND_FLOOR = 3;
|
|
2943
|
-
BigNumber2.ROUND_HALF_UP = 4;
|
|
2944
|
-
BigNumber2.ROUND_HALF_DOWN = 5;
|
|
2945
|
-
BigNumber2.ROUND_HALF_EVEN = 6;
|
|
2946
|
-
BigNumber2.ROUND_HALF_CEIL = 7;
|
|
2947
|
-
BigNumber2.ROUND_HALF_FLOOR = 8;
|
|
2948
|
-
BigNumber2.EUCLID = 9;
|
|
2949
|
-
BigNumber2.config = BigNumber2.set = function(obj) {
|
|
2950
|
-
var p2, v2;
|
|
2951
|
-
if (obj != null) {
|
|
2952
|
-
if (typeof obj == "object") {
|
|
2953
|
-
if (obj.hasOwnProperty(p2 = "DECIMAL_PLACES")) {
|
|
2954
|
-
v2 = obj[p2];
|
|
2955
|
-
intCheck(v2, 0, MAX, p2);
|
|
2956
|
-
DECIMAL_PLACES = v2;
|
|
2957
|
-
}
|
|
2958
|
-
if (obj.hasOwnProperty(p2 = "ROUNDING_MODE")) {
|
|
2959
|
-
v2 = obj[p2];
|
|
2960
|
-
intCheck(v2, 0, 8, p2);
|
|
2961
|
-
ROUNDING_MODE = v2;
|
|
2962
|
-
}
|
|
2963
|
-
if (obj.hasOwnProperty(p2 = "EXPONENTIAL_AT")) {
|
|
2964
|
-
v2 = obj[p2];
|
|
2965
|
-
if (v2 && v2.pop) {
|
|
2966
|
-
intCheck(v2[0], -MAX, 0, p2);
|
|
2967
|
-
intCheck(v2[1], 0, MAX, p2);
|
|
2968
|
-
TO_EXP_NEG = v2[0];
|
|
2969
|
-
TO_EXP_POS = v2[1];
|
|
2970
|
-
} else {
|
|
2971
|
-
intCheck(v2, -MAX, MAX, p2);
|
|
2972
|
-
TO_EXP_NEG = -(TO_EXP_POS = v2 < 0 ? -v2 : v2);
|
|
2973
|
-
}
|
|
2974
|
-
}
|
|
2975
|
-
if (obj.hasOwnProperty(p2 = "RANGE")) {
|
|
2976
|
-
v2 = obj[p2];
|
|
2977
|
-
if (v2 && v2.pop) {
|
|
2978
|
-
intCheck(v2[0], -MAX, -1, p2);
|
|
2979
|
-
intCheck(v2[1], 1, MAX, p2);
|
|
2980
|
-
MIN_EXP = v2[0];
|
|
2981
|
-
MAX_EXP = v2[1];
|
|
2982
|
-
} else {
|
|
2983
|
-
intCheck(v2, -MAX, MAX, p2);
|
|
2984
|
-
if (v2) {
|
|
2985
|
-
MIN_EXP = -(MAX_EXP = v2 < 0 ? -v2 : v2);
|
|
2986
|
-
} else {
|
|
2987
|
-
throw Error(bignumberError + p2 + " cannot be zero: " + v2);
|
|
2988
|
-
}
|
|
2989
|
-
}
|
|
2990
|
-
}
|
|
2991
|
-
if (obj.hasOwnProperty(p2 = "CRYPTO")) {
|
|
2992
|
-
v2 = obj[p2];
|
|
2993
|
-
if (v2 === !!v2) {
|
|
2994
|
-
if (v2) {
|
|
2995
|
-
if (typeof crypto != "undefined" && crypto && (crypto.getRandomValues || crypto.randomBytes)) {
|
|
2996
|
-
CRYPTO = v2;
|
|
2997
|
-
} else {
|
|
2998
|
-
CRYPTO = !v2;
|
|
2999
|
-
throw Error(bignumberError + "crypto unavailable");
|
|
3000
|
-
}
|
|
3001
|
-
} else {
|
|
3002
|
-
CRYPTO = v2;
|
|
3003
|
-
}
|
|
3004
|
-
} else {
|
|
3005
|
-
throw Error(bignumberError + p2 + " not true or false: " + v2);
|
|
3006
|
-
}
|
|
3007
|
-
}
|
|
3008
|
-
if (obj.hasOwnProperty(p2 = "MODULO_MODE")) {
|
|
3009
|
-
v2 = obj[p2];
|
|
3010
|
-
intCheck(v2, 0, 9, p2);
|
|
3011
|
-
MODULO_MODE = v2;
|
|
3012
|
-
}
|
|
3013
|
-
if (obj.hasOwnProperty(p2 = "POW_PRECISION")) {
|
|
3014
|
-
v2 = obj[p2];
|
|
3015
|
-
intCheck(v2, 0, MAX, p2);
|
|
3016
|
-
POW_PRECISION = v2;
|
|
3017
|
-
}
|
|
3018
|
-
if (obj.hasOwnProperty(p2 = "FORMAT")) {
|
|
3019
|
-
v2 = obj[p2];
|
|
3020
|
-
if (typeof v2 == "object") FORMAT = v2;
|
|
3021
|
-
else throw Error(bignumberError + p2 + " not an object: " + v2);
|
|
3022
|
-
}
|
|
3023
|
-
if (obj.hasOwnProperty(p2 = "ALPHABET")) {
|
|
3024
|
-
v2 = obj[p2];
|
|
3025
|
-
if (typeof v2 == "string" && !/^.?$|[+\-.\s]|(.).*\1/.test(v2)) {
|
|
3026
|
-
alphabetHasNormalDecimalDigits = v2.slice(0, 10) == "0123456789";
|
|
3027
|
-
ALPHABET = v2;
|
|
3028
|
-
} else {
|
|
3029
|
-
throw Error(bignumberError + p2 + " invalid: " + v2);
|
|
3030
|
-
}
|
|
3031
|
-
}
|
|
3032
|
-
} else {
|
|
3033
|
-
throw Error(bignumberError + "Object expected: " + obj);
|
|
3034
|
-
}
|
|
3035
|
-
}
|
|
3036
|
-
return {
|
|
3037
|
-
DECIMAL_PLACES,
|
|
3038
|
-
ROUNDING_MODE,
|
|
3039
|
-
EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS],
|
|
3040
|
-
RANGE: [MIN_EXP, MAX_EXP],
|
|
3041
|
-
CRYPTO,
|
|
3042
|
-
MODULO_MODE,
|
|
3043
|
-
POW_PRECISION,
|
|
3044
|
-
FORMAT,
|
|
3045
|
-
ALPHABET
|
|
3046
|
-
};
|
|
3047
|
-
};
|
|
3048
|
-
BigNumber2.isBigNumber = function(v2) {
|
|
3049
|
-
if (!v2 || v2._isBigNumber !== true) return false;
|
|
3050
|
-
if (!BigNumber2.DEBUG) return true;
|
|
3051
|
-
var i, n, c = v2.c, e = v2.e, s = v2.s;
|
|
3052
|
-
out: if ({}.toString.call(c) == "[object Array]") {
|
|
3053
|
-
if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) {
|
|
3054
|
-
if (c[0] === 0) {
|
|
3055
|
-
if (e === 0 && c.length === 1) return true;
|
|
3056
|
-
break out;
|
|
3057
|
-
}
|
|
3058
|
-
i = (e + 1) % LOG_BASE;
|
|
3059
|
-
if (i < 1) i += LOG_BASE;
|
|
3060
|
-
if (String(c[0]).length == i) {
|
|
3061
|
-
for (i = 0; i < c.length; i++) {
|
|
3062
|
-
n = c[i];
|
|
3063
|
-
if (n < 0 || n >= BASE || n !== mathfloor(n)) break out;
|
|
3064
|
-
}
|
|
3065
|
-
if (n !== 0) return true;
|
|
3066
|
-
}
|
|
3067
|
-
}
|
|
3068
|
-
} else if (c === null && e === null && (s === null || s === 1 || s === -1)) {
|
|
3069
|
-
return true;
|
|
3070
|
-
}
|
|
3071
|
-
throw Error(bignumberError + "Invalid BigNumber: " + v2);
|
|
3072
|
-
};
|
|
3073
|
-
BigNumber2.maximum = BigNumber2.max = function() {
|
|
3074
|
-
return maxOrMin(arguments, -1);
|
|
3075
|
-
};
|
|
3076
|
-
BigNumber2.minimum = BigNumber2.min = function() {
|
|
3077
|
-
return maxOrMin(arguments, 1);
|
|
3078
|
-
};
|
|
3079
|
-
BigNumber2.random = function() {
|
|
3080
|
-
var pow2_53 = 9007199254740992;
|
|
3081
|
-
var random53bitInt = Math.random() * pow2_53 & 2097151 ? function() {
|
|
3082
|
-
return mathfloor(Math.random() * pow2_53);
|
|
3083
|
-
} : function() {
|
|
3084
|
-
return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0);
|
|
3085
|
-
};
|
|
3086
|
-
return function(dp) {
|
|
3087
|
-
var a, b, e, k2, v2, i = 0, c = [], rand = new BigNumber2(ONE);
|
|
3088
|
-
if (dp == null) dp = DECIMAL_PLACES;
|
|
3089
|
-
else intCheck(dp, 0, MAX);
|
|
3090
|
-
k2 = mathceil(dp / LOG_BASE);
|
|
3091
|
-
if (CRYPTO) {
|
|
3092
|
-
if (crypto.getRandomValues) {
|
|
3093
|
-
a = crypto.getRandomValues(new Uint32Array(k2 *= 2));
|
|
3094
|
-
for (; i < k2; ) {
|
|
3095
|
-
v2 = a[i] * 131072 + (a[i + 1] >>> 11);
|
|
3096
|
-
if (v2 >= 9e15) {
|
|
3097
|
-
b = crypto.getRandomValues(new Uint32Array(2));
|
|
3098
|
-
a[i] = b[0];
|
|
3099
|
-
a[i + 1] = b[1];
|
|
3100
|
-
} else {
|
|
3101
|
-
c.push(v2 % 1e14);
|
|
3102
|
-
i += 2;
|
|
3103
|
-
}
|
|
3104
|
-
}
|
|
3105
|
-
i = k2 / 2;
|
|
3106
|
-
} else if (crypto.randomBytes) {
|
|
3107
|
-
a = crypto.randomBytes(k2 *= 7);
|
|
3108
|
-
for (; i < k2; ) {
|
|
3109
|
-
v2 = (a[i] & 31) * 281474976710656 + a[i + 1] * 1099511627776 + a[i + 2] * 4294967296 + a[i + 3] * 16777216 + (a[i + 4] << 16) + (a[i + 5] << 8) + a[i + 6];
|
|
3110
|
-
if (v2 >= 9e15) {
|
|
3111
|
-
crypto.randomBytes(7).copy(a, i);
|
|
3112
|
-
} else {
|
|
3113
|
-
c.push(v2 % 1e14);
|
|
3114
|
-
i += 7;
|
|
3115
|
-
}
|
|
3116
|
-
}
|
|
3117
|
-
i = k2 / 7;
|
|
3118
|
-
} else {
|
|
3119
|
-
CRYPTO = false;
|
|
3120
|
-
throw Error(bignumberError + "crypto unavailable");
|
|
3121
|
-
}
|
|
3122
|
-
}
|
|
3123
|
-
if (!CRYPTO) {
|
|
3124
|
-
for (; i < k2; ) {
|
|
3125
|
-
v2 = random53bitInt();
|
|
3126
|
-
if (v2 < 9e15) c[i++] = v2 % 1e14;
|
|
3127
|
-
}
|
|
3128
|
-
}
|
|
3129
|
-
k2 = c[--i];
|
|
3130
|
-
dp %= LOG_BASE;
|
|
3131
|
-
if (k2 && dp) {
|
|
3132
|
-
v2 = POWS_TEN[LOG_BASE - dp];
|
|
3133
|
-
c[i] = mathfloor(k2 / v2) * v2;
|
|
3134
|
-
}
|
|
3135
|
-
for (; c[i] === 0; c.pop(), i--) ;
|
|
3136
|
-
if (i < 0) {
|
|
3137
|
-
c = [e = 0];
|
|
3138
|
-
} else {
|
|
3139
|
-
for (e = -1; c[0] === 0; c.splice(0, 1), e -= LOG_BASE) ;
|
|
3140
|
-
for (i = 1, v2 = c[0]; v2 >= 10; v2 /= 10, i++) ;
|
|
3141
|
-
if (i < LOG_BASE) e -= LOG_BASE - i;
|
|
3142
|
-
}
|
|
3143
|
-
rand.e = e;
|
|
3144
|
-
rand.c = c;
|
|
3145
|
-
return rand;
|
|
3146
|
-
};
|
|
3147
|
-
}();
|
|
3148
|
-
BigNumber2.sum = function() {
|
|
3149
|
-
var i = 1, args = arguments, sum = new BigNumber2(args[0]);
|
|
3150
|
-
for (; i < args.length; ) sum = sum.plus(args[i++]);
|
|
3151
|
-
return sum;
|
|
3152
|
-
};
|
|
3153
|
-
convertBase = /* @__PURE__ */ function() {
|
|
3154
|
-
var decimal = "0123456789";
|
|
3155
|
-
function toBaseOut(str, baseIn, baseOut, alphabet) {
|
|
3156
|
-
var j2, arr = [0], arrL, i = 0, len = str.length;
|
|
3157
|
-
for (; i < len; ) {
|
|
3158
|
-
for (arrL = arr.length; arrL--; arr[arrL] *= baseIn) ;
|
|
3159
|
-
arr[0] += alphabet.indexOf(str.charAt(i++));
|
|
3160
|
-
for (j2 = 0; j2 < arr.length; j2++) {
|
|
3161
|
-
if (arr[j2] > baseOut - 1) {
|
|
3162
|
-
if (arr[j2 + 1] == null) arr[j2 + 1] = 0;
|
|
3163
|
-
arr[j2 + 1] += arr[j2] / baseOut | 0;
|
|
3164
|
-
arr[j2] %= baseOut;
|
|
3165
|
-
}
|
|
3166
|
-
}
|
|
3167
|
-
}
|
|
3168
|
-
return arr.reverse();
|
|
3169
|
-
}
|
|
3170
|
-
return function(str, baseIn, baseOut, sign, callerIsToString) {
|
|
3171
|
-
var alphabet, d, e, k2, r, x2, xc, y2, i = str.indexOf("."), dp = DECIMAL_PLACES, rm = ROUNDING_MODE;
|
|
3172
|
-
if (i >= 0) {
|
|
3173
|
-
k2 = POW_PRECISION;
|
|
3174
|
-
POW_PRECISION = 0;
|
|
3175
|
-
str = str.replace(".", "");
|
|
3176
|
-
y2 = new BigNumber2(baseIn);
|
|
3177
|
-
x2 = y2.pow(str.length - i);
|
|
3178
|
-
POW_PRECISION = k2;
|
|
3179
|
-
y2.c = toBaseOut(
|
|
3180
|
-
toFixedPoint(coeffToString(x2.c), x2.e, "0"),
|
|
3181
|
-
10,
|
|
3182
|
-
baseOut,
|
|
3183
|
-
decimal
|
|
3184
|
-
);
|
|
3185
|
-
y2.e = y2.c.length;
|
|
3186
|
-
}
|
|
3187
|
-
xc = toBaseOut(str, baseIn, baseOut, callerIsToString ? (alphabet = ALPHABET, decimal) : (alphabet = decimal, ALPHABET));
|
|
3188
|
-
e = k2 = xc.length;
|
|
3189
|
-
for (; xc[--k2] == 0; xc.pop()) ;
|
|
3190
|
-
if (!xc[0]) return alphabet.charAt(0);
|
|
3191
|
-
if (i < 0) {
|
|
3192
|
-
--e;
|
|
3193
|
-
} else {
|
|
3194
|
-
x2.c = xc;
|
|
3195
|
-
x2.e = e;
|
|
3196
|
-
x2.s = sign;
|
|
3197
|
-
x2 = div(x2, y2, dp, rm, baseOut);
|
|
3198
|
-
xc = x2.c;
|
|
3199
|
-
r = x2.r;
|
|
3200
|
-
e = x2.e;
|
|
3201
|
-
}
|
|
3202
|
-
d = e + dp + 1;
|
|
3203
|
-
i = xc[d];
|
|
3204
|
-
k2 = baseOut / 2;
|
|
3205
|
-
r = r || d < 0 || xc[d + 1] != null;
|
|
3206
|
-
r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x2.s < 0 ? 3 : 2)) : i > k2 || i == k2 && (rm == 4 || r || rm == 6 && xc[d - 1] & 1 || rm == (x2.s < 0 ? 8 : 7));
|
|
3207
|
-
if (d < 1 || !xc[0]) {
|
|
3208
|
-
str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0);
|
|
3209
|
-
} else {
|
|
3210
|
-
xc.length = d;
|
|
3211
|
-
if (r) {
|
|
3212
|
-
for (--baseOut; ++xc[--d] > baseOut; ) {
|
|
3213
|
-
xc[d] = 0;
|
|
3214
|
-
if (!d) {
|
|
3215
|
-
++e;
|
|
3216
|
-
xc = [1].concat(xc);
|
|
3217
|
-
}
|
|
3218
|
-
}
|
|
3219
|
-
}
|
|
3220
|
-
for (k2 = xc.length; !xc[--k2]; ) ;
|
|
3221
|
-
for (i = 0, str = ""; i <= k2; str += alphabet.charAt(xc[i++])) ;
|
|
3222
|
-
str = toFixedPoint(str, e, alphabet.charAt(0));
|
|
3223
|
-
}
|
|
3224
|
-
return str;
|
|
3225
|
-
};
|
|
3226
|
-
}();
|
|
3227
|
-
div = /* @__PURE__ */ function() {
|
|
3228
|
-
function multiply(x2, k2, base2) {
|
|
3229
|
-
var m2, temp, xlo, xhi, carry = 0, i = x2.length, klo = k2 % SQRT_BASE, khi = k2 / SQRT_BASE | 0;
|
|
3230
|
-
for (x2 = x2.slice(); i--; ) {
|
|
3231
|
-
xlo = x2[i] % SQRT_BASE;
|
|
3232
|
-
xhi = x2[i] / SQRT_BASE | 0;
|
|
3233
|
-
m2 = khi * xlo + xhi * klo;
|
|
3234
|
-
temp = klo * xlo + m2 % SQRT_BASE * SQRT_BASE + carry;
|
|
3235
|
-
carry = (temp / base2 | 0) + (m2 / SQRT_BASE | 0) + khi * xhi;
|
|
3236
|
-
x2[i] = temp % base2;
|
|
3237
|
-
}
|
|
3238
|
-
if (carry) x2 = [carry].concat(x2);
|
|
3239
|
-
return x2;
|
|
3240
|
-
}
|
|
3241
|
-
function compare2(a, b, aL, bL) {
|
|
3242
|
-
var i, cmp;
|
|
3243
|
-
if (aL != bL) {
|
|
3244
|
-
cmp = aL > bL ? 1 : -1;
|
|
3245
|
-
} else {
|
|
3246
|
-
for (i = cmp = 0; i < aL; i++) {
|
|
3247
|
-
if (a[i] != b[i]) {
|
|
3248
|
-
cmp = a[i] > b[i] ? 1 : -1;
|
|
3249
|
-
break;
|
|
3250
|
-
}
|
|
3251
|
-
}
|
|
3252
|
-
}
|
|
3253
|
-
return cmp;
|
|
3254
|
-
}
|
|
3255
|
-
function subtract(a, b, aL, base2) {
|
|
3256
|
-
var i = 0;
|
|
3257
|
-
for (; aL--; ) {
|
|
3258
|
-
a[aL] -= i;
|
|
3259
|
-
i = a[aL] < b[aL] ? 1 : 0;
|
|
3260
|
-
a[aL] = i * base2 + a[aL] - b[aL];
|
|
3261
|
-
}
|
|
3262
|
-
for (; !a[0] && a.length > 1; a.splice(0, 1)) ;
|
|
3263
|
-
}
|
|
3264
|
-
return function(x2, y2, dp, rm, base2) {
|
|
3265
|
-
var cmp, e, i, more, n, prod, prodL, q2, qc, rem, remL, rem0, xi, xL, yc0, yL, yz, s = x2.s == y2.s ? 1 : -1, xc = x2.c, yc = y2.c;
|
|
3266
|
-
if (!xc || !xc[0] || !yc || !yc[0]) {
|
|
3267
|
-
return new BigNumber2(
|
|
3268
|
-
// Return NaN if either NaN, or both Infinity or 0.
|
|
3269
|
-
!x2.s || !y2.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN : (
|
|
3270
|
-
// Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.
|
|
3271
|
-
xc && xc[0] == 0 || !yc ? s * 0 : s / 0
|
|
3272
|
-
)
|
|
3273
|
-
);
|
|
3274
|
-
}
|
|
3275
|
-
q2 = new BigNumber2(s);
|
|
3276
|
-
qc = q2.c = [];
|
|
3277
|
-
e = x2.e - y2.e;
|
|
3278
|
-
s = dp + e + 1;
|
|
3279
|
-
if (!base2) {
|
|
3280
|
-
base2 = BASE;
|
|
3281
|
-
e = bitFloor(x2.e / LOG_BASE) - bitFloor(y2.e / LOG_BASE);
|
|
3282
|
-
s = s / LOG_BASE | 0;
|
|
3283
|
-
}
|
|
3284
|
-
for (i = 0; yc[i] == (xc[i] || 0); i++) ;
|
|
3285
|
-
if (yc[i] > (xc[i] || 0)) e--;
|
|
3286
|
-
if (s < 0) {
|
|
3287
|
-
qc.push(1);
|
|
3288
|
-
more = true;
|
|
3289
|
-
} else {
|
|
3290
|
-
xL = xc.length;
|
|
3291
|
-
yL = yc.length;
|
|
3292
|
-
i = 0;
|
|
3293
|
-
s += 2;
|
|
3294
|
-
n = mathfloor(base2 / (yc[0] + 1));
|
|
3295
|
-
if (n > 1) {
|
|
3296
|
-
yc = multiply(yc, n, base2);
|
|
3297
|
-
xc = multiply(xc, n, base2);
|
|
3298
|
-
yL = yc.length;
|
|
3299
|
-
xL = xc.length;
|
|
3300
|
-
}
|
|
3301
|
-
xi = yL;
|
|
3302
|
-
rem = xc.slice(0, yL);
|
|
3303
|
-
remL = rem.length;
|
|
3304
|
-
for (; remL < yL; rem[remL++] = 0) ;
|
|
3305
|
-
yz = yc.slice();
|
|
3306
|
-
yz = [0].concat(yz);
|
|
3307
|
-
yc0 = yc[0];
|
|
3308
|
-
if (yc[1] >= base2 / 2) yc0++;
|
|
3309
|
-
do {
|
|
3310
|
-
n = 0;
|
|
3311
|
-
cmp = compare2(yc, rem, yL, remL);
|
|
3312
|
-
if (cmp < 0) {
|
|
3313
|
-
rem0 = rem[0];
|
|
3314
|
-
if (yL != remL) rem0 = rem0 * base2 + (rem[1] || 0);
|
|
3315
|
-
n = mathfloor(rem0 / yc0);
|
|
3316
|
-
if (n > 1) {
|
|
3317
|
-
if (n >= base2) n = base2 - 1;
|
|
3318
|
-
prod = multiply(yc, n, base2);
|
|
3319
|
-
prodL = prod.length;
|
|
3320
|
-
remL = rem.length;
|
|
3321
|
-
while (compare2(prod, rem, prodL, remL) == 1) {
|
|
3322
|
-
n--;
|
|
3323
|
-
subtract(prod, yL < prodL ? yz : yc, prodL, base2);
|
|
3324
|
-
prodL = prod.length;
|
|
3325
|
-
cmp = 1;
|
|
3326
|
-
}
|
|
3327
|
-
} else {
|
|
3328
|
-
if (n == 0) {
|
|
3329
|
-
cmp = n = 1;
|
|
3330
|
-
}
|
|
3331
|
-
prod = yc.slice();
|
|
3332
|
-
prodL = prod.length;
|
|
3333
|
-
}
|
|
3334
|
-
if (prodL < remL) prod = [0].concat(prod);
|
|
3335
|
-
subtract(rem, prod, remL, base2);
|
|
3336
|
-
remL = rem.length;
|
|
3337
|
-
if (cmp == -1) {
|
|
3338
|
-
while (compare2(yc, rem, yL, remL) < 1) {
|
|
3339
|
-
n++;
|
|
3340
|
-
subtract(rem, yL < remL ? yz : yc, remL, base2);
|
|
3341
|
-
remL = rem.length;
|
|
3342
|
-
}
|
|
3343
|
-
}
|
|
3344
|
-
} else if (cmp === 0) {
|
|
3345
|
-
n++;
|
|
3346
|
-
rem = [0];
|
|
3347
|
-
}
|
|
3348
|
-
qc[i++] = n;
|
|
3349
|
-
if (rem[0]) {
|
|
3350
|
-
rem[remL++] = xc[xi] || 0;
|
|
3351
|
-
} else {
|
|
3352
|
-
rem = [xc[xi]];
|
|
3353
|
-
remL = 1;
|
|
3354
|
-
}
|
|
3355
|
-
} while ((xi++ < xL || rem[0] != null) && s--);
|
|
3356
|
-
more = rem[0] != null;
|
|
3357
|
-
if (!qc[0]) qc.splice(0, 1);
|
|
3358
|
-
}
|
|
3359
|
-
if (base2 == BASE) {
|
|
3360
|
-
for (i = 1, s = qc[0]; s >= 10; s /= 10, i++) ;
|
|
3361
|
-
round(q2, dp + (q2.e = i + e * LOG_BASE - 1) + 1, rm, more);
|
|
3362
|
-
} else {
|
|
3363
|
-
q2.e = e;
|
|
3364
|
-
q2.r = +more;
|
|
3365
|
-
}
|
|
3366
|
-
return q2;
|
|
3367
|
-
};
|
|
3368
|
-
}();
|
|
3369
|
-
function format(n, i, rm, id) {
|
|
3370
|
-
var c0, e, ne2, len, str;
|
|
3371
|
-
if (rm == null) rm = ROUNDING_MODE;
|
|
3372
|
-
else intCheck(rm, 0, 8);
|
|
3373
|
-
if (!n.c) return n.toString();
|
|
3374
|
-
c0 = n.c[0];
|
|
3375
|
-
ne2 = n.e;
|
|
3376
|
-
if (i == null) {
|
|
3377
|
-
str = coeffToString(n.c);
|
|
3378
|
-
str = id == 1 || id == 2 && (ne2 <= TO_EXP_NEG || ne2 >= TO_EXP_POS) ? toExponential(str, ne2) : toFixedPoint(str, ne2, "0");
|
|
3379
|
-
} else {
|
|
3380
|
-
n = round(new BigNumber2(n), i, rm);
|
|
3381
|
-
e = n.e;
|
|
3382
|
-
str = coeffToString(n.c);
|
|
3383
|
-
len = str.length;
|
|
3384
|
-
if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) {
|
|
3385
|
-
for (; len < i; str += "0", len++) ;
|
|
3386
|
-
str = toExponential(str, e);
|
|
3387
|
-
} else {
|
|
3388
|
-
i -= ne2 + (id === 2 && e > ne2);
|
|
3389
|
-
str = toFixedPoint(str, e, "0");
|
|
3390
|
-
if (e + 1 > len) {
|
|
3391
|
-
if (--i > 0) for (str += "."; i--; str += "0") ;
|
|
3392
|
-
} else {
|
|
3393
|
-
i += e - len;
|
|
3394
|
-
if (i > 0) {
|
|
3395
|
-
if (e + 1 == len) str += ".";
|
|
3396
|
-
for (; i--; str += "0") ;
|
|
3397
|
-
}
|
|
3398
|
-
}
|
|
3399
|
-
}
|
|
3400
|
-
}
|
|
3401
|
-
return n.s < 0 && c0 ? "-" + str : str;
|
|
3402
|
-
}
|
|
3403
|
-
function maxOrMin(args, n) {
|
|
3404
|
-
var k2, y2, i = 1, x2 = new BigNumber2(args[0]);
|
|
3405
|
-
for (; i < args.length; i++) {
|
|
3406
|
-
y2 = new BigNumber2(args[i]);
|
|
3407
|
-
if (!y2.s || (k2 = compare(x2, y2)) === n || k2 === 0 && x2.s === n) {
|
|
3408
|
-
x2 = y2;
|
|
3409
|
-
}
|
|
3410
|
-
}
|
|
3411
|
-
return x2;
|
|
3412
|
-
}
|
|
3413
|
-
function normalise(n, c, e) {
|
|
3414
|
-
var i = 1, j2 = c.length;
|
|
3415
|
-
for (; !c[--j2]; c.pop()) ;
|
|
3416
|
-
for (j2 = c[0]; j2 >= 10; j2 /= 10, i++) ;
|
|
3417
|
-
if ((e = i + e * LOG_BASE - 1) > MAX_EXP) {
|
|
3418
|
-
n.c = n.e = null;
|
|
3419
|
-
} else if (e < MIN_EXP) {
|
|
3420
|
-
n.c = [n.e = 0];
|
|
3421
|
-
} else {
|
|
3422
|
-
n.e = e;
|
|
3423
|
-
n.c = c;
|
|
3424
|
-
}
|
|
3425
|
-
return n;
|
|
3426
|
-
}
|
|
3427
|
-
parseNumeric = /* @__PURE__ */ function() {
|
|
3428
|
-
var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i, dotAfter = /^([^.]+)\.$/, dotBefore = /^\.([^.]+)$/, isInfinityOrNaN = /^-?(Infinity|NaN)$/, whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
|
|
3429
|
-
return function(x2, str, isNum, b) {
|
|
3430
|
-
var base2, s = isNum ? str : str.replace(whitespaceOrPlus, "");
|
|
3431
|
-
if (isInfinityOrNaN.test(s)) {
|
|
3432
|
-
x2.s = isNaN(s) ? null : s < 0 ? -1 : 1;
|
|
3433
|
-
} else {
|
|
3434
|
-
if (!isNum) {
|
|
3435
|
-
s = s.replace(basePrefix, function(m2, p1, p2) {
|
|
3436
|
-
base2 = (p2 = p2.toLowerCase()) == "x" ? 16 : p2 == "b" ? 2 : 8;
|
|
3437
|
-
return !b || b == base2 ? p1 : m2;
|
|
3438
|
-
});
|
|
3439
|
-
if (b) {
|
|
3440
|
-
base2 = b;
|
|
3441
|
-
s = s.replace(dotAfter, "$1").replace(dotBefore, "0.$1");
|
|
3442
|
-
}
|
|
3443
|
-
if (str != s) return new BigNumber2(s, base2);
|
|
3444
|
-
}
|
|
3445
|
-
if (BigNumber2.DEBUG) {
|
|
3446
|
-
throw Error(bignumberError + "Not a" + (b ? " base " + b : "") + " number: " + str);
|
|
3447
|
-
}
|
|
3448
|
-
x2.s = null;
|
|
3449
|
-
}
|
|
3450
|
-
x2.c = x2.e = null;
|
|
3451
|
-
};
|
|
3452
|
-
}();
|
|
3453
|
-
function round(x2, sd, rm, r) {
|
|
3454
|
-
var d, i, j2, k2, n, ni, rd, xc = x2.c, pows10 = POWS_TEN;
|
|
3455
|
-
if (xc) {
|
|
3456
|
-
out: {
|
|
3457
|
-
for (d = 1, k2 = xc[0]; k2 >= 10; k2 /= 10, d++) ;
|
|
3458
|
-
i = sd - d;
|
|
3459
|
-
if (i < 0) {
|
|
3460
|
-
i += LOG_BASE;
|
|
3461
|
-
j2 = sd;
|
|
3462
|
-
n = xc[ni = 0];
|
|
3463
|
-
rd = mathfloor(n / pows10[d - j2 - 1] % 10);
|
|
3464
|
-
} else {
|
|
3465
|
-
ni = mathceil((i + 1) / LOG_BASE);
|
|
3466
|
-
if (ni >= xc.length) {
|
|
3467
|
-
if (r) {
|
|
3468
|
-
for (; xc.length <= ni; xc.push(0)) ;
|
|
3469
|
-
n = rd = 0;
|
|
3470
|
-
d = 1;
|
|
3471
|
-
i %= LOG_BASE;
|
|
3472
|
-
j2 = i - LOG_BASE + 1;
|
|
3473
|
-
} else {
|
|
3474
|
-
break out;
|
|
3475
|
-
}
|
|
3476
|
-
} else {
|
|
3477
|
-
n = k2 = xc[ni];
|
|
3478
|
-
for (d = 1; k2 >= 10; k2 /= 10, d++) ;
|
|
3479
|
-
i %= LOG_BASE;
|
|
3480
|
-
j2 = i - LOG_BASE + d;
|
|
3481
|
-
rd = j2 < 0 ? 0 : mathfloor(n / pows10[d - j2 - 1] % 10);
|
|
3482
|
-
}
|
|
3483
|
-
}
|
|
3484
|
-
r = r || sd < 0 || // Are there any non-zero digits after the rounding digit?
|
|
3485
|
-
// The expression n % pows10[d - j - 1] returns all digits of n to the right
|
|
3486
|
-
// of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.
|
|
3487
|
-
xc[ni + 1] != null || (j2 < 0 ? n : n % pows10[d - j2 - 1]);
|
|
3488
|
-
r = rm < 4 ? (rd || r) && (rm == 0 || rm == (x2.s < 0 ? 3 : 2)) : rd > 5 || rd == 5 && (rm == 4 || r || rm == 6 && // Check whether the digit to the left of the rounding digit is odd.
|
|
3489
|
-
(i > 0 ? j2 > 0 ? n / pows10[d - j2] : 0 : xc[ni - 1]) % 10 & 1 || rm == (x2.s < 0 ? 8 : 7));
|
|
3490
|
-
if (sd < 1 || !xc[0]) {
|
|
3491
|
-
xc.length = 0;
|
|
3492
|
-
if (r) {
|
|
3493
|
-
sd -= x2.e + 1;
|
|
3494
|
-
xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE];
|
|
3495
|
-
x2.e = -sd || 0;
|
|
3496
|
-
} else {
|
|
3497
|
-
xc[0] = x2.e = 0;
|
|
3498
|
-
}
|
|
3499
|
-
return x2;
|
|
3500
|
-
}
|
|
3501
|
-
if (i == 0) {
|
|
3502
|
-
xc.length = ni;
|
|
3503
|
-
k2 = 1;
|
|
3504
|
-
ni--;
|
|
3505
|
-
} else {
|
|
3506
|
-
xc.length = ni + 1;
|
|
3507
|
-
k2 = pows10[LOG_BASE - i];
|
|
3508
|
-
xc[ni] = j2 > 0 ? mathfloor(n / pows10[d - j2] % pows10[j2]) * k2 : 0;
|
|
3509
|
-
}
|
|
3510
|
-
if (r) {
|
|
3511
|
-
for (; ; ) {
|
|
3512
|
-
if (ni == 0) {
|
|
3513
|
-
for (i = 1, j2 = xc[0]; j2 >= 10; j2 /= 10, i++) ;
|
|
3514
|
-
j2 = xc[0] += k2;
|
|
3515
|
-
for (k2 = 1; j2 >= 10; j2 /= 10, k2++) ;
|
|
3516
|
-
if (i != k2) {
|
|
3517
|
-
x2.e++;
|
|
3518
|
-
if (xc[0] == BASE) xc[0] = 1;
|
|
3519
|
-
}
|
|
3520
|
-
break;
|
|
3521
|
-
} else {
|
|
3522
|
-
xc[ni] += k2;
|
|
3523
|
-
if (xc[ni] != BASE) break;
|
|
3524
|
-
xc[ni--] = 0;
|
|
3525
|
-
k2 = 1;
|
|
3526
|
-
}
|
|
3527
|
-
}
|
|
3528
|
-
}
|
|
3529
|
-
for (i = xc.length; xc[--i] === 0; xc.pop()) ;
|
|
3530
|
-
}
|
|
3531
|
-
if (x2.e > MAX_EXP) {
|
|
3532
|
-
x2.c = x2.e = null;
|
|
3533
|
-
} else if (x2.e < MIN_EXP) {
|
|
3534
|
-
x2.c = [x2.e = 0];
|
|
3535
|
-
}
|
|
3536
|
-
}
|
|
3537
|
-
return x2;
|
|
3538
|
-
}
|
|
3539
|
-
function valueOf(n) {
|
|
3540
|
-
var str, e = n.e;
|
|
3541
|
-
if (e === null) return n.toString();
|
|
3542
|
-
str = coeffToString(n.c);
|
|
3543
|
-
str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(str, e) : toFixedPoint(str, e, "0");
|
|
3544
|
-
return n.s < 0 ? "-" + str : str;
|
|
3545
|
-
}
|
|
3546
|
-
P2.absoluteValue = P2.abs = function() {
|
|
3547
|
-
var x2 = new BigNumber2(this);
|
|
3548
|
-
if (x2.s < 0) x2.s = 1;
|
|
3549
|
-
return x2;
|
|
3550
|
-
};
|
|
3551
|
-
P2.comparedTo = function(y2, b) {
|
|
3552
|
-
return compare(this, new BigNumber2(y2, b));
|
|
3553
|
-
};
|
|
3554
|
-
P2.decimalPlaces = P2.dp = function(dp, rm) {
|
|
3555
|
-
var c, n, v2, x2 = this;
|
|
3556
|
-
if (dp != null) {
|
|
3557
|
-
intCheck(dp, 0, MAX);
|
|
3558
|
-
if (rm == null) rm = ROUNDING_MODE;
|
|
3559
|
-
else intCheck(rm, 0, 8);
|
|
3560
|
-
return round(new BigNumber2(x2), dp + x2.e + 1, rm);
|
|
3561
|
-
}
|
|
3562
|
-
if (!(c = x2.c)) return null;
|
|
3563
|
-
n = ((v2 = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE;
|
|
3564
|
-
if (v2 = c[v2]) for (; v2 % 10 == 0; v2 /= 10, n--) ;
|
|
3565
|
-
if (n < 0) n = 0;
|
|
3566
|
-
return n;
|
|
3567
|
-
};
|
|
3568
|
-
P2.dividedBy = P2.div = function(y2, b) {
|
|
3569
|
-
return div(this, new BigNumber2(y2, b), DECIMAL_PLACES, ROUNDING_MODE);
|
|
3570
|
-
};
|
|
3571
|
-
P2.dividedToIntegerBy = P2.idiv = function(y2, b) {
|
|
3572
|
-
return div(this, new BigNumber2(y2, b), 0, 1);
|
|
3573
|
-
};
|
|
3574
|
-
P2.exponentiatedBy = P2.pow = function(n, m2) {
|
|
3575
|
-
var half, isModExp, i, k2, more, nIsBig, nIsNeg, nIsOdd, y2, x2 = this;
|
|
3576
|
-
n = new BigNumber2(n);
|
|
3577
|
-
if (n.c && !n.isInteger()) {
|
|
3578
|
-
throw Error(bignumberError + "Exponent not an integer: " + valueOf(n));
|
|
3579
|
-
}
|
|
3580
|
-
if (m2 != null) m2 = new BigNumber2(m2);
|
|
3581
|
-
nIsBig = n.e > 14;
|
|
3582
|
-
if (!x2.c || !x2.c[0] || x2.c[0] == 1 && !x2.e && x2.c.length == 1 || !n.c || !n.c[0]) {
|
|
3583
|
-
y2 = new BigNumber2(Math.pow(+valueOf(x2), nIsBig ? n.s * (2 - isOdd(n)) : +valueOf(n)));
|
|
3584
|
-
return m2 ? y2.mod(m2) : y2;
|
|
3585
|
-
}
|
|
3586
|
-
nIsNeg = n.s < 0;
|
|
3587
|
-
if (m2) {
|
|
3588
|
-
if (m2.c ? !m2.c[0] : !m2.s) return new BigNumber2(NaN);
|
|
3589
|
-
isModExp = !nIsNeg && x2.isInteger() && m2.isInteger();
|
|
3590
|
-
if (isModExp) x2 = x2.mod(m2);
|
|
3591
|
-
} else if (n.e > 9 && (x2.e > 0 || x2.e < -1 || (x2.e == 0 ? x2.c[0] > 1 || nIsBig && x2.c[1] >= 24e7 : x2.c[0] < 8e13 || nIsBig && x2.c[0] <= 9999975e7))) {
|
|
3592
|
-
k2 = x2.s < 0 && isOdd(n) ? -0 : 0;
|
|
3593
|
-
if (x2.e > -1) k2 = 1 / k2;
|
|
3594
|
-
return new BigNumber2(nIsNeg ? 1 / k2 : k2);
|
|
3595
|
-
} else if (POW_PRECISION) {
|
|
3596
|
-
k2 = mathceil(POW_PRECISION / LOG_BASE + 2);
|
|
3597
|
-
}
|
|
3598
|
-
if (nIsBig) {
|
|
3599
|
-
half = new BigNumber2(0.5);
|
|
3600
|
-
if (nIsNeg) n.s = 1;
|
|
3601
|
-
nIsOdd = isOdd(n);
|
|
3602
|
-
} else {
|
|
3603
|
-
i = Math.abs(+valueOf(n));
|
|
3604
|
-
nIsOdd = i % 2;
|
|
3605
|
-
}
|
|
3606
|
-
y2 = new BigNumber2(ONE);
|
|
3607
|
-
for (; ; ) {
|
|
3608
|
-
if (nIsOdd) {
|
|
3609
|
-
y2 = y2.times(x2);
|
|
3610
|
-
if (!y2.c) break;
|
|
3611
|
-
if (k2) {
|
|
3612
|
-
if (y2.c.length > k2) y2.c.length = k2;
|
|
3613
|
-
} else if (isModExp) {
|
|
3614
|
-
y2 = y2.mod(m2);
|
|
3615
|
-
}
|
|
3616
|
-
}
|
|
3617
|
-
if (i) {
|
|
3618
|
-
i = mathfloor(i / 2);
|
|
3619
|
-
if (i === 0) break;
|
|
3620
|
-
nIsOdd = i % 2;
|
|
3621
|
-
} else {
|
|
3622
|
-
n = n.times(half);
|
|
3623
|
-
round(n, n.e + 1, 1);
|
|
3624
|
-
if (n.e > 14) {
|
|
3625
|
-
nIsOdd = isOdd(n);
|
|
3626
|
-
} else {
|
|
3627
|
-
i = +valueOf(n);
|
|
3628
|
-
if (i === 0) break;
|
|
3629
|
-
nIsOdd = i % 2;
|
|
3630
|
-
}
|
|
3631
|
-
}
|
|
3632
|
-
x2 = x2.times(x2);
|
|
3633
|
-
if (k2) {
|
|
3634
|
-
if (x2.c && x2.c.length > k2) x2.c.length = k2;
|
|
3635
|
-
} else if (isModExp) {
|
|
3636
|
-
x2 = x2.mod(m2);
|
|
3637
|
-
}
|
|
3638
|
-
}
|
|
3639
|
-
if (isModExp) return y2;
|
|
3640
|
-
if (nIsNeg) y2 = ONE.div(y2);
|
|
3641
|
-
return m2 ? y2.mod(m2) : k2 ? round(y2, POW_PRECISION, ROUNDING_MODE, more) : y2;
|
|
3642
|
-
};
|
|
3643
|
-
P2.integerValue = function(rm) {
|
|
3644
|
-
var n = new BigNumber2(this);
|
|
3645
|
-
if (rm == null) rm = ROUNDING_MODE;
|
|
3646
|
-
else intCheck(rm, 0, 8);
|
|
3647
|
-
return round(n, n.e + 1, rm);
|
|
3648
|
-
};
|
|
3649
|
-
P2.isEqualTo = P2.eq = function(y2, b) {
|
|
3650
|
-
return compare(this, new BigNumber2(y2, b)) === 0;
|
|
3651
|
-
};
|
|
3652
|
-
P2.isFinite = function() {
|
|
3653
|
-
return !!this.c;
|
|
3654
|
-
};
|
|
3655
|
-
P2.isGreaterThan = P2.gt = function(y2, b) {
|
|
3656
|
-
return compare(this, new BigNumber2(y2, b)) > 0;
|
|
3657
|
-
};
|
|
3658
|
-
P2.isGreaterThanOrEqualTo = P2.gte = function(y2, b) {
|
|
3659
|
-
return (b = compare(this, new BigNumber2(y2, b))) === 1 || b === 0;
|
|
3660
|
-
};
|
|
3661
|
-
P2.isInteger = function() {
|
|
3662
|
-
return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2;
|
|
3663
|
-
};
|
|
3664
|
-
P2.isLessThan = P2.lt = function(y2, b) {
|
|
3665
|
-
return compare(this, new BigNumber2(y2, b)) < 0;
|
|
3666
|
-
};
|
|
3667
|
-
P2.isLessThanOrEqualTo = P2.lte = function(y2, b) {
|
|
3668
|
-
return (b = compare(this, new BigNumber2(y2, b))) === -1 || b === 0;
|
|
3669
|
-
};
|
|
3670
|
-
P2.isNaN = function() {
|
|
3671
|
-
return !this.s;
|
|
3672
|
-
};
|
|
3673
|
-
P2.isNegative = function() {
|
|
3674
|
-
return this.s < 0;
|
|
3675
|
-
};
|
|
3676
|
-
P2.isPositive = function() {
|
|
3677
|
-
return this.s > 0;
|
|
3678
|
-
};
|
|
3679
|
-
P2.isZero = function() {
|
|
3680
|
-
return !!this.c && this.c[0] == 0;
|
|
3681
|
-
};
|
|
3682
|
-
P2.minus = function(y2, b) {
|
|
3683
|
-
var i, j2, t, xLTy, x2 = this, a = x2.s;
|
|
3684
|
-
y2 = new BigNumber2(y2, b);
|
|
3685
|
-
b = y2.s;
|
|
3686
|
-
if (!a || !b) return new BigNumber2(NaN);
|
|
3687
|
-
if (a != b) {
|
|
3688
|
-
y2.s = -b;
|
|
3689
|
-
return x2.plus(y2);
|
|
3690
|
-
}
|
|
3691
|
-
var xe2 = x2.e / LOG_BASE, ye2 = y2.e / LOG_BASE, xc = x2.c, yc = y2.c;
|
|
3692
|
-
if (!xe2 || !ye2) {
|
|
3693
|
-
if (!xc || !yc) return xc ? (y2.s = -b, y2) : new BigNumber2(yc ? x2 : NaN);
|
|
3694
|
-
if (!xc[0] || !yc[0]) {
|
|
3695
|
-
return yc[0] ? (y2.s = -b, y2) : new BigNumber2(xc[0] ? x2 : (
|
|
3696
|
-
// IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity
|
|
3697
|
-
ROUNDING_MODE == 3 ? -0 : 0
|
|
3698
|
-
));
|
|
3699
|
-
}
|
|
3700
|
-
}
|
|
3701
|
-
xe2 = bitFloor(xe2);
|
|
3702
|
-
ye2 = bitFloor(ye2);
|
|
3703
|
-
xc = xc.slice();
|
|
3704
|
-
if (a = xe2 - ye2) {
|
|
3705
|
-
if (xLTy = a < 0) {
|
|
3706
|
-
a = -a;
|
|
3707
|
-
t = xc;
|
|
3708
|
-
} else {
|
|
3709
|
-
ye2 = xe2;
|
|
3710
|
-
t = yc;
|
|
3711
|
-
}
|
|
3712
|
-
t.reverse();
|
|
3713
|
-
for (b = a; b--; t.push(0)) ;
|
|
3714
|
-
t.reverse();
|
|
3715
|
-
} else {
|
|
3716
|
-
j2 = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b;
|
|
3717
|
-
for (a = b = 0; b < j2; b++) {
|
|
3718
|
-
if (xc[b] != yc[b]) {
|
|
3719
|
-
xLTy = xc[b] < yc[b];
|
|
3720
|
-
break;
|
|
3721
|
-
}
|
|
3722
|
-
}
|
|
3723
|
-
}
|
|
3724
|
-
if (xLTy) {
|
|
3725
|
-
t = xc;
|
|
3726
|
-
xc = yc;
|
|
3727
|
-
yc = t;
|
|
3728
|
-
y2.s = -y2.s;
|
|
3729
|
-
}
|
|
3730
|
-
b = (j2 = yc.length) - (i = xc.length);
|
|
3731
|
-
if (b > 0) for (; b--; xc[i++] = 0) ;
|
|
3732
|
-
b = BASE - 1;
|
|
3733
|
-
for (; j2 > a; ) {
|
|
3734
|
-
if (xc[--j2] < yc[j2]) {
|
|
3735
|
-
for (i = j2; i && !xc[--i]; xc[i] = b) ;
|
|
3736
|
-
--xc[i];
|
|
3737
|
-
xc[j2] += BASE;
|
|
3738
|
-
}
|
|
3739
|
-
xc[j2] -= yc[j2];
|
|
3740
|
-
}
|
|
3741
|
-
for (; xc[0] == 0; xc.splice(0, 1), --ye2) ;
|
|
3742
|
-
if (!xc[0]) {
|
|
3743
|
-
y2.s = ROUNDING_MODE == 3 ? -1 : 1;
|
|
3744
|
-
y2.c = [y2.e = 0];
|
|
3745
|
-
return y2;
|
|
3746
|
-
}
|
|
3747
|
-
return normalise(y2, xc, ye2);
|
|
3748
|
-
};
|
|
3749
|
-
P2.modulo = P2.mod = function(y2, b) {
|
|
3750
|
-
var q2, s, x2 = this;
|
|
3751
|
-
y2 = new BigNumber2(y2, b);
|
|
3752
|
-
if (!x2.c || !y2.s || y2.c && !y2.c[0]) {
|
|
3753
|
-
return new BigNumber2(NaN);
|
|
3754
|
-
} else if (!y2.c || x2.c && !x2.c[0]) {
|
|
3755
|
-
return new BigNumber2(x2);
|
|
3756
|
-
}
|
|
3757
|
-
if (MODULO_MODE == 9) {
|
|
3758
|
-
s = y2.s;
|
|
3759
|
-
y2.s = 1;
|
|
3760
|
-
q2 = div(x2, y2, 0, 3);
|
|
3761
|
-
y2.s = s;
|
|
3762
|
-
q2.s *= s;
|
|
3763
|
-
} else {
|
|
3764
|
-
q2 = div(x2, y2, 0, MODULO_MODE);
|
|
3765
|
-
}
|
|
3766
|
-
y2 = x2.minus(q2.times(y2));
|
|
3767
|
-
if (!y2.c[0] && MODULO_MODE == 1) y2.s = x2.s;
|
|
3768
|
-
return y2;
|
|
3769
|
-
};
|
|
3770
|
-
P2.multipliedBy = P2.times = function(y2, b) {
|
|
3771
|
-
var c, e, i, j2, k2, m2, xcL, xlo, xhi, ycL, ylo, yhi, zc, base2, sqrtBase, x2 = this, xc = x2.c, yc = (y2 = new BigNumber2(y2, b)).c;
|
|
3772
|
-
if (!xc || !yc || !xc[0] || !yc[0]) {
|
|
3773
|
-
if (!x2.s || !y2.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) {
|
|
3774
|
-
y2.c = y2.e = y2.s = null;
|
|
3775
|
-
} else {
|
|
3776
|
-
y2.s *= x2.s;
|
|
3777
|
-
if (!xc || !yc) {
|
|
3778
|
-
y2.c = y2.e = null;
|
|
3779
|
-
} else {
|
|
3780
|
-
y2.c = [0];
|
|
3781
|
-
y2.e = 0;
|
|
3782
|
-
}
|
|
3783
|
-
}
|
|
3784
|
-
return y2;
|
|
3785
|
-
}
|
|
3786
|
-
e = bitFloor(x2.e / LOG_BASE) + bitFloor(y2.e / LOG_BASE);
|
|
3787
|
-
y2.s *= x2.s;
|
|
3788
|
-
xcL = xc.length;
|
|
3789
|
-
ycL = yc.length;
|
|
3790
|
-
if (xcL < ycL) {
|
|
3791
|
-
zc = xc;
|
|
3792
|
-
xc = yc;
|
|
3793
|
-
yc = zc;
|
|
3794
|
-
i = xcL;
|
|
3795
|
-
xcL = ycL;
|
|
3796
|
-
ycL = i;
|
|
3797
|
-
}
|
|
3798
|
-
for (i = xcL + ycL, zc = []; i--; zc.push(0)) ;
|
|
3799
|
-
base2 = BASE;
|
|
3800
|
-
sqrtBase = SQRT_BASE;
|
|
3801
|
-
for (i = ycL; --i >= 0; ) {
|
|
3802
|
-
c = 0;
|
|
3803
|
-
ylo = yc[i] % sqrtBase;
|
|
3804
|
-
yhi = yc[i] / sqrtBase | 0;
|
|
3805
|
-
for (k2 = xcL, j2 = i + k2; j2 > i; ) {
|
|
3806
|
-
xlo = xc[--k2] % sqrtBase;
|
|
3807
|
-
xhi = xc[k2] / sqrtBase | 0;
|
|
3808
|
-
m2 = yhi * xlo + xhi * ylo;
|
|
3809
|
-
xlo = ylo * xlo + m2 % sqrtBase * sqrtBase + zc[j2] + c;
|
|
3810
|
-
c = (xlo / base2 | 0) + (m2 / sqrtBase | 0) + yhi * xhi;
|
|
3811
|
-
zc[j2--] = xlo % base2;
|
|
3812
|
-
}
|
|
3813
|
-
zc[j2] = c;
|
|
3814
|
-
}
|
|
3815
|
-
if (c) {
|
|
3816
|
-
++e;
|
|
3817
|
-
} else {
|
|
3818
|
-
zc.splice(0, 1);
|
|
3819
|
-
}
|
|
3820
|
-
return normalise(y2, zc, e);
|
|
3821
|
-
};
|
|
3822
|
-
P2.negated = function() {
|
|
3823
|
-
var x2 = new BigNumber2(this);
|
|
3824
|
-
x2.s = -x2.s || null;
|
|
3825
|
-
return x2;
|
|
3826
|
-
};
|
|
3827
|
-
P2.plus = function(y2, b) {
|
|
3828
|
-
var t, x2 = this, a = x2.s;
|
|
3829
|
-
y2 = new BigNumber2(y2, b);
|
|
3830
|
-
b = y2.s;
|
|
3831
|
-
if (!a || !b) return new BigNumber2(NaN);
|
|
3832
|
-
if (a != b) {
|
|
3833
|
-
y2.s = -b;
|
|
3834
|
-
return x2.minus(y2);
|
|
3835
|
-
}
|
|
3836
|
-
var xe2 = x2.e / LOG_BASE, ye2 = y2.e / LOG_BASE, xc = x2.c, yc = y2.c;
|
|
3837
|
-
if (!xe2 || !ye2) {
|
|
3838
|
-
if (!xc || !yc) return new BigNumber2(a / 0);
|
|
3839
|
-
if (!xc[0] || !yc[0]) return yc[0] ? y2 : new BigNumber2(xc[0] ? x2 : a * 0);
|
|
3840
|
-
}
|
|
3841
|
-
xe2 = bitFloor(xe2);
|
|
3842
|
-
ye2 = bitFloor(ye2);
|
|
3843
|
-
xc = xc.slice();
|
|
3844
|
-
if (a = xe2 - ye2) {
|
|
3845
|
-
if (a > 0) {
|
|
3846
|
-
ye2 = xe2;
|
|
3847
|
-
t = yc;
|
|
3848
|
-
} else {
|
|
3849
|
-
a = -a;
|
|
3850
|
-
t = xc;
|
|
3851
|
-
}
|
|
3852
|
-
t.reverse();
|
|
3853
|
-
for (; a--; t.push(0)) ;
|
|
3854
|
-
t.reverse();
|
|
3855
|
-
}
|
|
3856
|
-
a = xc.length;
|
|
3857
|
-
b = yc.length;
|
|
3858
|
-
if (a - b < 0) {
|
|
3859
|
-
t = yc;
|
|
3860
|
-
yc = xc;
|
|
3861
|
-
xc = t;
|
|
3862
|
-
b = a;
|
|
3863
|
-
}
|
|
3864
|
-
for (a = 0; b; ) {
|
|
3865
|
-
a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0;
|
|
3866
|
-
xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE;
|
|
3867
|
-
}
|
|
3868
|
-
if (a) {
|
|
3869
|
-
xc = [a].concat(xc);
|
|
3870
|
-
++ye2;
|
|
3871
|
-
}
|
|
3872
|
-
return normalise(y2, xc, ye2);
|
|
3873
|
-
};
|
|
3874
|
-
P2.precision = P2.sd = function(sd, rm) {
|
|
3875
|
-
var c, n, v2, x2 = this;
|
|
3876
|
-
if (sd != null && sd !== !!sd) {
|
|
3877
|
-
intCheck(sd, 1, MAX);
|
|
3878
|
-
if (rm == null) rm = ROUNDING_MODE;
|
|
3879
|
-
else intCheck(rm, 0, 8);
|
|
3880
|
-
return round(new BigNumber2(x2), sd, rm);
|
|
3881
|
-
}
|
|
3882
|
-
if (!(c = x2.c)) return null;
|
|
3883
|
-
v2 = c.length - 1;
|
|
3884
|
-
n = v2 * LOG_BASE + 1;
|
|
3885
|
-
if (v2 = c[v2]) {
|
|
3886
|
-
for (; v2 % 10 == 0; v2 /= 10, n--) ;
|
|
3887
|
-
for (v2 = c[0]; v2 >= 10; v2 /= 10, n++) ;
|
|
3888
|
-
}
|
|
3889
|
-
if (sd && x2.e + 1 > n) n = x2.e + 1;
|
|
3890
|
-
return n;
|
|
3891
|
-
};
|
|
3892
|
-
P2.shiftedBy = function(k2) {
|
|
3893
|
-
intCheck(k2, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER);
|
|
3894
|
-
return this.times("1e" + k2);
|
|
3895
|
-
};
|
|
3896
|
-
P2.squareRoot = P2.sqrt = function() {
|
|
3897
|
-
var m2, n, r, rep, t, x2 = this, c = x2.c, s = x2.s, e = x2.e, dp = DECIMAL_PLACES + 4, half = new BigNumber2("0.5");
|
|
3898
|
-
if (s !== 1 || !c || !c[0]) {
|
|
3899
|
-
return new BigNumber2(!s || s < 0 && (!c || c[0]) ? NaN : c ? x2 : 1 / 0);
|
|
3900
|
-
}
|
|
3901
|
-
s = Math.sqrt(+valueOf(x2));
|
|
3902
|
-
if (s == 0 || s == 1 / 0) {
|
|
3903
|
-
n = coeffToString(c);
|
|
3904
|
-
if ((n.length + e) % 2 == 0) n += "0";
|
|
3905
|
-
s = Math.sqrt(+n);
|
|
3906
|
-
e = bitFloor((e + 1) / 2) - (e < 0 || e % 2);
|
|
3907
|
-
if (s == 1 / 0) {
|
|
3908
|
-
n = "5e" + e;
|
|
3909
|
-
} else {
|
|
3910
|
-
n = s.toExponential();
|
|
3911
|
-
n = n.slice(0, n.indexOf("e") + 1) + e;
|
|
3912
|
-
}
|
|
3913
|
-
r = new BigNumber2(n);
|
|
3914
|
-
} else {
|
|
3915
|
-
r = new BigNumber2(s + "");
|
|
3916
|
-
}
|
|
3917
|
-
if (r.c[0]) {
|
|
3918
|
-
e = r.e;
|
|
3919
|
-
s = e + dp;
|
|
3920
|
-
if (s < 3) s = 0;
|
|
3921
|
-
for (; ; ) {
|
|
3922
|
-
t = r;
|
|
3923
|
-
r = half.times(t.plus(div(x2, t, dp, 1)));
|
|
3924
|
-
if (coeffToString(t.c).slice(0, s) === (n = coeffToString(r.c)).slice(0, s)) {
|
|
3925
|
-
if (r.e < e) --s;
|
|
3926
|
-
n = n.slice(s - 3, s + 1);
|
|
3927
|
-
if (n == "9999" || !rep && n == "4999") {
|
|
3928
|
-
if (!rep) {
|
|
3929
|
-
round(t, t.e + DECIMAL_PLACES + 2, 0);
|
|
3930
|
-
if (t.times(t).eq(x2)) {
|
|
3931
|
-
r = t;
|
|
3932
|
-
break;
|
|
3933
|
-
}
|
|
3934
|
-
}
|
|
3935
|
-
dp += 4;
|
|
3936
|
-
s += 4;
|
|
3937
|
-
rep = 1;
|
|
3938
|
-
} else {
|
|
3939
|
-
if (!+n || !+n.slice(1) && n.charAt(0) == "5") {
|
|
3940
|
-
round(r, r.e + DECIMAL_PLACES + 2, 1);
|
|
3941
|
-
m2 = !r.times(r).eq(x2);
|
|
3942
|
-
}
|
|
3943
|
-
break;
|
|
3944
|
-
}
|
|
3945
|
-
}
|
|
3946
|
-
}
|
|
3947
|
-
}
|
|
3948
|
-
return round(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m2);
|
|
3949
|
-
};
|
|
3950
|
-
P2.toExponential = function(dp, rm) {
|
|
3951
|
-
if (dp != null) {
|
|
3952
|
-
intCheck(dp, 0, MAX);
|
|
3953
|
-
dp++;
|
|
3954
|
-
}
|
|
3955
|
-
return format(this, dp, rm, 1);
|
|
3956
|
-
};
|
|
3957
|
-
P2.toFixed = function(dp, rm) {
|
|
3958
|
-
if (dp != null) {
|
|
3959
|
-
intCheck(dp, 0, MAX);
|
|
3960
|
-
dp = dp + this.e + 1;
|
|
3961
|
-
}
|
|
3962
|
-
return format(this, dp, rm);
|
|
3963
|
-
};
|
|
3964
|
-
P2.toFormat = function(dp, rm, format2) {
|
|
3965
|
-
var str, x2 = this;
|
|
3966
|
-
if (format2 == null) {
|
|
3967
|
-
if (dp != null && rm && typeof rm == "object") {
|
|
3968
|
-
format2 = rm;
|
|
3969
|
-
rm = null;
|
|
3970
|
-
} else if (dp && typeof dp == "object") {
|
|
3971
|
-
format2 = dp;
|
|
3972
|
-
dp = rm = null;
|
|
3973
|
-
} else {
|
|
3974
|
-
format2 = FORMAT;
|
|
3975
|
-
}
|
|
3976
|
-
} else if (typeof format2 != "object") {
|
|
3977
|
-
throw Error(bignumberError + "Argument not an object: " + format2);
|
|
3978
|
-
}
|
|
3979
|
-
str = x2.toFixed(dp, rm);
|
|
3980
|
-
if (x2.c) {
|
|
3981
|
-
var i, arr = str.split("."), g1 = +format2.groupSize, g2 = +format2.secondaryGroupSize, groupSeparator = format2.groupSeparator || "", intPart = arr[0], fractionPart = arr[1], isNeg = x2.s < 0, intDigits = isNeg ? intPart.slice(1) : intPart, len = intDigits.length;
|
|
3982
|
-
if (g2) {
|
|
3983
|
-
i = g1;
|
|
3984
|
-
g1 = g2;
|
|
3985
|
-
g2 = i;
|
|
3986
|
-
len -= i;
|
|
3987
|
-
}
|
|
3988
|
-
if (g1 > 0 && len > 0) {
|
|
3989
|
-
i = len % g1 || g1;
|
|
3990
|
-
intPart = intDigits.substr(0, i);
|
|
3991
|
-
for (; i < len; i += g1) intPart += groupSeparator + intDigits.substr(i, g1);
|
|
3992
|
-
if (g2 > 0) intPart += groupSeparator + intDigits.slice(i);
|
|
3993
|
-
if (isNeg) intPart = "-" + intPart;
|
|
3994
|
-
}
|
|
3995
|
-
str = fractionPart ? intPart + (format2.decimalSeparator || "") + ((g2 = +format2.fractionGroupSize) ? fractionPart.replace(
|
|
3996
|
-
new RegExp("\\d{" + g2 + "}\\B", "g"),
|
|
3997
|
-
"$&" + (format2.fractionGroupSeparator || "")
|
|
3998
|
-
) : fractionPart) : intPart;
|
|
3999
|
-
}
|
|
4000
|
-
return (format2.prefix || "") + str + (format2.suffix || "");
|
|
4001
|
-
};
|
|
4002
|
-
P2.toFraction = function(md) {
|
|
4003
|
-
var d, d0, d1, d2, e, exp, n, n0, n1, q2, r, s, x2 = this, xc = x2.c;
|
|
4004
|
-
if (md != null) {
|
|
4005
|
-
n = new BigNumber2(md);
|
|
4006
|
-
if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) {
|
|
4007
|
-
throw Error(bignumberError + "Argument " + (n.isInteger() ? "out of range: " : "not an integer: ") + valueOf(n));
|
|
4008
|
-
}
|
|
4009
|
-
}
|
|
4010
|
-
if (!xc) return new BigNumber2(x2);
|
|
4011
|
-
d = new BigNumber2(ONE);
|
|
4012
|
-
n1 = d0 = new BigNumber2(ONE);
|
|
4013
|
-
d1 = n0 = new BigNumber2(ONE);
|
|
4014
|
-
s = coeffToString(xc);
|
|
4015
|
-
e = d.e = s.length - x2.e - 1;
|
|
4016
|
-
d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp];
|
|
4017
|
-
md = !md || n.comparedTo(d) > 0 ? e > 0 ? d : n1 : n;
|
|
4018
|
-
exp = MAX_EXP;
|
|
4019
|
-
MAX_EXP = 1 / 0;
|
|
4020
|
-
n = new BigNumber2(s);
|
|
4021
|
-
n0.c[0] = 0;
|
|
4022
|
-
for (; ; ) {
|
|
4023
|
-
q2 = div(n, d, 0, 1);
|
|
4024
|
-
d2 = d0.plus(q2.times(d1));
|
|
4025
|
-
if (d2.comparedTo(md) == 1) break;
|
|
4026
|
-
d0 = d1;
|
|
4027
|
-
d1 = d2;
|
|
4028
|
-
n1 = n0.plus(q2.times(d2 = n1));
|
|
4029
|
-
n0 = d2;
|
|
4030
|
-
d = n.minus(q2.times(d2 = d));
|
|
4031
|
-
n = d2;
|
|
4032
|
-
}
|
|
4033
|
-
d2 = div(md.minus(d0), d1, 0, 1);
|
|
4034
|
-
n0 = n0.plus(d2.times(n1));
|
|
4035
|
-
d0 = d0.plus(d2.times(d1));
|
|
4036
|
-
n0.s = n1.s = x2.s;
|
|
4037
|
-
e = e * 2;
|
|
4038
|
-
r = div(n1, d1, e, ROUNDING_MODE).minus(x2).abs().comparedTo(
|
|
4039
|
-
div(n0, d0, e, ROUNDING_MODE).minus(x2).abs()
|
|
4040
|
-
) < 1 ? [n1, d1] : [n0, d0];
|
|
4041
|
-
MAX_EXP = exp;
|
|
4042
|
-
return r;
|
|
4043
|
-
};
|
|
4044
|
-
P2.toNumber = function() {
|
|
4045
|
-
return +valueOf(this);
|
|
4046
|
-
};
|
|
4047
|
-
P2.toPrecision = function(sd, rm) {
|
|
4048
|
-
if (sd != null) intCheck(sd, 1, MAX);
|
|
4049
|
-
return format(this, sd, rm, 2);
|
|
4050
|
-
};
|
|
4051
|
-
P2.toString = function(b) {
|
|
4052
|
-
var str, n = this, s = n.s, e = n.e;
|
|
4053
|
-
if (e === null) {
|
|
4054
|
-
if (s) {
|
|
4055
|
-
str = "Infinity";
|
|
4056
|
-
if (s < 0) str = "-" + str;
|
|
4057
|
-
} else {
|
|
4058
|
-
str = "NaN";
|
|
4059
|
-
}
|
|
4060
|
-
} else {
|
|
4061
|
-
if (b == null) {
|
|
4062
|
-
str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(coeffToString(n.c), e) : toFixedPoint(coeffToString(n.c), e, "0");
|
|
4063
|
-
} else if (b === 10 && alphabetHasNormalDecimalDigits) {
|
|
4064
|
-
n = round(new BigNumber2(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE);
|
|
4065
|
-
str = toFixedPoint(coeffToString(n.c), n.e, "0");
|
|
4066
|
-
} else {
|
|
4067
|
-
intCheck(b, 2, ALPHABET.length, "Base");
|
|
4068
|
-
str = convertBase(toFixedPoint(coeffToString(n.c), e, "0"), 10, b, s, true);
|
|
4069
|
-
}
|
|
4070
|
-
if (s < 0 && n.c[0]) str = "-" + str;
|
|
4071
|
-
}
|
|
4072
|
-
return str;
|
|
4073
|
-
};
|
|
4074
|
-
P2.valueOf = P2.toJSON = function() {
|
|
4075
|
-
return valueOf(this);
|
|
4076
|
-
};
|
|
4077
|
-
P2._isBigNumber = true;
|
|
4078
|
-
P2[Symbol.toStringTag] = "BigNumber";
|
|
4079
|
-
P2[Symbol.for("nodejs.util.inspect.custom")] = P2.valueOf;
|
|
4080
|
-
if (configObject != null) BigNumber2.set(configObject);
|
|
4081
|
-
return BigNumber2;
|
|
4082
|
-
}
|
|
4083
|
-
function bitFloor(n) {
|
|
4084
|
-
var i = n | 0;
|
|
4085
|
-
return n > 0 || n === i ? i : i - 1;
|
|
4086
|
-
}
|
|
4087
|
-
function coeffToString(a) {
|
|
4088
|
-
var s, z2, i = 1, j2 = a.length, r = a[0] + "";
|
|
4089
|
-
for (; i < j2; ) {
|
|
4090
|
-
s = a[i++] + "";
|
|
4091
|
-
z2 = LOG_BASE - s.length;
|
|
4092
|
-
for (; z2--; s = "0" + s) ;
|
|
4093
|
-
r += s;
|
|
4094
|
-
}
|
|
4095
|
-
for (j2 = r.length; r.charCodeAt(--j2) === 48; ) ;
|
|
4096
|
-
return r.slice(0, j2 + 1 || 1);
|
|
4097
|
-
}
|
|
4098
|
-
function compare(x2, y2) {
|
|
4099
|
-
var a, b, xc = x2.c, yc = y2.c, i = x2.s, j2 = y2.s, k2 = x2.e, l = y2.e;
|
|
4100
|
-
if (!i || !j2) return null;
|
|
4101
|
-
a = xc && !xc[0];
|
|
4102
|
-
b = yc && !yc[0];
|
|
4103
|
-
if (a || b) return a ? b ? 0 : -j2 : i;
|
|
4104
|
-
if (i != j2) return i;
|
|
4105
|
-
a = i < 0;
|
|
4106
|
-
b = k2 == l;
|
|
4107
|
-
if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1;
|
|
4108
|
-
if (!b) return k2 > l ^ a ? 1 : -1;
|
|
4109
|
-
j2 = (k2 = xc.length) < (l = yc.length) ? k2 : l;
|
|
4110
|
-
for (i = 0; i < j2; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1;
|
|
4111
|
-
return k2 == l ? 0 : k2 > l ^ a ? 1 : -1;
|
|
4112
|
-
}
|
|
4113
|
-
function intCheck(n, min, max, name) {
|
|
4114
|
-
if (n < min || n > max || n !== mathfloor(n)) {
|
|
4115
|
-
throw Error(bignumberError + (name || "Argument") + (typeof n == "number" ? n < min || n > max ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(n));
|
|
4116
|
-
}
|
|
4117
|
-
}
|
|
4118
|
-
function isOdd(n) {
|
|
4119
|
-
var k2 = n.c.length - 1;
|
|
4120
|
-
return bitFloor(n.e / LOG_BASE) == k2 && n.c[k2] % 2 != 0;
|
|
4121
|
-
}
|
|
4122
|
-
function toExponential(str, e) {
|
|
4123
|
-
return (str.length > 1 ? str.charAt(0) + "." + str.slice(1) : str) + (e < 0 ? "e" : "e+") + e;
|
|
4124
|
-
}
|
|
4125
|
-
function toFixedPoint(str, e, z2) {
|
|
4126
|
-
var len, zs;
|
|
4127
|
-
if (e < 0) {
|
|
4128
|
-
for (zs = z2 + "."; ++e; zs += z2) ;
|
|
4129
|
-
str = zs + str;
|
|
4130
|
-
} else {
|
|
4131
|
-
len = str.length;
|
|
4132
|
-
if (++e > len) {
|
|
4133
|
-
for (zs = z2, e -= len; --e; zs += z2) ;
|
|
4134
|
-
str += zs;
|
|
4135
|
-
} else if (e < len) {
|
|
4136
|
-
str = str.slice(0, e) + "." + str.slice(e);
|
|
4137
|
-
}
|
|
4138
|
-
}
|
|
4139
|
-
return str;
|
|
4140
|
-
}
|
|
4141
|
-
var BigNumber = clone();
|
|
4142
2812
|
const convertHumanReadableAmountToCryptoAmount = (humanReadableAmount, decimals = DEFAULT_DECIMAL_PLACES) => {
|
|
4143
2813
|
const cryptoAmount = new BigNumber(humanReadableAmount).shiftedBy(decimals);
|
|
4144
2814
|
return cryptoAmount.toFixed(0);
|
|
@@ -5075,7 +3745,6 @@ const keplrMainnetChainIdsInitialConnect = [
|
|
|
5075
3745
|
"crypto-org-chain-mainnet-1",
|
|
5076
3746
|
"dydx-mainnet-1",
|
|
5077
3747
|
"dymension_1100-1",
|
|
5078
|
-
"evmos_9001-2",
|
|
5079
3748
|
"injective-1",
|
|
5080
3749
|
"juno-1",
|
|
5081
3750
|
"kava_2222-10",
|
|
@@ -5153,58 +3822,58 @@ const walletInfo = {
|
|
|
5153
3822
|
},
|
|
5154
3823
|
[WalletType.LEAP]: {
|
|
5155
3824
|
name: "Leap",
|
|
5156
|
-
imgSrc: "https://raw.githubusercontent.com/
|
|
3825
|
+
imgSrc: "https://raw.githubusercontent.com/skip-mev/skip-go/refs/heads/main/assets/wallet-icon-leap.png"
|
|
5157
3826
|
},
|
|
5158
3827
|
[WalletType.COSMOSTATION]: {
|
|
5159
3828
|
name: "Cosmostation",
|
|
5160
|
-
imgSrc: "https://raw.githubusercontent.com/
|
|
3829
|
+
imgSrc: "https://raw.githubusercontent.com/skip-mev/skip-go/refs/heads/main/assets/wallet-icon-cosmostation.png"
|
|
5161
3830
|
},
|
|
5162
3831
|
[WalletType.VECTIS]: {
|
|
5163
3832
|
name: "Vectis",
|
|
5164
|
-
imgSrc: "https://raw.githubusercontent.com/
|
|
3833
|
+
imgSrc: "https://raw.githubusercontent.com/skip-mev/skip-go/refs/heads/main/assets/wallet-icon-vectis.svg"
|
|
5165
3834
|
},
|
|
5166
3835
|
[WalletType.STATION]: {
|
|
5167
3836
|
name: "Station",
|
|
5168
|
-
imgSrc: "https://raw.githubusercontent.com/
|
|
3837
|
+
imgSrc: "https://raw.githubusercontent.com/skip-mev/skip-go/refs/heads/main/assets/wallet-icon-station.svg"
|
|
5169
3838
|
},
|
|
5170
3839
|
[WalletType.XDEFI]: {
|
|
5171
3840
|
name: "XDefi",
|
|
5172
|
-
imgSrc: "https://raw.githubusercontent.com/
|
|
3841
|
+
imgSrc: "https://raw.githubusercontent.com/skip-mev/skip-go/refs/heads/main/assets/wallet-icon-xdefi.jpeg"
|
|
5173
3842
|
},
|
|
5174
3843
|
[WalletType.METAMASK_SNAP_LEAP]: {
|
|
5175
3844
|
name: "Metamask Snap Leap",
|
|
5176
|
-
imgSrc: "https://raw.githubusercontent.com/
|
|
3845
|
+
imgSrc: "https://raw.githubusercontent.com/skip-mev/skip-go/refs/heads/main/assets/wallet-icon-metamask.png"
|
|
5177
3846
|
},
|
|
5178
3847
|
[WalletType.METAMASK_SNAP_COSMOS]: {
|
|
5179
3848
|
name: "Metamask Snap Cosmos",
|
|
5180
|
-
imgSrc: "https://raw.githubusercontent.com/
|
|
3849
|
+
imgSrc: "https://raw.githubusercontent.com/skip-mev/skip-go/refs/heads/main/assets/wallet-icon-metamask.png"
|
|
5181
3850
|
},
|
|
5182
3851
|
[WalletType.WALLETCONNECT]: {
|
|
5183
3852
|
name: "WalletConnect",
|
|
5184
|
-
imgSrc: "https://raw.githubusercontent.com/
|
|
3853
|
+
imgSrc: "https://raw.githubusercontent.com/skip-mev/skip-go/refs/heads/main/assets/wallet-icon-walletconnect.png"
|
|
5185
3854
|
},
|
|
5186
3855
|
[WalletType.WC_KEPLR_MOBILE]: {
|
|
5187
3856
|
name: "Keplr Mobile",
|
|
5188
|
-
imgSrc: "https://raw.githubusercontent.com/
|
|
3857
|
+
imgSrc: "https://raw.githubusercontent.com/skip-mev/skip-go/refs/heads/main/assets/wallet-icon-keplr.png",
|
|
5189
3858
|
mobile: true
|
|
5190
3859
|
},
|
|
5191
3860
|
[WalletType.WC_LEAP_MOBILE]: {
|
|
5192
3861
|
name: "Leap Mobile",
|
|
5193
|
-
imgSrc: "https://raw.githubusercontent.com/
|
|
3862
|
+
imgSrc: "https://raw.githubusercontent.com/skip-mev/skip-go/refs/heads/main/assets/wallet-icon-leap.png",
|
|
5194
3863
|
mobile: true
|
|
5195
3864
|
},
|
|
5196
3865
|
[WalletType.WC_COSMOSTATION_MOBILE]: {
|
|
5197
3866
|
name: "Cosmostation Mobile",
|
|
5198
|
-
imgSrc: "https://raw.githubusercontent.com/
|
|
3867
|
+
imgSrc: "https://raw.githubusercontent.com/skip-mev/skip-go/refs/heads/main/assets/wallet-icon-cosmostation.png",
|
|
5199
3868
|
mobile: true
|
|
5200
3869
|
},
|
|
5201
3870
|
[WalletType.COSMIFRAME]: {
|
|
5202
3871
|
name: "DAO DAO",
|
|
5203
|
-
imgSrc: "https://raw.githubusercontent.com/
|
|
3872
|
+
imgSrc: "https://raw.githubusercontent.com/skip-mev/skip-go/refs/heads/main/assets/wallet-icon-daodao.png"
|
|
5204
3873
|
},
|
|
5205
3874
|
[WalletType.COMPASS]: {
|
|
5206
3875
|
name: "Compass",
|
|
5207
|
-
imgSrc: "https://raw.githubusercontent.com/
|
|
3876
|
+
imgSrc: "https://raw.githubusercontent.com/skip-mev/skip-go/refs/heads/main/assets/wallet-icon-compass.png"
|
|
5208
3877
|
}
|
|
5209
3878
|
};
|
|
5210
3879
|
const getCosmosWalletInfo = (walletType) => {
|
|
@@ -6097,6 +4766,11 @@ const _mainnetChains = [
|
|
|
6097
4766
|
coinDenom: "move",
|
|
6098
4767
|
coinMinimalDenom: "unit-move",
|
|
6099
4768
|
coinDecimals: 8
|
|
4769
|
+
},
|
|
4770
|
+
{
|
|
4771
|
+
coinDenom: "zig",
|
|
4772
|
+
coinMinimalDenom: "unit-zig",
|
|
4773
|
+
coinDecimals: 18
|
|
6100
4774
|
}
|
|
6101
4775
|
],
|
|
6102
4776
|
rest: "https://lcd-axelar.imperator.co:443",
|
|
@@ -9192,8 +7866,8 @@ const _mainnetChains = [
|
|
|
9192
7866
|
coinDecimals: 18
|
|
9193
7867
|
}
|
|
9194
7868
|
],
|
|
9195
|
-
rest: "https://
|
|
9196
|
-
rpc: "https://
|
|
7869
|
+
rest: "https://api.epix.zone",
|
|
7870
|
+
rpc: "https://rpc.epix.zone",
|
|
9197
7871
|
bech32Config: {
|
|
9198
7872
|
bech32PrefixAccAddr: "epix",
|
|
9199
7873
|
bech32PrefixAccPub: "epixpub",
|
|
@@ -23721,6 +22395,11 @@ const _mainnetChains = [
|
|
|
23721
22395
|
coinDenom: "gft",
|
|
23722
22396
|
coinMinimalDenom: "cw20:terra17hnu4prwa3varxrws0sy9hffkmqv8tfmfpldg4e9fq58flrmuz2qlhymr5",
|
|
23723
22397
|
coinDecimals: 6
|
|
22398
|
+
},
|
|
22399
|
+
{
|
|
22400
|
+
coinDenom: "ltk",
|
|
22401
|
+
coinMinimalDenom: "cw20:terra1mm8tdp40r2slzwqxk8jsz66ayc4zp69muxeateq37x2xquttzsaqy7275a",
|
|
22402
|
+
coinDecimals: 6
|
|
23724
22403
|
}
|
|
23725
22404
|
],
|
|
23726
22405
|
rest: "https://terra-classic-lcd.publicnode.com",
|
|
@@ -24495,6 +23174,47 @@ const _mainnetChains = [
|
|
|
24495
23174
|
coinType: 5555
|
|
24496
23175
|
}
|
|
24497
23176
|
},
|
|
23177
|
+
{
|
|
23178
|
+
chainId: "union-1",
|
|
23179
|
+
currencies: [
|
|
23180
|
+
{
|
|
23181
|
+
coinDenom: "U",
|
|
23182
|
+
coinMinimalDenom: "au",
|
|
23183
|
+
coinDecimals: 18
|
|
23184
|
+
}
|
|
23185
|
+
],
|
|
23186
|
+
rest: "https://rest.union.build",
|
|
23187
|
+
rpc: "https://rpc.union.build",
|
|
23188
|
+
bech32Config: {
|
|
23189
|
+
bech32PrefixAccAddr: "union",
|
|
23190
|
+
bech32PrefixAccPub: "unionpub",
|
|
23191
|
+
bech32PrefixValAddr: "unionvaloper",
|
|
23192
|
+
bech32PrefixValPub: "unionvaloperpub",
|
|
23193
|
+
bech32PrefixConsAddr: "unionvalcons",
|
|
23194
|
+
bech32PrefixConsPub: "unionvalconspub"
|
|
23195
|
+
},
|
|
23196
|
+
chainName: "union",
|
|
23197
|
+
feeCurrencies: [
|
|
23198
|
+
{
|
|
23199
|
+
coinDenom: "U",
|
|
23200
|
+
coinMinimalDenom: "au",
|
|
23201
|
+
coinDecimals: 18,
|
|
23202
|
+
gasPriceStep: {
|
|
23203
|
+
low: 1e8,
|
|
23204
|
+
average: 1e8,
|
|
23205
|
+
high: 2e8
|
|
23206
|
+
}
|
|
23207
|
+
}
|
|
23208
|
+
],
|
|
23209
|
+
stakeCurrency: {
|
|
23210
|
+
coinDenom: "U",
|
|
23211
|
+
coinMinimalDenom: "au",
|
|
23212
|
+
coinDecimals: 18
|
|
23213
|
+
},
|
|
23214
|
+
bip44: {
|
|
23215
|
+
coinType: 118
|
|
23216
|
+
}
|
|
23217
|
+
},
|
|
24498
23218
|
{
|
|
24499
23219
|
chainId: "ununifi-beta-v1",
|
|
24500
23220
|
currencies: [
|
|
@@ -24618,6 +23338,47 @@ const _mainnetChains = [
|
|
|
24618
23338
|
coinType: 118
|
|
24619
23339
|
}
|
|
24620
23340
|
},
|
|
23341
|
+
{
|
|
23342
|
+
chainId: "warden_8765-1",
|
|
23343
|
+
currencies: [
|
|
23344
|
+
{
|
|
23345
|
+
coinDenom: "ward",
|
|
23346
|
+
coinMinimalDenom: "award",
|
|
23347
|
+
coinDecimals: 18
|
|
23348
|
+
}
|
|
23349
|
+
],
|
|
23350
|
+
rest: "https://api.wardenprotocol.org",
|
|
23351
|
+
rpc: "https://rpc.wardenprotocol.org",
|
|
23352
|
+
bech32Config: {
|
|
23353
|
+
bech32PrefixAccAddr: "warden",
|
|
23354
|
+
bech32PrefixAccPub: "wardenpub",
|
|
23355
|
+
bech32PrefixValAddr: "wardenvaloper",
|
|
23356
|
+
bech32PrefixValPub: "wardenvaloperpub",
|
|
23357
|
+
bech32PrefixConsAddr: "wardenvalcons",
|
|
23358
|
+
bech32PrefixConsPub: "wardenvalconspub"
|
|
23359
|
+
},
|
|
23360
|
+
chainName: "wardenprotocol",
|
|
23361
|
+
feeCurrencies: [
|
|
23362
|
+
{
|
|
23363
|
+
coinDenom: "ward",
|
|
23364
|
+
coinMinimalDenom: "award",
|
|
23365
|
+
coinDecimals: 18,
|
|
23366
|
+
gasPriceStep: {
|
|
23367
|
+
low: 196e9,
|
|
23368
|
+
average: 2254e8,
|
|
23369
|
+
high: 2548e8
|
|
23370
|
+
}
|
|
23371
|
+
}
|
|
23372
|
+
],
|
|
23373
|
+
stakeCurrency: {
|
|
23374
|
+
coinDenom: "ward",
|
|
23375
|
+
coinMinimalDenom: "award",
|
|
23376
|
+
coinDecimals: 18
|
|
23377
|
+
},
|
|
23378
|
+
bip44: {
|
|
23379
|
+
coinType: 118
|
|
23380
|
+
}
|
|
23381
|
+
},
|
|
24621
23382
|
{
|
|
24622
23383
|
chainId: "xarchain",
|
|
24623
23384
|
currencies: [
|
|
@@ -24906,6 +23667,26 @@ const _mainnetChains = [
|
|
|
24906
23667
|
coinDenom: "zig",
|
|
24907
23668
|
coinMinimalDenom: "uzig",
|
|
24908
23669
|
coinDecimals: 6
|
|
23670
|
+
},
|
|
23671
|
+
{
|
|
23672
|
+
coinDenom: "stzig",
|
|
23673
|
+
coinMinimalDenom: "coin.zig109f7g2rzl2aqee7z6gffn8kfe9cpqx0mjkk7ethmx8m2hq4xpe9snmaam2.stzig",
|
|
23674
|
+
coinDecimals: 6
|
|
23675
|
+
},
|
|
23676
|
+
{
|
|
23677
|
+
coinDenom: "usdc",
|
|
23678
|
+
coinMinimalDenom: "ibc/6490A7EAB61059BFC1CDDEB05917DD70BDF3A611654162A1A47DB930D40D8AF4",
|
|
23679
|
+
coinDecimals: 6
|
|
23680
|
+
},
|
|
23681
|
+
{
|
|
23682
|
+
coinDenom: "atom",
|
|
23683
|
+
coinMinimalDenom: "ibc/EF48E6B1A1A19F47ECAEA62F5670C37C0580E86A9E88498B7E393EB6F49F33C0",
|
|
23684
|
+
coinDecimals: 6
|
|
23685
|
+
},
|
|
23686
|
+
{
|
|
23687
|
+
coinDenom: "zig.axl",
|
|
23688
|
+
coinMinimalDenom: "ibc/9BEE293E6559ED860CC702685996F394D4991D6DFFD60A19ABC3723E6F34788A",
|
|
23689
|
+
coinDecimals: 18
|
|
24909
23690
|
}
|
|
24910
23691
|
],
|
|
24911
23692
|
rest: "https://public-zigchain-lcd.numia.xyz/",
|
|
@@ -30962,6 +29743,72 @@ const _testnetChains = [
|
|
|
30962
29743
|
coinType: 330
|
|
30963
29744
|
}
|
|
30964
29745
|
},
|
|
29746
|
+
{
|
|
29747
|
+
chainId: "rebel-2",
|
|
29748
|
+
currencies: [
|
|
29749
|
+
{
|
|
29750
|
+
coinDenom: "luna",
|
|
29751
|
+
coinMinimalDenom: "uluna",
|
|
29752
|
+
coinDecimals: 6
|
|
29753
|
+
},
|
|
29754
|
+
{
|
|
29755
|
+
coinDenom: "ust",
|
|
29756
|
+
coinMinimalDenom: "uusd",
|
|
29757
|
+
coinDecimals: 6
|
|
29758
|
+
},
|
|
29759
|
+
{
|
|
29760
|
+
coinDenom: "krt",
|
|
29761
|
+
coinMinimalDenom: "ukrw",
|
|
29762
|
+
coinDecimals: 6
|
|
29763
|
+
},
|
|
29764
|
+
{
|
|
29765
|
+
coinDenom: "juris",
|
|
29766
|
+
coinMinimalDenom: "cw20:terra1w7d0jqehn0ja3hkzsm0psk6z2hjz06lsq0nxnwkzkkq4fqwgq6tqa5te8e",
|
|
29767
|
+
coinDecimals: 6
|
|
29768
|
+
}
|
|
29769
|
+
],
|
|
29770
|
+
rest: "https://rebel-lcd.luncgoblins.com",
|
|
29771
|
+
rpc: "https://rebel-rpc.luncgoblins.com",
|
|
29772
|
+
bech32Config: {
|
|
29773
|
+
bech32PrefixAccAddr: "terra",
|
|
29774
|
+
bech32PrefixAccPub: "terrapub",
|
|
29775
|
+
bech32PrefixValAddr: "terravaloper",
|
|
29776
|
+
bech32PrefixValPub: "terravaloperpub",
|
|
29777
|
+
bech32PrefixConsAddr: "terravalcons",
|
|
29778
|
+
bech32PrefixConsPub: "terravalconspub"
|
|
29779
|
+
},
|
|
29780
|
+
chainName: "terratestnet",
|
|
29781
|
+
feeCurrencies: [
|
|
29782
|
+
{
|
|
29783
|
+
coinDenom: "luna",
|
|
29784
|
+
coinMinimalDenom: "uluna",
|
|
29785
|
+
coinDecimals: 6,
|
|
29786
|
+
gasPriceStep: {
|
|
29787
|
+
low: 28.325,
|
|
29788
|
+
average: 28.325,
|
|
29789
|
+
high: 50
|
|
29790
|
+
}
|
|
29791
|
+
},
|
|
29792
|
+
{
|
|
29793
|
+
coinDenom: "ust",
|
|
29794
|
+
coinMinimalDenom: "uusd",
|
|
29795
|
+
coinDecimals: 6,
|
|
29796
|
+
gasPriceStep: {
|
|
29797
|
+
low: 0.75,
|
|
29798
|
+
average: 0.75,
|
|
29799
|
+
high: 0.75
|
|
29800
|
+
}
|
|
29801
|
+
}
|
|
29802
|
+
],
|
|
29803
|
+
stakeCurrency: {
|
|
29804
|
+
coinDenom: "luna",
|
|
29805
|
+
coinMinimalDenom: "uluna",
|
|
29806
|
+
coinDecimals: 6
|
|
29807
|
+
},
|
|
29808
|
+
bip44: {
|
|
29809
|
+
coinType: 330
|
|
29810
|
+
}
|
|
29811
|
+
},
|
|
30965
29812
|
{
|
|
30966
29813
|
chainId: "titan-test-4",
|
|
30967
29814
|
currencies: [
|
|
@@ -31583,6 +30430,16 @@ const _testnetChains = [
|
|
|
31583
30430
|
coinDenom: "zig",
|
|
31584
30431
|
coinMinimalDenom: "uzig",
|
|
31585
30432
|
coinDecimals: 6
|
|
30433
|
+
},
|
|
30434
|
+
{
|
|
30435
|
+
coinDenom: "stzig",
|
|
30436
|
+
coinMinimalDenom: "coin.zig1q5cuxuekvjdsl3l2t87jv83gdwjryc4hmh8s90y7mwgpyfwkqutsy9tqak.stzig",
|
|
30437
|
+
coinDecimals: 6
|
|
30438
|
+
},
|
|
30439
|
+
{
|
|
30440
|
+
coinDenom: "usdc",
|
|
30441
|
+
coinMinimalDenom: "ibc/8E452E728A6598EEF051E63FFE49AF19004F5D2AA3F690413C2985660AAFD38F",
|
|
30442
|
+
coinDecimals: 6
|
|
31586
30443
|
}
|
|
31587
30444
|
],
|
|
31588
30445
|
rest: "https://testnet-api.zigchain.com",
|
|
@@ -32450,9 +31307,9 @@ const _explorers = [
|
|
|
32450
31307
|
},
|
|
32451
31308
|
{
|
|
32452
31309
|
kind: "Ruangnode Explorer",
|
|
32453
|
-
url: "https://explorer.ruangnode.com/atomone",
|
|
32454
|
-
txPage: "https://explorer.ruangnode.com/atomone/tx/${txHash}",
|
|
32455
|
-
accountPage: "https://explorer.ruangnode.com/atomone
|
|
31310
|
+
url: "https://explorer.ruangnode.com/dashboard/atomone",
|
|
31311
|
+
txPage: "https://explorer.ruangnode.com/dashboard/atomone/tx/${txHash}",
|
|
31312
|
+
accountPage: "https://explorer.ruangnode.com/addresses/atomone/${accountAddress}"
|
|
32456
31313
|
},
|
|
32457
31314
|
{
|
|
32458
31315
|
kind: "Kynraze Explorer",
|
|
@@ -34075,8 +32932,8 @@ const _explorers = [
|
|
|
34075
32932
|
},
|
|
34076
32933
|
{
|
|
34077
32934
|
kind: "Ruangnode Explorers",
|
|
34078
|
-
url: "https://explorer.ruangnode.com/dora
|
|
34079
|
-
txPage: "https://explorer.ruangnode.com/dora
|
|
32935
|
+
url: "https://explorer.ruangnode.com/dashboard/dora",
|
|
32936
|
+
txPage: "https://explorer.ruangnode.com/transactions/dora?hash=${txHash}"
|
|
34080
32937
|
},
|
|
34081
32938
|
{
|
|
34082
32939
|
kind: "Roomit",
|
|
@@ -34418,9 +33275,14 @@ const _explorers = [
|
|
|
34418
33275
|
chainId: "epix_1916-1",
|
|
34419
33276
|
explorers: [
|
|
34420
33277
|
{
|
|
34421
|
-
kind: "
|
|
34422
|
-
url: "https://explorer.
|
|
34423
|
-
txPage: "https://explorer.
|
|
33278
|
+
kind: "L1",
|
|
33279
|
+
url: "https://explorer.epix.zone/",
|
|
33280
|
+
txPage: "https://explorer.epix.zone/epix/tx/${txHash}"
|
|
33281
|
+
},
|
|
33282
|
+
{
|
|
33283
|
+
kind: "EVM",
|
|
33284
|
+
url: "https://scan.epix.zone/",
|
|
33285
|
+
txPage: "https://scan.epix.zone/tx/${txHash}"
|
|
34424
33286
|
}
|
|
34425
33287
|
]
|
|
34426
33288
|
},
|
|
@@ -36052,6 +34914,12 @@ const _explorers = [
|
|
|
36052
34914
|
url: "https://portal.lumera.io/lumera-mainnet-1/",
|
|
36053
34915
|
txPage: "https://portal.lumera.io/lumera-mainnet-1/tx/${txHash}",
|
|
36054
34916
|
accountPage: "https://portal.lumera.io/lumera-mainnet-1/account/${accountAddress}"
|
|
34917
|
+
},
|
|
34918
|
+
{
|
|
34919
|
+
kind: "Cosmotracker",
|
|
34920
|
+
url: "https://cosmotracker.com/lumera/",
|
|
34921
|
+
txPage: "https://cosmotracker.com/lumera/tx/${txHash}",
|
|
34922
|
+
accountPage: "https://cosmotracker.com/lumera/account/${accountAddress}"
|
|
36055
34923
|
}
|
|
36056
34924
|
]
|
|
36057
34925
|
},
|
|
@@ -39200,6 +38068,22 @@ const _explorers = [
|
|
|
39200
38068
|
}
|
|
39201
38069
|
]
|
|
39202
38070
|
},
|
|
38071
|
+
{
|
|
38072
|
+
chainId: "union-1",
|
|
38073
|
+
explorers: [
|
|
38074
|
+
{
|
|
38075
|
+
kind: "Ping.Pub",
|
|
38076
|
+
url: "https://explorer.union.build/union",
|
|
38077
|
+
txPage: "https://explorer.union.build/union/tx/${txHash}",
|
|
38078
|
+
accountPage: "https://explorer.union.build/union/account/${accountAddress}"
|
|
38079
|
+
},
|
|
38080
|
+
{
|
|
38081
|
+
kind: "Ruangnode Explorer",
|
|
38082
|
+
url: "https://explorer.ruangnode.com/dashboard/union",
|
|
38083
|
+
txPage: "https://explorer.ruangnode.com/transactions/union?hash=${txHash}"
|
|
38084
|
+
}
|
|
38085
|
+
]
|
|
38086
|
+
},
|
|
39203
38087
|
{
|
|
39204
38088
|
chainId: "ununifi-beta-v1",
|
|
39205
38089
|
explorers: [
|
|
@@ -39278,6 +38162,17 @@ const _explorers = [
|
|
|
39278
38162
|
}
|
|
39279
38163
|
]
|
|
39280
38164
|
},
|
|
38165
|
+
{
|
|
38166
|
+
chainId: "warden_8765-1",
|
|
38167
|
+
explorers: [
|
|
38168
|
+
{
|
|
38169
|
+
kind: "Warden Labs",
|
|
38170
|
+
url: "https://explorer.wardenprotocol.org/",
|
|
38171
|
+
txPage: "https://explorer.wardenprotocol.org/tx/${txHash}",
|
|
38172
|
+
accountPage: "https://explorer.wardenprotocol.org/address/${accountAddress}"
|
|
38173
|
+
}
|
|
38174
|
+
]
|
|
38175
|
+
},
|
|
39281
38176
|
{
|
|
39282
38177
|
chainId: "xarchain",
|
|
39283
38178
|
explorers: [
|
|
@@ -41100,6 +39995,10 @@ const _explorers = [
|
|
|
41100
39995
|
}
|
|
41101
39996
|
]
|
|
41102
39997
|
},
|
|
39998
|
+
{
|
|
39999
|
+
chainId: "rebel-2",
|
|
40000
|
+
explorers: []
|
|
40001
|
+
},
|
|
41103
40002
|
{
|
|
41104
40003
|
chainId: "titan-test-4",
|
|
41105
40004
|
explorers: [
|
|
@@ -42999,7 +41898,7 @@ ieee754.write = function(buffer2, value, offset, isLE2, mLen, nBytes) {
|
|
|
42999
41898
|
Buffer2.isBuffer = function isBuffer(b) {
|
|
43000
41899
|
return b != null && b._isBuffer === true && b !== Buffer2.prototype;
|
|
43001
41900
|
};
|
|
43002
|
-
Buffer2.compare = function
|
|
41901
|
+
Buffer2.compare = function compare(a, b) {
|
|
43003
41902
|
if (isInstance(a, GlobalUint8Array)) a = Buffer2.from(a, a.offset, a.byteLength);
|
|
43004
41903
|
if (isInstance(b, GlobalUint8Array)) b = Buffer2.from(b, b.offset, b.byteLength);
|
|
43005
41904
|
if (!Buffer2.isBuffer(a) || !Buffer2.isBuffer(b)) {
|
|
@@ -43229,7 +42128,7 @@ ieee754.write = function(buffer2, value, offset, isLE2, mLen, nBytes) {
|
|
|
43229
42128
|
if (customInspectSymbol) {
|
|
43230
42129
|
Buffer2.prototype[customInspectSymbol] = Buffer2.prototype.inspect;
|
|
43231
42130
|
}
|
|
43232
|
-
Buffer2.prototype.compare = function
|
|
42131
|
+
Buffer2.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {
|
|
43233
42132
|
if (isInstance(target, GlobalUint8Array)) {
|
|
43234
42133
|
target = Buffer2.from(target, target.offset, target.byteLength);
|
|
43235
42134
|
}
|
|
@@ -48373,7 +47272,7 @@ function walletConnect(parameters) {
|
|
|
48373
47272
|
const optionalChains = config2.chains.map((x2) => x2.id);
|
|
48374
47273
|
if (!optionalChains.length)
|
|
48375
47274
|
return;
|
|
48376
|
-
const { EthereumProvider } = await import("./index.es-
|
|
47275
|
+
const { EthereumProvider } = await import("./index.es-CbN_imGq.js").then((n) => n.i);
|
|
48377
47276
|
return await EthereumProvider.init({
|
|
48378
47277
|
...parameters,
|
|
48379
47278
|
disableProviderPing: true,
|
|
@@ -48796,7 +47695,7 @@ const gasOnReceiveRouteRequestAtom = atom$1((get) => {
|
|
|
48796
47695
|
const gasPrice = ((_b2 = asset.gasPrice) == null ? void 0 : _b2.average) ?? ((_c2 = asset.gasPrice) == null ? void 0 : _c2.high) ?? ((_d2 = asset.gasPrice) == null ? void 0 : _d2.low);
|
|
48797
47696
|
return {
|
|
48798
47697
|
amountOut: gasPrice && convertHumanReadableAmountToCryptoAmount(
|
|
48799
|
-
BigNumber(gasPrice).multipliedBy(3).toNumber(),
|
|
47698
|
+
BigNumber$1(gasPrice).multipliedBy(3).toNumber(),
|
|
48800
47699
|
destinationFeeAsset == null ? void 0 : destinationFeeAsset.decimals
|
|
48801
47700
|
),
|
|
48802
47701
|
denom: asset.denom
|
|
@@ -48806,7 +47705,7 @@ const gasOnReceiveRouteRequestAtom = atom$1((get) => {
|
|
|
48806
47705
|
if (!(sourceAsset == null ? void 0 : sourceAsset.chainId) || !sourceAsset.denom || !destinationFeeAssets) return;
|
|
48807
47706
|
const sourceAssetUsdPrice = (_f = (_e2 = (_d = (_c = (_b = balances2 == null ? void 0 : balances2.data) == null ? void 0 : _b.chains) == null ? void 0 : _c[sourceAsset == null ? void 0 : sourceAsset.chainId]) == null ? void 0 : _d.denoms) == null ? void 0 : _e2[sourceAsset == null ? void 0 : sourceAsset.denom]) == null ? void 0 : _f.price;
|
|
48808
47707
|
if (!sourceAssetUsdPrice) return;
|
|
48809
|
-
const amount = BigNumber(amountUsd).dividedBy(sourceAssetUsdPrice).toString();
|
|
47708
|
+
const amount = BigNumber$1(amountUsd).dividedBy(sourceAssetUsdPrice).toString();
|
|
48810
47709
|
return {
|
|
48811
47710
|
amountIn: convertHumanReadableAmountToCryptoAmount(amount, sourceAsset == null ? void 0 : sourceAsset.decimals),
|
|
48812
47711
|
sourceAssetChainId: sourceAsset.chainId,
|
|
@@ -48842,7 +47741,7 @@ const isSomeDestinationFeeBalanceAvailableAtom = atomWithQuery((get) => {
|
|
|
48842
47741
|
({ denom, amountOut }) => {
|
|
48843
47742
|
var _a, _b, _c, _d;
|
|
48844
47743
|
const balanceAmount = (_d = (_c = (_b = (_a = balanceResponse == null ? void 0 : balanceResponse.chains) == null ? void 0 : _a[destination.chainId]) == null ? void 0 : _b.denoms) == null ? void 0 : _c[denom]) == null ? void 0 : _d.amount;
|
|
48845
|
-
const isMoreThanAmountOut = !!balanceAmount && !!amountOut && BigNumber(balanceAmount).isGreaterThanOrEqualTo(amountOut);
|
|
47744
|
+
const isMoreThanAmountOut = !!balanceAmount && !!amountOut && BigNumber$1(balanceAmount).isGreaterThanOrEqualTo(amountOut);
|
|
48846
47745
|
return amountOut ? isMoreThanAmountOut : balanceAmount && balanceAmount !== "0";
|
|
48847
47746
|
}
|
|
48848
47747
|
);
|
|
@@ -51252,9 +50151,7 @@ const useGetAccount = () => {
|
|
|
51252
50151
|
const svmWallet = useAtomValue(svmWalletAtom);
|
|
51253
50152
|
const connectedAddress = useAtomValue(connectedAddressesAtom);
|
|
51254
50153
|
const { data: chains2 } = useAtomValue(skipChainsAtom);
|
|
51255
|
-
const { data: cosmosAccounts } = useAccount$1(
|
|
51256
|
-
multiChain: true
|
|
51257
|
-
});
|
|
50154
|
+
const { data: cosmosAccounts } = useAccount$1();
|
|
51258
50155
|
const { wallets: _wallets } = useWallet();
|
|
51259
50156
|
const solanaWallet = _wallets.map((i) => i.adapter).find((wallet2) => wallet2.connected === true);
|
|
51260
50157
|
const evmAccount = useAccount();
|
|
@@ -51491,9 +50388,7 @@ const ConnectEcoRow = ({
|
|
|
51491
50388
|
}) => {
|
|
51492
50389
|
var _a, _b;
|
|
51493
50390
|
const { saveToClipboard: copyAddress, isCopied: isShowingCopyAddressFeedback } = useClipboard();
|
|
51494
|
-
const { data: cosmosAccounts } = useAccount$1(
|
|
51495
|
-
multiChain: true
|
|
51496
|
-
});
|
|
50391
|
+
const { data: cosmosAccounts } = useAccount$1();
|
|
51497
50392
|
const theme = nt();
|
|
51498
50393
|
const getAccount = useGetAccount();
|
|
51499
50394
|
const isMobileScreenSize = useIsMobileScreenSize();
|
|
@@ -55114,7 +54009,7 @@ const useHandleTransactionFailed = (error, statusData) => {
|
|
|
55114
54009
|
track("unexpected error page: transaction failed", { lastTransaction, error, route: route2 });
|
|
55115
54010
|
setErrorWarning({
|
|
55116
54011
|
errorWarningType: ErrorWarningType.TransactionFailed,
|
|
55117
|
-
onClickContactSupport: () => window.open("https://
|
|
54012
|
+
onClickContactSupport: () => window.open("https://discord.com/invite/interchain", "_blank"),
|
|
55118
54013
|
explorerLink,
|
|
55119
54014
|
txHash: lastTxHash ?? ""
|
|
55120
54015
|
});
|
|
@@ -56417,7 +55312,7 @@ const useConnectToMissingCosmosChain = () => {
|
|
|
56417
55312
|
}, [sourceAsset, wallets, extraChainIdsToConnect, addExtraChainIdsToConnectForWalletType]);
|
|
56418
55313
|
return { isAskingToApproveConnection };
|
|
56419
55314
|
};
|
|
56420
|
-
const version = "3.14.
|
|
55315
|
+
const version = "3.14.13";
|
|
56421
55316
|
const packageJson = {
|
|
56422
55317
|
version
|
|
56423
55318
|
};
|
|
@@ -57922,9 +56817,7 @@ const useKeepWalletStateSynced = () => {
|
|
|
57922
56817
|
const [evmWallet, setEvmWallet] = useAtom(evmWalletAtom);
|
|
57923
56818
|
const [cosmosWallet, setCosmosWallet] = useAtom(cosmosWalletAtom);
|
|
57924
56819
|
const [svmWallet, setSvmWallet] = useAtom(svmWalletAtom);
|
|
57925
|
-
const { data: cosmosAccounts, walletType } = useAccount$1(
|
|
57926
|
-
multiChain: true
|
|
57927
|
-
});
|
|
56820
|
+
const { data: cosmosAccounts, walletType } = useAccount$1();
|
|
57928
56821
|
const currentCosmosId = cosmosAccounts ? (_a = cosmosAccounts[Object.keys(cosmosAccounts)[0]]) == null ? void 0 : _a.bech32Address : "";
|
|
57929
56822
|
const { wallets: _wallets } = useWallet();
|
|
57930
56823
|
const solanaWallet = _wallets.map((i) => i.adapter).find((wallet) => wallet.connected === true);
|