@steemit/steem-js 1.0.9 → 1.0.10

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/dist/index.umd.js CHANGED
@@ -1188,7 +1188,7 @@
1188
1188
  * @license MIT
1189
1189
  */
1190
1190
 
1191
- (function (exports$1) {
1191
+ (function (exports) {
1192
1192
 
1193
1193
  const base64 = base64Js;
1194
1194
  const ieee754$1 = ieee754;
@@ -1197,12 +1197,12 @@
1197
1197
  ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation
1198
1198
  : null;
1199
1199
 
1200
- exports$1.Buffer = Buffer;
1201
- exports$1.SlowBuffer = SlowBuffer;
1202
- exports$1.INSPECT_MAX_BYTES = 50;
1200
+ exports.Buffer = Buffer;
1201
+ exports.SlowBuffer = SlowBuffer;
1202
+ exports.INSPECT_MAX_BYTES = 50;
1203
1203
 
1204
1204
  const K_MAX_LENGTH = 0x7fffffff;
1205
- exports$1.kMaxLength = K_MAX_LENGTH;
1205
+ exports.kMaxLength = K_MAX_LENGTH;
1206
1206
 
1207
1207
  /**
1208
1208
  * If `Buffer.TYPED_ARRAY_SUPPORT`:
@@ -1798,7 +1798,7 @@
1798
1798
 
1799
1799
  Buffer.prototype.inspect = function inspect () {
1800
1800
  let str = '';
1801
- const max = exports$1.INSPECT_MAX_BYTES;
1801
+ const max = exports.INSPECT_MAX_BYTES;
1802
1802
  str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim();
1803
1803
  if (this.length > max) str += ' ... ';
1804
1804
  return '<Buffer ' + str + '>'
@@ -3308,7 +3308,7 @@
3308
3308
  bn$1.exports;
3309
3309
 
3310
3310
  (function (module) {
3311
- (function (module, exports$1) {
3311
+ (function (module, exports) {
3312
3312
 
3313
3313
  // Utils
3314
3314
  function assert (val, msg) {
@@ -3351,7 +3351,7 @@
3351
3351
  if (typeof module === 'object') {
3352
3352
  module.exports = BN;
3353
3353
  } else {
3354
- exports$1.BN = BN;
3354
+ exports.BN = BN;
3355
3355
  }
3356
3356
 
3357
3357
  BN.BN = BN;
@@ -6770,9 +6770,9 @@
6770
6770
 
6771
6771
  var utils$l = {};
6772
6772
 
6773
- (function (exports$1) {
6773
+ (function (exports) {
6774
6774
 
6775
- var utils = exports$1;
6775
+ var utils = exports;
6776
6776
 
6777
6777
  function toArray(msg, enc) {
6778
6778
  if (Array.isArray(msg))
@@ -6830,9 +6830,9 @@
6830
6830
  };
6831
6831
  } (utils$l));
6832
6832
 
6833
- (function (exports$1) {
6833
+ (function (exports) {
6834
6834
 
6835
- var utils = exports$1;
6835
+ var utils = exports;
6836
6836
  var BN = bnExports$1;
6837
6837
  var minAssert = minimalisticAssert;
6838
6838
  var minUtils = utils$l;
@@ -8984,9 +8984,9 @@
8984
8984
  Point.prototype.toP = Point.prototype.normalize;
8985
8985
  Point.prototype.mixedAdd = Point.prototype.add;
8986
8986
 
8987
- (function (exports$1) {
8987
+ (function (exports) {
8988
8988
 
8989
- var curve = exports$1;
8989
+ var curve = exports;
8990
8990
 
8991
8991
  curve.base = base$1;
8992
8992
  curve.short = short;
@@ -10189,8 +10189,8 @@
10189
10189
  return this.outer.digest(enc);
10190
10190
  };
10191
10191
 
10192
- (function (exports$1) {
10193
- var hash = exports$1;
10192
+ (function (exports) {
10193
+ var hash = exports;
10194
10194
 
10195
10195
  hash.utils = utils$g;
10196
10196
  hash.common = common$5;
@@ -10996,9 +10996,9 @@
10996
10996
  return secp256k1$3;
10997
10997
  }
10998
10998
 
10999
- (function (exports$1) {
10999
+ (function (exports) {
11000
11000
 
11001
- var curves = exports$1;
11001
+ var curves = exports;
11002
11002
 
11003
11003
  var hash = hash$2;
11004
11004
  var curve$1 = curve;
@@ -12167,9 +12167,9 @@
12167
12167
  return val instanceof this.pointClass;
12168
12168
  };
12169
12169
 
12170
- (function (exports$1) {
12170
+ (function (exports) {
12171
12171
 
12172
- var elliptic = exports$1;
12172
+ var elliptic = exports;
12173
12173
 
12174
12174
  elliptic.version = require$$0$1.version;
12175
12175
  elliptic.utils = utils$m;
@@ -12187,7 +12187,7 @@
12187
12187
  bn.exports;
12188
12188
 
12189
12189
  (function (module) {
12190
- (function (module, exports$1) {
12190
+ (function (module, exports) {
12191
12191
 
12192
12192
  // Utils
12193
12193
  function assert (val, msg) {
@@ -12230,7 +12230,7 @@
12230
12230
  if (typeof module === 'object') {
12231
12231
  module.exports = BN;
12232
12232
  } else {
12233
- exports$1.BN = BN;
12233
+ exports.BN = BN;
12234
12234
  }
12235
12235
 
12236
12236
  BN.BN = BN;
@@ -17160,24 +17160,24 @@
17160
17160
  * @returns Buffer with random bytes
17161
17161
  */
17162
17162
  function randomBytes(size) {
17163
- // Always try Web Crypto API first (works in both browser and Node.js 18+)
17163
+ // Always try Web Crypto API first (works in both browser and Node.js 20.19+)
17164
17164
  if (typeof crypto !== 'undefined' && crypto.getRandomValues) {
17165
17165
  const array = new Uint8Array(size);
17166
17166
  crypto.getRandomValues(array);
17167
17167
  return buffer.Buffer.from(array);
17168
17168
  }
17169
17169
  // Fallback to Node.js crypto only if Web Crypto API is not available
17170
- // This code path should not be reached in Node.js 18+ (which has Web Crypto API)
17170
+ // This code path should not be reached in Node.js 20.19+ (which has Web Crypto API)
17171
17171
  // and is kept as a safety fallback for edge cases.
17172
17172
  // In browser builds, Rollup will tree-shake this code away because
17173
17173
  // the condition above will always be true in browsers.
17174
17174
  //
17175
- // Note: This SDK requires Node.js >= 18.0.0 (see package.json engines field).
17176
- // Node.js 18+ has Web Crypto API, so this fallback is rarely needed.
17177
- // In ESM mode, require is undefined, but since Node.js 18+ has Web Crypto API,
17175
+ // Note: This SDK requires Node.js >= 20.19.0 (see package.json engines field).
17176
+ // Node.js 20.19+ has Web Crypto API, so this fallback is rarely needed.
17177
+ // In ESM mode, require is undefined, but since Node.js 20.19+ has Web Crypto API,
17178
17178
  // this code path won't be reached in ESM mode with the minimum required version.
17179
17179
  try {
17180
- // Use dynamic require as a safety fallback (for Node.js < 18 edge cases)
17180
+ // Use dynamic require as a safety fallback (for Node.js < 20.19 edge cases)
17181
17181
  // eslint-disable-next-line @typescript-eslint/no-require-imports
17182
17182
  const nodeCrypto = typeof require !== 'undefined' ? require('crypto') : null;
17183
17183
  if (nodeCrypto && typeof nodeCrypto.randomBytes === 'function') {
@@ -17188,7 +17188,7 @@
17188
17188
  // Ignore require errors in browser environments or ESM mode
17189
17189
  }
17190
17190
  // If neither Web Crypto API nor Node.js crypto is available, throw error
17191
- throw new Error('Random bytes generation is not available. This library requires either Web Crypto API (browser/Node.js 18+) or Node.js crypto module.');
17191
+ throw new Error('Random bytes generation is not available. This library requires either Web Crypto API (browser/Node.js 20.19+) or Node.js crypto module.');
17192
17192
  }
17193
17193
 
17194
17194
  /**
@@ -18128,11 +18128,11 @@
18128
18128
  return mainError;
18129
18129
  };
18130
18130
 
18131
- (function (exports$1) {
18131
+ (function (exports) {
18132
18132
  var RetryOperation = retry_operation;
18133
18133
 
18134
- exports$1.operation = function(options) {
18135
- var timeouts = exports$1.timeouts(options);
18134
+ exports.operation = function(options) {
18135
+ var timeouts = exports.timeouts(options);
18136
18136
  return new RetryOperation(timeouts, {
18137
18137
  forever: options && (options.forever || options.retries === Infinity),
18138
18138
  unref: options && options.unref,
@@ -18140,7 +18140,7 @@
18140
18140
  });
18141
18141
  };
18142
18142
 
18143
- exports$1.timeouts = function(options) {
18143
+ exports.timeouts = function(options) {
18144
18144
  if (options instanceof Array) {
18145
18145
  return [].concat(options);
18146
18146
  }
@@ -18177,7 +18177,7 @@
18177
18177
  return timeouts;
18178
18178
  };
18179
18179
 
18180
- exports$1.createTimeout = function(attempt, opts) {
18180
+ exports.createTimeout = function(attempt, opts) {
18181
18181
  var random = (opts.randomize)
18182
18182
  ? (Math.random() + 1)
18183
18183
  : 1;
@@ -18188,7 +18188,7 @@
18188
18188
  return timeout;
18189
18189
  };
18190
18190
 
18191
- exports$1.wrap = function(obj, options, methods) {
18191
+ exports.wrap = function(obj, options, methods) {
18192
18192
  if (options instanceof Array) {
18193
18193
  methods = options;
18194
18194
  options = null;
@@ -18208,7 +18208,7 @@
18208
18208
  var original = obj[method];
18209
18209
 
18210
18210
  obj[method] = function retryWrapper(original) {
18211
- var op = exports$1.operation(options);
18211
+ var op = exports.operation(options);
18212
18212
  var args = Array.prototype.slice.call(arguments, 1);
18213
18213
  var callback = args.pop();
18214
18214
 
@@ -18290,7 +18290,7 @@
18290
18290
  }
18291
18291
  /**
18292
18292
  * Makes a JSON-RPC request using native fetch API
18293
- * Universal implementation that works in both Node.js (18+) and browser
18293
+ * Universal implementation that works in both Node.js (20.19+) and browser
18294
18294
  *
18295
18295
  * @param url - The URL to the JSON-RPC endpoint
18296
18296
  * @param request - The JSON-RPC request object
@@ -18637,7 +18637,7 @@
18637
18637
  if (value >= TWO_PWR_64_DBL)
18638
18638
  return MAX_UNSIGNED_VALUE;
18639
18639
  } else {
18640
- if (value <= -TWO_PWR_63_DBL)
18640
+ if (value <= -9223372036854776e3)
18641
18641
  return MIN_VALUE;
18642
18642
  if (value + 1 >= TWO_PWR_63_DBL)
18643
18643
  return MAX_VALUE;
@@ -23666,7 +23666,7 @@
23666
23666
  if (value < 0) return UZERO;
23667
23667
  if (value >= TWO_PWR_64_DBL) return MAX_UNSIGNED_VALUE;
23668
23668
  } else {
23669
- if (value <= -TWO_PWR_63_DBL) return MIN_VALUE;
23669
+ if (value <= -9223372036854776e3) return MIN_VALUE;
23670
23670
  if (value + 1 >= TWO_PWR_63_DBL) return MAX_VALUE;
23671
23671
  }
23672
23672
  if (value < 0) return fromNumber(-value, unsigned).neg();
@@ -25745,6 +25745,25 @@
25745
25745
  jsonRpc(this.options.url, { method, params, id }, fetchMethod)
25746
25746
  .then(res => { callback(null, res); }, err => { callback(err); });
25747
25747
  }
25748
+ /**
25749
+ * Promise-based version of call
25750
+ * Makes a JSON-RPC call to the Steem blockchain
25751
+ * @param method Method name (e.g., 'condenser_api.get_accounts')
25752
+ * @param params Parameters array for the method
25753
+ * @returns Promise that resolves with the result or rejects with an error
25754
+ */
25755
+ callAsync(method, params) {
25756
+ return new Promise((resolve, reject) => {
25757
+ this.call(method, params, (err, result) => {
25758
+ if (err) {
25759
+ reject(err);
25760
+ }
25761
+ else {
25762
+ resolve(result);
25763
+ }
25764
+ });
25765
+ });
25766
+ }
25748
25767
  signedCall(method, params, account, key, callback) {
25749
25768
  if (this._transportType !== 'http') {
25750
25769
  callback(new Error('RPC methods can only be called when using http transport'));
@@ -25763,6 +25782,27 @@
25763
25782
  jsonRpc(this.options.url, request, fetchMethod)
25764
25783
  .then(res => { callback(null, res); }, err => { callback(err); });
25765
25784
  }
25785
+ /**
25786
+ * Promise-based version of signedCall
25787
+ * Makes an authenticated JSON-RPC call with cryptographic signature
25788
+ * @param method Method name (e.g., 'conveyor.is_email_registered')
25789
+ * @param params Parameters array for the method
25790
+ * @param account Account name to sign the request with
25791
+ * @param key Private key (WIF) to sign the request
25792
+ * @returns Promise that resolves with the result or rejects with an error
25793
+ */
25794
+ signedCallAsync(method, params, account, key) {
25795
+ return new Promise((resolve, reject) => {
25796
+ this.signedCall(method, params, account, key, (err, result) => {
25797
+ if (err) {
25798
+ reject(err);
25799
+ }
25800
+ else {
25801
+ resolve(result);
25802
+ }
25803
+ });
25804
+ });
25805
+ }
25766
25806
  /**
25767
25807
  * Verify a signed RPC request
25768
25808
  * @param signedRequest The signed request to verify
@@ -25825,6 +25865,24 @@
25825
25865
  .catch(error => callback(error instanceof Error ? error : new Error(String(error))));
25826
25866
  }).catch(callback);
25827
25867
  }
25868
+ /**
25869
+ * Promise-based version of verifySignedRequest
25870
+ * Verifies a signed RPC request
25871
+ * @param signedRequest The signed request to verify
25872
+ * @returns Promise that resolves with verification result or rejects with an error
25873
+ */
25874
+ verifySignedRequestAsync(signedRequest) {
25875
+ return new Promise((resolve, reject) => {
25876
+ this.verifySignedRequest(signedRequest, (err, result) => {
25877
+ if (err) {
25878
+ reject(err);
25879
+ }
25880
+ else {
25881
+ resolve(result);
25882
+ }
25883
+ });
25884
+ });
25885
+ }
25828
25886
  setOptions(options) {
25829
25887
  Object.assign(this.options, options);
25830
25888
  this._setLogger(options);
@@ -25999,6 +26057,24 @@
25999
26057
  }
26000
26058
  this.broadcastTransactionSynchronous(trx, callback);
26001
26059
  }
26060
+ /**
26061
+ * Promise-based version of broadcastTransactionSynchronousWith
26062
+ * Broadcasts a transaction synchronously
26063
+ * @param options Options object containing the transaction
26064
+ * @returns Promise that resolves with the result or rejects with an error
26065
+ */
26066
+ broadcastTransactionSynchronousWithAsync(options) {
26067
+ return new Promise((resolve, reject) => {
26068
+ this.broadcastTransactionSynchronousWith(options, (err, result) => {
26069
+ if (err) {
26070
+ reject(err);
26071
+ }
26072
+ else {
26073
+ resolve(result);
26074
+ }
26075
+ });
26076
+ });
26077
+ }
26002
26078
  /**
26003
26079
  * Broadcast a transaction to the blockchain.
26004
26080
  * @param trx The transaction object
@@ -26018,6 +26094,24 @@
26018
26094
  callback(new Error('broadcastTransaction is not implemented'));
26019
26095
  }
26020
26096
  }
26097
+ /**
26098
+ * Promise-based version of broadcastTransaction
26099
+ * Broadcasts a transaction to the blockchain
26100
+ * @param trx The transaction object
26101
+ * @returns Promise that resolves with the result or rejects with an error
26102
+ */
26103
+ broadcastTransactionAsync(trx) {
26104
+ return new Promise((resolve, reject) => {
26105
+ this.broadcastTransaction(trx, (err, result) => {
26106
+ if (err) {
26107
+ reject(err);
26108
+ }
26109
+ else {
26110
+ resolve(result);
26111
+ }
26112
+ });
26113
+ });
26114
+ }
26021
26115
  /**
26022
26116
  * Sign a transaction with the provided private key(s).
26023
26117
  * @param trx The transaction object
@@ -26066,6 +26160,25 @@
26066
26160
  params: [confirmationCallback, trx]
26067
26161
  }, callback);
26068
26162
  }
26163
+ /**
26164
+ * Promise-based version of broadcastTransactionWithCallback
26165
+ * Note: The confirmationCallback will still be called when the transaction is confirmed
26166
+ * @param confirmationCallback Callback function for transaction confirmation
26167
+ * @param trx Transaction object to broadcast
26168
+ * @returns Promise that resolves with the result or rejects with an error
26169
+ */
26170
+ broadcastTransactionWithCallbackAsync(confirmationCallback, trx) {
26171
+ return new Promise((resolve, reject) => {
26172
+ this.broadcastTransactionWithCallback(confirmationCallback, trx, (err, result) => {
26173
+ if (err) {
26174
+ reject(err);
26175
+ }
26176
+ else {
26177
+ resolve(result);
26178
+ }
26179
+ });
26180
+ });
26181
+ }
26069
26182
  /**
26070
26183
  * Broadcast a block to the network.
26071
26184
  * @param block Block object to broadcast
@@ -26081,6 +26194,24 @@
26081
26194
  params: [block]
26082
26195
  }, callback);
26083
26196
  }
26197
+ /**
26198
+ * Promise-based version of broadcastBlock
26199
+ * Broadcasts a block to the network
26200
+ * @param block Block object to broadcast
26201
+ * @returns Promise that resolves with the result or rejects with an error
26202
+ */
26203
+ broadcastBlockAsync(block) {
26204
+ return new Promise((resolve, reject) => {
26205
+ this.broadcastBlock(block, (err, result) => {
26206
+ if (err) {
26207
+ reject(err);
26208
+ }
26209
+ else {
26210
+ resolve(result);
26211
+ }
26212
+ });
26213
+ });
26214
+ }
26084
26215
  /**
26085
26216
  * Set the maximum block age for transaction acceptance.
26086
26217
  * @param maxBlockAge Maximum block age in seconds
@@ -26096,6 +26227,24 @@
26096
26227
  params: [maxBlockAge]
26097
26228
  }, callback);
26098
26229
  }
26230
+ /**
26231
+ * Promise-based version of setMaxBlockAge
26232
+ * Sets the maximum block age for transaction acceptance
26233
+ * @param maxBlockAge Maximum block age in seconds
26234
+ * @returns Promise that resolves with the result or rejects with an error
26235
+ */
26236
+ setMaxBlockAgeAsync(maxBlockAge) {
26237
+ return new Promise((resolve, reject) => {
26238
+ this.setMaxBlockAge(maxBlockAge, (err, result) => {
26239
+ if (err) {
26240
+ reject(err);
26241
+ }
26242
+ else {
26243
+ resolve(result);
26244
+ }
26245
+ });
26246
+ });
26247
+ }
26099
26248
  /**
26100
26249
  * Verify transaction authority.
26101
26250
  * @param trx Transaction object to verify
@@ -28612,7 +28761,7 @@
28612
28761
  serializer,
28613
28762
  utils: utils$n,
28614
28763
  ...crypto$1,
28615
- version: '1.0.9',
28764
+ version: '1.0.10',
28616
28765
  config: {
28617
28766
  set: (options) => {
28618
28767
  // If nodes is provided, extract the first node as url for API