@solana/web3.js 1.10.0 → 1.10.2
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.esm.js +50 -19
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +50 -19
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.esm.js +50 -19
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +773 -660
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +4 -4
- package/lib/index.iife.min.js.map +1 -1
- package/package.json +28 -28
- package/src/message.ts +9 -12
- package/src/publickey.ts +4 -1
- package/src/transaction.ts +2 -2
- package/src/util/guarded-array-utils.ts +37 -0
- package/src/validator-info.ts +5 -4
package/lib/index.iife.js
CHANGED
|
@@ -18,15 +18,12 @@ var solanaWeb3 = (function (exports) {
|
|
|
18
18
|
return a;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
function createCommonjsModule(fn) {
|
|
22
|
-
var module = { exports: {} };
|
|
23
|
-
return fn(module, module.exports), module.exports;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
21
|
function commonjsRequire (path) {
|
|
27
22
|
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
28
23
|
}
|
|
29
24
|
|
|
25
|
+
var naclFast = {exports: {}};
|
|
26
|
+
|
|
30
27
|
var _nodeResolve_empty = {};
|
|
31
28
|
|
|
32
29
|
var _nodeResolve_empty$1 = /*#__PURE__*/Object.freeze({
|
|
@@ -34,9 +31,9 @@ var solanaWeb3 = (function (exports) {
|
|
|
34
31
|
'default': _nodeResolve_empty
|
|
35
32
|
});
|
|
36
33
|
|
|
37
|
-
var require$$0$
|
|
34
|
+
var require$$0$2 = /*@__PURE__*/getAugmentedNamespace(_nodeResolve_empty$1);
|
|
38
35
|
|
|
39
|
-
|
|
36
|
+
(function (module) {
|
|
40
37
|
(function(nacl) {
|
|
41
38
|
|
|
42
39
|
// Ported in 2014 by Dmitry Chestnykh and Devi Mandiri.
|
|
@@ -2415,7 +2412,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
2415
2412
|
});
|
|
2416
2413
|
} else if (typeof commonjsRequire !== 'undefined') {
|
|
2417
2414
|
// Node.js.
|
|
2418
|
-
crypto = require$$0$
|
|
2415
|
+
crypto = require$$0$2;
|
|
2419
2416
|
if (crypto && crypto.randomBytes) {
|
|
2420
2417
|
nacl.setPRNG(function(x, n) {
|
|
2421
2418
|
var i, v = crypto.randomBytes(n);
|
|
@@ -2427,11 +2424,17 @@ var solanaWeb3 = (function (exports) {
|
|
|
2427
2424
|
})();
|
|
2428
2425
|
|
|
2429
2426
|
})(module.exports ? module.exports : (self.nacl = self.nacl || {}));
|
|
2430
|
-
});
|
|
2427
|
+
}(naclFast));
|
|
2428
|
+
|
|
2429
|
+
var nacl = naclFast.exports;
|
|
2431
2430
|
|
|
2432
|
-
var
|
|
2433
|
-
|
|
2434
|
-
var
|
|
2431
|
+
var buffer = {};
|
|
2432
|
+
|
|
2433
|
+
var base64Js = {};
|
|
2434
|
+
|
|
2435
|
+
base64Js.byteLength = byteLength;
|
|
2436
|
+
base64Js.toByteArray = toByteArray;
|
|
2437
|
+
base64Js.fromByteArray = fromByteArray;
|
|
2435
2438
|
|
|
2436
2439
|
var lookup = [];
|
|
2437
2440
|
var revLookup = [];
|
|
@@ -2580,14 +2583,11 @@ var solanaWeb3 = (function (exports) {
|
|
|
2580
2583
|
return parts.join('')
|
|
2581
2584
|
}
|
|
2582
2585
|
|
|
2583
|
-
var
|
|
2584
|
-
byteLength: byteLength_1,
|
|
2585
|
-
toByteArray: toByteArray_1,
|
|
2586
|
-
fromByteArray: fromByteArray_1
|
|
2587
|
-
};
|
|
2586
|
+
var ieee754 = {};
|
|
2588
2587
|
|
|
2589
2588
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
2590
|
-
|
|
2589
|
+
|
|
2590
|
+
ieee754.read = function (buffer, offset, isLE, mLen, nBytes) {
|
|
2591
2591
|
var e, m;
|
|
2592
2592
|
var eLen = (nBytes * 8) - mLen - 1;
|
|
2593
2593
|
var eMax = (1 << eLen) - 1;
|
|
@@ -2620,7 +2620,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
2620
2620
|
return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
|
|
2621
2621
|
};
|
|
2622
2622
|
|
|
2623
|
-
|
|
2623
|
+
ieee754.write = function (buffer, value, offset, isLE, mLen, nBytes) {
|
|
2624
2624
|
var e, m, c;
|
|
2625
2625
|
var eLen = (nBytes * 8) - mLen - 1;
|
|
2626
2626
|
var eMax = (1 << eLen) - 1;
|
|
@@ -2672,11 +2672,6 @@ var solanaWeb3 = (function (exports) {
|
|
|
2672
2672
|
buffer[offset + i - d] |= s * 128;
|
|
2673
2673
|
};
|
|
2674
2674
|
|
|
2675
|
-
var ieee754 = {
|
|
2676
|
-
read: read,
|
|
2677
|
-
write: write
|
|
2678
|
-
};
|
|
2679
|
-
|
|
2680
2675
|
/*!
|
|
2681
2676
|
* The buffer module from node.js, for the browser.
|
|
2682
2677
|
*
|
|
@@ -2684,10 +2679,10 @@ var solanaWeb3 = (function (exports) {
|
|
|
2684
2679
|
* @license MIT
|
|
2685
2680
|
*/
|
|
2686
2681
|
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2682
|
+
(function (exports) {
|
|
2690
2683
|
|
|
2684
|
+
const base64 = base64Js;
|
|
2685
|
+
const ieee754$1 = ieee754;
|
|
2691
2686
|
const customInspectSymbol =
|
|
2692
2687
|
(typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation
|
|
2693
2688
|
? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation
|
|
@@ -3621,9 +3616,9 @@ var solanaWeb3 = (function (exports) {
|
|
|
3621
3616
|
|
|
3622
3617
|
function base64Slice (buf, start, end) {
|
|
3623
3618
|
if (start === 0 && end === buf.length) {
|
|
3624
|
-
return
|
|
3619
|
+
return base64.fromByteArray(buf)
|
|
3625
3620
|
} else {
|
|
3626
|
-
return
|
|
3621
|
+
return base64.fromByteArray(buf.slice(start, end))
|
|
3627
3622
|
}
|
|
3628
3623
|
}
|
|
3629
3624
|
|
|
@@ -4047,25 +4042,25 @@ var solanaWeb3 = (function (exports) {
|
|
|
4047
4042
|
Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
|
|
4048
4043
|
offset = offset >>> 0;
|
|
4049
4044
|
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
4050
|
-
return ieee754.read(this, offset, true, 23, 4)
|
|
4045
|
+
return ieee754$1.read(this, offset, true, 23, 4)
|
|
4051
4046
|
};
|
|
4052
4047
|
|
|
4053
4048
|
Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
|
|
4054
4049
|
offset = offset >>> 0;
|
|
4055
4050
|
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
4056
|
-
return ieee754.read(this, offset, false, 23, 4)
|
|
4051
|
+
return ieee754$1.read(this, offset, false, 23, 4)
|
|
4057
4052
|
};
|
|
4058
4053
|
|
|
4059
4054
|
Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
|
|
4060
4055
|
offset = offset >>> 0;
|
|
4061
4056
|
if (!noAssert) checkOffset(offset, 8, this.length);
|
|
4062
|
-
return ieee754.read(this, offset, true, 52, 8)
|
|
4057
|
+
return ieee754$1.read(this, offset, true, 52, 8)
|
|
4063
4058
|
};
|
|
4064
4059
|
|
|
4065
4060
|
Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
|
|
4066
4061
|
offset = offset >>> 0;
|
|
4067
4062
|
if (!noAssert) checkOffset(offset, 8, this.length);
|
|
4068
|
-
return ieee754.read(this, offset, false, 52, 8)
|
|
4063
|
+
return ieee754$1.read(this, offset, false, 52, 8)
|
|
4069
4064
|
};
|
|
4070
4065
|
|
|
4071
4066
|
function checkInt (buf, value, offset, ext, max, min) {
|
|
@@ -4334,7 +4329,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
4334
4329
|
if (!noAssert) {
|
|
4335
4330
|
checkIEEE754(buf, value, offset, 4);
|
|
4336
4331
|
}
|
|
4337
|
-
ieee754.write(buf, value, offset, littleEndian, 23, 4);
|
|
4332
|
+
ieee754$1.write(buf, value, offset, littleEndian, 23, 4);
|
|
4338
4333
|
return offset + 4
|
|
4339
4334
|
}
|
|
4340
4335
|
|
|
@@ -4352,7 +4347,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
4352
4347
|
if (!noAssert) {
|
|
4353
4348
|
checkIEEE754(buf, value, offset, 8);
|
|
4354
4349
|
}
|
|
4355
|
-
ieee754.write(buf, value, offset, littleEndian, 52, 8);
|
|
4350
|
+
ieee754$1.write(buf, value, offset, littleEndian, 52, 8);
|
|
4356
4351
|
return offset + 8
|
|
4357
4352
|
}
|
|
4358
4353
|
|
|
@@ -4735,7 +4730,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
4735
4730
|
}
|
|
4736
4731
|
|
|
4737
4732
|
function base64ToBytes (str) {
|
|
4738
|
-
return
|
|
4733
|
+
return base64.toByteArray(base64clean(str))
|
|
4739
4734
|
}
|
|
4740
4735
|
|
|
4741
4736
|
function blitBuffer (src, dst, offset, length) {
|
|
@@ -4782,7 +4777,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
4782
4777
|
function BufferBigIntNotDefined () {
|
|
4783
4778
|
throw new Error('BigInt not supported')
|
|
4784
4779
|
}
|
|
4785
|
-
});
|
|
4780
|
+
}(buffer));
|
|
4786
4781
|
|
|
4787
4782
|
const toBuffer = arr => {
|
|
4788
4783
|
if (arr instanceof buffer.Buffer) {
|
|
@@ -4809,7 +4804,9 @@ var solanaWeb3 = (function (exports) {
|
|
|
4809
4804
|
return obj;
|
|
4810
4805
|
}
|
|
4811
4806
|
|
|
4812
|
-
var bn =
|
|
4807
|
+
var bn = {exports: {}};
|
|
4808
|
+
|
|
4809
|
+
(function (module) {
|
|
4813
4810
|
(function (module, exports) {
|
|
4814
4811
|
|
|
4815
4812
|
// Utils
|
|
@@ -4864,7 +4861,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
4864
4861
|
if (typeof window !== 'undefined' && typeof window.Buffer !== 'undefined') {
|
|
4865
4862
|
Buffer = window.Buffer;
|
|
4866
4863
|
} else {
|
|
4867
|
-
Buffer = require$$0$
|
|
4864
|
+
Buffer = require$$0$2.Buffer;
|
|
4868
4865
|
}
|
|
4869
4866
|
} catch (e) {
|
|
4870
4867
|
}
|
|
@@ -8158,12 +8155,17 @@ var solanaWeb3 = (function (exports) {
|
|
|
8158
8155
|
return res._forceRed(this);
|
|
8159
8156
|
};
|
|
8160
8157
|
})(module, commonjsGlobal);
|
|
8161
|
-
});
|
|
8158
|
+
}(bn));
|
|
8159
|
+
|
|
8160
|
+
var BN$9 = bn.exports;
|
|
8161
|
+
|
|
8162
|
+
var safeBuffer = {exports: {}};
|
|
8162
8163
|
|
|
8163
8164
|
/* eslint-disable node/no-deprecated-api */
|
|
8164
8165
|
|
|
8165
|
-
|
|
8166
|
-
var
|
|
8166
|
+
(function (module, exports) {
|
|
8167
|
+
var buffer$1 = buffer;
|
|
8168
|
+
var Buffer = buffer$1.Buffer;
|
|
8167
8169
|
|
|
8168
8170
|
// alternative to using Object.keys for old browsers
|
|
8169
8171
|
function copyProps (src, dst) {
|
|
@@ -8172,10 +8174,10 @@ var solanaWeb3 = (function (exports) {
|
|
|
8172
8174
|
}
|
|
8173
8175
|
}
|
|
8174
8176
|
if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
|
|
8175
|
-
module.exports = buffer;
|
|
8177
|
+
module.exports = buffer$1;
|
|
8176
8178
|
} else {
|
|
8177
8179
|
// Copy properties from require('buffer')
|
|
8178
|
-
copyProps(buffer, exports);
|
|
8180
|
+
copyProps(buffer$1, exports);
|
|
8179
8181
|
exports.Buffer = SafeBuffer;
|
|
8180
8182
|
}
|
|
8181
8183
|
|
|
@@ -8221,9 +8223,9 @@ var solanaWeb3 = (function (exports) {
|
|
|
8221
8223
|
if (typeof size !== 'number') {
|
|
8222
8224
|
throw new TypeError('Argument must be a number')
|
|
8223
8225
|
}
|
|
8224
|
-
return buffer.SlowBuffer(size)
|
|
8226
|
+
return buffer$1.SlowBuffer(size)
|
|
8225
8227
|
};
|
|
8226
|
-
});
|
|
8228
|
+
}(safeBuffer, safeBuffer.exports));
|
|
8227
8229
|
|
|
8228
8230
|
// base-x encoding
|
|
8229
8231
|
// Forked from https://github.com/cryptocoinjs/bs58
|
|
@@ -8233,7 +8235,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
8233
8235
|
// Merged Buffer refactorings from base58-native by Stephen Pair
|
|
8234
8236
|
// Copyright (c) 2013 BitPay Inc
|
|
8235
8237
|
|
|
8236
|
-
var Buffer = safeBuffer.Buffer;
|
|
8238
|
+
var Buffer = safeBuffer.exports.Buffer;
|
|
8237
8239
|
|
|
8238
8240
|
var baseX = function base (ALPHABET) {
|
|
8239
8241
|
var ALPHABET_MAP = {};
|
|
@@ -8318,9 +8320,10 @@ var solanaWeb3 = (function (exports) {
|
|
|
8318
8320
|
}
|
|
8319
8321
|
};
|
|
8320
8322
|
|
|
8323
|
+
var basex = baseX;
|
|
8321
8324
|
var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
8322
8325
|
|
|
8323
|
-
var bs58 =
|
|
8326
|
+
var bs58 = basex(ALPHABET);
|
|
8324
8327
|
|
|
8325
8328
|
/* eslint-env browser */
|
|
8326
8329
|
|
|
@@ -8370,7 +8373,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
8370
8373
|
|
|
8371
8374
|
return options.outputFormat === 'hex' ? bufferToHex(hash) : hash;
|
|
8372
8375
|
};
|
|
8373
|
-
var sha256
|
|
8376
|
+
var sha256 = create$1('SHA-256');
|
|
8374
8377
|
|
|
8375
8378
|
/**
|
|
8376
8379
|
* Maximum length of derived pubkey seed
|
|
@@ -8397,9 +8400,9 @@ var solanaWeb3 = (function (exports) {
|
|
|
8397
8400
|
throw new Error("Invalid public key input");
|
|
8398
8401
|
}
|
|
8399
8402
|
|
|
8400
|
-
this._bn = new
|
|
8403
|
+
this._bn = new BN$9(decoded);
|
|
8401
8404
|
} else {
|
|
8402
|
-
this._bn = new
|
|
8405
|
+
this._bn = new BN$9(value);
|
|
8403
8406
|
}
|
|
8404
8407
|
|
|
8405
8408
|
if (this._bn.byteLength() > 32) {
|
|
@@ -8464,7 +8467,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
8464
8467
|
|
|
8465
8468
|
static async createWithSeed(fromPublicKey, seed, programId) {
|
|
8466
8469
|
const buffer$1 = buffer.Buffer.concat([fromPublicKey.toBuffer(), buffer.Buffer.from(seed), programId.toBuffer()]);
|
|
8467
|
-
const hash = await sha256
|
|
8470
|
+
const hash = await sha256(new Uint8Array(buffer$1));
|
|
8468
8471
|
return new PublicKey(buffer.Buffer.from(hash, 'hex'));
|
|
8469
8472
|
}
|
|
8470
8473
|
/**
|
|
@@ -8476,14 +8479,14 @@ var solanaWeb3 = (function (exports) {
|
|
|
8476
8479
|
let buffer$1 = buffer.Buffer.alloc(0);
|
|
8477
8480
|
seeds.forEach(function (seed) {
|
|
8478
8481
|
if (seed.length > MAX_SEED_LENGTH) {
|
|
8479
|
-
throw new
|
|
8482
|
+
throw new TypeError("Max seed length exceeded");
|
|
8480
8483
|
}
|
|
8481
8484
|
|
|
8482
8485
|
buffer$1 = buffer.Buffer.concat([buffer$1, toBuffer(seed)]);
|
|
8483
8486
|
});
|
|
8484
8487
|
buffer$1 = buffer.Buffer.concat([buffer$1, programId.toBuffer(), buffer.Buffer.from('ProgramDerivedAddress')]);
|
|
8485
|
-
let hash = await sha256
|
|
8486
|
-
let publicKeyBytes = new
|
|
8488
|
+
let hash = await sha256(new Uint8Array(buffer$1));
|
|
8489
|
+
let publicKeyBytes = new BN$9(hash, 16).toArray(undefined, 32);
|
|
8487
8490
|
|
|
8488
8491
|
if (is_on_curve(publicKeyBytes)) {
|
|
8489
8492
|
throw new Error("Invalid seeds, address must fall off the curve");
|
|
@@ -8509,6 +8512,10 @@ var solanaWeb3 = (function (exports) {
|
|
|
8509
8512
|
const seedsWithNonce = seeds.concat(buffer.Buffer.from([nonce]));
|
|
8510
8513
|
address = await this.createProgramAddress(seedsWithNonce, programId);
|
|
8511
8514
|
} catch (err) {
|
|
8515
|
+
if (err instanceof TypeError) {
|
|
8516
|
+
throw err;
|
|
8517
|
+
}
|
|
8518
|
+
|
|
8512
8519
|
nonce--;
|
|
8513
8520
|
continue;
|
|
8514
8521
|
}
|
|
@@ -8531,7 +8538,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
8531
8538
|
|
|
8532
8539
|
_defineProperty(PublicKey, "default", new PublicKey('11111111111111111111111111111111'));
|
|
8533
8540
|
|
|
8534
|
-
let naclLowLevel =
|
|
8541
|
+
let naclLowLevel = nacl.lowlevel; // Check that a pubkey is on the curve.
|
|
8535
8542
|
// This function and its dependents were sourced from:
|
|
8536
8543
|
// https://github.com/dchest/tweetnacl-js/blob/f1ec050ceae0861f34280e62498b1d3ed9c350c6/nacl.js#L792
|
|
8537
8544
|
|
|
@@ -8599,9 +8606,9 @@ var solanaWeb3 = (function (exports) {
|
|
|
8599
8606
|
*/
|
|
8600
8607
|
constructor(secretKey) {
|
|
8601
8608
|
if (secretKey) {
|
|
8602
|
-
this._keypair = naclFast.sign.keyPair.fromSecretKey(toBuffer(secretKey));
|
|
8609
|
+
this._keypair = naclFast.exports.sign.keyPair.fromSecretKey(toBuffer(secretKey));
|
|
8603
8610
|
} else {
|
|
8604
|
-
this._keypair = naclFast.sign.keyPair();
|
|
8611
|
+
this._keypair = naclFast.exports.sign.keyPair();
|
|
8605
8612
|
}
|
|
8606
8613
|
}
|
|
8607
8614
|
/**
|
|
@@ -8851,9 +8858,9 @@ var solanaWeb3 = (function (exports) {
|
|
|
8851
8858
|
uptime: uptime
|
|
8852
8859
|
};
|
|
8853
8860
|
|
|
8854
|
-
var inherits$
|
|
8861
|
+
var inherits$5;
|
|
8855
8862
|
if (typeof Object.create === 'function'){
|
|
8856
|
-
inherits$
|
|
8863
|
+
inherits$5 = function inherits(ctor, superCtor) {
|
|
8857
8864
|
// implementation from standard node.js 'util' module
|
|
8858
8865
|
ctor.super_ = superCtor;
|
|
8859
8866
|
ctor.prototype = Object.create(superCtor.prototype, {
|
|
@@ -8866,7 +8873,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
8866
8873
|
});
|
|
8867
8874
|
};
|
|
8868
8875
|
} else {
|
|
8869
|
-
inherits$
|
|
8876
|
+
inherits$5 = function inherits(ctor, superCtor) {
|
|
8870
8877
|
ctor.super_ = superCtor;
|
|
8871
8878
|
var TempCtor = function () {};
|
|
8872
8879
|
TempCtor.prototype = superCtor.prototype;
|
|
@@ -8874,7 +8881,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
8874
8881
|
ctor.prototype.constructor = ctor;
|
|
8875
8882
|
};
|
|
8876
8883
|
}
|
|
8877
|
-
var inherits$
|
|
8884
|
+
var inherits$6 = inherits$5;
|
|
8878
8885
|
|
|
8879
8886
|
/**
|
|
8880
8887
|
* Echos the value of a value. Trys to print the value out
|
|
@@ -9353,7 +9360,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
9353
9360
|
// AssertionError's when particular conditions are not met. The
|
|
9354
9361
|
// assert module must conform to the following interface.
|
|
9355
9362
|
|
|
9356
|
-
function assert$
|
|
9363
|
+
function assert$j(value, message) {
|
|
9357
9364
|
if (!value) fail(value, true, message, '==', ok);
|
|
9358
9365
|
}
|
|
9359
9366
|
|
|
@@ -9375,7 +9382,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
9375
9382
|
var match = str.match(regex);
|
|
9376
9383
|
return match && match[1];
|
|
9377
9384
|
}
|
|
9378
|
-
assert$
|
|
9385
|
+
assert$j.AssertionError = AssertionError;
|
|
9379
9386
|
function AssertionError(options) {
|
|
9380
9387
|
this.name = 'AssertionError';
|
|
9381
9388
|
this.actual = options.actual;
|
|
@@ -9413,7 +9420,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
9413
9420
|
}
|
|
9414
9421
|
|
|
9415
9422
|
// assert.AssertionError instanceof Error
|
|
9416
|
-
inherits$
|
|
9423
|
+
inherits$6(AssertionError, Error);
|
|
9417
9424
|
|
|
9418
9425
|
function truncate(s, n) {
|
|
9419
9426
|
if (typeof s === 'string') {
|
|
@@ -9458,7 +9465,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
9458
9465
|
}
|
|
9459
9466
|
|
|
9460
9467
|
// EXTENSION! allows for well behaved errors defined elsewhere.
|
|
9461
|
-
assert$
|
|
9468
|
+
assert$j.fail = fail;
|
|
9462
9469
|
|
|
9463
9470
|
// 4. Pure assertion tests whether a value is truthy, as determined
|
|
9464
9471
|
// by !!guard.
|
|
@@ -9470,19 +9477,19 @@ var solanaWeb3 = (function (exports) {
|
|
|
9470
9477
|
function ok(value, message) {
|
|
9471
9478
|
if (!value) fail(value, true, message, '==', ok);
|
|
9472
9479
|
}
|
|
9473
|
-
assert$
|
|
9480
|
+
assert$j.ok = ok;
|
|
9474
9481
|
|
|
9475
9482
|
// 5. The equality assertion tests shallow, coercive equality with
|
|
9476
9483
|
// ==.
|
|
9477
9484
|
// assert.equal(actual, expected, message_opt);
|
|
9478
|
-
assert$
|
|
9485
|
+
assert$j.equal = equal;
|
|
9479
9486
|
function equal(actual, expected, message) {
|
|
9480
9487
|
if (actual != expected) fail(actual, expected, message, '==', equal);
|
|
9481
9488
|
}
|
|
9482
9489
|
|
|
9483
9490
|
// 6. The non-equality assertion tests for whether two objects are not equal
|
|
9484
9491
|
// with != assert.notEqual(actual, expected, message_opt);
|
|
9485
|
-
assert$
|
|
9492
|
+
assert$j.notEqual = notEqual;
|
|
9486
9493
|
function notEqual(actual, expected, message) {
|
|
9487
9494
|
if (actual == expected) {
|
|
9488
9495
|
fail(actual, expected, message, '!=', notEqual);
|
|
@@ -9491,13 +9498,13 @@ var solanaWeb3 = (function (exports) {
|
|
|
9491
9498
|
|
|
9492
9499
|
// 7. The equivalence assertion tests a deep equality relation.
|
|
9493
9500
|
// assert.deepEqual(actual, expected, message_opt);
|
|
9494
|
-
assert$
|
|
9501
|
+
assert$j.deepEqual = deepEqual;
|
|
9495
9502
|
function deepEqual(actual, expected, message) {
|
|
9496
9503
|
if (!_deepEqual(actual, expected, false)) {
|
|
9497
9504
|
fail(actual, expected, message, 'deepEqual', deepEqual);
|
|
9498
9505
|
}
|
|
9499
9506
|
}
|
|
9500
|
-
assert$
|
|
9507
|
+
assert$j.deepStrictEqual = deepStrictEqual;
|
|
9501
9508
|
function deepStrictEqual(actual, expected, message) {
|
|
9502
9509
|
if (!_deepEqual(actual, expected, true)) {
|
|
9503
9510
|
fail(actual, expected, message, 'deepStrictEqual', deepStrictEqual);
|
|
@@ -9618,14 +9625,14 @@ var solanaWeb3 = (function (exports) {
|
|
|
9618
9625
|
|
|
9619
9626
|
// 8. The non-equivalence assertion tests for any deep inequality.
|
|
9620
9627
|
// assert.notDeepEqual(actual, expected, message_opt);
|
|
9621
|
-
assert$
|
|
9628
|
+
assert$j.notDeepEqual = notDeepEqual;
|
|
9622
9629
|
function notDeepEqual(actual, expected, message) {
|
|
9623
9630
|
if (_deepEqual(actual, expected, false)) {
|
|
9624
9631
|
fail(actual, expected, message, 'notDeepEqual', notDeepEqual);
|
|
9625
9632
|
}
|
|
9626
9633
|
}
|
|
9627
9634
|
|
|
9628
|
-
assert$
|
|
9635
|
+
assert$j.notDeepStrictEqual = notDeepStrictEqual;
|
|
9629
9636
|
function notDeepStrictEqual(actual, expected, message) {
|
|
9630
9637
|
if (_deepEqual(actual, expected, true)) {
|
|
9631
9638
|
fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual);
|
|
@@ -9635,7 +9642,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
9635
9642
|
|
|
9636
9643
|
// 9. The strict equality assertion tests strict equality, as determined by ===.
|
|
9637
9644
|
// assert.strictEqual(actual, expected, message_opt);
|
|
9638
|
-
assert$
|
|
9645
|
+
assert$j.strictEqual = strictEqual;
|
|
9639
9646
|
function strictEqual(actual, expected, message) {
|
|
9640
9647
|
if (actual !== expected) {
|
|
9641
9648
|
fail(actual, expected, message, '===', strictEqual);
|
|
@@ -9644,7 +9651,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
9644
9651
|
|
|
9645
9652
|
// 10. The strict non-equality assertion tests for strict inequality, as
|
|
9646
9653
|
// determined by !==. assert.notStrictEqual(actual, expected, message_opt);
|
|
9647
|
-
assert$
|
|
9654
|
+
assert$j.notStrictEqual = notStrictEqual;
|
|
9648
9655
|
function notStrictEqual(actual, expected, message) {
|
|
9649
9656
|
if (actual === expected) {
|
|
9650
9657
|
fail(actual, expected, message, '!==', notStrictEqual);
|
|
@@ -9725,25 +9732,25 @@ var solanaWeb3 = (function (exports) {
|
|
|
9725
9732
|
|
|
9726
9733
|
// 11. Expected to throw an error:
|
|
9727
9734
|
// assert.throws(block, Error_opt, message_opt);
|
|
9728
|
-
assert$
|
|
9735
|
+
assert$j.throws = throws;
|
|
9729
9736
|
function throws(block, /*optional*/error, /*optional*/message) {
|
|
9730
9737
|
_throws(true, block, error, message);
|
|
9731
9738
|
}
|
|
9732
9739
|
|
|
9733
9740
|
// EXTENSION! This is annoying to write outside this module.
|
|
9734
|
-
assert$
|
|
9741
|
+
assert$j.doesNotThrow = doesNotThrow;
|
|
9735
9742
|
function doesNotThrow(block, /*optional*/error, /*optional*/message) {
|
|
9736
9743
|
_throws(false, block, error, message);
|
|
9737
9744
|
}
|
|
9738
9745
|
|
|
9739
|
-
assert$
|
|
9746
|
+
assert$j.ifError = ifError;
|
|
9740
9747
|
function ifError(err) {
|
|
9741
9748
|
if (err) throw err;
|
|
9742
9749
|
}
|
|
9743
9750
|
|
|
9744
|
-
var assert$
|
|
9751
|
+
var assert$k = /*#__PURE__*/Object.freeze({
|
|
9745
9752
|
__proto__: null,
|
|
9746
|
-
'default': assert$
|
|
9753
|
+
'default': assert$j,
|
|
9747
9754
|
AssertionError: AssertionError,
|
|
9748
9755
|
fail: fail,
|
|
9749
9756
|
ok: ok,
|
|
@@ -9761,7 +9768,9 @@ var solanaWeb3 = (function (exports) {
|
|
|
9761
9768
|
ifError: ifError
|
|
9762
9769
|
});
|
|
9763
9770
|
|
|
9764
|
-
var
|
|
9771
|
+
var require$$0$1 = /*@__PURE__*/getAugmentedNamespace(assert$k);
|
|
9772
|
+
|
|
9773
|
+
const assert$i = require$$0$1;
|
|
9765
9774
|
|
|
9766
9775
|
/**
|
|
9767
9776
|
* Base class for layout objects.
|
|
@@ -10491,7 +10500,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
10491
10500
|
/* By construction the field must be fixed-length (because
|
|
10492
10501
|
* unnamed variable-length fields are disallowed when
|
|
10493
10502
|
* encoding). But check it anyway. */
|
|
10494
|
-
assert$
|
|
10503
|
+
assert$i(0 < span);
|
|
10495
10504
|
} else {
|
|
10496
10505
|
const fv = src[fd.property];
|
|
10497
10506
|
if (undefined !== fv) {
|
|
@@ -10785,6 +10794,36 @@ var solanaWeb3 = (function (exports) {
|
|
|
10785
10794
|
}
|
|
10786
10795
|
}
|
|
10787
10796
|
|
|
10797
|
+
const END_OF_BUFFER_ERROR_MESSAGE = 'Reached end of buffer unexpectedly';
|
|
10798
|
+
/**
|
|
10799
|
+
* Delegates to `Array#shift`, but throws if the array is zero-length.
|
|
10800
|
+
*/
|
|
10801
|
+
|
|
10802
|
+
function guardedShift(byteArray) {
|
|
10803
|
+
if (byteArray.length === 0) {
|
|
10804
|
+
throw new Error(END_OF_BUFFER_ERROR_MESSAGE);
|
|
10805
|
+
}
|
|
10806
|
+
|
|
10807
|
+
return byteArray.shift();
|
|
10808
|
+
}
|
|
10809
|
+
/**
|
|
10810
|
+
* Delegates to `Array#splice`, but throws if the section being spliced out extends past the end of
|
|
10811
|
+
* the array.
|
|
10812
|
+
*/
|
|
10813
|
+
|
|
10814
|
+
function guardedSplice(byteArray, ...args) {
|
|
10815
|
+
var _args$;
|
|
10816
|
+
|
|
10817
|
+
const [start] = args;
|
|
10818
|
+
|
|
10819
|
+
if (args.length === 2 // Implies that `deleteCount` was supplied
|
|
10820
|
+
? start + ((_args$ = args[1]) !== null && _args$ !== void 0 ? _args$ : 0) > byteArray.length : start >= byteArray.length) {
|
|
10821
|
+
throw new Error(END_OF_BUFFER_ERROR_MESSAGE);
|
|
10822
|
+
}
|
|
10823
|
+
|
|
10824
|
+
return byteArray.splice(...args);
|
|
10825
|
+
}
|
|
10826
|
+
|
|
10788
10827
|
/**
|
|
10789
10828
|
* The message header, identifying signed and read-only account
|
|
10790
10829
|
*/
|
|
@@ -10861,32 +10900,28 @@ var solanaWeb3 = (function (exports) {
|
|
|
10861
10900
|
static from(buffer$1) {
|
|
10862
10901
|
// Slice up wire data
|
|
10863
10902
|
let byteArray = [...buffer$1];
|
|
10864
|
-
const numRequiredSignatures = byteArray
|
|
10865
|
-
const numReadonlySignedAccounts = byteArray
|
|
10866
|
-
const numReadonlyUnsignedAccounts = byteArray
|
|
10903
|
+
const numRequiredSignatures = guardedShift(byteArray);
|
|
10904
|
+
const numReadonlySignedAccounts = guardedShift(byteArray);
|
|
10905
|
+
const numReadonlyUnsignedAccounts = guardedShift(byteArray);
|
|
10867
10906
|
const accountCount = decodeLength(byteArray);
|
|
10868
10907
|
let accountKeys = [];
|
|
10869
10908
|
|
|
10870
10909
|
for (let i = 0; i < accountCount; i++) {
|
|
10871
|
-
const account = byteArray
|
|
10872
|
-
byteArray = byteArray.slice(PUBKEY_LENGTH);
|
|
10910
|
+
const account = guardedSplice(byteArray, 0, PUBKEY_LENGTH);
|
|
10873
10911
|
accountKeys.push(bs58.encode(buffer.Buffer.from(account)));
|
|
10874
10912
|
}
|
|
10875
10913
|
|
|
10876
|
-
const recentBlockhash = byteArray
|
|
10877
|
-
byteArray = byteArray.slice(PUBKEY_LENGTH);
|
|
10914
|
+
const recentBlockhash = guardedSplice(byteArray, 0, PUBKEY_LENGTH);
|
|
10878
10915
|
const instructionCount = decodeLength(byteArray);
|
|
10879
10916
|
let instructions = [];
|
|
10880
10917
|
|
|
10881
10918
|
for (let i = 0; i < instructionCount; i++) {
|
|
10882
|
-
const programIdIndex = byteArray
|
|
10919
|
+
const programIdIndex = guardedShift(byteArray);
|
|
10883
10920
|
const accountCount = decodeLength(byteArray);
|
|
10884
|
-
const accounts = byteArray
|
|
10885
|
-
byteArray = byteArray.slice(accountCount);
|
|
10921
|
+
const accounts = guardedSplice(byteArray, 0, accountCount);
|
|
10886
10922
|
const dataLength = decodeLength(byteArray);
|
|
10887
|
-
const dataSlice = byteArray
|
|
10923
|
+
const dataSlice = guardedSplice(byteArray, 0, dataLength);
|
|
10888
10924
|
const data = bs58.encode(buffer.Buffer.from(dataSlice));
|
|
10889
|
-
byteArray = byteArray.slice(dataLength);
|
|
10890
10925
|
instructions.push({
|
|
10891
10926
|
programIdIndex,
|
|
10892
10927
|
accounts,
|
|
@@ -10909,6 +10944,10 @@ var solanaWeb3 = (function (exports) {
|
|
|
10909
10944
|
|
|
10910
10945
|
}
|
|
10911
10946
|
|
|
10947
|
+
/**
|
|
10948
|
+
* Transaction signature as base-58 encoded string
|
|
10949
|
+
*/
|
|
10950
|
+
|
|
10912
10951
|
/**
|
|
10913
10952
|
* Default (empty) signature
|
|
10914
10953
|
*
|
|
@@ -11174,8 +11213,8 @@ var solanaWeb3 = (function (exports) {
|
|
|
11174
11213
|
};
|
|
11175
11214
|
});
|
|
11176
11215
|
instructions.forEach(instruction => {
|
|
11177
|
-
assert$
|
|
11178
|
-
instruction.accounts.forEach(keyIndex => assert$
|
|
11216
|
+
assert$j(instruction.programIdIndex >= 0);
|
|
11217
|
+
instruction.accounts.forEach(keyIndex => assert$j(keyIndex >= 0));
|
|
11179
11218
|
});
|
|
11180
11219
|
return new Message({
|
|
11181
11220
|
header: {
|
|
@@ -11338,7 +11377,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
11338
11377
|
_partialSign(message, ...signers) {
|
|
11339
11378
|
const signData = message.serialize();
|
|
11340
11379
|
signers.forEach(signer => {
|
|
11341
|
-
const signature =
|
|
11380
|
+
const signature = nacl.sign.detached(signData, signer.secretKey);
|
|
11342
11381
|
|
|
11343
11382
|
this._addSignature(signer.publicKey, toBuffer(signature));
|
|
11344
11383
|
});
|
|
@@ -11362,7 +11401,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
11362
11401
|
|
|
11363
11402
|
|
|
11364
11403
|
_addSignature(pubkey, signature) {
|
|
11365
|
-
assert$
|
|
11404
|
+
assert$j(signature.length === 64);
|
|
11366
11405
|
const index = this.signatures.findIndex(sigpair => pubkey.equals(sigpair.publicKey));
|
|
11367
11406
|
|
|
11368
11407
|
if (index < 0) {
|
|
@@ -11394,7 +11433,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
11394
11433
|
return false;
|
|
11395
11434
|
}
|
|
11396
11435
|
} else {
|
|
11397
|
-
if (!
|
|
11436
|
+
if (!nacl.sign.detached.verify(signData, signature, publicKey.toBuffer())) {
|
|
11398
11437
|
return false;
|
|
11399
11438
|
}
|
|
11400
11439
|
}
|
|
@@ -11436,18 +11475,18 @@ var solanaWeb3 = (function (exports) {
|
|
|
11436
11475
|
encodeLength(signatureCount, signatures.length);
|
|
11437
11476
|
const transactionLength = signatureCount.length + signatures.length * 64 + signData.length;
|
|
11438
11477
|
const wireTransaction = buffer.Buffer.alloc(transactionLength);
|
|
11439
|
-
assert$
|
|
11478
|
+
assert$j(signatures.length < 256);
|
|
11440
11479
|
buffer.Buffer.from(signatureCount).copy(wireTransaction, 0);
|
|
11441
11480
|
signatures.forEach(({
|
|
11442
11481
|
signature
|
|
11443
11482
|
}, index) => {
|
|
11444
11483
|
if (signature !== null) {
|
|
11445
|
-
assert$
|
|
11484
|
+
assert$j(signature.length === 64, "signature has invalid length");
|
|
11446
11485
|
buffer.Buffer.from(signature).copy(wireTransaction, signatureCount.length + index * 64);
|
|
11447
11486
|
}
|
|
11448
11487
|
});
|
|
11449
11488
|
signData.copy(wireTransaction, signatureCount.length + signatures.length * 64);
|
|
11450
|
-
assert$
|
|
11489
|
+
assert$j(wireTransaction.length <= PACKET_DATA_SIZE, "Transaction too large: ".concat(wireTransaction.length, " > ").concat(PACKET_DATA_SIZE));
|
|
11451
11490
|
return wireTransaction;
|
|
11452
11491
|
}
|
|
11453
11492
|
/**
|
|
@@ -11457,7 +11496,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
11457
11496
|
|
|
11458
11497
|
|
|
11459
11498
|
get keys() {
|
|
11460
|
-
assert$
|
|
11499
|
+
assert$j(this.instructions.length === 1);
|
|
11461
11500
|
return this.instructions[0].keys.map(keyObj => keyObj.pubkey);
|
|
11462
11501
|
}
|
|
11463
11502
|
/**
|
|
@@ -11467,7 +11506,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
11467
11506
|
|
|
11468
11507
|
|
|
11469
11508
|
get programId() {
|
|
11470
|
-
assert$
|
|
11509
|
+
assert$j(this.instructions.length === 1);
|
|
11471
11510
|
return this.instructions[0].programId;
|
|
11472
11511
|
}
|
|
11473
11512
|
/**
|
|
@@ -11477,7 +11516,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
11477
11516
|
|
|
11478
11517
|
|
|
11479
11518
|
get data() {
|
|
11480
|
-
assert$
|
|
11519
|
+
assert$j(this.instructions.length === 1);
|
|
11481
11520
|
return this.instructions[0].data;
|
|
11482
11521
|
}
|
|
11483
11522
|
/**
|
|
@@ -11492,8 +11531,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
11492
11531
|
let signatures = [];
|
|
11493
11532
|
|
|
11494
11533
|
for (let i = 0; i < signatureCount; i++) {
|
|
11495
|
-
const signature = byteArray
|
|
11496
|
-
byteArray = byteArray.slice(SIGNATURE_LENGTH);
|
|
11534
|
+
const signature = guardedSplice(byteArray, 0, SIGNATURE_LENGTH);
|
|
11497
11535
|
signatures.push(bs58.encode(buffer.Buffer.from(signature)));
|
|
11498
11536
|
}
|
|
11499
11537
|
|
|
@@ -13687,7 +13725,9 @@ var solanaWeb3 = (function (exports) {
|
|
|
13687
13725
|
if (host) self.hostname = host;
|
|
13688
13726
|
}
|
|
13689
13727
|
|
|
13690
|
-
var browser$1 =
|
|
13728
|
+
var browser$1 = {exports: {}};
|
|
13729
|
+
|
|
13730
|
+
(function (module, exports) {
|
|
13691
13731
|
|
|
13692
13732
|
// ref: https://github.com/tc39/proposal-global
|
|
13693
13733
|
var getGlobal = function () {
|
|
@@ -13712,7 +13752,9 @@ var solanaWeb3 = (function (exports) {
|
|
|
13712
13752
|
exports.Headers = global.Headers;
|
|
13713
13753
|
exports.Request = global.Request;
|
|
13714
13754
|
exports.Response = global.Response;
|
|
13715
|
-
});
|
|
13755
|
+
}(browser$1, browser$1.exports));
|
|
13756
|
+
|
|
13757
|
+
var fetch = browser$1.exports;
|
|
13716
13758
|
|
|
13717
13759
|
/**
|
|
13718
13760
|
* A `StructFailure` represents a single specific failure in validation.
|
|
@@ -13958,7 +14000,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
13958
14000
|
|
|
13959
14001
|
|
|
13960
14002
|
assert(value) {
|
|
13961
|
-
return assert$
|
|
14003
|
+
return assert$h(value, this);
|
|
13962
14004
|
}
|
|
13963
14005
|
/**
|
|
13964
14006
|
* Create a value with the struct's coercion logic, then validate it.
|
|
@@ -14004,7 +14046,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
14004
14046
|
* Assert that a value passes a struct, throwing if it doesn't.
|
|
14005
14047
|
*/
|
|
14006
14048
|
|
|
14007
|
-
function assert$
|
|
14049
|
+
function assert$h(value, struct) {
|
|
14008
14050
|
const result = validate(value, struct);
|
|
14009
14051
|
|
|
14010
14052
|
if (result[0]) {
|
|
@@ -14324,7 +14366,11 @@ var solanaWeb3 = (function (exports) {
|
|
|
14324
14366
|
});
|
|
14325
14367
|
}
|
|
14326
14368
|
|
|
14327
|
-
var
|
|
14369
|
+
var index_browser = {};
|
|
14370
|
+
|
|
14371
|
+
var interopRequireDefault = {exports: {}};
|
|
14372
|
+
|
|
14373
|
+
(function (module) {
|
|
14328
14374
|
function _interopRequireDefault(obj) {
|
|
14329
14375
|
return obj && obj.__esModule ? obj : {
|
|
14330
14376
|
"default": obj
|
|
@@ -14333,9 +14379,11 @@ var solanaWeb3 = (function (exports) {
|
|
|
14333
14379
|
|
|
14334
14380
|
module.exports = _interopRequireDefault;
|
|
14335
14381
|
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
14336
|
-
});
|
|
14382
|
+
}(interopRequireDefault));
|
|
14337
14383
|
|
|
14338
|
-
var classCallCheck =
|
|
14384
|
+
var classCallCheck = {exports: {}};
|
|
14385
|
+
|
|
14386
|
+
(function (module) {
|
|
14339
14387
|
function _classCallCheck(instance, Constructor) {
|
|
14340
14388
|
if (!(instance instanceof Constructor)) {
|
|
14341
14389
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -14344,9 +14392,13 @@ var solanaWeb3 = (function (exports) {
|
|
|
14344
14392
|
|
|
14345
14393
|
module.exports = _classCallCheck;
|
|
14346
14394
|
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
14347
|
-
});
|
|
14395
|
+
}(classCallCheck));
|
|
14348
14396
|
|
|
14349
|
-
var
|
|
14397
|
+
var inherits$4 = {exports: {}};
|
|
14398
|
+
|
|
14399
|
+
var setPrototypeOf = {exports: {}};
|
|
14400
|
+
|
|
14401
|
+
(function (module) {
|
|
14350
14402
|
function _setPrototypeOf(o, p) {
|
|
14351
14403
|
module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
14352
14404
|
o.__proto__ = p;
|
|
@@ -14359,9 +14411,11 @@ var solanaWeb3 = (function (exports) {
|
|
|
14359
14411
|
|
|
14360
14412
|
module.exports = _setPrototypeOf;
|
|
14361
14413
|
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
14362
|
-
});
|
|
14414
|
+
}(setPrototypeOf));
|
|
14415
|
+
|
|
14416
|
+
(function (module) {
|
|
14417
|
+
var setPrototypeOf$1 = setPrototypeOf.exports;
|
|
14363
14418
|
|
|
14364
|
-
var inherits = createCommonjsModule(function (module) {
|
|
14365
14419
|
function _inherits(subClass, superClass) {
|
|
14366
14420
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
14367
14421
|
throw new TypeError("Super expression must either be null or a function");
|
|
@@ -14374,14 +14428,18 @@ var solanaWeb3 = (function (exports) {
|
|
|
14374
14428
|
configurable: true
|
|
14375
14429
|
}
|
|
14376
14430
|
});
|
|
14377
|
-
if (superClass) setPrototypeOf(subClass, superClass);
|
|
14431
|
+
if (superClass) setPrototypeOf$1(subClass, superClass);
|
|
14378
14432
|
}
|
|
14379
14433
|
|
|
14380
14434
|
module.exports = _inherits;
|
|
14381
14435
|
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
14382
|
-
});
|
|
14436
|
+
}(inherits$4));
|
|
14437
|
+
|
|
14438
|
+
var possibleConstructorReturn = {exports: {}};
|
|
14439
|
+
|
|
14440
|
+
var _typeof = {exports: {}};
|
|
14383
14441
|
|
|
14384
|
-
|
|
14442
|
+
(function (module) {
|
|
14385
14443
|
function _typeof(obj) {
|
|
14386
14444
|
"@babel/helpers - typeof";
|
|
14387
14445
|
|
|
@@ -14404,9 +14462,11 @@ var solanaWeb3 = (function (exports) {
|
|
|
14404
14462
|
|
|
14405
14463
|
module.exports = _typeof;
|
|
14406
14464
|
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
14407
|
-
});
|
|
14465
|
+
}(_typeof));
|
|
14466
|
+
|
|
14467
|
+
var assertThisInitialized = {exports: {}};
|
|
14408
14468
|
|
|
14409
|
-
|
|
14469
|
+
(function (module) {
|
|
14410
14470
|
function _assertThisInitialized(self) {
|
|
14411
14471
|
if (self === void 0) {
|
|
14412
14472
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
@@ -14417,26 +14477,28 @@ var solanaWeb3 = (function (exports) {
|
|
|
14417
14477
|
|
|
14418
14478
|
module.exports = _assertThisInitialized;
|
|
14419
14479
|
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
14420
|
-
});
|
|
14421
|
-
|
|
14422
|
-
var possibleConstructorReturn = createCommonjsModule(function (module) {
|
|
14423
|
-
var _typeof = _typeof_1["default"];
|
|
14480
|
+
}(assertThisInitialized));
|
|
14424
14481
|
|
|
14482
|
+
(function (module) {
|
|
14483
|
+
var _typeof$1 = _typeof.exports["default"];
|
|
14425
14484
|
|
|
14485
|
+
var assertThisInitialized$1 = assertThisInitialized.exports;
|
|
14426
14486
|
|
|
14427
14487
|
function _possibleConstructorReturn(self, call) {
|
|
14428
|
-
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
14488
|
+
if (call && (_typeof$1(call) === "object" || typeof call === "function")) {
|
|
14429
14489
|
return call;
|
|
14430
14490
|
}
|
|
14431
14491
|
|
|
14432
|
-
return assertThisInitialized(self);
|
|
14492
|
+
return assertThisInitialized$1(self);
|
|
14433
14493
|
}
|
|
14434
14494
|
|
|
14435
14495
|
module.exports = _possibleConstructorReturn;
|
|
14436
14496
|
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
14437
|
-
});
|
|
14497
|
+
}(possibleConstructorReturn));
|
|
14498
|
+
|
|
14499
|
+
var getPrototypeOf = {exports: {}};
|
|
14438
14500
|
|
|
14439
|
-
|
|
14501
|
+
(function (module) {
|
|
14440
14502
|
function _getPrototypeOf(o) {
|
|
14441
14503
|
module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
14442
14504
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
@@ -14447,9 +14509,13 @@ var solanaWeb3 = (function (exports) {
|
|
|
14447
14509
|
|
|
14448
14510
|
module.exports = _getPrototypeOf;
|
|
14449
14511
|
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
14450
|
-
});
|
|
14512
|
+
}(getPrototypeOf));
|
|
14513
|
+
|
|
14514
|
+
var websocket_browser = {};
|
|
14515
|
+
|
|
14516
|
+
var createClass = {exports: {}};
|
|
14451
14517
|
|
|
14452
|
-
|
|
14518
|
+
(function (module) {
|
|
14453
14519
|
function _defineProperties(target, props) {
|
|
14454
14520
|
for (var i = 0; i < props.length; i++) {
|
|
14455
14521
|
var descriptor = props[i];
|
|
@@ -14468,9 +14534,11 @@ var solanaWeb3 = (function (exports) {
|
|
|
14468
14534
|
|
|
14469
14535
|
module.exports = _createClass;
|
|
14470
14536
|
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
14471
|
-
});
|
|
14537
|
+
}(createClass));
|
|
14538
|
+
|
|
14539
|
+
var eventemitter3 = {exports: {}};
|
|
14472
14540
|
|
|
14473
|
-
|
|
14541
|
+
(function (module) {
|
|
14474
14542
|
|
|
14475
14543
|
var has = Object.prototype.hasOwnProperty
|
|
14476
14544
|
, prefix = '~';
|
|
@@ -14806,33 +14874,33 @@ var solanaWeb3 = (function (exports) {
|
|
|
14806
14874
|
{
|
|
14807
14875
|
module.exports = EventEmitter;
|
|
14808
14876
|
}
|
|
14809
|
-
});
|
|
14877
|
+
}(eventemitter3));
|
|
14810
14878
|
|
|
14811
14879
|
/**
|
|
14812
14880
|
* WebSocket implements a browser-side WebSocket specification.
|
|
14813
14881
|
* @module Client
|
|
14814
14882
|
*/
|
|
14815
14883
|
|
|
14816
|
-
|
|
14817
|
-
|
|
14884
|
+
(function (exports) {
|
|
14818
14885
|
|
|
14886
|
+
var _interopRequireDefault = interopRequireDefault.exports;
|
|
14819
14887
|
|
|
14820
14888
|
Object.defineProperty(exports, "__esModule", {
|
|
14821
14889
|
value: true
|
|
14822
14890
|
});
|
|
14823
14891
|
exports["default"] = _default;
|
|
14824
14892
|
|
|
14825
|
-
var _classCallCheck2 =
|
|
14893
|
+
var _classCallCheck2 = _interopRequireDefault(classCallCheck.exports);
|
|
14826
14894
|
|
|
14827
|
-
var _createClass2 =
|
|
14895
|
+
var _createClass2 = _interopRequireDefault(createClass.exports);
|
|
14828
14896
|
|
|
14829
|
-
var _inherits2 =
|
|
14897
|
+
var _inherits2 = _interopRequireDefault(inherits$4.exports);
|
|
14830
14898
|
|
|
14831
|
-
var _possibleConstructorReturn2 =
|
|
14832
|
-
|
|
14833
|
-
var _getPrototypeOf2 = interopRequireDefault(getPrototypeOf);
|
|
14899
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(possibleConstructorReturn.exports);
|
|
14834
14900
|
|
|
14901
|
+
var _getPrototypeOf2 = _interopRequireDefault(getPrototypeOf.exports);
|
|
14835
14902
|
|
|
14903
|
+
var _eventemitter = eventemitter3.exports;
|
|
14836
14904
|
|
|
14837
14905
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
14838
14906
|
|
|
@@ -14918,7 +14986,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
14918
14986
|
}
|
|
14919
14987
|
}]);
|
|
14920
14988
|
return WebSocketBrowserImpl;
|
|
14921
|
-
}(
|
|
14989
|
+
}(_eventemitter.EventEmitter);
|
|
14922
14990
|
/**
|
|
14923
14991
|
* factory method for common WebSocket instance
|
|
14924
14992
|
* @method
|
|
@@ -14931,7 +14999,11 @@ var solanaWeb3 = (function (exports) {
|
|
|
14931
14999
|
function _default(address, options) {
|
|
14932
15000
|
return new WebSocketBrowserImpl(address, options);
|
|
14933
15001
|
}
|
|
14934
|
-
});
|
|
15002
|
+
}(websocket_browser));
|
|
15003
|
+
|
|
15004
|
+
var client = {};
|
|
15005
|
+
|
|
15006
|
+
var runtime = {exports: {}};
|
|
14935
15007
|
|
|
14936
15008
|
/**
|
|
14937
15009
|
* Copyright (c) 2014-present, Facebook, Inc.
|
|
@@ -14940,7 +15012,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
14940
15012
|
* LICENSE file in the root directory of this source tree.
|
|
14941
15013
|
*/
|
|
14942
15014
|
|
|
14943
|
-
|
|
15015
|
+
(function (module) {
|
|
14944
15016
|
var runtime = (function (exports) {
|
|
14945
15017
|
|
|
14946
15018
|
var Op = Object.prototype;
|
|
@@ -15681,11 +15753,13 @@ var solanaWeb3 = (function (exports) {
|
|
|
15681
15753
|
// problems, please detail your unique predicament in a GitHub issue.
|
|
15682
15754
|
Function("r", "regeneratorRuntime = r")(runtime);
|
|
15683
15755
|
}
|
|
15684
|
-
});
|
|
15756
|
+
}(runtime));
|
|
15685
15757
|
|
|
15686
|
-
var regenerator =
|
|
15758
|
+
var regenerator = runtime.exports;
|
|
15687
15759
|
|
|
15688
|
-
var asyncToGenerator =
|
|
15760
|
+
var asyncToGenerator = {exports: {}};
|
|
15761
|
+
|
|
15762
|
+
(function (module) {
|
|
15689
15763
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
15690
15764
|
try {
|
|
15691
15765
|
var info = gen[key](arg);
|
|
@@ -15724,7 +15798,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
15724
15798
|
|
|
15725
15799
|
module.exports = _asyncToGenerator;
|
|
15726
15800
|
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
15727
|
-
});
|
|
15801
|
+
}(asyncToGenerator));
|
|
15728
15802
|
|
|
15729
15803
|
/*!
|
|
15730
15804
|
Copyright (C) 2013-2017 by Andrea Giammarchi - @WebReflection
|
|
@@ -15748,6 +15822,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
15748
15822
|
THE SOFTWARE.
|
|
15749
15823
|
|
|
15750
15824
|
*/
|
|
15825
|
+
|
|
15751
15826
|
var
|
|
15752
15827
|
// should be a not so common char
|
|
15753
15828
|
// possibly one JSON does not encode
|
|
@@ -15934,34 +16009,34 @@ var solanaWeb3 = (function (exports) {
|
|
|
15934
16009
|
|
|
15935
16010
|
var circularJson_node = CircularJSON;
|
|
15936
16011
|
|
|
15937
|
-
|
|
15938
|
-
|
|
16012
|
+
(function (exports) {
|
|
15939
16013
|
|
|
16014
|
+
var _interopRequireDefault = interopRequireDefault.exports;
|
|
15940
16015
|
|
|
15941
16016
|
Object.defineProperty(exports, "__esModule", {
|
|
15942
16017
|
value: true
|
|
15943
16018
|
});
|
|
15944
16019
|
exports["default"] = void 0;
|
|
15945
16020
|
|
|
15946
|
-
var _regenerator =
|
|
16021
|
+
var _regenerator = _interopRequireDefault(regenerator);
|
|
15947
16022
|
|
|
15948
|
-
var _asyncToGenerator2 =
|
|
16023
|
+
var _asyncToGenerator2 = _interopRequireDefault(asyncToGenerator.exports);
|
|
15949
16024
|
|
|
15950
|
-
var _typeof2 =
|
|
16025
|
+
var _typeof2 = _interopRequireDefault(_typeof.exports);
|
|
15951
16026
|
|
|
15952
|
-
var _classCallCheck2 =
|
|
16027
|
+
var _classCallCheck2 = _interopRequireDefault(classCallCheck.exports);
|
|
15953
16028
|
|
|
15954
|
-
var _createClass2 =
|
|
16029
|
+
var _createClass2 = _interopRequireDefault(createClass.exports);
|
|
15955
16030
|
|
|
15956
|
-
var _inherits2 =
|
|
16031
|
+
var _inherits2 = _interopRequireDefault(inherits$4.exports);
|
|
15957
16032
|
|
|
15958
|
-
var _possibleConstructorReturn2 =
|
|
16033
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(possibleConstructorReturn.exports);
|
|
15959
16034
|
|
|
15960
|
-
var _getPrototypeOf2 =
|
|
16035
|
+
var _getPrototypeOf2 = _interopRequireDefault(getPrototypeOf.exports);
|
|
15961
16036
|
|
|
16037
|
+
var _eventemitter = eventemitter3.exports;
|
|
15962
16038
|
|
|
15963
|
-
|
|
15964
|
-
var _circularJson = interopRequireDefault(circularJson_node);
|
|
16039
|
+
var _circularJson = _interopRequireDefault(circularJson_node);
|
|
15965
16040
|
|
|
15966
16041
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
15967
16042
|
|
|
@@ -16387,31 +16462,29 @@ var solanaWeb3 = (function (exports) {
|
|
|
16387
16462
|
}
|
|
16388
16463
|
}]);
|
|
16389
16464
|
return CommonClient;
|
|
16390
|
-
}(
|
|
16465
|
+
}(_eventemitter.EventEmitter);
|
|
16391
16466
|
|
|
16392
16467
|
exports["default"] = CommonClient;
|
|
16393
|
-
});
|
|
16468
|
+
}(client));
|
|
16394
16469
|
|
|
16395
|
-
var
|
|
16470
|
+
var _interopRequireDefault = interopRequireDefault.exports;
|
|
16396
16471
|
|
|
16397
|
-
|
|
16398
|
-
|
|
16399
|
-
Object.defineProperty(exports, "__esModule", {
|
|
16472
|
+
Object.defineProperty(index_browser, "__esModule", {
|
|
16400
16473
|
value: true
|
|
16401
16474
|
});
|
|
16402
|
-
|
|
16475
|
+
var Client_1 = index_browser.Client = void 0;
|
|
16403
16476
|
|
|
16404
|
-
var _classCallCheck2 =
|
|
16477
|
+
var _classCallCheck2 = _interopRequireDefault(classCallCheck.exports);
|
|
16405
16478
|
|
|
16406
|
-
var _inherits2 =
|
|
16479
|
+
var _inherits2 = _interopRequireDefault(inherits$4.exports);
|
|
16407
16480
|
|
|
16408
|
-
var _possibleConstructorReturn2 =
|
|
16481
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(possibleConstructorReturn.exports);
|
|
16409
16482
|
|
|
16410
|
-
var _getPrototypeOf2 =
|
|
16483
|
+
var _getPrototypeOf2 = _interopRequireDefault(getPrototypeOf.exports);
|
|
16411
16484
|
|
|
16412
|
-
var _websocket =
|
|
16485
|
+
var _websocket = _interopRequireDefault(websocket_browser);
|
|
16413
16486
|
|
|
16414
|
-
var _client =
|
|
16487
|
+
var _client = _interopRequireDefault(client);
|
|
16415
16488
|
|
|
16416
16489
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
16417
16490
|
|
|
@@ -16448,10 +16521,10 @@ var solanaWeb3 = (function (exports) {
|
|
|
16448
16521
|
return Client;
|
|
16449
16522
|
}(_client["default"]);
|
|
16450
16523
|
|
|
16451
|
-
|
|
16452
|
-
|
|
16524
|
+
Client_1 = index_browser.Client = Client;
|
|
16525
|
+
|
|
16526
|
+
var rngBrowser = {exports: {}};
|
|
16453
16527
|
|
|
16454
|
-
var rngBrowser = createCommonjsModule(function (module) {
|
|
16455
16528
|
// Unique ID creation requires a high quality random # generator. In the
|
|
16456
16529
|
// browser this is a little complicated due to unknown quality of Math.random()
|
|
16457
16530
|
// and inconsistent support for the `crypto` API. We do the best we can via
|
|
@@ -16466,7 +16539,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
16466
16539
|
// WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
|
|
16467
16540
|
var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
|
|
16468
16541
|
|
|
16469
|
-
|
|
16542
|
+
rngBrowser.exports = function whatwgRNG() {
|
|
16470
16543
|
getRandomValues(rnds8);
|
|
16471
16544
|
return rnds8;
|
|
16472
16545
|
};
|
|
@@ -16477,7 +16550,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
16477
16550
|
// quality.
|
|
16478
16551
|
var rnds = new Array(16);
|
|
16479
16552
|
|
|
16480
|
-
|
|
16553
|
+
rngBrowser.exports = function mathRNG() {
|
|
16481
16554
|
for (var i = 0, r; i < 16; i++) {
|
|
16482
16555
|
if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
|
|
16483
16556
|
rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
|
|
@@ -16486,18 +16559,18 @@ var solanaWeb3 = (function (exports) {
|
|
|
16486
16559
|
return rnds;
|
|
16487
16560
|
};
|
|
16488
16561
|
}
|
|
16489
|
-
});
|
|
16490
16562
|
|
|
16491
16563
|
/**
|
|
16492
16564
|
* Convert array of 16 byte values to UUID string format of the form:
|
|
16493
16565
|
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
16494
16566
|
*/
|
|
16567
|
+
|
|
16495
16568
|
var byteToHex = [];
|
|
16496
16569
|
for (var i = 0; i < 256; ++i) {
|
|
16497
16570
|
byteToHex[i] = (i + 0x100).toString(16).substr(1);
|
|
16498
16571
|
}
|
|
16499
16572
|
|
|
16500
|
-
function bytesToUuid(buf, offset) {
|
|
16573
|
+
function bytesToUuid$1(buf, offset) {
|
|
16501
16574
|
var i = offset || 0;
|
|
16502
16575
|
var bth = byteToHex;
|
|
16503
16576
|
// join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
|
|
@@ -16513,7 +16586,10 @@ var solanaWeb3 = (function (exports) {
|
|
|
16513
16586
|
]).join('');
|
|
16514
16587
|
}
|
|
16515
16588
|
|
|
16516
|
-
var bytesToUuid_1 = bytesToUuid;
|
|
16589
|
+
var bytesToUuid_1 = bytesToUuid$1;
|
|
16590
|
+
|
|
16591
|
+
var rng = rngBrowser.exports;
|
|
16592
|
+
var bytesToUuid = bytesToUuid_1;
|
|
16517
16593
|
|
|
16518
16594
|
function v4(options, buf, offset) {
|
|
16519
16595
|
var i = buf && offset || 0;
|
|
@@ -16524,7 +16600,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
16524
16600
|
}
|
|
16525
16601
|
options = options || {};
|
|
16526
16602
|
|
|
16527
|
-
var rnds = options.random || (options.rng ||
|
|
16603
|
+
var rnds = options.random || (options.rng || rng)();
|
|
16528
16604
|
|
|
16529
16605
|
// Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
16530
16606
|
rnds[6] = (rnds[6] & 0x0f) | 0x40;
|
|
@@ -16537,11 +16613,13 @@ var solanaWeb3 = (function (exports) {
|
|
|
16537
16613
|
}
|
|
16538
16614
|
}
|
|
16539
16615
|
|
|
16540
|
-
return buf ||
|
|
16616
|
+
return buf || bytesToUuid(rnds);
|
|
16541
16617
|
}
|
|
16542
16618
|
|
|
16543
16619
|
var v4_1 = v4;
|
|
16544
16620
|
|
|
16621
|
+
const uuid$1 = v4_1;
|
|
16622
|
+
|
|
16545
16623
|
/**
|
|
16546
16624
|
* Generates a JSON-RPC 1.0 or 2.0 request
|
|
16547
16625
|
* @param {String} method Name of method to call
|
|
@@ -16555,7 +16633,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
16555
16633
|
* @return {Object} A JSON-RPC 1.0 or 2.0 request
|
|
16556
16634
|
* @memberOf Utils
|
|
16557
16635
|
*/
|
|
16558
|
-
const generateRequest = function(method, params, id, options) {
|
|
16636
|
+
const generateRequest$1 = function(method, params, id, options) {
|
|
16559
16637
|
if(typeof method !== 'string') {
|
|
16560
16638
|
throw new TypeError(method + ' must be a string');
|
|
16561
16639
|
}
|
|
@@ -16586,7 +16664,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
16586
16664
|
|
|
16587
16665
|
// if id was left out, generate one (null means explicit notification)
|
|
16588
16666
|
if(typeof(id) === 'undefined') {
|
|
16589
|
-
const generator = typeof options.generator === 'function' ? options.generator : function() { return
|
|
16667
|
+
const generator = typeof options.generator === 'function' ? options.generator : function() { return uuid$1(); };
|
|
16590
16668
|
request.id = generator(request, options);
|
|
16591
16669
|
} else if (version === 2 && id === null) {
|
|
16592
16670
|
// we have a version 2 notification
|
|
@@ -16600,7 +16678,10 @@ var solanaWeb3 = (function (exports) {
|
|
|
16600
16678
|
return request;
|
|
16601
16679
|
};
|
|
16602
16680
|
|
|
16603
|
-
var generateRequest_1 = generateRequest;
|
|
16681
|
+
var generateRequest_1 = generateRequest$1;
|
|
16682
|
+
|
|
16683
|
+
const uuid = v4_1;
|
|
16684
|
+
const generateRequest = generateRequest_1;
|
|
16604
16685
|
|
|
16605
16686
|
/**
|
|
16606
16687
|
* Constructor for a Jayson Browser Client that does not depend any node.js core libraries
|
|
@@ -16626,7 +16707,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
16626
16707
|
this.options = {
|
|
16627
16708
|
reviver: typeof options.reviver !== 'undefined' ? options.reviver : null,
|
|
16628
16709
|
replacer: typeof options.replacer !== 'undefined' ? options.replacer : null,
|
|
16629
|
-
generator: typeof options.generator !== 'undefined' ? options.generator : function() { return
|
|
16710
|
+
generator: typeof options.generator !== 'undefined' ? options.generator : function() { return uuid(); },
|
|
16630
16711
|
version: typeof options.version !== 'undefined' ? options.version : 2,
|
|
16631
16712
|
notificationIdNull: typeof options.notificationIdNull === 'boolean' ? options.notificationIdNull : false,
|
|
16632
16713
|
};
|
|
@@ -16672,7 +16753,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
16672
16753
|
const hasCallback = typeof callback === 'function';
|
|
16673
16754
|
|
|
16674
16755
|
try {
|
|
16675
|
-
request =
|
|
16756
|
+
request = generateRequest(method, params, id, {
|
|
16676
16757
|
generator: this.options.generator,
|
|
16677
16758
|
version: this.options.version,
|
|
16678
16759
|
notificationIdNull: this.options.notificationIdNull,
|
|
@@ -16965,7 +17046,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
16965
17046
|
return new Promise((resolve, reject) => {
|
|
16966
17047
|
fetchMiddleware(url, options, async (url, options) => {
|
|
16967
17048
|
try {
|
|
16968
|
-
resolve(await
|
|
17049
|
+
resolve(await fetch(url, options));
|
|
16969
17050
|
} catch (error) {
|
|
16970
17051
|
reject(error);
|
|
16971
17052
|
}
|
|
@@ -16994,7 +17075,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
16994
17075
|
if (fetchWithMiddleware) {
|
|
16995
17076
|
res = await fetchWithMiddleware(url, options);
|
|
16996
17077
|
} else {
|
|
16997
|
-
res = await
|
|
17078
|
+
res = await fetch(url, options);
|
|
16998
17079
|
}
|
|
16999
17080
|
|
|
17000
17081
|
if (res.status !== 429
|
|
@@ -17751,7 +17832,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
17751
17832
|
url.port = String(Number(url.port) + 1);
|
|
17752
17833
|
}
|
|
17753
17834
|
|
|
17754
|
-
this._rpcWebSocket = new
|
|
17835
|
+
this._rpcWebSocket = new Client_1(urlFormat(url), {
|
|
17755
17836
|
autoconnect: false,
|
|
17756
17837
|
max_reconnects: Infinity
|
|
17757
17838
|
});
|
|
@@ -18161,7 +18242,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
18161
18242
|
throw new Error('signature must be base58 encoded: ' + signature);
|
|
18162
18243
|
}
|
|
18163
18244
|
|
|
18164
|
-
assert$
|
|
18245
|
+
assert$j(decodedSignature.length === 64, 'signature has invalid length');
|
|
18165
18246
|
const start = Date.now();
|
|
18166
18247
|
const subscriptionCommitment = commitment || this.commitment;
|
|
18167
18248
|
let subscriptionId;
|
|
@@ -18304,7 +18385,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
18304
18385
|
context,
|
|
18305
18386
|
value: values
|
|
18306
18387
|
} = await this.getSignatureStatuses([signature], config);
|
|
18307
|
-
assert$
|
|
18388
|
+
assert$j(values.length === 1);
|
|
18308
18389
|
const value = values[0];
|
|
18309
18390
|
return {
|
|
18310
18391
|
context,
|
|
@@ -19704,7 +19785,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
19704
19785
|
|
|
19705
19786
|
|
|
19706
19787
|
static generate() {
|
|
19707
|
-
return new Keypair(naclFast.sign.keyPair());
|
|
19788
|
+
return new Keypair(naclFast.exports.sign.keyPair());
|
|
19708
19789
|
}
|
|
19709
19790
|
/**
|
|
19710
19791
|
* Create a keypair from a raw secret key byte array.
|
|
@@ -19721,14 +19802,14 @@ var solanaWeb3 = (function (exports) {
|
|
|
19721
19802
|
|
|
19722
19803
|
|
|
19723
19804
|
static fromSecretKey(secretKey, options) {
|
|
19724
|
-
const keypair = naclFast.sign.keyPair.fromSecretKey(secretKey);
|
|
19805
|
+
const keypair = naclFast.exports.sign.keyPair.fromSecretKey(secretKey);
|
|
19725
19806
|
|
|
19726
19807
|
if (!options || !options.skipValidation) {
|
|
19727
19808
|
const encoder = new TextEncoder();
|
|
19728
19809
|
const signData = encoder.encode('@solana/web3.js-validation-v1');
|
|
19729
|
-
const signature = naclFast.sign.detached(signData, keypair.secretKey);
|
|
19810
|
+
const signature = naclFast.exports.sign.detached(signData, keypair.secretKey);
|
|
19730
19811
|
|
|
19731
|
-
if (!naclFast.sign.detached.verify(signData, signature, keypair.publicKey)) {
|
|
19812
|
+
if (!naclFast.exports.sign.detached.verify(signData, signature, keypair.publicKey)) {
|
|
19732
19813
|
throw new Error('provided secretKey is invalid');
|
|
19733
19814
|
}
|
|
19734
19815
|
}
|
|
@@ -19743,7 +19824,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
19743
19824
|
|
|
19744
19825
|
|
|
19745
19826
|
static fromSeed(seed) {
|
|
19746
|
-
return new Keypair(naclFast.sign.keyPair.fromSeed(seed));
|
|
19827
|
+
return new Keypair(naclFast.exports.sign.keyPair.fromSeed(seed));
|
|
19747
19828
|
}
|
|
19748
19829
|
/**
|
|
19749
19830
|
* The public key for this keypair
|
|
@@ -20470,27 +20551,27 @@ var solanaWeb3 = (function (exports) {
|
|
|
20470
20551
|
ECDH: 'Scalar was invalid (zero or overflow)'
|
|
20471
20552
|
};
|
|
20472
20553
|
|
|
20473
|
-
function assert$
|
|
20554
|
+
function assert$g (cond, msg) {
|
|
20474
20555
|
if (!cond) throw new Error(msg)
|
|
20475
20556
|
}
|
|
20476
20557
|
|
|
20477
20558
|
function isUint8Array (name, value, length) {
|
|
20478
|
-
assert$
|
|
20559
|
+
assert$g(value instanceof Uint8Array, `Expected ${name} to be an Uint8Array`);
|
|
20479
20560
|
|
|
20480
20561
|
if (length !== undefined) {
|
|
20481
20562
|
if (Array.isArray(length)) {
|
|
20482
20563
|
const numbers = length.join(', ');
|
|
20483
20564
|
const msg = `Expected ${name} to be an Uint8Array with length [${numbers}]`;
|
|
20484
|
-
assert$
|
|
20565
|
+
assert$g(length.includes(value.length), msg);
|
|
20485
20566
|
} else {
|
|
20486
20567
|
const msg = `Expected ${name} to be an Uint8Array with length ${length}`;
|
|
20487
|
-
assert$
|
|
20568
|
+
assert$g(value.length === length, msg);
|
|
20488
20569
|
}
|
|
20489
20570
|
}
|
|
20490
20571
|
}
|
|
20491
20572
|
|
|
20492
20573
|
function isCompressed (value) {
|
|
20493
|
-
assert$
|
|
20574
|
+
assert$g(toTypeString(value) === 'Boolean', 'Expected compressed to be a Boolean');
|
|
20494
20575
|
}
|
|
20495
20576
|
|
|
20496
20577
|
function getAssertedOutput (output = (len) => new Uint8Array(len), length) {
|
|
@@ -20506,7 +20587,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
20506
20587
|
var lib = (secp256k1) => {
|
|
20507
20588
|
return {
|
|
20508
20589
|
contextRandomize (seed) {
|
|
20509
|
-
assert$
|
|
20590
|
+
assert$g(
|
|
20510
20591
|
seed === null || seed instanceof Uint8Array,
|
|
20511
20592
|
'Expected seed to be an Uint8Array or null'
|
|
20512
20593
|
);
|
|
@@ -20613,8 +20694,8 @@ var solanaWeb3 = (function (exports) {
|
|
|
20613
20694
|
},
|
|
20614
20695
|
|
|
20615
20696
|
publicKeyCombine (pubkeys, compressed = true, output) {
|
|
20616
|
-
assert$
|
|
20617
|
-
assert$
|
|
20697
|
+
assert$g(Array.isArray(pubkeys), 'Expected public keys to be an Array');
|
|
20698
|
+
assert$g(pubkeys.length > 0, 'Expected public keys array will have more than zero items');
|
|
20618
20699
|
for (const pubkey of pubkeys) {
|
|
20619
20700
|
isUint8Array('public key', pubkey, [33, 65]);
|
|
20620
20701
|
}
|
|
@@ -20708,9 +20789,9 @@ var solanaWeb3 = (function (exports) {
|
|
|
20708
20789
|
ecdsaSign (msg32, seckey, options = {}, output) {
|
|
20709
20790
|
isUint8Array('message', msg32, 32);
|
|
20710
20791
|
isUint8Array('private key', seckey, 32);
|
|
20711
|
-
assert$
|
|
20792
|
+
assert$g(toTypeString(options) === 'Object', 'Expected options to be an Object');
|
|
20712
20793
|
if (options.data !== undefined) isUint8Array('options.data', options.data);
|
|
20713
|
-
if (options.noncefn !== undefined) assert$
|
|
20794
|
+
if (options.noncefn !== undefined) assert$g(toTypeString(options.noncefn) === 'Function', 'Expected options.noncefn to be a Function');
|
|
20714
20795
|
output = getAssertedOutput(output, 64);
|
|
20715
20796
|
|
|
20716
20797
|
const obj = { signature: output, recid: null };
|
|
@@ -20743,7 +20824,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
20743
20824
|
|
|
20744
20825
|
ecdsaRecover (sig, recid, msg32, compressed = true, output) {
|
|
20745
20826
|
isUint8Array('signature', sig, 64);
|
|
20746
|
-
assert$
|
|
20827
|
+
assert$g(
|
|
20747
20828
|
toTypeString(recid) === 'Number' &&
|
|
20748
20829
|
recid >= 0 &&
|
|
20749
20830
|
recid <= 3,
|
|
@@ -20768,10 +20849,10 @@ var solanaWeb3 = (function (exports) {
|
|
|
20768
20849
|
ecdh (pubkey, seckey, options = {}, output) {
|
|
20769
20850
|
isUint8Array('public key', pubkey, [33, 65]);
|
|
20770
20851
|
isUint8Array('private key', seckey, 32);
|
|
20771
|
-
assert$
|
|
20852
|
+
assert$g(toTypeString(options) === 'Object', 'Expected options to be an Object');
|
|
20772
20853
|
if (options.data !== undefined) isUint8Array('options.data', options.data);
|
|
20773
20854
|
if (options.hashfn !== undefined) {
|
|
20774
|
-
assert$
|
|
20855
|
+
assert$g(toTypeString(options.hashfn) === 'Function', 'Expected options.hashfn to be a Function');
|
|
20775
20856
|
if (options.xbuf !== undefined) isUint8Array('options.xbuf', options.xbuf, 32);
|
|
20776
20857
|
if (options.ybuf !== undefined) isUint8Array('options.ybuf', options.ybuf, 32);
|
|
20777
20858
|
isUint8Array('output', output);
|
|
@@ -20791,6 +20872,8 @@ var solanaWeb3 = (function (exports) {
|
|
|
20791
20872
|
}
|
|
20792
20873
|
};
|
|
20793
20874
|
|
|
20875
|
+
var elliptic$2 = {};
|
|
20876
|
+
|
|
20794
20877
|
var name = "elliptic";
|
|
20795
20878
|
var version = "6.5.4";
|
|
20796
20879
|
var description = "EC cryptography";
|
|
@@ -20845,9 +20928,6 @@ var solanaWeb3 = (function (exports) {
|
|
|
20845
20928
|
"minimalistic-assert": "^1.0.1",
|
|
20846
20929
|
"minimalistic-crypto-utils": "^1.0.1"
|
|
20847
20930
|
};
|
|
20848
|
-
var _resolved = "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz";
|
|
20849
|
-
var _integrity = "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==";
|
|
20850
|
-
var _from = "elliptic@6.5.4";
|
|
20851
20931
|
var require$$0 = {
|
|
20852
20932
|
name: name,
|
|
20853
20933
|
version: version,
|
|
@@ -20862,25 +20942,26 @@ var solanaWeb3 = (function (exports) {
|
|
|
20862
20942
|
bugs: bugs,
|
|
20863
20943
|
homepage: homepage,
|
|
20864
20944
|
devDependencies: devDependencies,
|
|
20865
|
-
dependencies: dependencies
|
|
20866
|
-
_resolved: _resolved,
|
|
20867
|
-
_integrity: _integrity,
|
|
20868
|
-
_from: _from
|
|
20945
|
+
dependencies: dependencies
|
|
20869
20946
|
};
|
|
20870
20947
|
|
|
20871
|
-
var
|
|
20948
|
+
var utils$m = {};
|
|
20949
|
+
|
|
20950
|
+
var minimalisticAssert = assert$f;
|
|
20872
20951
|
|
|
20873
|
-
function assert$
|
|
20952
|
+
function assert$f(val, msg) {
|
|
20874
20953
|
if (!val)
|
|
20875
20954
|
throw new Error(msg || 'Assertion failed');
|
|
20876
20955
|
}
|
|
20877
20956
|
|
|
20878
|
-
assert$
|
|
20957
|
+
assert$f.equal = function assertEqual(l, r, msg) {
|
|
20879
20958
|
if (l != r)
|
|
20880
20959
|
throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r));
|
|
20881
20960
|
};
|
|
20882
20961
|
|
|
20883
|
-
var
|
|
20962
|
+
var utils$l = {};
|
|
20963
|
+
|
|
20964
|
+
(function (exports) {
|
|
20884
20965
|
|
|
20885
20966
|
var utils = exports;
|
|
20886
20967
|
|
|
@@ -20938,20 +21019,20 @@ var solanaWeb3 = (function (exports) {
|
|
|
20938
21019
|
else
|
|
20939
21020
|
return arr;
|
|
20940
21021
|
};
|
|
20941
|
-
});
|
|
21022
|
+
}(utils$l));
|
|
20942
21023
|
|
|
20943
|
-
|
|
21024
|
+
(function (exports) {
|
|
20944
21025
|
|
|
20945
21026
|
var utils = exports;
|
|
21027
|
+
var BN = bn.exports;
|
|
21028
|
+
var minAssert = minimalisticAssert;
|
|
21029
|
+
var minUtils = utils$l;
|
|
20946
21030
|
|
|
20947
|
-
|
|
20948
|
-
|
|
20949
|
-
|
|
20950
|
-
utils.
|
|
20951
|
-
utils.
|
|
20952
|
-
utils.zero2 = utils_1$1.zero2;
|
|
20953
|
-
utils.toHex = utils_1$1.toHex;
|
|
20954
|
-
utils.encode = utils_1$1.encode;
|
|
21031
|
+
utils.assert = minAssert;
|
|
21032
|
+
utils.toArray = minUtils.toArray;
|
|
21033
|
+
utils.zero2 = minUtils.zero2;
|
|
21034
|
+
utils.toHex = minUtils.toHex;
|
|
21035
|
+
utils.encode = minUtils.encode;
|
|
20955
21036
|
|
|
20956
21037
|
// Represent num in a w-NAF form
|
|
20957
21038
|
function getNAF(num, w, bits) {
|
|
@@ -21055,14 +21136,16 @@ var solanaWeb3 = (function (exports) {
|
|
|
21055
21136
|
utils.parseBytes = parseBytes;
|
|
21056
21137
|
|
|
21057
21138
|
function intFromLE(bytes) {
|
|
21058
|
-
return new
|
|
21139
|
+
return new BN(bytes, 'hex', 'le');
|
|
21059
21140
|
}
|
|
21060
21141
|
utils.intFromLE = intFromLE;
|
|
21061
|
-
});
|
|
21142
|
+
}(utils$m));
|
|
21143
|
+
|
|
21144
|
+
var brorand = {exports: {}};
|
|
21062
21145
|
|
|
21063
21146
|
var r$1;
|
|
21064
21147
|
|
|
21065
|
-
|
|
21148
|
+
brorand.exports = function rand(len) {
|
|
21066
21149
|
if (!r$1)
|
|
21067
21150
|
r$1 = new Rand(null);
|
|
21068
21151
|
|
|
@@ -21072,7 +21155,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21072
21155
|
function Rand(rand) {
|
|
21073
21156
|
this.rand = rand;
|
|
21074
21157
|
}
|
|
21075
|
-
|
|
21158
|
+
brorand.exports.Rand = Rand;
|
|
21076
21159
|
|
|
21077
21160
|
Rand.prototype.generate = function generate(len) {
|
|
21078
21161
|
return this._rand(len);
|
|
@@ -21115,7 +21198,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21115
21198
|
} else {
|
|
21116
21199
|
// Node.js or Web worker with no crypto support
|
|
21117
21200
|
try {
|
|
21118
|
-
var crypto$1 = require$$0$
|
|
21201
|
+
var crypto$1 = require$$0$2;
|
|
21119
21202
|
if (typeof crypto$1.randomBytes !== 'function')
|
|
21120
21203
|
throw new Error('Not supported');
|
|
21121
21204
|
|
|
@@ -21125,26 +21208,29 @@ var solanaWeb3 = (function (exports) {
|
|
|
21125
21208
|
} catch (e) {
|
|
21126
21209
|
}
|
|
21127
21210
|
}
|
|
21128
|
-
brorand.Rand = Rand_1;
|
|
21129
21211
|
|
|
21130
|
-
var
|
|
21131
|
-
|
|
21132
|
-
var
|
|
21212
|
+
var curve = {};
|
|
21213
|
+
|
|
21214
|
+
var BN$8 = bn.exports;
|
|
21215
|
+
var utils$k = utils$m;
|
|
21216
|
+
var getNAF = utils$k.getNAF;
|
|
21217
|
+
var getJSF = utils$k.getJSF;
|
|
21218
|
+
var assert$e = utils$k.assert;
|
|
21133
21219
|
|
|
21134
21220
|
function BaseCurve(type, conf) {
|
|
21135
21221
|
this.type = type;
|
|
21136
|
-
this.p = new
|
|
21222
|
+
this.p = new BN$8(conf.p, 16);
|
|
21137
21223
|
|
|
21138
21224
|
// Use Montgomery, when there is no fast reduction for the prime
|
|
21139
|
-
this.red = conf.prime ?
|
|
21225
|
+
this.red = conf.prime ? BN$8.red(conf.prime) : BN$8.mont(this.p);
|
|
21140
21226
|
|
|
21141
21227
|
// Useful for many curves
|
|
21142
|
-
this.zero = new
|
|
21143
|
-
this.one = new
|
|
21144
|
-
this.two = new
|
|
21228
|
+
this.zero = new BN$8(0).toRed(this.red);
|
|
21229
|
+
this.one = new BN$8(1).toRed(this.red);
|
|
21230
|
+
this.two = new BN$8(2).toRed(this.red);
|
|
21145
21231
|
|
|
21146
21232
|
// Curve configuration, optional
|
|
21147
|
-
this.n = conf.n && new
|
|
21233
|
+
this.n = conf.n && new BN$8(conf.n, 16);
|
|
21148
21234
|
this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed);
|
|
21149
21235
|
|
|
21150
21236
|
// Temporary arrays
|
|
@@ -21175,7 +21261,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21175
21261
|
};
|
|
21176
21262
|
|
|
21177
21263
|
BaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) {
|
|
21178
|
-
assert$
|
|
21264
|
+
assert$e(p.precomputed);
|
|
21179
21265
|
var doubles = p._getDoubles();
|
|
21180
21266
|
|
|
21181
21267
|
var naf = getNAF(k, 1, this._bitLength);
|
|
@@ -21232,7 +21318,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21232
21318
|
if (i < 0)
|
|
21233
21319
|
break;
|
|
21234
21320
|
var z = naf[i];
|
|
21235
|
-
assert$
|
|
21321
|
+
assert$e(z !== 0);
|
|
21236
21322
|
if (p.type === 'affine') {
|
|
21237
21323
|
// J +- P
|
|
21238
21324
|
if (z > 0)
|
|
@@ -21392,7 +21478,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21392
21478
|
};
|
|
21393
21479
|
|
|
21394
21480
|
BaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) {
|
|
21395
|
-
bytes =
|
|
21481
|
+
bytes = utils$k.toArray(bytes, enc);
|
|
21396
21482
|
|
|
21397
21483
|
var len = this.p.byteLength();
|
|
21398
21484
|
|
|
@@ -21400,9 +21486,9 @@ var solanaWeb3 = (function (exports) {
|
|
|
21400
21486
|
if ((bytes[0] === 0x04 || bytes[0] === 0x06 || bytes[0] === 0x07) &&
|
|
21401
21487
|
bytes.length - 1 === 2 * len) {
|
|
21402
21488
|
if (bytes[0] === 0x06)
|
|
21403
|
-
assert$
|
|
21489
|
+
assert$e(bytes[bytes.length - 1] % 2 === 0);
|
|
21404
21490
|
else if (bytes[0] === 0x07)
|
|
21405
|
-
assert$
|
|
21491
|
+
assert$e(bytes[bytes.length - 1] % 2 === 1);
|
|
21406
21492
|
|
|
21407
21493
|
var res = this.point(bytes.slice(1, 1 + len),
|
|
21408
21494
|
bytes.slice(1 + len, 1 + 2 * len));
|
|
@@ -21430,7 +21516,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21430
21516
|
};
|
|
21431
21517
|
|
|
21432
21518
|
BasePoint.prototype.encode = function encode(enc, compact) {
|
|
21433
|
-
return
|
|
21519
|
+
return utils$k.encode(this._encode(compact), enc);
|
|
21434
21520
|
};
|
|
21435
21521
|
|
|
21436
21522
|
BasePoint.prototype.precompute = function precompute(power) {
|
|
@@ -21504,10 +21590,11 @@ var solanaWeb3 = (function (exports) {
|
|
|
21504
21590
|
return r;
|
|
21505
21591
|
};
|
|
21506
21592
|
|
|
21507
|
-
var inherits_browser$1 =
|
|
21593
|
+
var inherits_browser$1 = {exports: {}};
|
|
21594
|
+
|
|
21508
21595
|
if (typeof Object.create === 'function') {
|
|
21509
21596
|
// implementation from standard node.js 'util' module
|
|
21510
|
-
|
|
21597
|
+
inherits_browser$1.exports = function inherits(ctor, superCtor) {
|
|
21511
21598
|
if (superCtor) {
|
|
21512
21599
|
ctor.super_ = superCtor;
|
|
21513
21600
|
ctor.prototype = Object.create(superCtor.prototype, {
|
|
@@ -21522,7 +21609,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21522
21609
|
};
|
|
21523
21610
|
} else {
|
|
21524
21611
|
// old school shim for old browsers
|
|
21525
|
-
|
|
21612
|
+
inherits_browser$1.exports = function inherits(ctor, superCtor) {
|
|
21526
21613
|
if (superCtor) {
|
|
21527
21614
|
ctor.super_ = superCtor;
|
|
21528
21615
|
var TempCtor = function () {};
|
|
@@ -21532,15 +21619,19 @@ var solanaWeb3 = (function (exports) {
|
|
|
21532
21619
|
}
|
|
21533
21620
|
};
|
|
21534
21621
|
}
|
|
21535
|
-
});
|
|
21536
21622
|
|
|
21537
|
-
var
|
|
21623
|
+
var utils$j = utils$m;
|
|
21624
|
+
var BN$7 = bn.exports;
|
|
21625
|
+
var inherits$3 = inherits_browser$1.exports;
|
|
21626
|
+
var Base$2 = base;
|
|
21627
|
+
|
|
21628
|
+
var assert$d = utils$j.assert;
|
|
21538
21629
|
|
|
21539
21630
|
function ShortCurve(conf) {
|
|
21540
|
-
|
|
21631
|
+
Base$2.call(this, 'short', conf);
|
|
21541
21632
|
|
|
21542
|
-
this.a = new
|
|
21543
|
-
this.b = new
|
|
21633
|
+
this.a = new BN$7(conf.a, 16).toRed(this.red);
|
|
21634
|
+
this.b = new BN$7(conf.b, 16).toRed(this.red);
|
|
21544
21635
|
this.tinv = this.two.redInvm();
|
|
21545
21636
|
|
|
21546
21637
|
this.zeroA = this.a.fromRed().cmpn(0) === 0;
|
|
@@ -21551,7 +21642,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21551
21642
|
this._endoWnafT1 = new Array(4);
|
|
21552
21643
|
this._endoWnafT2 = new Array(4);
|
|
21553
21644
|
}
|
|
21554
|
-
|
|
21645
|
+
inherits$3(ShortCurve, Base$2);
|
|
21555
21646
|
var short = ShortCurve;
|
|
21556
21647
|
|
|
21557
21648
|
ShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) {
|
|
@@ -21563,7 +21654,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21563
21654
|
var beta;
|
|
21564
21655
|
var lambda;
|
|
21565
21656
|
if (conf.beta) {
|
|
21566
|
-
beta = new
|
|
21657
|
+
beta = new BN$7(conf.beta, 16).toRed(this.red);
|
|
21567
21658
|
} else {
|
|
21568
21659
|
var betas = this._getEndoRoots(this.p);
|
|
21569
21660
|
// Choose the smallest beta
|
|
@@ -21571,7 +21662,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21571
21662
|
beta = beta.toRed(this.red);
|
|
21572
21663
|
}
|
|
21573
21664
|
if (conf.lambda) {
|
|
21574
|
-
lambda = new
|
|
21665
|
+
lambda = new BN$7(conf.lambda, 16);
|
|
21575
21666
|
} else {
|
|
21576
21667
|
// Choose the lambda that is matching selected beta
|
|
21577
21668
|
var lambdas = this._getEndoRoots(this.n);
|
|
@@ -21579,7 +21670,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21579
21670
|
lambda = lambdas[0];
|
|
21580
21671
|
} else {
|
|
21581
21672
|
lambda = lambdas[1];
|
|
21582
|
-
assert$
|
|
21673
|
+
assert$d(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0);
|
|
21583
21674
|
}
|
|
21584
21675
|
}
|
|
21585
21676
|
|
|
@@ -21588,8 +21679,8 @@ var solanaWeb3 = (function (exports) {
|
|
|
21588
21679
|
if (conf.basis) {
|
|
21589
21680
|
basis = conf.basis.map(function(vec) {
|
|
21590
21681
|
return {
|
|
21591
|
-
a: new
|
|
21592
|
-
b: new
|
|
21682
|
+
a: new BN$7(vec.a, 16),
|
|
21683
|
+
b: new BN$7(vec.b, 16),
|
|
21593
21684
|
};
|
|
21594
21685
|
});
|
|
21595
21686
|
} else {
|
|
@@ -21607,11 +21698,11 @@ var solanaWeb3 = (function (exports) {
|
|
|
21607
21698
|
// Find roots of for x^2 + x + 1 in F
|
|
21608
21699
|
// Root = (-1 +- Sqrt(-3)) / 2
|
|
21609
21700
|
//
|
|
21610
|
-
var red = num === this.p ? this.red :
|
|
21611
|
-
var tinv = new
|
|
21701
|
+
var red = num === this.p ? this.red : BN$7.mont(num);
|
|
21702
|
+
var tinv = new BN$7(2).toRed(red).redInvm();
|
|
21612
21703
|
var ntinv = tinv.redNeg();
|
|
21613
21704
|
|
|
21614
|
-
var s = new
|
|
21705
|
+
var s = new BN$7(3).toRed(red).redNeg().redSqrt().redMul(tinv);
|
|
21615
21706
|
|
|
21616
21707
|
var l1 = ntinv.redAdd(s).fromRed();
|
|
21617
21708
|
var l2 = ntinv.redSub(s).fromRed();
|
|
@@ -21626,10 +21717,10 @@ var solanaWeb3 = (function (exports) {
|
|
|
21626
21717
|
// Run EGCD, until r(L + 1) < aprxSqrt
|
|
21627
21718
|
var u = lambda;
|
|
21628
21719
|
var v = this.n.clone();
|
|
21629
|
-
var x1 = new
|
|
21630
|
-
var y1 = new
|
|
21631
|
-
var x2 = new
|
|
21632
|
-
var y2 = new
|
|
21720
|
+
var x1 = new BN$7(1);
|
|
21721
|
+
var y1 = new BN$7(0);
|
|
21722
|
+
var x2 = new BN$7(0);
|
|
21723
|
+
var y2 = new BN$7(1);
|
|
21633
21724
|
|
|
21634
21725
|
// NOTE: all vectors are roots of: a + b * lambda = 0 (mod n)
|
|
21635
21726
|
var a0;
|
|
@@ -21714,7 +21805,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21714
21805
|
};
|
|
21715
21806
|
|
|
21716
21807
|
ShortCurve.prototype.pointFromX = function pointFromX(x, odd) {
|
|
21717
|
-
x = new
|
|
21808
|
+
x = new BN$7(x, 16);
|
|
21718
21809
|
if (!x.red)
|
|
21719
21810
|
x = x.toRed(this.red);
|
|
21720
21811
|
|
|
@@ -21778,14 +21869,14 @@ var solanaWeb3 = (function (exports) {
|
|
|
21778
21869
|
};
|
|
21779
21870
|
|
|
21780
21871
|
function Point$2(curve, x, y, isRed) {
|
|
21781
|
-
|
|
21872
|
+
Base$2.BasePoint.call(this, curve, 'affine');
|
|
21782
21873
|
if (x === null && y === null) {
|
|
21783
21874
|
this.x = null;
|
|
21784
21875
|
this.y = null;
|
|
21785
21876
|
this.inf = true;
|
|
21786
21877
|
} else {
|
|
21787
|
-
this.x = new
|
|
21788
|
-
this.y = new
|
|
21878
|
+
this.x = new BN$7(x, 16);
|
|
21879
|
+
this.y = new BN$7(y, 16);
|
|
21789
21880
|
// Force redgomery representation when loading from JSON
|
|
21790
21881
|
if (isRed) {
|
|
21791
21882
|
this.x.forceRed(this.curve.red);
|
|
@@ -21798,7 +21889,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21798
21889
|
this.inf = false;
|
|
21799
21890
|
}
|
|
21800
21891
|
}
|
|
21801
|
-
|
|
21892
|
+
inherits$3(Point$2, Base$2.BasePoint);
|
|
21802
21893
|
|
|
21803
21894
|
ShortCurve.prototype.point = function point(x, y, isRed) {
|
|
21804
21895
|
return new Point$2(this, x, y, isRed);
|
|
@@ -21949,7 +22040,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21949
22040
|
};
|
|
21950
22041
|
|
|
21951
22042
|
Point$2.prototype.mul = function mul(k) {
|
|
21952
|
-
k = new
|
|
22043
|
+
k = new BN$7(k, 16);
|
|
21953
22044
|
if (this.isInfinity())
|
|
21954
22045
|
return this;
|
|
21955
22046
|
else if (this._hasDoubles(k))
|
|
@@ -22017,15 +22108,15 @@ var solanaWeb3 = (function (exports) {
|
|
|
22017
22108
|
};
|
|
22018
22109
|
|
|
22019
22110
|
function JPoint(curve, x, y, z) {
|
|
22020
|
-
|
|
22111
|
+
Base$2.BasePoint.call(this, curve, 'jacobian');
|
|
22021
22112
|
if (x === null && y === null && z === null) {
|
|
22022
22113
|
this.x = this.curve.one;
|
|
22023
22114
|
this.y = this.curve.one;
|
|
22024
|
-
this.z = new
|
|
22115
|
+
this.z = new BN$7(0);
|
|
22025
22116
|
} else {
|
|
22026
|
-
this.x = new
|
|
22027
|
-
this.y = new
|
|
22028
|
-
this.z = new
|
|
22117
|
+
this.x = new BN$7(x, 16);
|
|
22118
|
+
this.y = new BN$7(y, 16);
|
|
22119
|
+
this.z = new BN$7(z, 16);
|
|
22029
22120
|
}
|
|
22030
22121
|
if (!this.x.red)
|
|
22031
22122
|
this.x = this.x.toRed(this.curve.red);
|
|
@@ -22036,7 +22127,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
22036
22127
|
|
|
22037
22128
|
this.zOne = this.z === this.curve.one;
|
|
22038
22129
|
}
|
|
22039
|
-
|
|
22130
|
+
inherits$3(JPoint, Base$2.BasePoint);
|
|
22040
22131
|
|
|
22041
22132
|
ShortCurve.prototype.jpoint = function jpoint(x, y, z) {
|
|
22042
22133
|
return new JPoint(this, x, y, z);
|
|
@@ -22410,7 +22501,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
22410
22501
|
};
|
|
22411
22502
|
|
|
22412
22503
|
JPoint.prototype.mul = function mul(k, kbase) {
|
|
22413
|
-
k = new
|
|
22504
|
+
k = new BN$7(k, kbase);
|
|
22414
22505
|
|
|
22415
22506
|
return this.curve._wnafMul(this, k);
|
|
22416
22507
|
};
|
|
@@ -22466,16 +22557,22 @@ var solanaWeb3 = (function (exports) {
|
|
|
22466
22557
|
return this.z.cmpn(0) === 0;
|
|
22467
22558
|
};
|
|
22468
22559
|
|
|
22560
|
+
var BN$6 = bn.exports;
|
|
22561
|
+
var inherits$2 = inherits_browser$1.exports;
|
|
22562
|
+
var Base$1 = base;
|
|
22563
|
+
|
|
22564
|
+
var utils$i = utils$m;
|
|
22565
|
+
|
|
22469
22566
|
function MontCurve(conf) {
|
|
22470
|
-
|
|
22567
|
+
Base$1.call(this, 'mont', conf);
|
|
22471
22568
|
|
|
22472
|
-
this.a = new
|
|
22473
|
-
this.b = new
|
|
22474
|
-
this.i4 = new
|
|
22475
|
-
this.two = new
|
|
22569
|
+
this.a = new BN$6(conf.a, 16).toRed(this.red);
|
|
22570
|
+
this.b = new BN$6(conf.b, 16).toRed(this.red);
|
|
22571
|
+
this.i4 = new BN$6(4).toRed(this.red).redInvm();
|
|
22572
|
+
this.two = new BN$6(2).toRed(this.red);
|
|
22476
22573
|
this.a24 = this.i4.redMul(this.a.redAdd(this.two));
|
|
22477
22574
|
}
|
|
22478
|
-
|
|
22575
|
+
inherits$2(MontCurve, Base$1);
|
|
22479
22576
|
var mont = MontCurve;
|
|
22480
22577
|
|
|
22481
22578
|
MontCurve.prototype.validate = function validate(point) {
|
|
@@ -22488,23 +22585,23 @@ var solanaWeb3 = (function (exports) {
|
|
|
22488
22585
|
};
|
|
22489
22586
|
|
|
22490
22587
|
function Point$1(curve, x, z) {
|
|
22491
|
-
|
|
22588
|
+
Base$1.BasePoint.call(this, curve, 'projective');
|
|
22492
22589
|
if (x === null && z === null) {
|
|
22493
22590
|
this.x = this.curve.one;
|
|
22494
22591
|
this.z = this.curve.zero;
|
|
22495
22592
|
} else {
|
|
22496
|
-
this.x = new
|
|
22497
|
-
this.z = new
|
|
22593
|
+
this.x = new BN$6(x, 16);
|
|
22594
|
+
this.z = new BN$6(z, 16);
|
|
22498
22595
|
if (!this.x.red)
|
|
22499
22596
|
this.x = this.x.toRed(this.curve.red);
|
|
22500
22597
|
if (!this.z.red)
|
|
22501
22598
|
this.z = this.z.toRed(this.curve.red);
|
|
22502
22599
|
}
|
|
22503
22600
|
}
|
|
22504
|
-
|
|
22601
|
+
inherits$2(Point$1, Base$1.BasePoint);
|
|
22505
22602
|
|
|
22506
22603
|
MontCurve.prototype.decodePoint = function decodePoint(bytes, enc) {
|
|
22507
|
-
return this.point(
|
|
22604
|
+
return this.point(utils$i.toArray(bytes, enc), 1);
|
|
22508
22605
|
};
|
|
22509
22606
|
|
|
22510
22607
|
MontCurve.prototype.point = function point(x, z) {
|
|
@@ -22637,7 +22734,12 @@ var solanaWeb3 = (function (exports) {
|
|
|
22637
22734
|
return this.x.fromRed();
|
|
22638
22735
|
};
|
|
22639
22736
|
|
|
22640
|
-
var
|
|
22737
|
+
var utils$h = utils$m;
|
|
22738
|
+
var BN$5 = bn.exports;
|
|
22739
|
+
var inherits$1 = inherits_browser$1.exports;
|
|
22740
|
+
var Base = base;
|
|
22741
|
+
|
|
22742
|
+
var assert$c = utils$h.assert;
|
|
22641
22743
|
|
|
22642
22744
|
function EdwardsCurve(conf) {
|
|
22643
22745
|
// NOTE: Important as we are creating point in Base.call()
|
|
@@ -22645,19 +22747,19 @@ var solanaWeb3 = (function (exports) {
|
|
|
22645
22747
|
this.mOneA = this.twisted && (conf.a | 0) === -1;
|
|
22646
22748
|
this.extended = this.mOneA;
|
|
22647
22749
|
|
|
22648
|
-
|
|
22750
|
+
Base.call(this, 'edwards', conf);
|
|
22649
22751
|
|
|
22650
|
-
this.a = new
|
|
22752
|
+
this.a = new BN$5(conf.a, 16).umod(this.red.m);
|
|
22651
22753
|
this.a = this.a.toRed(this.red);
|
|
22652
|
-
this.c = new
|
|
22754
|
+
this.c = new BN$5(conf.c, 16).toRed(this.red);
|
|
22653
22755
|
this.c2 = this.c.redSqr();
|
|
22654
|
-
this.d = new
|
|
22756
|
+
this.d = new BN$5(conf.d, 16).toRed(this.red);
|
|
22655
22757
|
this.dd = this.d.redAdd(this.d);
|
|
22656
22758
|
|
|
22657
|
-
assert$
|
|
22759
|
+
assert$c(!this.twisted || this.c.fromRed().cmpn(1) === 0);
|
|
22658
22760
|
this.oneC = (conf.c | 0) === 1;
|
|
22659
22761
|
}
|
|
22660
|
-
|
|
22762
|
+
inherits$1(EdwardsCurve, Base);
|
|
22661
22763
|
var edwards = EdwardsCurve;
|
|
22662
22764
|
|
|
22663
22765
|
EdwardsCurve.prototype._mulA = function _mulA(num) {
|
|
@@ -22680,7 +22782,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
22680
22782
|
};
|
|
22681
22783
|
|
|
22682
22784
|
EdwardsCurve.prototype.pointFromX = function pointFromX(x, odd) {
|
|
22683
|
-
x = new
|
|
22785
|
+
x = new BN$5(x, 16);
|
|
22684
22786
|
if (!x.red)
|
|
22685
22787
|
x = x.toRed(this.red);
|
|
22686
22788
|
|
|
@@ -22701,7 +22803,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
22701
22803
|
};
|
|
22702
22804
|
|
|
22703
22805
|
EdwardsCurve.prototype.pointFromY = function pointFromY(y, odd) {
|
|
22704
|
-
y = new
|
|
22806
|
+
y = new BN$5(y, 16);
|
|
22705
22807
|
if (!y.red)
|
|
22706
22808
|
y = y.toRed(this.red);
|
|
22707
22809
|
|
|
@@ -22744,7 +22846,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
22744
22846
|
};
|
|
22745
22847
|
|
|
22746
22848
|
function Point(curve, x, y, z, t) {
|
|
22747
|
-
|
|
22849
|
+
Base.BasePoint.call(this, curve, 'projective');
|
|
22748
22850
|
if (x === null && y === null && z === null) {
|
|
22749
22851
|
this.x = this.curve.zero;
|
|
22750
22852
|
this.y = this.curve.one;
|
|
@@ -22752,10 +22854,10 @@ var solanaWeb3 = (function (exports) {
|
|
|
22752
22854
|
this.t = this.curve.zero;
|
|
22753
22855
|
this.zOne = true;
|
|
22754
22856
|
} else {
|
|
22755
|
-
this.x = new
|
|
22756
|
-
this.y = new
|
|
22757
|
-
this.z = z ? new
|
|
22758
|
-
this.t = t && new
|
|
22857
|
+
this.x = new BN$5(x, 16);
|
|
22858
|
+
this.y = new BN$5(y, 16);
|
|
22859
|
+
this.z = z ? new BN$5(z, 16) : this.curve.one;
|
|
22860
|
+
this.t = t && new BN$5(t, 16);
|
|
22759
22861
|
if (!this.x.red)
|
|
22760
22862
|
this.x = this.x.toRed(this.curve.red);
|
|
22761
22863
|
if (!this.y.red)
|
|
@@ -22774,7 +22876,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
22774
22876
|
}
|
|
22775
22877
|
}
|
|
22776
22878
|
}
|
|
22777
|
-
|
|
22879
|
+
inherits$1(Point, Base.BasePoint);
|
|
22778
22880
|
|
|
22779
22881
|
EdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) {
|
|
22780
22882
|
return Point.fromJSON(this, obj);
|
|
@@ -23066,7 +23168,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
23066
23168
|
Point.prototype.toP = Point.prototype.normalize;
|
|
23067
23169
|
Point.prototype.mixedAdd = Point.prototype.add;
|
|
23068
23170
|
|
|
23069
|
-
|
|
23171
|
+
(function (exports) {
|
|
23070
23172
|
|
|
23071
23173
|
var curve = exports;
|
|
23072
23174
|
|
|
@@ -23074,12 +23176,19 @@ var solanaWeb3 = (function (exports) {
|
|
|
23074
23176
|
curve.short = short;
|
|
23075
23177
|
curve.mont = mont;
|
|
23076
23178
|
curve.edwards = edwards;
|
|
23077
|
-
});
|
|
23179
|
+
}(curve));
|
|
23180
|
+
|
|
23181
|
+
var curves$2 = {};
|
|
23182
|
+
|
|
23183
|
+
var hash$2 = {};
|
|
23184
|
+
|
|
23185
|
+
var utils$g = {};
|
|
23186
|
+
|
|
23187
|
+
var inherits_browser = {exports: {}};
|
|
23078
23188
|
|
|
23079
|
-
var inherits_browser = createCommonjsModule(function (module) {
|
|
23080
23189
|
if (typeof Object.create === 'function') {
|
|
23081
23190
|
// implementation from standard node.js 'util' module
|
|
23082
|
-
|
|
23191
|
+
inherits_browser.exports = function inherits(ctor, superCtor) {
|
|
23083
23192
|
ctor.super_ = superCtor;
|
|
23084
23193
|
ctor.prototype = Object.create(superCtor.prototype, {
|
|
23085
23194
|
constructor: {
|
|
@@ -23092,7 +23201,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
23092
23201
|
};
|
|
23093
23202
|
} else {
|
|
23094
23203
|
// old school shim for old browsers
|
|
23095
|
-
|
|
23204
|
+
inherits_browser.exports = function inherits(ctor, superCtor) {
|
|
23096
23205
|
ctor.super_ = superCtor;
|
|
23097
23206
|
var TempCtor = function () {};
|
|
23098
23207
|
TempCtor.prototype = superCtor.prototype;
|
|
@@ -23100,9 +23209,11 @@ var solanaWeb3 = (function (exports) {
|
|
|
23100
23209
|
ctor.prototype.constructor = ctor;
|
|
23101
23210
|
};
|
|
23102
23211
|
}
|
|
23103
|
-
});
|
|
23104
23212
|
|
|
23105
|
-
var
|
|
23213
|
+
var assert$b = minimalisticAssert;
|
|
23214
|
+
var inherits = inherits_browser.exports;
|
|
23215
|
+
|
|
23216
|
+
utils$g.inherits = inherits;
|
|
23106
23217
|
|
|
23107
23218
|
function isSurrogatePair(msg, i) {
|
|
23108
23219
|
if ((msg.charCodeAt(i) & 0xFC00) !== 0xD800) {
|
|
@@ -23159,7 +23270,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
23159
23270
|
}
|
|
23160
23271
|
return res;
|
|
23161
23272
|
}
|
|
23162
|
-
|
|
23273
|
+
utils$g.toArray = toArray;
|
|
23163
23274
|
|
|
23164
23275
|
function toHex(msg) {
|
|
23165
23276
|
var res = '';
|
|
@@ -23167,7 +23278,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
23167
23278
|
res += zero2(msg[i].toString(16));
|
|
23168
23279
|
return res;
|
|
23169
23280
|
}
|
|
23170
|
-
|
|
23281
|
+
utils$g.toHex = toHex;
|
|
23171
23282
|
|
|
23172
23283
|
function htonl(w) {
|
|
23173
23284
|
var res = (w >>> 24) |
|
|
@@ -23176,7 +23287,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
23176
23287
|
((w & 0xff) << 24);
|
|
23177
23288
|
return res >>> 0;
|
|
23178
23289
|
}
|
|
23179
|
-
|
|
23290
|
+
utils$g.htonl = htonl;
|
|
23180
23291
|
|
|
23181
23292
|
function toHex32(msg, endian) {
|
|
23182
23293
|
var res = '';
|
|
@@ -23188,7 +23299,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
23188
23299
|
}
|
|
23189
23300
|
return res;
|
|
23190
23301
|
}
|
|
23191
|
-
|
|
23302
|
+
utils$g.toHex32 = toHex32;
|
|
23192
23303
|
|
|
23193
23304
|
function zero2(word) {
|
|
23194
23305
|
if (word.length === 1)
|
|
@@ -23196,7 +23307,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
23196
23307
|
else
|
|
23197
23308
|
return word;
|
|
23198
23309
|
}
|
|
23199
|
-
|
|
23310
|
+
utils$g.zero2 = zero2;
|
|
23200
23311
|
|
|
23201
23312
|
function zero8(word) {
|
|
23202
23313
|
if (word.length === 7)
|
|
@@ -23216,11 +23327,11 @@ var solanaWeb3 = (function (exports) {
|
|
|
23216
23327
|
else
|
|
23217
23328
|
return word;
|
|
23218
23329
|
}
|
|
23219
|
-
|
|
23330
|
+
utils$g.zero8 = zero8;
|
|
23220
23331
|
|
|
23221
23332
|
function join32(msg, start, end, endian) {
|
|
23222
23333
|
var len = end - start;
|
|
23223
|
-
|
|
23334
|
+
assert$b(len % 4 === 0);
|
|
23224
23335
|
var res = new Array(len / 4);
|
|
23225
23336
|
for (var i = 0, k = start; i < res.length; i++, k += 4) {
|
|
23226
23337
|
var w;
|
|
@@ -23232,7 +23343,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
23232
23343
|
}
|
|
23233
23344
|
return res;
|
|
23234
23345
|
}
|
|
23235
|
-
|
|
23346
|
+
utils$g.join32 = join32;
|
|
23236
23347
|
|
|
23237
23348
|
function split32(msg, endian) {
|
|
23238
23349
|
var res = new Array(msg.length * 4);
|
|
@@ -23252,37 +23363,37 @@ var solanaWeb3 = (function (exports) {
|
|
|
23252
23363
|
}
|
|
23253
23364
|
return res;
|
|
23254
23365
|
}
|
|
23255
|
-
|
|
23366
|
+
utils$g.split32 = split32;
|
|
23256
23367
|
|
|
23257
23368
|
function rotr32$1(w, b) {
|
|
23258
23369
|
return (w >>> b) | (w << (32 - b));
|
|
23259
23370
|
}
|
|
23260
|
-
|
|
23371
|
+
utils$g.rotr32 = rotr32$1;
|
|
23261
23372
|
|
|
23262
23373
|
function rotl32$2(w, b) {
|
|
23263
23374
|
return (w << b) | (w >>> (32 - b));
|
|
23264
23375
|
}
|
|
23265
|
-
|
|
23376
|
+
utils$g.rotl32 = rotl32$2;
|
|
23266
23377
|
|
|
23267
23378
|
function sum32$3(a, b) {
|
|
23268
23379
|
return (a + b) >>> 0;
|
|
23269
23380
|
}
|
|
23270
|
-
|
|
23381
|
+
utils$g.sum32 = sum32$3;
|
|
23271
23382
|
|
|
23272
23383
|
function sum32_3$1(a, b, c) {
|
|
23273
23384
|
return (a + b + c) >>> 0;
|
|
23274
23385
|
}
|
|
23275
|
-
|
|
23386
|
+
utils$g.sum32_3 = sum32_3$1;
|
|
23276
23387
|
|
|
23277
23388
|
function sum32_4$2(a, b, c, d) {
|
|
23278
23389
|
return (a + b + c + d) >>> 0;
|
|
23279
23390
|
}
|
|
23280
|
-
|
|
23391
|
+
utils$g.sum32_4 = sum32_4$2;
|
|
23281
23392
|
|
|
23282
23393
|
function sum32_5$2(a, b, c, d, e) {
|
|
23283
23394
|
return (a + b + c + d + e) >>> 0;
|
|
23284
23395
|
}
|
|
23285
|
-
|
|
23396
|
+
utils$g.sum32_5 = sum32_5$2;
|
|
23286
23397
|
|
|
23287
23398
|
function sum64$1(buf, pos, ah, al) {
|
|
23288
23399
|
var bh = buf[pos];
|
|
@@ -23293,20 +23404,20 @@ var solanaWeb3 = (function (exports) {
|
|
|
23293
23404
|
buf[pos] = hi >>> 0;
|
|
23294
23405
|
buf[pos + 1] = lo;
|
|
23295
23406
|
}
|
|
23296
|
-
|
|
23407
|
+
utils$g.sum64 = sum64$1;
|
|
23297
23408
|
|
|
23298
23409
|
function sum64_hi$1(ah, al, bh, bl) {
|
|
23299
23410
|
var lo = (al + bl) >>> 0;
|
|
23300
23411
|
var hi = (lo < al ? 1 : 0) + ah + bh;
|
|
23301
23412
|
return hi >>> 0;
|
|
23302
23413
|
}
|
|
23303
|
-
|
|
23414
|
+
utils$g.sum64_hi = sum64_hi$1;
|
|
23304
23415
|
|
|
23305
23416
|
function sum64_lo$1(ah, al, bh, bl) {
|
|
23306
23417
|
var lo = al + bl;
|
|
23307
23418
|
return lo >>> 0;
|
|
23308
23419
|
}
|
|
23309
|
-
|
|
23420
|
+
utils$g.sum64_lo = sum64_lo$1;
|
|
23310
23421
|
|
|
23311
23422
|
function sum64_4_hi$1(ah, al, bh, bl, ch, cl, dh, dl) {
|
|
23312
23423
|
var carry = 0;
|
|
@@ -23321,13 +23432,13 @@ var solanaWeb3 = (function (exports) {
|
|
|
23321
23432
|
var hi = ah + bh + ch + dh + carry;
|
|
23322
23433
|
return hi >>> 0;
|
|
23323
23434
|
}
|
|
23324
|
-
|
|
23435
|
+
utils$g.sum64_4_hi = sum64_4_hi$1;
|
|
23325
23436
|
|
|
23326
23437
|
function sum64_4_lo$1(ah, al, bh, bl, ch, cl, dh, dl) {
|
|
23327
23438
|
var lo = al + bl + cl + dl;
|
|
23328
23439
|
return lo >>> 0;
|
|
23329
23440
|
}
|
|
23330
|
-
|
|
23441
|
+
utils$g.sum64_4_lo = sum64_4_lo$1;
|
|
23331
23442
|
|
|
23332
23443
|
function sum64_5_hi$1(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
|
|
23333
23444
|
var carry = 0;
|
|
@@ -23344,66 +23455,42 @@ var solanaWeb3 = (function (exports) {
|
|
|
23344
23455
|
var hi = ah + bh + ch + dh + eh + carry;
|
|
23345
23456
|
return hi >>> 0;
|
|
23346
23457
|
}
|
|
23347
|
-
|
|
23458
|
+
utils$g.sum64_5_hi = sum64_5_hi$1;
|
|
23348
23459
|
|
|
23349
23460
|
function sum64_5_lo$1(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
|
|
23350
23461
|
var lo = al + bl + cl + dl + el;
|
|
23351
23462
|
|
|
23352
23463
|
return lo >>> 0;
|
|
23353
23464
|
}
|
|
23354
|
-
|
|
23465
|
+
utils$g.sum64_5_lo = sum64_5_lo$1;
|
|
23355
23466
|
|
|
23356
23467
|
function rotr64_hi$1(ah, al, num) {
|
|
23357
23468
|
var r = (al << (32 - num)) | (ah >>> num);
|
|
23358
23469
|
return r >>> 0;
|
|
23359
23470
|
}
|
|
23360
|
-
|
|
23471
|
+
utils$g.rotr64_hi = rotr64_hi$1;
|
|
23361
23472
|
|
|
23362
23473
|
function rotr64_lo$1(ah, al, num) {
|
|
23363
23474
|
var r = (ah << (32 - num)) | (al >>> num);
|
|
23364
23475
|
return r >>> 0;
|
|
23365
23476
|
}
|
|
23366
|
-
|
|
23477
|
+
utils$g.rotr64_lo = rotr64_lo$1;
|
|
23367
23478
|
|
|
23368
23479
|
function shr64_hi$1(ah, al, num) {
|
|
23369
23480
|
return ah >>> num;
|
|
23370
23481
|
}
|
|
23371
|
-
|
|
23482
|
+
utils$g.shr64_hi = shr64_hi$1;
|
|
23372
23483
|
|
|
23373
23484
|
function shr64_lo$1(ah, al, num) {
|
|
23374
23485
|
var r = (ah << (32 - num)) | (al >>> num);
|
|
23375
23486
|
return r >>> 0;
|
|
23376
23487
|
}
|
|
23377
|
-
|
|
23378
|
-
|
|
23379
|
-
var
|
|
23380
|
-
|
|
23381
|
-
|
|
23382
|
-
|
|
23383
|
-
htonl: htonl_1,
|
|
23384
|
-
toHex32: toHex32_1,
|
|
23385
|
-
zero2: zero2_1,
|
|
23386
|
-
zero8: zero8_1,
|
|
23387
|
-
join32: join32_1,
|
|
23388
|
-
split32: split32_1,
|
|
23389
|
-
rotr32: rotr32_1,
|
|
23390
|
-
rotl32: rotl32_1,
|
|
23391
|
-
sum32: sum32_1,
|
|
23392
|
-
sum32_3: sum32_3_1,
|
|
23393
|
-
sum32_4: sum32_4_1,
|
|
23394
|
-
sum32_5: sum32_5_1,
|
|
23395
|
-
sum64: sum64_1,
|
|
23396
|
-
sum64_hi: sum64_hi_1,
|
|
23397
|
-
sum64_lo: sum64_lo_1,
|
|
23398
|
-
sum64_4_hi: sum64_4_hi_1,
|
|
23399
|
-
sum64_4_lo: sum64_4_lo_1,
|
|
23400
|
-
sum64_5_hi: sum64_5_hi_1,
|
|
23401
|
-
sum64_5_lo: sum64_5_lo_1,
|
|
23402
|
-
rotr64_hi: rotr64_hi_1,
|
|
23403
|
-
rotr64_lo: rotr64_lo_1,
|
|
23404
|
-
shr64_hi: shr64_hi_1,
|
|
23405
|
-
shr64_lo: shr64_lo_1
|
|
23406
|
-
};
|
|
23488
|
+
utils$g.shr64_lo = shr64_lo$1;
|
|
23489
|
+
|
|
23490
|
+
var common$5 = {};
|
|
23491
|
+
|
|
23492
|
+
var utils$f = utils$g;
|
|
23493
|
+
var assert$a = minimalisticAssert;
|
|
23407
23494
|
|
|
23408
23495
|
function BlockHash$4() {
|
|
23409
23496
|
this.pending = null;
|
|
@@ -23417,11 +23504,11 @@ var solanaWeb3 = (function (exports) {
|
|
|
23417
23504
|
this._delta8 = this.blockSize / 8;
|
|
23418
23505
|
this._delta32 = this.blockSize / 32;
|
|
23419
23506
|
}
|
|
23420
|
-
|
|
23507
|
+
common$5.BlockHash = BlockHash$4;
|
|
23421
23508
|
|
|
23422
23509
|
BlockHash$4.prototype.update = function update(msg, enc) {
|
|
23423
23510
|
// Convert message to array, pad it, and join into 32bit blocks
|
|
23424
|
-
msg = utils.toArray(msg, enc);
|
|
23511
|
+
msg = utils$f.toArray(msg, enc);
|
|
23425
23512
|
if (!this.pending)
|
|
23426
23513
|
this.pending = msg;
|
|
23427
23514
|
else
|
|
@@ -23438,7 +23525,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
23438
23525
|
if (this.pending.length === 0)
|
|
23439
23526
|
this.pending = null;
|
|
23440
23527
|
|
|
23441
|
-
msg = utils.join32(msg, 0, msg.length - r, this.endian);
|
|
23528
|
+
msg = utils$f.join32(msg, 0, msg.length - r, this.endian);
|
|
23442
23529
|
for (var i = 0; i < msg.length; i += this._delta32)
|
|
23443
23530
|
this._update(msg, i, i + this._delta32);
|
|
23444
23531
|
}
|
|
@@ -23448,7 +23535,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
23448
23535
|
|
|
23449
23536
|
BlockHash$4.prototype.digest = function digest(enc) {
|
|
23450
23537
|
this.update(this._pad());
|
|
23451
|
-
|
|
23538
|
+
assert$a(this.pending === null);
|
|
23452
23539
|
|
|
23453
23540
|
return this._digest(enc);
|
|
23454
23541
|
};
|
|
@@ -23493,11 +23580,12 @@ var solanaWeb3 = (function (exports) {
|
|
|
23493
23580
|
return res;
|
|
23494
23581
|
};
|
|
23495
23582
|
|
|
23496
|
-
var
|
|
23497
|
-
|
|
23498
|
-
};
|
|
23583
|
+
var sha = {};
|
|
23584
|
+
|
|
23585
|
+
var common$4 = {};
|
|
23499
23586
|
|
|
23500
|
-
var
|
|
23587
|
+
var utils$e = utils$g;
|
|
23588
|
+
var rotr32 = utils$e.rotr32;
|
|
23501
23589
|
|
|
23502
23590
|
function ft_1$1(s, x, y, z) {
|
|
23503
23591
|
if (s === 0)
|
|
@@ -23507,59 +23595,52 @@ var solanaWeb3 = (function (exports) {
|
|
|
23507
23595
|
if (s === 2)
|
|
23508
23596
|
return maj32$1(x, y, z);
|
|
23509
23597
|
}
|
|
23510
|
-
|
|
23598
|
+
common$4.ft_1 = ft_1$1;
|
|
23511
23599
|
|
|
23512
23600
|
function ch32$1(x, y, z) {
|
|
23513
23601
|
return (x & y) ^ ((~x) & z);
|
|
23514
23602
|
}
|
|
23515
|
-
|
|
23603
|
+
common$4.ch32 = ch32$1;
|
|
23516
23604
|
|
|
23517
23605
|
function maj32$1(x, y, z) {
|
|
23518
23606
|
return (x & y) ^ (x & z) ^ (y & z);
|
|
23519
23607
|
}
|
|
23520
|
-
|
|
23608
|
+
common$4.maj32 = maj32$1;
|
|
23521
23609
|
|
|
23522
23610
|
function p32(x, y, z) {
|
|
23523
23611
|
return x ^ y ^ z;
|
|
23524
23612
|
}
|
|
23525
|
-
|
|
23613
|
+
common$4.p32 = p32;
|
|
23526
23614
|
|
|
23527
23615
|
function s0_256$1(x) {
|
|
23528
23616
|
return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);
|
|
23529
23617
|
}
|
|
23530
|
-
|
|
23618
|
+
common$4.s0_256 = s0_256$1;
|
|
23531
23619
|
|
|
23532
23620
|
function s1_256$1(x) {
|
|
23533
23621
|
return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);
|
|
23534
23622
|
}
|
|
23535
|
-
|
|
23623
|
+
common$4.s1_256 = s1_256$1;
|
|
23536
23624
|
|
|
23537
23625
|
function g0_256$1(x) {
|
|
23538
23626
|
return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3);
|
|
23539
23627
|
}
|
|
23540
|
-
|
|
23628
|
+
common$4.g0_256 = g0_256$1;
|
|
23541
23629
|
|
|
23542
23630
|
function g1_256$1(x) {
|
|
23543
23631
|
return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10);
|
|
23544
23632
|
}
|
|
23545
|
-
|
|
23633
|
+
common$4.g1_256 = g1_256$1;
|
|
23546
23634
|
|
|
23547
|
-
var
|
|
23548
|
-
|
|
23549
|
-
|
|
23550
|
-
maj32: maj32_1,
|
|
23551
|
-
p32: p32_1,
|
|
23552
|
-
s0_256: s0_256_1,
|
|
23553
|
-
s1_256: s1_256_1,
|
|
23554
|
-
g0_256: g0_256_1,
|
|
23555
|
-
g1_256: g1_256_1
|
|
23556
|
-
};
|
|
23635
|
+
var utils$d = utils$g;
|
|
23636
|
+
var common$3 = common$5;
|
|
23637
|
+
var shaCommon$1 = common$4;
|
|
23557
23638
|
|
|
23558
|
-
var rotl32$1 = utils.rotl32;
|
|
23559
|
-
var sum32$2 = utils.sum32;
|
|
23560
|
-
var sum32_5$1 = utils.sum32_5;
|
|
23561
|
-
var ft_1 =
|
|
23562
|
-
var BlockHash$3 = common$
|
|
23639
|
+
var rotl32$1 = utils$d.rotl32;
|
|
23640
|
+
var sum32$2 = utils$d.sum32;
|
|
23641
|
+
var sum32_5$1 = utils$d.sum32_5;
|
|
23642
|
+
var ft_1 = shaCommon$1.ft_1;
|
|
23643
|
+
var BlockHash$3 = common$3.BlockHash;
|
|
23563
23644
|
|
|
23564
23645
|
var sha1_K = [
|
|
23565
23646
|
0x5A827999, 0x6ED9EBA1,
|
|
@@ -23577,7 +23658,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
23577
23658
|
this.W = new Array(80);
|
|
23578
23659
|
}
|
|
23579
23660
|
|
|
23580
|
-
utils.inherits(SHA1, BlockHash$3);
|
|
23661
|
+
utils$d.inherits(SHA1, BlockHash$3);
|
|
23581
23662
|
var _1 = SHA1;
|
|
23582
23663
|
|
|
23583
23664
|
SHA1.blockSize = 512;
|
|
@@ -23619,22 +23700,27 @@ var solanaWeb3 = (function (exports) {
|
|
|
23619
23700
|
|
|
23620
23701
|
SHA1.prototype._digest = function digest(enc) {
|
|
23621
23702
|
if (enc === 'hex')
|
|
23622
|
-
return utils.toHex32(this.h, 'big');
|
|
23703
|
+
return utils$d.toHex32(this.h, 'big');
|
|
23623
23704
|
else
|
|
23624
|
-
return utils.split32(this.h, 'big');
|
|
23705
|
+
return utils$d.split32(this.h, 'big');
|
|
23625
23706
|
};
|
|
23626
23707
|
|
|
23627
|
-
var
|
|
23628
|
-
var
|
|
23629
|
-
var
|
|
23630
|
-
var
|
|
23631
|
-
var maj32 = common.maj32;
|
|
23632
|
-
var s0_256 = common.s0_256;
|
|
23633
|
-
var s1_256 = common.s1_256;
|
|
23634
|
-
var g0_256 = common.g0_256;
|
|
23635
|
-
var g1_256 = common.g1_256;
|
|
23708
|
+
var utils$c = utils$g;
|
|
23709
|
+
var common$2 = common$5;
|
|
23710
|
+
var shaCommon = common$4;
|
|
23711
|
+
var assert$9 = minimalisticAssert;
|
|
23636
23712
|
|
|
23637
|
-
var
|
|
23713
|
+
var sum32$1 = utils$c.sum32;
|
|
23714
|
+
var sum32_4$1 = utils$c.sum32_4;
|
|
23715
|
+
var sum32_5 = utils$c.sum32_5;
|
|
23716
|
+
var ch32 = shaCommon.ch32;
|
|
23717
|
+
var maj32 = shaCommon.maj32;
|
|
23718
|
+
var s0_256 = shaCommon.s0_256;
|
|
23719
|
+
var s1_256 = shaCommon.s1_256;
|
|
23720
|
+
var g0_256 = shaCommon.g0_256;
|
|
23721
|
+
var g1_256 = shaCommon.g1_256;
|
|
23722
|
+
|
|
23723
|
+
var BlockHash$2 = common$2.BlockHash;
|
|
23638
23724
|
|
|
23639
23725
|
var sha256_K = [
|
|
23640
23726
|
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
|
|
@@ -23655,9 +23741,9 @@ var solanaWeb3 = (function (exports) {
|
|
|
23655
23741
|
0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
|
|
23656
23742
|
];
|
|
23657
23743
|
|
|
23658
|
-
function SHA256() {
|
|
23659
|
-
if (!(this instanceof SHA256))
|
|
23660
|
-
return new SHA256();
|
|
23744
|
+
function SHA256$1() {
|
|
23745
|
+
if (!(this instanceof SHA256$1))
|
|
23746
|
+
return new SHA256$1();
|
|
23661
23747
|
|
|
23662
23748
|
BlockHash$2.call(this);
|
|
23663
23749
|
this.h = [
|
|
@@ -23667,15 +23753,15 @@ var solanaWeb3 = (function (exports) {
|
|
|
23667
23753
|
this.k = sha256_K;
|
|
23668
23754
|
this.W = new Array(64);
|
|
23669
23755
|
}
|
|
23670
|
-
utils.inherits(SHA256, BlockHash$2);
|
|
23671
|
-
var _256 = SHA256;
|
|
23756
|
+
utils$c.inherits(SHA256$1, BlockHash$2);
|
|
23757
|
+
var _256 = SHA256$1;
|
|
23672
23758
|
|
|
23673
|
-
SHA256.blockSize = 512;
|
|
23674
|
-
SHA256.outSize = 256;
|
|
23675
|
-
SHA256.hmacStrength = 192;
|
|
23676
|
-
SHA256.padLength = 64;
|
|
23759
|
+
SHA256$1.blockSize = 512;
|
|
23760
|
+
SHA256$1.outSize = 256;
|
|
23761
|
+
SHA256$1.hmacStrength = 192;
|
|
23762
|
+
SHA256$1.padLength = 64;
|
|
23677
23763
|
|
|
23678
|
-
SHA256.prototype._update = function _update(msg, start) {
|
|
23764
|
+
SHA256$1.prototype._update = function _update(msg, start) {
|
|
23679
23765
|
var W = this.W;
|
|
23680
23766
|
|
|
23681
23767
|
for (var i = 0; i < 16; i++)
|
|
@@ -23692,7 +23778,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
23692
23778
|
var g = this.h[6];
|
|
23693
23779
|
var h = this.h[7];
|
|
23694
23780
|
|
|
23695
|
-
|
|
23781
|
+
assert$9(this.k.length === W.length);
|
|
23696
23782
|
for (i = 0; i < W.length; i++) {
|
|
23697
23783
|
var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);
|
|
23698
23784
|
var T2 = sum32$1(s0_256(a), maj32(a, b, c));
|
|
@@ -23716,23 +23802,26 @@ var solanaWeb3 = (function (exports) {
|
|
|
23716
23802
|
this.h[7] = sum32$1(this.h[7], h);
|
|
23717
23803
|
};
|
|
23718
23804
|
|
|
23719
|
-
SHA256.prototype._digest = function digest(enc) {
|
|
23805
|
+
SHA256$1.prototype._digest = function digest(enc) {
|
|
23720
23806
|
if (enc === 'hex')
|
|
23721
|
-
return utils.toHex32(this.h, 'big');
|
|
23807
|
+
return utils$c.toHex32(this.h, 'big');
|
|
23722
23808
|
else
|
|
23723
|
-
return utils.split32(this.h, 'big');
|
|
23809
|
+
return utils$c.split32(this.h, 'big');
|
|
23724
23810
|
};
|
|
23725
23811
|
|
|
23812
|
+
var utils$b = utils$g;
|
|
23813
|
+
var SHA256 = _256;
|
|
23814
|
+
|
|
23726
23815
|
function SHA224() {
|
|
23727
23816
|
if (!(this instanceof SHA224))
|
|
23728
23817
|
return new SHA224();
|
|
23729
23818
|
|
|
23730
|
-
|
|
23819
|
+
SHA256.call(this);
|
|
23731
23820
|
this.h = [
|
|
23732
23821
|
0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,
|
|
23733
23822
|
0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ];
|
|
23734
23823
|
}
|
|
23735
|
-
utils.inherits(SHA224,
|
|
23824
|
+
utils$b.inherits(SHA224, SHA256);
|
|
23736
23825
|
var _224 = SHA224;
|
|
23737
23826
|
|
|
23738
23827
|
SHA224.blockSize = 512;
|
|
@@ -23743,22 +23832,26 @@ var solanaWeb3 = (function (exports) {
|
|
|
23743
23832
|
SHA224.prototype._digest = function digest(enc) {
|
|
23744
23833
|
// Just truncate output
|
|
23745
23834
|
if (enc === 'hex')
|
|
23746
|
-
return utils.toHex32(this.h.slice(0, 7), 'big');
|
|
23835
|
+
return utils$b.toHex32(this.h.slice(0, 7), 'big');
|
|
23747
23836
|
else
|
|
23748
|
-
return utils.split32(this.h.slice(0, 7), 'big');
|
|
23837
|
+
return utils$b.split32(this.h.slice(0, 7), 'big');
|
|
23749
23838
|
};
|
|
23750
23839
|
|
|
23751
|
-
var
|
|
23752
|
-
var
|
|
23753
|
-
var
|
|
23754
|
-
|
|
23755
|
-
var
|
|
23756
|
-
var
|
|
23757
|
-
var
|
|
23758
|
-
var
|
|
23759
|
-
var
|
|
23760
|
-
var
|
|
23761
|
-
var
|
|
23840
|
+
var utils$a = utils$g;
|
|
23841
|
+
var common$1 = common$5;
|
|
23842
|
+
var assert$8 = minimalisticAssert;
|
|
23843
|
+
|
|
23844
|
+
var rotr64_hi = utils$a.rotr64_hi;
|
|
23845
|
+
var rotr64_lo = utils$a.rotr64_lo;
|
|
23846
|
+
var shr64_hi = utils$a.shr64_hi;
|
|
23847
|
+
var shr64_lo = utils$a.shr64_lo;
|
|
23848
|
+
var sum64 = utils$a.sum64;
|
|
23849
|
+
var sum64_hi = utils$a.sum64_hi;
|
|
23850
|
+
var sum64_lo = utils$a.sum64_lo;
|
|
23851
|
+
var sum64_4_hi = utils$a.sum64_4_hi;
|
|
23852
|
+
var sum64_4_lo = utils$a.sum64_4_lo;
|
|
23853
|
+
var sum64_5_hi = utils$a.sum64_5_hi;
|
|
23854
|
+
var sum64_5_lo = utils$a.sum64_5_lo;
|
|
23762
23855
|
|
|
23763
23856
|
var BlockHash$1 = common$1.BlockHash;
|
|
23764
23857
|
|
|
@@ -23805,9 +23898,9 @@ var solanaWeb3 = (function (exports) {
|
|
|
23805
23898
|
0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
|
|
23806
23899
|
];
|
|
23807
23900
|
|
|
23808
|
-
function SHA512() {
|
|
23809
|
-
if (!(this instanceof SHA512))
|
|
23810
|
-
return new SHA512();
|
|
23901
|
+
function SHA512$1() {
|
|
23902
|
+
if (!(this instanceof SHA512$1))
|
|
23903
|
+
return new SHA512$1();
|
|
23811
23904
|
|
|
23812
23905
|
BlockHash$1.call(this);
|
|
23813
23906
|
this.h = [
|
|
@@ -23822,15 +23915,15 @@ var solanaWeb3 = (function (exports) {
|
|
|
23822
23915
|
this.k = sha512_K;
|
|
23823
23916
|
this.W = new Array(160);
|
|
23824
23917
|
}
|
|
23825
|
-
utils.inherits(SHA512, BlockHash$1);
|
|
23826
|
-
var _512 = SHA512;
|
|
23918
|
+
utils$a.inherits(SHA512$1, BlockHash$1);
|
|
23919
|
+
var _512 = SHA512$1;
|
|
23827
23920
|
|
|
23828
|
-
SHA512.blockSize = 1024;
|
|
23829
|
-
SHA512.outSize = 512;
|
|
23830
|
-
SHA512.hmacStrength = 192;
|
|
23831
|
-
SHA512.padLength = 128;
|
|
23921
|
+
SHA512$1.blockSize = 1024;
|
|
23922
|
+
SHA512$1.outSize = 512;
|
|
23923
|
+
SHA512$1.hmacStrength = 192;
|
|
23924
|
+
SHA512$1.padLength = 128;
|
|
23832
23925
|
|
|
23833
|
-
SHA512.prototype._prepareBlock = function _prepareBlock(msg, start) {
|
|
23926
|
+
SHA512$1.prototype._prepareBlock = function _prepareBlock(msg, start) {
|
|
23834
23927
|
var W = this.W;
|
|
23835
23928
|
|
|
23836
23929
|
// 32 x 32bit words
|
|
@@ -23859,7 +23952,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
23859
23952
|
}
|
|
23860
23953
|
};
|
|
23861
23954
|
|
|
23862
|
-
SHA512.prototype._update = function _update(msg, start) {
|
|
23955
|
+
SHA512$1.prototype._update = function _update(msg, start) {
|
|
23863
23956
|
this._prepareBlock(msg, start);
|
|
23864
23957
|
|
|
23865
23958
|
var W = this.W;
|
|
@@ -23881,7 +23974,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
23881
23974
|
var hh = this.h[14];
|
|
23882
23975
|
var hl = this.h[15];
|
|
23883
23976
|
|
|
23884
|
-
|
|
23977
|
+
assert$8(this.k.length === W.length);
|
|
23885
23978
|
for (var i = 0; i < W.length; i += 2) {
|
|
23886
23979
|
var c0_hi = hh;
|
|
23887
23980
|
var c0_lo = hl;
|
|
@@ -23950,11 +24043,11 @@ var solanaWeb3 = (function (exports) {
|
|
|
23950
24043
|
sum64(this.h, 14, hh, hl);
|
|
23951
24044
|
};
|
|
23952
24045
|
|
|
23953
|
-
SHA512.prototype._digest = function digest(enc) {
|
|
24046
|
+
SHA512$1.prototype._digest = function digest(enc) {
|
|
23954
24047
|
if (enc === 'hex')
|
|
23955
|
-
return utils.toHex32(this.h, 'big');
|
|
24048
|
+
return utils$a.toHex32(this.h, 'big');
|
|
23956
24049
|
else
|
|
23957
|
-
return utils.split32(this.h, 'big');
|
|
24050
|
+
return utils$a.split32(this.h, 'big');
|
|
23958
24051
|
};
|
|
23959
24052
|
|
|
23960
24053
|
function ch64_hi(xh, xl, yh, yl, zh) {
|
|
@@ -24073,11 +24166,15 @@ var solanaWeb3 = (function (exports) {
|
|
|
24073
24166
|
return r;
|
|
24074
24167
|
}
|
|
24075
24168
|
|
|
24169
|
+
var utils$9 = utils$g;
|
|
24170
|
+
|
|
24171
|
+
var SHA512 = _512;
|
|
24172
|
+
|
|
24076
24173
|
function SHA384() {
|
|
24077
24174
|
if (!(this instanceof SHA384))
|
|
24078
24175
|
return new SHA384();
|
|
24079
24176
|
|
|
24080
|
-
|
|
24177
|
+
SHA512.call(this);
|
|
24081
24178
|
this.h = [
|
|
24082
24179
|
0xcbbb9d5d, 0xc1059ed8,
|
|
24083
24180
|
0x629a292a, 0x367cd507,
|
|
@@ -24088,7 +24185,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
24088
24185
|
0xdb0c2e0d, 0x64f98fa7,
|
|
24089
24186
|
0x47b5481d, 0xbefa4fa4 ];
|
|
24090
24187
|
}
|
|
24091
|
-
utils.inherits(SHA384,
|
|
24188
|
+
utils$9.inherits(SHA384, SHA512);
|
|
24092
24189
|
var _384 = SHA384;
|
|
24093
24190
|
|
|
24094
24191
|
SHA384.blockSize = 1024;
|
|
@@ -24098,30 +24195,27 @@ var solanaWeb3 = (function (exports) {
|
|
|
24098
24195
|
|
|
24099
24196
|
SHA384.prototype._digest = function digest(enc) {
|
|
24100
24197
|
if (enc === 'hex')
|
|
24101
|
-
return utils.toHex32(this.h.slice(0, 12), 'big');
|
|
24198
|
+
return utils$9.toHex32(this.h.slice(0, 12), 'big');
|
|
24102
24199
|
else
|
|
24103
|
-
return utils.split32(this.h.slice(0, 12), 'big');
|
|
24200
|
+
return utils$9.split32(this.h.slice(0, 12), 'big');
|
|
24104
24201
|
};
|
|
24105
24202
|
|
|
24106
|
-
|
|
24107
|
-
|
|
24108
|
-
|
|
24109
|
-
|
|
24110
|
-
|
|
24203
|
+
sha.sha1 = _1;
|
|
24204
|
+
sha.sha224 = _224;
|
|
24205
|
+
sha.sha256 = _256;
|
|
24206
|
+
sha.sha384 = _384;
|
|
24207
|
+
sha.sha512 = _512;
|
|
24111
24208
|
|
|
24112
|
-
var
|
|
24113
|
-
sha1: sha1,
|
|
24114
|
-
sha224: sha224,
|
|
24115
|
-
sha256: sha256,
|
|
24116
|
-
sha384: sha384,
|
|
24117
|
-
sha512: sha512
|
|
24118
|
-
};
|
|
24209
|
+
var ripemd = {};
|
|
24119
24210
|
|
|
24120
|
-
var
|
|
24121
|
-
var
|
|
24122
|
-
|
|
24123
|
-
var
|
|
24124
|
-
var
|
|
24211
|
+
var utils$8 = utils$g;
|
|
24212
|
+
var common = common$5;
|
|
24213
|
+
|
|
24214
|
+
var rotl32 = utils$8.rotl32;
|
|
24215
|
+
var sum32 = utils$8.sum32;
|
|
24216
|
+
var sum32_3 = utils$8.sum32_3;
|
|
24217
|
+
var sum32_4 = utils$8.sum32_4;
|
|
24218
|
+
var BlockHash = common.BlockHash;
|
|
24125
24219
|
|
|
24126
24220
|
function RIPEMD160() {
|
|
24127
24221
|
if (!(this instanceof RIPEMD160))
|
|
@@ -24132,8 +24226,8 @@ var solanaWeb3 = (function (exports) {
|
|
|
24132
24226
|
this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ];
|
|
24133
24227
|
this.endian = 'little';
|
|
24134
24228
|
}
|
|
24135
|
-
utils.inherits(RIPEMD160, BlockHash);
|
|
24136
|
-
|
|
24229
|
+
utils$8.inherits(RIPEMD160, BlockHash);
|
|
24230
|
+
ripemd.ripemd160 = RIPEMD160;
|
|
24137
24231
|
|
|
24138
24232
|
RIPEMD160.blockSize = 512;
|
|
24139
24233
|
RIPEMD160.outSize = 160;
|
|
@@ -24183,9 +24277,9 @@ var solanaWeb3 = (function (exports) {
|
|
|
24183
24277
|
|
|
24184
24278
|
RIPEMD160.prototype._digest = function digest(enc) {
|
|
24185
24279
|
if (enc === 'hex')
|
|
24186
|
-
return utils.toHex32(this.h, 'little');
|
|
24280
|
+
return utils$8.toHex32(this.h, 'little');
|
|
24187
24281
|
else
|
|
24188
|
-
return utils.split32(this.h, 'little');
|
|
24282
|
+
return utils$8.split32(this.h, 'little');
|
|
24189
24283
|
};
|
|
24190
24284
|
|
|
24191
24285
|
function f(j, x, y, z) {
|
|
@@ -24259,9 +24353,8 @@ var solanaWeb3 = (function (exports) {
|
|
|
24259
24353
|
8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11
|
|
24260
24354
|
];
|
|
24261
24355
|
|
|
24262
|
-
var
|
|
24263
|
-
|
|
24264
|
-
};
|
|
24356
|
+
var utils$7 = utils$g;
|
|
24357
|
+
var assert$7 = minimalisticAssert;
|
|
24265
24358
|
|
|
24266
24359
|
function Hmac(hash, key, enc) {
|
|
24267
24360
|
if (!(this instanceof Hmac))
|
|
@@ -24272,7 +24365,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
24272
24365
|
this.inner = null;
|
|
24273
24366
|
this.outer = null;
|
|
24274
24367
|
|
|
24275
|
-
this._init(utils.toArray(key, enc));
|
|
24368
|
+
this._init(utils$7.toArray(key, enc));
|
|
24276
24369
|
}
|
|
24277
24370
|
var hmac = Hmac;
|
|
24278
24371
|
|
|
@@ -24280,7 +24373,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
24280
24373
|
// Shorten key, if needed
|
|
24281
24374
|
if (key.length > this.blockSize)
|
|
24282
24375
|
key = new this.Hash().update(key).digest();
|
|
24283
|
-
|
|
24376
|
+
assert$7(key.length <= this.blockSize);
|
|
24284
24377
|
|
|
24285
24378
|
// Add padding to key
|
|
24286
24379
|
for (var i = key.length; i < this.blockSize; i++)
|
|
@@ -24306,11 +24399,11 @@ var solanaWeb3 = (function (exports) {
|
|
|
24306
24399
|
return this.outer.digest(enc);
|
|
24307
24400
|
};
|
|
24308
24401
|
|
|
24309
|
-
|
|
24402
|
+
(function (exports) {
|
|
24310
24403
|
var hash = exports;
|
|
24311
24404
|
|
|
24312
|
-
hash.utils = utils;
|
|
24313
|
-
hash.common = common$
|
|
24405
|
+
hash.utils = utils$g;
|
|
24406
|
+
hash.common = common$5;
|
|
24314
24407
|
hash.sha = sha;
|
|
24315
24408
|
hash.ripemd = ripemd;
|
|
24316
24409
|
hash.hmac = hmac;
|
|
@@ -24322,7 +24415,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
24322
24415
|
hash.sha384 = hash.sha.sha384;
|
|
24323
24416
|
hash.sha512 = hash.sha.sha512;
|
|
24324
24417
|
hash.ripemd160 = hash.ripemd.ripemd160;
|
|
24325
|
-
});
|
|
24418
|
+
}(hash$2));
|
|
24326
24419
|
|
|
24327
24420
|
var secp256k1 = {
|
|
24328
24421
|
doubles: {
|
|
@@ -25105,23 +25198,23 @@ var solanaWeb3 = (function (exports) {
|
|
|
25105
25198
|
},
|
|
25106
25199
|
};
|
|
25107
25200
|
|
|
25108
|
-
|
|
25201
|
+
(function (exports) {
|
|
25109
25202
|
|
|
25110
25203
|
var curves = exports;
|
|
25111
25204
|
|
|
25205
|
+
var hash = hash$2;
|
|
25206
|
+
var curve$1 = curve;
|
|
25207
|
+
var utils = utils$m;
|
|
25112
25208
|
|
|
25113
|
-
|
|
25114
|
-
|
|
25115
|
-
|
|
25116
|
-
var assert = utils_1.assert;
|
|
25209
|
+
var assert = utils.assert;
|
|
25117
25210
|
|
|
25118
25211
|
function PresetCurve(options) {
|
|
25119
25212
|
if (options.type === 'short')
|
|
25120
|
-
this.curve = new
|
|
25213
|
+
this.curve = new curve$1.short(options);
|
|
25121
25214
|
else if (options.type === 'edwards')
|
|
25122
|
-
this.curve = new
|
|
25215
|
+
this.curve = new curve$1.edwards(options);
|
|
25123
25216
|
else
|
|
25124
|
-
this.curve = new
|
|
25217
|
+
this.curve = new curve$1.mont(options);
|
|
25125
25218
|
this.g = this.curve.g;
|
|
25126
25219
|
this.n = this.curve.n;
|
|
25127
25220
|
this.hash = options.hash;
|
|
@@ -25154,7 +25247,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
25154
25247
|
a: 'ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc',
|
|
25155
25248
|
b: '64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1',
|
|
25156
25249
|
n: 'ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831',
|
|
25157
|
-
hash:
|
|
25250
|
+
hash: hash.sha256,
|
|
25158
25251
|
gRed: false,
|
|
25159
25252
|
g: [
|
|
25160
25253
|
'188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012',
|
|
@@ -25169,7 +25262,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
25169
25262
|
a: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe',
|
|
25170
25263
|
b: 'b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4',
|
|
25171
25264
|
n: 'ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d',
|
|
25172
|
-
hash:
|
|
25265
|
+
hash: hash.sha256,
|
|
25173
25266
|
gRed: false,
|
|
25174
25267
|
g: [
|
|
25175
25268
|
'b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21',
|
|
@@ -25184,7 +25277,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
25184
25277
|
a: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc',
|
|
25185
25278
|
b: '5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b',
|
|
25186
25279
|
n: 'ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551',
|
|
25187
|
-
hash:
|
|
25280
|
+
hash: hash.sha256,
|
|
25188
25281
|
gRed: false,
|
|
25189
25282
|
g: [
|
|
25190
25283
|
'6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296',
|
|
@@ -25203,7 +25296,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
25203
25296
|
'5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef',
|
|
25204
25297
|
n: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 ' +
|
|
25205
25298
|
'f4372ddf 581a0db2 48b0a77a ecec196a ccc52973',
|
|
25206
|
-
hash:
|
|
25299
|
+
hash: hash.sha384,
|
|
25207
25300
|
gRed: false,
|
|
25208
25301
|
g: [
|
|
25209
25302
|
'aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 ' +
|
|
@@ -25228,7 +25321,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
25228
25321
|
n: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
|
|
25229
25322
|
'ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 ' +
|
|
25230
25323
|
'f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409',
|
|
25231
|
-
hash:
|
|
25324
|
+
hash: hash.sha512,
|
|
25232
25325
|
gRed: false,
|
|
25233
25326
|
g: [
|
|
25234
25327
|
'000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 ' +
|
|
@@ -25247,7 +25340,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
25247
25340
|
a: '76d06',
|
|
25248
25341
|
b: '1',
|
|
25249
25342
|
n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',
|
|
25250
|
-
hash:
|
|
25343
|
+
hash: hash.sha256,
|
|
25251
25344
|
gRed: false,
|
|
25252
25345
|
g: [
|
|
25253
25346
|
'9',
|
|
@@ -25263,7 +25356,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
25263
25356
|
// -121665 * (121666^(-1)) (mod P)
|
|
25264
25357
|
d: '52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3',
|
|
25265
25358
|
n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',
|
|
25266
|
-
hash:
|
|
25359
|
+
hash: hash.sha256,
|
|
25267
25360
|
gRed: false,
|
|
25268
25361
|
g: [
|
|
25269
25362
|
'216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a',
|
|
@@ -25288,7 +25381,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
25288
25381
|
b: '7',
|
|
25289
25382
|
n: 'ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141',
|
|
25290
25383
|
h: '1',
|
|
25291
|
-
hash:
|
|
25384
|
+
hash: hash.sha256,
|
|
25292
25385
|
|
|
25293
25386
|
// Precomputed endomorphism
|
|
25294
25387
|
beta: '7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee',
|
|
@@ -25311,11 +25404,15 @@ var solanaWeb3 = (function (exports) {
|
|
|
25311
25404
|
pre,
|
|
25312
25405
|
],
|
|
25313
25406
|
});
|
|
25314
|
-
});
|
|
25407
|
+
}(curves$2));
|
|
25315
25408
|
|
|
25316
|
-
|
|
25317
|
-
|
|
25318
|
-
|
|
25409
|
+
var hash$1 = hash$2;
|
|
25410
|
+
var utils$6 = utils$l;
|
|
25411
|
+
var assert$6 = minimalisticAssert;
|
|
25412
|
+
|
|
25413
|
+
function HmacDRBG$1(options) {
|
|
25414
|
+
if (!(this instanceof HmacDRBG$1))
|
|
25415
|
+
return new HmacDRBG$1(options);
|
|
25319
25416
|
this.hash = options.hash;
|
|
25320
25417
|
this.predResist = !!options.predResist;
|
|
25321
25418
|
|
|
@@ -25327,16 +25424,16 @@ var solanaWeb3 = (function (exports) {
|
|
|
25327
25424
|
this.K = null;
|
|
25328
25425
|
this.V = null;
|
|
25329
25426
|
|
|
25330
|
-
var entropy =
|
|
25331
|
-
var nonce =
|
|
25332
|
-
var pers =
|
|
25333
|
-
|
|
25427
|
+
var entropy = utils$6.toArray(options.entropy, options.entropyEnc || 'hex');
|
|
25428
|
+
var nonce = utils$6.toArray(options.nonce, options.nonceEnc || 'hex');
|
|
25429
|
+
var pers = utils$6.toArray(options.pers, options.persEnc || 'hex');
|
|
25430
|
+
assert$6(entropy.length >= (this.minEntropy / 8),
|
|
25334
25431
|
'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');
|
|
25335
25432
|
this._init(entropy, nonce, pers);
|
|
25336
25433
|
}
|
|
25337
|
-
var hmacDrbg = HmacDRBG;
|
|
25434
|
+
var hmacDrbg = HmacDRBG$1;
|
|
25338
25435
|
|
|
25339
|
-
HmacDRBG.prototype._init = function init(entropy, nonce, pers) {
|
|
25436
|
+
HmacDRBG$1.prototype._init = function init(entropy, nonce, pers) {
|
|
25340
25437
|
var seed = entropy.concat(nonce).concat(pers);
|
|
25341
25438
|
|
|
25342
25439
|
this.K = new Array(this.outLen / 8);
|
|
@@ -25351,11 +25448,11 @@ var solanaWeb3 = (function (exports) {
|
|
|
25351
25448
|
this.reseedInterval = 0x1000000000000; // 2^48
|
|
25352
25449
|
};
|
|
25353
25450
|
|
|
25354
|
-
HmacDRBG.prototype._hmac = function hmac() {
|
|
25355
|
-
return new
|
|
25451
|
+
HmacDRBG$1.prototype._hmac = function hmac() {
|
|
25452
|
+
return new hash$1.hmac(this.hash, this.K);
|
|
25356
25453
|
};
|
|
25357
25454
|
|
|
25358
|
-
HmacDRBG.prototype._update = function update(seed) {
|
|
25455
|
+
HmacDRBG$1.prototype._update = function update(seed) {
|
|
25359
25456
|
var kmac = this._hmac()
|
|
25360
25457
|
.update(this.V)
|
|
25361
25458
|
.update([ 0x00 ]);
|
|
@@ -25374,7 +25471,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
25374
25471
|
this.V = this._hmac().update(this.V).digest();
|
|
25375
25472
|
};
|
|
25376
25473
|
|
|
25377
|
-
HmacDRBG.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) {
|
|
25474
|
+
HmacDRBG$1.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) {
|
|
25378
25475
|
// Optional entropy enc
|
|
25379
25476
|
if (typeof entropyEnc !== 'string') {
|
|
25380
25477
|
addEnc = add;
|
|
@@ -25382,17 +25479,17 @@ var solanaWeb3 = (function (exports) {
|
|
|
25382
25479
|
entropyEnc = null;
|
|
25383
25480
|
}
|
|
25384
25481
|
|
|
25385
|
-
entropy =
|
|
25386
|
-
add =
|
|
25482
|
+
entropy = utils$6.toArray(entropy, entropyEnc);
|
|
25483
|
+
add = utils$6.toArray(add, addEnc);
|
|
25387
25484
|
|
|
25388
|
-
|
|
25485
|
+
assert$6(entropy.length >= (this.minEntropy / 8),
|
|
25389
25486
|
'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');
|
|
25390
25487
|
|
|
25391
25488
|
this._update(entropy.concat(add || []));
|
|
25392
25489
|
this._reseed = 1;
|
|
25393
25490
|
};
|
|
25394
25491
|
|
|
25395
|
-
HmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) {
|
|
25492
|
+
HmacDRBG$1.prototype.generate = function generate(len, enc, add, addEnc) {
|
|
25396
25493
|
if (this._reseed > this.reseedInterval)
|
|
25397
25494
|
throw new Error('Reseed is required');
|
|
25398
25495
|
|
|
@@ -25405,7 +25502,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
25405
25502
|
|
|
25406
25503
|
// Optional additional data
|
|
25407
25504
|
if (add) {
|
|
25408
|
-
add =
|
|
25505
|
+
add = utils$6.toArray(add, addEnc || 'hex');
|
|
25409
25506
|
this._update(add);
|
|
25410
25507
|
}
|
|
25411
25508
|
|
|
@@ -25418,12 +25515,14 @@ var solanaWeb3 = (function (exports) {
|
|
|
25418
25515
|
var res = temp.slice(0, len);
|
|
25419
25516
|
this._update(add);
|
|
25420
25517
|
this._reseed++;
|
|
25421
|
-
return
|
|
25518
|
+
return utils$6.encode(res, enc);
|
|
25422
25519
|
};
|
|
25423
25520
|
|
|
25424
|
-
var
|
|
25521
|
+
var BN$4 = bn.exports;
|
|
25522
|
+
var utils$5 = utils$m;
|
|
25523
|
+
var assert$5 = utils$5.assert;
|
|
25425
25524
|
|
|
25426
|
-
function KeyPair$
|
|
25525
|
+
function KeyPair$3(ec, options) {
|
|
25427
25526
|
this.ec = ec;
|
|
25428
25527
|
this.priv = null;
|
|
25429
25528
|
this.pub = null;
|
|
@@ -25434,29 +25533,29 @@ var solanaWeb3 = (function (exports) {
|
|
|
25434
25533
|
if (options.pub)
|
|
25435
25534
|
this._importPublic(options.pub, options.pubEnc);
|
|
25436
25535
|
}
|
|
25437
|
-
var key$1 = KeyPair$
|
|
25536
|
+
var key$1 = KeyPair$3;
|
|
25438
25537
|
|
|
25439
|
-
KeyPair$
|
|
25440
|
-
if (pub instanceof KeyPair$
|
|
25538
|
+
KeyPair$3.fromPublic = function fromPublic(ec, pub, enc) {
|
|
25539
|
+
if (pub instanceof KeyPair$3)
|
|
25441
25540
|
return pub;
|
|
25442
25541
|
|
|
25443
|
-
return new KeyPair$
|
|
25542
|
+
return new KeyPair$3(ec, {
|
|
25444
25543
|
pub: pub,
|
|
25445
25544
|
pubEnc: enc,
|
|
25446
25545
|
});
|
|
25447
25546
|
};
|
|
25448
25547
|
|
|
25449
|
-
KeyPair$
|
|
25450
|
-
if (priv instanceof KeyPair$
|
|
25548
|
+
KeyPair$3.fromPrivate = function fromPrivate(ec, priv, enc) {
|
|
25549
|
+
if (priv instanceof KeyPair$3)
|
|
25451
25550
|
return priv;
|
|
25452
25551
|
|
|
25453
|
-
return new KeyPair$
|
|
25552
|
+
return new KeyPair$3(ec, {
|
|
25454
25553
|
priv: priv,
|
|
25455
25554
|
privEnc: enc,
|
|
25456
25555
|
});
|
|
25457
25556
|
};
|
|
25458
25557
|
|
|
25459
|
-
KeyPair$
|
|
25558
|
+
KeyPair$3.prototype.validate = function validate() {
|
|
25460
25559
|
var pub = this.getPublic();
|
|
25461
25560
|
|
|
25462
25561
|
if (pub.isInfinity())
|
|
@@ -25469,7 +25568,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
25469
25568
|
return { result: true, reason: null };
|
|
25470
25569
|
};
|
|
25471
25570
|
|
|
25472
|
-
KeyPair$
|
|
25571
|
+
KeyPair$3.prototype.getPublic = function getPublic(compact, enc) {
|
|
25473
25572
|
// compact is optional argument
|
|
25474
25573
|
if (typeof compact === 'string') {
|
|
25475
25574
|
enc = compact;
|
|
@@ -25485,22 +25584,22 @@ var solanaWeb3 = (function (exports) {
|
|
|
25485
25584
|
return this.pub.encode(enc, compact);
|
|
25486
25585
|
};
|
|
25487
25586
|
|
|
25488
|
-
KeyPair$
|
|
25587
|
+
KeyPair$3.prototype.getPrivate = function getPrivate(enc) {
|
|
25489
25588
|
if (enc === 'hex')
|
|
25490
25589
|
return this.priv.toString(16, 2);
|
|
25491
25590
|
else
|
|
25492
25591
|
return this.priv;
|
|
25493
25592
|
};
|
|
25494
25593
|
|
|
25495
|
-
KeyPair$
|
|
25496
|
-
this.priv = new
|
|
25594
|
+
KeyPair$3.prototype._importPrivate = function _importPrivate(key, enc) {
|
|
25595
|
+
this.priv = new BN$4(key, enc || 16);
|
|
25497
25596
|
|
|
25498
25597
|
// Ensure that the priv won't be bigger than n, otherwise we may fail
|
|
25499
25598
|
// in fixed multiplication method
|
|
25500
25599
|
this.priv = this.priv.umod(this.ec.curve.n);
|
|
25501
25600
|
};
|
|
25502
25601
|
|
|
25503
|
-
KeyPair$
|
|
25602
|
+
KeyPair$3.prototype._importPublic = function _importPublic(key, enc) {
|
|
25504
25603
|
if (key.x || key.y) {
|
|
25505
25604
|
// Montgomery points only have an `x` coordinate.
|
|
25506
25605
|
// Weierstrass/Edwards points on the other hand have both `x` and
|
|
@@ -25518,7 +25617,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
25518
25617
|
};
|
|
25519
25618
|
|
|
25520
25619
|
// ECDH
|
|
25521
|
-
KeyPair$
|
|
25620
|
+
KeyPair$3.prototype.derive = function derive(pub) {
|
|
25522
25621
|
if(!pub.validate()) {
|
|
25523
25622
|
assert$5(pub.validate(), 'public point not validated');
|
|
25524
25623
|
}
|
|
@@ -25526,37 +25625,40 @@ var solanaWeb3 = (function (exports) {
|
|
|
25526
25625
|
};
|
|
25527
25626
|
|
|
25528
25627
|
// ECDSA
|
|
25529
|
-
KeyPair$
|
|
25628
|
+
KeyPair$3.prototype.sign = function sign(msg, enc, options) {
|
|
25530
25629
|
return this.ec.sign(msg, this, enc, options);
|
|
25531
25630
|
};
|
|
25532
25631
|
|
|
25533
|
-
KeyPair$
|
|
25632
|
+
KeyPair$3.prototype.verify = function verify(msg, signature) {
|
|
25534
25633
|
return this.ec.verify(msg, signature, this);
|
|
25535
25634
|
};
|
|
25536
25635
|
|
|
25537
|
-
KeyPair$
|
|
25636
|
+
KeyPair$3.prototype.inspect = function inspect() {
|
|
25538
25637
|
return '<Key priv: ' + (this.priv && this.priv.toString(16, 2)) +
|
|
25539
25638
|
' pub: ' + (this.pub && this.pub.inspect()) + ' >';
|
|
25540
25639
|
};
|
|
25541
25640
|
|
|
25542
|
-
var
|
|
25641
|
+
var BN$3 = bn.exports;
|
|
25543
25642
|
|
|
25544
|
-
|
|
25545
|
-
|
|
25643
|
+
var utils$4 = utils$m;
|
|
25644
|
+
var assert$4 = utils$4.assert;
|
|
25645
|
+
|
|
25646
|
+
function Signature$3(options, enc) {
|
|
25647
|
+
if (options instanceof Signature$3)
|
|
25546
25648
|
return options;
|
|
25547
25649
|
|
|
25548
25650
|
if (this._importDER(options, enc))
|
|
25549
25651
|
return;
|
|
25550
25652
|
|
|
25551
25653
|
assert$4(options.r && options.s, 'Signature without r or s');
|
|
25552
|
-
this.r = new
|
|
25553
|
-
this.s = new
|
|
25654
|
+
this.r = new BN$3(options.r, 16);
|
|
25655
|
+
this.s = new BN$3(options.s, 16);
|
|
25554
25656
|
if (options.recoveryParam === undefined)
|
|
25555
25657
|
this.recoveryParam = null;
|
|
25556
25658
|
else
|
|
25557
25659
|
this.recoveryParam = options.recoveryParam;
|
|
25558
25660
|
}
|
|
25559
|
-
var signature$1 = Signature$
|
|
25661
|
+
var signature$1 = Signature$3;
|
|
25560
25662
|
|
|
25561
25663
|
function Position() {
|
|
25562
25664
|
this.place = 0;
|
|
@@ -25602,8 +25704,8 @@ var solanaWeb3 = (function (exports) {
|
|
|
25602
25704
|
return buf.slice(i);
|
|
25603
25705
|
}
|
|
25604
25706
|
|
|
25605
|
-
Signature$
|
|
25606
|
-
data =
|
|
25707
|
+
Signature$3.prototype._importDER = function _importDER(data, enc) {
|
|
25708
|
+
data = utils$4.toArray(data, enc);
|
|
25607
25709
|
var p = new Position();
|
|
25608
25710
|
if (data[p.place++] !== 0x30) {
|
|
25609
25711
|
return false;
|
|
@@ -25652,8 +25754,8 @@ var solanaWeb3 = (function (exports) {
|
|
|
25652
25754
|
}
|
|
25653
25755
|
}
|
|
25654
25756
|
|
|
25655
|
-
this.r = new
|
|
25656
|
-
this.s = new
|
|
25757
|
+
this.r = new BN$3(r);
|
|
25758
|
+
this.s = new BN$3(s);
|
|
25657
25759
|
this.recoveryParam = null;
|
|
25658
25760
|
|
|
25659
25761
|
return true;
|
|
@@ -25672,7 +25774,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
25672
25774
|
arr.push(len);
|
|
25673
25775
|
}
|
|
25674
25776
|
|
|
25675
|
-
Signature$
|
|
25777
|
+
Signature$3.prototype.toDER = function toDER(enc) {
|
|
25676
25778
|
var r = this.r.toArray();
|
|
25677
25779
|
var s = this.s.toArray();
|
|
25678
25780
|
|
|
@@ -25698,13 +25800,18 @@ var solanaWeb3 = (function (exports) {
|
|
|
25698
25800
|
var res = [ 0x30 ];
|
|
25699
25801
|
constructLength(res, backHalf.length);
|
|
25700
25802
|
res = res.concat(backHalf);
|
|
25701
|
-
return
|
|
25803
|
+
return utils$4.encode(res, enc);
|
|
25702
25804
|
};
|
|
25703
25805
|
|
|
25704
|
-
var
|
|
25705
|
-
|
|
25706
|
-
|
|
25806
|
+
var BN$2 = bn.exports;
|
|
25807
|
+
var HmacDRBG = hmacDrbg;
|
|
25808
|
+
var utils$3 = utils$m;
|
|
25809
|
+
var curves$1 = curves$2;
|
|
25810
|
+
var rand = brorand.exports;
|
|
25811
|
+
var assert$3 = utils$3.assert;
|
|
25707
25812
|
|
|
25813
|
+
var KeyPair$2 = key$1;
|
|
25814
|
+
var Signature$2 = signature$1;
|
|
25708
25815
|
|
|
25709
25816
|
function EC$1(options) {
|
|
25710
25817
|
if (!(this instanceof EC$1))
|
|
@@ -25712,14 +25819,14 @@ var solanaWeb3 = (function (exports) {
|
|
|
25712
25819
|
|
|
25713
25820
|
// Shortcut `elliptic.ec(curve-name)`
|
|
25714
25821
|
if (typeof options === 'string') {
|
|
25715
|
-
assert$3(Object.prototype.hasOwnProperty.call(
|
|
25822
|
+
assert$3(Object.prototype.hasOwnProperty.call(curves$1, options),
|
|
25716
25823
|
'Unknown curve ' + options);
|
|
25717
25824
|
|
|
25718
|
-
options =
|
|
25825
|
+
options = curves$1[options];
|
|
25719
25826
|
}
|
|
25720
25827
|
|
|
25721
25828
|
// Shortcut for `elliptic.ec(elliptic.curves.curveName)`
|
|
25722
|
-
if (options instanceof
|
|
25829
|
+
if (options instanceof curves$1.PresetCurve)
|
|
25723
25830
|
options = { curve: options };
|
|
25724
25831
|
|
|
25725
25832
|
this.curve = options.curve.curve;
|
|
@@ -25737,15 +25844,15 @@ var solanaWeb3 = (function (exports) {
|
|
|
25737
25844
|
var ec$1 = EC$1;
|
|
25738
25845
|
|
|
25739
25846
|
EC$1.prototype.keyPair = function keyPair(options) {
|
|
25740
|
-
return new
|
|
25847
|
+
return new KeyPair$2(this, options);
|
|
25741
25848
|
};
|
|
25742
25849
|
|
|
25743
25850
|
EC$1.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) {
|
|
25744
|
-
return
|
|
25851
|
+
return KeyPair$2.fromPrivate(this, priv, enc);
|
|
25745
25852
|
};
|
|
25746
25853
|
|
|
25747
25854
|
EC$1.prototype.keyFromPublic = function keyFromPublic(pub, enc) {
|
|
25748
|
-
return
|
|
25855
|
+
return KeyPair$2.fromPublic(this, pub, enc);
|
|
25749
25856
|
};
|
|
25750
25857
|
|
|
25751
25858
|
EC$1.prototype.genKeyPair = function genKeyPair(options) {
|
|
@@ -25753,19 +25860,19 @@ var solanaWeb3 = (function (exports) {
|
|
|
25753
25860
|
options = {};
|
|
25754
25861
|
|
|
25755
25862
|
// Instantiate Hmac_DRBG
|
|
25756
|
-
var drbg = new
|
|
25863
|
+
var drbg = new HmacDRBG({
|
|
25757
25864
|
hash: this.hash,
|
|
25758
25865
|
pers: options.pers,
|
|
25759
25866
|
persEnc: options.persEnc || 'utf8',
|
|
25760
|
-
entropy: options.entropy ||
|
|
25867
|
+
entropy: options.entropy || rand(this.hash.hmacStrength),
|
|
25761
25868
|
entropyEnc: options.entropy && options.entropyEnc || 'utf8',
|
|
25762
25869
|
nonce: this.n.toArray(),
|
|
25763
25870
|
});
|
|
25764
25871
|
|
|
25765
25872
|
var bytes = this.n.byteLength();
|
|
25766
|
-
var ns2 = this.n.sub(new
|
|
25873
|
+
var ns2 = this.n.sub(new BN$2(2));
|
|
25767
25874
|
for (;;) {
|
|
25768
|
-
var priv = new
|
|
25875
|
+
var priv = new BN$2(drbg.generate(bytes));
|
|
25769
25876
|
if (priv.cmp(ns2) > 0)
|
|
25770
25877
|
continue;
|
|
25771
25878
|
|
|
@@ -25793,7 +25900,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
25793
25900
|
options = {};
|
|
25794
25901
|
|
|
25795
25902
|
key = this.keyFromPrivate(key, enc);
|
|
25796
|
-
msg = this._truncateToN(new
|
|
25903
|
+
msg = this._truncateToN(new BN$2(msg, 16));
|
|
25797
25904
|
|
|
25798
25905
|
// Zero-extend key to provide enough entropy
|
|
25799
25906
|
var bytes = this.n.byteLength();
|
|
@@ -25803,7 +25910,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
25803
25910
|
var nonce = msg.toArray('be', bytes);
|
|
25804
25911
|
|
|
25805
25912
|
// Instantiate Hmac_DRBG
|
|
25806
|
-
var drbg = new
|
|
25913
|
+
var drbg = new HmacDRBG({
|
|
25807
25914
|
hash: this.hash,
|
|
25808
25915
|
entropy: bkey,
|
|
25809
25916
|
nonce: nonce,
|
|
@@ -25812,12 +25919,12 @@ var solanaWeb3 = (function (exports) {
|
|
|
25812
25919
|
});
|
|
25813
25920
|
|
|
25814
25921
|
// Number of bytes to generate
|
|
25815
|
-
var ns1 = this.n.sub(new
|
|
25922
|
+
var ns1 = this.n.sub(new BN$2(1));
|
|
25816
25923
|
|
|
25817
25924
|
for (var iter = 0; ; iter++) {
|
|
25818
25925
|
var k = options.k ?
|
|
25819
25926
|
options.k(iter) :
|
|
25820
|
-
new
|
|
25927
|
+
new BN$2(drbg.generate(this.n.byteLength()));
|
|
25821
25928
|
k = this._truncateToN(k, true);
|
|
25822
25929
|
if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0)
|
|
25823
25930
|
continue;
|
|
@@ -25845,14 +25952,14 @@ var solanaWeb3 = (function (exports) {
|
|
|
25845
25952
|
recoveryParam ^= 1;
|
|
25846
25953
|
}
|
|
25847
25954
|
|
|
25848
|
-
return new
|
|
25955
|
+
return new Signature$2({ r: r, s: s, recoveryParam: recoveryParam });
|
|
25849
25956
|
}
|
|
25850
25957
|
};
|
|
25851
25958
|
|
|
25852
25959
|
EC$1.prototype.verify = function verify(msg, signature, key, enc) {
|
|
25853
|
-
msg = this._truncateToN(new
|
|
25960
|
+
msg = this._truncateToN(new BN$2(msg, 16));
|
|
25854
25961
|
key = this.keyFromPublic(key, enc);
|
|
25855
|
-
signature = new
|
|
25962
|
+
signature = new Signature$2(signature, 'hex');
|
|
25856
25963
|
|
|
25857
25964
|
// Perform primitive values validation
|
|
25858
25965
|
var r = signature.r;
|
|
@@ -25891,10 +25998,10 @@ var solanaWeb3 = (function (exports) {
|
|
|
25891
25998
|
|
|
25892
25999
|
EC$1.prototype.recoverPubKey = function(msg, signature, j, enc) {
|
|
25893
26000
|
assert$3((3 & j) === j, 'The recovery param is more than two bits');
|
|
25894
|
-
signature = new
|
|
26001
|
+
signature = new Signature$2(signature, enc);
|
|
25895
26002
|
|
|
25896
26003
|
var n = this.n;
|
|
25897
|
-
var e = new
|
|
26004
|
+
var e = new BN$2(msg);
|
|
25898
26005
|
var r = signature.r;
|
|
25899
26006
|
var s = signature.s;
|
|
25900
26007
|
|
|
@@ -25920,7 +26027,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
25920
26027
|
};
|
|
25921
26028
|
|
|
25922
26029
|
EC$1.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) {
|
|
25923
|
-
signature = new
|
|
26030
|
+
signature = new Signature$2(signature, enc);
|
|
25924
26031
|
if (signature.recoveryParam !== null)
|
|
25925
26032
|
return signature.recoveryParam;
|
|
25926
26033
|
|
|
@@ -25938,9 +26045,10 @@ var solanaWeb3 = (function (exports) {
|
|
|
25938
26045
|
throw new Error('Unable to find valid recovery factor');
|
|
25939
26046
|
};
|
|
25940
26047
|
|
|
25941
|
-
var
|
|
25942
|
-
var
|
|
25943
|
-
var
|
|
26048
|
+
var utils$2 = utils$m;
|
|
26049
|
+
var assert$2 = utils$2.assert;
|
|
26050
|
+
var parseBytes$2 = utils$2.parseBytes;
|
|
26051
|
+
var cachedProperty$1 = utils$2.cachedProperty;
|
|
25944
26052
|
|
|
25945
26053
|
/**
|
|
25946
26054
|
* @param {EDDSA} eddsa - instance
|
|
@@ -25951,7 +26059,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
25951
26059
|
* @param {Array<Byte>} [params.pub] - public key point encoded as bytes
|
|
25952
26060
|
*
|
|
25953
26061
|
*/
|
|
25954
|
-
function KeyPair(eddsa, params) {
|
|
26062
|
+
function KeyPair$1(eddsa, params) {
|
|
25955
26063
|
this.eddsa = eddsa;
|
|
25956
26064
|
this._secret = parseBytes$2(params.secret);
|
|
25957
26065
|
if (eddsa.isPoint(params.pub))
|
|
@@ -25960,33 +26068,33 @@ var solanaWeb3 = (function (exports) {
|
|
|
25960
26068
|
this._pubBytes = parseBytes$2(params.pub);
|
|
25961
26069
|
}
|
|
25962
26070
|
|
|
25963
|
-
KeyPair.fromPublic = function fromPublic(eddsa, pub) {
|
|
25964
|
-
if (pub instanceof KeyPair)
|
|
26071
|
+
KeyPair$1.fromPublic = function fromPublic(eddsa, pub) {
|
|
26072
|
+
if (pub instanceof KeyPair$1)
|
|
25965
26073
|
return pub;
|
|
25966
|
-
return new KeyPair(eddsa, { pub: pub });
|
|
26074
|
+
return new KeyPair$1(eddsa, { pub: pub });
|
|
25967
26075
|
};
|
|
25968
26076
|
|
|
25969
|
-
KeyPair.fromSecret = function fromSecret(eddsa, secret) {
|
|
25970
|
-
if (secret instanceof KeyPair)
|
|
26077
|
+
KeyPair$1.fromSecret = function fromSecret(eddsa, secret) {
|
|
26078
|
+
if (secret instanceof KeyPair$1)
|
|
25971
26079
|
return secret;
|
|
25972
|
-
return new KeyPair(eddsa, { secret: secret });
|
|
26080
|
+
return new KeyPair$1(eddsa, { secret: secret });
|
|
25973
26081
|
};
|
|
25974
26082
|
|
|
25975
|
-
KeyPair.prototype.secret = function secret() {
|
|
26083
|
+
KeyPair$1.prototype.secret = function secret() {
|
|
25976
26084
|
return this._secret;
|
|
25977
26085
|
};
|
|
25978
26086
|
|
|
25979
|
-
cachedProperty$1(KeyPair, 'pubBytes', function pubBytes() {
|
|
26087
|
+
cachedProperty$1(KeyPair$1, 'pubBytes', function pubBytes() {
|
|
25980
26088
|
return this.eddsa.encodePoint(this.pub());
|
|
25981
26089
|
});
|
|
25982
26090
|
|
|
25983
|
-
cachedProperty$1(KeyPair, 'pub', function pub() {
|
|
26091
|
+
cachedProperty$1(KeyPair$1, 'pub', function pub() {
|
|
25984
26092
|
if (this._pubBytes)
|
|
25985
26093
|
return this.eddsa.decodePoint(this._pubBytes);
|
|
25986
26094
|
return this.eddsa.g.mul(this.priv());
|
|
25987
26095
|
});
|
|
25988
26096
|
|
|
25989
|
-
cachedProperty$1(KeyPair, 'privBytes', function privBytes() {
|
|
26097
|
+
cachedProperty$1(KeyPair$1, 'privBytes', function privBytes() {
|
|
25990
26098
|
var eddsa = this.eddsa;
|
|
25991
26099
|
var hash = this.hash();
|
|
25992
26100
|
var lastIx = eddsa.encodingLength - 1;
|
|
@@ -25999,41 +26107,43 @@ var solanaWeb3 = (function (exports) {
|
|
|
25999
26107
|
return a;
|
|
26000
26108
|
});
|
|
26001
26109
|
|
|
26002
|
-
cachedProperty$1(KeyPair, 'priv', function priv() {
|
|
26110
|
+
cachedProperty$1(KeyPair$1, 'priv', function priv() {
|
|
26003
26111
|
return this.eddsa.decodeInt(this.privBytes());
|
|
26004
26112
|
});
|
|
26005
26113
|
|
|
26006
|
-
cachedProperty$1(KeyPair, 'hash', function hash() {
|
|
26114
|
+
cachedProperty$1(KeyPair$1, 'hash', function hash() {
|
|
26007
26115
|
return this.eddsa.hash().update(this.secret()).digest();
|
|
26008
26116
|
});
|
|
26009
26117
|
|
|
26010
|
-
cachedProperty$1(KeyPair, 'messagePrefix', function messagePrefix() {
|
|
26118
|
+
cachedProperty$1(KeyPair$1, 'messagePrefix', function messagePrefix() {
|
|
26011
26119
|
return this.hash().slice(this.eddsa.encodingLength);
|
|
26012
26120
|
});
|
|
26013
26121
|
|
|
26014
|
-
KeyPair.prototype.sign = function sign(message) {
|
|
26122
|
+
KeyPair$1.prototype.sign = function sign(message) {
|
|
26015
26123
|
assert$2(this._secret, 'KeyPair can only verify');
|
|
26016
26124
|
return this.eddsa.sign(message, this);
|
|
26017
26125
|
};
|
|
26018
26126
|
|
|
26019
|
-
KeyPair.prototype.verify = function verify(message, sig) {
|
|
26127
|
+
KeyPair$1.prototype.verify = function verify(message, sig) {
|
|
26020
26128
|
return this.eddsa.verify(message, sig, this);
|
|
26021
26129
|
};
|
|
26022
26130
|
|
|
26023
|
-
KeyPair.prototype.getSecret = function getSecret(enc) {
|
|
26131
|
+
KeyPair$1.prototype.getSecret = function getSecret(enc) {
|
|
26024
26132
|
assert$2(this._secret, 'KeyPair is public only');
|
|
26025
|
-
return
|
|
26133
|
+
return utils$2.encode(this.secret(), enc);
|
|
26026
26134
|
};
|
|
26027
26135
|
|
|
26028
|
-
KeyPair.prototype.getPublic = function getPublic(enc) {
|
|
26029
|
-
return
|
|
26136
|
+
KeyPair$1.prototype.getPublic = function getPublic(enc) {
|
|
26137
|
+
return utils$2.encode(this.pubBytes(), enc);
|
|
26030
26138
|
};
|
|
26031
26139
|
|
|
26032
|
-
var key = KeyPair;
|
|
26140
|
+
var key = KeyPair$1;
|
|
26033
26141
|
|
|
26034
|
-
var
|
|
26035
|
-
var
|
|
26036
|
-
var
|
|
26142
|
+
var BN$1 = bn.exports;
|
|
26143
|
+
var utils$1 = utils$m;
|
|
26144
|
+
var assert$1 = utils$1.assert;
|
|
26145
|
+
var cachedProperty = utils$1.cachedProperty;
|
|
26146
|
+
var parseBytes$1 = utils$1.parseBytes;
|
|
26037
26147
|
|
|
26038
26148
|
/**
|
|
26039
26149
|
* @param {EDDSA} eddsa - eddsa instance
|
|
@@ -26043,7 +26153,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
26043
26153
|
* @param {Array<Bytes>} [sig.Rencoded] - R point encoded
|
|
26044
26154
|
* @param {Array<Bytes>} [sig.Sencoded] - S scalar encoded
|
|
26045
26155
|
*/
|
|
26046
|
-
function Signature(eddsa, sig) {
|
|
26156
|
+
function Signature$1(eddsa, sig) {
|
|
26047
26157
|
this.eddsa = eddsa;
|
|
26048
26158
|
|
|
26049
26159
|
if (typeof sig !== 'object')
|
|
@@ -26060,43 +26170,46 @@ var solanaWeb3 = (function (exports) {
|
|
|
26060
26170
|
|
|
26061
26171
|
if (eddsa.isPoint(sig.R))
|
|
26062
26172
|
this._R = sig.R;
|
|
26063
|
-
if (sig.S instanceof
|
|
26173
|
+
if (sig.S instanceof BN$1)
|
|
26064
26174
|
this._S = sig.S;
|
|
26065
26175
|
|
|
26066
26176
|
this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded;
|
|
26067
26177
|
this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded;
|
|
26068
26178
|
}
|
|
26069
26179
|
|
|
26070
|
-
cachedProperty(Signature, 'S', function S() {
|
|
26180
|
+
cachedProperty(Signature$1, 'S', function S() {
|
|
26071
26181
|
return this.eddsa.decodeInt(this.Sencoded());
|
|
26072
26182
|
});
|
|
26073
26183
|
|
|
26074
|
-
cachedProperty(Signature, 'R', function R() {
|
|
26184
|
+
cachedProperty(Signature$1, 'R', function R() {
|
|
26075
26185
|
return this.eddsa.decodePoint(this.Rencoded());
|
|
26076
26186
|
});
|
|
26077
26187
|
|
|
26078
|
-
cachedProperty(Signature, 'Rencoded', function Rencoded() {
|
|
26188
|
+
cachedProperty(Signature$1, 'Rencoded', function Rencoded() {
|
|
26079
26189
|
return this.eddsa.encodePoint(this.R());
|
|
26080
26190
|
});
|
|
26081
26191
|
|
|
26082
|
-
cachedProperty(Signature, 'Sencoded', function Sencoded() {
|
|
26192
|
+
cachedProperty(Signature$1, 'Sencoded', function Sencoded() {
|
|
26083
26193
|
return this.eddsa.encodeInt(this.S());
|
|
26084
26194
|
});
|
|
26085
26195
|
|
|
26086
|
-
Signature.prototype.toBytes = function toBytes() {
|
|
26196
|
+
Signature$1.prototype.toBytes = function toBytes() {
|
|
26087
26197
|
return this.Rencoded().concat(this.Sencoded());
|
|
26088
26198
|
};
|
|
26089
26199
|
|
|
26090
|
-
Signature.prototype.toHex = function toHex() {
|
|
26091
|
-
return
|
|
26200
|
+
Signature$1.prototype.toHex = function toHex() {
|
|
26201
|
+
return utils$1.encode(this.toBytes(), 'hex').toUpperCase();
|
|
26092
26202
|
};
|
|
26093
26203
|
|
|
26094
|
-
var signature = Signature;
|
|
26095
|
-
|
|
26096
|
-
var assert = utils_1.assert;
|
|
26097
|
-
var parseBytes = utils_1.parseBytes;
|
|
26098
|
-
|
|
26204
|
+
var signature = Signature$1;
|
|
26099
26205
|
|
|
26206
|
+
var hash = hash$2;
|
|
26207
|
+
var curves = curves$2;
|
|
26208
|
+
var utils = utils$m;
|
|
26209
|
+
var assert = utils.assert;
|
|
26210
|
+
var parseBytes = utils.parseBytes;
|
|
26211
|
+
var KeyPair = key;
|
|
26212
|
+
var Signature = signature;
|
|
26100
26213
|
|
|
26101
26214
|
function EDDSA(curve) {
|
|
26102
26215
|
assert(curve === 'ed25519', 'only tested with ed25519 so far');
|
|
@@ -26104,14 +26217,14 @@ var solanaWeb3 = (function (exports) {
|
|
|
26104
26217
|
if (!(this instanceof EDDSA))
|
|
26105
26218
|
return new EDDSA(curve);
|
|
26106
26219
|
|
|
26107
|
-
curve =
|
|
26220
|
+
curve = curves[curve].curve;
|
|
26108
26221
|
this.curve = curve;
|
|
26109
26222
|
this.g = curve.g;
|
|
26110
26223
|
this.g.precompute(curve.n.bitLength() + 1);
|
|
26111
26224
|
|
|
26112
26225
|
this.pointClass = curve.point().constructor;
|
|
26113
26226
|
this.encodingLength = Math.ceil(curve.n.bitLength() / 8);
|
|
26114
|
-
this.hash =
|
|
26227
|
+
this.hash = hash.sha512;
|
|
26115
26228
|
}
|
|
26116
26229
|
|
|
26117
26230
|
var eddsa = EDDSA;
|
|
@@ -26153,21 +26266,21 @@ var solanaWeb3 = (function (exports) {
|
|
|
26153
26266
|
var hash = this.hash();
|
|
26154
26267
|
for (var i = 0; i < arguments.length; i++)
|
|
26155
26268
|
hash.update(arguments[i]);
|
|
26156
|
-
return
|
|
26269
|
+
return utils.intFromLE(hash.digest()).umod(this.curve.n);
|
|
26157
26270
|
};
|
|
26158
26271
|
|
|
26159
26272
|
EDDSA.prototype.keyFromPublic = function keyFromPublic(pub) {
|
|
26160
|
-
return
|
|
26273
|
+
return KeyPair.fromPublic(this, pub);
|
|
26161
26274
|
};
|
|
26162
26275
|
|
|
26163
26276
|
EDDSA.prototype.keyFromSecret = function keyFromSecret(secret) {
|
|
26164
|
-
return
|
|
26277
|
+
return KeyPair.fromSecret(this, secret);
|
|
26165
26278
|
};
|
|
26166
26279
|
|
|
26167
26280
|
EDDSA.prototype.makeSignature = function makeSignature(sig) {
|
|
26168
|
-
if (sig instanceof
|
|
26281
|
+
if (sig instanceof Signature)
|
|
26169
26282
|
return sig;
|
|
26170
|
-
return new
|
|
26283
|
+
return new Signature(this, sig);
|
|
26171
26284
|
};
|
|
26172
26285
|
|
|
26173
26286
|
/**
|
|
@@ -26185,13 +26298,13 @@ var solanaWeb3 = (function (exports) {
|
|
|
26185
26298
|
};
|
|
26186
26299
|
|
|
26187
26300
|
EDDSA.prototype.decodePoint = function decodePoint(bytes) {
|
|
26188
|
-
bytes =
|
|
26301
|
+
bytes = utils.parseBytes(bytes);
|
|
26189
26302
|
|
|
26190
26303
|
var lastIx = bytes.length - 1;
|
|
26191
26304
|
var normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & ~0x80);
|
|
26192
26305
|
var xIsOdd = (bytes[lastIx] & 0x80) !== 0;
|
|
26193
26306
|
|
|
26194
|
-
var y =
|
|
26307
|
+
var y = utils.intFromLE(normed);
|
|
26195
26308
|
return this.curve.pointFromY(y, xIsOdd);
|
|
26196
26309
|
};
|
|
26197
26310
|
|
|
@@ -26200,29 +26313,29 @@ var solanaWeb3 = (function (exports) {
|
|
|
26200
26313
|
};
|
|
26201
26314
|
|
|
26202
26315
|
EDDSA.prototype.decodeInt = function decodeInt(bytes) {
|
|
26203
|
-
return
|
|
26316
|
+
return utils.intFromLE(bytes);
|
|
26204
26317
|
};
|
|
26205
26318
|
|
|
26206
26319
|
EDDSA.prototype.isPoint = function isPoint(val) {
|
|
26207
26320
|
return val instanceof this.pointClass;
|
|
26208
26321
|
};
|
|
26209
26322
|
|
|
26210
|
-
|
|
26323
|
+
(function (exports) {
|
|
26211
26324
|
|
|
26212
26325
|
var elliptic = exports;
|
|
26213
26326
|
|
|
26214
26327
|
elliptic.version = require$$0.version;
|
|
26215
|
-
elliptic.utils =
|
|
26216
|
-
elliptic.rand = brorand;
|
|
26217
|
-
elliptic.curve =
|
|
26218
|
-
elliptic.curves =
|
|
26328
|
+
elliptic.utils = utils$m;
|
|
26329
|
+
elliptic.rand = brorand.exports;
|
|
26330
|
+
elliptic.curve = curve;
|
|
26331
|
+
elliptic.curves = curves$2;
|
|
26219
26332
|
|
|
26220
26333
|
// Protocols
|
|
26221
26334
|
elliptic.ec = ec$1;
|
|
26222
26335
|
elliptic.eddsa = eddsa;
|
|
26223
|
-
});
|
|
26336
|
+
}(elliptic$2));
|
|
26224
26337
|
|
|
26225
|
-
const EC =
|
|
26338
|
+
const EC = elliptic$2.ec;
|
|
26226
26339
|
|
|
26227
26340
|
const ec = new EC('secp256k1');
|
|
26228
26341
|
const ecparams = ec.curve;
|
|
@@ -26627,7 +26740,9 @@ var solanaWeb3 = (function (exports) {
|
|
|
26627
26740
|
|
|
26628
26741
|
var elliptic = lib(elliptic$1);
|
|
26629
26742
|
|
|
26630
|
-
var sha3 =
|
|
26743
|
+
var sha3 = {exports: {}};
|
|
26744
|
+
|
|
26745
|
+
(function (module) {
|
|
26631
26746
|
/*jslint bitwise: true */
|
|
26632
26747
|
(function () {
|
|
26633
26748
|
|
|
@@ -27269,7 +27384,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
27269
27384
|
}
|
|
27270
27385
|
}
|
|
27271
27386
|
})();
|
|
27272
|
-
});
|
|
27387
|
+
}(sha3));
|
|
27273
27388
|
|
|
27274
27389
|
const {
|
|
27275
27390
|
publicKeyCreate,
|
|
@@ -27299,10 +27414,10 @@ var solanaWeb3 = (function (exports) {
|
|
|
27299
27414
|
* @param {Buffer} publicKey a 64 byte secp256k1 public key buffer
|
|
27300
27415
|
*/
|
|
27301
27416
|
static publicKeyToEthAddress(publicKey) {
|
|
27302
|
-
assert$
|
|
27417
|
+
assert$j(publicKey.length === PUBLIC_KEY_BYTES, "Public key must be ".concat(PUBLIC_KEY_BYTES, " bytes but received ").concat(publicKey.length, " bytes"));
|
|
27303
27418
|
|
|
27304
27419
|
try {
|
|
27305
|
-
return buffer.Buffer.from(sha3.keccak_256.update(toBuffer(publicKey)).digest()).slice(-ETHEREUM_ADDRESS_BYTES);
|
|
27420
|
+
return buffer.Buffer.from(sha3.exports.keccak_256.update(toBuffer(publicKey)).digest()).slice(-ETHEREUM_ADDRESS_BYTES);
|
|
27306
27421
|
} catch (error) {
|
|
27307
27422
|
throw new Error("Error constructing Ethereum address: ".concat(error));
|
|
27308
27423
|
}
|
|
@@ -27352,7 +27467,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
27352
27467
|
ethAddress = rawAddress;
|
|
27353
27468
|
}
|
|
27354
27469
|
|
|
27355
|
-
assert$
|
|
27470
|
+
assert$j(ethAddress.length === ETHEREUM_ADDRESS_BYTES, "Address must be ".concat(ETHEREUM_ADDRESS_BYTES, " bytes but received ").concat(ethAddress.length, " bytes"));
|
|
27356
27471
|
const dataStart = 1 + SIGNATURE_OFFSETS_SERIALIZED_SIZE;
|
|
27357
27472
|
const ethAddressOffset = dataStart;
|
|
27358
27473
|
const signatureOffset = dataStart + ethAddress.length;
|
|
@@ -27390,13 +27505,13 @@ var solanaWeb3 = (function (exports) {
|
|
|
27390
27505
|
privateKey: pkey,
|
|
27391
27506
|
message
|
|
27392
27507
|
} = params;
|
|
27393
|
-
assert$
|
|
27508
|
+
assert$j(pkey.length === PRIVATE_KEY_BYTES, "Private key must be ".concat(PRIVATE_KEY_BYTES, " bytes but received ").concat(pkey.length, " bytes"));
|
|
27394
27509
|
|
|
27395
27510
|
try {
|
|
27396
27511
|
const privateKey = toBuffer(pkey);
|
|
27397
27512
|
const publicKey = publicKeyCreate(privateKey, false).slice(1); // throw away leading byte
|
|
27398
27513
|
|
|
27399
|
-
const messageHash = buffer.Buffer.from(sha3.keccak_256.update(toBuffer(message)).digest());
|
|
27514
|
+
const messageHash = buffer.Buffer.from(sha3.exports.keccak_256.update(toBuffer(message)).digest());
|
|
27400
27515
|
const {
|
|
27401
27516
|
signature,
|
|
27402
27517
|
recid: recoveryId
|
|
@@ -27467,10 +27582,8 @@ var solanaWeb3 = (function (exports) {
|
|
|
27467
27582
|
const configKeys = [];
|
|
27468
27583
|
|
|
27469
27584
|
for (let i = 0; i < 2; i++) {
|
|
27470
|
-
const publicKey = new PublicKey(byteArray
|
|
27471
|
-
|
|
27472
|
-
const isSigner = byteArray.slice(0, 1)[0] === 1;
|
|
27473
|
-
byteArray = byteArray.slice(1);
|
|
27585
|
+
const publicKey = new PublicKey(guardedSplice(byteArray, 0, PUBKEY_LENGTH));
|
|
27586
|
+
const isSigner = guardedShift(byteArray) === 1;
|
|
27474
27587
|
configKeys.push({
|
|
27475
27588
|
publicKey,
|
|
27476
27589
|
isSigner
|
|
@@ -27481,7 +27594,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
27481
27594
|
if (configKeys[1].isSigner) {
|
|
27482
27595
|
const rawInfo = rustString().decode(buffer.Buffer.from(byteArray));
|
|
27483
27596
|
const info = JSON.parse(rawInfo);
|
|
27484
|
-
assert$
|
|
27597
|
+
assert$h(info, InfoString);
|
|
27485
27598
|
return new ValidatorInfo(configKeys[1].publicKey, info);
|
|
27486
27599
|
}
|
|
27487
27600
|
}
|