@proton/wrap-constants 0.2.182 → 0.2.184
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +413 -554
- package/dist/index.js +50 -35
- package/dist/index.mjs +50 -35
- package/package.json +2 -2
- package/src/coins.ts +562 -560
- package/src/parsers/deposit.ts +1 -1
- package/dist/coins.d.ts +0 -121
- package/dist/constants.d.ts +0 -63
- package/dist/graph.d.ts +0 -30
- package/dist/math.d.ts +0 -17
- package/dist/parsers/actions.d.ts +0 -1323
- package/dist/parsers/address.d.ts +0 -932
- package/dist/parsers/auth.d.ts +0 -1816
- package/dist/parsers/base.d.ts +0 -35
- package/dist/parsers/currency.d.ts +0 -236
- package/dist/parsers/deposit.d.ts +0 -66
- package/dist/parsers/dex.d.ts +0 -1516
- package/dist/parsers/index.d.ts +0 -13
- package/dist/parsers/login.d.ts +0 -892
- package/dist/parsers/otc.d.ts +0 -46
- package/dist/parsers/pool.d.ts +0 -52
- package/dist/parsers/withdraw.d.ts +0 -1053
- package/dist/parsers/withdrawalHistory.d.ts +0 -98
- package/dist/parsers/wrap.d.ts +0 -109
- package/dist/utils.d.ts +0 -8
- package/dist/wrap-constants.cjs.development.js +0 -2144
- package/dist/wrap-constants.cjs.development.js.map +0 -1
- package/dist/wrap-constants.cjs.production.min.js +0 -2
- package/dist/wrap-constants.cjs.production.min.js.map +0 -1
- package/dist/wrap-constants.esm.js +0 -2069
- package/dist/wrap-constants.esm.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -158,7 +158,7 @@ var Chains = /* @__PURE__ */ ((Chains2) => {
|
|
|
158
158
|
Chains2["BitcoinMainnet"] = "Bitcoin";
|
|
159
159
|
Chains2["BitcoinTestnet"] = "Bitcoin (Testnet)";
|
|
160
160
|
Chains2["EthereumMainnet"] = "Ethereum";
|
|
161
|
-
Chains2["
|
|
161
|
+
Chains2["EthereumSepolia"] = "Ethereum (Sepolia)";
|
|
162
162
|
Chains2["LitecoinMainnet"] = "Litecoin";
|
|
163
163
|
Chains2["LitecoinTestnet"] = "Litecoin (Testnet)";
|
|
164
164
|
Chains2["BitcoinCashMainnet"] = "Bitcoin Cash";
|
|
@@ -193,13 +193,13 @@ var Chains = /* @__PURE__ */ ((Chains2) => {
|
|
|
193
193
|
var Networks = /* @__PURE__ */ ((Networks2) => {
|
|
194
194
|
Networks2["Mainnet"] = "mainnet";
|
|
195
195
|
Networks2["Testnet"] = "testnet";
|
|
196
|
-
Networks2["Ropsten"] = "ropsten";
|
|
197
196
|
Networks2["ERC20"] = "erc20";
|
|
198
197
|
Networks2["BEP20"] = "bep20";
|
|
199
198
|
Networks2["XLM"] = "xlm";
|
|
200
199
|
Networks2["AVM"] = "avm";
|
|
201
200
|
Networks2["EVM"] = "evm";
|
|
202
201
|
Networks2["METALL2"] = "metall2";
|
|
202
|
+
Networks2["Sepolia"] = "sepolia";
|
|
203
203
|
return Networks2;
|
|
204
204
|
})(Networks || {});
|
|
205
205
|
var similarChains = {
|
|
@@ -216,7 +216,7 @@ var explorerLinkByChain = {
|
|
|
216
216
|
["Bitcoin" /* BitcoinMainnet */]: (txid) => `https://blockchain.com/btc/tx/${txid}`,
|
|
217
217
|
["Bitcoin (Testnet)" /* BitcoinTestnet */]: (txid) => `https://blockstream.info/testnet/tx/${txid}`,
|
|
218
218
|
["Ethereum" /* EthereumMainnet */]: (txid) => `https://etherscan.io/tx/${txid}`,
|
|
219
|
-
["Ethereum (
|
|
219
|
+
["Ethereum (Sepolia)" /* EthereumSepolia */]: (txid) => `https://sepolia.etherscan.io/tx/${txid}`,
|
|
220
220
|
["Litecoin" /* LitecoinMainnet */]: (txid) => `https://blockchair.com/litecoin/transaction/${txid}`,
|
|
221
221
|
["Litecoin (Testnet)" /* LitecoinTestnet */]: (txid) => `https://blockexplorer.one/litecoin/testnet/blockHash/${txid}`,
|
|
222
222
|
["Bitcoin Cash" /* BitcoinCashMainnet */]: (txid) => `https://blockchair.com/bitcoin-cash/transaction/${txid}`,
|
|
@@ -337,8 +337,8 @@ var initializeCoins = (protonChain) => {
|
|
|
337
337
|
{
|
|
338
338
|
wallet: "USDC",
|
|
339
339
|
symbol: "USDC",
|
|
340
|
-
chain: "Ethereum (
|
|
341
|
-
network: "
|
|
340
|
+
chain: "Ethereum (Sepolia)" /* EthereumSepolia */,
|
|
341
|
+
network: "sepolia" /* Sepolia */,
|
|
342
342
|
precision: 6,
|
|
343
343
|
contract: "0xA0B86991C6218B36C1D19D4A2E9EB0CE3606EB48",
|
|
344
344
|
provider: "fireblocks" /* FIREBLOCKS */,
|
|
@@ -526,8 +526,8 @@ var initializeCoins = (protonChain) => {
|
|
|
526
526
|
{
|
|
527
527
|
wallet: "ETH",
|
|
528
528
|
symbol: "ETH",
|
|
529
|
-
chain: "Ethereum (
|
|
530
|
-
network: "
|
|
529
|
+
chain: "Ethereum (Sepolia)" /* EthereumSepolia */,
|
|
530
|
+
network: "sepolia" /* Sepolia */,
|
|
531
531
|
precision: 18,
|
|
532
532
|
contract: "0x0000000000000000000000000000000000000000",
|
|
533
533
|
provider: "fireblocks" /* FIREBLOCKS */,
|
|
@@ -590,8 +590,8 @@ var initializeCoins = (protonChain) => {
|
|
|
590
590
|
{
|
|
591
591
|
wallet: "USDT",
|
|
592
592
|
symbol: "USDT",
|
|
593
|
-
chain: "Ethereum (
|
|
594
|
-
network: "
|
|
593
|
+
chain: "Ethereum (Sepolia)" /* EthereumSepolia */,
|
|
594
|
+
network: "sepolia" /* Sepolia */,
|
|
595
595
|
precision: 6,
|
|
596
596
|
contract: "0xDAC17F958D2EE523A2206206994597C13D831EC7",
|
|
597
597
|
provider: "fireblocks" /* FIREBLOCKS */,
|
|
@@ -742,8 +742,8 @@ var initializeCoins = (protonChain) => {
|
|
|
742
742
|
{
|
|
743
743
|
wallet: "PAXG",
|
|
744
744
|
symbol: "PAXG",
|
|
745
|
-
chain: "Ethereum (
|
|
746
|
-
network: "
|
|
745
|
+
chain: "Ethereum (Sepolia)" /* EthereumSepolia */,
|
|
746
|
+
network: "sepolia" /* Sepolia */,
|
|
747
747
|
precision: 18,
|
|
748
748
|
contract: "0x45804880DE22913DAFE09F4980848ECE6ECBAF78",
|
|
749
749
|
provider: "fireblocks" /* FIREBLOCKS */,
|
|
@@ -827,8 +827,8 @@ var initializeCoins = (protonChain) => {
|
|
|
827
827
|
// {
|
|
828
828
|
// wallet: "UNI",
|
|
829
829
|
// symbol: "UNI",
|
|
830
|
-
// chain: Chains.
|
|
831
|
-
// network: Networks.
|
|
830
|
+
// chain: Chains.EthereumSepolia,
|
|
831
|
+
// network: Networks.Sepolia,
|
|
832
832
|
// precision: 18,
|
|
833
833
|
// contract: "0x1F9840A85D5AF5BF1D1762F925BDADDC4201F984",
|
|
834
834
|
// provider: Providers.FIREBLOCKS,
|
|
@@ -1826,7 +1826,7 @@ var depositBodyParser = z6.object({
|
|
|
1826
1826
|
coin: z6.string(),
|
|
1827
1827
|
// "ETH" or "XPR"
|
|
1828
1828
|
wallet: z6.string(),
|
|
1829
|
-
// "ETH-
|
|
1829
|
+
// "ETH-SEPOLIA" or "XPR-MAINNET"
|
|
1830
1830
|
network: z6.string()
|
|
1831
1831
|
// "erc29"
|
|
1832
1832
|
});
|
|
@@ -2935,10 +2935,10 @@ function clone(configObject) {
|
|
|
2935
2935
|
throw Error(bignumberError + "Invalid BigNumber: " + v);
|
|
2936
2936
|
};
|
|
2937
2937
|
BigNumber2.maximum = BigNumber2.max = function() {
|
|
2938
|
-
return maxOrMin(arguments,
|
|
2938
|
+
return maxOrMin(arguments, -1);
|
|
2939
2939
|
};
|
|
2940
2940
|
BigNumber2.minimum = BigNumber2.min = function() {
|
|
2941
|
-
return maxOrMin(arguments,
|
|
2941
|
+
return maxOrMin(arguments, 1);
|
|
2942
2942
|
};
|
|
2943
2943
|
BigNumber2.random = function() {
|
|
2944
2944
|
var pow2_53 = 9007199254740992;
|
|
@@ -3297,18 +3297,15 @@ function clone(configObject) {
|
|
|
3297
3297
|
}
|
|
3298
3298
|
return n.s < 0 && c0 ? "-" + str : str;
|
|
3299
3299
|
}
|
|
3300
|
-
function maxOrMin(args,
|
|
3301
|
-
var
|
|
3300
|
+
function maxOrMin(args, n) {
|
|
3301
|
+
var k, y, i = 1, x = new BigNumber2(args[0]);
|
|
3302
3302
|
for (; i < args.length; i++) {
|
|
3303
|
-
|
|
3304
|
-
if (!n.s) {
|
|
3305
|
-
|
|
3306
|
-
break;
|
|
3307
|
-
} else if (method.call(m, n)) {
|
|
3308
|
-
m = n;
|
|
3303
|
+
y = new BigNumber2(args[i]);
|
|
3304
|
+
if (!y.s || (k = compare(x, y)) === n || k === 0 && x.s === n) {
|
|
3305
|
+
x = y;
|
|
3309
3306
|
}
|
|
3310
3307
|
}
|
|
3311
|
-
return
|
|
3308
|
+
return x;
|
|
3312
3309
|
}
|
|
3313
3310
|
function normalise(n, c, e) {
|
|
3314
3311
|
var i = 1, j = c.length;
|
|
@@ -3364,7 +3361,7 @@ function clone(configObject) {
|
|
|
3364
3361
|
i += LOG_BASE;
|
|
3365
3362
|
j = sd;
|
|
3366
3363
|
n = xc[ni = 0];
|
|
3367
|
-
rd = n / pows10[d - j - 1] % 10
|
|
3364
|
+
rd = mathfloor(n / pows10[d - j - 1] % 10);
|
|
3368
3365
|
} else {
|
|
3369
3366
|
ni = mathceil((i + 1) / LOG_BASE);
|
|
3370
3367
|
if (ni >= xc.length) {
|
|
@@ -3384,7 +3381,7 @@ function clone(configObject) {
|
|
|
3384
3381
|
;
|
|
3385
3382
|
i %= LOG_BASE;
|
|
3386
3383
|
j = i - LOG_BASE + d;
|
|
3387
|
-
rd = j < 0 ? 0 : n / pows10[d - j - 1] % 10
|
|
3384
|
+
rd = j < 0 ? 0 : mathfloor(n / pows10[d - j - 1] % 10);
|
|
3388
3385
|
}
|
|
3389
3386
|
}
|
|
3390
3387
|
r = r || sd < 0 || // Are there any non-zero digits after the rounding digit?
|
|
@@ -3657,8 +3654,12 @@ function clone(configObject) {
|
|
|
3657
3654
|
}
|
|
3658
3655
|
}
|
|
3659
3656
|
}
|
|
3660
|
-
if (xLTy)
|
|
3661
|
-
t = xc
|
|
3657
|
+
if (xLTy) {
|
|
3658
|
+
t = xc;
|
|
3659
|
+
xc = yc;
|
|
3660
|
+
yc = t;
|
|
3661
|
+
y.s = -y.s;
|
|
3662
|
+
}
|
|
3662
3663
|
b = (j = yc.length) - (i = xc.length);
|
|
3663
3664
|
if (b > 0)
|
|
3664
3665
|
for (; b--; xc[i++] = 0)
|
|
@@ -3724,8 +3725,14 @@ function clone(configObject) {
|
|
|
3724
3725
|
y.s *= x.s;
|
|
3725
3726
|
xcL = xc.length;
|
|
3726
3727
|
ycL = yc.length;
|
|
3727
|
-
if (xcL < ycL)
|
|
3728
|
-
zc = xc
|
|
3728
|
+
if (xcL < ycL) {
|
|
3729
|
+
zc = xc;
|
|
3730
|
+
xc = yc;
|
|
3731
|
+
yc = zc;
|
|
3732
|
+
i = xcL;
|
|
3733
|
+
xcL = ycL;
|
|
3734
|
+
ycL = i;
|
|
3735
|
+
}
|
|
3729
3736
|
for (i = xcL + ycL, zc = []; i--; zc.push(0))
|
|
3730
3737
|
;
|
|
3731
3738
|
base = BASE;
|
|
@@ -3791,8 +3798,12 @@ function clone(configObject) {
|
|
|
3791
3798
|
}
|
|
3792
3799
|
a = xc.length;
|
|
3793
3800
|
b = yc.length;
|
|
3794
|
-
if (a - b < 0)
|
|
3795
|
-
t = yc
|
|
3801
|
+
if (a - b < 0) {
|
|
3802
|
+
t = yc;
|
|
3803
|
+
yc = xc;
|
|
3804
|
+
xc = t;
|
|
3805
|
+
b = a;
|
|
3806
|
+
}
|
|
3796
3807
|
for (a = 0; b; ) {
|
|
3797
3808
|
a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0;
|
|
3798
3809
|
xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE;
|
|
@@ -3920,8 +3931,12 @@ function clone(configObject) {
|
|
|
3920
3931
|
str = x.toFixed(dp, rm);
|
|
3921
3932
|
if (x.c) {
|
|
3922
3933
|
var i, arr = str.split("."), g1 = +format2.groupSize, g2 = +format2.secondaryGroupSize, groupSeparator = format2.groupSeparator || "", intPart = arr[0], fractionPart = arr[1], isNeg = x.s < 0, intDigits = isNeg ? intPart.slice(1) : intPart, len = intDigits.length;
|
|
3923
|
-
if (g2)
|
|
3924
|
-
i = g1
|
|
3934
|
+
if (g2) {
|
|
3935
|
+
i = g1;
|
|
3936
|
+
g1 = g2;
|
|
3937
|
+
g2 = i;
|
|
3938
|
+
len -= i;
|
|
3939
|
+
}
|
|
3925
3940
|
if (g1 > 0 && len > 0) {
|
|
3926
3941
|
i = len % g1 || g1;
|
|
3927
3942
|
intPart = intDigits.substr(0, i);
|
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ var Chains = /* @__PURE__ */ ((Chains2) => {
|
|
|
3
3
|
Chains2["BitcoinMainnet"] = "Bitcoin";
|
|
4
4
|
Chains2["BitcoinTestnet"] = "Bitcoin (Testnet)";
|
|
5
5
|
Chains2["EthereumMainnet"] = "Ethereum";
|
|
6
|
-
Chains2["
|
|
6
|
+
Chains2["EthereumSepolia"] = "Ethereum (Sepolia)";
|
|
7
7
|
Chains2["LitecoinMainnet"] = "Litecoin";
|
|
8
8
|
Chains2["LitecoinTestnet"] = "Litecoin (Testnet)";
|
|
9
9
|
Chains2["BitcoinCashMainnet"] = "Bitcoin Cash";
|
|
@@ -38,13 +38,13 @@ var Chains = /* @__PURE__ */ ((Chains2) => {
|
|
|
38
38
|
var Networks = /* @__PURE__ */ ((Networks2) => {
|
|
39
39
|
Networks2["Mainnet"] = "mainnet";
|
|
40
40
|
Networks2["Testnet"] = "testnet";
|
|
41
|
-
Networks2["Ropsten"] = "ropsten";
|
|
42
41
|
Networks2["ERC20"] = "erc20";
|
|
43
42
|
Networks2["BEP20"] = "bep20";
|
|
44
43
|
Networks2["XLM"] = "xlm";
|
|
45
44
|
Networks2["AVM"] = "avm";
|
|
46
45
|
Networks2["EVM"] = "evm";
|
|
47
46
|
Networks2["METALL2"] = "metall2";
|
|
47
|
+
Networks2["Sepolia"] = "sepolia";
|
|
48
48
|
return Networks2;
|
|
49
49
|
})(Networks || {});
|
|
50
50
|
var similarChains = {
|
|
@@ -61,7 +61,7 @@ var explorerLinkByChain = {
|
|
|
61
61
|
["Bitcoin" /* BitcoinMainnet */]: (txid) => `https://blockchain.com/btc/tx/${txid}`,
|
|
62
62
|
["Bitcoin (Testnet)" /* BitcoinTestnet */]: (txid) => `https://blockstream.info/testnet/tx/${txid}`,
|
|
63
63
|
["Ethereum" /* EthereumMainnet */]: (txid) => `https://etherscan.io/tx/${txid}`,
|
|
64
|
-
["Ethereum (
|
|
64
|
+
["Ethereum (Sepolia)" /* EthereumSepolia */]: (txid) => `https://sepolia.etherscan.io/tx/${txid}`,
|
|
65
65
|
["Litecoin" /* LitecoinMainnet */]: (txid) => `https://blockchair.com/litecoin/transaction/${txid}`,
|
|
66
66
|
["Litecoin (Testnet)" /* LitecoinTestnet */]: (txid) => `https://blockexplorer.one/litecoin/testnet/blockHash/${txid}`,
|
|
67
67
|
["Bitcoin Cash" /* BitcoinCashMainnet */]: (txid) => `https://blockchair.com/bitcoin-cash/transaction/${txid}`,
|
|
@@ -182,8 +182,8 @@ var initializeCoins = (protonChain) => {
|
|
|
182
182
|
{
|
|
183
183
|
wallet: "USDC",
|
|
184
184
|
symbol: "USDC",
|
|
185
|
-
chain: "Ethereum (
|
|
186
|
-
network: "
|
|
185
|
+
chain: "Ethereum (Sepolia)" /* EthereumSepolia */,
|
|
186
|
+
network: "sepolia" /* Sepolia */,
|
|
187
187
|
precision: 6,
|
|
188
188
|
contract: "0xA0B86991C6218B36C1D19D4A2E9EB0CE3606EB48",
|
|
189
189
|
provider: "fireblocks" /* FIREBLOCKS */,
|
|
@@ -371,8 +371,8 @@ var initializeCoins = (protonChain) => {
|
|
|
371
371
|
{
|
|
372
372
|
wallet: "ETH",
|
|
373
373
|
symbol: "ETH",
|
|
374
|
-
chain: "Ethereum (
|
|
375
|
-
network: "
|
|
374
|
+
chain: "Ethereum (Sepolia)" /* EthereumSepolia */,
|
|
375
|
+
network: "sepolia" /* Sepolia */,
|
|
376
376
|
precision: 18,
|
|
377
377
|
contract: "0x0000000000000000000000000000000000000000",
|
|
378
378
|
provider: "fireblocks" /* FIREBLOCKS */,
|
|
@@ -435,8 +435,8 @@ var initializeCoins = (protonChain) => {
|
|
|
435
435
|
{
|
|
436
436
|
wallet: "USDT",
|
|
437
437
|
symbol: "USDT",
|
|
438
|
-
chain: "Ethereum (
|
|
439
|
-
network: "
|
|
438
|
+
chain: "Ethereum (Sepolia)" /* EthereumSepolia */,
|
|
439
|
+
network: "sepolia" /* Sepolia */,
|
|
440
440
|
precision: 6,
|
|
441
441
|
contract: "0xDAC17F958D2EE523A2206206994597C13D831EC7",
|
|
442
442
|
provider: "fireblocks" /* FIREBLOCKS */,
|
|
@@ -587,8 +587,8 @@ var initializeCoins = (protonChain) => {
|
|
|
587
587
|
{
|
|
588
588
|
wallet: "PAXG",
|
|
589
589
|
symbol: "PAXG",
|
|
590
|
-
chain: "Ethereum (
|
|
591
|
-
network: "
|
|
590
|
+
chain: "Ethereum (Sepolia)" /* EthereumSepolia */,
|
|
591
|
+
network: "sepolia" /* Sepolia */,
|
|
592
592
|
precision: 18,
|
|
593
593
|
contract: "0x45804880DE22913DAFE09F4980848ECE6ECBAF78",
|
|
594
594
|
provider: "fireblocks" /* FIREBLOCKS */,
|
|
@@ -672,8 +672,8 @@ var initializeCoins = (protonChain) => {
|
|
|
672
672
|
// {
|
|
673
673
|
// wallet: "UNI",
|
|
674
674
|
// symbol: "UNI",
|
|
675
|
-
// chain: Chains.
|
|
676
|
-
// network: Networks.
|
|
675
|
+
// chain: Chains.EthereumSepolia,
|
|
676
|
+
// network: Networks.Sepolia,
|
|
677
677
|
// precision: 18,
|
|
678
678
|
// contract: "0x1F9840A85D5AF5BF1D1762F925BDADDC4201F984",
|
|
679
679
|
// provider: Providers.FIREBLOCKS,
|
|
@@ -1671,7 +1671,7 @@ var depositBodyParser = z6.object({
|
|
|
1671
1671
|
coin: z6.string(),
|
|
1672
1672
|
// "ETH" or "XPR"
|
|
1673
1673
|
wallet: z6.string(),
|
|
1674
|
-
// "ETH-
|
|
1674
|
+
// "ETH-SEPOLIA" or "XPR-MAINNET"
|
|
1675
1675
|
network: z6.string()
|
|
1676
1676
|
// "erc29"
|
|
1677
1677
|
});
|
|
@@ -2780,10 +2780,10 @@ function clone(configObject) {
|
|
|
2780
2780
|
throw Error(bignumberError + "Invalid BigNumber: " + v);
|
|
2781
2781
|
};
|
|
2782
2782
|
BigNumber2.maximum = BigNumber2.max = function() {
|
|
2783
|
-
return maxOrMin(arguments,
|
|
2783
|
+
return maxOrMin(arguments, -1);
|
|
2784
2784
|
};
|
|
2785
2785
|
BigNumber2.minimum = BigNumber2.min = function() {
|
|
2786
|
-
return maxOrMin(arguments,
|
|
2786
|
+
return maxOrMin(arguments, 1);
|
|
2787
2787
|
};
|
|
2788
2788
|
BigNumber2.random = function() {
|
|
2789
2789
|
var pow2_53 = 9007199254740992;
|
|
@@ -3142,18 +3142,15 @@ function clone(configObject) {
|
|
|
3142
3142
|
}
|
|
3143
3143
|
return n.s < 0 && c0 ? "-" + str : str;
|
|
3144
3144
|
}
|
|
3145
|
-
function maxOrMin(args,
|
|
3146
|
-
var
|
|
3145
|
+
function maxOrMin(args, n) {
|
|
3146
|
+
var k, y, i = 1, x = new BigNumber2(args[0]);
|
|
3147
3147
|
for (; i < args.length; i++) {
|
|
3148
|
-
|
|
3149
|
-
if (!n.s) {
|
|
3150
|
-
|
|
3151
|
-
break;
|
|
3152
|
-
} else if (method.call(m, n)) {
|
|
3153
|
-
m = n;
|
|
3148
|
+
y = new BigNumber2(args[i]);
|
|
3149
|
+
if (!y.s || (k = compare(x, y)) === n || k === 0 && x.s === n) {
|
|
3150
|
+
x = y;
|
|
3154
3151
|
}
|
|
3155
3152
|
}
|
|
3156
|
-
return
|
|
3153
|
+
return x;
|
|
3157
3154
|
}
|
|
3158
3155
|
function normalise(n, c, e) {
|
|
3159
3156
|
var i = 1, j = c.length;
|
|
@@ -3209,7 +3206,7 @@ function clone(configObject) {
|
|
|
3209
3206
|
i += LOG_BASE;
|
|
3210
3207
|
j = sd;
|
|
3211
3208
|
n = xc[ni = 0];
|
|
3212
|
-
rd = n / pows10[d - j - 1] % 10
|
|
3209
|
+
rd = mathfloor(n / pows10[d - j - 1] % 10);
|
|
3213
3210
|
} else {
|
|
3214
3211
|
ni = mathceil((i + 1) / LOG_BASE);
|
|
3215
3212
|
if (ni >= xc.length) {
|
|
@@ -3229,7 +3226,7 @@ function clone(configObject) {
|
|
|
3229
3226
|
;
|
|
3230
3227
|
i %= LOG_BASE;
|
|
3231
3228
|
j = i - LOG_BASE + d;
|
|
3232
|
-
rd = j < 0 ? 0 : n / pows10[d - j - 1] % 10
|
|
3229
|
+
rd = j < 0 ? 0 : mathfloor(n / pows10[d - j - 1] % 10);
|
|
3233
3230
|
}
|
|
3234
3231
|
}
|
|
3235
3232
|
r = r || sd < 0 || // Are there any non-zero digits after the rounding digit?
|
|
@@ -3502,8 +3499,12 @@ function clone(configObject) {
|
|
|
3502
3499
|
}
|
|
3503
3500
|
}
|
|
3504
3501
|
}
|
|
3505
|
-
if (xLTy)
|
|
3506
|
-
t = xc
|
|
3502
|
+
if (xLTy) {
|
|
3503
|
+
t = xc;
|
|
3504
|
+
xc = yc;
|
|
3505
|
+
yc = t;
|
|
3506
|
+
y.s = -y.s;
|
|
3507
|
+
}
|
|
3507
3508
|
b = (j = yc.length) - (i = xc.length);
|
|
3508
3509
|
if (b > 0)
|
|
3509
3510
|
for (; b--; xc[i++] = 0)
|
|
@@ -3569,8 +3570,14 @@ function clone(configObject) {
|
|
|
3569
3570
|
y.s *= x.s;
|
|
3570
3571
|
xcL = xc.length;
|
|
3571
3572
|
ycL = yc.length;
|
|
3572
|
-
if (xcL < ycL)
|
|
3573
|
-
zc = xc
|
|
3573
|
+
if (xcL < ycL) {
|
|
3574
|
+
zc = xc;
|
|
3575
|
+
xc = yc;
|
|
3576
|
+
yc = zc;
|
|
3577
|
+
i = xcL;
|
|
3578
|
+
xcL = ycL;
|
|
3579
|
+
ycL = i;
|
|
3580
|
+
}
|
|
3574
3581
|
for (i = xcL + ycL, zc = []; i--; zc.push(0))
|
|
3575
3582
|
;
|
|
3576
3583
|
base = BASE;
|
|
@@ -3636,8 +3643,12 @@ function clone(configObject) {
|
|
|
3636
3643
|
}
|
|
3637
3644
|
a = xc.length;
|
|
3638
3645
|
b = yc.length;
|
|
3639
|
-
if (a - b < 0)
|
|
3640
|
-
t = yc
|
|
3646
|
+
if (a - b < 0) {
|
|
3647
|
+
t = yc;
|
|
3648
|
+
yc = xc;
|
|
3649
|
+
xc = t;
|
|
3650
|
+
b = a;
|
|
3651
|
+
}
|
|
3641
3652
|
for (a = 0; b; ) {
|
|
3642
3653
|
a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0;
|
|
3643
3654
|
xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE;
|
|
@@ -3765,8 +3776,12 @@ function clone(configObject) {
|
|
|
3765
3776
|
str = x.toFixed(dp, rm);
|
|
3766
3777
|
if (x.c) {
|
|
3767
3778
|
var i, arr = str.split("."), g1 = +format2.groupSize, g2 = +format2.secondaryGroupSize, groupSeparator = format2.groupSeparator || "", intPart = arr[0], fractionPart = arr[1], isNeg = x.s < 0, intDigits = isNeg ? intPart.slice(1) : intPart, len = intDigits.length;
|
|
3768
|
-
if (g2)
|
|
3769
|
-
i = g1
|
|
3779
|
+
if (g2) {
|
|
3780
|
+
i = g1;
|
|
3781
|
+
g1 = g2;
|
|
3782
|
+
g2 = i;
|
|
3783
|
+
len -= i;
|
|
3784
|
+
}
|
|
3770
3785
|
if (g1 > 0 && len > 0) {
|
|
3771
3786
|
i = len % g1 || g1;
|
|
3772
3787
|
intPart = intDigits.substr(0, i);
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
|
-
"version": "0.2.
|
|
8
|
+
"version": "0.2.184",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"main": "dist/index.js",
|
|
11
11
|
"typings": "dist/index.d.ts",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"resolutions": {
|
|
41
41
|
"typescript": "4.5"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "88555c5fb8a463f5e0d8af0e6976025739398ba3"
|
|
44
44
|
}
|