@ethersphere/bee-js 7.0.1 → 7.0.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/mjs/bee.js
CHANGED
|
@@ -1321,19 +1321,14 @@ export class Bee {
|
|
|
1321
1321
|
return stake.getRedistributionState(this.getRequestOptionsForCall(options));
|
|
1322
1322
|
}
|
|
1323
1323
|
async waitForUsablePostageStamp(id, timeout = 240000) {
|
|
1324
|
-
const TIME_STEP =
|
|
1324
|
+
const TIME_STEP = 3000;
|
|
1325
1325
|
for (let time = 0; time < timeout; time += TIME_STEP) {
|
|
1326
1326
|
try {
|
|
1327
1327
|
const stamp = await this.getPostageBatch(id);
|
|
1328
1328
|
if (stamp.usable) {
|
|
1329
1329
|
return;
|
|
1330
1330
|
}
|
|
1331
|
-
} catch (error) {
|
|
1332
|
-
const message = error?.response?.data?.message || error?.message || '';
|
|
1333
|
-
if (!message.includes('batch not usable')) {
|
|
1334
|
-
throw error;
|
|
1335
|
-
}
|
|
1336
|
-
}
|
|
1331
|
+
} catch (error) {}
|
|
1337
1332
|
await System.sleepMillis(TIME_STEP);
|
|
1338
1333
|
}
|
|
1339
1334
|
throw new BeeError('Timeout on waiting for postage stamp to become usable');
|
package/dist/mjs/feed/index.js
CHANGED
|
@@ -26,7 +26,7 @@ export async function findNextIndex(requestOptions, owner, topic, options) {
|
|
|
26
26
|
}
|
|
27
27
|
export async function updateFeed(requestOptions, signer, topic, reference, postageBatchId, options) {
|
|
28
28
|
const ownerHex = makeHexEthAddress(signer.address);
|
|
29
|
-
const nextIndex = options?.index
|
|
29
|
+
const nextIndex = options?.index ?? (await findNextIndex(requestOptions, ownerHex, topic, options));
|
|
30
30
|
const identifier = makeFeedIdentifier(topic, nextIndex);
|
|
31
31
|
const at = options?.at ?? Date.now() / 1000.0;
|
|
32
32
|
const timestamp = Binary.numberToUint64BE(Math.floor(at));
|