@ethersphere/bee-js 6.7.0 → 6.7.3
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/dist/cjs/bee-debug.js +13 -5
- package/dist/cjs/feed/index.js +1 -1
- package/dist/index.browser.min.js +1 -1
- package/dist/index.browser.min.js.map +1 -1
- package/dist/mjs/bee-debug.js +12 -5
- package/dist/mjs/feed/index.js +1 -1
- package/dist/types/feed/index.d.ts +1 -1
- package/dist/types/modules/feed.d.ts +3 -2
- package/package.json +1 -1
package/dist/mjs/bee-debug.js
CHANGED
|
@@ -536,12 +536,19 @@ export class BeeDebug {
|
|
|
536
536
|
assertRequestOptions(options);
|
|
537
537
|
return stake.getRedistributionState(this.getRequestOptionsForCall(options));
|
|
538
538
|
}
|
|
539
|
-
async waitForUsablePostageStamp(id, timeout =
|
|
540
|
-
const TIME_STEP =
|
|
539
|
+
async waitForUsablePostageStamp(id, timeout = 240000) {
|
|
540
|
+
const TIME_STEP = 2000;
|
|
541
541
|
for (let time = 0; time < timeout; time += TIME_STEP) {
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
542
|
+
try {
|
|
543
|
+
const stamp = await this.getPostageBatch(id);
|
|
544
|
+
if (stamp.usable) {
|
|
545
|
+
return;
|
|
546
|
+
}
|
|
547
|
+
} catch (error) {
|
|
548
|
+
const message = error?.response?.data?.message || error?.message || '';
|
|
549
|
+
if (!message.includes('batch not usable')) {
|
|
550
|
+
throw error;
|
|
551
|
+
}
|
|
545
552
|
}
|
|
546
553
|
await System.sleepMillis(TIME_STEP);
|
|
547
554
|
}
|
package/dist/mjs/feed/index.js
CHANGED
|
@@ -58,7 +58,7 @@ export function makeFeedReader(requestOptions, type, topic, owner) {
|
|
|
58
58
|
owner,
|
|
59
59
|
topic,
|
|
60
60
|
async download(options) {
|
|
61
|
-
if (!options?.index) {
|
|
61
|
+
if (!options?.index && options?.index !== 0) {
|
|
62
62
|
return fetchLatestFeedUpdate(requestOptions, owner, topic, {
|
|
63
63
|
...options,
|
|
64
64
|
type
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FeedUpdateOptions } from '../modules/feed';
|
|
2
|
-
import { BatchId, BeeRequestOptions, BytesReference, FeedReader, FeedWriter,
|
|
2
|
+
import { BatchId, BeeRequestOptions, BytesReference, FEED_INDEX_HEX_LENGTH, FeedReader, FeedWriter, PlainBytesReference, Reference, Signer, Topic, UploadOptions } from '../types';
|
|
3
3
|
import { Bytes } from '../utils/bytes';
|
|
4
4
|
import { EthAddress, HexEthAddress } from '../utils/eth';
|
|
5
5
|
import { HexString } from '../utils/hex';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Index } from '../feed';
|
|
1
2
|
import { FeedType } from '../feed/type';
|
|
2
3
|
import { BatchId, BeeRequestOptions, Reference, ReferenceResponse, Topic } from '../types';
|
|
3
4
|
import { HexEthAddress } from '../utils/eth';
|
|
@@ -16,13 +17,13 @@ export interface FeedUpdateOptions {
|
|
|
16
17
|
/**
|
|
17
18
|
* Fetch specific previous Feed's update (default fetches latest update)
|
|
18
19
|
*/
|
|
19
|
-
index?:
|
|
20
|
+
index?: Index;
|
|
20
21
|
}
|
|
21
22
|
interface FeedUpdateHeaders {
|
|
22
23
|
/**
|
|
23
24
|
* The current feed's index
|
|
24
25
|
*/
|
|
25
|
-
feedIndex:
|
|
26
|
+
feedIndex: Index;
|
|
26
27
|
/**
|
|
27
28
|
* The feed's index for next update.
|
|
28
29
|
* Only set for the latest update. If update is fetched using previous index, then this is an empty string.
|