hive-stream 3.0.3 → 3.0.5

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.
Files changed (41) hide show
  1. package/DOCUMENTATION.md +693 -1
  2. package/README.md +251 -1
  3. package/dist/adapters/mongodb.adapter.js +21 -30
  4. package/dist/adapters/mongodb.adapter.js.map +1 -1
  5. package/dist/adapters/postgresql.adapter.js +16 -16
  6. package/dist/adapters/postgresql.adapter.js.map +1 -1
  7. package/dist/adapters/sqlite.adapter.js +17 -17
  8. package/dist/adapters/sqlite.adapter.js.map +1 -1
  9. package/dist/api.js +2 -0
  10. package/dist/api.js.map +1 -1
  11. package/dist/builders.d.ts +444 -0
  12. package/dist/builders.js +1609 -0
  13. package/dist/builders.js.map +1 -0
  14. package/dist/config.d.ts +10 -1
  15. package/dist/config.js +90 -4
  16. package/dist/config.js.map +1 -1
  17. package/dist/contracts/coinflip.contract.js +18 -21
  18. package/dist/contracts/coinflip.contract.js.map +1 -1
  19. package/dist/contracts/dice.contract.js +18 -21
  20. package/dist/contracts/dice.contract.js.map +1 -1
  21. package/dist/contracts/helpers.d.ts +2 -0
  22. package/dist/contracts/helpers.js +18 -11
  23. package/dist/contracts/helpers.js.map +1 -1
  24. package/dist/contracts/nft.contract.js +5 -10
  25. package/dist/contracts/nft.contract.js.map +1 -1
  26. package/dist/contracts/rps.contract.js +35 -23
  27. package/dist/contracts/rps.contract.js.map +1 -1
  28. package/dist/index.d.ts +1 -0
  29. package/dist/index.js +1 -0
  30. package/dist/index.js.map +1 -1
  31. package/dist/metadata.d.ts +13 -0
  32. package/dist/metadata.js +256 -0
  33. package/dist/metadata.js.map +1 -1
  34. package/dist/streamer.d.ts +148 -12
  35. package/dist/streamer.js +1102 -53
  36. package/dist/streamer.js.map +1 -1
  37. package/dist/types/hive-stream.d.ts +623 -0
  38. package/dist/utils.d.ts +475 -0
  39. package/dist/utils.js +1618 -8
  40. package/dist/utils.js.map +1 -1
  41. package/package.json +4 -5
