@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.
@@ -0,0 +1,271 @@
1
+ /**
2
+ * Protocol type definitions for Steem RPC return values.
3
+ *
4
+ * These interfaces mirror the C++ node's condenser_api / database_api /
5
+ * follow_api FC_REFLECT serialization structs and are cross-checked against
6
+ * the dsteem TypeScript implementation. Field order follows JSON
7
+ * serialization order. C++ prototype types are noted in comments:
8
+ * - time_point_sec / account_name_type / signature_type → string
9
+ * - fc::object_id (account_id_type, comment_id_type, etc.) → number
10
+ * - hash id types (block_id_type, transaction_id_type, etc.) → string
11
+ * - legacy_asset → string literal e.g. "1.000 STEEM" (condenser form)
12
+ * - share_type (fc::safe<int64_t>) → number | string (may exceed safe int)
13
+ * - uint128_t → string
14
+ * - flat_map<K,V> → array of [K, V] tuples
15
+ *
16
+ * Source of truth:
17
+ * steem/libraries/plugins/apis/condenser_api/include/steem/plugins/condenser_api/condenser_api.hpp
18
+ */
19
+ import type { Authority, Transaction } from '../types';
20
+ /** steem::chain::util::manabar */
21
+ export interface Manabar {
22
+ current_mana: number | string;
23
+ last_update_time: number;
24
+ }
25
+ /** steem::protocol::beneficiary_route_type */
26
+ export interface BeneficiaryRoute {
27
+ account: string;
28
+ weight: number;
29
+ }
30
+ /**
31
+ * steem::plugins::follow::api_follow_object (follow_api).
32
+ * Returned by condenser_api.get_followers / get_following.
33
+ */
34
+ export interface FollowApiObject {
35
+ follower: string;
36
+ following: string;
37
+ /** Follow type tags: "blog", "ignore", or empty. */
38
+ what: string[];
39
+ }
40
+ /** Vote entry inside Discussion.active_votes (steem::plugins::tags::vote_state). */
41
+ export interface ActiveVote {
42
+ voter: string;
43
+ percent: number;
44
+ reputation: number | string;
45
+ rshares: number;
46
+ time: string;
47
+ weight: number;
48
+ }
49
+ /**
50
+ * steem::plugins::condenser_api::api_operation_object.
51
+ * The value element of get_account_history entries.
52
+ */
53
+ export interface AppliedOperation {
54
+ trx_id: string;
55
+ block: number;
56
+ trx_in_block: number;
57
+ op_in_trx: number;
58
+ virtual_op: number;
59
+ timestamp: string;
60
+ /** [operation_name, operation_body] static_variant. */
61
+ op: [string, unknown];
62
+ }
63
+ /**
64
+ * condenser_api.get_account_history returns a map<uint32_t, api_operation_object>
65
+ * serialized as an array of [index, operation] tuples.
66
+ */
67
+ export type AccountHistoryEntry = [number, AppliedOperation];
68
+ /**
69
+ * condenser_api::extended_account. Returned by get_accounts /
70
+ * get_account_references. Fields common to api_account_object come first,
71
+ * then the extended_account additions.
72
+ *
73
+ * Note: the *_history / comments / blog / feed / recent_replies fields are
74
+ * lazily populated by specific RPC calls and are absent from get_accounts.
75
+ */
76
+ export interface ExtendedAccount {
77
+ id: number;
78
+ name: string;
79
+ owner: Authority;
80
+ active: Authority;
81
+ posting: Authority;
82
+ memo_key: string;
83
+ json_metadata: string;
84
+ posting_json_metadata: string;
85
+ proxy: string;
86
+ last_owner_update: string;
87
+ last_account_update: string;
88
+ created: string;
89
+ mined: boolean;
90
+ recovery_account: string;
91
+ last_account_recovery: string;
92
+ reset_account: string;
93
+ comment_count: number;
94
+ lifetime_vote_count: number;
95
+ post_count: number;
96
+ can_vote: boolean;
97
+ voting_manabar: Manabar;
98
+ downvote_manabar: Manabar;
99
+ voting_power: number;
100
+ balance: string;
101
+ savings_balance: string;
102
+ sbd_balance: string;
103
+ sbd_seconds: string;
104
+ sbd_seconds_last_update: string;
105
+ sbd_last_interest_payment: string;
106
+ savings_sbd_balance: string;
107
+ savings_sbd_seconds: string;
108
+ savings_sbd_seconds_last_update: string;
109
+ savings_sbd_last_interest_payment: string;
110
+ savings_withdraw_requests: number;
111
+ reward_sbd_balance: string;
112
+ reward_steem_balance: string;
113
+ reward_vesting_balance: string;
114
+ reward_vesting_steem: string;
115
+ vesting_shares: string;
116
+ delegated_vesting_shares: string;
117
+ received_vesting_shares: string;
118
+ vesting_withdraw_rate: string;
119
+ next_vesting_withdrawal: string;
120
+ withdrawn: number | string;
121
+ to_withdraw: number | string;
122
+ withdraw_routes: number;
123
+ curation_rewards: number | string;
124
+ posting_rewards: number | string;
125
+ proxied_vsf_votes: (number | string)[];
126
+ witnesses_voted_for: number;
127
+ last_post: string;
128
+ last_root_post: string;
129
+ last_vote_time: string;
130
+ post_bandwidth: number;
131
+ pending_claimed_accounts: number | string;
132
+ vesting_balance: string;
133
+ reputation: number | string;
134
+ transfer_history: unknown[];
135
+ market_history: unknown[];
136
+ post_history: unknown[];
137
+ vote_history: unknown[];
138
+ other_history: unknown[];
139
+ witness_votes: string[];
140
+ tags_usage: unknown[];
141
+ guest_bloggers: unknown[];
142
+ open_orders?: unknown[];
143
+ comments?: unknown[];
144
+ blog?: unknown[];
145
+ feed?: unknown[];
146
+ recent_replies?: unknown[];
147
+ recommended?: unknown[];
148
+ }
149
+ /**
150
+ * extended_dynamic_global_properties.
151
+ * Returned by get_dynamic_global_properties.
152
+ */
153
+ export interface DynamicGlobalProperties {
154
+ id: number;
155
+ head_block_number: number;
156
+ head_block_id: string;
157
+ time: string;
158
+ current_witness: string;
159
+ total_pow: number;
160
+ num_pow_witnesses: number;
161
+ virtual_supply: string;
162
+ current_supply: string;
163
+ confidential_supply: string;
164
+ init_sbd_supply: string;
165
+ current_sbd_supply: string;
166
+ confidential_sbd_supply: string;
167
+ total_vesting_fund_steem: string;
168
+ total_vesting_shares: string;
169
+ total_reward_fund_steem: string;
170
+ total_reward_shares2: string;
171
+ pending_rewarded_vesting_shares: string;
172
+ pending_rewarded_vesting_steem: string;
173
+ sbd_interest_rate: number;
174
+ sbd_print_rate: number;
175
+ maximum_block_size: number;
176
+ required_actions_partition_percent: number;
177
+ current_aslot: number;
178
+ recent_slots_filled: string;
179
+ participation_count: number;
180
+ last_irreversible_block_num: number;
181
+ vote_power_reserve_rate: number;
182
+ delegation_return_period: number;
183
+ reverse_auction_seconds: number;
184
+ available_account_subsidies: number;
185
+ sbd_stop_percent: number;
186
+ sbd_start_percent: number;
187
+ next_maintenance_time: string;
188
+ last_budget_time: string;
189
+ content_reward_percent: number;
190
+ vesting_reward_percent: number;
191
+ sps_fund_percent: number;
192
+ sps_interval_ledger: string;
193
+ downvote_pool_percent: number;
194
+ }
195
+ /**
196
+ * condenser_api::discussion. Returned by get_content.
197
+ * Includes api_comment_object base fields + discussion additions.
198
+ */
199
+ export interface Discussion {
200
+ id: number;
201
+ author: string;
202
+ permlink: string;
203
+ category: string;
204
+ parent_author: string;
205
+ parent_permlink: string;
206
+ title: string;
207
+ body: string;
208
+ json_metadata: string;
209
+ last_update: string;
210
+ created: string;
211
+ active: string;
212
+ last_payout: string;
213
+ depth: number;
214
+ children: number;
215
+ net_rshares: number | string;
216
+ abs_rshares: number | string;
217
+ vote_rshares: number | string;
218
+ children_abs_rshares: number | string;
219
+ cashout_time: string;
220
+ max_cashout_time: string;
221
+ total_vote_weight: number;
222
+ reward_weight: number;
223
+ total_payout_value: string;
224
+ curator_payout_value: string;
225
+ author_rewards: number | string;
226
+ net_votes: number;
227
+ root_author: string;
228
+ root_permlink: string;
229
+ max_accepted_payout: string;
230
+ percent_steem_dollars: number;
231
+ allow_replies: boolean;
232
+ allow_votes: boolean;
233
+ allow_curation_rewards: boolean;
234
+ beneficiaries: BeneficiaryRoute[];
235
+ url: string;
236
+ root_title: string;
237
+ pending_payout_value: string;
238
+ total_pending_payout_value: string;
239
+ active_votes: ActiveVote[];
240
+ replies: string[];
241
+ author_reputation: number | string;
242
+ promoted: string;
243
+ body_length: number;
244
+ reblogged_by: string[];
245
+ first_reblogged_by?: string;
246
+ first_reblogged_on?: string;
247
+ }
248
+ /**
249
+ * condenser_api::legacy_signed_block (BlockHeader → SignedBlockHeader →
250
+ * SignedBlock merged). Returned by get_block.
251
+ */
252
+ export interface SignedBlock {
253
+ previous: string;
254
+ timestamp: string;
255
+ witness: string;
256
+ transaction_merkle_root: string;
257
+ extensions: unknown[];
258
+ witness_signature: string;
259
+ block_id: string;
260
+ signing_key: string;
261
+ transaction_ids: string[];
262
+ /**
263
+ * Transactions in this block. NOTE: this reuses the broadcast-input
264
+ * `Transaction` type, which omits the `transaction_id` / `block_num` /
265
+ * `transaction_num` annotation fields that condenser's
266
+ * legacy_signed_transaction includes on every block transaction. A
267
+ * dedicated annotated-output transaction type should replace this in a
268
+ * follow-up (see PR #542 review).
269
+ */
270
+ transactions: Transaction[];
271
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steemit/steem-js",
3
- "version": "1.0.20",
3
+ "version": "1.1.0",
4
4
  "description": "Steem blockchain JavaScript/TypeScript library",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -1,10 +0,0 @@
1
- import { PrivateKey } from './key_private';
2
- export declare function addEntropy(...ints: number[]): void;
3
- /**
4
- * Cryptographically secure 32-byte random buffer.
5
- * Optionally mix in caller-provided entropy (e.g. from browser) via one-shot hash.
6
- * @param entropy optional string entropy of at least 32 bytes to mix in
7
- */
8
- export declare function random32ByteBuffer(entropy?: string): Buffer;
9
- export declare function get_random_key(entropy?: string): PrivateKey;
10
- export declare function browserEntropy(): string;