@leofcoin/peernet 1.2.30 → 3.0.0
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/README.md +13 -0
- package/docs/automatic-transport.md +37 -0
- package/exports/browser/{browser-DvU1xNFS.js → browser-CCfR9KOM.js} +1 -1
- package/exports/browser/{client-86Tnax66.js → client-C_pBoi1g.js} +254 -78
- package/exports/browser/{identity-CYVPDmkf.js → identity-Cf8KKnho.js} +511 -391
- package/exports/browser/identity.js +1 -1
- package/exports/browser/{index-BD0Anx7_.js → index-dTQVgkpf.js} +1 -1
- package/exports/browser/{messages-D7JxkkDW.js → messages-BGHaihSi.js} +2 -2
- package/exports/browser/{peernet-C4rOvyyU.js → peernet-Db43ag2D.js} +68 -45
- package/exports/browser/peernet.js +2 -2
- package/exports/store.js +0 -3
- package/package.json +10 -6
- package/.esdoc.json +0 -10
- package/.gitattributes +0 -2
- package/.github/workflows/release.yml +0 -34
- package/.prettierrc +0 -7
- package/.travis.yml +0 -27
- package/BREAKING_CHANGES.md +0 -35
- package/deploy.js +0 -8
- package/exports/browser/browser-D-r0O9Qn.js +0 -53
- package/exports/browser/browser-_hiyXwPp.js +0 -147
- package/exports/browser/client-BFxJts6j.js +0 -2224
- package/exports/browser/client-BVhUamQG.js +0 -2200
- package/exports/browser/client-BzvWzzLv.js +0 -2224
- package/exports/browser/client-C9GBz2Tf.js +0 -2224
- package/exports/browser/client-CQzuu6At.js +0 -2224
- package/exports/browser/client-CVkFejdx.js +0 -2224
- package/exports/browser/client-Cj_UUO8W.js +0 -2224
- package/exports/browser/client-CrGaeBjj.js +0 -2224
- package/exports/browser/client-DDC8C510.js +0 -2224
- package/exports/browser/client-ERocgKET.js +0 -2224
- package/exports/browser/client-a8rws3cu.js +0 -2224
- package/exports/browser/identity-ChyyZSve.js +0 -8397
- package/exports/browser/index-Bxr5Iztg.js +0 -37
- package/exports/browser/messages-BFCmg6Vb.js +0 -212
- package/exports/browser/messages-BHIC2mQu.js +0 -212
- package/exports/browser/messages-CimzJ4wr.js +0 -210
- package/exports/browser/messages-Cjoa_LGO.js +0 -210
- package/exports/browser/messages-DH0tgNM9.js +0 -207
- package/exports/browser/messages-DVHcNvs_.js +0 -212
- package/exports/browser/messages-DqL_g2qw.js +0 -210
- package/exports/browser/messages-UKnuelZ7.js +0 -207
- package/exports/browser/messages-XgZZUMma.js +0 -212
- package/exports/browser/messages-kfFyctPL.js +0 -210
- package/exports/browser/messages-psROnfRi.js +0 -212
- package/exports/browser/peernet-B9VL4Xwe.js +0 -9522
- package/exports/browser/peernet-C-HNdrcd.js +0 -9528
- package/exports/browser/peernet-Ca1iM2tN.js +0 -9336
- package/exports/browser/peernet-CbI0-jFn.js +0 -9651
- package/exports/browser/peernet-CtHScDyh.js +0 -9524
- package/exports/browser/peernet-DfuxUK3u.js +0 -9525
- package/exports/browser/peernet-DiEcNDLD.js +0 -9655
- package/exports/browser/peernet-DtuRXOzP.js +0 -9653
- package/exports/browser/peernet-r_9IyzTe.js +0 -9336
- package/exports/browser/peernet-rcD5XL1y.js +0 -9590
- package/exports/browser/peernet-rw8HJGOz.js +0 -9597
- package/exports/messages-CHKVVTVE.js +0 -204
- package/exports/messages-DaUtFfBh.js +0 -207
- package/index.html +0 -19
- package/rollup.config.js +0 -143
- package/src/dht/dht.ts +0 -142
- package/src/discovery/peer-discovery.js +0 -75
- package/src/errors/errors.js +0 -12
- package/src/file-transfer.ts +0 -194
- package/src/handlers/data.js +0 -15
- package/src/handlers/message.js +0 -34
- package/src/identity.ts +0 -172
- package/src/messages/chat.ts +0 -13
- package/src/messages/data-response.ts +0 -13
- package/src/messages/data.ts +0 -17
- package/src/messages/dht-response.ts +0 -13
- package/src/messages/dht.ts +0 -21
- package/src/messages/file-link.ts +0 -17
- package/src/messages/file.ts +0 -17
- package/src/messages/peer-response.ts +0 -13
- package/src/messages/peer.ts +0 -13
- package/src/messages/peernet.ts +0 -13
- package/src/messages/ps.ts +0 -13
- package/src/messages/request.ts +0 -13
- package/src/messages/response.ts +0 -13
- package/src/messages.js +0 -12
- package/src/peer-info.js +0 -9
- package/src/peernet.ts +0 -1113
- package/src/prompts/password/browser.js +0 -1
- package/src/prompts/password/node.js +0 -6
- package/src/prompts/password.js +0 -1
- package/src/proto/chat-message.proto.js +0 -6
- package/src/proto/data-response.proto.js +0 -4
- package/src/proto/data.proto.js +0 -4
- package/src/proto/dht-response.proto.js +0 -4
- package/src/proto/dht.proto.js +0 -4
- package/src/proto/file-link.proto.js +0 -5
- package/src/proto/file.proto.js +0 -10
- package/src/proto/peer-response.proto.js +0 -3
- package/src/proto/peer.proto.js +0 -3
- package/src/proto/peernet.proto.js +0 -7
- package/src/proto/ps.proto.js +0 -4
- package/src/proto/request.proto.js +0 -4
- package/src/proto/response.proto.js +0 -3
- package/src/types.ts +0 -25
- package/src/utils/utils.js +0 -77
- package/test/all.js +0 -5
- package/test/client.js +0 -15
- package/test/codec.js +0 -56
- package/test/file-transfer.test.js +0 -81
- package/test/fresh-empty-store.js +0 -15
- package/test/hash.js +0 -14
- package/test/index.js +0 -6
- package/test/lastBlock.js +0 -7
- package/test/messages.js +0 -26
- package/test/peer-data-exchange.test.js +0 -52
- package/test/peer-file-exchange.test.js +0 -78
- package/test/peernet.js +0 -17
- package/test/peernet.test.js +0 -440
- package/test-output.log +0 -84
- package/test.js +0 -63
- package/test2.js +0 -13
- package/test3.js +0 -16
- package/test4.js +0 -7
- package/tsconfig.json +0 -13
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { I as default, r as resolveAccountWallets } from './identity-
|
|
1
|
+
export { I as default, r as resolveAccountWallets } from './identity-Cf8KKnho.js';
|
|
2
2
|
import 'crypto';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as index$2, b as base, a as base58$1, c as index$3, d as index$4, e as
|
|
1
|
+
import { i as index$2, b as base, a as base58$1, c as index$3, d as index$4, B as BinaryReader, e as BinaryWriter, v as varUintLength, f as createSHA512, g as createSHA384, h as createSHA256, j as createSHA224, k as createSHA1, I as Identity } from './identity-Cf8KKnho.js';
|
|
2
2
|
import { K as KeyPath, a as KeyValue } from './value-C3vAp-wb.js';
|
|
3
3
|
|
|
4
4
|
const getTargets = () => Array.from([]);
|
|
@@ -7666,7 +7666,7 @@ let Codec$1 = class Codec extends BasicInterface {
|
|
|
7666
7666
|
super();
|
|
7667
7667
|
if (buffer) {
|
|
7668
7668
|
if (buffer instanceof Uint8Array) {
|
|
7669
|
-
const codec =
|
|
7669
|
+
const codec = new BinaryReader(buffer).readVarUint(false);
|
|
7670
7670
|
const name = this.getCodecName(codec);
|
|
7671
7671
|
if (name) {
|
|
7672
7672
|
this.name = name;
|
|
@@ -7678,11 +7678,12 @@ let Codec$1 = class Codec extends BasicInterface {
|
|
|
7678
7678
|
}
|
|
7679
7679
|
}
|
|
7680
7680
|
else if (buffer instanceof ArrayBuffer) {
|
|
7681
|
-
const
|
|
7681
|
+
const view = new Uint8Array(buffer);
|
|
7682
|
+
const codec = new BinaryReader(view).readVarUint(false);
|
|
7682
7683
|
const name = this.getCodecName(codec);
|
|
7683
7684
|
if (name) {
|
|
7684
7685
|
this.name = name;
|
|
7685
|
-
this.decode(
|
|
7686
|
+
this.decode(view);
|
|
7686
7687
|
}
|
|
7687
7688
|
else {
|
|
7688
7689
|
this.encode(Number(new TextDecoder().decode(new Uint8Array(buffer))));
|
|
@@ -7707,7 +7708,7 @@ let Codec$1 = class Codec extends BasicInterface {
|
|
|
7707
7708
|
}
|
|
7708
7709
|
}
|
|
7709
7710
|
fromEncoded(encoded) {
|
|
7710
|
-
const codec =
|
|
7711
|
+
const codec = new BinaryReader(encoded).readVarUint(false);
|
|
7711
7712
|
const name = this.getCodecName(codec);
|
|
7712
7713
|
this.name = name;
|
|
7713
7714
|
this.encoded = encoded;
|
|
@@ -7726,7 +7727,7 @@ let Codec$1 = class Codec extends BasicInterface {
|
|
|
7726
7727
|
this.name = this.getCodecName(codec);
|
|
7727
7728
|
this.hashAlg = this.getHashAlg(this.name);
|
|
7728
7729
|
this.codec = this.getCodec(this.name);
|
|
7729
|
-
this.codecBuffer =
|
|
7730
|
+
this.codecBuffer = new BinaryWriter(varUintLength(this.codec)).writeVarUint(this.codec).finish();
|
|
7730
7731
|
this.decoded = {
|
|
7731
7732
|
name: this.name,
|
|
7732
7733
|
hashAlg: this.hashAlg,
|
|
@@ -7739,7 +7740,7 @@ let Codec$1 = class Codec extends BasicInterface {
|
|
|
7739
7740
|
this.name = name;
|
|
7740
7741
|
this.codec = codec;
|
|
7741
7742
|
this.hashAlg = this.getHashAlg(name);
|
|
7742
|
-
this.codecBuffer =
|
|
7743
|
+
this.codecBuffer = new BinaryWriter(varUintLength(this.codec)).writeVarUint(this.codec).finish();
|
|
7743
7744
|
this.decoded = {
|
|
7744
7745
|
name: this.name,
|
|
7745
7746
|
hashAlg: this.hashAlg,
|
|
@@ -7749,13 +7750,13 @@ let Codec$1 = class Codec extends BasicInterface {
|
|
|
7749
7750
|
}
|
|
7750
7751
|
decode(encoded) {
|
|
7751
7752
|
encoded = encoded || this.encoded;
|
|
7752
|
-
const codec =
|
|
7753
|
+
const codec = new BinaryReader(encoded).readVarUint(false);
|
|
7753
7754
|
this.fromCodec(codec);
|
|
7754
7755
|
return this.decoded;
|
|
7755
7756
|
}
|
|
7756
7757
|
encode(codec) {
|
|
7757
7758
|
codec = codec || this.codec;
|
|
7758
|
-
this.encoded =
|
|
7759
|
+
this.encoded = new BinaryWriter(varUintLength(codec)).writeVarUint(codec).finish();
|
|
7759
7760
|
return this.encoded;
|
|
7760
7761
|
}
|
|
7761
7762
|
};
|
|
@@ -7784,10 +7785,37 @@ const digestBuffer = async (hashVariant, buffer) => {
|
|
|
7784
7785
|
const digest = hasher.digest('binary');
|
|
7785
7786
|
return digest instanceof Uint8Array ? digest : new Uint8Array(digest);
|
|
7786
7787
|
};
|
|
7788
|
+
const hashHeader = (buffer) => {
|
|
7789
|
+
if (!(buffer instanceof Uint8Array))
|
|
7790
|
+
throw new TypeError('CodecHash only supports Uint8Array input');
|
|
7791
|
+
const reader = new BinaryReader(buffer);
|
|
7792
|
+
const codec = reader.readVarUint();
|
|
7793
|
+
const name = utils.getCodecName(codec);
|
|
7794
|
+
if (!name)
|
|
7795
|
+
throw new Error('unknown hash codec');
|
|
7796
|
+
const size = reader.readVarUint();
|
|
7797
|
+
if (size !== reader.remaining)
|
|
7798
|
+
throw new Error('hash length inconsistent');
|
|
7799
|
+
return { name, size, offset: reader.position };
|
|
7800
|
+
};
|
|
7801
|
+
const hasHashHeader = (buffer) => {
|
|
7802
|
+
const reader = new BinaryReader(buffer);
|
|
7803
|
+
try {
|
|
7804
|
+
// Recognition is deliberately separate from strict parsing: a padded known
|
|
7805
|
+
// codec must reach decode() and fail, not silently become raw content.
|
|
7806
|
+
return Boolean(utils.getCodecName(reader.readVarUint(false)));
|
|
7807
|
+
}
|
|
7808
|
+
catch (error) {
|
|
7809
|
+
if (!(error instanceof RangeError))
|
|
7810
|
+
throw error;
|
|
7811
|
+
return false;
|
|
7812
|
+
}
|
|
7813
|
+
};
|
|
7787
7814
|
class CodecHash extends BasicInterface {
|
|
7788
7815
|
codec;
|
|
7789
7816
|
discoCodec;
|
|
7790
7817
|
size;
|
|
7818
|
+
digest;
|
|
7791
7819
|
codecs;
|
|
7792
7820
|
constructor(options = { name: 'disco-hash', codecs: {} }) {
|
|
7793
7821
|
super();
|
|
@@ -7795,21 +7823,14 @@ class CodecHash extends BasicInterface {
|
|
|
7795
7823
|
this.name = options.name;
|
|
7796
7824
|
else
|
|
7797
7825
|
this.name = 'disco-hash';
|
|
7798
|
-
|
|
7799
|
-
this.codecs = options.codecs;
|
|
7826
|
+
this.codecs = options?.codecs ?? {};
|
|
7800
7827
|
}
|
|
7801
7828
|
async init(uint8Array) {
|
|
7802
7829
|
if (uint8Array) {
|
|
7803
7830
|
if (!(uint8Array instanceof Uint8Array)) {
|
|
7804
7831
|
throw new Error('CodecHash only supports Uint8Array input');
|
|
7805
7832
|
}
|
|
7806
|
-
|
|
7807
|
-
// Codec prefixes are small (varint encoded), so 100 bytes is more than enough
|
|
7808
|
-
const checkBuffer = uint8Array.length > 100 ? uint8Array.subarray(0, 100) : uint8Array;
|
|
7809
|
-
this.discoCodec = new Codec$1(checkBuffer);
|
|
7810
|
-
const name = this.discoCodec.name;
|
|
7811
|
-
if (name) {
|
|
7812
|
-
this.name = name;
|
|
7833
|
+
if (hasHashHeader(uint8Array)) {
|
|
7813
7834
|
this.decode(uint8Array);
|
|
7814
7835
|
}
|
|
7815
7836
|
else {
|
|
@@ -7818,15 +7839,19 @@ class CodecHash extends BasicInterface {
|
|
|
7818
7839
|
}
|
|
7819
7840
|
return this;
|
|
7820
7841
|
}
|
|
7842
|
+
#clearEncodingCache() {
|
|
7843
|
+
for (const key of ['_bs32', '_hex', '_string'])
|
|
7844
|
+
delete this[key];
|
|
7845
|
+
}
|
|
7821
7846
|
get prefix() {
|
|
7822
7847
|
const length = this.length;
|
|
7823
7848
|
const uint8Array = new Uint8Array(length.length + this.discoCodec.codecBuffer.length);
|
|
7824
|
-
uint8Array.set(
|
|
7825
|
-
uint8Array.set(this.discoCodec.codecBuffer
|
|
7849
|
+
uint8Array.set(this.discoCodec.codecBuffer);
|
|
7850
|
+
uint8Array.set(length, this.discoCodec.codecBuffer.length);
|
|
7826
7851
|
return uint8Array;
|
|
7827
7852
|
}
|
|
7828
7853
|
get length() {
|
|
7829
|
-
return
|
|
7854
|
+
return new BinaryWriter(varUintLength(this.size)).writeVarUint(this.size).finish();
|
|
7830
7855
|
}
|
|
7831
7856
|
get buffer() {
|
|
7832
7857
|
return this.encoded;
|
|
@@ -7853,6 +7878,8 @@ class CodecHash extends BasicInterface {
|
|
|
7853
7878
|
const uint8Array = new Uint8Array(this.digest.length + this.prefix.length);
|
|
7854
7879
|
uint8Array.set(this.prefix);
|
|
7855
7880
|
uint8Array.set(this.digest, this.prefix.length);
|
|
7881
|
+
this.#clearEncodingCache();
|
|
7882
|
+
this.decoded = undefined;
|
|
7856
7883
|
this.encoded = uint8Array;
|
|
7857
7884
|
return this.encoded;
|
|
7858
7885
|
}
|
|
@@ -7860,35 +7887,30 @@ class CodecHash extends BasicInterface {
|
|
|
7860
7887
|
if (!(buffer instanceof Uint8Array)) {
|
|
7861
7888
|
throw new Error('CodecHash only supports Uint8Array input');
|
|
7862
7889
|
}
|
|
7863
|
-
|
|
7864
|
-
if (this.codecs[codec]) {
|
|
7865
|
-
this.decode(buffer);
|
|
7866
|
-
}
|
|
7867
|
-
else {
|
|
7868
|
-
await this.encode(buffer);
|
|
7869
|
-
}
|
|
7890
|
+
await this.init(buffer);
|
|
7870
7891
|
}
|
|
7871
7892
|
decode(buffer) {
|
|
7893
|
+
buffer = buffer ?? this.encoded;
|
|
7894
|
+
// Validate completely before changing this instance, including cached encodings.
|
|
7895
|
+
const header = hashHeader(buffer);
|
|
7896
|
+
const codec = new Codec$1(header.name);
|
|
7897
|
+
const digest = new Uint8Array(buffer.subarray(header.offset));
|
|
7898
|
+
this.#clearEncodingCache();
|
|
7872
7899
|
this.encoded = buffer;
|
|
7873
|
-
|
|
7874
|
-
this.
|
|
7875
|
-
|
|
7876
|
-
|
|
7877
|
-
this.
|
|
7878
|
-
|
|
7879
|
-
if (this.digest.length !== this.size) {
|
|
7880
|
-
throw new Error(`hash length inconsistent: 0x${this.encoded.toString()}`);
|
|
7881
|
-
}
|
|
7882
|
-
// const discoCodec = new Codec(codec, this.codecs)
|
|
7883
|
-
this.name = this.discoCodec.name;
|
|
7884
|
-
this.size = this.digest.length;
|
|
7885
|
-
return {
|
|
7900
|
+
this.discoCodec = codec;
|
|
7901
|
+
this.codec = codec.codecBuffer;
|
|
7902
|
+
this.name = header.name;
|
|
7903
|
+
this.size = header.size;
|
|
7904
|
+
this.digest = digest;
|
|
7905
|
+
const decoded = {
|
|
7886
7906
|
codec: this.codec,
|
|
7887
7907
|
name: this.name,
|
|
7888
7908
|
size: this.size,
|
|
7889
7909
|
length: this.length,
|
|
7890
7910
|
digest: this.digest
|
|
7891
7911
|
};
|
|
7912
|
+
this.decoded = decoded;
|
|
7913
|
+
return decoded;
|
|
7892
7914
|
}
|
|
7893
7915
|
}
|
|
7894
7916
|
|
|
@@ -8001,13 +8023,14 @@ let FormatInterface$1 = class FormatInterface extends BasicInterface {
|
|
|
8001
8023
|
!Object.prototype.hasOwnProperty.call(this.decoded, 'hash')) {
|
|
8002
8024
|
// @ts-ignore
|
|
8003
8025
|
const hash = new CodecHash({ name: this.name });
|
|
8004
|
-
|
|
8026
|
+
// These are explicitly raw message bytes, even if they resemble a hash header.
|
|
8027
|
+
return hash.encode(this.contentBytes).then(() => hash);
|
|
8005
8028
|
}
|
|
8006
8029
|
// Fallback: must re-encode without hash property
|
|
8007
8030
|
const decoded = this.beforeHashing({ ...this.decoded });
|
|
8008
8031
|
// @ts-ignore
|
|
8009
8032
|
const hash = new CodecHash({ name: this.name });
|
|
8010
|
-
return hash.
|
|
8033
|
+
return hash.encode(this.protoEncode(decoded)).then(() => hash);
|
|
8011
8034
|
}
|
|
8012
8035
|
/**
|
|
8013
8036
|
* @return {peernetHash}
|
|
@@ -8817,7 +8840,7 @@ class Peernet {
|
|
|
8817
8840
|
await getAddress();
|
|
8818
8841
|
this.storePrefix = options.storePrefix;
|
|
8819
8842
|
this.root = options.root;
|
|
8820
|
-
const { RequestMessage, ResponseMessage, PeerMessage, PeerMessageResponse, PeernetMessage, DHTMessage, DHTMessageResponse, DataMessage, DataMessageResponse, PsMessage, ChatMessage, PeernetFile } = await import(/* webpackChunkName: "messages" */ './messages-
|
|
8843
|
+
const { RequestMessage, ResponseMessage, PeerMessage, PeerMessageResponse, PeernetMessage, DHTMessage, DHTMessageResponse, DataMessage, DataMessageResponse, PsMessage, ChatMessage, PeernetFile } = await import(/* webpackChunkName: "messages" */ './messages-BGHaihSi.js');
|
|
8821
8844
|
/**
|
|
8822
8845
|
* proto Object containing protos
|
|
8823
8846
|
* @type {Object}
|
|
@@ -8864,7 +8887,7 @@ class Peernet {
|
|
|
8864
8887
|
if (this.#starting || this.#started)
|
|
8865
8888
|
return;
|
|
8866
8889
|
this.#starting = true;
|
|
8867
|
-
const importee = await import('./client-
|
|
8890
|
+
const importee = await import('./client-C_pBoi1g.js');
|
|
8868
8891
|
/**
|
|
8869
8892
|
* @access public
|
|
8870
8893
|
* @type {PeernetClient}
|
package/exports/store.js
CHANGED
|
@@ -102,9 +102,6 @@ class Store {
|
|
|
102
102
|
this.root = await init(root, homedir);
|
|
103
103
|
this.version = version;
|
|
104
104
|
this.db = new ClassicLevel(join(this.root, this.name), { valueEncoding: 'view' });
|
|
105
|
-
if (typeof this.db.open === 'function') {
|
|
106
|
-
await this.db.open();
|
|
107
|
-
}
|
|
108
105
|
}
|
|
109
106
|
toKeyPath(key) {
|
|
110
107
|
if (!key.isKeyPath())
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leofcoin/peernet",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -91,12 +91,17 @@
|
|
|
91
91
|
},
|
|
92
92
|
"type": "module",
|
|
93
93
|
"engines": {
|
|
94
|
-
"node": ">=
|
|
94
|
+
"node": ">=24.15.0"
|
|
95
95
|
},
|
|
96
|
+
"files": [
|
|
97
|
+
"exports",
|
|
98
|
+
"docs/automatic-transport.md"
|
|
99
|
+
],
|
|
96
100
|
"scripts": {
|
|
97
101
|
"build": "rollup -c",
|
|
98
102
|
"watch": "rollup -c -w",
|
|
99
103
|
"test": "node --test test/peernet.test.js test/file-transfer.test.js",
|
|
104
|
+
"test:package": "node test/standalone-install.js",
|
|
100
105
|
"server": "discovery-swarm-webrtc --port=4000",
|
|
101
106
|
"demo": "jsproject --serve ./ --port 6868"
|
|
102
107
|
},
|
|
@@ -105,14 +110,14 @@
|
|
|
105
110
|
"license": "MIT",
|
|
106
111
|
"packageManager": "npm@11.17.0",
|
|
107
112
|
"dependencies": {
|
|
108
|
-
"@leofcoin/codec-format-interface": "^
|
|
113
|
+
"@leofcoin/codec-format-interface": "^2.0.0",
|
|
109
114
|
"@leofcoin/codecs": "^1.1.2",
|
|
110
115
|
"@leofcoin/generate-account": "^2.0.3",
|
|
111
116
|
"@leofcoin/identity-utils": "^1.0.2",
|
|
112
|
-
"@leofcoin/multi-wallet": "^3.1.
|
|
117
|
+
"@leofcoin/multi-wallet": "^3.1.11",
|
|
113
118
|
"@leofcoin/storage": "^3.5.38",
|
|
114
119
|
"@mapbox/node-pre-gyp": "^2.0.3",
|
|
115
|
-
"@netpeer/swarm": "^0.
|
|
120
|
+
"@netpeer/swarm": "^0.10.0",
|
|
116
121
|
"@vandeurenglenn/base58": "^1.1.9",
|
|
117
122
|
"@vandeurenglenn/debug": "^1.4.0",
|
|
118
123
|
"@vandeurenglenn/little-pubsub": "^1.5.2",
|
|
@@ -129,7 +134,6 @@
|
|
|
129
134
|
"@rollup/plugin-wasm": "^6.2.2",
|
|
130
135
|
"@types/node": "^25.9.1",
|
|
131
136
|
"@types/qrcode": "^1.5.6",
|
|
132
|
-
"rimraf": "^5.0.10",
|
|
133
137
|
"rollup": "^4.60.4",
|
|
134
138
|
"tslib": "^2.8.1",
|
|
135
139
|
"typescript": "^6.0.2"
|
package/.esdoc.json
DELETED
package/.gitattributes
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
name: Release package
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
workflow_dispatch:
|
|
5
|
-
|
|
6
|
-
permissions:
|
|
7
|
-
contents: read
|
|
8
|
-
id-token: write
|
|
9
|
-
|
|
10
|
-
concurrency:
|
|
11
|
-
group: release-package
|
|
12
|
-
cancel-in-progress: false
|
|
13
|
-
|
|
14
|
-
jobs:
|
|
15
|
-
publish:
|
|
16
|
-
runs-on: ubuntu-latest
|
|
17
|
-
steps:
|
|
18
|
-
- uses: actions/checkout@v7
|
|
19
|
-
|
|
20
|
-
- uses: actions/setup-node@v7
|
|
21
|
-
with:
|
|
22
|
-
node-version: 24
|
|
23
|
-
registry-url: https://registry.npmjs.org
|
|
24
|
-
cache: npm
|
|
25
|
-
|
|
26
|
-
- name: Use supported npm CLI
|
|
27
|
-
run: npm install --global npm@11.17.0
|
|
28
|
-
|
|
29
|
-
- run: npm ci
|
|
30
|
-
- run: npm run build
|
|
31
|
-
- run: npm test
|
|
32
|
-
|
|
33
|
-
- name: Publish with provenance
|
|
34
|
-
run: npm publish --access public --provenance
|
package/.prettierrc
DELETED
package/.travis.yml
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
os:
|
|
2
|
-
- linux
|
|
3
|
-
- windows
|
|
4
|
-
- osx
|
|
5
|
-
|
|
6
|
-
language: node_js
|
|
7
|
-
node_js:
|
|
8
|
-
- 14
|
|
9
|
-
- 16
|
|
10
|
-
- 19
|
|
11
|
-
|
|
12
|
-
script:
|
|
13
|
-
- npm run c
|
|
14
|
-
- npm run doc
|
|
15
|
-
- npm run test
|
|
16
|
-
|
|
17
|
-
after_success:
|
|
18
|
-
- npm run coverage
|
|
19
|
-
- npm run coveralls
|
|
20
|
-
- node deploy.js success $WEBHOOK_URL
|
|
21
|
-
|
|
22
|
-
after_failure:
|
|
23
|
-
- node deploy.js failure $WEBHOOK_URL
|
|
24
|
-
|
|
25
|
-
branches:
|
|
26
|
-
only:
|
|
27
|
-
- main
|
package/BREAKING_CHANGES.md
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# breaking changes
|
|
2
|
-
## 1.0.10
|
|
3
|
-
### start
|
|
4
|
-
#### before
|
|
5
|
-
```js
|
|
6
|
-
const node = await new Node()
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
#### now
|
|
10
|
-
```js
|
|
11
|
-
const node = await new Node()
|
|
12
|
-
// gives time to setup things...
|
|
13
|
-
await node.start()
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## 1.1.0
|
|
17
|
-
### autoStart
|
|
18
|
-
#### before
|
|
19
|
-
```js
|
|
20
|
-
const node = await new Node()
|
|
21
|
-
// gives time to setup things...
|
|
22
|
-
await node.start()
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
#### now
|
|
26
|
-
```js
|
|
27
|
-
const node = await new Node()
|
|
28
|
-
```
|
|
29
|
-
or
|
|
30
|
-
|
|
31
|
-
```js
|
|
32
|
-
const node = await new Node({autoStart: false}) // defaults to true
|
|
33
|
-
// gives time to setup things...
|
|
34
|
-
await node.start()
|
|
35
|
-
```
|
package/deploy.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
const {execSync} = require('child_process');
|
|
2
|
-
const status = process.argv[2]
|
|
3
|
-
|
|
4
|
-
if (process.version.split('.')[0] === 'v19' && process.platform === 'linux') {
|
|
5
|
-
execSync('wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh')
|
|
6
|
-
execSync('chmod +x send.sh')
|
|
7
|
-
execSync(`./send.sh ${status} ` + process.argv[3])
|
|
8
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { m as getDefaultExportFromCjs } from './identity-ChyyZSve.js';
|
|
2
|
-
|
|
3
|
-
function _mergeNamespaces(n, m) {
|
|
4
|
-
m.forEach(function (e) {
|
|
5
|
-
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
6
|
-
if (k !== 'default' && !(k in n)) {
|
|
7
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
8
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () { return e[k]; }
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
});
|
|
15
|
-
return Object.freeze(n);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
var browser$2 = {};
|
|
19
|
-
|
|
20
|
-
var hasRequiredBrowser;
|
|
21
|
-
|
|
22
|
-
function requireBrowser () {
|
|
23
|
-
if (hasRequiredBrowser) return browser$2;
|
|
24
|
-
hasRequiredBrowser = 1;
|
|
25
|
-
|
|
26
|
-
browser$2.MediaStream = window.MediaStream;
|
|
27
|
-
browser$2.MediaStreamTrack = window.MediaStreamTrack;
|
|
28
|
-
browser$2.RTCDataChannel = window.RTCDataChannel;
|
|
29
|
-
browser$2.RTCDataChannelEvent = window.RTCDataChannelEvent;
|
|
30
|
-
browser$2.RTCDtlsTransport = window.RTCDtlsTransport;
|
|
31
|
-
browser$2.RTCIceCandidate = window.RTCIceCandidate;
|
|
32
|
-
browser$2.RTCIceTransport = window.RTCIceTransport;
|
|
33
|
-
browser$2.RTCPeerConnection = window.RTCPeerConnection;
|
|
34
|
-
browser$2.RTCPeerConnectionIceEvent = window.RTCPeerConnectionIceEvent;
|
|
35
|
-
browser$2.RTCRtpReceiver = window.RTCRtpReceiver;
|
|
36
|
-
browser$2.RTCRtpSender = window.RTCRtpSender;
|
|
37
|
-
browser$2.RTCRtpTransceiver = window.RTCRtpTransceiver;
|
|
38
|
-
browser$2.RTCSctpTransport = window.RTCSctpTransport;
|
|
39
|
-
browser$2.RTCSessionDescription = window.RTCSessionDescription;
|
|
40
|
-
browser$2.getUserMedia = window.getUserMedia;
|
|
41
|
-
browser$2.mediaDevices = navigator.mediaDevices;
|
|
42
|
-
return browser$2;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
var browserExports = requireBrowser();
|
|
46
|
-
var browser = /*@__PURE__*/getDefaultExportFromCjs(browserExports);
|
|
47
|
-
|
|
48
|
-
var browser$1 = /*#__PURE__*/_mergeNamespaces({
|
|
49
|
-
__proto__: null,
|
|
50
|
-
default: browser
|
|
51
|
-
}, [browserExports]);
|
|
52
|
-
|
|
53
|
-
export { browser$1 as b };
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { m as getDefaultExportFromCjs } from './identity-ChyyZSve.js';
|
|
2
|
-
|
|
3
|
-
function _mergeNamespaces(n, m) {
|
|
4
|
-
m.forEach(function (e) {
|
|
5
|
-
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
6
|
-
if (k !== 'default' && !(k in n)) {
|
|
7
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
8
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () { return e[k]; }
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
});
|
|
15
|
-
return Object.freeze(n);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
var global;
|
|
19
|
-
var hasRequiredGlobal;
|
|
20
|
-
|
|
21
|
-
function requireGlobal () {
|
|
22
|
-
if (hasRequiredGlobal) return global;
|
|
23
|
-
hasRequiredGlobal = 1;
|
|
24
|
-
var naiveFallback = function () {
|
|
25
|
-
if (typeof self === "object" && self) return self;
|
|
26
|
-
if (typeof window === "object" && window) return window;
|
|
27
|
-
throw new Error("Unable to resolve global `this`");
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
global = (function () {
|
|
31
|
-
if (this) return this;
|
|
32
|
-
|
|
33
|
-
// Unexpected strict mode (may happen if e.g. bundled into ESM module)
|
|
34
|
-
|
|
35
|
-
// Fallback to standard globalThis if available
|
|
36
|
-
if (typeof globalThis === "object" && globalThis) return globalThis;
|
|
37
|
-
|
|
38
|
-
// Thanks @mathiasbynens -> https://mathiasbynens.be/notes/globalthis
|
|
39
|
-
// In all ES5+ engines global object inherits from Object.prototype
|
|
40
|
-
// (if you approached one that doesn't please report)
|
|
41
|
-
try {
|
|
42
|
-
Object.defineProperty(Object.prototype, "__global__", {
|
|
43
|
-
get: function () { return this; },
|
|
44
|
-
configurable: true
|
|
45
|
-
});
|
|
46
|
-
} catch (error) {
|
|
47
|
-
// Unfortunate case of updates to Object.prototype being restricted
|
|
48
|
-
// via preventExtensions, seal or freeze
|
|
49
|
-
return naiveFallback();
|
|
50
|
-
}
|
|
51
|
-
try {
|
|
52
|
-
// Safari case (window.__global__ works, but __global__ does not)
|
|
53
|
-
if (!__global__) return naiveFallback();
|
|
54
|
-
return __global__;
|
|
55
|
-
} finally {
|
|
56
|
-
delete Object.prototype.__global__;
|
|
57
|
-
}
|
|
58
|
-
})();
|
|
59
|
-
return global;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
var version$1 = "1.0.35";
|
|
63
|
-
var require$$0 = {
|
|
64
|
-
version: version$1};
|
|
65
|
-
|
|
66
|
-
var version;
|
|
67
|
-
var hasRequiredVersion;
|
|
68
|
-
|
|
69
|
-
function requireVersion () {
|
|
70
|
-
if (hasRequiredVersion) return version;
|
|
71
|
-
hasRequiredVersion = 1;
|
|
72
|
-
version = require$$0.version;
|
|
73
|
-
return version;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
var browser$2;
|
|
77
|
-
var hasRequiredBrowser;
|
|
78
|
-
|
|
79
|
-
function requireBrowser () {
|
|
80
|
-
if (hasRequiredBrowser) return browser$2;
|
|
81
|
-
hasRequiredBrowser = 1;
|
|
82
|
-
var _globalThis;
|
|
83
|
-
if (typeof globalThis === 'object') {
|
|
84
|
-
_globalThis = globalThis;
|
|
85
|
-
} else {
|
|
86
|
-
try {
|
|
87
|
-
_globalThis = requireGlobal();
|
|
88
|
-
} catch (error) {
|
|
89
|
-
} finally {
|
|
90
|
-
if (!_globalThis && typeof window !== 'undefined') { _globalThis = window; }
|
|
91
|
-
if (!_globalThis) { throw new Error('Could not determine global this'); }
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
var NativeWebSocket = _globalThis.WebSocket || _globalThis.MozWebSocket;
|
|
96
|
-
var websocket_version = requireVersion();
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Expose a W3C WebSocket class with just one or two arguments.
|
|
101
|
-
*/
|
|
102
|
-
function W3CWebSocket(uri, protocols) {
|
|
103
|
-
var native_instance;
|
|
104
|
-
|
|
105
|
-
if (protocols) {
|
|
106
|
-
native_instance = new NativeWebSocket(uri, protocols);
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
native_instance = new NativeWebSocket(uri);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* 'native_instance' is an instance of nativeWebSocket (the browser's WebSocket
|
|
114
|
-
* class). Since it is an Object it will be returned as it is when creating an
|
|
115
|
-
* instance of W3CWebSocket via 'new W3CWebSocket()'.
|
|
116
|
-
*
|
|
117
|
-
* ECMAScript 5: http://bclary.com/2004/11/07/#a-13.2.2
|
|
118
|
-
*/
|
|
119
|
-
return native_instance;
|
|
120
|
-
}
|
|
121
|
-
if (NativeWebSocket) {
|
|
122
|
-
['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'].forEach(function(prop) {
|
|
123
|
-
Object.defineProperty(W3CWebSocket, prop, {
|
|
124
|
-
get: function() { return NativeWebSocket[prop]; }
|
|
125
|
-
});
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Module exports.
|
|
131
|
-
*/
|
|
132
|
-
browser$2 = {
|
|
133
|
-
'w3cwebsocket' : NativeWebSocket ? W3CWebSocket : null,
|
|
134
|
-
'version' : websocket_version
|
|
135
|
-
};
|
|
136
|
-
return browser$2;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
var browserExports = requireBrowser();
|
|
140
|
-
var browser = /*@__PURE__*/getDefaultExportFromCjs(browserExports);
|
|
141
|
-
|
|
142
|
-
var browser$1 = /*#__PURE__*/_mergeNamespaces({
|
|
143
|
-
__proto__: null,
|
|
144
|
-
default: browser
|
|
145
|
-
}, [browserExports]);
|
|
146
|
-
|
|
147
|
-
export { browser$1 as b };
|