@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/README.md +1 -1
- package/dist/api/index.d.ts +66 -0
- package/dist/api/transports/http.d.ts +1 -1
- package/dist/browser.esm.js +189 -40
- package/dist/browser.esm.js.map +1 -1
- package/dist/index.cjs +183 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +183 -34
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +189 -40
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/package.json +2 -2
- package/dist/api/transports/ws.d.ts +0 -19
- package/dist/crypto/browser-crypto.d.ts +0 -43
- package/dist/index.browser.js +0 -56378
- package/dist/index.browser.js.map +0 -1
- package/dist/polyfills/secure-random-browser.d.ts +0 -8
- package/dist/utils/buffer-global.d.ts +0 -7
- package/dist/utils/net-polyfill.d.ts +0 -17
- package/dist/utils/polyfill-test.d.ts +0 -19
- package/dist/utils/tls-polyfill.d.ts +0 -15
- package/dist/utils/util-polyfill.d.ts +0 -17
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ A modern JavaScript/TypeScript library for interacting with the Steem blockchain
|
|
|
17
17
|
|
|
18
18
|
### Requirements
|
|
19
19
|
|
|
20
|
-
- **Node.js**: >=
|
|
20
|
+
- **Node.js**: >= 20.19.0 (LTS recommended)
|
|
21
21
|
- **Browser**: Modern browsers with Web Crypto API support
|
|
22
22
|
|
|
23
23
|
### Installation
|
package/dist/api/index.d.ts
CHANGED
|
@@ -29,13 +29,41 @@ export declare class Api extends EventEmitter {
|
|
|
29
29
|
stop(): Promise<void>;
|
|
30
30
|
send(api: string, data: unknown, callback: unknown): void | Promise<void>;
|
|
31
31
|
call(method: string, params: unknown[], callback: (err: Error | null, result?: unknown) => void): void;
|
|
32
|
+
/**
|
|
33
|
+
* Promise-based version of call
|
|
34
|
+
* Makes a JSON-RPC call to the Steem blockchain
|
|
35
|
+
* @param method Method name (e.g., 'condenser_api.get_accounts')
|
|
36
|
+
* @param params Parameters array for the method
|
|
37
|
+
* @returns Promise that resolves with the result or rejects with an error
|
|
38
|
+
*/
|
|
39
|
+
callAsync(method: string, params: unknown[]): Promise<unknown>;
|
|
32
40
|
signedCall(method: string, params: unknown[], account: string, key: string, callback: (err: Error | null, result?: unknown) => void): void;
|
|
41
|
+
/**
|
|
42
|
+
* Promise-based version of signedCall
|
|
43
|
+
* Makes an authenticated JSON-RPC call with cryptographic signature
|
|
44
|
+
* @param method Method name (e.g., 'conveyor.is_email_registered')
|
|
45
|
+
* @param params Parameters array for the method
|
|
46
|
+
* @param account Account name to sign the request with
|
|
47
|
+
* @param key Private key (WIF) to sign the request
|
|
48
|
+
* @returns Promise that resolves with the result or rejects with an error
|
|
49
|
+
*/
|
|
50
|
+
signedCallAsync(method: string, params: unknown[], account: string, key: string): Promise<unknown>;
|
|
33
51
|
/**
|
|
34
52
|
* Verify a signed RPC request
|
|
35
53
|
* @param signedRequest The signed request to verify
|
|
36
54
|
* @param callback Callback function
|
|
37
55
|
*/
|
|
38
56
|
verifySignedRequest(signedRequest: unknown, callback: (err: Error | null, result?: unknown) => void): void;
|
|
57
|
+
/**
|
|
58
|
+
* Promise-based version of verifySignedRequest
|
|
59
|
+
* Verifies a signed RPC request
|
|
60
|
+
* @param signedRequest The signed request to verify
|
|
61
|
+
* @returns Promise that resolves with verification result or rejects with an error
|
|
62
|
+
*/
|
|
63
|
+
verifySignedRequestAsync(signedRequest: unknown): Promise<{
|
|
64
|
+
valid: boolean;
|
|
65
|
+
params: unknown;
|
|
66
|
+
}>;
|
|
39
67
|
setOptions(options: ApiOptions): void;
|
|
40
68
|
setUrl(url: string): void;
|
|
41
69
|
streamBlockNumber(mode?: string | ((err: Error | null, blockNumber?: unknown) => void), callback?: (err: Error | null, blockNumber?: unknown) => void, ts?: number): () => void;
|
|
@@ -45,12 +73,28 @@ export declare class Api extends EventEmitter {
|
|
|
45
73
|
broadcastTransactionSynchronousWith(options: {
|
|
46
74
|
transaction: unknown;
|
|
47
75
|
}, callback: (err: Error | null, result?: unknown) => void): void;
|
|
76
|
+
/**
|
|
77
|
+
* Promise-based version of broadcastTransactionSynchronousWith
|
|
78
|
+
* Broadcasts a transaction synchronously
|
|
79
|
+
* @param options Options object containing the transaction
|
|
80
|
+
* @returns Promise that resolves with the result or rejects with an error
|
|
81
|
+
*/
|
|
82
|
+
broadcastTransactionSynchronousWithAsync(options: {
|
|
83
|
+
transaction: unknown;
|
|
84
|
+
}): Promise<unknown>;
|
|
48
85
|
/**
|
|
49
86
|
* Broadcast a transaction to the blockchain.
|
|
50
87
|
* @param trx The transaction object
|
|
51
88
|
* @param callback Callback function
|
|
52
89
|
*/
|
|
53
90
|
broadcastTransaction(trx: unknown, callback: (err: Error | null, result?: unknown) => void): void;
|
|
91
|
+
/**
|
|
92
|
+
* Promise-based version of broadcastTransaction
|
|
93
|
+
* Broadcasts a transaction to the blockchain
|
|
94
|
+
* @param trx The transaction object
|
|
95
|
+
* @returns Promise that resolves with the result or rejects with an error
|
|
96
|
+
*/
|
|
97
|
+
broadcastTransactionAsync(trx: unknown): Promise<unknown>;
|
|
54
98
|
/**
|
|
55
99
|
* Sign a transaction with the provided private key(s).
|
|
56
100
|
* @param trx The transaction object
|
|
@@ -75,18 +119,40 @@ export declare class Api extends EventEmitter {
|
|
|
75
119
|
* @param callback Callback function
|
|
76
120
|
*/
|
|
77
121
|
broadcastTransactionWithCallback(confirmationCallback: (result: unknown) => void, trx: unknown, callback: (err: Error | null, result?: unknown) => void): void;
|
|
122
|
+
/**
|
|
123
|
+
* Promise-based version of broadcastTransactionWithCallback
|
|
124
|
+
* Note: The confirmationCallback will still be called when the transaction is confirmed
|
|
125
|
+
* @param confirmationCallback Callback function for transaction confirmation
|
|
126
|
+
* @param trx Transaction object to broadcast
|
|
127
|
+
* @returns Promise that resolves with the result or rejects with an error
|
|
128
|
+
*/
|
|
129
|
+
broadcastTransactionWithCallbackAsync(confirmationCallback: (result: unknown) => void, trx: unknown): Promise<unknown>;
|
|
78
130
|
/**
|
|
79
131
|
* Broadcast a block to the network.
|
|
80
132
|
* @param block Block object to broadcast
|
|
81
133
|
* @param callback Callback function
|
|
82
134
|
*/
|
|
83
135
|
broadcastBlock(block: unknown, callback: (err: Error | null, result?: unknown) => void): void;
|
|
136
|
+
/**
|
|
137
|
+
* Promise-based version of broadcastBlock
|
|
138
|
+
* Broadcasts a block to the network
|
|
139
|
+
* @param block Block object to broadcast
|
|
140
|
+
* @returns Promise that resolves with the result or rejects with an error
|
|
141
|
+
*/
|
|
142
|
+
broadcastBlockAsync(block: unknown): Promise<unknown>;
|
|
84
143
|
/**
|
|
85
144
|
* Set the maximum block age for transaction acceptance.
|
|
86
145
|
* @param maxBlockAge Maximum block age in seconds
|
|
87
146
|
* @param callback Callback function
|
|
88
147
|
*/
|
|
89
148
|
setMaxBlockAge(maxBlockAge: number, callback: (err: Error | null, result?: unknown) => void): void;
|
|
149
|
+
/**
|
|
150
|
+
* Promise-based version of setMaxBlockAge
|
|
151
|
+
* Sets the maximum block age for transaction acceptance
|
|
152
|
+
* @param maxBlockAge Maximum block age in seconds
|
|
153
|
+
* @returns Promise that resolves with the result or rejects with an error
|
|
154
|
+
*/
|
|
155
|
+
setMaxBlockAgeAsync(maxBlockAge: number): Promise<unknown>;
|
|
90
156
|
/**
|
|
91
157
|
* Verify transaction authority.
|
|
92
158
|
* @param trx Transaction object to verify
|
|
@@ -2,7 +2,7 @@ import { TransportOptions, JsonRpcRequest } from './types';
|
|
|
2
2
|
import { BaseTransport } from './base';
|
|
3
3
|
/**
|
|
4
4
|
* Makes a JSON-RPC request using native fetch API
|
|
5
|
-
* Universal implementation that works in both Node.js (
|
|
5
|
+
* Universal implementation that works in both Node.js (20.19+) and browser
|
|
6
6
|
*
|
|
7
7
|
* @param url - The URL to the JSON-RPC endpoint
|
|
8
8
|
* @param request - The JSON-RPC request object
|
package/dist/browser.esm.js
CHANGED
|
@@ -1202,7 +1202,7 @@ var hasRequiredBuffer;
|
|
|
1202
1202
|
function requireBuffer () {
|
|
1203
1203
|
if (hasRequiredBuffer) return buffer;
|
|
1204
1204
|
hasRequiredBuffer = 1;
|
|
1205
|
-
(function (exports
|
|
1205
|
+
(function (exports) {
|
|
1206
1206
|
|
|
1207
1207
|
const base64 = requireBase64Js();
|
|
1208
1208
|
const ieee754 = requireIeee754();
|
|
@@ -1211,12 +1211,12 @@ function requireBuffer () {
|
|
|
1211
1211
|
? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation
|
|
1212
1212
|
: null;
|
|
1213
1213
|
|
|
1214
|
-
exports
|
|
1215
|
-
exports
|
|
1216
|
-
exports
|
|
1214
|
+
exports.Buffer = Buffer;
|
|
1215
|
+
exports.SlowBuffer = SlowBuffer;
|
|
1216
|
+
exports.INSPECT_MAX_BYTES = 50;
|
|
1217
1217
|
|
|
1218
1218
|
const K_MAX_LENGTH = 0x7fffffff;
|
|
1219
|
-
exports
|
|
1219
|
+
exports.kMaxLength = K_MAX_LENGTH;
|
|
1220
1220
|
|
|
1221
1221
|
/**
|
|
1222
1222
|
* If `Buffer.TYPED_ARRAY_SUPPORT`:
|
|
@@ -1812,7 +1812,7 @@ function requireBuffer () {
|
|
|
1812
1812
|
|
|
1813
1813
|
Buffer.prototype.inspect = function inspect () {
|
|
1814
1814
|
let str = '';
|
|
1815
|
-
const max = exports
|
|
1815
|
+
const max = exports.INSPECT_MAX_BYTES;
|
|
1816
1816
|
str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim();
|
|
1817
1817
|
if (this.length > max) str += ' ... ';
|
|
1818
1818
|
return '<Buffer ' + str + '>'
|
|
@@ -3331,7 +3331,7 @@ function requireBn$1 () {
|
|
|
3331
3331
|
if (hasRequiredBn$1) return bn$1.exports;
|
|
3332
3332
|
hasRequiredBn$1 = 1;
|
|
3333
3333
|
(function (module) {
|
|
3334
|
-
(function (module, exports
|
|
3334
|
+
(function (module, exports) {
|
|
3335
3335
|
|
|
3336
3336
|
// Utils
|
|
3337
3337
|
function assert (val, msg) {
|
|
@@ -3374,7 +3374,7 @@ function requireBn$1 () {
|
|
|
3374
3374
|
if (typeof module === 'object') {
|
|
3375
3375
|
module.exports = BN;
|
|
3376
3376
|
} else {
|
|
3377
|
-
exports
|
|
3377
|
+
exports.BN = BN;
|
|
3378
3378
|
}
|
|
3379
3379
|
|
|
3380
3380
|
BN.BN = BN;
|
|
@@ -6806,9 +6806,9 @@ var hasRequiredUtils$2;
|
|
|
6806
6806
|
function requireUtils$2 () {
|
|
6807
6807
|
if (hasRequiredUtils$2) return utils$1;
|
|
6808
6808
|
hasRequiredUtils$2 = 1;
|
|
6809
|
-
(function (exports
|
|
6809
|
+
(function (exports) {
|
|
6810
6810
|
|
|
6811
|
-
var utils = exports
|
|
6811
|
+
var utils = exports;
|
|
6812
6812
|
|
|
6813
6813
|
function toArray(msg, enc) {
|
|
6814
6814
|
if (Array.isArray(msg))
|
|
@@ -6873,9 +6873,9 @@ var hasRequiredUtils$1;
|
|
|
6873
6873
|
function requireUtils$1 () {
|
|
6874
6874
|
if (hasRequiredUtils$1) return utils$2;
|
|
6875
6875
|
hasRequiredUtils$1 = 1;
|
|
6876
|
-
(function (exports
|
|
6876
|
+
(function (exports) {
|
|
6877
6877
|
|
|
6878
|
-
var utils = exports
|
|
6878
|
+
var utils = exports;
|
|
6879
6879
|
var BN = requireBn$1();
|
|
6880
6880
|
var minAssert = requireMinimalisticAssert();
|
|
6881
6881
|
var minUtils = requireUtils$2();
|
|
@@ -9080,9 +9080,9 @@ var hasRequiredCurve;
|
|
|
9080
9080
|
function requireCurve () {
|
|
9081
9081
|
if (hasRequiredCurve) return curve;
|
|
9082
9082
|
hasRequiredCurve = 1;
|
|
9083
|
-
(function (exports
|
|
9083
|
+
(function (exports) {
|
|
9084
9084
|
|
|
9085
|
-
var curve = exports
|
|
9085
|
+
var curve = exports;
|
|
9086
9086
|
|
|
9087
9087
|
curve.base = requireBase();
|
|
9088
9088
|
curve.short = requireShort();
|
|
@@ -10386,8 +10386,8 @@ var hasRequiredHash;
|
|
|
10386
10386
|
function requireHash () {
|
|
10387
10387
|
if (hasRequiredHash) return hash;
|
|
10388
10388
|
hasRequiredHash = 1;
|
|
10389
|
-
(function (exports
|
|
10390
|
-
var hash = exports
|
|
10389
|
+
(function (exports) {
|
|
10390
|
+
var hash = exports;
|
|
10391
10391
|
|
|
10392
10392
|
hash.utils = requireUtils();
|
|
10393
10393
|
hash.common = requireCommon$1();
|
|
@@ -11200,9 +11200,9 @@ var hasRequiredCurves;
|
|
|
11200
11200
|
function requireCurves () {
|
|
11201
11201
|
if (hasRequiredCurves) return curves;
|
|
11202
11202
|
hasRequiredCurves = 1;
|
|
11203
|
-
(function (exports
|
|
11203
|
+
(function (exports) {
|
|
11204
11204
|
|
|
11205
|
-
var curves = exports
|
|
11205
|
+
var curves = exports;
|
|
11206
11206
|
|
|
11207
11207
|
var hash = requireHash();
|
|
11208
11208
|
var curve = requireCurve();
|
|
@@ -12441,9 +12441,9 @@ var hasRequiredElliptic;
|
|
|
12441
12441
|
function requireElliptic () {
|
|
12442
12442
|
if (hasRequiredElliptic) return elliptic;
|
|
12443
12443
|
hasRequiredElliptic = 1;
|
|
12444
|
-
(function (exports
|
|
12444
|
+
(function (exports) {
|
|
12445
12445
|
|
|
12446
|
-
var elliptic = exports
|
|
12446
|
+
var elliptic = exports;
|
|
12447
12447
|
|
|
12448
12448
|
elliptic.version = require$$0$1.version;
|
|
12449
12449
|
elliptic.utils = requireUtils$1();
|
|
@@ -12470,7 +12470,7 @@ function requireBn () {
|
|
|
12470
12470
|
if (hasRequiredBn) return bn.exports;
|
|
12471
12471
|
hasRequiredBn = 1;
|
|
12472
12472
|
(function (module) {
|
|
12473
|
-
(function (module, exports
|
|
12473
|
+
(function (module, exports) {
|
|
12474
12474
|
|
|
12475
12475
|
// Utils
|
|
12476
12476
|
function assert (val, msg) {
|
|
@@ -12513,7 +12513,7 @@ function requireBn () {
|
|
|
12513
12513
|
if (typeof module === 'object') {
|
|
12514
12514
|
module.exports = BN;
|
|
12515
12515
|
} else {
|
|
12516
|
-
exports
|
|
12516
|
+
exports.BN = BN;
|
|
12517
12517
|
}
|
|
12518
12518
|
|
|
12519
12519
|
BN.BN = BN;
|
|
@@ -17445,24 +17445,24 @@ class Address {
|
|
|
17445
17445
|
* @returns Buffer with random bytes
|
|
17446
17446
|
*/
|
|
17447
17447
|
function randomBytes(size) {
|
|
17448
|
-
// Always try Web Crypto API first (works in both browser and Node.js
|
|
17448
|
+
// Always try Web Crypto API first (works in both browser and Node.js 20.19+)
|
|
17449
17449
|
if (typeof crypto !== 'undefined' && crypto.getRandomValues) {
|
|
17450
17450
|
const array = new Uint8Array(size);
|
|
17451
17451
|
crypto.getRandomValues(array);
|
|
17452
17452
|
return bufferExports.Buffer.from(array);
|
|
17453
17453
|
}
|
|
17454
17454
|
// Fallback to Node.js crypto only if Web Crypto API is not available
|
|
17455
|
-
// This code path should not be reached in Node.js
|
|
17455
|
+
// This code path should not be reached in Node.js 20.19+ (which has Web Crypto API)
|
|
17456
17456
|
// and is kept as a safety fallback for edge cases.
|
|
17457
17457
|
// In browser builds, Rollup will tree-shake this code away because
|
|
17458
17458
|
// the condition above will always be true in browsers.
|
|
17459
17459
|
//
|
|
17460
|
-
// Note: This SDK requires Node.js >=
|
|
17461
|
-
// Node.js
|
|
17462
|
-
// In ESM mode, require is undefined, but since Node.js
|
|
17460
|
+
// Note: This SDK requires Node.js >= 20.19.0 (see package.json engines field).
|
|
17461
|
+
// Node.js 20.19+ has Web Crypto API, so this fallback is rarely needed.
|
|
17462
|
+
// In ESM mode, require is undefined, but since Node.js 20.19+ has Web Crypto API,
|
|
17463
17463
|
// this code path won't be reached in ESM mode with the minimum required version.
|
|
17464
17464
|
try {
|
|
17465
|
-
// Use dynamic require as a safety fallback (for Node.js <
|
|
17465
|
+
// Use dynamic require as a safety fallback (for Node.js < 20.19 edge cases)
|
|
17466
17466
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
17467
17467
|
const nodeCrypto = null;
|
|
17468
17468
|
if (nodeCrypto && typeof nodeCrypto.randomBytes === 'function') ;
|
|
@@ -17471,7 +17471,7 @@ function randomBytes(size) {
|
|
|
17471
17471
|
// Ignore require errors in browser environments or ESM mode
|
|
17472
17472
|
}
|
|
17473
17473
|
// If neither Web Crypto API nor Node.js crypto is available, throw error
|
|
17474
|
-
throw new Error('Random bytes generation is not available. This library requires either Web Crypto API (browser/Node.js
|
|
17474
|
+
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.');
|
|
17475
17475
|
}
|
|
17476
17476
|
|
|
17477
17477
|
/**
|
|
@@ -18424,11 +18424,11 @@ var hasRequiredRetry$1;
|
|
|
18424
18424
|
function requireRetry$1 () {
|
|
18425
18425
|
if (hasRequiredRetry$1) return retry$2;
|
|
18426
18426
|
hasRequiredRetry$1 = 1;
|
|
18427
|
-
(function (exports
|
|
18427
|
+
(function (exports) {
|
|
18428
18428
|
var RetryOperation = requireRetry_operation();
|
|
18429
18429
|
|
|
18430
|
-
exports
|
|
18431
|
-
var timeouts = exports
|
|
18430
|
+
exports.operation = function(options) {
|
|
18431
|
+
var timeouts = exports.timeouts(options);
|
|
18432
18432
|
return new RetryOperation(timeouts, {
|
|
18433
18433
|
forever: options && (options.forever || options.retries === Infinity),
|
|
18434
18434
|
unref: options && options.unref,
|
|
@@ -18436,7 +18436,7 @@ function requireRetry$1 () {
|
|
|
18436
18436
|
});
|
|
18437
18437
|
};
|
|
18438
18438
|
|
|
18439
|
-
exports
|
|
18439
|
+
exports.timeouts = function(options) {
|
|
18440
18440
|
if (options instanceof Array) {
|
|
18441
18441
|
return [].concat(options);
|
|
18442
18442
|
}
|
|
@@ -18473,7 +18473,7 @@ function requireRetry$1 () {
|
|
|
18473
18473
|
return timeouts;
|
|
18474
18474
|
};
|
|
18475
18475
|
|
|
18476
|
-
exports
|
|
18476
|
+
exports.createTimeout = function(attempt, opts) {
|
|
18477
18477
|
var random = (opts.randomize)
|
|
18478
18478
|
? (Math.random() + 1)
|
|
18479
18479
|
: 1;
|
|
@@ -18484,7 +18484,7 @@ function requireRetry$1 () {
|
|
|
18484
18484
|
return timeout;
|
|
18485
18485
|
};
|
|
18486
18486
|
|
|
18487
|
-
exports
|
|
18487
|
+
exports.wrap = function(obj, options, methods) {
|
|
18488
18488
|
if (options instanceof Array) {
|
|
18489
18489
|
methods = options;
|
|
18490
18490
|
options = null;
|
|
@@ -18504,7 +18504,7 @@ function requireRetry$1 () {
|
|
|
18504
18504
|
var original = obj[method];
|
|
18505
18505
|
|
|
18506
18506
|
obj[method] = function retryWrapper(original) {
|
|
18507
|
-
var op = exports
|
|
18507
|
+
var op = exports.operation(options);
|
|
18508
18508
|
var args = Array.prototype.slice.call(arguments, 1);
|
|
18509
18509
|
var callback = args.pop();
|
|
18510
18510
|
|
|
@@ -18597,7 +18597,7 @@ class JsonRpcError extends Error {
|
|
|
18597
18597
|
}
|
|
18598
18598
|
/**
|
|
18599
18599
|
* Makes a JSON-RPC request using native fetch API
|
|
18600
|
-
* Universal implementation that works in both Node.js (
|
|
18600
|
+
* Universal implementation that works in both Node.js (20.19+) and browser
|
|
18601
18601
|
*
|
|
18602
18602
|
* @param url - The URL to the JSON-RPC endpoint
|
|
18603
18603
|
* @param request - The JSON-RPC request object
|
|
@@ -18944,7 +18944,7 @@ function requireLong () {
|
|
|
18944
18944
|
if (value >= TWO_PWR_64_DBL)
|
|
18945
18945
|
return MAX_UNSIGNED_VALUE;
|
|
18946
18946
|
} else {
|
|
18947
|
-
if (value <= -
|
|
18947
|
+
if (value <= -9223372036854776e3)
|
|
18948
18948
|
return MIN_VALUE;
|
|
18949
18949
|
if (value + 1 >= TWO_PWR_63_DBL)
|
|
18950
18950
|
return MAX_VALUE;
|
|
@@ -23980,7 +23980,7 @@ function fromNumber(value, unsigned) {
|
|
|
23980
23980
|
if (value < 0) return UZERO;
|
|
23981
23981
|
if (value >= TWO_PWR_64_DBL) return MAX_UNSIGNED_VALUE;
|
|
23982
23982
|
} else {
|
|
23983
|
-
if (value <= -
|
|
23983
|
+
if (value <= -9223372036854776e3) return MIN_VALUE;
|
|
23984
23984
|
if (value + 1 >= TWO_PWR_63_DBL) return MAX_VALUE;
|
|
23985
23985
|
}
|
|
23986
23986
|
if (value < 0) return fromNumber(-value, unsigned).neg();
|
|
@@ -26059,6 +26059,25 @@ class Api extends eventsExports.EventEmitter {
|
|
|
26059
26059
|
jsonRpc(this.options.url, { method, params, id }, fetchMethod)
|
|
26060
26060
|
.then(res => { callback(null, res); }, err => { callback(err); });
|
|
26061
26061
|
}
|
|
26062
|
+
/**
|
|
26063
|
+
* Promise-based version of call
|
|
26064
|
+
* Makes a JSON-RPC call to the Steem blockchain
|
|
26065
|
+
* @param method Method name (e.g., 'condenser_api.get_accounts')
|
|
26066
|
+
* @param params Parameters array for the method
|
|
26067
|
+
* @returns Promise that resolves with the result or rejects with an error
|
|
26068
|
+
*/
|
|
26069
|
+
callAsync(method, params) {
|
|
26070
|
+
return new Promise((resolve, reject) => {
|
|
26071
|
+
this.call(method, params, (err, result) => {
|
|
26072
|
+
if (err) {
|
|
26073
|
+
reject(err);
|
|
26074
|
+
}
|
|
26075
|
+
else {
|
|
26076
|
+
resolve(result);
|
|
26077
|
+
}
|
|
26078
|
+
});
|
|
26079
|
+
});
|
|
26080
|
+
}
|
|
26062
26081
|
signedCall(method, params, account, key, callback) {
|
|
26063
26082
|
if (this._transportType !== 'http') {
|
|
26064
26083
|
callback(new Error('RPC methods can only be called when using http transport'));
|
|
@@ -26077,6 +26096,27 @@ class Api extends eventsExports.EventEmitter {
|
|
|
26077
26096
|
jsonRpc(this.options.url, request, fetchMethod)
|
|
26078
26097
|
.then(res => { callback(null, res); }, err => { callback(err); });
|
|
26079
26098
|
}
|
|
26099
|
+
/**
|
|
26100
|
+
* Promise-based version of signedCall
|
|
26101
|
+
* Makes an authenticated JSON-RPC call with cryptographic signature
|
|
26102
|
+
* @param method Method name (e.g., 'conveyor.is_email_registered')
|
|
26103
|
+
* @param params Parameters array for the method
|
|
26104
|
+
* @param account Account name to sign the request with
|
|
26105
|
+
* @param key Private key (WIF) to sign the request
|
|
26106
|
+
* @returns Promise that resolves with the result or rejects with an error
|
|
26107
|
+
*/
|
|
26108
|
+
signedCallAsync(method, params, account, key) {
|
|
26109
|
+
return new Promise((resolve, reject) => {
|
|
26110
|
+
this.signedCall(method, params, account, key, (err, result) => {
|
|
26111
|
+
if (err) {
|
|
26112
|
+
reject(err);
|
|
26113
|
+
}
|
|
26114
|
+
else {
|
|
26115
|
+
resolve(result);
|
|
26116
|
+
}
|
|
26117
|
+
});
|
|
26118
|
+
});
|
|
26119
|
+
}
|
|
26080
26120
|
/**
|
|
26081
26121
|
* Verify a signed RPC request
|
|
26082
26122
|
* @param signedRequest The signed request to verify
|
|
@@ -26139,6 +26179,24 @@ class Api extends eventsExports.EventEmitter {
|
|
|
26139
26179
|
.catch(error => callback(error instanceof Error ? error : new Error(String(error))));
|
|
26140
26180
|
}).catch(callback);
|
|
26141
26181
|
}
|
|
26182
|
+
/**
|
|
26183
|
+
* Promise-based version of verifySignedRequest
|
|
26184
|
+
* Verifies a signed RPC request
|
|
26185
|
+
* @param signedRequest The signed request to verify
|
|
26186
|
+
* @returns Promise that resolves with verification result or rejects with an error
|
|
26187
|
+
*/
|
|
26188
|
+
verifySignedRequestAsync(signedRequest) {
|
|
26189
|
+
return new Promise((resolve, reject) => {
|
|
26190
|
+
this.verifySignedRequest(signedRequest, (err, result) => {
|
|
26191
|
+
if (err) {
|
|
26192
|
+
reject(err);
|
|
26193
|
+
}
|
|
26194
|
+
else {
|
|
26195
|
+
resolve(result);
|
|
26196
|
+
}
|
|
26197
|
+
});
|
|
26198
|
+
});
|
|
26199
|
+
}
|
|
26142
26200
|
setOptions(options) {
|
|
26143
26201
|
Object.assign(this.options, options);
|
|
26144
26202
|
this._setLogger(options);
|
|
@@ -26313,6 +26371,24 @@ class Api extends eventsExports.EventEmitter {
|
|
|
26313
26371
|
}
|
|
26314
26372
|
this.broadcastTransactionSynchronous(trx, callback);
|
|
26315
26373
|
}
|
|
26374
|
+
/**
|
|
26375
|
+
* Promise-based version of broadcastTransactionSynchronousWith
|
|
26376
|
+
* Broadcasts a transaction synchronously
|
|
26377
|
+
* @param options Options object containing the transaction
|
|
26378
|
+
* @returns Promise that resolves with the result or rejects with an error
|
|
26379
|
+
*/
|
|
26380
|
+
broadcastTransactionSynchronousWithAsync(options) {
|
|
26381
|
+
return new Promise((resolve, reject) => {
|
|
26382
|
+
this.broadcastTransactionSynchronousWith(options, (err, result) => {
|
|
26383
|
+
if (err) {
|
|
26384
|
+
reject(err);
|
|
26385
|
+
}
|
|
26386
|
+
else {
|
|
26387
|
+
resolve(result);
|
|
26388
|
+
}
|
|
26389
|
+
});
|
|
26390
|
+
});
|
|
26391
|
+
}
|
|
26316
26392
|
/**
|
|
26317
26393
|
* Broadcast a transaction to the blockchain.
|
|
26318
26394
|
* @param trx The transaction object
|
|
@@ -26332,6 +26408,24 @@ class Api extends eventsExports.EventEmitter {
|
|
|
26332
26408
|
callback(new Error('broadcastTransaction is not implemented'));
|
|
26333
26409
|
}
|
|
26334
26410
|
}
|
|
26411
|
+
/**
|
|
26412
|
+
* Promise-based version of broadcastTransaction
|
|
26413
|
+
* Broadcasts a transaction to the blockchain
|
|
26414
|
+
* @param trx The transaction object
|
|
26415
|
+
* @returns Promise that resolves with the result or rejects with an error
|
|
26416
|
+
*/
|
|
26417
|
+
broadcastTransactionAsync(trx) {
|
|
26418
|
+
return new Promise((resolve, reject) => {
|
|
26419
|
+
this.broadcastTransaction(trx, (err, result) => {
|
|
26420
|
+
if (err) {
|
|
26421
|
+
reject(err);
|
|
26422
|
+
}
|
|
26423
|
+
else {
|
|
26424
|
+
resolve(result);
|
|
26425
|
+
}
|
|
26426
|
+
});
|
|
26427
|
+
});
|
|
26428
|
+
}
|
|
26335
26429
|
/**
|
|
26336
26430
|
* Sign a transaction with the provided private key(s).
|
|
26337
26431
|
* @param trx The transaction object
|
|
@@ -26380,6 +26474,25 @@ class Api extends eventsExports.EventEmitter {
|
|
|
26380
26474
|
params: [confirmationCallback, trx]
|
|
26381
26475
|
}, callback);
|
|
26382
26476
|
}
|
|
26477
|
+
/**
|
|
26478
|
+
* Promise-based version of broadcastTransactionWithCallback
|
|
26479
|
+
* Note: The confirmationCallback will still be called when the transaction is confirmed
|
|
26480
|
+
* @param confirmationCallback Callback function for transaction confirmation
|
|
26481
|
+
* @param trx Transaction object to broadcast
|
|
26482
|
+
* @returns Promise that resolves with the result or rejects with an error
|
|
26483
|
+
*/
|
|
26484
|
+
broadcastTransactionWithCallbackAsync(confirmationCallback, trx) {
|
|
26485
|
+
return new Promise((resolve, reject) => {
|
|
26486
|
+
this.broadcastTransactionWithCallback(confirmationCallback, trx, (err, result) => {
|
|
26487
|
+
if (err) {
|
|
26488
|
+
reject(err);
|
|
26489
|
+
}
|
|
26490
|
+
else {
|
|
26491
|
+
resolve(result);
|
|
26492
|
+
}
|
|
26493
|
+
});
|
|
26494
|
+
});
|
|
26495
|
+
}
|
|
26383
26496
|
/**
|
|
26384
26497
|
* Broadcast a block to the network.
|
|
26385
26498
|
* @param block Block object to broadcast
|
|
@@ -26395,6 +26508,24 @@ class Api extends eventsExports.EventEmitter {
|
|
|
26395
26508
|
params: [block]
|
|
26396
26509
|
}, callback);
|
|
26397
26510
|
}
|
|
26511
|
+
/**
|
|
26512
|
+
* Promise-based version of broadcastBlock
|
|
26513
|
+
* Broadcasts a block to the network
|
|
26514
|
+
* @param block Block object to broadcast
|
|
26515
|
+
* @returns Promise that resolves with the result or rejects with an error
|
|
26516
|
+
*/
|
|
26517
|
+
broadcastBlockAsync(block) {
|
|
26518
|
+
return new Promise((resolve, reject) => {
|
|
26519
|
+
this.broadcastBlock(block, (err, result) => {
|
|
26520
|
+
if (err) {
|
|
26521
|
+
reject(err);
|
|
26522
|
+
}
|
|
26523
|
+
else {
|
|
26524
|
+
resolve(result);
|
|
26525
|
+
}
|
|
26526
|
+
});
|
|
26527
|
+
});
|
|
26528
|
+
}
|
|
26398
26529
|
/**
|
|
26399
26530
|
* Set the maximum block age for transaction acceptance.
|
|
26400
26531
|
* @param maxBlockAge Maximum block age in seconds
|
|
@@ -26410,6 +26541,24 @@ class Api extends eventsExports.EventEmitter {
|
|
|
26410
26541
|
params: [maxBlockAge]
|
|
26411
26542
|
}, callback);
|
|
26412
26543
|
}
|
|
26544
|
+
/**
|
|
26545
|
+
* Promise-based version of setMaxBlockAge
|
|
26546
|
+
* Sets the maximum block age for transaction acceptance
|
|
26547
|
+
* @param maxBlockAge Maximum block age in seconds
|
|
26548
|
+
* @returns Promise that resolves with the result or rejects with an error
|
|
26549
|
+
*/
|
|
26550
|
+
setMaxBlockAgeAsync(maxBlockAge) {
|
|
26551
|
+
return new Promise((resolve, reject) => {
|
|
26552
|
+
this.setMaxBlockAge(maxBlockAge, (err, result) => {
|
|
26553
|
+
if (err) {
|
|
26554
|
+
reject(err);
|
|
26555
|
+
}
|
|
26556
|
+
else {
|
|
26557
|
+
resolve(result);
|
|
26558
|
+
}
|
|
26559
|
+
});
|
|
26560
|
+
});
|
|
26561
|
+
}
|
|
26413
26562
|
/**
|
|
26414
26563
|
* Verify transaction authority.
|
|
26415
26564
|
* @param trx Transaction object to verify
|
|
@@ -28913,7 +29062,7 @@ const steem = {
|
|
|
28913
29062
|
operations,
|
|
28914
29063
|
serializer,
|
|
28915
29064
|
utils: utils$3,
|
|
28916
|
-
version: '1.0.
|
|
29065
|
+
version: '1.0.10',
|
|
28917
29066
|
config: {
|
|
28918
29067
|
set: (options) => {
|
|
28919
29068
|
// If nodes is provided, extract the first node as url for API
|