@layr-labs/ecloud-sdk 0.4.0-dev.3 → 0.4.0-dev.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.
- package/README.md +2 -2
- package/VERSION +2 -2
- package/dist/billing.cjs +23 -1
- package/dist/billing.cjs.map +1 -1
- package/dist/billing.js +23 -1
- package/dist/billing.js.map +1 -1
- package/dist/browser.cjs +24 -2
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.js +24 -2
- package/dist/browser.js.map +1 -1
- package/dist/compute.cjs +31 -2
- package/dist/compute.cjs.map +1 -1
- package/dist/compute.js +31 -2
- package/dist/compute.js.map +1 -1
- package/dist/index.cjs +31 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +31 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/tools/tls-keygen-linux-amd64 +0 -0
package/dist/index.cjs
CHANGED
|
@@ -2517,6 +2517,28 @@ async function createAuthorizationList(options) {
|
|
|
2517
2517
|
});
|
|
2518
2518
|
return [signedAuthorization];
|
|
2519
2519
|
}
|
|
2520
|
+
var TRANSIENT_PATTERNS = [
|
|
2521
|
+
"indexing is in progress",
|
|
2522
|
+
"is not in the chain"
|
|
2523
|
+
];
|
|
2524
|
+
function isTransientReceiptError(error) {
|
|
2525
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
2526
|
+
return TRANSIENT_PATTERNS.some((p) => msg.includes(p));
|
|
2527
|
+
}
|
|
2528
|
+
async function waitForReceipt(publicClient, hash, logger, { maxRetries = 5, baseDelayMs = 2e3 } = {}) {
|
|
2529
|
+
for (let attempt = 0; ; attempt++) {
|
|
2530
|
+
try {
|
|
2531
|
+
return await publicClient.waitForTransactionReceipt({ hash });
|
|
2532
|
+
} catch (error) {
|
|
2533
|
+
if (!isTransientReceiptError(error) || attempt >= maxRetries) throw error;
|
|
2534
|
+
const delay = baseDelayMs * 2 ** attempt;
|
|
2535
|
+
logger.debug(
|
|
2536
|
+
`Receipt not available yet (attempt ${attempt + 1}/${maxRetries}), retrying in ${delay}ms...`
|
|
2537
|
+
);
|
|
2538
|
+
await new Promise((r) => setTimeout(r, delay));
|
|
2539
|
+
}
|
|
2540
|
+
}
|
|
2541
|
+
}
|
|
2520
2542
|
async function executeBatch(options, logger = noopLogger) {
|
|
2521
2543
|
const {
|
|
2522
2544
|
walletClient,
|
|
@@ -2584,7 +2606,7 @@ async function executeBatch(options, logger = noopLogger) {
|
|
|
2584
2606
|
}
|
|
2585
2607
|
const hash = await walletClient.sendTransaction(txRequest);
|
|
2586
2608
|
logger.info(`Transaction sent: ${hash}`);
|
|
2587
|
-
const receipt = await publicClient
|
|
2609
|
+
const receipt = await waitForReceipt(publicClient, hash, logger);
|
|
2588
2610
|
if (receipt.status === "reverted") {
|
|
2589
2611
|
let revertReason = "Unknown reason";
|
|
2590
2612
|
try {
|
|
@@ -4960,7 +4982,7 @@ var CanViewAppLogsPermission = "0x2fd3f2fe";
|
|
|
4960
4982
|
var CanViewSensitiveAppInfoPermission = "0x0e67b22f";
|
|
4961
4983
|
var CanUpdateAppProfilePermission = "0x036fef61";
|
|
4962
4984
|
function getDefaultClientId() {
|
|
4963
|
-
const version = true ? "0.4.0-dev.
|
|
4985
|
+
const version = true ? "0.4.0-dev.5" : "0.0.0";
|
|
4964
4986
|
return `ecloud-sdk/v${version}`;
|
|
4965
4987
|
}
|
|
4966
4988
|
var UserApiClient = class {
|
|
@@ -5329,6 +5351,8 @@ async function watchUntilRunning(options, logger) {
|
|
|
5329
5351
|
}
|
|
5330
5352
|
return false;
|
|
5331
5353
|
};
|
|
5354
|
+
const startTime = Date.now();
|
|
5355
|
+
let lastLoggedStatus;
|
|
5332
5356
|
while (true) {
|
|
5333
5357
|
try {
|
|
5334
5358
|
const info = await userApiClient.getInfos([appId], 1);
|
|
@@ -5339,6 +5363,11 @@ async function watchUntilRunning(options, logger) {
|
|
|
5339
5363
|
const appInfo = info[0];
|
|
5340
5364
|
const currentStatus = appInfo.status;
|
|
5341
5365
|
const currentIP = appInfo.ip || "";
|
|
5366
|
+
const elapsed = Math.round((Date.now() - startTime) / 1e3);
|
|
5367
|
+
if (currentStatus !== lastLoggedStatus) {
|
|
5368
|
+
logger.info(`Status: ${currentStatus} (${elapsed}s)`);
|
|
5369
|
+
lastLoggedStatus = currentStatus;
|
|
5370
|
+
}
|
|
5342
5371
|
if (stopCondition(currentStatus, currentIP)) {
|
|
5343
5372
|
return currentIP || void 0;
|
|
5344
5373
|
}
|