@leofcoin/chain 1.3.11 → 1.4.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.
Files changed (49) hide show
  1. package/block-worker.js +1 -1
  2. package/demo/chain.browser.js +4 -0
  3. package/dist/browser/workers/block-worker.js +1977 -5692
  4. package/dist/browser/workers/machine-worker.js +1955 -5670
  5. package/dist/browser/workers/pool-worker.js +1636 -5531
  6. package/dist/browser/workers/transaction-worker.js +1626 -5521
  7. package/dist/chain.js +9865 -1192
  8. package/dist/client-80bc8156.js +491 -0
  9. package/dist/commonjs-7fe3c381.js +270 -0
  10. package/dist/generate-account-445db122.js +46 -0
  11. package/dist/index-57f93805.js +718 -0
  12. package/dist/{messages.browser.js → messages-bce1b91d-81af3b00.js} +26 -39
  13. package/dist/module/chain.js +9820 -1174
  14. package/dist/module/client-8031ec88.js +489 -0
  15. package/dist/module/commonjs-9005d5c0.js +268 -0
  16. package/dist/module/generate-account-489552b6.js +44 -0
  17. package/dist/module/index-ac2285c4.js +688 -0
  18. package/dist/module/messages-bce1b91d-eaf75d83.js +302 -0
  19. package/dist/module/node.js +6833 -2
  20. package/dist/module/workers/block-worker.js +3 -287
  21. package/dist/module/workers/machine-worker.js +3 -287
  22. package/dist/node.js +6845 -8
  23. package/dist/workers/machine-worker.js +1 -1
  24. package/package.json +11 -20
  25. package/src/chain.js +9 -12
  26. package/src/contract.js +2 -2
  27. package/src/machine.js +10 -7
  28. package/src/node.js +2 -2
  29. package/src/transaction.js +5 -5
  30. package/test/chain.js +5 -7
  31. package/test/index.js +1 -3
  32. package/tsconfig.js +15 -0
  33. package/workers/block-worker.js +40 -0
  34. package/workers/machine-worker.js +219 -0
  35. package/workers/pool-worker.js +28 -0
  36. package/workers/transaction-worker.js +20 -0
  37. package/workers/workers.js +9 -0
  38. package/dist/865.browser.js +0 -10
  39. package/dist/chain.browser.js +0 -66838
  40. package/dist/generate-account.browser.js +0 -50
  41. package/dist/multi-wallet.browser.js +0 -15
  42. package/dist/node.browser.js +0 -9858
  43. package/dist/pako.browser.js +0 -6900
  44. package/dist/peernet-swarm.browser.js +0 -839
  45. package/dist/storage.browser.js +0 -3724
  46. package/dist/wrtc.browser.js +0 -28
  47. package/rollup.config.js +0 -229
  48. package/src/standards/initializer.js +0 -10
  49. package/webpack.config.js +0 -109