@@ -0,0 +1,444 @@
1
+ import type { Streamer } from './streamer';
2
+ import type { BatchBuilder, BurnOperationBuilder, CommunityOperationBuilder, EngineCancelOrderBuilder, EngineDelegateBuilder, EngineMarketOrderBuilder, EngineStakeBuilder, EngineUnstakeBuilder, CancelOrderBuilder, ClaimRewardsBuilder, CollateralizedConvertBuilder, CommentOptionsBuilder, ConvertBuilder, DelegateBuilder, DeleteCommentBuilder, EscrowTransferBuilder, FlowAllocationInput, FlowDedupeStore, FlowGroupRecipient, FlowGroupSplitStrategy, FlowMemoInput, FlowSubscriptionHandle, FollowBuilder, HiveEngineBurnBuilder, HiveEngineIssueBuilder, HiveEngineTransferBuilder, IncomingTransferFlowBuilder, LimitOrderBuilder, PlannedIncomingTransferRoutes, PostBuilder, PowerDownBuilder, PowerUpBuilder, ProposalBuilder, ProposalVotesBuilder, ReblogBuilder, RemoveProposalsBuilder, RecurrentTransferBuilder, SavingsTransferBuilder, SetProxyBuilder, TransferEvent, TransferOperationBuilder, UpdateProfileBuilder, VoteBuilder, WitnessVoteBuilder, WithdrawRouteBuilder } from './types/hive-stream';
3
+ export declare class IncomingTransfersBuilder implements IncomingTransferFlowBuilder {
4
+ private readonly streamer;
5
+ private account?;
6
+ private allowedSymbols?;
7
+ private dedupeStore?;
8
+ private ignoreZeroAmountValue?;
9
+ private errorHandler?;
10
+ private defaultMemo?;
11
+ private steps;
12
+ constructor(streamer: Streamer, account?: string);
13
+ forAccount(account: string): this;
14
+ allowSymbols(...symbols: string[]): this;
15
+ memo(memo: FlowMemoInput): this;
16
+ dedupeWith(store: FlowDedupeStore): this;
17
+ ignoreZeroAmount(ignore?: boolean): this;
18
+ onError(handler: (error: unknown, event: TransferEvent) => void | Promise<void>): this;
19
+ burn(allocation: FlowAllocationInput, memo?: FlowMemoInput): this;
20
+ burnOnTop(allocation: FlowAllocationInput, memo?: FlowMemoInput): this;
21
+ forwardTo(to: string, allocation?: FlowAllocationInput, memo?: FlowMemoInput): this;
22
+ forwardOnTop(to: string, allocation: FlowAllocationInput, memo?: FlowMemoInput): this;
23
+ donateOnTop(to: string, allocation: FlowAllocationInput, memo?: FlowMemoInput): this;
24
+ forwardGroup(recipients: FlowGroupRecipient[], allocation: FlowAllocationInput, options?: {
25
+ memo?: FlowMemoInput;
26
+ split?: FlowGroupSplitStrategy;
27
+ }): this;
28
+ forwardGroupOnTop(recipients: FlowGroupRecipient[], allocation: FlowAllocationInput, options?: {
29
+ memo?: FlowMemoInput;
30
+ split?: FlowGroupSplitStrategy;
31
+ }): this;
32
+ remainderTo(to: string, memo?: FlowMemoInput): this;
33
+ remainderToGroup(recipients: FlowGroupRecipient[], options?: {
34
+ memo?: FlowMemoInput;
35
+ split?: FlowGroupSplitStrategy;
36
+ }): this;
37
+ refund(memo?: FlowMemoInput): this;
38
+ refundPortion(allocation: FlowAllocationInput, memo?: FlowMemoInput): this;
39
+ remainderToSender(memo?: FlowMemoInput): this;
40
+ plan(transfer: string | TransferEvent | {
41
+ amount?: string;
42
+ from?: string;
43
+ to?: string;
44
+ memo?: string;
45
+ }): PlannedIncomingTransferRoutes;
46
+ start(): FlowSubscriptionHandle;
47
+ private buildRoutes;
48
+ }
49
+ export declare class HiveTransferBuilder implements TransferOperationBuilder {
50
+ private readonly streamer;
51
+ private state;
52
+ constructor(streamer: Streamer);
53
+ from(account: string): this;
54
+ to(account: string): this;
55
+ amount(amount: string | number, symbol?: string): this;
56
+ hive(amount: string | number): this;
57
+ hbd(amount: string | number): this;
58
+ memo(memo: string): this;
59
+ send(): any;
60
+ }
61
+ export declare class HiveBurnBuilder implements BurnOperationBuilder {
62
+ private readonly streamer;
63
+ private state;
64
+ constructor(streamer: Streamer);
65
+ from(account: string): this;
66
+ amount(amount: string | number, symbol?: string): this;
67
+ hive(amount: string | number): this;
68
+ hbd(amount: string | number): this;
69
+ memo(memo: string): this;
70
+ send(): any;
71
+ }
72
+ export declare class HiveEscrowTransferBuilder implements EscrowTransferBuilder {
73
+ private readonly streamer;
74
+ private state;
75
+ constructor(streamer: Streamer);
76
+ from(account: string): this;
77
+ to(account: string): this;
78
+ agent(account: string): this;
79
+ id(escrowId: number): this;
80
+ hive(amount: string | number): this;
81
+ hbd(amount: string | number): this;
82
+ fee(amount: string | number, symbol?: string): this;
83
+ ratificationDeadline(value: string | Date): this;
84
+ expiration(value: string | Date): this;
85
+ jsonMeta(meta: string | Record<string, any>): this;
86
+ send(signingKeys?: string | string[]): any;
87
+ }
88
+ export declare class HiveRecurrentTransferBuilder implements RecurrentTransferBuilder {
89
+ private readonly streamer;
90
+ private state;
91
+ constructor(streamer: Streamer);
92
+ from(account: string): this;
93
+ to(account: string): this;
94
+ amount(amount: string | number, symbol?: string): this;
95
+ hive(amount: string | number): this;
96
+ hbd(amount: string | number): this;
97
+ memo(memo: string): this;
98
+ recurrence(value: number): this;
99
+ executions(value: number): this;
100
+ send(signingKeys?: string | string[]): any;
101
+ }
102
+ export declare class HiveProposalBuilder implements ProposalBuilder {
103
+ private readonly streamer;
104
+ private state;
105
+ constructor(streamer: Streamer);
106
+ creator(account: string): this;
107
+ receiver(account: string): this;
108
+ startDate(value: string | Date): this;
109
+ endDate(value: string | Date): this;
110
+ dailyPay(amount: string | number, symbol?: string): this;
111
+ dailyHive(amount: string | number): this;
112
+ dailyHbd(amount: string | number): this;
113
+ subject(value: string): this;
114
+ permlink(value: string): this;
115
+ send(signingKeys?: string | string[]): any;
116
+ }
117
+ export declare class HiveEngineTokenTransferBuilder implements HiveEngineTransferBuilder {
118
+ private readonly streamer;
119
+ private state;
120
+ constructor(streamer: Streamer);
121
+ from(account: string): this;
122
+ to(account: string): this;
123
+ symbol(symbol: string): this;
124
+ quantity(quantity: string | number): this;
125
+ memo(memo: string): this;
126
+ send(): any;
127
+ }
128
+ export declare class HiveEngineTokenBurnBuilder implements HiveEngineBurnBuilder {
129
+ private readonly streamer;
130
+ private state;
131
+ constructor(streamer: Streamer);
132
+ from(account: string): this;
133
+ symbol(symbol: string): this;
134
+ quantity(quantity: string | number): this;
135
+ memo(memo: string): this;
136
+ send(): any;
137
+ }
138
+ export declare class HiveEngineTokenIssueBuilder implements HiveEngineIssueBuilder {
139
+ private readonly streamer;
140
+ private state;
141
+ constructor(streamer: Streamer);
142
+ from(account: string): this;
143
+ to(account: string): this;
144
+ symbol(symbol: string): this;
145
+ quantity(quantity: string | number): this;
146
+ memo(memo: string): this;
147
+ send(): any;
148
+ }
149
+ export declare class HiveProposalVotesBuilder implements ProposalVotesBuilder {
150
+ private readonly streamer;
151
+ private state;
152
+ constructor(streamer: Streamer);
153
+ voter(account: string): this;
154
+ ids(...proposalIds: number[]): this;
155
+ approve(value?: boolean): this;
156
+ reject(): this;
157
+ send(signingKeys?: string | string[]): any;
158
+ }
159
+ export declare class HiveRemoveProposalsBuilder implements RemoveProposalsBuilder {
160
+ private readonly streamer;
161
+ private state;
162
+ constructor(streamer: Streamer);
163
+ owner(account: string): this;
164
+ ids(...proposalIds: number[]): this;
165
+ send(signingKeys?: string | string[]): any;
166
+ }
167
+ export declare class HiveVoteBuilder implements VoteBuilder {
168
+ private readonly streamer;
169
+ private readonly direction;
170
+ private state;
171
+ constructor(streamer: Streamer, direction: 'upvote' | 'downvote');
172
+ author(account: string): this;
173
+ permlink(value: string): this;
174
+ weight(value: string | number): this;
175
+ send(): any;
176
+ }
177
+ export declare class HiveFollowBuilder implements FollowBuilder {
178
+ private readonly streamer;
179
+ private readonly mode;
180
+ private state;
181
+ constructor(streamer: Streamer, mode: 'follow' | 'unfollow' | 'mute');
182
+ follower(account: string): this;
183
+ following(account: string): this;
184
+ send(): any;
185
+ }
186
+ export declare class HiveReblogBuilder implements ReblogBuilder {
187
+ private readonly streamer;
188
+ private state;
189
+ constructor(streamer: Streamer);
190
+ account(account: string): this;
191
+ author(account: string): this;
192
+ permlink(value: string): this;
193
+ send(): any;
194
+ }
195
+ export declare class HivePowerUpBuilder implements PowerUpBuilder {
196
+ private readonly streamer;
197
+ private state;
198
+ constructor(streamer: Streamer);
199
+ from(account: string): this;
200
+ to(account: string): this;
201
+ amount(amount: string | number): this;
202
+ send(): any;
203
+ }
204
+ export declare class HivePowerDownBuilder implements PowerDownBuilder {
205
+ private readonly streamer;
206
+ private readonly cancel;
207
+ private state;
208
+ constructor(streamer: Streamer, cancel?: boolean);
209
+ account(account: string): this;
210
+ vestingShares(amount: string): this;
211
+ send(): any;
212
+ }
213
+ export declare class HiveDelegateBuilder implements DelegateBuilder {
214
+ private readonly streamer;
215
+ private readonly undelegate;
216
+ private state;
217
+ constructor(streamer: Streamer, undelegate?: boolean);
218
+ delegator(account: string): this;
219
+ delegatee(account: string): this;
220
+ vestingShares(amount: string): this;
221
+ send(): any;
222
+ }
223
+ export declare class HiveClaimRewardsBuilder implements ClaimRewardsBuilder {
224
+ private readonly streamer;
225
+ private state;
226
+ constructor(streamer: Streamer);
227
+ account(account: string): this;
228
+ rewardHive(amount: string): this;
229
+ rewardHbd(amount: string): this;
230
+ rewardVests(amount: string): this;
231
+ send(): any;
232
+ }
233
+ export declare class HiveWitnessVoteBuilder implements WitnessVoteBuilder {
234
+ private readonly streamer;
235
+ private state;
236
+ constructor(streamer: Streamer);
237
+ account(account: string): this;
238
+ witness(account: string): this;
239
+ approve(value?: boolean): this;
240
+ unapprove(): this;
241
+ send(): any;
242
+ }
243
+ export declare class HiveSetProxyBuilder implements SetProxyBuilder {
244
+ private readonly streamer;
245
+ private readonly clear;
246
+ private state;
247
+ constructor(streamer: Streamer, clear?: boolean);
248
+ account(account: string): this;
249
+ proxy(account: string): this;
250
+ send(): any;
251
+ }
252
+ export declare class HiveUpdateProfileBuilder implements UpdateProfileBuilder {
253
+ private readonly streamer;
254
+ private state;
255
+ constructor(streamer: Streamer);
256
+ account(account: string): this;
257
+ name(value: string): this;
258
+ about(value: string): this;
259
+ location(value: string): this;
260
+ website(value: string): this;
261
+ profileImage(url: string): this;
262
+ coverImage(url: string): this;
263
+ set(key: string, value: any): this;
264
+ send(): any;
265
+ }
266
+ export declare class HiveSavingsTransferBuilder implements SavingsTransferBuilder {
267
+ private readonly streamer;
268
+ private readonly direction;
269
+ private state;
270
+ constructor(streamer: Streamer, direction: 'to' | 'from');
271
+ from(account: string): this;
272
+ to(account: string): this;
273
+ amount(amount: string | number, symbol?: string): this;
274
+ hive(amount: string | number): this;
275
+ hbd(amount: string | number): this;
276
+ memo(memo: string): this;
277
+ requestId(id: number): this;
278
+ send(): any;
279
+ }
280
+ export declare class HiveConvertBuilder implements ConvertBuilder {
281
+ private readonly streamer;
282
+ private state;
283
+ constructor(streamer: Streamer);
284
+ from(account: string): this;
285
+ amount(amount: string | number, symbol?: string): this;
286
+ hbd(amount: string | number): this;
287
+ requestId(id: number): this;
288
+ send(): any;
289
+ }
290
+ export declare class HiveCollateralizedConvertBuilder implements CollateralizedConvertBuilder {
291
+ private readonly streamer;
292
+ private state;
293
+ constructor(streamer: Streamer);
294
+ from(account: string): this;
295
+ amount(amount: string | number, symbol?: string): this;
296
+ hive(amount: string | number): this;
297
+ requestId(id: number): this;
298
+ send(): any;
299
+ }
300
+ export declare class HiveDeleteCommentBuilder implements DeleteCommentBuilder {
301
+ private readonly streamer;
302
+ private state;
303
+ constructor(streamer: Streamer);
304
+ author(account: string): this;
305
+ permlink(value: string): this;
306
+ send(): any;
307
+ }
308
+ export declare class HiveLimitOrderBuilder implements LimitOrderBuilder {
309
+ private readonly streamer;
310
+ private state;
311
+ constructor(streamer: Streamer);
312
+ owner(account: string): this;
313
+ orderId(id: number): this;
314
+ amountToSell(amount: string | number, symbol?: string): this;
315
+ minToReceive(amount: string | number, symbol?: string): this;
316
+ fillOrKill(value?: boolean): this;
317
+ expiration(value: string | Date): this;
318
+ send(signingKeys?: string | string[]): any;
319
+ }
320
+ export declare class HiveCancelOrderBuilder implements CancelOrderBuilder {
321
+ private readonly streamer;
322
+ private state;
323
+ constructor(streamer: Streamer);
324
+ owner(account: string): this;
325
+ orderId(id: number): this;
326
+ send(signingKeys?: string | string[]): any;
327
+ }
328
+ export declare class HiveWithdrawRouteBuilder implements WithdrawRouteBuilder {
329
+ private readonly streamer;
330
+ private state;
331
+ constructor(streamer: Streamer);
332
+ from(account: string): this;
333
+ to(account: string): this;
334
+ percent(value: number): this;
335
+ autoVest(value?: boolean): this;
336
+ send(signingKeys?: string | string[]): any;
337
+ }
338
+ export declare class HiveCommentOptionsBuilder implements CommentOptionsBuilder {
339
+ private readonly streamer;
340
+ private state;
341
+ constructor(streamer: Streamer);
342
+ author(account: string): this;
343
+ permlink(value: string): this;
344
+ maxAcceptedPayout(amount: string | number, symbol?: string): this;
345
+ percentHbd(value: number): this;
346
+ allowVotes(value?: boolean): this;
347
+ allowCurationRewards(value?: boolean): this;
348
+ beneficiary(account: string, weight: number): this;
349
+ send(): any;
350
+ }
351
+ export declare class HivePostBuilder implements PostBuilder {
352
+ private readonly streamer;
353
+ private state;
354
+ constructor(streamer: Streamer);
355
+ author(account: string): this;
356
+ title(value: string): this;
357
+ body(value: string): this;
358
+ permlink(value: string): this;
359
+ tags(...tags: string[]): this;
360
+ community(name: string): this;
361
+ parentAuthor(account: string): this;
362
+ parentPermlink(value: string): this;
363
+ beneficiary(account: string, weight: number): this;
364
+ maxAcceptedPayout(amount: string | number, symbol?: string): this;
365
+ percentHbd(value: number): this;
366
+ allowVotes(value?: boolean): this;
367
+ allowCurationRewards(value?: boolean): this;
368
+ app(name: string): this;
369
+ format(value: string): this;
370
+ description(value: string): this;
371
+ image(...urls: string[]): this;
372
+ metadata(key: string, value: any): this;
373
+ send(): any;
374
+ }
375
+ export declare class HiveBatchBuilder implements BatchBuilder {
376
+ private readonly streamer;
377
+ private operations;
378
+ constructor(streamer: Streamer);
379
+ add(operation: [string, any]): this;
380
+ transfer(from: string, to: string, amount: string, memo?: string): this;
381
+ vote(voter: string, author: string, permlink: string, weight: number): this;
382
+ customJson(id: string, json: any, postingAuth?: string, activeAuth?: string): this;
383
+ comment(author: string, permlink: string, parentAuthor: string, parentPermlink: string, title: string, body: string, jsonMetadata?: string): this;
384
+ send(signingKeys?: string | string[]): any;
385
+ }
386
+ export declare class HiveEngineStakeBuilder implements EngineStakeBuilder {
387
+ private readonly streamer;
388
+ private state;
389
+ constructor(streamer: Streamer);
390
+ from(account: string): this;
391
+ to(account: string): this;
392
+ symbol(symbol: string): this;
393
+ quantity(quantity: string | number): this;
394
+ send(): any;
395
+ }
396
+ export declare class HiveEngineUnstakeBuilder implements EngineUnstakeBuilder {
397
+ private readonly streamer;
398
+ private state;
399
+ constructor(streamer: Streamer);
400
+ from(account: string): this;
401
+ symbol(symbol: string): this;
402
+ quantity(quantity: string | number): this;
403
+ send(): any;
404
+ }
405
+ export declare class HiveEngineMarketOrderBuilder implements EngineMarketOrderBuilder {
406
+ private readonly streamer;
407
+ private readonly side;
408
+ private state;
409
+ constructor(streamer: Streamer, side: 'buy' | 'sell');
410
+ from(account: string): this;
411
+ symbol(symbol: string): this;
412
+ quantity(quantity: string | number): this;
413
+ price(price: string | number): this;
414
+ send(): any;
415
+ }
416
+ export declare class HiveEngineCancelOrderBuilder implements EngineCancelOrderBuilder {
417
+ private readonly streamer;
418
+ private state;
419
+ constructor(streamer: Streamer);
420
+ from(account: string): this;
421
+ type(type: 'buy' | 'sell'): this;
422
+ orderId(id: string): this;
423
+ send(): any;
424
+ }
425
+ export declare class HiveEngineDelegateBuilder implements EngineDelegateBuilder {
426
+ private readonly streamer;
427
+ private readonly undelegate;
428
+ private state;
429
+ constructor(streamer: Streamer, undelegate?: boolean);
430
+ from(account: string): this;
431
+ to(account: string): this;
432
+ symbol(symbol: string): this;
433
+ quantity(quantity: string | number): this;
434
+ send(): any;
435
+ }
436
+ export declare class HiveCommunityOperationBuilder implements CommunityOperationBuilder {
437
+ private readonly streamer;
438
+ private readonly action;
439
+ private state;
440
+ constructor(streamer: Streamer, action: 'subscribe' | 'unsubscribe');
441
+ account(account: string): this;
442
+ community(name: string): this;
443
+ send(): any;
444
+ }