@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/compute.js
CHANGED
|
@@ -2364,6 +2364,28 @@ async function createAuthorizationList(options) {
|
|
|
2364
2364
|
});
|
|
2365
2365
|
return [signedAuthorization];
|
|
2366
2366
|
}
|
|
2367
|
+
var TRANSIENT_PATTERNS = [
|
|
2368
|
+
"indexing is in progress",
|
|
2369
|
+
"is not in the chain"
|
|
2370
|
+
];
|
|
2371
|
+
function isTransientReceiptError(error) {
|
|
2372
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
2373
|
+
return TRANSIENT_PATTERNS.some((p) => msg.includes(p));
|
|
2374
|
+
}
|
|
2375
|
+
async function waitForReceipt(publicClient, hash, logger, { maxRetries = 5, baseDelayMs = 2e3 } = {}) {
|
|
2376
|
+
for (let attempt = 0; ; attempt++) {
|
|
2377
|
+
try {
|
|
2378
|
+
return await publicClient.waitForTransactionReceipt({ hash });
|
|
2379
|
+
} catch (error) {
|
|
2380
|
+
if (!isTransientReceiptError(error) || attempt >= maxRetries) throw error;
|
|
2381
|
+
const delay = baseDelayMs * 2 ** attempt;
|
|
2382
|
+
logger.debug(
|
|
2383
|
+
`Receipt not available yet (attempt ${attempt + 1}/${maxRetries}), retrying in ${delay}ms...`
|
|
2384
|
+
);
|
|
2385
|
+
await new Promise((r) => setTimeout(r, delay));
|
|
2386
|
+
}
|
|
2387
|
+
}
|
|
2388
|
+
}
|
|
2367
2389
|
async function executeBatch(options, logger = noopLogger) {
|
|
2368
2390
|
const {
|
|
2369
2391
|
walletClient,
|
|
@@ -2431,7 +2453,7 @@ async function executeBatch(options, logger = noopLogger) {
|
|
|
2431
2453
|
}
|
|
2432
2454
|
const hash = await walletClient.sendTransaction(txRequest);
|
|
2433
2455
|
logger.info(`Transaction sent: ${hash}`);
|
|
2434
|
-
const receipt = await publicClient
|
|
2456
|
+
const receipt = await waitForReceipt(publicClient, hash, logger);
|
|
2435
2457
|
if (receipt.status === "reverted") {
|
|
2436
2458
|
let revertReason = "Unknown reason";
|
|
2437
2459
|
try {
|
|
@@ -4667,7 +4689,7 @@ var CanViewAppLogsPermission = "0x2fd3f2fe";
|
|
|
4667
4689
|
var CanViewSensitiveAppInfoPermission = "0x0e67b22f";
|
|
4668
4690
|
var CanUpdateAppProfilePermission = "0x036fef61";
|
|
4669
4691
|
function getDefaultClientId() {
|
|
4670
|
-
const version = true ? "0.4.0-dev.
|
|
4692
|
+
const version = true ? "0.4.0-dev.5" : "0.0.0";
|
|
4671
4693
|
return `ecloud-sdk/v${version}`;
|
|
4672
4694
|
}
|
|
4673
4695
|
var UserApiClient = class {
|
|
@@ -5036,6 +5058,8 @@ async function watchUntilRunning(options, logger) {
|
|
|
5036
5058
|
}
|
|
5037
5059
|
return false;
|
|
5038
5060
|
};
|
|
5061
|
+
const startTime = Date.now();
|
|
5062
|
+
let lastLoggedStatus;
|
|
5039
5063
|
while (true) {
|
|
5040
5064
|
try {
|
|
5041
5065
|
const info = await userApiClient.getInfos([appId], 1);
|
|
@@ -5046,6 +5070,11 @@ async function watchUntilRunning(options, logger) {
|
|
|
5046
5070
|
const appInfo = info[0];
|
|
5047
5071
|
const currentStatus = appInfo.status;
|
|
5048
5072
|
const currentIP = appInfo.ip || "";
|
|
5073
|
+
const elapsed = Math.round((Date.now() - startTime) / 1e3);
|
|
5074
|
+
if (currentStatus !== lastLoggedStatus) {
|
|
5075
|
+
logger.info(`Status: ${currentStatus} (${elapsed}s)`);
|
|
5076
|
+
lastLoggedStatus = currentStatus;
|
|
5077
|
+
}
|
|
5049
5078
|
if (stopCondition(currentStatus, currentIP)) {
|
|
5050
5079
|
return currentIP || void 0;
|
|
5051
5080
|
}
|