@flashbacktech/flashbackclient 0.1.39 → 0.1.41

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 (52) hide show
  1. package/dist/stellarv2/client/index.d.ts +1 -6
  2. package/dist/stellarv2/client/index.js +24 -10
  3. package/dist/stellarv2/wallet/transaction.js +0 -53
  4. package/package.json +1 -1
  5. package/dist/api/types.d.ts +0 -89
  6. package/dist/api/types.js +0 -20
  7. package/dist/consumer/file/delete.d.ts +0 -3
  8. package/dist/consumer/file/delete.js +0 -23
  9. package/dist/consumer/file/getUrl.d.ts +0 -3
  10. package/dist/consumer/file/getUrl.js +0 -20
  11. package/dist/consumer/file/index.d.ts +0 -30
  12. package/dist/consumer/file/index.js +0 -52
  13. package/dist/consumer/file/types.d.ts +0 -25
  14. package/dist/consumer/file/types.js +0 -2
  15. package/dist/consumer/file/upload.d.ts +0 -3
  16. package/dist/consumer/file/upload.js +0 -75
  17. package/dist/consumer/index.d.ts +0 -1
  18. package/dist/consumer/index.js +0 -17
  19. package/dist/stellar/client.d.ts +0 -282
  20. package/dist/stellar/client.js +0 -453
  21. package/dist/stellar/consumer.d.ts +0 -10
  22. package/dist/stellar/consumer.js +0 -86
  23. package/dist/stellar/decorator.d.ts +0 -1
  24. package/dist/stellar/decorator.js +0 -33
  25. package/dist/stellar/index.d.ts +0 -4
  26. package/dist/stellar/index.js +0 -5
  27. package/dist/stellar/models.d.ts +0 -55
  28. package/dist/stellar/models.js +0 -2
  29. package/dist/stellar/provider.d.ts +0 -10
  30. package/dist/stellar/provider.js +0 -86
  31. package/dist/stellar/reservation.d.ts +0 -8
  32. package/dist/stellar/reservation.js +0 -61
  33. package/dist/stellar/stats.d.ts +0 -4
  34. package/dist/stellar/stats.js +0 -12
  35. package/dist/stellar/transaction.d.ts +0 -24
  36. package/dist/stellar/transaction.js +0 -138
  37. package/dist/stellar/unit.d.ts +0 -12
  38. package/dist/stellar/unit.js +0 -100
  39. package/dist/stellarv2/bucket.d.ts +0 -111
  40. package/dist/stellarv2/bucket.js +0 -262
  41. package/dist/stellarv2/client.d.ts +0 -134
  42. package/dist/stellarv2/client.js +0 -240
  43. package/dist/stellarv2/consumer.d.ts +0 -60
  44. package/dist/stellarv2/consumer.js +0 -145
  45. package/dist/stellarv2/deal.d.ts +0 -160
  46. package/dist/stellarv2/deal.js +0 -357
  47. package/dist/stellarv2/funding.d.ts +0 -46
  48. package/dist/stellarv2/funding.js +0 -86
  49. package/dist/stellarv2/provider.d.ts +0 -72
  50. package/dist/stellarv2/provider.js +0 -174
  51. package/dist/stellarv2/transaction.d.ts +0 -36
  52. package/dist/stellarv2/transaction.js +0 -168
