@steemit/steem-js 1.0.2 → 1.0.3
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 -5
- package/dist/index.umd.js +0 -47
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +2 -0
- package/dist/index.umd.min.js.map +1 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ This is a complete refactoring of the original steem-js library, migrating from
|
|
|
11
11
|
- ✅ **TypeScript Migration**: Complete migration from JavaScript to TypeScript
|
|
12
12
|
- ✅ **Build System**: Migrated from Webpack to Rollup
|
|
13
13
|
- ✅ **Testing**: Migrated from Mocha to Vitest
|
|
14
|
-
- ✅ **Modern Dependencies (
|
|
14
|
+
- ✅ **Modern Dependencies (2025)**: Replaced outdated cryptographic libraries
|
|
15
15
|
- `bigi` → `bn.js` (modern big integer library)
|
|
16
16
|
- `ecurve` → `elliptic` (modern elliptic curve cryptography)
|
|
17
17
|
- Removed all shim layers for direct modern library usage
|
|
@@ -50,10 +50,14 @@ yarn add @steemit/steem-js
|
|
|
50
50
|
|
|
51
51
|
```html
|
|
52
52
|
<!-- Include @steemit/steem-js (all dependencies are bundled) -->
|
|
53
|
+
<!-- For production: use minified version (692KB) -->
|
|
54
|
+
<script src="https://cdn.jsdelivr.net/npm/@steemit/steem-js/dist/index.umd.min.js"></script>
|
|
55
|
+
|
|
56
|
+
<!-- For development: use regular version (1.7MB) with better debugging -->
|
|
53
57
|
<script src="https://cdn.jsdelivr.net/npm/@steemit/steem-js/dist/index.umd.js"></script>
|
|
54
58
|
```
|
|
55
59
|
|
|
56
|
-
**Note**: The UMD build includes all necessary polyfills (events, buffer, util, stream, assert, crypto-browserify). No additional dependencies are required.
|
|
60
|
+
**Note**: The UMD build includes all necessary polyfills (events, buffer, util, stream, assert, crypto-browserify). No additional dependencies are required. The minified version is recommended for production use.
|
|
57
61
|
|
|
58
62
|
## Usage
|
|
59
63
|
|
|
@@ -109,8 +113,8 @@ The UMD build includes all necessary dependencies and polyfills, so you can use
|
|
|
109
113
|
<html>
|
|
110
114
|
<head>
|
|
111
115
|
<title>Steem.js Example</title>
|
|
112
|
-
<!-- Include @steemit/steem-js (
|
|
113
|
-
<script src="https://cdn.jsdelivr.net/npm/@steemit/steem-js/dist/index.umd.js"></script>
|
|
116
|
+
<!-- Include @steemit/steem-js (minified for production) -->
|
|
117
|
+
<script src="https://cdn.jsdelivr.net/npm/@steemit/steem-js/dist/index.umd.min.js"></script>
|
|
114
118
|
</head>
|
|
115
119
|
<body>
|
|
116
120
|
<script>
|
|
@@ -133,7 +137,11 @@ The UMD build includes all necessary dependencies and polyfills, so you can use
|
|
|
133
137
|
</html>
|
|
134
138
|
```
|
|
135
139
|
|
|
136
|
-
**Note**: The UMD build
|
|
140
|
+
**Note**: The UMD build comes in two versions:
|
|
141
|
+
- **Minified** (`index.umd.min.js` - 692KB): Recommended for production
|
|
142
|
+
- **Regular** (`index.umd.js` - 1.7MB): Better for development and debugging
|
|
143
|
+
|
|
144
|
+
Both include all polyfills, making them ready to use in browsers without additional dependencies. For production use with bundlers (Webpack, Vite, Rollup), use the ES Module or CommonJS builds instead.
|
|
137
145
|
|
|
138
146
|
### Broadcast Operations
|
|
139
147
|
|
package/dist/index.umd.js
CHANGED
|
@@ -56254,52 +56254,5 @@
|
|
|
56254
56254
|
|
|
56255
56255
|
return steem;
|
|
56256
56256
|
|
|
56257
|
-
(function() {
|
|
56258
|
-
// Ensure Buffer is globally available after bundle loads
|
|
56259
|
-
if (typeof globalThis !== 'undefined' && typeof globalThis.Buffer === 'undefined') {
|
|
56260
|
-
// Try to find Buffer in the bundle
|
|
56261
|
-
if (typeof require !== 'undefined') {
|
|
56262
|
-
try {
|
|
56263
|
-
globalThis.Buffer = require('buffer').Buffer;
|
|
56264
|
-
} catch (e) {
|
|
56265
|
-
// Fallback: create minimal Buffer polyfill
|
|
56266
|
-
globalThis.Buffer = {
|
|
56267
|
-
from: function(data, encoding) {
|
|
56268
|
-
if (typeof data === 'string') {
|
|
56269
|
-
if (encoding === 'hex') {
|
|
56270
|
-
const bytes = new Uint8Array(data.length / 2);
|
|
56271
|
-
for (let i = 0; i < data.length; i += 2) {
|
|
56272
|
-
bytes[i / 2] = parseInt(data.substr(i, 2), 16);
|
|
56273
|
-
}
|
|
56274
|
-
return bytes;
|
|
56275
|
-
}
|
|
56276
|
-
return new TextEncoder().encode(data);
|
|
56277
|
-
}
|
|
56278
|
-
return new Uint8Array(data);
|
|
56279
|
-
},
|
|
56280
|
-
alloc: function(size, fill) {
|
|
56281
|
-
const buf = new Uint8Array(size);
|
|
56282
|
-
if (fill !== undefined) buf.fill(fill);
|
|
56283
|
-
return buf;
|
|
56284
|
-
},
|
|
56285
|
-
concat: function(buffers) {
|
|
56286
|
-
const totalLength = buffers.reduce((sum, buf) => sum + buf.length, 0);
|
|
56287
|
-
const result = new Uint8Array(totalLength);
|
|
56288
|
-
let offset = 0;
|
|
56289
|
-
for (const buf of buffers) {
|
|
56290
|
-
result.set(buf, offset);
|
|
56291
|
-
offset += buf.length;
|
|
56292
|
-
}
|
|
56293
|
-
return result;
|
|
56294
|
-
},
|
|
56295
|
-
isBuffer: function(obj) {
|
|
56296
|
-
return obj instanceof Uint8Array;
|
|
56297
|
-
}
|
|
56298
|
-
};
|
|
56299
|
-
}
|
|
56300
|
-
}
|
|
56301
|
-
}
|
|
56302
|
-
})();
|
|
56303
|
-
|
|
56304
56257
|
}));
|
|
56305
56258
|
//# sourceMappingURL=index.umd.js.map
|