@@ -1,28 +0,0 @@
1
- (self["webpackChunk_leofcoin_chain"] = self["webpackChunk_leofcoin_chain"] || []).push([[228],{
2
-
3
- /***/ 9347:
4
- /***/ (function(__unused_webpack_module, exports) {
5
-
6
-
7
-
8
- exports.MediaStream = window.MediaStream;
9
- exports.MediaStreamTrack = window.MediaStreamTrack;
10
- exports.RTCDataChannel = window.RTCDataChannel;
11
- exports.RTCDataChannelEvent = window.RTCDataChannelEvent;
12
- exports.RTCDtlsTransport = window.RTCDtlsTransport;
13
- exports.RTCIceCandidate = window.RTCIceCandidate;
14
- exports.RTCIceTransport = window.RTCIceTransport;
15
- exports.RTCPeerConnection = window.RTCPeerConnection;
16
- exports.RTCPeerConnectionIceEvent = window.RTCPeerConnectionIceEvent;
17
- exports.RTCRtpReceiver = window.RTCRtpReceiver;
18
- exports.RTCRtpSender = window.RTCRtpSender;
19
- exports.RTCRtpTransceiver = window.RTCRtpTransceiver;
20
- exports.RTCSctpTransport = window.RTCSctpTransport;
21
- exports.RTCSessionDescription = window.RTCSessionDescription;
22
- exports.getUserMedia = window.getUserMedia;
23
- exports.mediaDevices = navigator.mediaDevices;
24
-
25
-
26
- /***/ })
27
-
28
- }])
package/rollup.config.js DELETED
@@ -1,229 +0,0 @@
1
- import json from '@rollup/plugin-json'
2
- import strip from '@rollup/plugin-strip';
3
- import { terser } from "rollup-plugin-terser";
4
- import modify from 'rollup-plugin-modify'
5
-
6
- import { execSync } from 'node:child_process'
7
-
8
- try {
9
- execSync(`rm -rf ./dist/**`)
10
-
11
- } catch (e) {
12
-
13
- }
14
- export default [{
15
- input: ['./src/chain.js'],
16
- output: [{
17
- dir: './dist',
18
- format: 'cjs'
19
- }, {
20
- dir: './dist/module',
21
- format: 'es'
22
- }],
23
- plugins: [
24
- json(),
25
- modify({
26
- 'node:path': 'path',
27
- 'node:crypto': 'crypto'
28
- })
29
- // terser({
30
- // keep_classnames: true
31
- // }),
32
- ]
33
- }, {
34
- input: ['./src/node.js'],
35
- output: [{
36
- dir: 'dist',
37
- format: 'cjs'
38
- }, {
39
- dir: 'dist/module',
40
- format: 'es'
41
- }],
42
- plugins: [
43
- json(),
44
- modify({
45
- 'node:path': 'path',
46
- 'node:crypto': 'crypto'
47
- })
48
- // terser({
49
- // keep_classnames: true
50
- // }),
51
- // cjs()
52
- ]
53
- }, {
54
- input: ['./../workers/src/machine-worker.js'],
55
- output: {
56
- dir: 'dist/module/workers',
57
- format: 'es'
58
- },
59
- plugins: [
60
- json(),
61
- // cjs()
62
- ]
63
- }, {
64
- input: ['./../workers/src/block-worker.js'],
65
- output: {
66
- dir: 'dist/module/workers',
67
- format: 'es'
68
- },
69
- plugins: [
70
- json(),
71
- // cjs()
72
- ]
73
- }, {
74
- input: ['./../workers/src/transaction-worker.js'],
75
- output: {
76
- dir: 'dist/module/workers',
77
- format: 'es'
78
- },
79
- plugins: [
80
- json(),
81
- // cjs()
82
- ]
83
- }, {
84
- input: ['./../workers/src/pool-worker.js'],
85
- output: {
86
- dir: 'dist/module/workers',
87
- format: 'es'
88
- },
89
- plugins: [
90
- json(),
91
- // cjs()
92
- ]
93
- }, {
94
- input: ['./../workers/src/machine-worker.js'],
95
- output: {
96
- dir: 'dist/workers',
97
- format: 'cjs'
98
- },
99
- plugins: [
100
- json(),
101
- terser({
102
- keep_classnames: true
103
- }),
104
- // cjs()
105
- ]
106
- }, {
107
- input: ['./../workers/src/transaction-worker.js'],
108
- output: {
109
- dir: 'dist/workers',
110
- format: 'cjs'
111
- },
112
- plugins: [
113
- json(),
114
- terser({
115
- keep_classnames: true
116
- }),
117
- // cjs()
118
- ]
119
- }, {
120
- input: ['./../workers/src/pool-worker.js'],
121
- output: {
122
- dir: 'dist/workers',
123
- format: 'cjs'
124
- },
125
- plugins: [
126
- json(),
127
- terser({
128
- keep_classnames: true
129
- }),
130
- // cjs()
131
- ]
132
- }, {
133
- input: ['./../workers/src/block-worker.js'],
134
- output: {
135
- dir: './',
136
- format: 'cjs'
137
- },
138
- plugins: [
139
- json(),
140
- terser({
141
- keep_classnames: true
142
- }),
143
- // cjs()
144
- ]
145
- }, {
146
- input: ['src/contracts/factory.js'],
147
- output: {
148
- dir: 'dist/contracts',
149
- format: 'es'
150
- },
151
- plugins: [
152
- json(),
153
- strip(),
154
- terser({
155
- mangle: false,
156
- format: {semicolons: true },
157
- keep_classnames: true,
158
- ecma: 6
159
- })
160
- // resolve({preferBuiltins: false,browser: false, extensions: ['.js', '.mjs', '.node']}),
161
- ]
162
- }, {
163
- input: ['src/contracts/name-service.js'],
164
- output: {
165
- dir: 'dist/contracts',
166
- format: 'es'
167
- },
168
- plugins: [
169
- json(),
170
- strip(),
171
- terser({
172
- mangle: false,
173
- format: {semicolons: true, wrap_iife: true},
174
- keep_classnames: true,
175
- ecma: 6
176
- })
177
- // resolve({preferBuiltins: false,browser: false, extensions: ['.js', '.mjs', '.node']}),
178
- ]
179
- }, {
180
- input: ['src/contracts/native-token.js'],
181
- output: {
182
- dir: 'dist/contracts',
183
- format: 'es'
184
- },
185
- plugins: [
186
- json(),
187
- strip(),
188
- terser({
189
- mangle: false,
190
- keep_classnames: true,
191
- ecma: 6
192
- })
193
- // resolve({preferBuiltins: false,browser: false, extensions: ['.js', '.mjs', '.node']}),
194
- ]
195
- },{
196
- input: ['src/contracts/validators.js'],
197
- output: {
198
- dir: 'dist/contracts',
199
- format: 'es'
200
- },
201
- plugins: [
202
- json(),
203
- strip(),
204
- terser({
205
- mangle: false,
206
- format: {semicolons: true, wrap_iife: true},
207
- keep_classnames: true,
208
- ecma: 6
209
- })
210
- // resolve({preferBuiltins: false,browser: false, extensions: ['.js', '.mjs', '.node']}),
211
- ]
212
- }, {
213
- input: ['src/standards/token.js'],
214
- output: {
215
- dir: 'dist/standards',
216
- format: 'es'
217
- },
218
- plugins: [
219
- json(),
220
- strip(),
221
- terser({
222
- mangle: false,
223
- format: {semicolons: true, wrap_iife: true},
224
- keep_classnames: true,
225
- ecma: 6
226
- })
227
- // resolve({preferBuiltins: false,browser: false, extensions: ['.js', '.mjs', '.node']}),
228
- ]
229
- }]
@@ -1,10 +0,0 @@
1
- export default class Initializer {
2
- #initialized = false
3
- constructor() {
4
- this.#initialized = true
5
- }
6
-
7
- get initialized() {
8
- return this.#initialized
9
- }
10
- }
package/webpack.config.js DELETED
@@ -1,109 +0,0 @@
1
- const path = require('path');
2
- const webpack = require('webpack');
3
- module.exports = [{
4
- mode: 'production',
5
- entry: {
6
- chain: './dist/module/chain.js',
7
- node: './dist/module/node.js'
8
- },
9
- plugins: [
10
-
11
- // Work around for Buffer is undefined:
12
- // https://github.com/webpack/changelog-v5/issues/10
13
- new webpack.ProvidePlugin({
14
- Buffer: ['buffer', 'Buffer'],
15
- }),
16
- new webpack.ProvidePlugin({
17
- process: 'process/browser',
18
- }),
19
- new webpack.ProvidePlugin({
20
- WRTC_IMPORT: `globalThis.wrtc = {
21
- RTCPeerConnection,
22
- RTCSessionDescription,
23
- RTCIceCandidate
24
- }`
25
- })
26
- ],
27
- optimization: {
28
- minimize: false
29
- },
30
- resolve: {
31
- // extensions: [ '.ts', '.js' ],
32
- fallback: {
33
- 'vm': require.resolve("vm-browserify"),
34
- "path": require.resolve("path-browserify"),
35
- "stream": require.resolve("stream-browserify"),
36
- "crypto": require.resolve("crypto-browserify"),
37
- "os": require.resolve("os-browserify/browser"),
38
- "child_process": false,
39
- "fs": false,
40
- "util": false,
41
- // "assert": require.resolve("assert/"),
42
- }
43
- },
44
- output: {
45
- library: {
46
- type: 'module'
47
- },
48
- publicPath: '',
49
- filename: '[name].browser.js',
50
- chunkFilename: '[name].browser.js',
51
- path: path.resolve(__dirname, 'dist'),
52
- },
53
- experiments: {
54
- outputModule: true
55
- }
56
- }, {
57
- mode: 'production',
58
- entry: {
59
- 'machine-worker': './dist/module/workers/machine-worker.js',
60
- 'block-worker': './dist/module/workers/block-worker.js',
61
- 'transaction-worker': './dist/module/workers/transaction-worker.js',
62
- 'pool-worker': './dist/module/workers/pool-worker.js'
63
- },
64
- plugins: [
65
- // Work around for Buffer is undefined:
66
- // https://github.com/webpack/changelog-v5/issues/10
67
- new webpack.ProvidePlugin({
68
- Buffer: ['buffer', 'Buffer'],
69
- }),
70
- new webpack.ProvidePlugin({
71
- process: 'process/browser',
72
- }),
73
- new webpack.ProvidePlugin({
74
- WRTC_IMPORT: `globalThis.wrtc = {
75
- RTCPeerConnection,
76
- RTCSessionDescription,
77
- RTCIceCandidate
78
- }`
79
- })
80
- ],
81
- optimization: {
82
- minimize: false
83
- },
84
- resolve: {
85
- // extensions: [ '.ts', '.js' ],
86
- fallback: {
87
- 'vm': require.resolve("vm-browserify"),
88
- 'path': require.resolve("path-browserify"),
89
- "stream": require.resolve("stream-browserify"),
90
- "os": require.resolve("os-browserify/browser"),
91
- // "buffer": require.resolve("buffer"),
92
- "fs": false,
93
- "util": false,
94
- "child_process": false,
95
- // "assert": require.resolve("assert/"),
96
- }
97
- },
98
- output: {
99
- library: {
100
- type: 'module'
101
- },
102
- publicPath: '',
103
- filename: '[name].js',
104
- path: path.resolve(__dirname, 'dist/browser/workers'),
105
- },
106
- experiments: {
107
- outputModule: true
108
- }
109
- }];