@leofcoin/chain 1.8.8 → 1.8.11
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/chain.js +18 -12
- package/exports/browser/{flags-wmeqg14g.js → constants-ByuwyBVy.js} +772 -82
- package/exports/browser/node-browser.js +84 -4
- package/exports/chain.js +14 -7
- package/exports/constants-eo0U5-D_.js +12 -0
- package/exports/constants.d.ts +2 -0
- package/exports/node.js +2 -9
- package/package.json +4 -4
- package/exports/browser/browser-CfYI-6aD-DHRKebpJ.js +0 -132
- package/exports/browser/browser-Qcpp3EKK-DOtgsScX.js +0 -38
- package/exports/browser/client-CWkdUcxK-BEmg-tGc.js +0 -989
- package/exports/browser/identity-nIyW_Xm8-BU8xakCv.js +0 -17199
- package/exports/browser/index-ChRjMyiM-EjbBu23l.js +0 -36
- package/exports/browser/index-DTbjK0sK-BK_5FT46.js +0 -7580
- package/exports/browser/messages-C507MMRx-ypXoH7gN.js +0 -207
- package/exports/browser/networks-F1y7bMrB.js +0 -25
- package/exports/browser/node-browser-A1KVCavN.js +0 -9132
- package/exports/browser/password-oDixGC8h.js +0 -3
- package/exports/browser/qr-scanner-worker.min-Dy0qkKA4-Dy0qkKA4.js +0 -100
- package/exports/flags-DKVwPDLE.js +0 -3
- package/exports/flags.d.ts +0 -2
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
import { F as FormatInterface } from './node-browser-A1KVCavN.js';
|
|
2
|
-
import './identity-nIyW_Xm8-BU8xakCv.js';
|
|
3
|
-
import './flags-wmeqg14g.js';
|
|
4
|
-
import './networks-F1y7bMrB.js';
|
|
5
|
-
|
|
6
|
-
var proto$b = {
|
|
7
|
-
data: new Uint8Array(),
|
|
8
|
-
signature: new Uint8Array(),
|
|
9
|
-
'from?': String(),
|
|
10
|
-
'to?': String(),
|
|
11
|
-
'id?': String()
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
class PeernetMessage extends FormatInterface {
|
|
15
|
-
get messageName() {
|
|
16
|
-
return 'PeernetMessage';
|
|
17
|
-
}
|
|
18
|
-
constructor(buffer) {
|
|
19
|
-
const name = 'peernet-message';
|
|
20
|
-
super(buffer, proto$b, { name });
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
var proto$a = {
|
|
25
|
-
hash: String(),
|
|
26
|
-
'store?': String()
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* @example `
|
|
31
|
-
new DHTMessage(hash, store)
|
|
32
|
-
// store = optional if not set, peernet checks every store
|
|
33
|
-
let message = new DHTMessage('hashmvbs124xcfd...', 'transaction')
|
|
34
|
-
message = new DHTMessage('hashmvbs124xcfd...', 'block')
|
|
35
|
-
`
|
|
36
|
-
*/
|
|
37
|
-
class DHTMessage extends FormatInterface {
|
|
38
|
-
get messageName() {
|
|
39
|
-
return 'PeernetDHTMessage';
|
|
40
|
-
}
|
|
41
|
-
constructor(data) {
|
|
42
|
-
const name = 'peernet-dht';
|
|
43
|
-
super(data, proto$a, { name });
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
var proto$9 = {
|
|
48
|
-
hash: String(),
|
|
49
|
-
has: Boolean()
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
class DHTMessageResponse extends FormatInterface {
|
|
53
|
-
get messageName() {
|
|
54
|
-
return 'PeernetDHTMessageResponse';
|
|
55
|
-
}
|
|
56
|
-
constructor(data) {
|
|
57
|
-
const name = 'peernet-dht-response';
|
|
58
|
-
super(data, proto$9, { name });
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
var proto$8 = {
|
|
63
|
-
hash: String(),
|
|
64
|
-
'store?': String()
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* @extends {CodecFormat}
|
|
69
|
-
*/
|
|
70
|
-
class DataMessage extends FormatInterface {
|
|
71
|
-
get messageName() {
|
|
72
|
-
return 'PeernetDataMessage';
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* @param {Buffer|String|Object|DataMessage} data - The data needed to create the DataMessage
|
|
76
|
-
*/
|
|
77
|
-
constructor(data) {
|
|
78
|
-
super(data, proto$8, { name: 'peernet-data' });
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
var proto$7 = {
|
|
83
|
-
data: new Uint8Array(),
|
|
84
|
-
topic: new Uint8Array()
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
class PsMessage extends FormatInterface {
|
|
88
|
-
get messageName() {
|
|
89
|
-
return 'PsMessage';
|
|
90
|
-
}
|
|
91
|
-
constructor(buffer) {
|
|
92
|
-
const name = 'peernet-ps';
|
|
93
|
-
super(buffer, proto$7, { name });
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
var proto$6 = {
|
|
98
|
-
id: String()
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
class PeerMessage extends FormatInterface {
|
|
102
|
-
get messageName() {
|
|
103
|
-
return 'PeernetPeerMessage';
|
|
104
|
-
}
|
|
105
|
-
constructor(data) {
|
|
106
|
-
const name = 'peernet-peer';
|
|
107
|
-
super(data, proto$6, { name });
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
var proto$5 = {
|
|
112
|
-
request: String(),
|
|
113
|
-
'requested?': new Uint8Array()
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
class RequestMessage extends FormatInterface {
|
|
117
|
-
get messageName() {
|
|
118
|
-
return 'PeernetRequestMessage';
|
|
119
|
-
}
|
|
120
|
-
constructor(data) {
|
|
121
|
-
const name = 'peernet-request';
|
|
122
|
-
super(data, proto$5, { name });
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
var proto$4 = {
|
|
127
|
-
response: {}
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
class ResponseMessage extends FormatInterface {
|
|
131
|
-
get messageName() {
|
|
132
|
-
return 'PeernetResponseMessage';
|
|
133
|
-
}
|
|
134
|
-
constructor(data) {
|
|
135
|
-
const name = 'peernet-response';
|
|
136
|
-
super(data, proto$4, { name });
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
var proto$3 = {
|
|
141
|
-
id: String()
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
class PeerMessageResponse extends FormatInterface {
|
|
145
|
-
get messageName() {
|
|
146
|
-
return 'PeernetPeerMessageResponse';
|
|
147
|
-
}
|
|
148
|
-
constructor(data) {
|
|
149
|
-
const name = 'peernet-peer-response';
|
|
150
|
-
super(data, proto$3, { name });
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
var proto$2 = {
|
|
155
|
-
hash: String(),
|
|
156
|
-
data: new Uint8Array()
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
class DataMessageResponse extends FormatInterface {
|
|
160
|
-
get messageName() {
|
|
161
|
-
return 'PeernetDataMessageResponse';
|
|
162
|
-
}
|
|
163
|
-
constructor(data) {
|
|
164
|
-
const name = 'peernet-data-response';
|
|
165
|
-
super(data, proto$2, { name });
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
var proto$1 = {
|
|
170
|
-
value: String(),
|
|
171
|
-
author: String(),
|
|
172
|
-
timestamp: Number(),
|
|
173
|
-
files: [String()]
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
class ChatMessage extends FormatInterface {
|
|
177
|
-
get messageName() {
|
|
178
|
-
return 'ChatMessage';
|
|
179
|
-
}
|
|
180
|
-
constructor(buffer) {
|
|
181
|
-
const name = 'chat-message';
|
|
182
|
-
super(buffer, proto$1, { name });
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
var proto = {
|
|
187
|
-
path: String(),
|
|
188
|
-
'content?': '',
|
|
189
|
-
'links?': []
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* @extends {CodecFormat}
|
|
194
|
-
*/
|
|
195
|
-
class PeernetFile extends FormatInterface {
|
|
196
|
-
get messageName() {
|
|
197
|
-
return 'PeernetFile';
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* @param {Buffer|String|Object|DataMessage} data - The data needed to create the DataMessage
|
|
201
|
-
*/
|
|
202
|
-
constructor(data) {
|
|
203
|
-
super(data, proto, { name: 'peernet-file' });
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
export { ChatMessage, DHTMessage, DHTMessageResponse, DataMessage, DataMessageResponse, PeerMessage, PeerMessageResponse, PeernetFile, PeernetMessage, PsMessage, RequestMessage, ResponseMessage };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// todo only one star needed, no need to have one for each network
|
|
2
|
-
// unless we change anything to the star protocol
|
|
3
|
-
// version differences should be handled in the chain
|
|
4
|
-
// maybe a good way to handle could be in p2pt-swarm
|
|
5
|
-
var networks = {
|
|
6
|
-
leofcoin: {
|
|
7
|
-
mainnet: {
|
|
8
|
-
// ports don't really matter since it is favorable to have it begind a ngninx proxy but if we change something to the proto it's easier maybe?
|
|
9
|
-
port: 44444,
|
|
10
|
-
// todo a versionhash would be nice to have as a double check?
|
|
11
|
-
versionHash: '0',
|
|
12
|
-
// a short description identifying the version
|
|
13
|
-
description: 'Main net current version',
|
|
14
|
-
stars: ['wss://star.leofcoin.org'] // todo webrtc and bittorent stars
|
|
15
|
-
},
|
|
16
|
-
peach: {
|
|
17
|
-
port: 44444,
|
|
18
|
-
description: 'Main testnet: latest step before merging into main',
|
|
19
|
-
versionHash: '1',
|
|
20
|
-
stars: ['wss://star.leofcoin.org'] // todo webrtc and bittorent stars
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export { networks as default };
|