@steemit/steem-js 1.0.14 → 1.0.16

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 CHANGED
@@ -11,6 +11,10 @@ A modern JavaScript/TypeScript library for interacting with the Steem blockchain
11
11
 
12
12
  **[👉 Complete API Documentation](./docs/README.md)** - Comprehensive guide with all methods, examples, and usage patterns
13
13
 
14
+ **[API routing (condenser_api vs database_api)](./docs/README.md#api-routing)** - How RPC namespaces map to current Steem nodes (v1.0.16+)
15
+
16
+ **[📋 Changelog](./CHANGELOG.md)** - Version history and breaking changes
17
+
14
18
  **[🔧 Refactoring Details](./docs/refactoring-2025.md)** - Technical details about the 2025 modernization
15
19
 
16
20
  ## 🚀 Quick Start
@@ -65,6 +69,7 @@ await steem.broadcast.voteAsync(postingWif, 'voter', 'author', 'permlink', 10000
65
69
 
66
70
  ## ✨ Key Features
67
71
 
72
+ - **🔗 Correct RPC routing** - Legacy read APIs use `condenser_api`; chain/validation APIs use `database_api` (v1.0.16+, aligned with [steem](https://github.com/steemit/steem))
68
73
  - **🔒 Type Safety** - Full TypeScript support with complete type definitions
69
74
  - **⚡ Modern** - ES modules, async/await, modern cryptography libraries
70
75
  - **🌐 Universal** - Works in Node.js, browsers, and bundlers
@@ -102,7 +107,7 @@ This is a complete modernization of the original steem-js library:
102
107
 
103
108
  ```
104
109
  src/
105
- ├── api/ # Blockchain API client (HTTP)
110
+ ├── api/ # Blockchain API client (HTTP; methods.ts → condenser_api / database_api / …)
106
111
  ├── auth/ # Authentication and key management
107
112
  ├── broadcast/ # Transaction broadcasting
108
113
  ├── crypto/ # Cryptographic utilities
@@ -33,6 +33,11 @@ export declare class Api extends EventEmitter {
33
33
  log(logLevel: string, ...args: unknown[]): void;
34
34
  start(): Promise<void>;
35
35
  stop(): Promise<void>;
36
+ /**
37
+ * Send a JSON-RPC request via the active transport.
38
+ * HTTP uses the legacy `call` wrapper: params are [apiNamespace, methodName, args].
39
+ * @param api Plugin namespace (e.g. condenser_api, database_api)
40
+ */
36
41
  send(api: string, data: unknown, callback: unknown): void | Promise<void>;
37
42
  call(method: string, params: unknown[], callback: (err: Error | null, result?: unknown) => void): void;
38
43
  /**
@@ -160,14 +165,15 @@ export declare class Api extends EventEmitter {
160
165
  */
161
166
  setMaxBlockAgeAsync(maxBlockAge: number): Promise<unknown>;
162
167
  /**
163
- * Verify transaction authority.
168
+ * Verify transaction authority (database_api.verify_authority on the node).
169
+ * Prefer verifyAuthorityAsync; dynamically generated helpers also exist from methods.ts.
164
170
  * @param trx Transaction object to verify
165
171
  * @param callback Optional callback function
166
172
  * @returns Promise with verification result if no callback provided
167
173
  */
168
174
  verifyAuthority(trx: unknown, callback?: (err: Error | null, result?: boolean) => void): Promise<boolean> | void;
169
175
  /**
170
- * Verify account authority.
176
+ * Verify account authority (database_api.verify_account_authority on the node).
171
177
  * @param nameOrId Account name or ID
172
178
  * @param signers Array of signer public keys
173
179
  * @param callback Optional callback function
@@ -179,6 +185,7 @@ declare const api: Api;
179
185
  export declare function setOptions(options: ApiOptions): void;
180
186
  export declare function call(method: string, params: unknown[], callback: (err: Error | null, result?: unknown) => void): void;
181
187
  export declare function signTransaction(trx: unknown, keys: string[]): unknown;
188
+ /** @deprecated Use `api.verifyAuthority` / `verifyAuthorityAsync` on the Api instance instead. */
182
189
  export declare function verifyAuthority(..._args: unknown[]): boolean;
183
190
  export default api;
184
191
  export declare const getDynamicGlobalPropertiesAsync: () => Promise<unknown>;
@@ -1,3 +1,17 @@
1
+ /**
2
+ * Registry of JSON-RPC methods exposed as steem.api.* helpers.
3
+ *
4
+ * Each entry's `api` field is the Steem node plugin namespace sent on the wire
5
+ * (legacy HTTP transport uses JSON-RPC `call` with [api, method, params]).
6
+ *
7
+ * Routing policy (aligned with steemit/steem):
8
+ * - condenser_api: legacy read helpers (get_accounts, get_content, discussions, …)
9
+ * - database_api: chain/validation APIs still on the modern database_api plugin
10
+ * - follow_api, network_broadcast_api, market_history_api, etc.: other plugins
11
+ *
12
+ * Methods removed from this list in v1.0.16 are no longer served by current nodes
13
+ * (e.g. websocket subscriptions, category listings, proposed-transaction getters).
14
+ */
1
15
  interface ApiMethod {
2
16
  api: string;
3
17
  method: string;
@@ -19,6 +19,10 @@ export declare class HttpTransport extends BaseTransport {
19
19
  constructor(options: TransportOptions);
20
20
  get nonRetriableOperations(): string[];
21
21
  isBroadcastOperation(method: string): boolean;
22
+ /**
23
+ * POST JSON-RPC to the node. Body uses method `call` with params [api, methodName, args]
24
+ * for backwards compatibility with steemd; alternatively use Api.call('plugin.method', …).
25
+ */
22
26
  send(api: string, data: {
23
27
  id?: number;
24
28
  method: string;
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Type definitions for dynamically generated API methods
3
- * These types provide TypeScript support for all API methods
2
+ * Type definitions for dynamically generated API methods.
3
+ * Runtime routing (condenser_api vs database_api) is defined in methods.ts; see docs/README.md#api-routing.
4
4
  */
5
5
  export type ApiCallback<T = unknown> = (err: Error | null, result?: T) => void;
6
6
  type ApiMethodWithParams<TResult = unknown> = (...args: unknown[]) => Promise<TResult> | void;