@solana/web3.js 1.70.3 → 1.70.4
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/lib/index.browser.cjs.js +55 -32
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +55 -32
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +278 -80
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.esm.js +273 -75
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +55 -32
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +3 -3
- package/lib/index.iife.min.js.map +1 -1
- package/lib/index.native.js +55 -32
- package/lib/index.native.js.map +1 -1
- package/package.json +22 -22
- package/src/message/legacy.ts +9 -12
- package/src/message/v0.ts +29 -12
- package/src/transaction/legacy.ts +2 -2
- package/src/transaction/versioned.ts +2 -1
- package/src/utils/guarded-array-utils.ts +34 -0
- package/src/validator-info.ts +5 -4
package/lib/index.esm.js
CHANGED
|
@@ -8,13 +8,13 @@ import { serialize, deserialize, deserializeUnchecked } from 'borsh';
|
|
|
8
8
|
import * as BufferLayout from '@solana/buffer-layout';
|
|
9
9
|
import { blob } from '@solana/buffer-layout';
|
|
10
10
|
import { toBigIntLE, toBufferLE } from 'bigint-buffer';
|
|
11
|
+
import require$$1 from 'tty';
|
|
11
12
|
import require$$0$1 from 'os';
|
|
12
|
-
import require$$0$2 from 'tty';
|
|
13
13
|
import require$$0 from 'util';
|
|
14
|
-
import require$$0$
|
|
15
|
-
import require$$1 from 'path';
|
|
16
|
-
import require$$0$
|
|
17
|
-
import require$$0$
|
|
14
|
+
import require$$0$2 from 'events';
|
|
15
|
+
import require$$1$1 from 'path';
|
|
16
|
+
import require$$0$3 from 'http';
|
|
17
|
+
import require$$0$4, { Agent as Agent$1 } from 'https';
|
|
18
18
|
import { coerce, instance, string, tuple, literal, unknown, union, type, optional, any, number, array, nullable, create, boolean, record, assert as assert$1 } from 'superstruct';
|
|
19
19
|
import { Client } from 'rpc-websockets';
|
|
20
20
|
import RpcClient from 'jayson/lib/client/browser';
|
|
@@ -765,6 +765,36 @@ class CompiledKeys {
|
|
|
765
765
|
|
|
766
766
|
}
|
|
767
767
|
|
|
768
|
+
const END_OF_BUFFER_ERROR_MESSAGE = 'Reached end of buffer unexpectedly';
|
|
769
|
+
/**
|
|
770
|
+
* Delegates to `Array#shift`, but throws if the array is zero-length.
|
|
771
|
+
*/
|
|
772
|
+
|
|
773
|
+
function guardedShift(byteArray) {
|
|
774
|
+
if (byteArray.length === 0) {
|
|
775
|
+
throw new Error(END_OF_BUFFER_ERROR_MESSAGE);
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
return byteArray.shift();
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* Delegates to `Array#splice`, but throws if the section being spliced out extends past the end of
|
|
782
|
+
* the array.
|
|
783
|
+
*/
|
|
784
|
+
|
|
785
|
+
function guardedSplice(byteArray, ...args) {
|
|
786
|
+
var _args$;
|
|
787
|
+
|
|
788
|
+
const [start] = args;
|
|
789
|
+
|
|
790
|
+
if (args.length === 2 // Implies that `deleteCount` was supplied
|
|
791
|
+
? start + ((_args$ = args[1]) !== null && _args$ !== void 0 ? _args$ : 0) > byteArray.length : start >= byteArray.length) {
|
|
792
|
+
throw new Error(END_OF_BUFFER_ERROR_MESSAGE);
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
return byteArray.splice(...args);
|
|
796
|
+
}
|
|
797
|
+
|
|
768
798
|
/**
|
|
769
799
|
* An instruction to execute by a program
|
|
770
800
|
*
|
|
@@ -916,37 +946,33 @@ class Message {
|
|
|
916
946
|
static from(buffer) {
|
|
917
947
|
// Slice up wire data
|
|
918
948
|
let byteArray = [...buffer];
|
|
919
|
-
const numRequiredSignatures = byteArray
|
|
949
|
+
const numRequiredSignatures = guardedShift(byteArray);
|
|
920
950
|
|
|
921
951
|
if (numRequiredSignatures !== (numRequiredSignatures & VERSION_PREFIX_MASK)) {
|
|
922
952
|
throw new Error('Versioned messages must be deserialized with VersionedMessage.deserialize()');
|
|
923
953
|
}
|
|
924
954
|
|
|
925
|
-
const numReadonlySignedAccounts = byteArray
|
|
926
|
-
const numReadonlyUnsignedAccounts = byteArray
|
|
955
|
+
const numReadonlySignedAccounts = guardedShift(byteArray);
|
|
956
|
+
const numReadonlyUnsignedAccounts = guardedShift(byteArray);
|
|
927
957
|
const accountCount = decodeLength(byteArray);
|
|
928
958
|
let accountKeys = [];
|
|
929
959
|
|
|
930
960
|
for (let i = 0; i < accountCount; i++) {
|
|
931
|
-
const account = byteArray
|
|
932
|
-
byteArray = byteArray.slice(PUBLIC_KEY_LENGTH);
|
|
961
|
+
const account = guardedSplice(byteArray, 0, PUBLIC_KEY_LENGTH);
|
|
933
962
|
accountKeys.push(new PublicKey(Buffer.from(account)));
|
|
934
963
|
}
|
|
935
964
|
|
|
936
|
-
const recentBlockhash = byteArray
|
|
937
|
-
byteArray = byteArray.slice(PUBLIC_KEY_LENGTH);
|
|
965
|
+
const recentBlockhash = guardedSplice(byteArray, 0, PUBLIC_KEY_LENGTH);
|
|
938
966
|
const instructionCount = decodeLength(byteArray);
|
|
939
967
|
let instructions = [];
|
|
940
968
|
|
|
941
969
|
for (let i = 0; i < instructionCount; i++) {
|
|
942
|
-
const programIdIndex = byteArray
|
|
970
|
+
const programIdIndex = guardedShift(byteArray);
|
|
943
971
|
const accountCount = decodeLength(byteArray);
|
|
944
|
-
const accounts = byteArray
|
|
945
|
-
byteArray = byteArray.slice(accountCount);
|
|
972
|
+
const accounts = guardedSplice(byteArray, 0, accountCount);
|
|
946
973
|
const dataLength = decodeLength(byteArray);
|
|
947
|
-
const dataSlice = byteArray
|
|
974
|
+
const dataSlice = guardedSplice(byteArray, 0, dataLength);
|
|
948
975
|
const data = bs58.encode(Buffer.from(dataSlice));
|
|
949
|
-
byteArray = byteArray.slice(dataLength);
|
|
950
976
|
instructions.push({
|
|
951
977
|
programIdIndex,
|
|
952
978
|
accounts,
|
|
@@ -1182,33 +1208,33 @@ class MessageV0 {
|
|
|
1182
1208
|
|
|
1183
1209
|
static deserialize(serializedMessage) {
|
|
1184
1210
|
let byteArray = [...serializedMessage];
|
|
1185
|
-
const prefix = byteArray
|
|
1211
|
+
const prefix = guardedShift(byteArray);
|
|
1186
1212
|
const maskedPrefix = prefix & VERSION_PREFIX_MASK;
|
|
1187
1213
|
assert(prefix !== maskedPrefix, `Expected versioned message but received legacy message`);
|
|
1188
1214
|
const version = maskedPrefix;
|
|
1189
1215
|
assert(version === 0, `Expected versioned message with version 0 but found version ${version}`);
|
|
1190
1216
|
const header = {
|
|
1191
|
-
numRequiredSignatures: byteArray
|
|
1192
|
-
numReadonlySignedAccounts: byteArray
|
|
1193
|
-
numReadonlyUnsignedAccounts: byteArray
|
|
1217
|
+
numRequiredSignatures: guardedShift(byteArray),
|
|
1218
|
+
numReadonlySignedAccounts: guardedShift(byteArray),
|
|
1219
|
+
numReadonlyUnsignedAccounts: guardedShift(byteArray)
|
|
1194
1220
|
};
|
|
1195
1221
|
const staticAccountKeys = [];
|
|
1196
1222
|
const staticAccountKeysLength = decodeLength(byteArray);
|
|
1197
1223
|
|
|
1198
1224
|
for (let i = 0; i < staticAccountKeysLength; i++) {
|
|
1199
|
-
staticAccountKeys.push(new PublicKey(byteArray
|
|
1225
|
+
staticAccountKeys.push(new PublicKey(guardedSplice(byteArray, 0, PUBLIC_KEY_LENGTH)));
|
|
1200
1226
|
}
|
|
1201
1227
|
|
|
1202
|
-
const recentBlockhash = bs58.encode(byteArray
|
|
1228
|
+
const recentBlockhash = bs58.encode(guardedSplice(byteArray, 0, PUBLIC_KEY_LENGTH));
|
|
1203
1229
|
const instructionCount = decodeLength(byteArray);
|
|
1204
1230
|
const compiledInstructions = [];
|
|
1205
1231
|
|
|
1206
1232
|
for (let i = 0; i < instructionCount; i++) {
|
|
1207
|
-
const programIdIndex = byteArray
|
|
1233
|
+
const programIdIndex = guardedShift(byteArray);
|
|
1208
1234
|
const accountKeyIndexesLength = decodeLength(byteArray);
|
|
1209
|
-
const accountKeyIndexes = byteArray
|
|
1235
|
+
const accountKeyIndexes = guardedSplice(byteArray, 0, accountKeyIndexesLength);
|
|
1210
1236
|
const dataLength = decodeLength(byteArray);
|
|
1211
|
-
const data = new Uint8Array(byteArray
|
|
1237
|
+
const data = new Uint8Array(guardedSplice(byteArray, 0, dataLength));
|
|
1212
1238
|
compiledInstructions.push({
|
|
1213
1239
|
programIdIndex,
|
|
1214
1240
|
accountKeyIndexes,
|
|
@@ -1220,11 +1246,11 @@ class MessageV0 {
|
|
|
1220
1246
|
const addressTableLookups = [];
|
|
1221
1247
|
|
|
1222
1248
|
for (let i = 0; i < addressTableLookupsCount; i++) {
|
|
1223
|
-
const accountKey = new PublicKey(byteArray
|
|
1249
|
+
const accountKey = new PublicKey(guardedSplice(byteArray, 0, PUBLIC_KEY_LENGTH));
|
|
1224
1250
|
const writableIndexesLength = decodeLength(byteArray);
|
|
1225
|
-
const writableIndexes = byteArray
|
|
1251
|
+
const writableIndexes = guardedSplice(byteArray, 0, writableIndexesLength);
|
|
1226
1252
|
const readonlyIndexesLength = decodeLength(byteArray);
|
|
1227
|
-
const readonlyIndexes = byteArray
|
|
1253
|
+
const readonlyIndexes = guardedSplice(byteArray, 0, readonlyIndexesLength);
|
|
1228
1254
|
addressTableLookups.push({
|
|
1229
1255
|
accountKey,
|
|
1230
1256
|
writableIndexes,
|
|
@@ -1964,8 +1990,7 @@ class Transaction {
|
|
|
1964
1990
|
let signatures = [];
|
|
1965
1991
|
|
|
1966
1992
|
for (let i = 0; i < signatureCount; i++) {
|
|
1967
|
-
const signature = byteArray
|
|
1968
|
-
byteArray = byteArray.slice(SIGNATURE_LENGTH_IN_BYTES);
|
|
1993
|
+
const signature = guardedSplice(byteArray, 0, SIGNATURE_LENGTH_IN_BYTES);
|
|
1969
1994
|
signatures.push(bs58.encode(Buffer.from(signature)));
|
|
1970
1995
|
}
|
|
1971
1996
|
|
|
@@ -2163,7 +2188,7 @@ class VersionedTransaction {
|
|
|
2163
2188
|
const signaturesLength = decodeLength(byteArray);
|
|
2164
2189
|
|
|
2165
2190
|
for (let i = 0; i < signaturesLength; i++) {
|
|
2166
|
-
signatures.push(new Uint8Array(byteArray
|
|
2191
|
+
signatures.push(new Uint8Array(guardedSplice(byteArray, 0, SIGNATURE_LENGTH_IN_BYTES)));
|
|
2167
2192
|
}
|
|
2168
2193
|
|
|
2169
2194
|
const message = VersionedMessage.deserialize(new Uint8Array(byteArray));
|
|
@@ -3336,7 +3361,7 @@ var y = d * 365.25;
|
|
|
3336
3361
|
* @api public
|
|
3337
3362
|
*/
|
|
3338
3363
|
|
|
3339
|
-
var ms$
|
|
3364
|
+
var ms$3 = function (val, options) {
|
|
3340
3365
|
options = options || {};
|
|
3341
3366
|
var type = typeof val;
|
|
3342
3367
|
if (type === 'string' && val.length > 0) {
|
|
@@ -3485,11 +3510,11 @@ function plural(ms, msAbs, n, name) {
|
|
|
3485
3510
|
*/
|
|
3486
3511
|
|
|
3487
3512
|
var util = require$$0;
|
|
3488
|
-
var ms$
|
|
3513
|
+
var ms$2 = ms$3;
|
|
3489
3514
|
|
|
3490
3515
|
var humanizeMs = function (t) {
|
|
3491
3516
|
if (typeof t === 'number') return t;
|
|
3492
|
-
var r = ms$
|
|
3517
|
+
var r = ms$2(t);
|
|
3493
3518
|
if (r === undefined) {
|
|
3494
3519
|
var err = new Error(util.format('humanize-ms(%j) result undefined', t));
|
|
3495
3520
|
console.warn(err.stack);
|
|
@@ -3501,6 +3526,177 @@ var src = {exports: {}};
|
|
|
3501
3526
|
|
|
3502
3527
|
var browser = {exports: {}};
|
|
3503
3528
|
|
|
3529
|
+
/**
|
|
3530
|
+
* Helpers.
|
|
3531
|
+
*/
|
|
3532
|
+
|
|
3533
|
+
var ms$1;
|
|
3534
|
+
var hasRequiredMs;
|
|
3535
|
+
|
|
3536
|
+
function requireMs () {
|
|
3537
|
+
if (hasRequiredMs) return ms$1;
|
|
3538
|
+
hasRequiredMs = 1;
|
|
3539
|
+
var s = 1000;
|
|
3540
|
+
var m = s * 60;
|
|
3541
|
+
var h = m * 60;
|
|
3542
|
+
var d = h * 24;
|
|
3543
|
+
var w = d * 7;
|
|
3544
|
+
var y = d * 365.25;
|
|
3545
|
+
|
|
3546
|
+
/**
|
|
3547
|
+
* Parse or format the given `val`.
|
|
3548
|
+
*
|
|
3549
|
+
* Options:
|
|
3550
|
+
*
|
|
3551
|
+
* - `long` verbose formatting [false]
|
|
3552
|
+
*
|
|
3553
|
+
* @param {String|Number} val
|
|
3554
|
+
* @param {Object} [options]
|
|
3555
|
+
* @throws {Error} throw an error if val is not a non-empty string or a number
|
|
3556
|
+
* @return {String|Number}
|
|
3557
|
+
* @api public
|
|
3558
|
+
*/
|
|
3559
|
+
|
|
3560
|
+
ms$1 = function(val, options) {
|
|
3561
|
+
options = options || {};
|
|
3562
|
+
var type = typeof val;
|
|
3563
|
+
if (type === 'string' && val.length > 0) {
|
|
3564
|
+
return parse(val);
|
|
3565
|
+
} else if (type === 'number' && isFinite(val)) {
|
|
3566
|
+
return options.long ? fmtLong(val) : fmtShort(val);
|
|
3567
|
+
}
|
|
3568
|
+
throw new Error(
|
|
3569
|
+
'val is not a non-empty string or a valid number. val=' +
|
|
3570
|
+
JSON.stringify(val)
|
|
3571
|
+
);
|
|
3572
|
+
};
|
|
3573
|
+
|
|
3574
|
+
/**
|
|
3575
|
+
* Parse the given `str` and return milliseconds.
|
|
3576
|
+
*
|
|
3577
|
+
* @param {String} str
|
|
3578
|
+
* @return {Number}
|
|
3579
|
+
* @api private
|
|
3580
|
+
*/
|
|
3581
|
+
|
|
3582
|
+
function parse(str) {
|
|
3583
|
+
str = String(str);
|
|
3584
|
+
if (str.length > 100) {
|
|
3585
|
+
return;
|
|
3586
|
+
}
|
|
3587
|
+
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
|
3588
|
+
str
|
|
3589
|
+
);
|
|
3590
|
+
if (!match) {
|
|
3591
|
+
return;
|
|
3592
|
+
}
|
|
3593
|
+
var n = parseFloat(match[1]);
|
|
3594
|
+
var type = (match[2] || 'ms').toLowerCase();
|
|
3595
|
+
switch (type) {
|
|
3596
|
+
case 'years':
|
|
3597
|
+
case 'year':
|
|
3598
|
+
case 'yrs':
|
|
3599
|
+
case 'yr':
|
|
3600
|
+
case 'y':
|
|
3601
|
+
return n * y;
|
|
3602
|
+
case 'weeks':
|
|
3603
|
+
case 'week':
|
|
3604
|
+
case 'w':
|
|
3605
|
+
return n * w;
|
|
3606
|
+
case 'days':
|
|
3607
|
+
case 'day':
|
|
3608
|
+
case 'd':
|
|
3609
|
+
return n * d;
|
|
3610
|
+
case 'hours':
|
|
3611
|
+
case 'hour':
|
|
3612
|
+
case 'hrs':
|
|
3613
|
+
case 'hr':
|
|
3614
|
+
case 'h':
|
|
3615
|
+
return n * h;
|
|
3616
|
+
case 'minutes':
|
|
3617
|
+
case 'minute':
|
|
3618
|
+
case 'mins':
|
|
3619
|
+
case 'min':
|
|
3620
|
+
case 'm':
|
|
3621
|
+
return n * m;
|
|
3622
|
+
case 'seconds':
|
|
3623
|
+
case 'second':
|
|
3624
|
+
case 'secs':
|
|
3625
|
+
case 'sec':
|
|
3626
|
+
case 's':
|
|
3627
|
+
return n * s;
|
|
3628
|
+
case 'milliseconds':
|
|
3629
|
+
case 'millisecond':
|
|
3630
|
+
case 'msecs':
|
|
3631
|
+
case 'msec':
|
|
3632
|
+
case 'ms':
|
|
3633
|
+
return n;
|
|
3634
|
+
default:
|
|
3635
|
+
return undefined;
|
|
3636
|
+
}
|
|
3637
|
+
}
|
|
3638
|
+
|
|
3639
|
+
/**
|
|
3640
|
+
* Short format for `ms`.
|
|
3641
|
+
*
|
|
3642
|
+
* @param {Number} ms
|
|
3643
|
+
* @return {String}
|
|
3644
|
+
* @api private
|
|
3645
|
+
*/
|
|
3646
|
+
|
|
3647
|
+
function fmtShort(ms) {
|
|
3648
|
+
var msAbs = Math.abs(ms);
|
|
3649
|
+
if (msAbs >= d) {
|
|
3650
|
+
return Math.round(ms / d) + 'd';
|
|
3651
|
+
}
|
|
3652
|
+
if (msAbs >= h) {
|
|
3653
|
+
return Math.round(ms / h) + 'h';
|
|
3654
|
+
}
|
|
3655
|
+
if (msAbs >= m) {
|
|
3656
|
+
return Math.round(ms / m) + 'm';
|
|
3657
|
+
}
|
|
3658
|
+
if (msAbs >= s) {
|
|
3659
|
+
return Math.round(ms / s) + 's';
|
|
3660
|
+
}
|
|
3661
|
+
return ms + 'ms';
|
|
3662
|
+
}
|
|
3663
|
+
|
|
3664
|
+
/**
|
|
3665
|
+
* Long format for `ms`.
|
|
3666
|
+
*
|
|
3667
|
+
* @param {Number} ms
|
|
3668
|
+
* @return {String}
|
|
3669
|
+
* @api private
|
|
3670
|
+
*/
|
|
3671
|
+
|
|
3672
|
+
function fmtLong(ms) {
|
|
3673
|
+
var msAbs = Math.abs(ms);
|
|
3674
|
+
if (msAbs >= d) {
|
|
3675
|
+
return plural(ms, msAbs, d, 'day');
|
|
3676
|
+
}
|
|
3677
|
+
if (msAbs >= h) {
|
|
3678
|
+
return plural(ms, msAbs, h, 'hour');
|
|
3679
|
+
}
|
|
3680
|
+
if (msAbs >= m) {
|
|
3681
|
+
return plural(ms, msAbs, m, 'minute');
|
|
3682
|
+
}
|
|
3683
|
+
if (msAbs >= s) {
|
|
3684
|
+
return plural(ms, msAbs, s, 'second');
|
|
3685
|
+
}
|
|
3686
|
+
return ms + ' ms';
|
|
3687
|
+
}
|
|
3688
|
+
|
|
3689
|
+
/**
|
|
3690
|
+
* Pluralization helper.
|
|
3691
|
+
*/
|
|
3692
|
+
|
|
3693
|
+
function plural(ms, msAbs, n, name) {
|
|
3694
|
+
var isPlural = msAbs >= n * 1.5;
|
|
3695
|
+
return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
|
|
3696
|
+
}
|
|
3697
|
+
return ms$1;
|
|
3698
|
+
}
|
|
3699
|
+
|
|
3504
3700
|
var common;
|
|
3505
3701
|
var hasRequiredCommon;
|
|
3506
3702
|
|
|
@@ -3519,7 +3715,7 @@ function requireCommon () {
|
|
|
3519
3715
|
createDebug.disable = disable;
|
|
3520
3716
|
createDebug.enable = enable;
|
|
3521
3717
|
createDebug.enabled = enabled;
|
|
3522
|
-
createDebug.humanize =
|
|
3718
|
+
createDebug.humanize = requireMs();
|
|
3523
3719
|
createDebug.destroy = destroy;
|
|
3524
3720
|
|
|
3525
3721
|
Object.keys(env).forEach(key => {
|
|
@@ -4070,12 +4266,12 @@ var hasRequiredHasFlag;
|
|
|
4070
4266
|
function requireHasFlag () {
|
|
4071
4267
|
if (hasRequiredHasFlag) return hasFlag;
|
|
4072
4268
|
hasRequiredHasFlag = 1;
|
|
4073
|
-
|
|
4074
|
-
|
|
4269
|
+
|
|
4270
|
+
hasFlag = (flag, argv = process.argv) => {
|
|
4075
4271
|
const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
|
|
4076
|
-
const
|
|
4077
|
-
const
|
|
4078
|
-
return
|
|
4272
|
+
const position = argv.indexOf(prefix + flag);
|
|
4273
|
+
const terminatorPosition = argv.indexOf('--');
|
|
4274
|
+
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
4079
4275
|
};
|
|
4080
4276
|
return hasFlag;
|
|
4081
4277
|
}
|
|
@@ -4087,23 +4283,32 @@ function requireSupportsColor () {
|
|
|
4087
4283
|
if (hasRequiredSupportsColor) return supportsColor_1;
|
|
4088
4284
|
hasRequiredSupportsColor = 1;
|
|
4089
4285
|
const os = require$$0$1;
|
|
4286
|
+
const tty = require$$1;
|
|
4090
4287
|
const hasFlag = requireHasFlag();
|
|
4091
4288
|
|
|
4092
|
-
const env = process
|
|
4289
|
+
const {env} = process;
|
|
4093
4290
|
|
|
4094
4291
|
let forceColor;
|
|
4095
4292
|
if (hasFlag('no-color') ||
|
|
4096
4293
|
hasFlag('no-colors') ||
|
|
4097
|
-
hasFlag('color=false')
|
|
4098
|
-
|
|
4294
|
+
hasFlag('color=false') ||
|
|
4295
|
+
hasFlag('color=never')) {
|
|
4296
|
+
forceColor = 0;
|
|
4099
4297
|
} else if (hasFlag('color') ||
|
|
4100
4298
|
hasFlag('colors') ||
|
|
4101
4299
|
hasFlag('color=true') ||
|
|
4102
4300
|
hasFlag('color=always')) {
|
|
4103
|
-
forceColor =
|
|
4301
|
+
forceColor = 1;
|
|
4104
4302
|
}
|
|
4303
|
+
|
|
4105
4304
|
if ('FORCE_COLOR' in env) {
|
|
4106
|
-
|
|
4305
|
+
if (env.FORCE_COLOR === 'true') {
|
|
4306
|
+
forceColor = 1;
|
|
4307
|
+
} else if (env.FORCE_COLOR === 'false') {
|
|
4308
|
+
forceColor = 0;
|
|
4309
|
+
} else {
|
|
4310
|
+
forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
|
|
4311
|
+
}
|
|
4107
4312
|
}
|
|
4108
4313
|
|
|
4109
4314
|
function translateLevel(level) {
|
|
@@ -4119,8 +4324,8 @@ function requireSupportsColor () {
|
|
|
4119
4324
|
};
|
|
4120
4325
|
}
|
|
4121
4326
|
|
|
4122
|
-
function supportsColor(
|
|
4123
|
-
if (forceColor ===
|
|
4327
|
+
function supportsColor(haveStream, streamIsTTY) {
|
|
4328
|
+
if (forceColor === 0) {
|
|
4124
4329
|
return 0;
|
|
4125
4330
|
}
|
|
4126
4331
|
|
|
@@ -4134,22 +4339,21 @@ function requireSupportsColor () {
|
|
|
4134
4339
|
return 2;
|
|
4135
4340
|
}
|
|
4136
4341
|
|
|
4137
|
-
if (
|
|
4342
|
+
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
|
4138
4343
|
return 0;
|
|
4139
4344
|
}
|
|
4140
4345
|
|
|
4141
|
-
const min = forceColor
|
|
4346
|
+
const min = forceColor || 0;
|
|
4347
|
+
|
|
4348
|
+
if (env.TERM === 'dumb') {
|
|
4349
|
+
return min;
|
|
4350
|
+
}
|
|
4142
4351
|
|
|
4143
4352
|
if (process.platform === 'win32') {
|
|
4144
|
-
//
|
|
4145
|
-
//
|
|
4146
|
-
// won't work. However, here we target Node.js 8 at minimum as it is an LTS
|
|
4147
|
-
// release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows
|
|
4148
|
-
// release that supports 256 colors. Windows 10 build 14931 is the first release
|
|
4149
|
-
// that supports 16m/TrueColor.
|
|
4353
|
+
// Windows 10 build 10586 is the first Windows release that supports 256 colors.
|
|
4354
|
+
// Windows 10 build 14931 is the first release that supports 16m/TrueColor.
|
|
4150
4355
|
const osRelease = os.release().split('.');
|
|
4151
4356
|
if (
|
|
4152
|
-
Number(process.versions.node.split('.')[0]) >= 8 &&
|
|
4153
4357
|
Number(osRelease[0]) >= 10 &&
|
|
4154
4358
|
Number(osRelease[2]) >= 10586
|
|
4155
4359
|
) {
|
|
@@ -4160,7 +4364,7 @@ function requireSupportsColor () {
|
|
|
4160
4364
|
}
|
|
4161
4365
|
|
|
4162
4366
|
if ('CI' in env) {
|
|
4163
|
-
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
|
|
4367
|
+
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
|
|
4164
4368
|
return 1;
|
|
4165
4369
|
}
|
|
4166
4370
|
|
|
@@ -4199,22 +4403,18 @@ function requireSupportsColor () {
|
|
|
4199
4403
|
return 1;
|
|
4200
4404
|
}
|
|
4201
4405
|
|
|
4202
|
-
if (env.TERM === 'dumb') {
|
|
4203
|
-
return min;
|
|
4204
|
-
}
|
|
4205
|
-
|
|
4206
4406
|
return min;
|
|
4207
4407
|
}
|
|
4208
4408
|
|
|
4209
4409
|
function getSupportLevel(stream) {
|
|
4210
|
-
const level = supportsColor(stream);
|
|
4410
|
+
const level = supportsColor(stream, stream && stream.isTTY);
|
|
4211
4411
|
return translateLevel(level);
|
|
4212
4412
|
}
|
|
4213
4413
|
|
|
4214
4414
|
supportsColor_1 = {
|
|
4215
4415
|
supportsColor: getSupportLevel,
|
|
4216
|
-
stdout:
|
|
4217
|
-
stderr:
|
|
4416
|
+
stdout: translateLevel(supportsColor(true, tty.isatty(1))),
|
|
4417
|
+
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
|
|
4218
4418
|
};
|
|
4219
4419
|
return supportsColor_1;
|
|
4220
4420
|
}
|
|
@@ -4229,7 +4429,7 @@ function requireNode () {
|
|
|
4229
4429
|
if (hasRequiredNode) return node.exports;
|
|
4230
4430
|
hasRequiredNode = 1;
|
|
4231
4431
|
(function (module, exports) {
|
|
4232
|
-
const tty = require$$
|
|
4432
|
+
const tty = require$$1;
|
|
4233
4433
|
const util = require$$0;
|
|
4234
4434
|
|
|
4235
4435
|
/**
|
|
@@ -4661,7 +4861,7 @@ function requireEventListenerCount () {
|
|
|
4661
4861
|
* @private
|
|
4662
4862
|
*/
|
|
4663
4863
|
|
|
4664
|
-
var EventEmitter = require$$0$
|
|
4864
|
+
var EventEmitter = require$$0$2.EventEmitter;
|
|
4665
4865
|
|
|
4666
4866
|
/**
|
|
4667
4867
|
* Module exports.
|
|
@@ -4741,7 +4941,7 @@ function requireEventListenerCount () {
|
|
|
4741
4941
|
|
|
4742
4942
|
var callSiteToString = compat.exports.callSiteToString;
|
|
4743
4943
|
var eventListenerCount = compat.exports.eventListenerCount;
|
|
4744
|
-
var relative = require$$1.relative;
|
|
4944
|
+
var relative = require$$1$1.relative;
|
|
4745
4945
|
|
|
4746
4946
|
/**
|
|
4747
4947
|
* Module exports.
|
|
@@ -5264,7 +5464,7 @@ var constants = {
|
|
|
5264
5464
|
SOCKET_REQUEST_FINISHED_COUNT: Symbol('agentkeepalive#socketRequestFinishedCount'),
|
|
5265
5465
|
};
|
|
5266
5466
|
|
|
5267
|
-
const OriginalAgent = require$$0$
|
|
5467
|
+
const OriginalAgent = require$$0$3.Agent;
|
|
5268
5468
|
const ms = humanizeMs;
|
|
5269
5469
|
const debug = src.exports('agentkeepalive');
|
|
5270
5470
|
const deprecate = depd_1('agentkeepalive');
|
|
@@ -5661,7 +5861,7 @@ function inspect(obj) {
|
|
|
5661
5861
|
return res;
|
|
5662
5862
|
}
|
|
5663
5863
|
|
|
5664
|
-
const OriginalHttpsAgent = require$$0$
|
|
5864
|
+
const OriginalHttpsAgent = require$$0$4.Agent;
|
|
5665
5865
|
const HttpAgent = agent;
|
|
5666
5866
|
const {
|
|
5667
5867
|
INIT_SOCKET,
|
|
@@ -7124,7 +7324,7 @@ const LogsNotificationResult = type({
|
|
|
7124
7324
|
|
|
7125
7325
|
/** @internal */
|
|
7126
7326
|
const COMMON_HTTP_HEADERS = {
|
|
7127
|
-
'solana-client': `js/${(_process$env$npm_pack = "
|
|
7327
|
+
'solana-client': `js/${(_process$env$npm_pack = "1.70.4") !== null && _process$env$npm_pack !== void 0 ? _process$env$npm_pack : 'UNKNOWN'}`
|
|
7128
7328
|
};
|
|
7129
7329
|
/**
|
|
7130
7330
|
* A connection to a fullnode JSON RPC endpoint
|
|
@@ -12542,10 +12742,8 @@ class ValidatorInfo {
|
|
|
12542
12742
|
const configKeys = [];
|
|
12543
12743
|
|
|
12544
12744
|
for (let i = 0; i < 2; i++) {
|
|
12545
|
-
const publicKey = new PublicKey(byteArray
|
|
12546
|
-
|
|
12547
|
-
const isSigner = byteArray.slice(0, 1)[0] === 1;
|
|
12548
|
-
byteArray = byteArray.slice(1);
|
|
12745
|
+
const publicKey = new PublicKey(guardedSplice(byteArray, 0, PUBLIC_KEY_LENGTH));
|
|
12746
|
+
const isSigner = guardedShift(byteArray) === 1;
|
|
12549
12747
|
configKeys.push({
|
|
12550
12748
|
publicKey,
|
|
12551
12749
|
isSigner
|