@leofcoin/peernet 1.1.42 → 1.1.44
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/exports/browser/{client-04e44411.js → client-020c00d8.js} +10 -6
- package/exports/browser/{index-b5c99174.js → index-ed935219.js} +1 -1
- package/exports/browser/{messages-3a71ed04.js → messages-cc3774b5.js} +1 -1
- package/exports/browser/{peernet-3b8a488e.js → peernet-4fce82bc.js} +51 -56
- package/exports/browser/peernet.js +1 -1
- package/package.json +2 -2
|
@@ -10605,13 +10605,17 @@ let P2PT$1 = class P2PT extends require$$0$5 {
|
|
|
10605
10605
|
*/
|
|
10606
10606
|
start() {
|
|
10607
10607
|
this.on('peer', peer => {
|
|
10608
|
-
let newpeer = false;
|
|
10609
|
-
if (!this.peers[peer.id]) {
|
|
10610
|
-
newpeer = true;
|
|
10611
|
-
this.peers[peer.id] = {};
|
|
10612
|
-
this.responseWaiting[peer.id] = {};
|
|
10613
|
-
}
|
|
10614
10608
|
peer.on('connect', () => {
|
|
10609
|
+
let newpeer = false;
|
|
10610
|
+
/**
|
|
10611
|
+
* peer connected or reconnected
|
|
10612
|
+
* Sometimes peers reconnect so need to handle the newpeer here
|
|
10613
|
+
*/
|
|
10614
|
+
if (!this.peers[peer.id]) {
|
|
10615
|
+
newpeer = true;
|
|
10616
|
+
this.peers[peer.id] = {};
|
|
10617
|
+
this.responseWaiting[peer.id] = {};
|
|
10618
|
+
}
|
|
10615
10619
|
/**
|
|
10616
10620
|
* Multiple data channels to one peer is possible
|
|
10617
10621
|
* The `peer` object actually refers to a peer with a data channel. Even though it may have same `id` (peerID) property, the data channel will be different. Different trackers giving the same "peer" will give the `peer` object with different channels.
|
|
@@ -648,6 +648,10 @@ var index$2 = {
|
|
|
648
648
|
|
|
649
649
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
650
650
|
|
|
651
|
+
function getDefaultExportFromCjs (x) {
|
|
652
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
653
|
+
}
|
|
654
|
+
|
|
651
655
|
function getAugmentedNamespace(n) {
|
|
652
656
|
if (n.__esModule) return n;
|
|
653
657
|
var f = n.default;
|
|
@@ -676,11 +680,7 @@ function getAugmentedNamespace(n) {
|
|
|
676
680
|
return a;
|
|
677
681
|
}
|
|
678
682
|
|
|
679
|
-
var
|
|
680
|
-
var bn$1 = {
|
|
681
|
-
get exports(){ return bnExports$1; },
|
|
682
|
-
set exports(v){ bnExports$1 = v; },
|
|
683
|
-
};
|
|
683
|
+
var bn$1 = {exports: {}};
|
|
684
684
|
|
|
685
685
|
var _nodeResolve_empty = {};
|
|
686
686
|
|
|
@@ -4039,10 +4039,11 @@ var require$$0$1 = /*@__PURE__*/getAugmentedNamespace(_nodeResolve_empty$1);
|
|
|
4039
4039
|
var res = this.imod(a._invmp(this.m).mul(this.r2));
|
|
4040
4040
|
return res._forceRed(this);
|
|
4041
4041
|
};
|
|
4042
|
-
})(module, commonjsGlobal);
|
|
4042
|
+
})(module, commonjsGlobal);
|
|
4043
4043
|
} (bn$1));
|
|
4044
4044
|
|
|
4045
|
-
var
|
|
4045
|
+
var bnExports$1 = bn$1.exports;
|
|
4046
|
+
var _BN = /*@__PURE__*/getDefaultExportFromCjs(bnExports$1);
|
|
4046
4047
|
|
|
4047
4048
|
const version$4 = "logger/5.7.0";
|
|
4048
4049
|
|
|
@@ -7146,11 +7147,7 @@ var require$$0 = {
|
|
|
7146
7147
|
|
|
7147
7148
|
var utils$o = {};
|
|
7148
7149
|
|
|
7149
|
-
var
|
|
7150
|
-
var bn = {
|
|
7151
|
-
get exports(){ return bnExports; },
|
|
7152
|
-
set exports(v){ bnExports = v; },
|
|
7153
|
-
};
|
|
7150
|
+
var bn = {exports: {}};
|
|
7154
7151
|
|
|
7155
7152
|
(function (module) {
|
|
7156
7153
|
(function (module, exports) {
|
|
@@ -10595,9 +10592,11 @@ var bn = {
|
|
|
10595
10592
|
var res = this.imod(a._invmp(this.m).mul(this.r2));
|
|
10596
10593
|
return res._forceRed(this);
|
|
10597
10594
|
};
|
|
10598
|
-
})(module, commonjsGlobal);
|
|
10595
|
+
})(module, commonjsGlobal);
|
|
10599
10596
|
} (bn));
|
|
10600
10597
|
|
|
10598
|
+
var bnExports = bn.exports;
|
|
10599
|
+
|
|
10601
10600
|
var minimalisticAssert = assert$f;
|
|
10602
10601
|
|
|
10603
10602
|
function assert$f(val, msg) {
|
|
@@ -10669,7 +10668,7 @@ var utils$n = {};
|
|
|
10669
10668
|
return toHex(arr);
|
|
10670
10669
|
else
|
|
10671
10670
|
return arr;
|
|
10672
|
-
};
|
|
10671
|
+
};
|
|
10673
10672
|
} (utils$n));
|
|
10674
10673
|
|
|
10675
10674
|
(function (exports) {
|
|
@@ -10789,14 +10788,10 @@ var utils$n = {};
|
|
|
10789
10788
|
function intFromLE(bytes) {
|
|
10790
10789
|
return new BN(bytes, 'hex', 'le');
|
|
10791
10790
|
}
|
|
10792
|
-
utils.intFromLE = intFromLE;
|
|
10791
|
+
utils.intFromLE = intFromLE;
|
|
10793
10792
|
} (utils$o));
|
|
10794
10793
|
|
|
10795
|
-
var
|
|
10796
|
-
var brorand = {
|
|
10797
|
-
get exports(){ return brorandExports; },
|
|
10798
|
-
set exports(v){ brorandExports = v; },
|
|
10799
|
-
};
|
|
10794
|
+
var brorand = {exports: {}};
|
|
10800
10795
|
|
|
10801
10796
|
var r$1;
|
|
10802
10797
|
|
|
@@ -10810,7 +10805,7 @@ brorand.exports = function rand(len) {
|
|
|
10810
10805
|
function Rand(rand) {
|
|
10811
10806
|
this.rand = rand;
|
|
10812
10807
|
}
|
|
10813
|
-
|
|
10808
|
+
brorand.exports.Rand = Rand;
|
|
10814
10809
|
|
|
10815
10810
|
Rand.prototype.generate = function generate(len) {
|
|
10816
10811
|
return this._rand(len);
|
|
@@ -10864,6 +10859,8 @@ if (typeof self === 'object') {
|
|
|
10864
10859
|
}
|
|
10865
10860
|
}
|
|
10866
10861
|
|
|
10862
|
+
var brorandExports = brorand.exports;
|
|
10863
|
+
|
|
10867
10864
|
var curve = {};
|
|
10868
10865
|
|
|
10869
10866
|
var BN$8 = bnExports;
|
|
@@ -11245,11 +11242,7 @@ BasePoint.prototype.dblp = function dblp(k) {
|
|
|
11245
11242
|
return r;
|
|
11246
11243
|
};
|
|
11247
11244
|
|
|
11248
|
-
var
|
|
11249
|
-
var inherits_browser = {
|
|
11250
|
-
get exports(){ return inherits_browserExports; },
|
|
11251
|
-
set exports(v){ inherits_browserExports = v; },
|
|
11252
|
-
};
|
|
11245
|
+
var inherits_browser = {exports: {}};
|
|
11253
11246
|
|
|
11254
11247
|
if (typeof Object.create === 'function') {
|
|
11255
11248
|
// implementation from standard node.js 'util' module
|
|
@@ -11279,6 +11272,8 @@ if (typeof Object.create === 'function') {
|
|
|
11279
11272
|
};
|
|
11280
11273
|
}
|
|
11281
11274
|
|
|
11275
|
+
var inherits_browserExports = inherits_browser.exports;
|
|
11276
|
+
|
|
11282
11277
|
var utils$l = utils$o;
|
|
11283
11278
|
var BN$7 = bnExports;
|
|
11284
11279
|
var inherits$3 = inherits_browserExports;
|
|
@@ -12834,7 +12829,7 @@ Point.prototype.mixedAdd = Point.prototype.add;
|
|
|
12834
12829
|
curve.base = base;
|
|
12835
12830
|
curve.short = short;
|
|
12836
12831
|
curve.mont = mont;
|
|
12837
|
-
curve.edwards = edwards;
|
|
12832
|
+
curve.edwards = edwards;
|
|
12838
12833
|
} (curve));
|
|
12839
12834
|
|
|
12840
12835
|
var curves$2 = {};
|
|
@@ -14047,16 +14042,16 @@ Hmac.prototype.digest = function digest(enc) {
|
|
|
14047
14042
|
hash.sha224 = hash.sha.sha224;
|
|
14048
14043
|
hash.sha384 = hash.sha.sha384;
|
|
14049
14044
|
hash.sha512 = hash.sha.sha512;
|
|
14050
|
-
hash.ripemd160 = hash.ripemd.ripemd160;
|
|
14045
|
+
hash.ripemd160 = hash.ripemd.ripemd160;
|
|
14051
14046
|
} (hash$2));
|
|
14052
14047
|
|
|
14053
|
-
var secp256k1;
|
|
14048
|
+
var secp256k1$1;
|
|
14054
14049
|
var hasRequiredSecp256k1;
|
|
14055
14050
|
|
|
14056
14051
|
function requireSecp256k1 () {
|
|
14057
|
-
if (hasRequiredSecp256k1) return secp256k1;
|
|
14052
|
+
if (hasRequiredSecp256k1) return secp256k1$1;
|
|
14058
14053
|
hasRequiredSecp256k1 = 1;
|
|
14059
|
-
secp256k1 = {
|
|
14054
|
+
secp256k1$1 = {
|
|
14060
14055
|
doubles: {
|
|
14061
14056
|
step: 4,
|
|
14062
14057
|
points: [
|
|
@@ -14836,7 +14831,7 @@ function requireSecp256k1 () {
|
|
|
14836
14831
|
],
|
|
14837
14832
|
},
|
|
14838
14833
|
};
|
|
14839
|
-
return secp256k1;
|
|
14834
|
+
return secp256k1$1;
|
|
14840
14835
|
}
|
|
14841
14836
|
|
|
14842
14837
|
(function (exports) {
|
|
@@ -15044,7 +15039,7 @@ function requireSecp256k1 () {
|
|
|
15044
15039
|
'483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8',
|
|
15045
15040
|
pre,
|
|
15046
15041
|
],
|
|
15047
|
-
});
|
|
15042
|
+
});
|
|
15048
15043
|
} (curves$2));
|
|
15049
15044
|
|
|
15050
15045
|
var hash$1 = hash$2;
|
|
@@ -15973,7 +15968,7 @@ EDDSA.prototype.isPoint = function isPoint(val) {
|
|
|
15973
15968
|
|
|
15974
15969
|
// Protocols
|
|
15975
15970
|
elliptic.ec = ec$1;
|
|
15976
|
-
elliptic.eddsa = eddsa;
|
|
15971
|
+
elliptic.eddsa = eddsa;
|
|
15977
15972
|
} (elliptic$2));
|
|
15978
15973
|
|
|
15979
15974
|
const EC = elliptic$2.ec;
|
|
@@ -16381,6 +16376,8 @@ var elliptic$1 = {
|
|
|
16381
16376
|
|
|
16382
16377
|
var elliptic = lib(elliptic$1);
|
|
16383
16378
|
|
|
16379
|
+
var secp256k1 = /*@__PURE__*/getDefaultExportFromCjs(elliptic);
|
|
16380
|
+
|
|
16384
16381
|
const leofcoinOlivia = {
|
|
16385
16382
|
messagePrefix: '\u0019Leofcoin Signed Message:',
|
|
16386
16383
|
version: 1,
|
|
@@ -16513,7 +16510,7 @@ const decode = async (wif, version) => {
|
|
|
16513
16510
|
var wif = { encode, decode };
|
|
16514
16511
|
|
|
16515
16512
|
const HIGHEST_BIT = 0x80000000;
|
|
16516
|
-
const { publicKeyCreate, publicKeyVerify, privateKeyVerify, privateKeyTweakAdd, ecdh } =
|
|
16513
|
+
const { publicKeyCreate, publicKeyVerify, privateKeyVerify, privateKeyTweakAdd, ecdh } = secp256k1;
|
|
16517
16514
|
class HdNode {
|
|
16518
16515
|
#privateKey;
|
|
16519
16516
|
#publicKey;
|
|
@@ -16932,7 +16929,7 @@ class MultiSignature {
|
|
|
16932
16929
|
sign(hash, privateKey) {
|
|
16933
16930
|
if (!hash || !privateKey)
|
|
16934
16931
|
throw ReferenceError(`${hash ? 'privateKey' : 'hash'} undefined`);
|
|
16935
|
-
const { signature } =
|
|
16932
|
+
const { signature } = secp256k1.ecdsaSign(hash, privateKey);
|
|
16936
16933
|
this.decoded = {
|
|
16937
16934
|
version: this.version,
|
|
16938
16935
|
multiCodec: this.multiCodec,
|
|
@@ -16944,14 +16941,14 @@ class MultiSignature {
|
|
|
16944
16941
|
* verify signature (multiSignature.signature)
|
|
16945
16942
|
*/
|
|
16946
16943
|
verifySignature(signature, hash, publicKey) {
|
|
16947
|
-
return
|
|
16944
|
+
return secp256k1.ecdsaVerify(signature, hash, publicKey);
|
|
16948
16945
|
}
|
|
16949
16946
|
/**
|
|
16950
16947
|
* verify multiSignature
|
|
16951
16948
|
*/
|
|
16952
16949
|
verify(multiSignature, hash, publicKey) {
|
|
16953
16950
|
multiSignature = this.decode(multiSignature);
|
|
16954
|
-
return
|
|
16951
|
+
return secp256k1.ecdsaVerify(multiSignature.signature, hash, publicKey);
|
|
16955
16952
|
}
|
|
16956
16953
|
encode(signature) {
|
|
16957
16954
|
signature = signature || this.signature;
|
|
@@ -17349,7 +17346,7 @@ var errorCorrectionLevel = {};
|
|
|
17349
17346
|
} catch (e) {
|
|
17350
17347
|
return defaultValue
|
|
17351
17348
|
}
|
|
17352
|
-
};
|
|
17349
|
+
};
|
|
17353
17350
|
} (errorCorrectionLevel));
|
|
17354
17351
|
|
|
17355
17352
|
function BitBuffer$1 () {
|
|
@@ -17542,7 +17539,7 @@ var alignmentPattern = {};
|
|
|
17542
17539
|
}
|
|
17543
17540
|
|
|
17544
17541
|
return coords
|
|
17545
|
-
};
|
|
17542
|
+
};
|
|
17546
17543
|
} (alignmentPattern));
|
|
17547
17544
|
|
|
17548
17545
|
var finderPattern = {};
|
|
@@ -17807,7 +17804,7 @@ var maskPattern = {};
|
|
|
17807
17804
|
}
|
|
17808
17805
|
|
|
17809
17806
|
return bestPattern
|
|
17810
|
-
};
|
|
17807
|
+
};
|
|
17811
17808
|
} (maskPattern));
|
|
17812
17809
|
|
|
17813
17810
|
var errorCorrectionCode = {};
|
|
@@ -18084,7 +18081,7 @@ galoisField.mul = function mul (x, y) {
|
|
|
18084
18081
|
}
|
|
18085
18082
|
|
|
18086
18083
|
return poly
|
|
18087
|
-
};
|
|
18084
|
+
};
|
|
18088
18085
|
} (polynomial));
|
|
18089
18086
|
|
|
18090
18087
|
const Polynomial = polynomial;
|
|
@@ -18362,7 +18359,7 @@ regex.testAlphanumeric = function testAlphanumeric (str) {
|
|
|
18362
18359
|
} catch (e) {
|
|
18363
18360
|
return defaultValue
|
|
18364
18361
|
}
|
|
18365
|
-
};
|
|
18362
|
+
};
|
|
18366
18363
|
} (mode));
|
|
18367
18364
|
|
|
18368
18365
|
(function (exports) {
|
|
@@ -18528,7 +18525,7 @@ regex.testAlphanumeric = function testAlphanumeric (str) {
|
|
|
18528
18525
|
}
|
|
18529
18526
|
|
|
18530
18527
|
return (version << 12) | d
|
|
18531
|
-
};
|
|
18528
|
+
};
|
|
18532
18529
|
} (version));
|
|
18533
18530
|
|
|
18534
18531
|
var formatInfo = {};
|
|
@@ -18809,11 +18806,7 @@ KanjiData.prototype.write = function (bitBuffer) {
|
|
|
18809
18806
|
|
|
18810
18807
|
var kanjiData = KanjiData;
|
|
18811
18808
|
|
|
18812
|
-
var
|
|
18813
|
-
var dijkstra = {
|
|
18814
|
-
get exports(){ return dijkstraExports; },
|
|
18815
|
-
set exports(v){ dijkstraExports = v; },
|
|
18816
|
-
};
|
|
18809
|
+
var dijkstra = {exports: {}};
|
|
18817
18810
|
|
|
18818
18811
|
(function (module) {
|
|
18819
18812
|
|
|
@@ -18978,9 +18971,11 @@ var dijkstra = {
|
|
|
18978
18971
|
// node.js module exports
|
|
18979
18972
|
{
|
|
18980
18973
|
module.exports = dijkstra;
|
|
18981
|
-
}
|
|
18974
|
+
}
|
|
18982
18975
|
} (dijkstra));
|
|
18983
18976
|
|
|
18977
|
+
var dijkstraExports = dijkstra.exports;
|
|
18978
|
+
|
|
18984
18979
|
(function (exports) {
|
|
18985
18980
|
const Mode = mode;
|
|
18986
18981
|
const NumericData = numericData;
|
|
@@ -19311,7 +19306,7 @@ var dijkstra = {
|
|
|
19311
19306
|
return exports.fromArray(
|
|
19312
19307
|
getSegmentsFromString(data, Utils.isKanjiModeEnabled())
|
|
19313
19308
|
)
|
|
19314
|
-
};
|
|
19309
|
+
};
|
|
19315
19310
|
} (segments));
|
|
19316
19311
|
|
|
19317
19312
|
const Utils$1 = utils$1;
|
|
@@ -19913,7 +19908,7 @@ var utils = {};
|
|
|
19913
19908
|
imgData[posDst] = pxColor.a;
|
|
19914
19909
|
}
|
|
19915
19910
|
}
|
|
19916
|
-
};
|
|
19911
|
+
};
|
|
19917
19912
|
} (utils));
|
|
19918
19913
|
|
|
19919
19914
|
(function (exports) {
|
|
@@ -19979,7 +19974,7 @@ var utils = {};
|
|
|
19979
19974
|
const rendererOpts = opts.rendererOpts || {};
|
|
19980
19975
|
|
|
19981
19976
|
return canvasEl.toDataURL(type, rendererOpts.quality)
|
|
19982
|
-
};
|
|
19977
|
+
};
|
|
19983
19978
|
} (canvas));
|
|
19984
19979
|
|
|
19985
19980
|
var svgTag = {};
|
|
@@ -20179,7 +20174,7 @@ class Identity {
|
|
|
20179
20174
|
globalThis.peernet.selectedAccount = new TextDecoder().decode(selected);
|
|
20180
20175
|
}
|
|
20181
20176
|
else {
|
|
20182
|
-
const importee = await import(/* webpackChunkName: "generate-account" */ './index-
|
|
20177
|
+
const importee = await import(/* webpackChunkName: "generate-account" */ './index-ed935219.js');
|
|
20183
20178
|
const { identity, accounts } = await importee.default(password, this.network);
|
|
20184
20179
|
await globalThis.accountStore.put('public', JSON.stringify({ walletId: identity.walletId }));
|
|
20185
20180
|
await globalThis.walletStore.put('version', String(1));
|
|
@@ -20350,7 +20345,7 @@ class Peernet {
|
|
|
20350
20345
|
this.root = options.root;
|
|
20351
20346
|
const { RequestMessage, ResponseMessage, PeerMessage, PeerMessageResponse, PeernetMessage, DHTMessage, DHTMessageResponse, DataMessage, DataMessageResponse, PsMessage, ChatMessage, PeernetFile
|
|
20352
20347
|
// FolderMessageResponse
|
|
20353
|
-
} = await import(/* webpackChunkName: "messages" */ './messages-
|
|
20348
|
+
} = await import(/* webpackChunkName: "messages" */ './messages-cc3774b5.js');
|
|
20354
20349
|
/**
|
|
20355
20350
|
* proto Object containing protos
|
|
20356
20351
|
* @type {Object}
|
|
@@ -20429,7 +20424,7 @@ class Peernet {
|
|
|
20429
20424
|
if (this.#starting || this.#started)
|
|
20430
20425
|
return;
|
|
20431
20426
|
this.#starting = true;
|
|
20432
|
-
const importee = await import('./client-
|
|
20427
|
+
const importee = await import('./client-020c00d8.js');
|
|
20433
20428
|
/**
|
|
20434
20429
|
* @access public
|
|
20435
20430
|
* @type {PeernetClient}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { P as default } from './peernet-
|
|
1
|
+
export { P as default } from './peernet-4fce82bc.js';
|
|
2
2
|
import './value-157ab062.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leofcoin/peernet",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.44",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "src/peernet.js",
|
|
6
6
|
"exports": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"import": "./exports/peernet.js",
|
|
9
9
|
"require": "./exports/commonjs/peernet.js"
|
|
10
10
|
},
|
|
11
|
-
"./browser": "./exports/browser/peernet.
|
|
11
|
+
"./browser": "./exports/browser/peernet.js"
|
|
12
12
|
},
|
|
13
13
|
"type": "module",
|
|
14
14
|
"engines": {
|