@substeem/steem-sdk 0.0.0-stage → 1.1.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.
- package/LICENSE +21 -0
- package/README.md +95 -2
- package/dist/index.cjs +5412 -0
- package/dist/index.d.cts +1386 -0
- package/dist/index.d.mts +1386 -0
- package/dist/index.mjs +5387 -0
- package/package.json +78 -4
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,1386 @@
|
|
|
1
|
+
export declare class Signature {
|
|
2
|
+
data: Uint8Array;
|
|
3
|
+
recovery: number;
|
|
4
|
+
private compressed;
|
|
5
|
+
/**
|
|
6
|
+
* Creates a new Signature instance.
|
|
7
|
+
* @param data Raw signature data (64 bytes)
|
|
8
|
+
* @param recovery Recovery byte (0-3)
|
|
9
|
+
* @param compressed Whether signature is compressed (default: true)
|
|
10
|
+
*/
|
|
11
|
+
constructor(data: Uint8Array, recovery: number, compressed?: boolean);
|
|
12
|
+
/**
|
|
13
|
+
* Creates a Signature from a hex string.
|
|
14
|
+
* @param string 130-character hex string containing signature and recovery data
|
|
15
|
+
* @returns New Signature instance
|
|
16
|
+
* @throws Error if input is not a string
|
|
17
|
+
*/
|
|
18
|
+
static from(string: string): Signature;
|
|
19
|
+
/**
|
|
20
|
+
* Converts signature to 65-byte buffer format.
|
|
21
|
+
* @returns 65-byte buffer containing recovery byte + signature data
|
|
22
|
+
*/
|
|
23
|
+
toBuffer(): Uint8Array<ArrayBuffer>;
|
|
24
|
+
/**
|
|
25
|
+
* Returns signature as 130-character hex string.
|
|
26
|
+
* @returns Hex string representation of signature
|
|
27
|
+
*/
|
|
28
|
+
customToString(): string;
|
|
29
|
+
/**
|
|
30
|
+
* Recovers the public key from this signature and message.
|
|
31
|
+
* @param message 32-byte message hash (Uint8Array) or 64-character hex string
|
|
32
|
+
* @returns PublicKey that created this signature
|
|
33
|
+
* @throws Error if message is not a valid 32-byte SHA256 hash
|
|
34
|
+
*/
|
|
35
|
+
getPublicKey(message: Uint8Array | string): PublicKey;
|
|
36
|
+
}
|
|
37
|
+
export declare class PublicKey {
|
|
38
|
+
key: Uint8Array;
|
|
39
|
+
prefix: string;
|
|
40
|
+
/**
|
|
41
|
+
* Creates a new PublicKey instance from raw bytes.
|
|
42
|
+
* Validates that the key is a valid point on the secp256k1 curve.
|
|
43
|
+
* @param key Raw public key bytes (33 bytes, compressed format)
|
|
44
|
+
* @param prefix Optional address prefix (defaults to config.address_prefix)
|
|
45
|
+
*/
|
|
46
|
+
constructor(key: Uint8Array, prefix?: string);
|
|
47
|
+
/**
|
|
48
|
+
* Creates a PublicKey from a string representation.
|
|
49
|
+
* Validates checksum, prefix, and secp256k1 point validity.
|
|
50
|
+
* @param wif Public key string (e.g., "STM8m5UgaFAAYQRuaNejYdS8FVLVp9Ss3K1qAVk5de6F8s3HnVbvA")
|
|
51
|
+
* @returns New PublicKey instance
|
|
52
|
+
* @throws Error if the key format or checksum is invalid
|
|
53
|
+
*/
|
|
54
|
+
static fromString(wif: string): PublicKey;
|
|
55
|
+
/**
|
|
56
|
+
* Creates a PublicKey from a string or returns the instance if already a PublicKey.
|
|
57
|
+
* @param value Public key string or PublicKey instance
|
|
58
|
+
* @returns New or existing PublicKey instance
|
|
59
|
+
*/
|
|
60
|
+
static from(value: string | PublicKey): PublicKey;
|
|
61
|
+
/**
|
|
62
|
+
* Verifies a signature against a message hash.
|
|
63
|
+
* @param message 32-byte message hash to verify
|
|
64
|
+
* @param signature Signature to verify
|
|
65
|
+
* @returns True if signature is valid, false otherwise
|
|
66
|
+
*/
|
|
67
|
+
verify(message: Uint8Array, signature: Signature | string): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Returns the public key as a string for storage or transmission.
|
|
70
|
+
* @returns Public key string with prefix (e.g., "STM8m5UgaFAAYQRuaNejYdS8FVLVp9Ss3K1qAVk5de6F8s3HnVbvA")
|
|
71
|
+
*/
|
|
72
|
+
toString(): string;
|
|
73
|
+
/**
|
|
74
|
+
* Returns JSON representation (same as toString()).
|
|
75
|
+
* @returns Public key string
|
|
76
|
+
*/
|
|
77
|
+
toJSON(): string;
|
|
78
|
+
/**
|
|
79
|
+
* Returns a string representation for debugging.
|
|
80
|
+
* @returns Formatted public key string
|
|
81
|
+
*/
|
|
82
|
+
inspect(): string;
|
|
83
|
+
}
|
|
84
|
+
type KeyRole = 'owner' | 'active' | 'posting' | 'memo';
|
|
85
|
+
/**
|
|
86
|
+
* ECDSA (secp256k1) private key for signing and encryption operations.
|
|
87
|
+
* Handles key generation, derivation from seeds/passwords, and cryptographic operations.
|
|
88
|
+
*
|
|
89
|
+
* All private keys are stored internally as Uint8Array and can be converted to/from
|
|
90
|
+
* Wallet Import Format (WIF) strings for storage and transmission.
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```typescript
|
|
94
|
+
* // From WIF string
|
|
95
|
+
* const key = PrivateKey.from('5JdeC9P7Pbd1uGdFVEsJ41EkEnADbbHGq6p1BwFxm6txNBsQnsw')
|
|
96
|
+
*
|
|
97
|
+
* // Generate random key
|
|
98
|
+
* const randomKey = PrivateKey.randomKey()
|
|
99
|
+
*
|
|
100
|
+
* // From username and password
|
|
101
|
+
* const loginKey = PrivateKey.fromLogin('username', 'password')
|
|
102
|
+
*
|
|
103
|
+
* // Sign a message
|
|
104
|
+
* const signature = key.sign(someHash)
|
|
105
|
+
*
|
|
106
|
+
* // Get public key
|
|
107
|
+
* const pubKey = key.createPublic()
|
|
108
|
+
*
|
|
109
|
+
* // Clean up sensitive memory when done
|
|
110
|
+
* key.wipe()
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
export declare class PrivateKey {
|
|
114
|
+
key: Uint8Array;
|
|
115
|
+
constructor(key: Uint8Array);
|
|
116
|
+
/**
|
|
117
|
+
* Securely zeroes out the private key bytes from memory.
|
|
118
|
+
* Call this when done with the key to prevent sensitive data lingering in heap buffers.
|
|
119
|
+
*/
|
|
120
|
+
wipe(): void;
|
|
121
|
+
/**
|
|
122
|
+
* Creates a PrivateKey instance from a WIF string or raw Uint8Array.
|
|
123
|
+
* Automatically detects the input type and uses the appropriate method.
|
|
124
|
+
*
|
|
125
|
+
* @param value - WIF formatted string or raw 32-byte key as Uint8Array
|
|
126
|
+
* @returns New PrivateKey instance
|
|
127
|
+
* @throws Error if the key format is invalid
|
|
128
|
+
*/
|
|
129
|
+
static from(value: string | Uint8Array): PrivateKey;
|
|
130
|
+
/**
|
|
131
|
+
* Creates a PrivateKey from a Wallet Import Format (WIF) encoded string.
|
|
132
|
+
*
|
|
133
|
+
* @param wif - WIF encoded private key string
|
|
134
|
+
* @returns New PrivateKey instance
|
|
135
|
+
* @throws Error if WIF format is invalid or checksum fails
|
|
136
|
+
*/
|
|
137
|
+
static fromString(wif: string): PrivateKey;
|
|
138
|
+
/**
|
|
139
|
+
* Creates a PrivateKey from a seed string or Uint8Array.
|
|
140
|
+
* The seed is hashed with SHA256 to produce the private key.
|
|
141
|
+
*
|
|
142
|
+
* @param seed - Seed string (converted to bytes) or raw byte array
|
|
143
|
+
* @returns New PrivateKey instance derived from seed
|
|
144
|
+
*/
|
|
145
|
+
static fromSeed(seed: string | Uint8Array): PrivateKey;
|
|
146
|
+
/**
|
|
147
|
+
* Derives a PrivateKey from username, password, and role using Steem's key derivation scheme.
|
|
148
|
+
* This generates the same keys that the Steem wallet uses for login-based keys.
|
|
149
|
+
*
|
|
150
|
+
* @param username - Steem username
|
|
151
|
+
* @param password - Master password (or seed phrase)
|
|
152
|
+
* @param role - Key role ('owner', 'active', 'posting', 'memo')
|
|
153
|
+
* @returns New PrivateKey instance for the specified role
|
|
154
|
+
*/
|
|
155
|
+
static fromLogin(username: string, password: string, role?: KeyRole): PrivateKey;
|
|
156
|
+
/**
|
|
157
|
+
* Signs a 32-byte message hash using ECDSA and returns a recoverable signature.
|
|
158
|
+
* The signature includes recovery information to allow public key recovery.
|
|
159
|
+
*
|
|
160
|
+
* @param message - 32-byte message hash to sign (Uint8Array)
|
|
161
|
+
* @returns Signature object containing the signature data
|
|
162
|
+
*/
|
|
163
|
+
sign(message: Uint8Array): Signature;
|
|
164
|
+
/**
|
|
165
|
+
* Derives the corresponding public key for this private key.
|
|
166
|
+
*
|
|
167
|
+
* @param prefix - Optional address prefix (defaults to config.address_prefix)
|
|
168
|
+
* @returns PublicKey instance derived from this private key
|
|
169
|
+
*/
|
|
170
|
+
createPublic(prefix?: string): PublicKey;
|
|
171
|
+
/**
|
|
172
|
+
* Returns the private key as a Wallet Import Format (WIF) encoded string.
|
|
173
|
+
* This includes network ID and checksum for safe storage/transmission.
|
|
174
|
+
*
|
|
175
|
+
* @returns WIF encoded private key string
|
|
176
|
+
*/
|
|
177
|
+
toString(): string;
|
|
178
|
+
/**
|
|
179
|
+
* Returns a masked representation of the private key for debugging/logging.
|
|
180
|
+
* Shows only the first and last 6 characters to avoid accidental exposure.
|
|
181
|
+
* Use toString() to get the full key for export/serialization.
|
|
182
|
+
*
|
|
183
|
+
* @returns Masked key representation for safe logging
|
|
184
|
+
*/
|
|
185
|
+
inspect(): string;
|
|
186
|
+
/**
|
|
187
|
+
* Computes a shared secret using ECDH key exchange for memo encryption.
|
|
188
|
+
* The shared secret is used as a key for AES encryption/decryption.
|
|
189
|
+
*
|
|
190
|
+
* @param publicKey - Other party's public key
|
|
191
|
+
* @returns 64-byte shared secret as Uint8Array
|
|
192
|
+
*/
|
|
193
|
+
getSharedSecret(publicKey: PublicKey): Uint8Array;
|
|
194
|
+
/**
|
|
195
|
+
* Generates a new cryptographically secure random private key.
|
|
196
|
+
* Uses the secp256k1 key generation algorithm for security.
|
|
197
|
+
* This method may take up to 250ms due to entropy collection.
|
|
198
|
+
*
|
|
199
|
+
* @returns New randomly generated PrivateKey instance
|
|
200
|
+
*/
|
|
201
|
+
static randomKey(): PrivateKey;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Class representing a Steem asset,
|
|
205
|
+
* e.g. `1.000 STEEM`, `5.000 SBD` or `12.112233 VESTS`.
|
|
206
|
+
*/
|
|
207
|
+
export declare class Asset {
|
|
208
|
+
amount: number;
|
|
209
|
+
symbol: string;
|
|
210
|
+
constructor(amount: number, symbol: string);
|
|
211
|
+
/** Create a new Asset instance from a string, e.g. `42.000 STEEM`. */
|
|
212
|
+
static fromString(string: string, expectedSymbol?: string | null): Asset;
|
|
213
|
+
/**
|
|
214
|
+
* Convenience to create new Asset.
|
|
215
|
+
* @param symbol Symbol to use when created from number. Will also be used to validate
|
|
216
|
+
* the asset, throws if the passed value has a different symbol than this.
|
|
217
|
+
*/
|
|
218
|
+
static from(value: number | string | Asset, symbol?: string | null): Asset;
|
|
219
|
+
/** Return asset precision. */
|
|
220
|
+
getPrecision(): 3 | 6;
|
|
221
|
+
/** Return a string representation of this asset, e.g. `42.000 STEEM`. */
|
|
222
|
+
toString(): string;
|
|
223
|
+
toJSON(): string;
|
|
224
|
+
}
|
|
225
|
+
export type AssetSymbol = 'STEEM' | 'SBD' | 'VESTS' | 'TESTS' | 'TBD';
|
|
226
|
+
export interface Authority {
|
|
227
|
+
weight_threshold: number;
|
|
228
|
+
account_auths: Array<[string, number]>;
|
|
229
|
+
key_auths: Array<[string | PublicKey, number]>;
|
|
230
|
+
}
|
|
231
|
+
export type AuthorityType = Authority;
|
|
232
|
+
export interface Beneficiary {
|
|
233
|
+
account: string;
|
|
234
|
+
weight: number;
|
|
235
|
+
}
|
|
236
|
+
export interface Price {
|
|
237
|
+
base: Asset | string;
|
|
238
|
+
quote: Asset | string;
|
|
239
|
+
}
|
|
240
|
+
export type PriceType = Price | {
|
|
241
|
+
base: string | Asset;
|
|
242
|
+
quote: string | Asset;
|
|
243
|
+
};
|
|
244
|
+
export interface ChainProperties {
|
|
245
|
+
account_creation_fee: Asset | string;
|
|
246
|
+
maximum_block_size: number;
|
|
247
|
+
sbd_interest_rate?: number;
|
|
248
|
+
}
|
|
249
|
+
export interface WitnessProps {
|
|
250
|
+
account_creation_fee?: Asset | string;
|
|
251
|
+
account_subsidy_budget?: number;
|
|
252
|
+
account_subsidy_decay?: number;
|
|
253
|
+
key?: string | PublicKey;
|
|
254
|
+
maximum_block_size?: number;
|
|
255
|
+
new_signing_key?: string | PublicKey | null;
|
|
256
|
+
sbd_exchange_rate?: Price;
|
|
257
|
+
sbd_interest_rate?: number;
|
|
258
|
+
url?: string;
|
|
259
|
+
}
|
|
260
|
+
export interface VoteOperation {
|
|
261
|
+
voter: string;
|
|
262
|
+
author: string;
|
|
263
|
+
permlink: string;
|
|
264
|
+
weight: number;
|
|
265
|
+
}
|
|
266
|
+
export interface CommentOperation {
|
|
267
|
+
parent_author: string;
|
|
268
|
+
parent_permlink: string;
|
|
269
|
+
author: string;
|
|
270
|
+
permlink: string;
|
|
271
|
+
title: string;
|
|
272
|
+
body: string;
|
|
273
|
+
json_metadata: string;
|
|
274
|
+
}
|
|
275
|
+
export interface TransferOperation {
|
|
276
|
+
from: string;
|
|
277
|
+
to: string;
|
|
278
|
+
amount: Asset | string;
|
|
279
|
+
memo: string;
|
|
280
|
+
}
|
|
281
|
+
export interface TransferToVestingOperation {
|
|
282
|
+
from: string;
|
|
283
|
+
to: string;
|
|
284
|
+
amount: Asset | string;
|
|
285
|
+
}
|
|
286
|
+
export interface WithdrawVestingOperation {
|
|
287
|
+
account: string;
|
|
288
|
+
vesting_shares: Asset | string;
|
|
289
|
+
}
|
|
290
|
+
export interface AccountCreateOperation {
|
|
291
|
+
fee: Asset | string;
|
|
292
|
+
creator: string;
|
|
293
|
+
new_account_name: string;
|
|
294
|
+
owner: Authority;
|
|
295
|
+
active: Authority;
|
|
296
|
+
posting: Authority;
|
|
297
|
+
memo_key: string | PublicKey;
|
|
298
|
+
json_metadata: string;
|
|
299
|
+
}
|
|
300
|
+
export interface AccountCreateWithDelegationOperation {
|
|
301
|
+
fee: Asset | string;
|
|
302
|
+
delegation: Asset | string;
|
|
303
|
+
creator: string;
|
|
304
|
+
new_account_name: string;
|
|
305
|
+
owner: Authority;
|
|
306
|
+
active: Authority;
|
|
307
|
+
posting: Authority;
|
|
308
|
+
memo_key: string | PublicKey;
|
|
309
|
+
json_metadata: string;
|
|
310
|
+
extensions: [];
|
|
311
|
+
}
|
|
312
|
+
export interface AccountUpdateOperation {
|
|
313
|
+
account: string;
|
|
314
|
+
owner?: Authority;
|
|
315
|
+
active?: Authority;
|
|
316
|
+
posting?: Authority;
|
|
317
|
+
memo_key: string | PublicKey;
|
|
318
|
+
json_metadata: string;
|
|
319
|
+
}
|
|
320
|
+
export interface AccountUpdate2Operation {
|
|
321
|
+
account: string;
|
|
322
|
+
owner?: Authority;
|
|
323
|
+
active?: Authority;
|
|
324
|
+
posting?: Authority;
|
|
325
|
+
memo_key?: string | PublicKey;
|
|
326
|
+
json_metadata: string;
|
|
327
|
+
posting_json_metadata: string;
|
|
328
|
+
extensions: [];
|
|
329
|
+
}
|
|
330
|
+
export interface AccountWitnessVoteOperation {
|
|
331
|
+
account: string;
|
|
332
|
+
witness: string;
|
|
333
|
+
approve: boolean;
|
|
334
|
+
}
|
|
335
|
+
export interface AccountWitnessProxyOperation {
|
|
336
|
+
account: string;
|
|
337
|
+
proxy: string;
|
|
338
|
+
}
|
|
339
|
+
export interface ConvertOperation {
|
|
340
|
+
owner: string;
|
|
341
|
+
requestid: number;
|
|
342
|
+
amount: Asset | string;
|
|
343
|
+
}
|
|
344
|
+
export interface CollateralizedConvertOperation {
|
|
345
|
+
owner: string;
|
|
346
|
+
requestid: number;
|
|
347
|
+
amount: Asset | string;
|
|
348
|
+
}
|
|
349
|
+
export interface CustomOperation {
|
|
350
|
+
required_auths: string[];
|
|
351
|
+
id: number;
|
|
352
|
+
data: Uint8Array | string;
|
|
353
|
+
}
|
|
354
|
+
export interface CustomJsonOperation {
|
|
355
|
+
required_auths: string[];
|
|
356
|
+
required_posting_auths: string[];
|
|
357
|
+
id: string;
|
|
358
|
+
json: string;
|
|
359
|
+
}
|
|
360
|
+
export interface ClaimAccountOperation {
|
|
361
|
+
creator: string;
|
|
362
|
+
fee: Asset | string;
|
|
363
|
+
extensions: [];
|
|
364
|
+
}
|
|
365
|
+
export interface CreateClaimedAccountOperation {
|
|
366
|
+
creator: string;
|
|
367
|
+
new_account_name: string;
|
|
368
|
+
owner: Authority;
|
|
369
|
+
active: Authority;
|
|
370
|
+
posting: Authority;
|
|
371
|
+
memo_key: string | PublicKey;
|
|
372
|
+
json_metadata: string;
|
|
373
|
+
extensions: [];
|
|
374
|
+
}
|
|
375
|
+
export interface ClaimRewardBalanceOperation {
|
|
376
|
+
account: string;
|
|
377
|
+
reward_steem?: Asset | string;
|
|
378
|
+
reward_sbd?: Asset | string;
|
|
379
|
+
reward_vests: Asset | string;
|
|
380
|
+
}
|
|
381
|
+
export interface DelegateVestingSharesOperation {
|
|
382
|
+
delegator: string;
|
|
383
|
+
delegatee: string;
|
|
384
|
+
vesting_shares: Asset | string;
|
|
385
|
+
}
|
|
386
|
+
export interface DeleteCommentOperation {
|
|
387
|
+
author: string;
|
|
388
|
+
permlink: string;
|
|
389
|
+
}
|
|
390
|
+
export interface CommentOptionsOperation {
|
|
391
|
+
author: string;
|
|
392
|
+
permlink: string;
|
|
393
|
+
max_accepted_payout: Asset | string;
|
|
394
|
+
percent_steem_dollars?: number;
|
|
395
|
+
percent_sbd?: number;
|
|
396
|
+
allow_votes: boolean;
|
|
397
|
+
allow_curation_rewards: boolean;
|
|
398
|
+
extensions: Array<Array<Beneficiary>>;
|
|
399
|
+
}
|
|
400
|
+
export interface SetWithdrawVestingRouteOperation {
|
|
401
|
+
from_account: string;
|
|
402
|
+
to_account: string;
|
|
403
|
+
percent: number;
|
|
404
|
+
auto_vest: boolean;
|
|
405
|
+
}
|
|
406
|
+
export interface WitnessUpdateOperation {
|
|
407
|
+
owner: string;
|
|
408
|
+
url: string;
|
|
409
|
+
block_signing_key: string | PublicKey;
|
|
410
|
+
props: ChainProperties;
|
|
411
|
+
fee: Asset | string;
|
|
412
|
+
}
|
|
413
|
+
export interface WitnessSetPropertiesOperation {
|
|
414
|
+
owner: string;
|
|
415
|
+
props: Array<[string, string]>;
|
|
416
|
+
extensions: [];
|
|
417
|
+
}
|
|
418
|
+
export interface AccountWitnessVoteOperation {
|
|
419
|
+
account: string;
|
|
420
|
+
witness: string;
|
|
421
|
+
approve: boolean;
|
|
422
|
+
}
|
|
423
|
+
export interface DeclineVotingRightsOperation {
|
|
424
|
+
account: string;
|
|
425
|
+
decline: boolean;
|
|
426
|
+
}
|
|
427
|
+
export interface ResetAccountOperation {
|
|
428
|
+
reset_account: string;
|
|
429
|
+
account_to_reset: string;
|
|
430
|
+
new_owner_authority: Authority;
|
|
431
|
+
}
|
|
432
|
+
export interface SetResetAccountOperation {
|
|
433
|
+
account: string;
|
|
434
|
+
current_reset_account: string;
|
|
435
|
+
reset_account: string;
|
|
436
|
+
}
|
|
437
|
+
export interface TransferToSavingsOperation {
|
|
438
|
+
from: string;
|
|
439
|
+
to: string;
|
|
440
|
+
amount: Asset | string;
|
|
441
|
+
memo: string;
|
|
442
|
+
}
|
|
443
|
+
export interface TransferFromSavingsOperation {
|
|
444
|
+
from: string;
|
|
445
|
+
request_id: number;
|
|
446
|
+
to: string;
|
|
447
|
+
amount: Asset | string;
|
|
448
|
+
memo: string;
|
|
449
|
+
}
|
|
450
|
+
export interface CancelTransferFromSavingsOperation {
|
|
451
|
+
from: string;
|
|
452
|
+
request_id: number;
|
|
453
|
+
}
|
|
454
|
+
export interface LimitOrderCreateOperation {
|
|
455
|
+
owner: string;
|
|
456
|
+
orderid: number;
|
|
457
|
+
amount_to_sell: Asset | string;
|
|
458
|
+
min_to_receive: Asset | string;
|
|
459
|
+
fill_or_kill: boolean;
|
|
460
|
+
expiration: string | Date;
|
|
461
|
+
}
|
|
462
|
+
export interface LimitOrderCreate2Operation {
|
|
463
|
+
owner: string;
|
|
464
|
+
orderid: number;
|
|
465
|
+
amount_to_sell: Asset | string;
|
|
466
|
+
fill_or_kill: boolean;
|
|
467
|
+
exchange_rate: Price;
|
|
468
|
+
expiration: string | Date;
|
|
469
|
+
}
|
|
470
|
+
export interface LimitOrderCancelOperation {
|
|
471
|
+
owner: string;
|
|
472
|
+
orderid: number;
|
|
473
|
+
}
|
|
474
|
+
export interface FeedPublishOperation {
|
|
475
|
+
publisher: string;
|
|
476
|
+
exchange_rate: Price;
|
|
477
|
+
}
|
|
478
|
+
export interface EscrowTransferOperation {
|
|
479
|
+
from: string;
|
|
480
|
+
to: string;
|
|
481
|
+
sbd_amount?: Asset | string;
|
|
482
|
+
steem_amount?: Asset | string;
|
|
483
|
+
escrow_id: number;
|
|
484
|
+
agent: string;
|
|
485
|
+
fee: Asset | string;
|
|
486
|
+
json_meta: string;
|
|
487
|
+
ratification_deadline: string | Date;
|
|
488
|
+
escrow_expiration: string | Date;
|
|
489
|
+
}
|
|
490
|
+
export interface EscrowDisputeOperation {
|
|
491
|
+
from: string;
|
|
492
|
+
to: string;
|
|
493
|
+
agent: string;
|
|
494
|
+
who: string;
|
|
495
|
+
escrow_id: number;
|
|
496
|
+
}
|
|
497
|
+
export interface EscrowReleaseOperation {
|
|
498
|
+
from: string;
|
|
499
|
+
to: string;
|
|
500
|
+
agent: string;
|
|
501
|
+
who: string;
|
|
502
|
+
receiver: string;
|
|
503
|
+
escrow_id: number;
|
|
504
|
+
sbd_amount?: Asset | string;
|
|
505
|
+
steem_amount?: Asset | string;
|
|
506
|
+
}
|
|
507
|
+
export interface EscrowApproveOperation {
|
|
508
|
+
from: string;
|
|
509
|
+
to: string;
|
|
510
|
+
agent: string;
|
|
511
|
+
who: string;
|
|
512
|
+
escrow_id: number;
|
|
513
|
+
approve: boolean;
|
|
514
|
+
}
|
|
515
|
+
export interface RecoverAccountOperation {
|
|
516
|
+
account_to_recover: string;
|
|
517
|
+
new_owner_authority: Authority;
|
|
518
|
+
recent_owner_authority: Authority;
|
|
519
|
+
extensions: [];
|
|
520
|
+
}
|
|
521
|
+
export interface RequestAccountRecoveryOperation {
|
|
522
|
+
recovery_account: string;
|
|
523
|
+
account_to_recover: string;
|
|
524
|
+
new_owner_authority: Authority;
|
|
525
|
+
extensions: [];
|
|
526
|
+
}
|
|
527
|
+
export interface ChangeRecoveryAccountOperation {
|
|
528
|
+
account_to_recover: string;
|
|
529
|
+
new_recovery_account: string;
|
|
530
|
+
extensions: [];
|
|
531
|
+
}
|
|
532
|
+
export interface TransferOperation {
|
|
533
|
+
from: string;
|
|
534
|
+
to: string;
|
|
535
|
+
amount: Asset | string;
|
|
536
|
+
memo: string;
|
|
537
|
+
}
|
|
538
|
+
export interface RecurrentTransferOperation {
|
|
539
|
+
from: string;
|
|
540
|
+
to: string;
|
|
541
|
+
amount: Asset | string;
|
|
542
|
+
memo: string;
|
|
543
|
+
recurrence: number;
|
|
544
|
+
executions: number;
|
|
545
|
+
extensions: Array<{
|
|
546
|
+
type: number;
|
|
547
|
+
value: {
|
|
548
|
+
pair_id: number;
|
|
549
|
+
};
|
|
550
|
+
}>;
|
|
551
|
+
}
|
|
552
|
+
export interface CreateProposalOperation {
|
|
553
|
+
creator: string;
|
|
554
|
+
receiver: string;
|
|
555
|
+
start_date: string | Date;
|
|
556
|
+
end_date: string | Date;
|
|
557
|
+
daily_pay: Asset | string;
|
|
558
|
+
subject: string;
|
|
559
|
+
permlink: string;
|
|
560
|
+
extensions: [];
|
|
561
|
+
}
|
|
562
|
+
export interface UpdateProposalOperation {
|
|
563
|
+
proposal_id: number;
|
|
564
|
+
creator: string;
|
|
565
|
+
daily_pay: Asset | string;
|
|
566
|
+
subject: string;
|
|
567
|
+
permlink: string;
|
|
568
|
+
extensions: Array<Array<{
|
|
569
|
+
end_date: string | Date;
|
|
570
|
+
}>>;
|
|
571
|
+
}
|
|
572
|
+
export interface UpdateProposalVotesOperation {
|
|
573
|
+
voter: string;
|
|
574
|
+
proposal_ids: number[];
|
|
575
|
+
approve: boolean;
|
|
576
|
+
extensions: [];
|
|
577
|
+
}
|
|
578
|
+
export interface RemoveProposalOperation {
|
|
579
|
+
proposal_owner: string;
|
|
580
|
+
proposal_ids: number[];
|
|
581
|
+
extensions: [];
|
|
582
|
+
}
|
|
583
|
+
export type Operation = ['vote', VoteOperation] | ['comment', CommentOperation] | ['transfer', TransferOperation] | ['transfer_to_vesting', TransferToVestingOperation] | ['withdraw_vesting', WithdrawVestingOperation] | ['account_create', AccountCreateOperation] | ['account_create_with_delegation', AccountCreateWithDelegationOperation] | ['account_update', AccountUpdateOperation] | ['account_update2', AccountUpdate2Operation] | ['account_witness_vote', AccountWitnessVoteOperation] | ['account_witness_proxy', AccountWitnessProxyOperation] | ['convert', ConvertOperation] | ['collateralized_convert', CollateralizedConvertOperation] | ['custom', CustomOperation] | ['custom_json', CustomJsonOperation] | ['claim_account', ClaimAccountOperation] | ['create_claimed_account', CreateClaimedAccountOperation] | ['claim_reward_balance', ClaimRewardBalanceOperation] | ['delegate_vesting_shares', DelegateVestingSharesOperation] | ['delete_comment', DeleteCommentOperation] | ['comment_options', CommentOptionsOperation] | ['set_withdraw_vesting_route', SetWithdrawVestingRouteOperation] | ['witness_update', WitnessUpdateOperation] | ['witness_set_properties', WitnessSetPropertiesOperation] | ['decline_voting_rights', DeclineVotingRightsOperation] | ['reset_account', ResetAccountOperation] | ['set_reset_account', SetResetAccountOperation] | ['transfer_to_savings', TransferToSavingsOperation] | ['transfer_from_savings', TransferFromSavingsOperation] | ['cancel_transfer_from_savings', CancelTransferFromSavingsOperation] | ['limit_order_create', LimitOrderCreateOperation] | ['limit_order_create2', LimitOrderCreate2Operation] | ['limit_order_cancel', LimitOrderCancelOperation] | ['feed_publish', FeedPublishOperation] | ['escrow_transfer', EscrowTransferOperation] | ['escrow_dispute', EscrowDisputeOperation] | ['escrow_release', EscrowReleaseOperation] | ['escrow_approve', EscrowApproveOperation] | ['recover_account', RecoverAccountOperation] | ['request_account_recovery', RequestAccountRecoveryOperation] | ['change_recovery_account', ChangeRecoveryAccountOperation] | ['recurrent_transfer', RecurrentTransferOperation] | ['create_proposal', CreateProposalOperation] | ['update_proposal', UpdateProposalOperation] | ['update_proposal_votes', UpdateProposalVotesOperation] | ['remove_proposal', RemoveProposalOperation];
|
|
584
|
+
export type OperationName = Operation[0];
|
|
585
|
+
export type OperationBody<O extends OperationName> = Extract<Operation, [O, any]>[1];
|
|
586
|
+
export type VirtualOperationName = 'fill_convert_request' | 'author_reward' | 'curation_reward' | 'comment_reward' | 'liquidity_reward' | 'interest' | 'fill_vesting_withdraw' | 'fill_order' | 'shutdown_witness' | 'fill_transfer_from_savings' | 'hardfork' | 'comment_payout_update' | 'return_vesting_delegation' | 'comment_benefactor_reward' | 'producer_reward' | 'clear_null_account_balance' | 'proposal_pay' | 'sps_fund' | 'hardfork_steem' | 'hardfork_steem_restore' | 'delayed_voting' | 'consolidate_treasury_balance' | 'effective_comment_vote' | 'ineffective_delete_comment' | 'sps_convert' | 'expired_account_notification' | 'changed_recovery_account' | 'transfer_to_vesting_completed' | 'pow_reward' | 'vesting_shares_split' | 'account_created' | 'fill_collateralized_convert_request' | 'system_warning' | 'fill_recurrent_transfer' | 'failed_recurrent_transfer' | 'limit_order_cancelled' | 'producer_missed' | 'proposal_fee' | 'collateralized_convert_immediate_conversion' | 'escrow_approved' | 'escrow_rejected' | 'proxy_cleared' | 'declined_voting_rights';
|
|
587
|
+
/** Created by the chain itself, never broadcast. Bodies are untyped. */
|
|
588
|
+
export type VirtualOperation = [VirtualOperationName, Record<string, unknown>];
|
|
589
|
+
export interface WitnessSetPropertiesParams extends WitnessProps {}
|
|
590
|
+
export type Extension = [] | [string, any] | any[];
|
|
591
|
+
export interface TransactionType {
|
|
592
|
+
expiration: string;
|
|
593
|
+
extensions: Extension[];
|
|
594
|
+
operations: [OperationName, OperationBody<OperationName>][];
|
|
595
|
+
ref_block_num: number;
|
|
596
|
+
ref_block_prefix: number;
|
|
597
|
+
signatures: string[];
|
|
598
|
+
}
|
|
599
|
+
export type SignedTransaction = TransactionType;
|
|
600
|
+
export interface Manabar {
|
|
601
|
+
current_mana: string | number;
|
|
602
|
+
last_update_time: number;
|
|
603
|
+
}
|
|
604
|
+
export interface Account {
|
|
605
|
+
id: number;
|
|
606
|
+
name: string;
|
|
607
|
+
owner: Authority;
|
|
608
|
+
active: Authority;
|
|
609
|
+
posting: Authority;
|
|
610
|
+
memo_key: string;
|
|
611
|
+
json_metadata: string;
|
|
612
|
+
posting_json_metadata?: string;
|
|
613
|
+
proxy: string;
|
|
614
|
+
last_owner_update: string;
|
|
615
|
+
last_account_update: string;
|
|
616
|
+
created: string;
|
|
617
|
+
mined: boolean;
|
|
618
|
+
recovery_account: string;
|
|
619
|
+
reset_account: string;
|
|
620
|
+
last_account_recovery: string;
|
|
621
|
+
comment_count: number;
|
|
622
|
+
lifetime_vote_count: number;
|
|
623
|
+
post_count: number;
|
|
624
|
+
can_vote: boolean;
|
|
625
|
+
voting_power: number;
|
|
626
|
+
last_vote_time: string;
|
|
627
|
+
voting_manabar: Manabar;
|
|
628
|
+
downvote_manabar?: Manabar;
|
|
629
|
+
balance: Asset | string;
|
|
630
|
+
savings_balance: Asset | string;
|
|
631
|
+
sbd_balance: Asset | string;
|
|
632
|
+
sbd_seconds: string;
|
|
633
|
+
sbd_seconds_last_update: string;
|
|
634
|
+
sbd_last_interest_payment: string;
|
|
635
|
+
savings_sbd_balance: Asset | string;
|
|
636
|
+
savings_sbd_seconds: string;
|
|
637
|
+
savings_sbd_seconds_last_update: string;
|
|
638
|
+
savings_sbd_last_interest_payment: string;
|
|
639
|
+
savings_withdraw_requests: number;
|
|
640
|
+
reward_sbd_balance: Asset | string;
|
|
641
|
+
reward_steem_balance: Asset | string;
|
|
642
|
+
reward_vesting_balance: Asset | string;
|
|
643
|
+
reward_vesting_steem: Asset | string;
|
|
644
|
+
curation_rewards: number | string;
|
|
645
|
+
posting_rewards: number | string;
|
|
646
|
+
vesting_shares: Asset | string;
|
|
647
|
+
delegated_vesting_shares: Asset | string;
|
|
648
|
+
received_vesting_shares: Asset | string;
|
|
649
|
+
vesting_withdraw_rate: Asset | string;
|
|
650
|
+
next_vesting_withdrawal: string;
|
|
651
|
+
withdrawn: number | string;
|
|
652
|
+
to_withdraw: number | string;
|
|
653
|
+
withdraw_routes: number;
|
|
654
|
+
proxied_vsf_votes: number[];
|
|
655
|
+
witnesses_voted_for: number;
|
|
656
|
+
last_post: string;
|
|
657
|
+
last_root_post: string;
|
|
658
|
+
pending_claimed_accounts?: number;
|
|
659
|
+
}
|
|
660
|
+
export interface ExtendedAccount extends Account {
|
|
661
|
+
vesting_balance: Asset | string;
|
|
662
|
+
reputation: string | number;
|
|
663
|
+
transfer_history: any[];
|
|
664
|
+
market_history: any[];
|
|
665
|
+
post_history: any[];
|
|
666
|
+
vote_history: any[];
|
|
667
|
+
other_history: any[];
|
|
668
|
+
witness_votes: string[];
|
|
669
|
+
tags_usage: string[];
|
|
670
|
+
guest_bloggers: string[];
|
|
671
|
+
open_orders?: any[];
|
|
672
|
+
comments?: any[];
|
|
673
|
+
blog?: any[];
|
|
674
|
+
feed?: any[];
|
|
675
|
+
recent_replies?: any[];
|
|
676
|
+
recommended?: any[];
|
|
677
|
+
}
|
|
678
|
+
export interface DynamicGlobalProperties {
|
|
679
|
+
head_block_number: number;
|
|
680
|
+
head_block_id: string;
|
|
681
|
+
time: string;
|
|
682
|
+
current_witness: string;
|
|
683
|
+
total_pow: number;
|
|
684
|
+
num_pow_witnesses: number;
|
|
685
|
+
virtual_supply: Asset | string;
|
|
686
|
+
current_supply: Asset | string;
|
|
687
|
+
confidential_supply: Asset | string;
|
|
688
|
+
current_sbd_supply: Asset | string;
|
|
689
|
+
confidential_sbd_supply: Asset | string;
|
|
690
|
+
total_vesting_fund_steem: Asset | string;
|
|
691
|
+
total_vesting_shares: Asset | string;
|
|
692
|
+
total_reward_fund_steem: Asset | string;
|
|
693
|
+
total_reward_shares2: string;
|
|
694
|
+
pending_rewarded_vesting_shares: Asset | string;
|
|
695
|
+
pending_rewarded_vesting_steem: Asset | string;
|
|
696
|
+
sbd_interest_rate: number;
|
|
697
|
+
sbd_print_rate: number;
|
|
698
|
+
maximum_block_size: number;
|
|
699
|
+
required_actions_partition_percent: number;
|
|
700
|
+
current_aslot: number;
|
|
701
|
+
recent_slots_filled: string;
|
|
702
|
+
participation_count: number;
|
|
703
|
+
last_irreversible_block_num: number;
|
|
704
|
+
vote_power_reserve_rate: number;
|
|
705
|
+
delegation_return_period: number;
|
|
706
|
+
reverse_auction_seconds: number;
|
|
707
|
+
available_account_subsidies: number;
|
|
708
|
+
sbd_stop_percent: number;
|
|
709
|
+
sbd_start_percent: number;
|
|
710
|
+
next_maintenance_time: string;
|
|
711
|
+
last_budget_time: string;
|
|
712
|
+
content_reward_percent: number;
|
|
713
|
+
vesting_reward_percent: number;
|
|
714
|
+
sps_fund_percent: number;
|
|
715
|
+
sps_interval_ledger: Asset | string;
|
|
716
|
+
downvote_pool_percent: number;
|
|
717
|
+
}
|
|
718
|
+
export interface VestingDelegation {
|
|
719
|
+
id: number;
|
|
720
|
+
delegator: string;
|
|
721
|
+
delegatee: string;
|
|
722
|
+
vesting_shares: Asset | string;
|
|
723
|
+
min_delegation_time: string;
|
|
724
|
+
}
|
|
725
|
+
export interface BlockTransaction extends TransactionType {
|
|
726
|
+
operations: Operation[];
|
|
727
|
+
transaction_id: string;
|
|
728
|
+
block_num: number;
|
|
729
|
+
transaction_num: number;
|
|
730
|
+
}
|
|
731
|
+
/** An operation as applied in a block, as returned by `get_ops_in_block` */
|
|
732
|
+
export interface AppliedOperation {
|
|
733
|
+
block: number;
|
|
734
|
+
/** All zeros for virtual operations that no transaction caused */
|
|
735
|
+
trx_id: string;
|
|
736
|
+
/** 4294967295 for virtual operations that no transaction caused */
|
|
737
|
+
trx_in_block: number;
|
|
738
|
+
/** Position within the transaction; virtual operations count too */
|
|
739
|
+
op_in_trx: number;
|
|
740
|
+
virtual_op: boolean;
|
|
741
|
+
timestamp: string;
|
|
742
|
+
op: Operation | VirtualOperation;
|
|
743
|
+
}
|
|
744
|
+
export interface Block {
|
|
745
|
+
/** Added by `streamBlocks`; the API response has no block number */
|
|
746
|
+
block_num: number;
|
|
747
|
+
block_id: string;
|
|
748
|
+
previous: string;
|
|
749
|
+
timestamp: string;
|
|
750
|
+
witness: string;
|
|
751
|
+
witness_signature: string;
|
|
752
|
+
signing_key: string;
|
|
753
|
+
transaction_merkle_root: string;
|
|
754
|
+
extensions: Extension[];
|
|
755
|
+
transaction_ids: string[];
|
|
756
|
+
transactions: BlockTransaction[];
|
|
757
|
+
}
|
|
758
|
+
export interface BroadcastError {
|
|
759
|
+
id: number;
|
|
760
|
+
jsonrpc: string;
|
|
761
|
+
error: {
|
|
762
|
+
code: number;
|
|
763
|
+
message: string;
|
|
764
|
+
data?: any;
|
|
765
|
+
};
|
|
766
|
+
}
|
|
767
|
+
export type CallResponse<T = any> = {
|
|
768
|
+
id: number;
|
|
769
|
+
jsonrpc: string;
|
|
770
|
+
result: T;
|
|
771
|
+
} | BroadcastError;
|
|
772
|
+
export interface BroadcastResult {
|
|
773
|
+
tx_id: string;
|
|
774
|
+
id?: string;
|
|
775
|
+
status?: string;
|
|
776
|
+
block_num?: number;
|
|
777
|
+
trx_num?: number;
|
|
778
|
+
expired?: boolean;
|
|
779
|
+
result?: {
|
|
780
|
+
tx_id: string;
|
|
781
|
+
id?: string;
|
|
782
|
+
status?: string;
|
|
783
|
+
block_num?: number;
|
|
784
|
+
trx_num?: number;
|
|
785
|
+
expired?: boolean;
|
|
786
|
+
};
|
|
787
|
+
}
|
|
788
|
+
export interface DigestData {
|
|
789
|
+
digest: Uint8Array;
|
|
790
|
+
txId: string;
|
|
791
|
+
}
|
|
792
|
+
export interface TransactionStatus {
|
|
793
|
+
status: 'unknown' | 'within_mempool' | 'within_reversible_block' | 'within_irreversible_block' | 'expired_reversible' | 'expired_irreversible' | 'too_old';
|
|
794
|
+
}
|
|
795
|
+
interface TransactionOptions {
|
|
796
|
+
transaction?: TransactionType | Transaction;
|
|
797
|
+
/**
|
|
798
|
+
* Transaction expiration in milliseconds (ms) - max 86400000 (24 hours)
|
|
799
|
+
* @default 60_000
|
|
800
|
+
*/
|
|
801
|
+
expiration?: number;
|
|
802
|
+
}
|
|
803
|
+
export declare class Transaction {
|
|
804
|
+
transaction?: TransactionType;
|
|
805
|
+
expiration: number;
|
|
806
|
+
private txId?;
|
|
807
|
+
constructor(options?: TransactionOptions | TransactionType | Transaction | any);
|
|
808
|
+
/**
|
|
809
|
+
* Backwards-compatible getter for the transaction object
|
|
810
|
+
*/
|
|
811
|
+
get signedTransaction(): TransactionType | undefined;
|
|
812
|
+
/**
|
|
813
|
+
* Creates a transaction structure with operations and expiration time.
|
|
814
|
+
* @param operations Array of operations to include in the transaction
|
|
815
|
+
* @param exp Expiration time in seconds (default: 60)
|
|
816
|
+
* @returns Promise resolving to the created transaction structure
|
|
817
|
+
*/
|
|
818
|
+
create(operations?: any[], exp?: number): Promise<TransactionType>;
|
|
819
|
+
/**
|
|
820
|
+
* Adds an operation to the transaction. If no transaction exists, creates one first.
|
|
821
|
+
* @template O Operation name type for type safety
|
|
822
|
+
* @param operationName The name/type of the operation to add (e.g., 'transfer', 'vote', 'comment')
|
|
823
|
+
* @param operationBody The operation data/body for the specified operation type
|
|
824
|
+
* @returns Promise that resolves when the operation is added
|
|
825
|
+
* @throws Error if transaction creation fails or global properties cannot be retrieved
|
|
826
|
+
*/
|
|
827
|
+
addOperation<O extends OperationName>(operationName: O, operationBody: OperationBody<O>): Promise<void>;
|
|
828
|
+
/**
|
|
829
|
+
* Signs the transaction with the provided key(s), supporting both single and multi-signature transactions.
|
|
830
|
+
* For multi-signature, you can sign with all keys at once or sign individually by calling this method multiple times.
|
|
831
|
+
* @param keys Single PrivateKey or array of PrivateKeys to sign the transaction with
|
|
832
|
+
* @returns The signed transaction
|
|
833
|
+
* @throws Error if no transaction exists to sign
|
|
834
|
+
*/
|
|
835
|
+
sign(keys: PrivateKey | PrivateKey[]): TransactionType;
|
|
836
|
+
/**
|
|
837
|
+
* Broadcasts the signed transaction to the Steem network.
|
|
838
|
+
* Automatically handles retries and duplicate transaction detection.
|
|
839
|
+
* By default uses synchronous broadcast (`condenser_api.broadcast_transaction_synchronous`)
|
|
840
|
+
* which confirms block inclusion.
|
|
841
|
+
*
|
|
842
|
+
* @param optionsOrSync If boolean, specifies whether to broadcast synchronously (default: true).
|
|
843
|
+
* If number, specifies custom timeout in seconds.
|
|
844
|
+
* @param retry Number of retry attempts.
|
|
845
|
+
* @returns Promise resolving to broadcast result
|
|
846
|
+
*/
|
|
847
|
+
broadcast(optionsOrSync?: boolean | number, retry?: number): Promise<BroadcastResult | any>;
|
|
848
|
+
/**
|
|
849
|
+
* Returns the transaction digest containing the transaction ID and hash.
|
|
850
|
+
* The digest can be used to verify signatures and for transaction identification.
|
|
851
|
+
* @returns DigestData containing transaction ID and hash
|
|
852
|
+
* @throws Error if no transaction exists
|
|
853
|
+
*/
|
|
854
|
+
digest(): DigestData;
|
|
855
|
+
/**
|
|
856
|
+
* Adds a signature to an already created transaction. Useful when signing with external tools.
|
|
857
|
+
* Multiple signatures can be added one at a time for multi-signature transactions.
|
|
858
|
+
* @param signature The signature string in hex format (must be exactly 130 characters)
|
|
859
|
+
* @returns The transaction with the added signature
|
|
860
|
+
* @throws Error if no transaction exists or signature format is invalid
|
|
861
|
+
*/
|
|
862
|
+
addSignature(signature: string): TransactionType;
|
|
863
|
+
/** Get status of this transaction. */
|
|
864
|
+
checkStatus(): Promise<TransactionStatus>;
|
|
865
|
+
/**
|
|
866
|
+
* Creates the transaction structure and initializes it with blockchain data.
|
|
867
|
+
* Retrieves current head block information and sets up reference block data.
|
|
868
|
+
* @private
|
|
869
|
+
* @param expiration Transaction expiration in milliseconds
|
|
870
|
+
*/
|
|
871
|
+
private createTransaction;
|
|
872
|
+
}
|
|
873
|
+
export declare class RPCError extends Error {
|
|
874
|
+
name: string;
|
|
875
|
+
data?: any;
|
|
876
|
+
code: number;
|
|
877
|
+
stack: undefined;
|
|
878
|
+
constructor(rpcError: {
|
|
879
|
+
message: string;
|
|
880
|
+
code: number;
|
|
881
|
+
data?: any;
|
|
882
|
+
});
|
|
883
|
+
}
|
|
884
|
+
/**
|
|
885
|
+
* Makes API calls to Steem blockchain nodes with automatic retry and failover support.
|
|
886
|
+
* Automatically switches between multiple nodes.
|
|
887
|
+
*
|
|
888
|
+
* The method supports JSON-RPC 2.0 protocol used by Steem API nodes.
|
|
889
|
+
* If the current node fails, it will automatically try the next node in the list.
|
|
890
|
+
*
|
|
891
|
+
* @param method - The API method name (e.g., 'condenser_api.get_accounts')
|
|
892
|
+
* @param params - Parameters for the API method as array or object
|
|
893
|
+
* @param timeout - Request timeout in milliseconds (default: config.timeout)
|
|
894
|
+
* @param retry - Number of retry attempts before throwing an error (default: config.retry)
|
|
895
|
+
* @returns Promise resolving to the API response
|
|
896
|
+
* @throws Error if all retry attempts fail or on RPCError
|
|
897
|
+
*
|
|
898
|
+
* @example
|
|
899
|
+
* ```typescript
|
|
900
|
+
* import { callRPC } from '@substeem/steem-sdk'
|
|
901
|
+
*
|
|
902
|
+
* // Get account information
|
|
903
|
+
* const accounts = await callRPC('condenser_api.get_accounts', [['alice']])
|
|
904
|
+
*
|
|
905
|
+
* // Custom timeout and retry settings
|
|
906
|
+
* const data = await callRPC('condenser_api.get_content', ['alice', 'test-post'], 10_000, 8)
|
|
907
|
+
* ```
|
|
908
|
+
*/
|
|
909
|
+
export declare const callRPC: <T = any>(method: string, params?: any[] | object, timeout?: number, retry?: number) => Promise<T>;
|
|
910
|
+
/**
|
|
911
|
+
* Backwards-compatible alias for callRPC
|
|
912
|
+
*/
|
|
913
|
+
export declare const call: <T = any>(method: string, params?: any[] | object, timeout?: number, retry?: number) => Promise<T>;
|
|
914
|
+
/**
|
|
915
|
+
* Like `callRPC`, but calls `method` once per entry of `paramsList` in a single JSON-RPC batch request.
|
|
916
|
+
* Results keep the order of `paramsList`. Throws `RPCError` if any call in the batch fails.
|
|
917
|
+
*
|
|
918
|
+
* @example
|
|
919
|
+
* ```typescript
|
|
920
|
+
* import { callRPCBatch } from '@substeem/steem-sdk'
|
|
921
|
+
*
|
|
922
|
+
* const [first, second] = await callRPCBatch('condenser_api.get_block', [[1], [2]])
|
|
923
|
+
* ```
|
|
924
|
+
*/
|
|
925
|
+
export declare const callRPCBatch: <T = any>(method: string, paramsList: unknown[], timeout?: number, retry?: number) => Promise<T[]>;
|
|
926
|
+
/**
|
|
927
|
+
* Generic REST API caller with automatic retry, URL validation, and failover support.
|
|
928
|
+
*
|
|
929
|
+
* @param endpoint - Endpoint path (e.g., '/api/v1/resource') or full URL
|
|
930
|
+
* @param params - Optional parameters for path substitution ({key}) and query parameters
|
|
931
|
+
* @param timeout - Request timeout in milliseconds (default: config.timeout)
|
|
932
|
+
* @param retry - Number of retry attempts before throwing an error (default: config.retry)
|
|
933
|
+
*/
|
|
934
|
+
export declare function callREST<T = any>(endpoint: string, params?: Record<string, unknown>, timeout?: number, retry?: number): Promise<T>;
|
|
935
|
+
/**
|
|
936
|
+
* Make a JSONRPC call with quorum. The method will cross-check the result
|
|
937
|
+
* with `quorum` number of nodes before returning the result.
|
|
938
|
+
* @param method - The API method name (e.g., 'condenser_api.get_accounts')
|
|
939
|
+
* @param params - Parameters for the API method as array or object
|
|
940
|
+
* @param quorum - Default: 2 (recommended)
|
|
941
|
+
*/
|
|
942
|
+
export declare const callWithQuorum: <T = any>(method: string, params?: any[] | object, quorum?: number) => Promise<T>;
|
|
943
|
+
interface StreamOptions {
|
|
944
|
+
/** First block to stream. Default: the last irreversible block */
|
|
945
|
+
from?: number;
|
|
946
|
+
/** Last block to stream; the stream ends after it. Default: never ends */
|
|
947
|
+
to?: number;
|
|
948
|
+
}
|
|
949
|
+
interface StreamOperationsOptions extends StreamOptions {
|
|
950
|
+
/** As in `get_ops_in_block`: true streams only virtual operations, false streams all. Default: false */
|
|
951
|
+
only_virtual?: boolean;
|
|
952
|
+
}
|
|
953
|
+
/**
|
|
954
|
+
* Streams irreversible block numbers in order, with no gaps or duplicates, without fetching the blocks.
|
|
955
|
+
* Same catch-up, stop, and resume behavior as `streamBlocks`.
|
|
956
|
+
*
|
|
957
|
+
* @example
|
|
958
|
+
* ```typescript
|
|
959
|
+
* import { streamBlockNumbers } from '@substeem/steem-sdk'
|
|
960
|
+
*
|
|
961
|
+
* for await (const num of streamBlockNumbers()) {
|
|
962
|
+
* console.log(num)
|
|
963
|
+
* }
|
|
964
|
+
* ```
|
|
965
|
+
*/
|
|
966
|
+
export declare function streamBlockNumbers(options?: StreamOptions): AsyncGenerator<number>;
|
|
967
|
+
/**
|
|
968
|
+
* Streams irreversible blocks in order, with no gaps or duplicates.
|
|
969
|
+
* Catches up on past blocks in batches, then follows the chain as new blocks become irreversible.
|
|
970
|
+
* Steem blocks become irreversible within a few seconds, so this is close to real time.
|
|
971
|
+
*
|
|
972
|
+
* Stop by `break`ing out of the loop. On network failure the stream throws;
|
|
973
|
+
* resume with `from: lastBlock.block_num + 1`.
|
|
974
|
+
*
|
|
975
|
+
* @example
|
|
976
|
+
* ```typescript
|
|
977
|
+
* import { streamBlocks } from '@substeem/steem-sdk'
|
|
978
|
+
*
|
|
979
|
+
* for await (const block of streamBlocks()) {
|
|
980
|
+
* console.log(block.block_num, block.transactions.length)
|
|
981
|
+
* }
|
|
982
|
+
* ```
|
|
983
|
+
*/
|
|
984
|
+
export declare function streamBlocks(options?: StreamOptions): AsyncGenerator<Block>;
|
|
985
|
+
/**
|
|
986
|
+
* Streams the operations of irreversible blocks in chain order, with no gaps or duplicates.
|
|
987
|
+
* Includes virtual operations (rewards, order fills, interest, ...) like `get_ops_in_block` does.
|
|
988
|
+
* Same catch-up and stop behavior as `streamBlocks`. To resume, pass `from` as the last fully handled block + 1.
|
|
989
|
+
*
|
|
990
|
+
* @example
|
|
991
|
+
* ```typescript
|
|
992
|
+
* import { streamOperations } from '@substeem/steem-sdk'
|
|
993
|
+
*
|
|
994
|
+
* for await (const { block, trx_id, op } of streamOperations()) {
|
|
995
|
+
* if (op[0] === 'transfer') console.log(block, trx_id, op[1].from, op[1].amount)
|
|
996
|
+
* if (op[0] === 'producer_reward') console.log(block, op[1].producer)
|
|
997
|
+
* }
|
|
998
|
+
* ```
|
|
999
|
+
*/
|
|
1000
|
+
export declare function streamOperations({ only_virtual, ...range }?: StreamOperationsOptions): AsyncGenerator<AppliedOperation>;
|
|
1001
|
+
/**
|
|
1002
|
+
* Configuration object for customizing steem-sdk library behavior.
|
|
1003
|
+
* Modify these values to change the default node endpoints, timeout, and other settings.
|
|
1004
|
+
*/
|
|
1005
|
+
interface SteemConfig {
|
|
1006
|
+
nodes: string[];
|
|
1007
|
+
restNodes: string[];
|
|
1008
|
+
chain_id: string;
|
|
1009
|
+
address_prefix: string;
|
|
1010
|
+
timeout: number;
|
|
1011
|
+
retry: number;
|
|
1012
|
+
axiosAdapter?: any;
|
|
1013
|
+
node: string[] | string;
|
|
1014
|
+
}
|
|
1015
|
+
export declare const config: SteemConfig;
|
|
1016
|
+
export type Memo = {
|
|
1017
|
+
/**
|
|
1018
|
+
* Encrypts a memo for secure private messaging
|
|
1019
|
+
*/
|
|
1020
|
+
encode(privateKey: string | PrivateKey, publicKey: string | PublicKey, memo: string, testNonce?: any): string;
|
|
1021
|
+
/**
|
|
1022
|
+
* Decrypts a memo message
|
|
1023
|
+
*/
|
|
1024
|
+
decode(privateKey: string | PrivateKey, memo: string): string;
|
|
1025
|
+
/**
|
|
1026
|
+
* Encrypts a memo for an account, looking up its memo key
|
|
1027
|
+
*/
|
|
1028
|
+
encodeForAccount(privateKey: string | PrivateKey, account: string, memo: string): Promise<string>;
|
|
1029
|
+
};
|
|
1030
|
+
/**
|
|
1031
|
+
* Memo utilities for encrypting and decrypting private messages between Steem users.
|
|
1032
|
+
* Uses AES encryption with ECDH key exchange for secure communication.
|
|
1033
|
+
*
|
|
1034
|
+
* Messages must start with '#' to be encrypted/decrypted.
|
|
1035
|
+
* Plain text messages (without '#') are returned unchanged.
|
|
1036
|
+
*
|
|
1037
|
+
* @example
|
|
1038
|
+
* ```typescript
|
|
1039
|
+
* import { Memo, PrivateKey, PublicKey } from '@substeem/steem-sdk'
|
|
1040
|
+
*
|
|
1041
|
+
* // Encrypt a message
|
|
1042
|
+
* const encrypted = Memo.encode(senderPrivateKey, recipientPublicKey, '#Hello World')
|
|
1043
|
+
*
|
|
1044
|
+
* // Or by account name; the recipient's memo key is fetched
|
|
1045
|
+
* const encrypted = await Memo.encodeForAccount(senderPrivateKey, 'bob', '#Hello World')
|
|
1046
|
+
*
|
|
1047
|
+
* // Decrypt a message
|
|
1048
|
+
* const decrypted = Memo.decode(recipientPrivateKey, encrypted)
|
|
1049
|
+
* console.log(decrypted) // '#Hello World'
|
|
1050
|
+
* ```
|
|
1051
|
+
*/
|
|
1052
|
+
export declare const Memo: {
|
|
1053
|
+
decode: (privateKey: string | PrivateKey, memo: string) => string;
|
|
1054
|
+
encode: (privateKey: string | PrivateKey, publicKey: string | PublicKey, memo: string, testNonce?: any) => string;
|
|
1055
|
+
encodeForAccount: (privateKey: string | PrivateKey, account: string, memo: string) => Promise<string>;
|
|
1056
|
+
};
|
|
1057
|
+
/**
|
|
1058
|
+
* Stake, mana, vote, and reputation math. Account helpers take a name, or an account object
|
|
1059
|
+
* you already have (condenser_api or database_api format) to skip the request.
|
|
1060
|
+
* Chain data is fetched internally and cached for 2 seconds.
|
|
1061
|
+
* Results are JavaScript numbers: exact enough for display and estimates, not for consensus.
|
|
1062
|
+
*/
|
|
1063
|
+
/** Asset as returned by condenser_api (`"1.000 STEEM"`) or by database_api (NAI object) */
|
|
1064
|
+
type AssetInput = string | {
|
|
1065
|
+
amount: string;
|
|
1066
|
+
precision: number;
|
|
1067
|
+
nai: string;
|
|
1068
|
+
};
|
|
1069
|
+
/** Manabar fields as returned by the API */
|
|
1070
|
+
interface ManabarInput {
|
|
1071
|
+
current_mana: number | string;
|
|
1072
|
+
last_update_time: number;
|
|
1073
|
+
}
|
|
1074
|
+
/** Account fields used for stake and mana, from `get_accounts` or `find_accounts` */
|
|
1075
|
+
interface StakeAccount {
|
|
1076
|
+
vesting_shares: AssetInput;
|
|
1077
|
+
delegated_vesting_shares: AssetInput;
|
|
1078
|
+
received_vesting_shares: AssetInput;
|
|
1079
|
+
vesting_withdraw_rate: AssetInput;
|
|
1080
|
+
to_withdraw: number | string;
|
|
1081
|
+
withdrawn: number | string;
|
|
1082
|
+
voting_manabar: ManabarInput;
|
|
1083
|
+
downvote_manabar: ManabarInput;
|
|
1084
|
+
}
|
|
1085
|
+
/** Account fields from `rc_api.find_rc_accounts` */
|
|
1086
|
+
interface RCAccount {
|
|
1087
|
+
max_rc: number | string;
|
|
1088
|
+
rc_manabar: ManabarInput;
|
|
1089
|
+
}
|
|
1090
|
+
/** Account fields used for its value, from `get_accounts` */
|
|
1091
|
+
interface WalletAccount extends StakeAccount {
|
|
1092
|
+
name: string;
|
|
1093
|
+
balance: AssetInput;
|
|
1094
|
+
savings_balance: AssetInput;
|
|
1095
|
+
sbd_balance?: AssetInput;
|
|
1096
|
+
savings_sbd_balance?: AssetInput;
|
|
1097
|
+
}
|
|
1098
|
+
/** Account name, or an account object from `get_accounts` / `find_accounts` */
|
|
1099
|
+
type AccountInput = string | StakeAccount;
|
|
1100
|
+
/** Account name, or an object from `rc_api.find_rc_accounts` */
|
|
1101
|
+
type RCAccountInput = string | RCAccount;
|
|
1102
|
+
interface Manabar$1 {
|
|
1103
|
+
/** Current mana, regenerated to now */
|
|
1104
|
+
current: number;
|
|
1105
|
+
max: number;
|
|
1106
|
+
/** 0 to 100 */
|
|
1107
|
+
percentage: number;
|
|
1108
|
+
/** When the mana will be full; already passed if it is full */
|
|
1109
|
+
fullAt: Date;
|
|
1110
|
+
}
|
|
1111
|
+
/** Parses `"1.000 STEEM"` or `{ amount: "1000", precision: 3, nai: "@@000000021" }` */
|
|
1112
|
+
declare const parseAsset: (asset: AssetInput) => {
|
|
1113
|
+
amount: number;
|
|
1114
|
+
symbol: string;
|
|
1115
|
+
};
|
|
1116
|
+
/** Converts STEEM to SBD at the median price feed */
|
|
1117
|
+
declare const steemToSbd: (steem: number | AssetInput) => Promise<number>;
|
|
1118
|
+
/** Converts SBD to STEEM at the median price feed */
|
|
1119
|
+
declare const sbdToSteem: (sbd: number | AssetInput) => Promise<number>;
|
|
1120
|
+
/** Converts VESTS to STEEM Power at the current rate */
|
|
1121
|
+
declare const vestsToSP: (vests: number | AssetInput) => Promise<number>;
|
|
1122
|
+
/** Converts STEEM Power to VESTS at the current rate */
|
|
1123
|
+
declare const spToVests: (sp: number | AssetInput) => Promise<number>;
|
|
1124
|
+
/**
|
|
1125
|
+
* VESTS that give voting power: own + received - delegated - this week's power down.
|
|
1126
|
+
* This is also the maximum voting mana, in VESTS.
|
|
1127
|
+
*/
|
|
1128
|
+
declare const getEffectiveVests: (account: AccountInput) => Promise<number>;
|
|
1129
|
+
/** Upvote mana ("voting power") of an account at `now` (ms) */
|
|
1130
|
+
declare const getVotingMana: (account: AccountInput, now?: number) => Promise<Manabar$1>;
|
|
1131
|
+
/** Downvote mana of an account at `now` (ms) */
|
|
1132
|
+
declare const getDownvoteMana: (account: AccountInput, now?: number) => Promise<Manabar$1>;
|
|
1133
|
+
/** Resource credits of an account at `now` (ms) */
|
|
1134
|
+
declare const getRCMana: (account: RCAccountInput, now?: number) => Promise<Manabar$1>;
|
|
1135
|
+
/**
|
|
1136
|
+
* rshares a vote adds to a post. `weight` is -10000 to 10000 (-100% to 100%).
|
|
1137
|
+
*/
|
|
1138
|
+
declare const getVoteRShares: (account: AccountInput, weight?: number) => Promise<number>;
|
|
1139
|
+
/** SBD value of rshares at the current reward pool and median price */
|
|
1140
|
+
declare const rsharesToSBD: (rshares: number) => Promise<number>;
|
|
1141
|
+
/** Estimated SBD value of a vote, author and curation rewards combined */
|
|
1142
|
+
declare const getVoteValue: (account: AccountInput, weight?: number) => Promise<number>;
|
|
1143
|
+
/** Yearly STEEM Power interest in percent */
|
|
1144
|
+
declare const getSpApr: () => Promise<number>;
|
|
1145
|
+
/** Yearly interest on SBD in savings, in percent */
|
|
1146
|
+
declare const getSbdApr: () => Promise<number>;
|
|
1147
|
+
/**
|
|
1148
|
+
* Estimated account value in SBD at the median price: liquid, savings, STEEM Power
|
|
1149
|
+
* (own, including delegated out), and funds in open market orders.
|
|
1150
|
+
*/
|
|
1151
|
+
declare const estimateAccountValue: (account: string | WalletAccount) => Promise<number>;
|
|
1152
|
+
/** Converts raw reputation (e.g. `"79470587263453"`) to the familiar score (e.g. `66.2`) */
|
|
1153
|
+
declare const formatReputation: (raw: number | string) => number;
|
|
1154
|
+
/** A random master password in the format Steem wallets use ("P5..."); store it safely */
|
|
1155
|
+
declare const createPassword: () => string;
|
|
1156
|
+
/**
|
|
1157
|
+
* Derives an account's keys from its master password, the same way Steem wallets do.
|
|
1158
|
+
* Returns the private keys to give the user, the public keys, and the `owner`, `active`,
|
|
1159
|
+
* `posting`, and `memo_key` fields for `create_claimed_account`, `account_create`, or `account_update`.
|
|
1160
|
+
*/
|
|
1161
|
+
declare const generateKeys: (username: string, password: string) => {
|
|
1162
|
+
privateKeys: Record<KeyRole, string>;
|
|
1163
|
+
publicKeys: Record<KeyRole, string>;
|
|
1164
|
+
owner: Authority;
|
|
1165
|
+
active: Authority;
|
|
1166
|
+
posting: Authority;
|
|
1167
|
+
memo_key: string;
|
|
1168
|
+
};
|
|
1169
|
+
/** True if `wif` is a valid private key (checks format and checksum) */
|
|
1170
|
+
declare const isValidWif: (wif: string) => boolean;
|
|
1171
|
+
/** True if `key` is a valid public key for this chain (checks prefix, checksum, and curve point) */
|
|
1172
|
+
declare const isValidPublicKey: (key: string) => boolean;
|
|
1173
|
+
/**
|
|
1174
|
+
* Builders for social `custom_json` operations (follows, reblogs, communities).
|
|
1175
|
+
* Each returns an operation to pass to `addOperation`:
|
|
1176
|
+
* `await tx.addOperation(...utils.follow('alice', 'bob'))`
|
|
1177
|
+
*/
|
|
1178
|
+
type CustomJson = ['custom_json', CustomJsonOperation];
|
|
1179
|
+
/** `follower` follows `following` */
|
|
1180
|
+
declare const follow: (follower: string, following: string) => CustomJson;
|
|
1181
|
+
/** `follower` stops following `following` */
|
|
1182
|
+
declare const unfollow: (follower: string, following: string) => CustomJson;
|
|
1183
|
+
/** `follower` mutes `following` */
|
|
1184
|
+
declare const mute: (follower: string, following: string) => CustomJson;
|
|
1185
|
+
/** `follower` unmutes `following` (same operation as unfollow: both clear the state) */
|
|
1186
|
+
declare const unmute: (follower: string, following: string) => CustomJson;
|
|
1187
|
+
/** `follower` blacklists (blocks) `following`: their posts are marked "my blacklist" */
|
|
1188
|
+
declare const blacklist: (follower: string, following: string) => CustomJson;
|
|
1189
|
+
/** `follower` removes `following` from their blacklist (unfollow does not clear a blacklist) */
|
|
1190
|
+
declare const unblacklist: (follower: string, following: string) => CustomJson;
|
|
1191
|
+
/** `follower` adopts the blacklist of `following` */
|
|
1192
|
+
declare const followBlacklist: (follower: string, following: string) => CustomJson;
|
|
1193
|
+
/** `follower` stops using the blacklist of `following` */
|
|
1194
|
+
declare const unfollowBlacklist: (follower: string, following: string) => CustomJson;
|
|
1195
|
+
/** `follower` adopts the mute list of `following` */
|
|
1196
|
+
declare const followMuted: (follower: string, following: string) => CustomJson;
|
|
1197
|
+
/** `follower` stops using the mute list of `following` */
|
|
1198
|
+
declare const unfollowMuted: (follower: string, following: string) => CustomJson;
|
|
1199
|
+
/** `account` reblogs the post `author/permlink` */
|
|
1200
|
+
declare const reblog: (account: string, author: string, permlink: string) => CustomJson;
|
|
1201
|
+
/** `account` subscribes to a community, e.g. `"steem-101145"` */
|
|
1202
|
+
declare const subscribe: (account: string, community: string) => CustomJson;
|
|
1203
|
+
/** `account` unsubscribes from a community */
|
|
1204
|
+
declare const unsubscribe: (account: string, community: string) => CustomJson;
|
|
1205
|
+
declare namespace utils_d_exports {
|
|
1206
|
+
export { AccountInput, AssetInput, Manabar$1 as Manabar, ManabarInput, RCAccount, RCAccountInput, StakeAccount, WalletAccount, WitnessProps$1 as WitnessProps, blacklist, buildWitnessSetProperties, createPassword, createPermlink, equalBytes, estimateAccountValue, follow, followBlacklist, followMuted, formatReputation, generateKeys, getDownvoteMana, getEffectiveVests, getRCMana, getSbdApr, getSpApr, getVoteRShares, getVoteValue, getVotingMana, isValidPublicKey, isValidWif, makeBitMaskFilter, mute, operations, parseAsset, reblog, rsharesToSBD, sbdToSteem, spToVests, steemToSbd, subscribe, unblacklist, unfollow, unfollowBlacklist, unfollowMuted, unmute, unsubscribe, validateUsername, vestsToSP };
|
|
1207
|
+
}
|
|
1208
|
+
/** Constant-time comparison of two Uint8Arrays to prevent timing attacks */
|
|
1209
|
+
declare const equalBytes: (a: Uint8Array, b: Uint8Array) => boolean;
|
|
1210
|
+
interface WitnessProps$1 {
|
|
1211
|
+
account_creation_fee?: string;
|
|
1212
|
+
account_subsidy_budget?: number;
|
|
1213
|
+
account_subsidy_decay?: number;
|
|
1214
|
+
key: PublicKey | string;
|
|
1215
|
+
maximum_block_size?: number;
|
|
1216
|
+
new_signing_key?: PublicKey | string | null;
|
|
1217
|
+
sbd_exchange_rate?: {
|
|
1218
|
+
base: string;
|
|
1219
|
+
quote: string;
|
|
1220
|
+
};
|
|
1221
|
+
sbd_interest_rate?: number;
|
|
1222
|
+
url?: string;
|
|
1223
|
+
}
|
|
1224
|
+
/** Return null for a valid username */
|
|
1225
|
+
declare const validateUsername: (username: string) => null | string;
|
|
1226
|
+
declare const operations: {
|
|
1227
|
+
vote: number;
|
|
1228
|
+
comment: number;
|
|
1229
|
+
transfer: number;
|
|
1230
|
+
transfer_to_vesting: number;
|
|
1231
|
+
withdraw_vesting: number;
|
|
1232
|
+
limit_order_create: number;
|
|
1233
|
+
limit_order_cancel: number;
|
|
1234
|
+
feed_publish: number;
|
|
1235
|
+
convert: number;
|
|
1236
|
+
account_create: number;
|
|
1237
|
+
account_update: number;
|
|
1238
|
+
witness_update: number;
|
|
1239
|
+
account_witness_vote: number;
|
|
1240
|
+
account_witness_proxy: number;
|
|
1241
|
+
pow: number;
|
|
1242
|
+
custom: number;
|
|
1243
|
+
report_over_production: number;
|
|
1244
|
+
delete_comment: number;
|
|
1245
|
+
custom_json: number;
|
|
1246
|
+
comment_options: number;
|
|
1247
|
+
set_withdraw_vesting_route: number;
|
|
1248
|
+
limit_order_create2: number;
|
|
1249
|
+
claim_account: number;
|
|
1250
|
+
create_claimed_account: number;
|
|
1251
|
+
request_account_recovery: number;
|
|
1252
|
+
recover_account: number;
|
|
1253
|
+
change_recovery_account: number;
|
|
1254
|
+
escrow_transfer: number;
|
|
1255
|
+
escrow_dispute: number;
|
|
1256
|
+
escrow_release: number;
|
|
1257
|
+
pow2: number;
|
|
1258
|
+
escrow_approve: number;
|
|
1259
|
+
transfer_to_savings: number;
|
|
1260
|
+
transfer_from_savings: number;
|
|
1261
|
+
cancel_transfer_from_savings: number;
|
|
1262
|
+
custom_binary: number;
|
|
1263
|
+
decline_voting_rights: number;
|
|
1264
|
+
reset_account: number;
|
|
1265
|
+
set_reset_account: number;
|
|
1266
|
+
claim_reward_balance: number;
|
|
1267
|
+
delegate_vesting_shares: number;
|
|
1268
|
+
account_create_with_delegation: number;
|
|
1269
|
+
witness_set_properties: number;
|
|
1270
|
+
account_update2: number;
|
|
1271
|
+
create_proposal: number;
|
|
1272
|
+
update_proposal_votes: number;
|
|
1273
|
+
remove_proposal: number;
|
|
1274
|
+
update_proposal: number;
|
|
1275
|
+
collateralized_convert: number;
|
|
1276
|
+
recurrent_transfer: number;
|
|
1277
|
+
fill_convert_request: number;
|
|
1278
|
+
author_reward: number;
|
|
1279
|
+
curation_reward: number;
|
|
1280
|
+
comment_reward: number;
|
|
1281
|
+
liquidity_reward: number;
|
|
1282
|
+
interest: number;
|
|
1283
|
+
fill_vesting_withdraw: number;
|
|
1284
|
+
fill_order: number;
|
|
1285
|
+
shutdown_witness: number;
|
|
1286
|
+
fill_transfer_from_savings: number;
|
|
1287
|
+
hardfork: number;
|
|
1288
|
+
comment_payout_update: number;
|
|
1289
|
+
return_vesting_delegation: number;
|
|
1290
|
+
comment_benefactor_reward: number;
|
|
1291
|
+
producer_reward: number;
|
|
1292
|
+
clear_null_account_balance: number;
|
|
1293
|
+
proposal_pay: number;
|
|
1294
|
+
sps_fund: number;
|
|
1295
|
+
hardfork_steem: number;
|
|
1296
|
+
hardfork_steem_restore: number;
|
|
1297
|
+
delayed_voting: number;
|
|
1298
|
+
consolidate_treasury_balance: number;
|
|
1299
|
+
effective_comment_vote: number;
|
|
1300
|
+
ineffective_delete_comment: number;
|
|
1301
|
+
sps_convert: number;
|
|
1302
|
+
expired_account_notification: number;
|
|
1303
|
+
changed_recovery_account: number;
|
|
1304
|
+
transfer_to_vesting_completed: number;
|
|
1305
|
+
pow_reward: number;
|
|
1306
|
+
vesting_shares_split: number;
|
|
1307
|
+
account_created: number;
|
|
1308
|
+
fill_collateralized_convert_request: number;
|
|
1309
|
+
system_warning: number;
|
|
1310
|
+
fill_recurrent_transfer: number;
|
|
1311
|
+
failed_recurrent_transfer: number;
|
|
1312
|
+
limit_order_cancelled: number;
|
|
1313
|
+
producer_missed: number;
|
|
1314
|
+
proposal_fee: number;
|
|
1315
|
+
collateralized_convert_immediate_conversion: number;
|
|
1316
|
+
escrow_approved: number;
|
|
1317
|
+
escrow_rejected: number;
|
|
1318
|
+
proxy_cleared: number;
|
|
1319
|
+
declined_voting_rights: number;
|
|
1320
|
+
};
|
|
1321
|
+
/**
|
|
1322
|
+
* Make bitmask filter to be used with get_account_history call
|
|
1323
|
+
*/
|
|
1324
|
+
declare const makeBitMaskFilter: (allowedOperations: number[]) => any[];
|
|
1325
|
+
declare const buildWitnessSetProperties: (owner: string, props: WitnessProps$1) => ["witness_set_properties", {
|
|
1326
|
+
extensions: never[];
|
|
1327
|
+
owner: string;
|
|
1328
|
+
props: any;
|
|
1329
|
+
}];
|
|
1330
|
+
/**
|
|
1331
|
+
* Makes a permlink from a title with a random suffix, e.g. `"hello-world-3f9a1c0b7e2d"`.
|
|
1332
|
+
* Without a title (e.g. for replies), returns only the random part.
|
|
1333
|
+
*/
|
|
1334
|
+
declare const createPermlink: (title?: string) => string;
|
|
1335
|
+
interface ClientOptions {
|
|
1336
|
+
timeout?: number;
|
|
1337
|
+
retry?: number;
|
|
1338
|
+
chainId?: string;
|
|
1339
|
+
addressPrefix?: string;
|
|
1340
|
+
}
|
|
1341
|
+
export declare class DatabaseAPI {
|
|
1342
|
+
private client;
|
|
1343
|
+
constructor(client: Client);
|
|
1344
|
+
/**
|
|
1345
|
+
* Return extended accounts by username list.
|
|
1346
|
+
*/
|
|
1347
|
+
getAccounts(names: string[]): Promise<ExtendedAccount[]>;
|
|
1348
|
+
/**
|
|
1349
|
+
* Return dynamic global properties.
|
|
1350
|
+
*/
|
|
1351
|
+
getDynamicGlobalProperties(): Promise<DynamicGlobalProperties>;
|
|
1352
|
+
/**
|
|
1353
|
+
* Return active vesting delegations from an account.
|
|
1354
|
+
*/
|
|
1355
|
+
getVestingDelegations(account: string, from?: string, limit?: number): Promise<VestingDelegation[]>;
|
|
1356
|
+
/**
|
|
1357
|
+
* Generic database/condenser_api call.
|
|
1358
|
+
*/
|
|
1359
|
+
call<T = any>(method: string, params?: any[] | object): Promise<T>;
|
|
1360
|
+
}
|
|
1361
|
+
export declare class BroadcastAPI {
|
|
1362
|
+
private client;
|
|
1363
|
+
constructor(client: Client);
|
|
1364
|
+
/**
|
|
1365
|
+
* Sign and broadcast a list of operations with private key(s).
|
|
1366
|
+
*/
|
|
1367
|
+
sendOperations(operations: Operation[], key: PrivateKey | PrivateKey[]): Promise<BroadcastResult>;
|
|
1368
|
+
/**
|
|
1369
|
+
* Sign a transaction object with private key (compatibility wrapper).
|
|
1370
|
+
*/
|
|
1371
|
+
sign(transaction: any, key: PrivateKey | PrivateKey[]): any;
|
|
1372
|
+
}
|
|
1373
|
+
/**
|
|
1374
|
+
* High-level Steem RPC client providing familiar database and broadcast namespaces.
|
|
1375
|
+
*/
|
|
1376
|
+
export declare class Client {
|
|
1377
|
+
readonly database: DatabaseAPI;
|
|
1378
|
+
readonly broadcast: BroadcastAPI;
|
|
1379
|
+
timeout: number;
|
|
1380
|
+
constructor(address?: string | string[], options?: ClientOptions);
|
|
1381
|
+
/**
|
|
1382
|
+
* Call any API method directly (e.g. client.call('condenser_api', 'get_accounts', [['steemit']]))
|
|
1383
|
+
*/
|
|
1384
|
+
call<T = any>(api: string, method: string, params?: any[] | object): Promise<T>;
|
|
1385
|
+
}
|
|
1386
|
+
export { type ClientOptions, type TransactionOptions, utils_d_exports as utils };
|