@steemit/steem-js 1.0.20 → 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/README.md +0 -2
- package/dist/api/types.d.ts +32 -29
- package/dist/auth/ecc/index.d.ts +0 -1
- package/dist/auth/ecc/src/index.d.ts +0 -1
- package/dist/browser.esm.js +3 -3
- package/dist/browser.esm.js.map +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +3 -3
- 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/dist/types/protocol.d.ts +271 -0
- package/package.json +1 -1
- package/dist/auth/ecc/src/key_utils.d.ts +0 -10
package/README.md
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# Steem.js
|
|
2
2
|
|
|
3
|
-
> ⚠️ Under Construction: This SDK is currently under active development. Do not use it in the production environment.
|
|
4
|
-
|
|
5
3
|
A modern JavaScript/TypeScript library for interacting with the Steem blockchain. Complete refactoring with TypeScript, modern tooling, and improved security.
|
|
6
4
|
|
|
7
5
|
[](https://www.npmjs.com/package/@steemit/steem-js)
|
package/dist/api/types.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Type definitions for dynamically generated API methods.
|
|
3
3
|
* Runtime routing (condenser_api vs database_api) is defined in methods.ts; see docs/README.md#api-routing.
|
|
4
4
|
*/
|
|
5
|
+
import type { ExtendedAccount, DynamicGlobalProperties, Discussion, SignedBlock, FollowApiObject, AccountHistoryEntry } from '../types/protocol';
|
|
5
6
|
export type ApiCallback<T = unknown> = (err: Error | null, result?: T) => void;
|
|
6
7
|
type ApiMethodWithParams<TResult = unknown> = (...args: unknown[]) => Promise<TResult> | void;
|
|
7
8
|
type ApiMethodNoParams<TResult = unknown> = (callback?: ApiCallback<TResult>) => Promise<TResult> | void;
|
|
@@ -10,69 +11,71 @@ type ApiMethodAsync<TParams extends unknown[] = unknown[], TResult = unknown> =
|
|
|
10
11
|
type ApiMethodWithAsync<TResult = unknown> = (options: Record<string, unknown>) => Promise<TResult>;
|
|
11
12
|
/**
|
|
12
13
|
* Type definitions for all API methods
|
|
13
|
-
* This interface provides type safety for dynamically generated methods
|
|
14
|
+
* This interface provides type safety for dynamically generated methods.
|
|
15
|
+
* Return types mirror the C++ node's condenser_api FC_REFLECT structs; see
|
|
16
|
+
* src/types/protocol.ts for the protocol definitions.
|
|
14
17
|
*/
|
|
15
18
|
export interface ApiMethodSignatures {
|
|
16
|
-
getAccounts(accounts: string[], callback?: ApiCallback<
|
|
17
|
-
getAccountsAsync(accounts: string[]): Promise<
|
|
19
|
+
getAccounts(accounts: string[], callback?: ApiCallback<ExtendedAccount[]>): Promise<ExtendedAccount[]> | void;
|
|
20
|
+
getAccountsAsync(accounts: string[]): Promise<ExtendedAccount[]>;
|
|
18
21
|
getAccountsWith(options: {
|
|
19
22
|
names: string[];
|
|
20
|
-
}, callback?: ApiCallback<
|
|
23
|
+
}, callback?: ApiCallback<ExtendedAccount[]>): Promise<ExtendedAccount[]> | void;
|
|
21
24
|
getAccountsWithAsync(options: {
|
|
22
25
|
names: string[];
|
|
23
|
-
}): Promise<
|
|
24
|
-
getAccountHistory(account: string, from: number, limit: number, callback?: ApiCallback<
|
|
25
|
-
getAccountHistoryAsync(account: string, from: number, limit: number): Promise<
|
|
26
|
+
}): Promise<ExtendedAccount[]>;
|
|
27
|
+
getAccountHistory(account: string, from: number, limit: number, callback?: ApiCallback<AccountHistoryEntry[]>): Promise<AccountHistoryEntry[]> | void;
|
|
28
|
+
getAccountHistoryAsync(account: string, from: number, limit: number): Promise<AccountHistoryEntry[]>;
|
|
26
29
|
getAccountHistoryWith(options: {
|
|
27
30
|
account: string;
|
|
28
31
|
from: number;
|
|
29
32
|
limit: number;
|
|
30
|
-
}, callback?: ApiCallback<
|
|
33
|
+
}, callback?: ApiCallback<AccountHistoryEntry[]>): Promise<AccountHistoryEntry[]> | void;
|
|
31
34
|
getAccountHistoryWithAsync(options: {
|
|
32
35
|
account: string;
|
|
33
36
|
from: number;
|
|
34
37
|
limit: number;
|
|
35
|
-
}): Promise<
|
|
36
|
-
getDynamicGlobalProperties(callback?: ApiCallback<
|
|
37
|
-
getDynamicGlobalPropertiesAsync(): Promise<
|
|
38
|
-
getDynamicGlobalPropertiesWith(options: Record<string, unknown>, callback?: ApiCallback<
|
|
39
|
-
getDynamicGlobalPropertiesWithAsync(options: Record<string, unknown>): Promise<
|
|
40
|
-
getContent(author: string, permlink: string, callback?: ApiCallback<
|
|
41
|
-
getContentAsync(author: string, permlink: string): Promise<
|
|
38
|
+
}): Promise<AccountHistoryEntry[]>;
|
|
39
|
+
getDynamicGlobalProperties(callback?: ApiCallback<DynamicGlobalProperties>): Promise<DynamicGlobalProperties> | void;
|
|
40
|
+
getDynamicGlobalPropertiesAsync(): Promise<DynamicGlobalProperties>;
|
|
41
|
+
getDynamicGlobalPropertiesWith(options: Record<string, unknown>, callback?: ApiCallback<DynamicGlobalProperties>): Promise<DynamicGlobalProperties> | void;
|
|
42
|
+
getDynamicGlobalPropertiesWithAsync(options: Record<string, unknown>): Promise<DynamicGlobalProperties>;
|
|
43
|
+
getContent(author: string, permlink: string, callback?: ApiCallback<Discussion>): Promise<Discussion> | void;
|
|
44
|
+
getContentAsync(author: string, permlink: string): Promise<Discussion>;
|
|
42
45
|
getContentWith(options: {
|
|
43
46
|
author: string;
|
|
44
47
|
permlink: string;
|
|
45
|
-
}, callback?: ApiCallback<
|
|
48
|
+
}, callback?: ApiCallback<Discussion>): Promise<Discussion> | void;
|
|
46
49
|
getContentWithAsync(options: {
|
|
47
50
|
author: string;
|
|
48
51
|
permlink: string;
|
|
49
|
-
}): Promise<
|
|
50
|
-
getFollowers(following: string, startFollower: string, followType: string, limit: number, callback?: ApiCallback<
|
|
51
|
-
getFollowersAsync(following: string, startFollower: string, followType: string, limit: number): Promise<
|
|
52
|
+
}): Promise<Discussion>;
|
|
53
|
+
getFollowers(following: string, startFollower: string, followType: string, limit: number, callback?: ApiCallback<FollowApiObject[]>): Promise<FollowApiObject[]> | void;
|
|
54
|
+
getFollowersAsync(following: string, startFollower: string, followType: string, limit: number): Promise<FollowApiObject[]>;
|
|
52
55
|
getFollowersWith(options: {
|
|
53
56
|
following: string;
|
|
54
57
|
startFollower: string;
|
|
55
58
|
followType: string;
|
|
56
59
|
limit: number;
|
|
57
|
-
}, callback?: ApiCallback<
|
|
60
|
+
}, callback?: ApiCallback<FollowApiObject[]>): Promise<FollowApiObject[]> | void;
|
|
58
61
|
getFollowersWithAsync(options: {
|
|
59
62
|
following: string;
|
|
60
63
|
startFollower: string;
|
|
61
64
|
followType: string;
|
|
62
65
|
limit: number;
|
|
63
|
-
}): Promise<
|
|
64
|
-
getBlock(blockNum: number, callback?: ApiCallback<
|
|
65
|
-
getBlockAsync(blockNum: number): Promise<
|
|
66
|
+
}): Promise<FollowApiObject[]>;
|
|
67
|
+
getBlock(blockNum: number, callback?: ApiCallback<SignedBlock>): Promise<SignedBlock> | void;
|
|
68
|
+
getBlockAsync(blockNum: number): Promise<SignedBlock>;
|
|
66
69
|
getBlockWith(options: {
|
|
67
70
|
blockNum: number;
|
|
68
|
-
}, callback?: ApiCallback<
|
|
71
|
+
}, callback?: ApiCallback<SignedBlock>): Promise<SignedBlock> | void;
|
|
69
72
|
getBlockWithAsync(options: {
|
|
70
73
|
blockNum: number;
|
|
71
|
-
}): Promise<
|
|
72
|
-
getConfig(callback?: ApiCallback<
|
|
73
|
-
getConfigAsync(): Promise<
|
|
74
|
-
getConfigWith(options: Record<string, unknown>, callback?: ApiCallback<
|
|
75
|
-
getConfigWithAsync(options: Record<string, unknown>): Promise<
|
|
74
|
+
}): Promise<SignedBlock>;
|
|
75
|
+
getConfig(callback?: ApiCallback<Record<string, unknown>>): Promise<Record<string, unknown>> | void;
|
|
76
|
+
getConfigAsync(): Promise<Record<string, unknown>>;
|
|
77
|
+
getConfigWith(options: Record<string, unknown>, callback?: ApiCallback<Record<string, unknown>>): Promise<Record<string, unknown>> | void;
|
|
78
|
+
getConfigWithAsync(options: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
76
79
|
[methodName: string]: ApiMethodWithParams | ApiMethodNoParams | ApiMethodWith | ApiMethodAsync<unknown[]> | ApiMethodWithAsync | unknown;
|
|
77
80
|
}
|
|
78
81
|
export {};
|
package/dist/auth/ecc/index.d.ts
CHANGED
|
@@ -4,6 +4,5 @@ export { PrivateKey } from './src/key_private';
|
|
|
4
4
|
export { PublicKey } from './src/key_public';
|
|
5
5
|
export { Signature } from './src/signature';
|
|
6
6
|
export { normalize as brainKey } from './src/brain_key';
|
|
7
|
-
export * as key_utils from './src/key_utils';
|
|
8
7
|
export * as hash from './src/hash';
|
|
9
8
|
export { Config as ecc_config } from '../../config';
|
|
@@ -4,6 +4,5 @@ export { PrivateKey } from './key_private';
|
|
|
4
4
|
export { PublicKey } from './key_public';
|
|
5
5
|
export { Signature } from './signature';
|
|
6
6
|
export { normalize as brainKey } from './brain_key';
|
|
7
|
-
export * as key_utils from './key_utils';
|
|
8
7
|
export * as hash from './hash';
|
|
9
8
|
export { Config as ecc_config } from '../../../config';
|
package/dist/browser.esm.js
CHANGED
|
@@ -17267,7 +17267,7 @@ function recoverPubKey(curve, e, signature, i) {
|
|
|
17267
17267
|
const Q = curve.recoverPubKey(msgBuffer, sigObj, i);
|
|
17268
17268
|
return Q;
|
|
17269
17269
|
}
|
|
17270
|
-
catch
|
|
17270
|
+
catch {
|
|
17271
17271
|
// Fallback to manual implementation if elliptic's method fails
|
|
17272
17272
|
const G = curve.g;
|
|
17273
17273
|
// A set LSB signifies that the y-coordinate is odd
|
|
@@ -17287,7 +17287,7 @@ function recoverPubKey(curve, e, signature, i) {
|
|
|
17287
17287
|
try {
|
|
17288
17288
|
R = curve.curve.pointFromX(xHexPadded, isYOdd);
|
|
17289
17289
|
}
|
|
17290
|
-
catch
|
|
17290
|
+
catch {
|
|
17291
17291
|
// If hex string fails, try with Buffer
|
|
17292
17292
|
const xBuffer = x.toArrayLike(bufferExports.Buffer, 'be', 32);
|
|
17293
17293
|
R = curve.curve.pointFromX(xBuffer, isYOdd);
|
|
@@ -29737,7 +29737,7 @@ const steem = {
|
|
|
29737
29737
|
memo,
|
|
29738
29738
|
operations,
|
|
29739
29739
|
utils: utils$3,
|
|
29740
|
-
version: '1.0
|
|
29740
|
+
version: '1.1.0',
|
|
29741
29741
|
config: {
|
|
29742
29742
|
set: (options) => {
|
|
29743
29743
|
// If nodes is provided, extract the first node as url for API
|