saito-js 0.0.4 → 0.0.6
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/browser/index.js +3669 -0
- package/configs.d.ts +26 -0
- package/configs.d.ts.map +1 -0
- package/index.node.d.ts +12 -0
- package/index.node.d.ts.map +1 -0
- package/index.web.d.ts +12 -0
- package/index.web.d.ts.map +1 -0
- package/lib/block.d.ts +18 -0
- package/lib/block.d.ts.map +1 -0
- package/lib/blockchain.d.ts +8 -0
- package/lib/blockchain.d.ts.map +1 -0
- package/lib/custom/custom_shared_methods.d.ts +22 -0
- package/lib/custom/custom_shared_methods.d.ts.map +1 -0
- package/lib/custom/shared_methods.web.d.ts +15 -0
- package/lib/custom/shared_methods.web.d.ts.map +1 -0
- package/lib/factory.d.ts +16 -0
- package/lib/factory.d.ts.map +1 -0
- package/lib/peer.d.ts +15 -0
- package/lib/peer.d.ts.map +1 -0
- package/lib/saito_factory.d.ts +1 -0
- package/lib/saito_factory.d.ts.map +1 -0
- package/lib/slip.d.ts +43 -0
- package/lib/slip.d.ts.map +1 -0
- package/lib/transaction.d.ts +70 -0
- package/lib/transaction.d.ts.map +1 -0
- package/lib/wallet.d.ts +18 -0
- package/lib/wallet.d.ts.map +1 -0
- package/package.json +2 -2
- package/saito.d.ts +52 -0
- package/saito.d.ts.map +1 -0
- package/server/index.js +3731 -0
- package/{shared_methods.ts → shared_methods.d.ts} +1 -18
- package/shared_methods.d.ts.map +1 -0
- package/tests/index.test.d.ts +1 -0
- package/tests/index.test.d.ts.map +1 -0
- package/.github/workflows/publish.yml +0 -50
- package/.prettierrc.json +0 -3
- package/babel.config.json +0 -13
- package/configs.ts +0 -26
- package/index.node.ts +0 -51
- package/index.web.ts +0 -47
- package/lib/block.ts +0 -42
- package/lib/blockchain.ts +0 -14
- package/lib/custom/custom_shared_methods.ts +0 -92
- package/lib/custom/shared_methods.web.ts +0 -123
- package/lib/factory.ts +0 -32
- package/lib/peer.ts +0 -50
- package/lib/saito_factory.ts +0 -18
- package/lib/slip.ts +0 -119
- package/lib/transaction.ts +0 -179
- package/lib/wallet.ts +0 -61
- package/saito.ts +0 -404
- package/tests/index.test.ts +0 -35
- package/tsconfig.json +0 -111
- package/tsconfig.testing.json +0 -19
- package/webpack.config.js +0 -136
- package/webpack.prod.config.js +0 -136
package/webpack.config.js
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const webpack = require('webpack');
|
|
3
|
-
const {merge} = require("webpack-merge");
|
|
4
|
-
|
|
5
|
-
let config = {
|
|
6
|
-
optimization: {
|
|
7
|
-
minimize: false,
|
|
8
|
-
},
|
|
9
|
-
// Path to your entry point. From this file Webpack will begin his work
|
|
10
|
-
// entry: ["babel-polyfill", path.resolve(__dirname, entrypoint)],
|
|
11
|
-
resolve: {
|
|
12
|
-
// Add '.ts' and '.tsx' as resolvable extensions.
|
|
13
|
-
extensions: [".webpack.js", ".web.js", ".ts", ".tsx", ".js", ".wasm", "..."],
|
|
14
|
-
fallback: {
|
|
15
|
-
"fs": false,
|
|
16
|
-
"tls": false,
|
|
17
|
-
"net": false,
|
|
18
|
-
"path": require.resolve("path-browserify"),
|
|
19
|
-
"zlib": false,
|
|
20
|
-
"http": false,
|
|
21
|
-
"https": false,
|
|
22
|
-
"stream": require.resolve("stream-browserify"),
|
|
23
|
-
"buffer": require.resolve("buffer"),
|
|
24
|
-
"crypto": require.resolve("crypto-browserify"),
|
|
25
|
-
"crypto-browserify": require.resolve("crypto-browserify"),
|
|
26
|
-
"async_hooks": false,
|
|
27
|
-
'process/browser': require.resolve('process/browser'),
|
|
28
|
-
"util": require.resolve("util/"),
|
|
29
|
-
"url": require.resolve("url/")
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
module: {
|
|
33
|
-
rules: [
|
|
34
|
-
// All files with a '.ts' or '.tsx' extension will be handled by 'ts-loader'.
|
|
35
|
-
{
|
|
36
|
-
test: /\.tsx?$/,
|
|
37
|
-
loader: "ts-loader",
|
|
38
|
-
exclude: ["/node_modules/", /\.d\.ts$/iu]
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
test: /\.d\.ts$/,
|
|
42
|
-
loader: 'ignore-loader'
|
|
43
|
-
},
|
|
44
|
-
// All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'.
|
|
45
|
-
{
|
|
46
|
-
test: /\.js$/,
|
|
47
|
-
use: [
|
|
48
|
-
"source-map-loader",
|
|
49
|
-
{
|
|
50
|
-
loader: "babel-loader",
|
|
51
|
-
options: {
|
|
52
|
-
presets: ["@babel/preset-env"],
|
|
53
|
-
sourceMaps: true
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
],
|
|
57
|
-
exclude: /(node_modules)/
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
test: /\.mjs$/,
|
|
61
|
-
exclude: /(node_modules)/,
|
|
62
|
-
type: "javascript/auto"
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
test: /\.wasm$/,
|
|
66
|
-
type: "asset/inline",
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
parser: {
|
|
70
|
-
javascript: {
|
|
71
|
-
dynamicImportMode: 'eager'
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
plugins: [
|
|
76
|
-
// Work around for Buffer is undefined:
|
|
77
|
-
// https://github.com/webpack/changelog-v5/issues/10
|
|
78
|
-
new webpack.ProvidePlugin({
|
|
79
|
-
Buffer: ["buffer", "Buffer"]
|
|
80
|
-
}),
|
|
81
|
-
new webpack.ProvidePlugin({
|
|
82
|
-
process: "process/browser"
|
|
83
|
-
})
|
|
84
|
-
],
|
|
85
|
-
// ignoreWarnings: [/Failed to parse source map/],
|
|
86
|
-
experiments: {
|
|
87
|
-
asyncWebAssembly: true,
|
|
88
|
-
topLevelAwait: true,
|
|
89
|
-
syncWebAssembly: true,
|
|
90
|
-
// futureDefaults: true,
|
|
91
|
-
},
|
|
92
|
-
mode: "development",
|
|
93
|
-
devtool: "eval"
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
let nodeConfigs = merge(config, {
|
|
97
|
-
output: {
|
|
98
|
-
path: path.resolve(__dirname, "./dist/server"),
|
|
99
|
-
filename: "index.js"
|
|
100
|
-
},
|
|
101
|
-
resolve: {
|
|
102
|
-
fallback: {}
|
|
103
|
-
},
|
|
104
|
-
target: "node",
|
|
105
|
-
entry: ["babel-polyfill", path.resolve(__dirname, "./index.node.ts")],
|
|
106
|
-
externals: [
|
|
107
|
-
{
|
|
108
|
-
'utf-8-validate': 'commonjs utf-8-validate',
|
|
109
|
-
'bufferutil': 'commonjs bufferutil',
|
|
110
|
-
},
|
|
111
|
-
],
|
|
112
|
-
});
|
|
113
|
-
let webConfigs = merge(config, {
|
|
114
|
-
output: {
|
|
115
|
-
path: path.resolve(__dirname, "./dist/browser/"),
|
|
116
|
-
filename: "index.js"
|
|
117
|
-
},
|
|
118
|
-
plugins: [
|
|
119
|
-
// new CopyPlugin({
|
|
120
|
-
// patterns: [{
|
|
121
|
-
// from: "./dist/browser/saito.js",
|
|
122
|
-
// to: "../../public/javascripts/saito.js",
|
|
123
|
-
// }]
|
|
124
|
-
// })
|
|
125
|
-
],
|
|
126
|
-
resolve: {
|
|
127
|
-
fallback: {
|
|
128
|
-
"bufferutil": false,
|
|
129
|
-
"utf-8-validate": false
|
|
130
|
-
}
|
|
131
|
-
},
|
|
132
|
-
target: "web",
|
|
133
|
-
entry: ["babel-polyfill", path.resolve(__dirname, "./index.web.ts")],
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
module.exports = [nodeConfigs, webConfigs];
|
package/webpack.prod.config.js
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const webpack = require('webpack');
|
|
3
|
-
const {merge} = require("webpack-merge");
|
|
4
|
-
|
|
5
|
-
let config = {
|
|
6
|
-
optimization: {
|
|
7
|
-
minimize: true,
|
|
8
|
-
},
|
|
9
|
-
// Path to your entry point. From this file Webpack will begin his work
|
|
10
|
-
// entry: ["babel-polyfill", path.resolve(__dirname, entrypoint)],
|
|
11
|
-
resolve: {
|
|
12
|
-
// Add '.ts' and '.tsx' as resolvable extensions.
|
|
13
|
-
extensions: [".webpack.js", ".web.js", ".ts", ".tsx", ".js", ".wasm", "..."],
|
|
14
|
-
fallback: {
|
|
15
|
-
"fs": false,
|
|
16
|
-
"tls": false,
|
|
17
|
-
"net": false,
|
|
18
|
-
"path": require.resolve("path-browserify"),
|
|
19
|
-
"zlib": false,
|
|
20
|
-
"http": false,
|
|
21
|
-
"https": false,
|
|
22
|
-
"stream": require.resolve("stream-browserify"),
|
|
23
|
-
"buffer": require.resolve("buffer"),
|
|
24
|
-
"crypto": require.resolve("crypto-browserify"),
|
|
25
|
-
"crypto-browserify": require.resolve("crypto-browserify"),
|
|
26
|
-
"async_hooks": false,
|
|
27
|
-
'process/browser': require.resolve('process/browser'),
|
|
28
|
-
"util": require.resolve("util/"),
|
|
29
|
-
"url": require.resolve("url/")
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
module: {
|
|
33
|
-
rules: [
|
|
34
|
-
// All files with a '.ts' or '.tsx' extension will be handled by 'ts-loader'.
|
|
35
|
-
{
|
|
36
|
-
test: /\.tsx?$/,
|
|
37
|
-
loader: "ts-loader",
|
|
38
|
-
exclude: ["/node_modules/", /\.d\.ts$/iu]
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
test: /\.d\.ts$/,
|
|
42
|
-
loader: 'ignore-loader'
|
|
43
|
-
},
|
|
44
|
-
// All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'.
|
|
45
|
-
{
|
|
46
|
-
test: /\.js$/,
|
|
47
|
-
use: [
|
|
48
|
-
"source-map-loader",
|
|
49
|
-
{
|
|
50
|
-
loader: "babel-loader",
|
|
51
|
-
options: {
|
|
52
|
-
presets: ["@babel/preset-env"],
|
|
53
|
-
sourceMaps: true
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
],
|
|
57
|
-
exclude: /(node_modules)/
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
test: /\.mjs$/,
|
|
61
|
-
exclude: /(node_modules)/,
|
|
62
|
-
type: "javascript/auto"
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
test: /\.wasm$/,
|
|
66
|
-
type: "asset/inline",
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
parser: {
|
|
70
|
-
javascript: {
|
|
71
|
-
dynamicImportMode: 'eager'
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
plugins: [
|
|
76
|
-
// Work around for Buffer is undefined:
|
|
77
|
-
// https://github.com/webpack/changelog-v5/issues/10
|
|
78
|
-
new webpack.ProvidePlugin({
|
|
79
|
-
Buffer: ["buffer", "Buffer"]
|
|
80
|
-
}),
|
|
81
|
-
new webpack.ProvidePlugin({
|
|
82
|
-
process: "process/browser"
|
|
83
|
-
})
|
|
84
|
-
],
|
|
85
|
-
// ignoreWarnings: [/Failed to parse source map/],
|
|
86
|
-
experiments: {
|
|
87
|
-
asyncWebAssembly: true,
|
|
88
|
-
topLevelAwait: true,
|
|
89
|
-
syncWebAssembly: true,
|
|
90
|
-
// futureDefaults: true,
|
|
91
|
-
},
|
|
92
|
-
mode: "production",
|
|
93
|
-
devtool: "source-map"
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
let nodeConfigs = merge(config, {
|
|
97
|
-
output: {
|
|
98
|
-
path: path.resolve(__dirname, "./dist/server"),
|
|
99
|
-
filename: "index.js"
|
|
100
|
-
},
|
|
101
|
-
resolve: {
|
|
102
|
-
fallback: {}
|
|
103
|
-
},
|
|
104
|
-
target: "node",
|
|
105
|
-
entry: ["babel-polyfill", path.resolve(__dirname, "./index.node.ts")],
|
|
106
|
-
externals: [
|
|
107
|
-
{
|
|
108
|
-
'utf-8-validate': 'commonjs utf-8-validate',
|
|
109
|
-
'bufferutil': 'commonjs bufferutil',
|
|
110
|
-
},
|
|
111
|
-
],
|
|
112
|
-
});
|
|
113
|
-
let webConfigs = merge(config, {
|
|
114
|
-
output: {
|
|
115
|
-
path: path.resolve(__dirname, "./dist/browser/"),
|
|
116
|
-
filename: "index.js"
|
|
117
|
-
},
|
|
118
|
-
plugins: [
|
|
119
|
-
// new CopyPlugin({
|
|
120
|
-
// patterns: [{
|
|
121
|
-
// from: "./dist/browser/saito.js",
|
|
122
|
-
// to: "../../public/javascripts/saito.js",
|
|
123
|
-
// }]
|
|
124
|
-
// })
|
|
125
|
-
],
|
|
126
|
-
resolve: {
|
|
127
|
-
fallback: {
|
|
128
|
-
"bufferutil": false,
|
|
129
|
-
"utf-8-validate": false
|
|
130
|
-
}
|
|
131
|
-
},
|
|
132
|
-
target: "web",
|
|
133
|
-
entry: ["babel-polyfill", path.resolve(__dirname, "./index.web.ts")],
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
module.exports = [nodeConfigs, webConfigs];
|