@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.js
CHANGED
|
@@ -2368,6 +2368,28 @@ async function createAuthorizationList(options) {
|
|
|
2368
2368
|
});
|
|
2369
2369
|
return [signedAuthorization];
|
|
2370
2370
|
}
|
|
2371
|
+
var TRANSIENT_PATTERNS = [
|
|
2372
|
+
"indexing is in progress",
|
|
2373
|
+
"is not in the chain"
|
|
2374
|
+
];
|
|
2375
|
+
function isTransientReceiptError(error) {
|
|
2376
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
2377
|
+
return TRANSIENT_PATTERNS.some((p) => msg.includes(p));
|
|
2378
|
+
}
|
|
2379
|
+
async function waitForReceipt(publicClient, hash, logger, { maxRetries = 5, baseDelayMs = 2e3 } = {}) {
|
|
2380
|
+
for (let attempt = 0; ; attempt++) {
|
|
2381
|
+
try {
|
|
2382
|
+
return await publicClient.waitForTransactionReceipt({ hash });
|
|
2383
|
+
} catch (error) {
|
|
2384
|
+
if (!isTransientReceiptError(error) || attempt >= maxRetries) throw error;
|
|
2385
|
+
const delay = baseDelayMs * 2 ** attempt;
|
|
2386
|
+
logger.debug(
|
|
2387
|
+
`Receipt not available yet (attempt ${attempt + 1}/${maxRetries}), retrying in ${delay}ms...`
|
|
2388
|
+
);
|
|
2389
|
+
await new Promise((r) => setTimeout(r, delay));
|
|
2390
|
+
}
|
|
2391
|
+
}
|
|
2392
|
+
}
|
|
2371
2393
|
async function executeBatch(options, logger = noopLogger) {
|
|
2372
2394
|
const {
|
|
2373
2395
|
walletClient,
|
|
@@ -2435,7 +2457,7 @@ async function executeBatch(options, logger = noopLogger) {
|
|
|
2435
2457
|
}
|
|
2436
2458
|
const hash = await walletClient.sendTransaction(txRequest);
|
|
2437
2459
|
logger.info(`Transaction sent: ${hash}`);
|
|
2438
|
-
const receipt = await publicClient
|
|
2460
|
+
const receipt = await waitForReceipt(publicClient, hash, logger);
|
|
2439
2461
|
if (receipt.status === "reverted") {
|
|
2440
2462
|
let revertReason = "Unknown reason";
|
|
2441
2463
|
try {
|
|
@@ -4811,7 +4833,7 @@ var CanViewAppLogsPermission = "0x2fd3f2fe";
|
|
|
4811
4833
|
var CanViewSensitiveAppInfoPermission = "0x0e67b22f";
|
|
4812
4834
|
var CanUpdateAppProfilePermission = "0x036fef61";
|
|
4813
4835
|
function getDefaultClientId() {
|
|
4814
|
-
const version = true ? "0.4.0-dev.
|
|
4836
|
+
const version = true ? "0.4.0-dev.5" : "0.0.0";
|
|
4815
4837
|
return `ecloud-sdk/v${version}`;
|
|
4816
4838
|
}
|
|
4817
4839
|
var UserApiClient = class {
|
|
@@ -5180,6 +5202,8 @@ async function watchUntilRunning(options, logger) {
|
|
|
5180
5202
|
}
|
|
5181
5203
|
return false;
|
|
5182
5204
|
};
|
|
5205
|
+
const startTime = Date.now();
|
|
5206
|
+
let lastLoggedStatus;
|
|
5183
5207
|
while (true) {
|
|
5184
5208
|
try {
|
|
5185
5209
|
const info = await userApiClient.getInfos([appId], 1);
|
|
@@ -5190,6 +5214,11 @@ async function watchUntilRunning(options, logger) {
|
|
|
5190
5214
|
const appInfo = info[0];
|
|
5191
5215
|
const currentStatus = appInfo.status;
|
|
5192
5216
|
const currentIP = appInfo.ip || "";
|
|
5217
|
+
const elapsed = Math.round((Date.now() - startTime) / 1e3);
|
|
5218
|
+
if (currentStatus !== lastLoggedStatus) {
|
|
5219
|
+
logger.info(`Status: ${currentStatus} (${elapsed}s)`);
|
|
5220
|
+
lastLoggedStatus = currentStatus;
|
|
5221
|
+
}
|
|
5193
5222
|
if (stopCondition(currentStatus, currentIP)) {
|
|
5194
5223
|
return currentIP || void 0;
|
|
5195
5224
|
}
|