@@ -1,282 +0,0 @@
1
- import { StellarNetwork } from './transaction.js';
2
- /**
3
- * Configuration interface for the FlashOnStellar client
4
- * @interface FlashOnStellarClientConfig
5
- */
6
- interface FlashOnStellarClientConfig {
7
- /** Stellar contract address for the FlashOnStellar system */
8
- contractAddress: string;
9
- /**
10
- * Optional callback function to sign non-read Stellar transactions
11
- * @param xdrToSign - The XDR-encoded transaction to sign
12
- * @returns Promise resolving to the signed XDR string
13
- */
14
- signTransaction?: (xdrToSign: string) => Promise<string>;
15
- /** Network configuration for Stellar (testnet/public) */
16
- network: StellarNetwork;
17
- }
18
- type ClientContext = FlashOnStellarClientConfig;
19
- /**
20
- * Main client class for interacting with the FlashOnStellar system
21
- * This client provides methods for managing providers, consumers, units, and reservations
22
- * on the Stellar blockchain.
23
- */
24
- declare class FlashOnStellarClient {
25
- private readonly signTransaction?;
26
- private readonly contractAddress;
27
- private readonly network;
28
- protected getContext(): ClientContext;
29
- /**
30
- * Creates a new instance of the FlashOnStellarClient
31
- * @param config - Configuration options for the client
32
- */
33
- constructor(config: FlashOnStellarClientConfig);
34
- /**
35
- * Derives a public key from a private key
36
- * @param privateKey - Stellar private key
37
- * @returns The corresponding public key
38
- */
39
- getPublicKey: (privateKey: string) => string;
40
- /**
41
- * Signs a transaction using the provided private key using Stellar SDK
42
- * The alternative is providing your own signing function (for example, using Wallet Kit).
43
- * @param xdrToSign - XDR-encoded transaction to sign
44
- * @param privateKey - Stellar private key to sign with
45
- * @returns Promise resolving to the signed XDR string
46
- */
47
- signTransactionWithKey: (xdrToSign: string, privateKey: string) => Promise<string>;
48
- /**
49
- * Retrieves stats for the current user
50
- * @param wallet_address - Address of the wallet requesting the information
51
- * @returns Promise resolving to DashboardStats object
52
- */
53
- get_stats: (wallet_address: string) => Promise<import("./models.js").ContractStats | null>;
54
- /**
55
- * Retrieves provider information
56
- * @param wallet_address - Address of the wallet requesting the information
57
- * @param provider_address - Address of the provider to retrieve
58
- * @param load_units - Optional flag to include provider's units in the response
59
- * @returns Promise resolving to StorageProvider object
60
- */
61
- get_provider: (wallet_address: string, provider_address: string, load_units?: boolean) => Promise<import("./models.js").StorageProvider | null>;
62
- /**
63
- * Retrieves all units associated with a provider
64
- * @param wallet_address - Address of the wallet requesting the information
65
- * @param provider_address - Address of the provider
66
- * @returns Promise resolving to an array of StorageUnit objects
67
- */
68
- get_provider_units: (wallet_address: string, provider_address: string) => Promise<Map<number, import("./models.js").StorageUnit>>;
69
- /**
70
- * Retrieves a paginated list of providers
71
- * @param wallet_address - Address of the wallet requesting the information
72
- * @param skip - Number of items to skip for pagination
73
- * @param take - Number of items to take per page
74
- * @returns Promise resolving to an array of StorageProvider objects
75
- */
76
- get_providers: (wallet_address: string, skip?: number, take?: number) => Promise<Map<string, import("./models.js").StorageProvider>>;
77
- /**
78
- * Gets the total count of providers in the system
79
- * @param wallet_address - Address of the wallet requesting the information
80
- * @returns Promise resolving to the total number of providers
81
- */
82
- get_provider_count: (wallet_address: string) => Promise<number>;
83
- /**
84
- * Registers a new provider in the system
85
- * @param wallet_address - Address of the wallet registering the provider
86
- * @param provider_address - Address for the new provider
87
- * @param provider_description - Description of the provider
88
- * @returns Promise resolving to the registration transaction result
89
- * @requires Signature - This method requires a transaction signature
90
- * @throws Will throw if provider address is already registered
91
- */
92
- register_provider(wallet_address: string, provider_address: string, provider_description: string): Promise<void>;
93
- /**
94
- * Deletes a provider from the system
95
- * @param wallet_address - Address of the wallet making the request
96
- * @param provider_address - Address of the provider to delete
97
- * @returns Promise resolving to the deletion transaction result
98
- * @requires Signature - This method requires a transaction signature
99
- */
100
- delete_provider(wallet_address: string, provider_address: string): Promise<void>;
101
- /**
102
- * Updates provider information
103
- * @param wallet_address - Address of the wallet making the request
104
- * @param provider_address - Address of the provider to update
105
- * @param provider_description - New description for the provider
106
- * @returns Promise resolving to the update transaction result
107
- * @requires Signature - This method requires a transaction signature
108
- */
109
- update_provider(wallet_address: string, provider_address: string, provider_description: string): Promise<void>;
110
- /**
111
- * Retrieves consumer information
112
- * @param wallet_address - Address of the wallet requesting the information
113
- * @param consumer_address - Address of the consumer to retrieve
114
- * @param load_reservations - Optional flag to include consumer's reservations
115
- * @returns Promise resolving to StorageConsumer object
116
- */
117
- get_consumer: (wallet_address: string, consumer_address: string, load_reservations?: boolean) => Promise<import("./models.js").StorageConsumer | null>;
118
- /**
119
- * Retrieves a paginated list of consumers
120
- * @param wallet_address - Address of the wallet requesting the information
121
- * @param skip - Number of items to skip for pagination
122
- * @param take - Number of items to take per page
123
- * @returns Promise resolving to an array of StorageConsumer objects
124
- */
125
- get_consumers: (wallet_address: string, skip?: number, take?: number) => Promise<Map<string, import("./models.js").StorageConsumer>>;
126
- /**
127
- * Gets the total count of consumers in the system
128
- * @param wallet_address - Address of the wallet requesting the information
129
- * @returns Promise resolving to the total number of consumers
130
- */
131
- get_consumer_count: (wallet_address: string) => Promise<number>;
132
- /**
133
- * Retrieves all reservations associated with a consumer
134
- * @param wallet_address - Address of the wallet requesting the information
135
- * @param consumer_address - Address of the consumer
136
- * @returns Promise resolving to an array of StorageReservation objects
137
- */
138
- get_consumer_reservations: (wallet_address: string, consumer_address: string) => Promise<Map<number, import("./models.js").StorageReservation>>;
139
- /**
140
- * Registers a new consumer in the system
141
- * @param wallet_address - Address of the wallet registering the consumer
142
- * @param consumer_address - Address for the new consumer
143
- * @param consumer_description - Description of the consumer
144
- * @returns Promise resolving to the registration transaction result
145
- * @requires Signature - This method requires a transaction signature
146
- */
147
- register_consumer(wallet_address: string, consumer_address: string, consumer_description: string): Promise<void>;
148
- delete_consumer(wallet_address: string, consumer_address: string): Promise<void>;
149
- update_consumer(wallet_address: string, consumer_address: string, consumer_description: string): Promise<void>;
150
- /**
151
- * Registers a new storage unit in the system
152
- * @param wallet_address - Address of the wallet registering the unit
153
- * @param provider_address - Address of the provider owning the unit
154
- * @param capacity - Capacity of the storage unit in gigabytes
155
- * @param endpoint - Endpoint for the storage unit
156
- * @returns Promise resolving to the registration transaction result
157
- * @requires Signature - This method requires a transaction signature
158
- */
159
- register_unit(wallet_address: string, provider_address: string, capacity: number, endpoint: string): Promise<[unitId: number, unit: import("./models.js").StorageUnit] | null>;
160
- /**
161
- * Retrieves storage unit information
162
- * @param wallet_address - Address of the wallet requesting the information
163
- * @param unit_id - Identifier of the storage unit
164
- * @param load_reservations - Optional flag to include unit's reservations
165
- * @returns Promise resolving to StorageUnit object
166
- */
167
- get_unit: (wallet_address: string, unit_id: number, load_reservations?: boolean) => Promise<import("./models.js").StorageUnit | null>;
168
- /**
169
- * Retrieves all reservations for a specific storage unit
170
- * @param wallet_address - Address of the wallet requesting the information
171
- * @param unit_id - Identifier of the storage unit
172
- * @returns Promise resolving to an array of StorageReservation objects
173
- */
174
- get_unit_reservations: (wallet_address: string, unit_id: number) => Promise<Map<number, import("./models.js").StorageReservation>>;
175
- /**
176
- * Deletes a storage unit from the system
177
- * @param wallet_address - Address of the wallet making the request
178
- * @param provider_address - Address of the provider owning the unit
179
- * @param unit_id - Identifier of the storage unit
180
- * @returns Promise resolving to the deletion transaction result
181
- * @requires Signature - This method requires a transaction signature
182
- * @throws Will throw if unit has active reservations
183
- */
184
- delete_unit(wallet_address: string, provider_address: string, unit_id: number): Promise<import("./models.js").DeletionStatus | null>;
185
- /**
186
- * Places a storage unit into maintenance mode
187
- * @param wallet_address - Address of the wallet making the request
188
- * @param provider_address - Address of the provider owning the unit
189
- * @param unit_id - Identifier of the storage unit
190
- * @param maintenance_start - Start date of maintenance period
191
- * @param maintenance_end - End date of maintenance period
192
- * @returns Promise resolving to the maintenance transaction result
193
- * @requires Signature - This method requires a transaction signature
194
- * @throws Will throw if unit has active reservations that conflict with the maintenance window
195
- */
196
- enter_maintenance(wallet_address: string, provider_address: string, unit_id: number, maintenance_start: Date, maintenance_end: Date): Promise<boolean | null>;
197
- /**
198
- * Exits maintenance mode for a storage unit
199
- * @param wallet_address - Address of the wallet making the request
200
- * @param provider_address - Address of the provider owning the unit
201
- * @param unit_id - Identifier of the storage unit
202
- * @returns Promise resolving to the maintenance exit transaction result
203
- * @requires Signature - This method requires a transaction signature
204
- * @throws Will throw if unit is not in maintenance mode
205
- */
206
- exit_maintenance(wallet_address: string, provider_address: string, unit_id: number): Promise<boolean | null>;
207
- /**
208
- * Places a storage unit into decommissioning mode
209
- * This starts the process of removing the unit from service.
210
- * @param wallet_address - Address of the wallet making the request
211
- * @param provider_address - Address of the provider owning the unit
212
- * @param unit_id - Identifier of the storage unit
213
- * @returns Promise resolving to the decommissioning transaction result
214
- * @requires Signature - This method requires a transaction signature
215
- * @throws Will throw if unit has active reservations
216
- */
217
- enter_decommissioning(wallet_address: string, provider_address: string, unit_id: number): Promise<boolean | null>;
218
- /**
219
- * Exits decommissioning mode for a storage unit
220
- * This cancels the decommissioning process and returns the unit to service.
221
- * @param wallet_address - Address of the wallet making the request
222
- * @param provider_address - Address of the provider owning the unit
223
- * @param unit_id - Identifier of the storage unit
224
- * @returns Promise resolving to the decommissioning exit transaction result
225
- * @requires Signature - This method requires a transaction signature
226
- * @throws Will throw if unit is not in decommissioning mode
227
- */
228
- exit_decommissioning(wallet_address: string, provider_address: string, unit_id: number): Promise<boolean | null>;
229
- /**
230
- * Retrieves information about a specific reservation
231
- * @param wallet_address - Address of the wallet requesting the information
232
- * @param reservation_id - Identifier of the reservation
233
- * @returns Promise resolving to StorageReservation object
234
- */
235
- get_reservation: (wallet_address: string, reservation_id: number) => Promise<import("./models.js").StorageReservation | null>;
236
- /**
237
- * Creates a new storage reservation
238
- * @param wallet_address - Address of the wallet making the request
239
- * @param consumer_address - Address of the consumer requesting storage
240
- * @param unit_id - Identifier of the storage unit to reserve
241
- * @param reserved_gb - Amount of storage to reserve in gigabytes
242
- * @returns Promise resolving to the reservation creation transaction result
243
- * @requires Signature - This method requires a transaction signature
244
- * @throws Will throw if unit doesn't have enough available capacity
245
- * @throws Will throw if unit is in maintenance or decommissioning mode
246
- */
247
- reserve_unit(wallet_address: string, consumer_address: string, unit_id: number, reserved_gb: number): Promise<boolean>;
248
- /**
249
- * Deletes an existing reservation
250
- * @param wallet_address - Address of the wallet making the request
251
- * @param consumer_address - Address of the consumer who owns the reservation
252
- * @param reservation_id - Identifier of the reservation to delete
253
- * @returns Promise resolving to the reservation deletion transaction result
254
- * @requires Signature - This method requires a transaction signature
255
- * @throws Will throw if reservation has non-zero inuse_bytes
256
- */
257
- delete_reservation(wallet_address: string, consumer_address: string, reservation_id: number): Promise<import("./models.js").DeletionStatus>;
258
- /**
259
- * Updates the amount of storage currently in use by a consumer
260
- * @param wallet_address - Address of the wallet making the request
261
- * @param consumer_address - Address of the consumer
262
- * @param reservation_id - Identifier of the reservation
263
- * @param inuse_bytes - Current number of bytes in use
264
- * @returns Promise resolving to the update transaction result
265
- * @requires Signature - This method requires a transaction signature
266
- * @throws Will throw if inuse_bytes exceeds reserved amount
267
- */
268
- update_inuse_bytes_consumer(wallet_address: string, consumer_address: string, reservation_id: number, inuse_bytes: number): Promise<boolean>;
269
- /**
270
- * Updates the amount of storage currently in use, reported by provider
271
- * @param wallet_address - Address of the wallet making the request
272
- * @param provider_address - Address of the provider
273
- * @param reservation_id - Identifier of the reservation
274
- * @param inuse_bytes - Current number of bytes in use
275
- * @returns Promise resolving to the update transaction result
276
- * @requires Signature - This method requires a transaction signature
277
- * @throws Will throw if inuse_bytes exceeds reserved amount
278
- * @throws Will throw if provider's report differs significantly from consumer's report
279
- */
280
- update_inuse_bytes_provider(wallet_address: string, provider_address: string, reservation_id: number, inuse_bytes: number): Promise<boolean>;
281
- }
282
- export { FlashOnStellarClient, FlashOnStellarClientConfig, ClientContext };