@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 CHANGED
@@ -53,7 +53,7 @@ ecloud billing subscribe
53
53
 
54
54
  ```bash
55
55
  # Create your app (choose: typescript | python | golang | rust)
56
- ecloud compute app create my-app typescript
56
+ ecloud compute app create --name my-app --language typescript
57
57
  cd my-app
58
58
 
59
59
  # Configure environment variables
@@ -224,7 +224,7 @@ docker build --platform linux/amd64 -t myregistry/myapp:v1.0 .
224
224
  docker push myregistry/myapp:v1.0
225
225
 
226
226
  # Deploy using the image reference
227
- ecloud compute app deploy myregistry/myapp:v1.0
227
+ ecloud compute app deploy --image-ref myregistry/myapp:v1.0
228
228
  ```
229
229
 
230
230
  **Requirements:**
package/VERSION CHANGED
@@ -1,2 +1,2 @@
1
- version=0.4.0-dev.3
2
- commit=28778e9448067097cb879bd612b696f99d4b031b
1
+ version=0.4.0-dev.5
2
+ commit=0874835615d92f09de2d3397111e426f7b69a0f1
package/dist/billing.cjs CHANGED
@@ -1845,6 +1845,28 @@ async function checkERC7702Delegation(publicClient, account, delegatorAddress) {
1845
1845
  const expectedCode = `0xef0100${delegatorAddress.slice(2)}`;
1846
1846
  return code.toLowerCase() === expectedCode.toLowerCase();
1847
1847
  }
1848
+ var TRANSIENT_PATTERNS = [
1849
+ "indexing is in progress",
1850
+ "is not in the chain"
1851
+ ];
1852
+ function isTransientReceiptError(error) {
1853
+ const msg = error instanceof Error ? error.message : String(error);
1854
+ return TRANSIENT_PATTERNS.some((p) => msg.includes(p));
1855
+ }
1856
+ async function waitForReceipt(publicClient, hash, logger, { maxRetries = 5, baseDelayMs = 2e3 } = {}) {
1857
+ for (let attempt = 0; ; attempt++) {
1858
+ try {
1859
+ return await publicClient.waitForTransactionReceipt({ hash });
1860
+ } catch (error) {
1861
+ if (!isTransientReceiptError(error) || attempt >= maxRetries) throw error;
1862
+ const delay = baseDelayMs * 2 ** attempt;
1863
+ logger.debug(
1864
+ `Receipt not available yet (attempt ${attempt + 1}/${maxRetries}), retrying in ${delay}ms...`
1865
+ );
1866
+ await new Promise((r) => setTimeout(r, delay));
1867
+ }
1868
+ }
1869
+ }
1848
1870
  async function executeBatch(options, logger = noopLogger) {
1849
1871
  const {
1850
1872
  walletClient,
@@ -1912,7 +1934,7 @@ async function executeBatch(options, logger = noopLogger) {
1912
1934
  }
1913
1935
  const hash = await walletClient.sendTransaction(txRequest);
1914
1936
  logger.info(`Transaction sent: ${hash}`);
1915
- const receipt = await publicClient.waitForTransactionReceipt({ hash });
1937
+ const receipt = await waitForReceipt(publicClient, hash, logger);
1916
1938
  if (receipt.status === "reverted") {
1917
1939
  let revertReason = "Unknown reason";
1918
1940
  try {