@layr-labs/ecloud-sdk 1.0.0-dev.6 → 1.0.0-dev.8

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/compute.js CHANGED
@@ -421,7 +421,74 @@ var PushPermissionError = class extends Error {
421
421
  import Handlebars from "handlebars";
422
422
 
423
423
  // src/client/common/templates/Dockerfile.layered.tmpl
424
- var Dockerfile_layered_default = '{{#if includeTLS}}\n# Get Caddy from official image\nFROM caddy:2.10.2-alpine AS caddy\n{{/if}}\n\nFROM {{baseImage}}\n\n{{#if originalUser}}\n# Switch to root to perform setup (base image has non-root USER: {{originalUser}})\nUSER root\n{{/if}}\n\n# Copy core TEE components\nCOPY compute-source-env.sh /usr/local/bin/\nCOPY kms-client /usr/local/bin/\nCOPY kms-signing-public-key.pem /usr/local/bin/\n\n{{#if includeTLS}}\n# Copy Caddy from official image\nCOPY --from=caddy /usr/bin/caddy /usr/local/bin/caddy\n\n# Copy TLS components\nCOPY tls-keygen /usr/local/bin/\nCOPY Caddyfile /etc/caddy/\n{{/if}}\n\n{{#if originalUser}}\n# Make binaries executable (755 for executables, 644 for keys)\nRUN chmod 755 /usr/local/bin/compute-source-env.sh \\\n && chmod 755 /usr/local/bin/kms-client{{#if includeTLS}} \\\n && chmod 755 /usr/local/bin/tls-keygen \\\n && chmod 755 /usr/local/bin/caddy{{/if}} \\\n && chmod 644 /usr/local/bin/kms-signing-public-key.pem\n\n# Store original user - entrypoint will drop privileges to this user after TEE setup\nENV __ECLOUD_ORIGINAL_USER={{originalUser}}\n{{else}}\n# Make binaries executable (preserve existing permissions, just add execute)\nRUN chmod +x /usr/local/bin/compute-source-env.sh \\\n && chmod +x /usr/local/bin/kms-client{{#if includeTLS}} \\\n && chmod +x /usr/local/bin/tls-keygen{{/if}}\n{{/if}}\n\n{{#if logRedirect}}\n\nLABEL tee.launch_policy.log_redirect={{logRedirect}}\n{{/if}}\n{{#if resourceUsageAllow}}\n\nLABEL tee.launch_policy.monitoring_memory_allow={{resourceUsageAllow}}\n{{/if}}\n\nLABEL eigenx_cli_version={{ecloudCLIVersion}}\nLABEL eigenx_vm_image=eigen\n\n{{#if includeTLS}}\n# Expose both HTTP and HTTPS ports for Caddy\nEXPOSE 80 443\n{{/if}}\n\nENTRYPOINT ["/usr/local/bin/compute-source-env.sh"]\nCMD {{{originalCmd}}}\n';
424
+ var Dockerfile_layered_default = `{{#if includeTLS}}
425
+ # Get Caddy from official image
426
+ FROM caddy:2.10.2-alpine AS caddy
427
+ {{/if}}
428
+
429
+ FROM {{baseImage}}
430
+
431
+ {{#if originalUser}}
432
+ # Switch to root to perform setup (base image has non-root USER: {{originalUser}})
433
+ USER root
434
+ {{/if}}
435
+
436
+ # Copy core TEE components
437
+ # CA bundle for kms-client / tls-keygen to validate HTTPS calls to
438
+ # eigencloud.xyz endpoints. Bundled at a non-standard path and consumed
439
+ # only via SSL_CERT_FILE in compute-source-env.sh, so the user's
440
+ # /etc/ssl/ is never touched.
441
+ COPY --from=alpine:3.20.10 /etc/ssl/certs/ca-certificates.crt /usr/local/share/eigenx-ca-certs.crt
442
+ COPY compute-source-env.sh /usr/local/bin/
443
+ COPY kms-client /usr/local/bin/
444
+ COPY kms-signing-public-key.pem /usr/local/bin/
445
+
446
+ {{#if includeTLS}}
447
+ # Copy Caddy from official image
448
+ COPY --from=caddy /usr/bin/caddy /usr/local/bin/caddy
449
+
450
+ # Copy TLS components
451
+ COPY tls-keygen /usr/local/bin/
452
+ COPY Caddyfile /etc/caddy/
453
+ {{/if}}
454
+
455
+ {{#if originalUser}}
456
+ # Make binaries executable (755 for executables, 644 for keys)
457
+ RUN chmod 755 /usr/local/bin/compute-source-env.sh \\
458
+ && chmod 755 /usr/local/bin/kms-client{{#if includeTLS}} \\
459
+ && chmod 755 /usr/local/bin/tls-keygen \\
460
+ && chmod 755 /usr/local/bin/caddy{{/if}} \\
461
+ && chmod 644 /usr/local/bin/kms-signing-public-key.pem
462
+
463
+ # Store original user - entrypoint will drop privileges to this user after TEE setup
464
+ ENV __ECLOUD_ORIGINAL_USER={{originalUser}}
465
+ {{else}}
466
+ # Make binaries executable (preserve existing permissions, just add execute)
467
+ RUN chmod +x /usr/local/bin/compute-source-env.sh \\
468
+ && chmod +x /usr/local/bin/kms-client{{#if includeTLS}} \\
469
+ && chmod +x /usr/local/bin/tls-keygen{{/if}}
470
+ {{/if}}
471
+
472
+ {{#if logRedirect}}
473
+
474
+ LABEL tee.launch_policy.log_redirect={{logRedirect}}
475
+ {{/if}}
476
+ {{#if resourceUsageAllow}}
477
+
478
+ LABEL tee.launch_policy.monitoring_memory_allow={{resourceUsageAllow}}
479
+ {{/if}}
480
+
481
+ LABEL eigenx_cli_version={{ecloudCLIVersion}}
482
+ LABEL eigenx_vm_image=eigen
483
+
484
+ {{#if includeTLS}}
485
+ # Expose both HTTP and HTTPS ports for Caddy
486
+ EXPOSE 80 443
487
+ {{/if}}
488
+
489
+ ENTRYPOINT ["/usr/local/bin/compute-source-env.sh"]
490
+ CMD {{{originalCmd}}}
491
+ `;
425
492
 
426
493
  // src/client/common/templates/dockerfileTemplate.ts
427
494
  function processDockerfileTemplate(data) {
@@ -438,7 +505,7 @@ echo "compute-source-env.sh: Running setup script..."
438
505
 
439
506
  # Fetch and source environment variables from KMS
440
507
  echo "Fetching secrets from KMS..."
441
- if /usr/local/bin/kms-client \\
508
+ if SSL_CERT_FILE=/usr/local/share/eigenx-ca-certs.crt /usr/local/bin/kms-client \\
442
509
  --kms-server-url "{{kmsServerURL}}" \\
443
510
  --kms-signing-key-file /usr/local/bin/kms-signing-public-key.pem \\
444
511
  --userapi-url "{{userAPIURL}}" \\
@@ -496,7 +563,8 @@ setup_tls() {
496
563
 
497
564
  echo "compute-source-env.sh: Obtaining TLS certificate using $challenge challenge..."
498
565
  # Pass the API URL for certificate persistence
499
- if ! MNEMONIC="$mnemonic" DOMAIN="$domain" API_URL="{{userAPIURL}}" /usr/local/bin/tls-keygen \\
566
+ if ! SSL_CERT_FILE=/usr/local/share/eigenx-ca-certs.crt \\
567
+ MNEMONIC="$mnemonic" DOMAIN="$domain" API_URL="{{userAPIURL}}" /usr/local/bin/tls-keygen \\
500
568
  -challenge "$challenge" \\
501
569
  $staging_flag; then
502
570
  echo "compute-source-env.sh: ERROR - Failed to obtain TLS certificate"
@@ -888,16 +956,7 @@ async function extractDigestFromSinglePlatform(manifest, imageRef) {
888
956
  architecture: inspectData[0].Architecture
889
957
  } : null;
890
958
  if (!config) {
891
- if (manifest.config?.digest) {
892
- const digest = hexStringToBytes32(manifest.config.digest);
893
- const registry = extractRegistryName(imageRef);
894
- return {
895
- digest,
896
- registry,
897
- platform: DOCKER_PLATFORM
898
- };
899
- }
900
- throw new Error(`Could not determine platform for ${imageRef}`);
959
+ throw createPlatformErrorMessage(imageRef, ["unknown (could not determine architecture)"]);
901
960
  }
902
961
  const platform2 = `${config.os}/${config.architecture}`;
903
962
  if (platform2 === DOCKER_PLATFORM) {
@@ -969,14 +1028,11 @@ Image: ${imageRef}
969
1028
  Found platform(s): ${platforms.join(", ")}
970
1029
  Required platform: ${DOCKER_PLATFORM}
971
1030
 
972
- To fix this issue:
973
- 1. Manual fix:
974
- a. Rebuild your image with the correct platform:
975
- docker build --platform ${DOCKER_PLATFORM} -t ${imageRef} .
976
- b. Push the rebuilt image to your remote registry:
977
- docker push ${imageRef}
978
-
979
- 2. Or use the SDK to build with the correct platform automatically.`;
1031
+ To fix, either:
1032
+ 1. Rebuild the image for ${DOCKER_PLATFORM} and push it:
1033
+ docker buildx build --platform ${DOCKER_PLATFORM} -t ${imageRef} --push .
1034
+ 2. Or use a verifiable build (--verifiable --repo <repo> --commit <sha>), which
1035
+ builds server-side and needs no local Docker.`;
980
1036
  return new Error(errorMsg);
981
1037
  }
982
1038
 
@@ -1081,6 +1137,8 @@ async function prepareRelease(options, logger) {
1081
1137
  logger.info(`Waiting ${REGISTRY_PROPAGATION_WAIT_SECONDS} seconds for registry propagation...`);
1082
1138
  await new Promise((resolve2) => setTimeout(resolve2, REGISTRY_PROPAGATION_WAIT_SECONDS * 1e3));
1083
1139
  } else {
1140
+ logger.info("Verifying image platform (linux/amd64)...");
1141
+ await getImageDigestAndName(imageRef);
1084
1142
  logger.info("Checking if image needs layering...");
1085
1143
  finalImageRef = await layerRemoteImageIfNeeded(
1086
1144
  {
@@ -1239,6 +1297,13 @@ function extractRegistryNameNoDocker(imageRef) {
1239
1297
  import { encodeFunctionData, encodeAbiParameters, decodeErrorResult } from "viem";
1240
1298
 
1241
1299
  // src/client/common/types/index.ts
1300
+ var EMPTY_CONTAINER_POLICY = {
1301
+ args: [],
1302
+ cmdOverride: [],
1303
+ env: [],
1304
+ envOverride: [],
1305
+ restartPolicy: ""
1306
+ };
1242
1307
  var noopLogger = {
1243
1308
  debug: () => {
1244
1309
  },
@@ -2479,32 +2544,1577 @@ async function executeBatch(options, logger = noopLogger) {
2479
2544
  } else {
2480
2545
  revertReason = callError.message || "Unknown reason";
2481
2546
  }
2482
- }
2483
- throw new Error(`Transaction reverted: ${hash}. Reason: ${revertReason}`);
2547
+ }
2548
+ throw new Error(`Transaction reverted: ${hash}. Reason: ${revertReason}`);
2549
+ }
2550
+ return hash;
2551
+ }
2552
+
2553
+ // src/client/common/contract/caller.ts
2554
+ import { encodeFunctionData as encodeFunctionData2, decodeErrorResult as decodeErrorResult2, bytesToHex } from "viem";
2555
+
2556
+ // src/client/common/utils/helpers.ts
2557
+ import { extractChain, createPublicClient, createWalletClient, http, fallback } from "viem";
2558
+ import { sepolia as sepolia2 } from "viem/chains";
2559
+ import { privateKeyToAccount } from "viem/accounts";
2560
+ function getChainFromID(chainID, fallback2 = sepolia2) {
2561
+ const id = Number(chainID);
2562
+ return extractChain({ chains: SUPPORTED_CHAINS, id }) || fallback2;
2563
+ }
2564
+ function addHexPrefix(value) {
2565
+ return value.startsWith("0x") ? value : `0x${value}`;
2566
+ }
2567
+ function stripHexPrefix(value) {
2568
+ return value.startsWith("0x") ? value.slice(2) : value;
2569
+ }
2570
+
2571
+ // src/client/common/abis/AppController.json
2572
+ var AppController_default = [
2573
+ {
2574
+ type: "constructor",
2575
+ inputs: [
2576
+ {
2577
+ name: "_version",
2578
+ type: "string",
2579
+ internalType: "string"
2580
+ },
2581
+ {
2582
+ name: "_permissionController",
2583
+ type: "address",
2584
+ internalType: "contractIPermissionController"
2585
+ },
2586
+ {
2587
+ name: "_releaseManager",
2588
+ type: "address",
2589
+ internalType: "contractIReleaseManager"
2590
+ },
2591
+ {
2592
+ name: "_computeAVSRegistrar",
2593
+ type: "address",
2594
+ internalType: "contractIComputeAVSRegistrar"
2595
+ },
2596
+ {
2597
+ name: "_computeOperator",
2598
+ type: "address",
2599
+ internalType: "contractIComputeOperator"
2600
+ },
2601
+ {
2602
+ name: "_appBeacon",
2603
+ type: "address",
2604
+ internalType: "contractIBeacon"
2605
+ }
2606
+ ],
2607
+ stateMutability: "nonpayable"
2608
+ },
2609
+ {
2610
+ type: "function",
2611
+ name: "API_PERMISSION_TYPEHASH",
2612
+ inputs: [],
2613
+ outputs: [
2614
+ {
2615
+ name: "",
2616
+ type: "bytes32",
2617
+ internalType: "bytes32"
2618
+ }
2619
+ ],
2620
+ stateMutability: "view"
2621
+ },
2622
+ {
2623
+ type: "function",
2624
+ name: "appBeacon",
2625
+ inputs: [],
2626
+ outputs: [
2627
+ {
2628
+ name: "",
2629
+ type: "address",
2630
+ internalType: "contractIBeacon"
2631
+ }
2632
+ ],
2633
+ stateMutability: "view"
2634
+ },
2635
+ {
2636
+ type: "function",
2637
+ name: "calculateApiPermissionDigestHash",
2638
+ inputs: [
2639
+ {
2640
+ name: "permission",
2641
+ type: "bytes4",
2642
+ internalType: "bytes4"
2643
+ },
2644
+ {
2645
+ name: "expiry",
2646
+ type: "uint256",
2647
+ internalType: "uint256"
2648
+ }
2649
+ ],
2650
+ outputs: [
2651
+ {
2652
+ name: "",
2653
+ type: "bytes32",
2654
+ internalType: "bytes32"
2655
+ }
2656
+ ],
2657
+ stateMutability: "view"
2658
+ },
2659
+ {
2660
+ type: "function",
2661
+ name: "calculateAppId",
2662
+ inputs: [
2663
+ {
2664
+ name: "deployer",
2665
+ type: "address",
2666
+ internalType: "address"
2667
+ },
2668
+ {
2669
+ name: "salt",
2670
+ type: "bytes32",
2671
+ internalType: "bytes32"
2672
+ }
2673
+ ],
2674
+ outputs: [
2675
+ {
2676
+ name: "",
2677
+ type: "address",
2678
+ internalType: "contractIApp"
2679
+ }
2680
+ ],
2681
+ stateMutability: "view"
2682
+ },
2683
+ {
2684
+ type: "function",
2685
+ name: "computeAVSRegistrar",
2686
+ inputs: [],
2687
+ outputs: [
2688
+ {
2689
+ name: "",
2690
+ type: "address",
2691
+ internalType: "contractIComputeAVSRegistrar"
2692
+ }
2693
+ ],
2694
+ stateMutability: "view"
2695
+ },
2696
+ {
2697
+ type: "function",
2698
+ name: "computeOperator",
2699
+ inputs: [],
2700
+ outputs: [
2701
+ {
2702
+ name: "",
2703
+ type: "address",
2704
+ internalType: "contractIComputeOperator"
2705
+ }
2706
+ ],
2707
+ stateMutability: "view"
2708
+ },
2709
+ {
2710
+ type: "function",
2711
+ name: "confirmUpgrade",
2712
+ inputs: [
2713
+ {
2714
+ name: "app",
2715
+ type: "address",
2716
+ internalType: "contractIApp"
2717
+ }
2718
+ ],
2719
+ outputs: [],
2720
+ stateMutability: "nonpayable"
2721
+ },
2722
+ {
2723
+ type: "function",
2724
+ name: "createApp",
2725
+ inputs: [
2726
+ {
2727
+ name: "salt",
2728
+ type: "bytes32",
2729
+ internalType: "bytes32"
2730
+ },
2731
+ {
2732
+ name: "release",
2733
+ type: "tuple",
2734
+ internalType: "structIAppController.Release",
2735
+ components: [
2736
+ {
2737
+ name: "rmsRelease",
2738
+ type: "tuple",
2739
+ internalType: "structIReleaseManagerTypes.Release",
2740
+ components: [
2741
+ {
2742
+ name: "artifacts",
2743
+ type: "tuple[]",
2744
+ internalType: "structIReleaseManagerTypes.Artifact[]",
2745
+ components: [
2746
+ {
2747
+ name: "digest",
2748
+ type: "bytes32",
2749
+ internalType: "bytes32"
2750
+ },
2751
+ {
2752
+ name: "registry",
2753
+ type: "string",
2754
+ internalType: "string"
2755
+ }
2756
+ ]
2757
+ },
2758
+ {
2759
+ name: "upgradeByTime",
2760
+ type: "uint32",
2761
+ internalType: "uint32"
2762
+ }
2763
+ ]
2764
+ },
2765
+ {
2766
+ name: "publicEnv",
2767
+ type: "bytes",
2768
+ internalType: "bytes"
2769
+ },
2770
+ {
2771
+ name: "encryptedEnv",
2772
+ type: "bytes",
2773
+ internalType: "bytes"
2774
+ },
2775
+ {
2776
+ name: "containerPolicy",
2777
+ type: "tuple",
2778
+ internalType: "structIAppController.ContainerPolicy",
2779
+ components: [
2780
+ {
2781
+ name: "args",
2782
+ type: "string[]",
2783
+ internalType: "string[]"
2784
+ },
2785
+ {
2786
+ name: "cmdOverride",
2787
+ type: "string[]",
2788
+ internalType: "string[]"
2789
+ },
2790
+ {
2791
+ name: "env",
2792
+ type: "tuple[]",
2793
+ internalType: "structIAppController.EnvVar[]",
2794
+ components: [
2795
+ {
2796
+ name: "key",
2797
+ type: "string",
2798
+ internalType: "string"
2799
+ },
2800
+ {
2801
+ name: "value",
2802
+ type: "string",
2803
+ internalType: "string"
2804
+ }
2805
+ ]
2806
+ },
2807
+ {
2808
+ name: "envOverride",
2809
+ type: "tuple[]",
2810
+ internalType: "structIAppController.EnvVar[]",
2811
+ components: [
2812
+ {
2813
+ name: "key",
2814
+ type: "string",
2815
+ internalType: "string"
2816
+ },
2817
+ {
2818
+ name: "value",
2819
+ type: "string",
2820
+ internalType: "string"
2821
+ }
2822
+ ]
2823
+ },
2824
+ {
2825
+ name: "restartPolicy",
2826
+ type: "string",
2827
+ internalType: "string"
2828
+ }
2829
+ ]
2830
+ }
2831
+ ]
2832
+ }
2833
+ ],
2834
+ outputs: [
2835
+ {
2836
+ name: "app",
2837
+ type: "address",
2838
+ internalType: "contractIApp"
2839
+ }
2840
+ ],
2841
+ stateMutability: "nonpayable"
2842
+ },
2843
+ {
2844
+ type: "function",
2845
+ name: "createAppWithIsolatedBilling",
2846
+ inputs: [
2847
+ {
2848
+ name: "salt",
2849
+ type: "bytes32",
2850
+ internalType: "bytes32"
2851
+ },
2852
+ {
2853
+ name: "release",
2854
+ type: "tuple",
2855
+ internalType: "structIAppController.Release",
2856
+ components: [
2857
+ {
2858
+ name: "rmsRelease",
2859
+ type: "tuple",
2860
+ internalType: "structIReleaseManagerTypes.Release",
2861
+ components: [
2862
+ {
2863
+ name: "artifacts",
2864
+ type: "tuple[]",
2865
+ internalType: "structIReleaseManagerTypes.Artifact[]",
2866
+ components: [
2867
+ {
2868
+ name: "digest",
2869
+ type: "bytes32",
2870
+ internalType: "bytes32"
2871
+ },
2872
+ {
2873
+ name: "registry",
2874
+ type: "string",
2875
+ internalType: "string"
2876
+ }
2877
+ ]
2878
+ },
2879
+ {
2880
+ name: "upgradeByTime",
2881
+ type: "uint32",
2882
+ internalType: "uint32"
2883
+ }
2884
+ ]
2885
+ },
2886
+ {
2887
+ name: "publicEnv",
2888
+ type: "bytes",
2889
+ internalType: "bytes"
2890
+ },
2891
+ {
2892
+ name: "encryptedEnv",
2893
+ type: "bytes",
2894
+ internalType: "bytes"
2895
+ },
2896
+ {
2897
+ name: "containerPolicy",
2898
+ type: "tuple",
2899
+ internalType: "structIAppController.ContainerPolicy",
2900
+ components: [
2901
+ {
2902
+ name: "args",
2903
+ type: "string[]",
2904
+ internalType: "string[]"
2905
+ },
2906
+ {
2907
+ name: "cmdOverride",
2908
+ type: "string[]",
2909
+ internalType: "string[]"
2910
+ },
2911
+ {
2912
+ name: "env",
2913
+ type: "tuple[]",
2914
+ internalType: "structIAppController.EnvVar[]",
2915
+ components: [
2916
+ {
2917
+ name: "key",
2918
+ type: "string",
2919
+ internalType: "string"
2920
+ },
2921
+ {
2922
+ name: "value",
2923
+ type: "string",
2924
+ internalType: "string"
2925
+ }
2926
+ ]
2927
+ },
2928
+ {
2929
+ name: "envOverride",
2930
+ type: "tuple[]",
2931
+ internalType: "structIAppController.EnvVar[]",
2932
+ components: [
2933
+ {
2934
+ name: "key",
2935
+ type: "string",
2936
+ internalType: "string"
2937
+ },
2938
+ {
2939
+ name: "value",
2940
+ type: "string",
2941
+ internalType: "string"
2942
+ }
2943
+ ]
2944
+ },
2945
+ {
2946
+ name: "restartPolicy",
2947
+ type: "string",
2948
+ internalType: "string"
2949
+ }
2950
+ ]
2951
+ }
2952
+ ]
2953
+ }
2954
+ ],
2955
+ outputs: [
2956
+ {
2957
+ name: "app",
2958
+ type: "address",
2959
+ internalType: "contractIApp"
2960
+ }
2961
+ ],
2962
+ stateMutability: "nonpayable"
2963
+ },
2964
+ {
2965
+ type: "function",
2966
+ name: "createEmptyApp",
2967
+ inputs: [
2968
+ {
2969
+ name: "salt",
2970
+ type: "bytes32",
2971
+ internalType: "bytes32"
2972
+ }
2973
+ ],
2974
+ outputs: [
2975
+ {
2976
+ name: "app",
2977
+ type: "address",
2978
+ internalType: "contractIApp"
2979
+ }
2980
+ ],
2981
+ stateMutability: "nonpayable"
2982
+ },
2983
+ {
2984
+ type: "function",
2985
+ name: "createEmptyAppWithIsolatedBilling",
2986
+ inputs: [
2987
+ {
2988
+ name: "salt",
2989
+ type: "bytes32",
2990
+ internalType: "bytes32"
2991
+ }
2992
+ ],
2993
+ outputs: [
2994
+ {
2995
+ name: "app",
2996
+ type: "address",
2997
+ internalType: "contractIApp"
2998
+ }
2999
+ ],
3000
+ stateMutability: "nonpayable"
3001
+ },
3002
+ {
3003
+ type: "function",
3004
+ name: "domainSeparator",
3005
+ inputs: [],
3006
+ outputs: [
3007
+ {
3008
+ name: "",
3009
+ type: "bytes32",
3010
+ internalType: "bytes32"
3011
+ }
3012
+ ],
3013
+ stateMutability: "view"
3014
+ },
3015
+ {
3016
+ type: "function",
3017
+ name: "getActiveAppCount",
3018
+ inputs: [
3019
+ {
3020
+ name: "user",
3021
+ type: "address",
3022
+ internalType: "address"
3023
+ }
3024
+ ],
3025
+ outputs: [
3026
+ {
3027
+ name: "",
3028
+ type: "uint32",
3029
+ internalType: "uint32"
3030
+ }
3031
+ ],
3032
+ stateMutability: "view"
3033
+ },
3034
+ {
3035
+ type: "function",
3036
+ name: "getAppCreator",
3037
+ inputs: [
3038
+ {
3039
+ name: "app",
3040
+ type: "address",
3041
+ internalType: "contractIApp"
3042
+ }
3043
+ ],
3044
+ outputs: [
3045
+ {
3046
+ name: "",
3047
+ type: "address",
3048
+ internalType: "address"
3049
+ }
3050
+ ],
3051
+ stateMutability: "view"
3052
+ },
3053
+ {
3054
+ type: "function",
3055
+ name: "getAppLatestReleaseBlockNumber",
3056
+ inputs: [
3057
+ {
3058
+ name: "app",
3059
+ type: "address",
3060
+ internalType: "contractIApp"
3061
+ }
3062
+ ],
3063
+ outputs: [
3064
+ {
3065
+ name: "",
3066
+ type: "uint32",
3067
+ internalType: "uint32"
3068
+ }
3069
+ ],
3070
+ stateMutability: "view"
3071
+ },
3072
+ {
3073
+ type: "function",
3074
+ name: "getAppOperatorSetId",
3075
+ inputs: [
3076
+ {
3077
+ name: "app",
3078
+ type: "address",
3079
+ internalType: "contractIApp"
3080
+ }
3081
+ ],
3082
+ outputs: [
3083
+ {
3084
+ name: "",
3085
+ type: "uint32",
3086
+ internalType: "uint32"
3087
+ }
3088
+ ],
3089
+ stateMutability: "view"
3090
+ },
3091
+ {
3092
+ type: "function",
3093
+ name: "getAppPendingReleaseBlockNumber",
3094
+ inputs: [
3095
+ {
3096
+ name: "app",
3097
+ type: "address",
3098
+ internalType: "contractIApp"
3099
+ }
3100
+ ],
3101
+ outputs: [
3102
+ {
3103
+ name: "",
3104
+ type: "uint32",
3105
+ internalType: "uint32"
3106
+ }
3107
+ ],
3108
+ stateMutability: "view"
3109
+ },
3110
+ {
3111
+ type: "function",
3112
+ name: "getAppStatus",
3113
+ inputs: [
3114
+ {
3115
+ name: "app",
3116
+ type: "address",
3117
+ internalType: "contractIApp"
3118
+ }
3119
+ ],
3120
+ outputs: [
3121
+ {
3122
+ name: "",
3123
+ type: "uint8",
3124
+ internalType: "enumIAppController.AppStatus"
3125
+ }
3126
+ ],
3127
+ stateMutability: "view"
3128
+ },
3129
+ {
3130
+ type: "function",
3131
+ name: "getApps",
3132
+ inputs: [
3133
+ {
3134
+ name: "offset",
3135
+ type: "uint256",
3136
+ internalType: "uint256"
3137
+ },
3138
+ {
3139
+ name: "limit",
3140
+ type: "uint256",
3141
+ internalType: "uint256"
3142
+ }
3143
+ ],
3144
+ outputs: [
3145
+ {
3146
+ name: "apps",
3147
+ type: "address[]",
3148
+ internalType: "contractIApp[]"
3149
+ },
3150
+ {
3151
+ name: "appConfigsMem",
3152
+ type: "tuple[]",
3153
+ internalType: "structIAppController.AppConfig[]",
3154
+ components: [
3155
+ {
3156
+ name: "creator",
3157
+ type: "address",
3158
+ internalType: "address"
3159
+ },
3160
+ {
3161
+ name: "operatorSetId",
3162
+ type: "uint32",
3163
+ internalType: "uint32"
3164
+ },
3165
+ {
3166
+ name: "latestReleaseBlockNumber",
3167
+ type: "uint32",
3168
+ internalType: "uint32"
3169
+ },
3170
+ {
3171
+ name: "pendingReleaseBlockNumber",
3172
+ type: "uint32",
3173
+ internalType: "uint32"
3174
+ },
3175
+ {
3176
+ name: "status",
3177
+ type: "uint8",
3178
+ internalType: "enumIAppController.AppStatus"
3179
+ }
3180
+ ]
3181
+ }
3182
+ ],
3183
+ stateMutability: "view"
3184
+ },
3185
+ {
3186
+ type: "function",
3187
+ name: "getAppsByBillingAccount",
3188
+ inputs: [
3189
+ {
3190
+ name: "account",
3191
+ type: "address",
3192
+ internalType: "address"
3193
+ },
3194
+ {
3195
+ name: "offset",
3196
+ type: "uint256",
3197
+ internalType: "uint256"
3198
+ },
3199
+ {
3200
+ name: "limit",
3201
+ type: "uint256",
3202
+ internalType: "uint256"
3203
+ }
3204
+ ],
3205
+ outputs: [
3206
+ {
3207
+ name: "apps",
3208
+ type: "address[]",
3209
+ internalType: "contractIApp[]"
3210
+ },
3211
+ {
3212
+ name: "appConfigsMem",
3213
+ type: "tuple[]",
3214
+ internalType: "structIAppController.AppConfig[]",
3215
+ components: [
3216
+ {
3217
+ name: "creator",
3218
+ type: "address",
3219
+ internalType: "address"
3220
+ },
3221
+ {
3222
+ name: "operatorSetId",
3223
+ type: "uint32",
3224
+ internalType: "uint32"
3225
+ },
3226
+ {
3227
+ name: "latestReleaseBlockNumber",
3228
+ type: "uint32",
3229
+ internalType: "uint32"
3230
+ },
3231
+ {
3232
+ name: "pendingReleaseBlockNumber",
3233
+ type: "uint32",
3234
+ internalType: "uint32"
3235
+ },
3236
+ {
3237
+ name: "status",
3238
+ type: "uint8",
3239
+ internalType: "enumIAppController.AppStatus"
3240
+ }
3241
+ ]
3242
+ }
3243
+ ],
3244
+ stateMutability: "view"
3245
+ },
3246
+ {
3247
+ type: "function",
3248
+ name: "getAppsByCreator",
3249
+ inputs: [
3250
+ {
3251
+ name: "creator",
3252
+ type: "address",
3253
+ internalType: "address"
3254
+ },
3255
+ {
3256
+ name: "offset",
3257
+ type: "uint256",
3258
+ internalType: "uint256"
3259
+ },
3260
+ {
3261
+ name: "limit",
3262
+ type: "uint256",
3263
+ internalType: "uint256"
3264
+ }
3265
+ ],
3266
+ outputs: [
3267
+ {
3268
+ name: "apps",
3269
+ type: "address[]",
3270
+ internalType: "contractIApp[]"
3271
+ },
3272
+ {
3273
+ name: "appConfigsMem",
3274
+ type: "tuple[]",
3275
+ internalType: "structIAppController.AppConfig[]",
3276
+ components: [
3277
+ {
3278
+ name: "creator",
3279
+ type: "address",
3280
+ internalType: "address"
3281
+ },
3282
+ {
3283
+ name: "operatorSetId",
3284
+ type: "uint32",
3285
+ internalType: "uint32"
3286
+ },
3287
+ {
3288
+ name: "latestReleaseBlockNumber",
3289
+ type: "uint32",
3290
+ internalType: "uint32"
3291
+ },
3292
+ {
3293
+ name: "pendingReleaseBlockNumber",
3294
+ type: "uint32",
3295
+ internalType: "uint32"
3296
+ },
3297
+ {
3298
+ name: "status",
3299
+ type: "uint8",
3300
+ internalType: "enumIAppController.AppStatus"
3301
+ }
3302
+ ]
3303
+ }
3304
+ ],
3305
+ stateMutability: "view"
3306
+ },
3307
+ {
3308
+ type: "function",
3309
+ name: "getAppsByDeveloper",
3310
+ inputs: [
3311
+ {
3312
+ name: "developer",
3313
+ type: "address",
3314
+ internalType: "address"
3315
+ },
3316
+ {
3317
+ name: "offset",
3318
+ type: "uint256",
3319
+ internalType: "uint256"
3320
+ },
3321
+ {
3322
+ name: "limit",
3323
+ type: "uint256",
3324
+ internalType: "uint256"
3325
+ }
3326
+ ],
3327
+ outputs: [
3328
+ {
3329
+ name: "apps",
3330
+ type: "address[]",
3331
+ internalType: "contractIApp[]"
3332
+ },
3333
+ {
3334
+ name: "appConfigsMem",
3335
+ type: "tuple[]",
3336
+ internalType: "structIAppController.AppConfig[]",
3337
+ components: [
3338
+ {
3339
+ name: "creator",
3340
+ type: "address",
3341
+ internalType: "address"
3342
+ },
3343
+ {
3344
+ name: "operatorSetId",
3345
+ type: "uint32",
3346
+ internalType: "uint32"
3347
+ },
3348
+ {
3349
+ name: "latestReleaseBlockNumber",
3350
+ type: "uint32",
3351
+ internalType: "uint32"
3352
+ },
3353
+ {
3354
+ name: "pendingReleaseBlockNumber",
3355
+ type: "uint32",
3356
+ internalType: "uint32"
3357
+ },
3358
+ {
3359
+ name: "status",
3360
+ type: "uint8",
3361
+ internalType: "enumIAppController.AppStatus"
3362
+ }
3363
+ ]
3364
+ }
3365
+ ],
3366
+ stateMutability: "view"
3367
+ },
3368
+ {
3369
+ type: "function",
3370
+ name: "getBillingAccount",
3371
+ inputs: [
3372
+ {
3373
+ name: "app",
3374
+ type: "address",
3375
+ internalType: "contractIApp"
3376
+ }
3377
+ ],
3378
+ outputs: [
3379
+ {
3380
+ name: "",
3381
+ type: "address",
3382
+ internalType: "address"
3383
+ }
3384
+ ],
3385
+ stateMutability: "view"
3386
+ },
3387
+ {
3388
+ type: "function",
3389
+ name: "getBillingType",
3390
+ inputs: [
3391
+ {
3392
+ name: "app",
3393
+ type: "address",
3394
+ internalType: "contractIApp"
3395
+ }
3396
+ ],
3397
+ outputs: [
3398
+ {
3399
+ name: "",
3400
+ type: "uint8",
3401
+ internalType: "enumIAppController.BillingType"
3402
+ }
3403
+ ],
3404
+ stateMutability: "view"
3405
+ },
3406
+ {
3407
+ type: "function",
3408
+ name: "getMaxActiveAppsPerUser",
3409
+ inputs: [
3410
+ {
3411
+ name: "user",
3412
+ type: "address",
3413
+ internalType: "address"
3414
+ }
3415
+ ],
3416
+ outputs: [
3417
+ {
3418
+ name: "",
3419
+ type: "uint32",
3420
+ internalType: "uint32"
3421
+ }
3422
+ ],
3423
+ stateMutability: "view"
3424
+ },
3425
+ {
3426
+ type: "function",
3427
+ name: "globalActiveAppCount",
3428
+ inputs: [],
3429
+ outputs: [
3430
+ {
3431
+ name: "",
3432
+ type: "uint32",
3433
+ internalType: "uint32"
3434
+ }
3435
+ ],
3436
+ stateMutability: "view"
3437
+ },
3438
+ {
3439
+ type: "function",
3440
+ name: "initialize",
3441
+ inputs: [
3442
+ {
3443
+ name: "admin",
3444
+ type: "address",
3445
+ internalType: "address"
3446
+ }
3447
+ ],
3448
+ outputs: [],
3449
+ stateMutability: "nonpayable"
3450
+ },
3451
+ {
3452
+ type: "function",
3453
+ name: "maxGlobalActiveApps",
3454
+ inputs: [],
3455
+ outputs: [
3456
+ {
3457
+ name: "",
3458
+ type: "uint32",
3459
+ internalType: "uint32"
3460
+ }
3461
+ ],
3462
+ stateMutability: "view"
3463
+ },
3464
+ {
3465
+ type: "function",
3466
+ name: "permissionController",
3467
+ inputs: [],
3468
+ outputs: [
3469
+ {
3470
+ name: "",
3471
+ type: "address",
3472
+ internalType: "contractIPermissionController"
3473
+ }
3474
+ ],
3475
+ stateMutability: "view"
3476
+ },
3477
+ {
3478
+ type: "function",
3479
+ name: "releaseManager",
3480
+ inputs: [],
3481
+ outputs: [
3482
+ {
3483
+ name: "",
3484
+ type: "address",
3485
+ internalType: "contractIReleaseManager"
3486
+ }
3487
+ ],
3488
+ stateMutability: "view"
3489
+ },
3490
+ {
3491
+ type: "function",
3492
+ name: "setMaxActiveAppsPerUser",
3493
+ inputs: [
3494
+ {
3495
+ name: "user",
3496
+ type: "address",
3497
+ internalType: "address"
3498
+ },
3499
+ {
3500
+ name: "limit",
3501
+ type: "uint32",
3502
+ internalType: "uint32"
3503
+ }
3504
+ ],
3505
+ outputs: [],
3506
+ stateMutability: "nonpayable"
3507
+ },
3508
+ {
3509
+ type: "function",
3510
+ name: "setMaxGlobalActiveApps",
3511
+ inputs: [
3512
+ {
3513
+ name: "limit",
3514
+ type: "uint32",
3515
+ internalType: "uint32"
3516
+ }
3517
+ ],
3518
+ outputs: [],
3519
+ stateMutability: "nonpayable"
3520
+ },
3521
+ {
3522
+ type: "function",
3523
+ name: "startApp",
3524
+ inputs: [
3525
+ {
3526
+ name: "app",
3527
+ type: "address",
3528
+ internalType: "contractIApp"
3529
+ }
3530
+ ],
3531
+ outputs: [],
3532
+ stateMutability: "nonpayable"
3533
+ },
3534
+ {
3535
+ type: "function",
3536
+ name: "stopApp",
3537
+ inputs: [
3538
+ {
3539
+ name: "app",
3540
+ type: "address",
3541
+ internalType: "contractIApp"
3542
+ }
3543
+ ],
3544
+ outputs: [],
3545
+ stateMutability: "nonpayable"
3546
+ },
3547
+ {
3548
+ type: "function",
3549
+ name: "suspend",
3550
+ inputs: [
3551
+ {
3552
+ name: "account",
3553
+ type: "address",
3554
+ internalType: "address"
3555
+ },
3556
+ {
3557
+ name: "apps",
3558
+ type: "address[]",
3559
+ internalType: "contractIApp[]"
3560
+ }
3561
+ ],
3562
+ outputs: [],
3563
+ stateMutability: "nonpayable"
3564
+ },
3565
+ {
3566
+ type: "function",
3567
+ name: "terminateApp",
3568
+ inputs: [
3569
+ {
3570
+ name: "app",
3571
+ type: "address",
3572
+ internalType: "contractIApp"
3573
+ }
3574
+ ],
3575
+ outputs: [],
3576
+ stateMutability: "nonpayable"
3577
+ },
3578
+ {
3579
+ type: "function",
3580
+ name: "terminateAppByAdmin",
3581
+ inputs: [
3582
+ {
3583
+ name: "app",
3584
+ type: "address",
3585
+ internalType: "contractIApp"
3586
+ }
3587
+ ],
3588
+ outputs: [],
3589
+ stateMutability: "nonpayable"
3590
+ },
3591
+ {
3592
+ type: "function",
3593
+ name: "updateAppMetadataURI",
3594
+ inputs: [
3595
+ {
3596
+ name: "app",
3597
+ type: "address",
3598
+ internalType: "contractIApp"
3599
+ },
3600
+ {
3601
+ name: "metadataURI",
3602
+ type: "string",
3603
+ internalType: "string"
3604
+ }
3605
+ ],
3606
+ outputs: [],
3607
+ stateMutability: "nonpayable"
3608
+ },
3609
+ {
3610
+ type: "function",
3611
+ name: "upgradeApp",
3612
+ inputs: [
3613
+ {
3614
+ name: "app",
3615
+ type: "address",
3616
+ internalType: "contractIApp"
3617
+ },
3618
+ {
3619
+ name: "release",
3620
+ type: "tuple",
3621
+ internalType: "structIAppController.Release",
3622
+ components: [
3623
+ {
3624
+ name: "rmsRelease",
3625
+ type: "tuple",
3626
+ internalType: "structIReleaseManagerTypes.Release",
3627
+ components: [
3628
+ {
3629
+ name: "artifacts",
3630
+ type: "tuple[]",
3631
+ internalType: "structIReleaseManagerTypes.Artifact[]",
3632
+ components: [
3633
+ {
3634
+ name: "digest",
3635
+ type: "bytes32",
3636
+ internalType: "bytes32"
3637
+ },
3638
+ {
3639
+ name: "registry",
3640
+ type: "string",
3641
+ internalType: "string"
3642
+ }
3643
+ ]
3644
+ },
3645
+ {
3646
+ name: "upgradeByTime",
3647
+ type: "uint32",
3648
+ internalType: "uint32"
3649
+ }
3650
+ ]
3651
+ },
3652
+ {
3653
+ name: "publicEnv",
3654
+ type: "bytes",
3655
+ internalType: "bytes"
3656
+ },
3657
+ {
3658
+ name: "encryptedEnv",
3659
+ type: "bytes",
3660
+ internalType: "bytes"
3661
+ },
3662
+ {
3663
+ name: "containerPolicy",
3664
+ type: "tuple",
3665
+ internalType: "structIAppController.ContainerPolicy",
3666
+ components: [
3667
+ {
3668
+ name: "args",
3669
+ type: "string[]",
3670
+ internalType: "string[]"
3671
+ },
3672
+ {
3673
+ name: "cmdOverride",
3674
+ type: "string[]",
3675
+ internalType: "string[]"
3676
+ },
3677
+ {
3678
+ name: "env",
3679
+ type: "tuple[]",
3680
+ internalType: "structIAppController.EnvVar[]",
3681
+ components: [
3682
+ {
3683
+ name: "key",
3684
+ type: "string",
3685
+ internalType: "string"
3686
+ },
3687
+ {
3688
+ name: "value",
3689
+ type: "string",
3690
+ internalType: "string"
3691
+ }
3692
+ ]
3693
+ },
3694
+ {
3695
+ name: "envOverride",
3696
+ type: "tuple[]",
3697
+ internalType: "structIAppController.EnvVar[]",
3698
+ components: [
3699
+ {
3700
+ name: "key",
3701
+ type: "string",
3702
+ internalType: "string"
3703
+ },
3704
+ {
3705
+ name: "value",
3706
+ type: "string",
3707
+ internalType: "string"
3708
+ }
3709
+ ]
3710
+ },
3711
+ {
3712
+ name: "restartPolicy",
3713
+ type: "string",
3714
+ internalType: "string"
3715
+ }
3716
+ ]
3717
+ }
3718
+ ]
3719
+ }
3720
+ ],
3721
+ outputs: [
3722
+ {
3723
+ name: "",
3724
+ type: "uint256",
3725
+ internalType: "uint256"
3726
+ }
3727
+ ],
3728
+ stateMutability: "nonpayable"
3729
+ },
3730
+ {
3731
+ type: "function",
3732
+ name: "version",
3733
+ inputs: [],
3734
+ outputs: [
3735
+ {
3736
+ name: "",
3737
+ type: "string",
3738
+ internalType: "string"
3739
+ }
3740
+ ],
3741
+ stateMutability: "view"
3742
+ },
3743
+ {
3744
+ type: "event",
3745
+ name: "AppCreated",
3746
+ inputs: [
3747
+ {
3748
+ name: "creator",
3749
+ type: "address",
3750
+ indexed: true,
3751
+ internalType: "address"
3752
+ },
3753
+ {
3754
+ name: "app",
3755
+ type: "address",
3756
+ indexed: true,
3757
+ internalType: "contractIApp"
3758
+ },
3759
+ {
3760
+ name: "operatorSetId",
3761
+ type: "uint32",
3762
+ indexed: false,
3763
+ internalType: "uint32"
3764
+ }
3765
+ ],
3766
+ anonymous: false
3767
+ },
3768
+ {
3769
+ type: "event",
3770
+ name: "AppMetadataURIUpdated",
3771
+ inputs: [
3772
+ {
3773
+ name: "app",
3774
+ type: "address",
3775
+ indexed: true,
3776
+ internalType: "contractIApp"
3777
+ },
3778
+ {
3779
+ name: "metadataURI",
3780
+ type: "string",
3781
+ indexed: false,
3782
+ internalType: "string"
3783
+ }
3784
+ ],
3785
+ anonymous: false
3786
+ },
3787
+ {
3788
+ type: "event",
3789
+ name: "AppStarted",
3790
+ inputs: [
3791
+ {
3792
+ name: "app",
3793
+ type: "address",
3794
+ indexed: true,
3795
+ internalType: "contractIApp"
3796
+ }
3797
+ ],
3798
+ anonymous: false
3799
+ },
3800
+ {
3801
+ type: "event",
3802
+ name: "AppStopped",
3803
+ inputs: [
3804
+ {
3805
+ name: "app",
3806
+ type: "address",
3807
+ indexed: true,
3808
+ internalType: "contractIApp"
3809
+ }
3810
+ ],
3811
+ anonymous: false
3812
+ },
3813
+ {
3814
+ type: "event",
3815
+ name: "AppSuspended",
3816
+ inputs: [
3817
+ {
3818
+ name: "app",
3819
+ type: "address",
3820
+ indexed: true,
3821
+ internalType: "contractIApp"
3822
+ }
3823
+ ],
3824
+ anonymous: false
3825
+ },
3826
+ {
3827
+ type: "event",
3828
+ name: "AppTerminated",
3829
+ inputs: [
3830
+ {
3831
+ name: "app",
3832
+ type: "address",
3833
+ indexed: true,
3834
+ internalType: "contractIApp"
3835
+ }
3836
+ ],
3837
+ anonymous: false
3838
+ },
3839
+ {
3840
+ type: "event",
3841
+ name: "AppTerminatedByAdmin",
3842
+ inputs: [
3843
+ {
3844
+ name: "app",
3845
+ type: "address",
3846
+ indexed: true,
3847
+ internalType: "contractIApp"
3848
+ }
3849
+ ],
3850
+ anonymous: false
3851
+ },
3852
+ {
3853
+ type: "event",
3854
+ name: "AppUpgraded",
3855
+ inputs: [
3856
+ {
3857
+ name: "app",
3858
+ type: "address",
3859
+ indexed: true,
3860
+ internalType: "contractIApp"
3861
+ },
3862
+ {
3863
+ name: "rmsReleaseId",
3864
+ type: "uint256",
3865
+ indexed: false,
3866
+ internalType: "uint256"
3867
+ },
3868
+ {
3869
+ name: "release",
3870
+ type: "tuple",
3871
+ indexed: false,
3872
+ internalType: "structIAppController.Release",
3873
+ components: [
3874
+ {
3875
+ name: "rmsRelease",
3876
+ type: "tuple",
3877
+ internalType: "structIReleaseManagerTypes.Release",
3878
+ components: [
3879
+ {
3880
+ name: "artifacts",
3881
+ type: "tuple[]",
3882
+ internalType: "structIReleaseManagerTypes.Artifact[]",
3883
+ components: [
3884
+ {
3885
+ name: "digest",
3886
+ type: "bytes32",
3887
+ internalType: "bytes32"
3888
+ },
3889
+ {
3890
+ name: "registry",
3891
+ type: "string",
3892
+ internalType: "string"
3893
+ }
3894
+ ]
3895
+ },
3896
+ {
3897
+ name: "upgradeByTime",
3898
+ type: "uint32",
3899
+ internalType: "uint32"
3900
+ }
3901
+ ]
3902
+ },
3903
+ {
3904
+ name: "publicEnv",
3905
+ type: "bytes",
3906
+ internalType: "bytes"
3907
+ },
3908
+ {
3909
+ name: "encryptedEnv",
3910
+ type: "bytes",
3911
+ internalType: "bytes"
3912
+ },
3913
+ {
3914
+ name: "containerPolicy",
3915
+ type: "tuple",
3916
+ internalType: "structIAppController.ContainerPolicy",
3917
+ components: [
3918
+ {
3919
+ name: "args",
3920
+ type: "string[]",
3921
+ internalType: "string[]"
3922
+ },
3923
+ {
3924
+ name: "cmdOverride",
3925
+ type: "string[]",
3926
+ internalType: "string[]"
3927
+ },
3928
+ {
3929
+ name: "env",
3930
+ type: "tuple[]",
3931
+ internalType: "structIAppController.EnvVar[]",
3932
+ components: [
3933
+ {
3934
+ name: "key",
3935
+ type: "string",
3936
+ internalType: "string"
3937
+ },
3938
+ {
3939
+ name: "value",
3940
+ type: "string",
3941
+ internalType: "string"
3942
+ }
3943
+ ]
3944
+ },
3945
+ {
3946
+ name: "envOverride",
3947
+ type: "tuple[]",
3948
+ internalType: "structIAppController.EnvVar[]",
3949
+ components: [
3950
+ {
3951
+ name: "key",
3952
+ type: "string",
3953
+ internalType: "string"
3954
+ },
3955
+ {
3956
+ name: "value",
3957
+ type: "string",
3958
+ internalType: "string"
3959
+ }
3960
+ ]
3961
+ },
3962
+ {
3963
+ name: "restartPolicy",
3964
+ type: "string",
3965
+ internalType: "string"
3966
+ }
3967
+ ]
3968
+ }
3969
+ ]
3970
+ }
3971
+ ],
3972
+ anonymous: false
3973
+ },
3974
+ {
3975
+ type: "event",
3976
+ name: "GlobalMaxActiveAppsSet",
3977
+ inputs: [
3978
+ {
3979
+ name: "limit",
3980
+ type: "uint32",
3981
+ indexed: false,
3982
+ internalType: "uint32"
3983
+ }
3984
+ ],
3985
+ anonymous: false
3986
+ },
3987
+ {
3988
+ type: "event",
3989
+ name: "Initialized",
3990
+ inputs: [
3991
+ {
3992
+ name: "version",
3993
+ type: "uint8",
3994
+ indexed: false,
3995
+ internalType: "uint8"
3996
+ }
3997
+ ],
3998
+ anonymous: false
3999
+ },
4000
+ {
4001
+ type: "event",
4002
+ name: "MaxActiveAppsSet",
4003
+ inputs: [
4004
+ {
4005
+ name: "user",
4006
+ type: "address",
4007
+ indexed: true,
4008
+ internalType: "address"
4009
+ },
4010
+ {
4011
+ name: "limit",
4012
+ type: "uint32",
4013
+ indexed: false,
4014
+ internalType: "uint32"
4015
+ }
4016
+ ],
4017
+ anonymous: false
4018
+ },
4019
+ {
4020
+ type: "event",
4021
+ name: "UpgradeConfirmed",
4022
+ inputs: [
4023
+ {
4024
+ name: "app",
4025
+ type: "address",
4026
+ indexed: true,
4027
+ internalType: "contractIApp"
4028
+ },
4029
+ {
4030
+ name: "pendingReleaseBlockNumber",
4031
+ type: "uint32",
4032
+ indexed: false,
4033
+ internalType: "uint32"
4034
+ }
4035
+ ],
4036
+ anonymous: false
4037
+ },
4038
+ {
4039
+ type: "error",
4040
+ name: "AccountHasActiveApps",
4041
+ inputs: []
4042
+ },
4043
+ {
4044
+ type: "error",
4045
+ name: "AppAlreadyExists",
4046
+ inputs: []
4047
+ },
4048
+ {
4049
+ type: "error",
4050
+ name: "AppDoesNotExist",
4051
+ inputs: []
4052
+ },
4053
+ {
4054
+ type: "error",
4055
+ name: "GlobalMaxActiveAppsExceeded",
4056
+ inputs: []
4057
+ },
4058
+ {
4059
+ type: "error",
4060
+ name: "InvalidAppStatus",
4061
+ inputs: []
4062
+ },
4063
+ {
4064
+ type: "error",
4065
+ name: "InvalidPermissions",
4066
+ inputs: []
4067
+ },
4068
+ {
4069
+ type: "error",
4070
+ name: "InvalidReleaseMetadataURI",
4071
+ inputs: []
4072
+ },
4073
+ {
4074
+ type: "error",
4075
+ name: "InvalidShortString",
4076
+ inputs: []
4077
+ },
4078
+ {
4079
+ type: "error",
4080
+ name: "InvalidSignature",
4081
+ inputs: []
4082
+ },
4083
+ {
4084
+ type: "error",
4085
+ name: "MaxActiveAppsExceeded",
4086
+ inputs: []
4087
+ },
4088
+ {
4089
+ type: "error",
4090
+ name: "MoreThanOneArtifact",
4091
+ inputs: []
4092
+ },
4093
+ {
4094
+ type: "error",
4095
+ name: "NoPendingUpgrade",
4096
+ inputs: []
4097
+ },
4098
+ {
4099
+ type: "error",
4100
+ name: "SignatureExpired",
4101
+ inputs: []
4102
+ },
4103
+ {
4104
+ type: "error",
4105
+ name: "StringTooLong",
4106
+ inputs: [
4107
+ {
4108
+ name: "str",
4109
+ type: "string",
4110
+ internalType: "string"
4111
+ }
4112
+ ]
2484
4113
  }
2485
- return hash;
2486
- }
2487
-
2488
- // src/client/common/contract/caller.ts
2489
- import { encodeFunctionData as encodeFunctionData2, decodeErrorResult as decodeErrorResult2, bytesToHex } from "viem";
2490
-
2491
- // src/client/common/utils/helpers.ts
2492
- import { extractChain, createPublicClient, createWalletClient, http, fallback } from "viem";
2493
- import { sepolia as sepolia2 } from "viem/chains";
2494
- import { privateKeyToAccount } from "viem/accounts";
2495
- function getChainFromID(chainID, fallback2 = sepolia2) {
2496
- const id = Number(chainID);
2497
- return extractChain({ chains: SUPPORTED_CHAINS, id }) || fallback2;
2498
- }
2499
- function addHexPrefix(value) {
2500
- return value.startsWith("0x") ? value : `0x${value}`;
2501
- }
2502
- function stripHexPrefix(value) {
2503
- return value.startsWith("0x") ? value.slice(2) : value;
2504
- }
4114
+ ];
2505
4115
 
2506
- // src/client/common/abis/AppController.json
2507
- var AppController_default = [
4116
+ // src/client/common/abis/AppController.v1_4.json
4117
+ var AppController_v1_4_default = [
2508
4118
  {
2509
4119
  type: "constructor",
2510
4120
  inputs: [
@@ -4188,6 +5798,38 @@ var PermissionController_default = [
4188
5798
  ];
4189
5799
 
4190
5800
  // src/client/common/contract/caller.ts
5801
+ function appControllerAbiFor(environmentConfig) {
5802
+ return environmentConfig.releaseAbiVersion === "v1.4" ? AppController_v1_4_default : AppController_default;
5803
+ }
5804
+ function supportsContainerPolicy(environmentConfig) {
5805
+ return environmentConfig.releaseAbiVersion !== "v1.4";
5806
+ }
5807
+ function containerPolicyForViem(policy = EMPTY_CONTAINER_POLICY) {
5808
+ return {
5809
+ args: policy.args,
5810
+ cmdOverride: policy.cmdOverride,
5811
+ env: policy.env.map((e) => ({ key: e.key, value: e.value })),
5812
+ envOverride: policy.envOverride.map((e) => ({ key: e.key, value: e.value })),
5813
+ restartPolicy: policy.restartPolicy
5814
+ };
5815
+ }
5816
+ function releaseForViem(release, environmentConfig) {
5817
+ const base = {
5818
+ rmsRelease: {
5819
+ artifacts: release.rmsRelease.artifacts.map((artifact) => ({
5820
+ digest: `0x${bytesToHex(artifact.digest).slice(2).padStart(64, "0")}`,
5821
+ registry: artifact.registry
5822
+ })),
5823
+ upgradeByTime: release.rmsRelease.upgradeByTime
5824
+ },
5825
+ publicEnv: bytesToHex(release.publicEnv),
5826
+ encryptedEnv: bytesToHex(release.encryptedEnv)
5827
+ };
5828
+ if (!supportsContainerPolicy(environmentConfig)) {
5829
+ return base;
5830
+ }
5831
+ return { ...base, containerPolicy: containerPolicyForViem(release.containerPolicy) };
5832
+ }
4191
5833
  function formatETH(wei) {
4192
5834
  const eth = Number(wei) / 1e18;
4193
5835
  const costStr = eth.toFixed(6);
@@ -4204,7 +5846,7 @@ async function calculateAppID(options) {
4204
5846
  const saltHex = `0x${paddedSaltHex}`;
4205
5847
  const appID = await publicClient.readContract({
4206
5848
  address: environmentConfig.appControllerAddress,
4207
- abi: AppController_default,
5849
+ abi: appControllerAbiFor(environmentConfig),
4208
5850
  functionName: "calculateAppId",
4209
5851
  args: [ownerAddress, saltHex]
4210
5852
  });
@@ -4228,22 +5870,12 @@ async function prepareDeployBatch(options, logger = noopLogger) {
4228
5870
  const saltHexString = bytesToHex(salt).slice(2);
4229
5871
  const paddedSaltHex = saltHexString.padStart(64, "0");
4230
5872
  const saltHex = `0x${paddedSaltHex}`;
4231
- const releaseForViem = {
4232
- rmsRelease: {
4233
- artifacts: release.rmsRelease.artifacts.map((artifact) => ({
4234
- digest: `0x${bytesToHex(artifact.digest).slice(2).padStart(64, "0")}`,
4235
- registry: artifact.registry
4236
- })),
4237
- upgradeByTime: release.rmsRelease.upgradeByTime
4238
- },
4239
- publicEnv: bytesToHex(release.publicEnv),
4240
- encryptedEnv: bytesToHex(release.encryptedEnv)
4241
- };
5873
+ const release_ = releaseForViem(release, environmentConfig);
4242
5874
  const functionName = options.billTo === "app" ? "createAppWithIsolatedBilling" : "createApp";
4243
5875
  const createData = encodeFunctionData2({
4244
- abi: AppController_default,
5876
+ abi: appControllerAbiFor(environmentConfig),
4245
5877
  functionName,
4246
- args: [saltHex, releaseForViem]
5878
+ args: [saltHex, release_]
4247
5879
  });
4248
5880
  const acceptAdminData = encodeFunctionData2({
4249
5881
  abi: PermissionController_default,
@@ -4331,21 +5963,11 @@ async function prepareUpgradeBatch(options) {
4331
5963
  publicLogs,
4332
5964
  needsPermissionChange
4333
5965
  } = options;
4334
- const releaseForViem = {
4335
- rmsRelease: {
4336
- artifacts: release.rmsRelease.artifacts.map((artifact) => ({
4337
- digest: `0x${bytesToHex(artifact.digest).slice(2).padStart(64, "0")}`,
4338
- registry: artifact.registry
4339
- })),
4340
- upgradeByTime: release.rmsRelease.upgradeByTime
4341
- },
4342
- publicEnv: bytesToHex(release.publicEnv),
4343
- encryptedEnv: bytesToHex(release.encryptedEnv)
4344
- };
5966
+ const release_ = releaseForViem(release, environmentConfig);
4345
5967
  const upgradeData = encodeFunctionData2({
4346
- abi: AppController_default,
5968
+ abi: appControllerAbiFor(environmentConfig),
4347
5969
  functionName: "upgradeApp",
4348
- args: [appID, releaseForViem]
5970
+ args: [appID, release_]
4349
5971
  });
4350
5972
  const executions = [
4351
5973
  {
@@ -4479,7 +6101,7 @@ ${pendingMessage}`);
4479
6101
  if (callError.data) {
4480
6102
  try {
4481
6103
  const decoded = decodeErrorResult2({
4482
- abi: AppController_default,
6104
+ abi: appControllerAbiFor(environmentConfig),
4483
6105
  data: callError.data
4484
6106
  });
4485
6107
  const formattedError = formatAppControllerError(decoded);
@@ -4532,7 +6154,7 @@ function formatAppControllerError(decoded) {
4532
6154
  async function getActiveAppCount(publicClient, environmentConfig, user) {
4533
6155
  const count = await publicClient.readContract({
4534
6156
  address: environmentConfig.appControllerAddress,
4535
- abi: AppController_default,
6157
+ abi: appControllerAbiFor(environmentConfig),
4536
6158
  functionName: "getActiveAppCount",
4537
6159
  args: [user]
4538
6160
  });
@@ -4541,7 +6163,7 @@ async function getActiveAppCount(publicClient, environmentConfig, user) {
4541
6163
  async function getMaxActiveAppsPerUser(publicClient, environmentConfig, user) {
4542
6164
  const quota = await publicClient.readContract({
4543
6165
  address: environmentConfig.appControllerAddress,
4544
- abi: AppController_default,
6166
+ abi: appControllerAbiFor(environmentConfig),
4545
6167
  functionName: "getMaxActiveAppsPerUser",
4546
6168
  args: [user]
4547
6169
  });
@@ -4550,7 +6172,7 @@ async function getMaxActiveAppsPerUser(publicClient, environmentConfig, user) {
4550
6172
  async function getBillingType(publicClient, environmentConfig, app) {
4551
6173
  const result = await publicClient.readContract({
4552
6174
  address: environmentConfig.appControllerAddress,
4553
- abi: AppController_default,
6175
+ abi: appControllerAbiFor(environmentConfig),
4554
6176
  functionName: "getBillingType",
4555
6177
  args: [app]
4556
6178
  });
@@ -4559,7 +6181,7 @@ async function getBillingType(publicClient, environmentConfig, app) {
4559
6181
  async function getAppsByBillingAccount(publicClient, environmentConfig, account, offset, limit) {
4560
6182
  const result = await publicClient.readContract({
4561
6183
  address: environmentConfig.appControllerAddress,
4562
- abi: AppController_default,
6184
+ abi: appControllerAbiFor(environmentConfig),
4563
6185
  functionName: "getAppsByBillingAccount",
4564
6186
  args: [account, offset, limit]
4565
6187
  });
@@ -4613,6 +6235,35 @@ async function undelegate(options, logger = noopLogger) {
4613
6235
  return hash;
4614
6236
  }
4615
6237
 
6238
+ // src/client/common/gas/insufficientGas.ts
6239
+ import { formatEther } from "viem";
6240
+ var InsufficientGasError = class extends Error {
6241
+ constructor(args) {
6242
+ const requiredEth = formatEther(args.requiredWei);
6243
+ const availableEth = formatEther(args.availableWei);
6244
+ super(
6245
+ `Insufficient ETH for gas: wallet ${args.address} has ${availableEth} ETH but this transaction needs ~${requiredEth} ETH.
6246
+ Compute credits do not pay on-chain gas \u2014 fund the wallet with ETH and retry.`
6247
+ );
6248
+ this.name = "InsufficientGasError";
6249
+ this.address = args.address;
6250
+ this.requiredWei = args.requiredWei;
6251
+ this.availableWei = args.availableWei;
6252
+ this.requiredEth = requiredEth;
6253
+ this.availableEth = availableEth;
6254
+ }
6255
+ };
6256
+ async function assertSufficientGas(args) {
6257
+ const availableWei = await args.publicClient.getBalance({ address: args.address });
6258
+ if (availableWei < args.gasEstimate.maxCostWei) {
6259
+ throw new InsufficientGasError({
6260
+ address: args.address,
6261
+ requiredWei: args.gasEstimate.maxCostWei,
6262
+ availableWei
6263
+ });
6264
+ }
6265
+ }
6266
+
4616
6267
  // src/client/common/utils/userapi.ts
4617
6268
  import axios2 from "axios";
4618
6269
 
@@ -4645,6 +6296,7 @@ import axios from "axios";
4645
6296
  var MAX_RETRIES = 5;
4646
6297
  var INITIAL_BACKOFF_MS = 1e3;
4647
6298
  var MAX_BACKOFF_MS = 3e4;
6299
+ var RETRYABLE_STATUSES = /* @__PURE__ */ new Set([429, 502, 503, 504]);
4648
6300
  function sleep(ms) {
4649
6301
  return new Promise((resolve2) => setTimeout(resolve2, ms));
4650
6302
  }
@@ -4664,7 +6316,7 @@ async function requestWithRetry(config) {
4664
6316
  for (let attempt = 0; attempt <= MAX_RETRIES; attempt++) {
4665
6317
  const res = await axios({ ...config, validateStatus: () => true });
4666
6318
  lastResponse = res;
4667
- if (res.status !== 429) {
6319
+ if (!RETRYABLE_STATUSES.has(res.status)) {
4668
6320
  return res;
4669
6321
  }
4670
6322
  if (attempt < MAX_RETRIES) {
@@ -4693,7 +6345,7 @@ var CanViewAppLogsPermission = "0x2fd3f2fe";
4693
6345
  var CanViewSensitiveAppInfoPermission = "0x0e67b22f";
4694
6346
  var CanUpdateAppProfilePermission = "0x036fef61";
4695
6347
  function getDefaultClientId() {
4696
- const version = true ? "1.0.0-dev.6" : "0.0.0";
6348
+ const version = true ? "1.0.0-dev.8" : "0.0.0";
4697
6349
  return `ecloud-sdk/v${version}`;
4698
6350
  }
4699
6351
  var UserApiClient = class {
@@ -5031,8 +6683,36 @@ function transformAppRelease(raw) {
5031
6683
 
5032
6684
  // src/client/common/contract/watcher.ts
5033
6685
  var WATCH_POLL_INTERVAL_SECONDS = 5;
6686
+ var WATCH_HEARTBEAT_INTERVAL_SECONDS = 30;
6687
+ var WATCH_DEFAULT_TIMEOUT_SECONDS = 10 * 60;
5034
6688
  var APP_STATUS_RUNNING = "Running";
5035
6689
  var APP_STATUS_FAILED = "Failed";
6690
+ var WatchTimeoutError = class extends Error {
6691
+ constructor(args) {
6692
+ super(
6693
+ args.message ?? `Timed out after ${args.elapsedSeconds}s waiting for app ${args.appId} (last status: ${args.lastStatus ?? "unknown"})`
6694
+ );
6695
+ this.name = "WatchTimeoutError";
6696
+ this.appId = args.appId;
6697
+ this.elapsedSeconds = args.elapsedSeconds;
6698
+ this.lastStatus = args.lastStatus;
6699
+ this.timeoutSeconds = args.timeoutSeconds;
6700
+ }
6701
+ };
6702
+ function resolveWatchTimeoutSeconds(explicit) {
6703
+ if (typeof explicit === "number" && Number.isFinite(explicit) && explicit > 0) {
6704
+ return Math.floor(explicit);
6705
+ }
6706
+ const raw = process.env.ECLOUD_WATCH_TIMEOUT_SECONDS;
6707
+ if (raw === void 0 || raw === "") {
6708
+ return WATCH_DEFAULT_TIMEOUT_SECONDS;
6709
+ }
6710
+ const parsed = Number(raw);
6711
+ if (!Number.isFinite(parsed) || parsed <= 0) {
6712
+ return WATCH_DEFAULT_TIMEOUT_SECONDS;
6713
+ }
6714
+ return Math.floor(parsed);
6715
+ }
5036
6716
  async function watchUntilRunning(options, logger) {
5037
6717
  const { walletClient, publicClient, environmentConfig, appId } = options;
5038
6718
  const userApiClient = new UserApiClient(environmentConfig, walletClient, publicClient);
@@ -5063,8 +6743,20 @@ async function watchUntilRunning(options, logger) {
5063
6743
  return false;
5064
6744
  };
5065
6745
  const startTime = Date.now();
6746
+ const timeoutSeconds = resolveWatchTimeoutSeconds(options.timeoutSeconds);
5066
6747
  let lastLoggedStatus;
6748
+ let lastHeartbeatAt = startTime;
5067
6749
  while (true) {
6750
+ const elapsedMs = Date.now() - startTime;
6751
+ const elapsed = Math.round(elapsedMs / 1e3);
6752
+ if (elapsed >= timeoutSeconds) {
6753
+ throw new WatchTimeoutError({
6754
+ appId,
6755
+ elapsedSeconds: elapsed,
6756
+ lastStatus: lastLoggedStatus,
6757
+ timeoutSeconds
6758
+ });
6759
+ }
5068
6760
  try {
5069
6761
  const info = await userApiClient.getInfos([appId], 1);
5070
6762
  if (info.length === 0) {
@@ -5074,16 +6766,22 @@ async function watchUntilRunning(options, logger) {
5074
6766
  const appInfo = info[0];
5075
6767
  const currentStatus = appInfo.status;
5076
6768
  const currentIP = appInfo.ip || "";
5077
- const elapsed = Math.round((Date.now() - startTime) / 1e3);
5078
6769
  if (currentStatus !== lastLoggedStatus) {
5079
6770
  logger.info(`Status: ${currentStatus} (${elapsed}s)`);
5080
6771
  lastLoggedStatus = currentStatus;
6772
+ lastHeartbeatAt = Date.now();
6773
+ } else if (Date.now() - lastHeartbeatAt >= WATCH_HEARTBEAT_INTERVAL_SECONDS * 1e3) {
6774
+ logger.info(`Status: ${currentStatus} (${elapsed}s)`);
6775
+ lastHeartbeatAt = Date.now();
5081
6776
  }
5082
6777
  if (stopCondition(currentStatus, currentIP)) {
5083
6778
  return currentIP || void 0;
5084
6779
  }
5085
6780
  await sleep2(WATCH_POLL_INTERVAL_SECONDS * 1e3);
5086
6781
  } catch (error) {
6782
+ if (error instanceof WatchTimeoutError) {
6783
+ throw error;
6784
+ }
5087
6785
  logger.warn(`Failed to fetch app info: ${error.message}`);
5088
6786
  await sleep2(WATCH_POLL_INTERVAL_SECONDS * 1e3);
5089
6787
  }
@@ -5092,6 +6790,7 @@ async function watchUntilRunning(options, logger) {
5092
6790
  var APP_STATUS_STOPPED = "Stopped";
5093
6791
  async function watchUntilUpgradeComplete(options, logger) {
5094
6792
  const { walletClient, publicClient, environmentConfig, appId } = options;
6793
+ const timeoutSeconds = resolveWatchTimeoutSeconds(options.timeoutSeconds);
5095
6794
  const userApiClient = new UserApiClient(environmentConfig, walletClient, publicClient);
5096
6795
  let initialStatus;
5097
6796
  let initialIP;
@@ -5129,7 +6828,20 @@ async function watchUntilUpgradeComplete(options, logger) {
5129
6828
  }
5130
6829
  return false;
5131
6830
  };
6831
+ const startTime = Date.now();
6832
+ const deadline = startTime + timeoutSeconds * 1e3;
6833
+ let lastLoggedStatus;
6834
+ let lastObservedStatus;
5132
6835
  while (true) {
6836
+ if (Date.now() >= deadline) {
6837
+ const elapsedSeconds = Math.round((Date.now() - startTime) / 1e3);
6838
+ throw new WatchTimeoutError({
6839
+ appId,
6840
+ lastStatus: lastObservedStatus,
6841
+ elapsedSeconds,
6842
+ timeoutSeconds
6843
+ });
6844
+ }
5133
6845
  try {
5134
6846
  const info = await userApiClient.getInfos([appId], 1);
5135
6847
  if (info.length === 0) {
@@ -5139,11 +6851,23 @@ async function watchUntilUpgradeComplete(options, logger) {
5139
6851
  const appInfo = info[0];
5140
6852
  const currentStatus = appInfo.status;
5141
6853
  const currentIP = appInfo.ip || "";
6854
+ lastObservedStatus = currentStatus;
6855
+ const elapsed = Math.round((Date.now() - startTime) / 1e3);
6856
+ if (currentStatus !== lastLoggedStatus) {
6857
+ logger.info(`Status: ${currentStatus} (${elapsed}s)`);
6858
+ lastLoggedStatus = currentStatus;
6859
+ }
5142
6860
  if (stopCondition(currentStatus, currentIP)) {
5143
6861
  return;
5144
6862
  }
5145
6863
  await sleep2(WATCH_POLL_INTERVAL_SECONDS * 1e3);
5146
6864
  } catch (error) {
6865
+ if (error instanceof WatchTimeoutError) {
6866
+ throw error;
6867
+ }
6868
+ if (typeof error?.message === "string" && error.message.includes("Failed")) {
6869
+ throw error;
6870
+ }
5147
6871
  logger.warn(`Failed to fetch app info: ${error.message}`);
5148
6872
  await sleep2(WATCH_POLL_INTERVAL_SECONDS * 1e3);
5149
6873
  }
@@ -5257,6 +6981,8 @@ var ENVIRONMENTS = {
5257
6981
  name: "sepolia",
5258
6982
  build: "dev",
5259
6983
  appControllerAddress: "0xa86DC1C47cb2518327fB4f9A1627F51966c83B92",
6984
+ releaseAbiVersion: "v1.5",
6985
+ // AppController upgraded to v1.5.x (containerPolicy)
5260
6986
  permissionControllerAddress: ChainAddresses[SEPOLIA_CHAIN_ID].PermissionController,
5261
6987
  erc7702DelegatorAddress: CommonAddresses.ERC7702Delegator,
5262
6988
  kmsServerURL: "http://10.128.0.57:8080",
@@ -5270,6 +6996,8 @@ var ENVIRONMENTS = {
5270
6996
  name: "sepolia",
5271
6997
  build: "prod",
5272
6998
  appControllerAddress: "0x0dd810a6ffba6a9820a10d97b659f07d8d23d4E2",
6999
+ releaseAbiVersion: "v1.4",
7000
+ // prod still on AppController v1.4.0 (3-field Release)
5273
7001
  permissionControllerAddress: ChainAddresses[SEPOLIA_CHAIN_ID].PermissionController,
5274
7002
  erc7702DelegatorAddress: CommonAddresses.ERC7702Delegator,
5275
7003
  kmsServerURL: "http://10.128.15.203:8080",
@@ -5284,6 +7012,8 @@ var ENVIRONMENTS = {
5284
7012
  name: "mainnet-alpha",
5285
7013
  build: "prod",
5286
7014
  appControllerAddress: "0xc38d35Fc995e75342A21CBd6D770305b142Fbe67",
7015
+ releaseAbiVersion: "v1.4",
7016
+ // prod still on AppController v1.4.0 (3-field Release)
5287
7017
  permissionControllerAddress: ChainAddresses[MAINNET_CHAIN_ID].PermissionController,
5288
7018
  erc7702DelegatorAddress: CommonAddresses.ERC7702Delegator,
5289
7019
  kmsServerURL: "http://10.128.0.2:8080",
@@ -5684,6 +7414,11 @@ async function prepareDeployFromVerifiableBuild(options, logger = defaultLogger)
5684
7414
  executions: batch.executions,
5685
7415
  authorizationList
5686
7416
  });
7417
+ await assertSufficientGas({
7418
+ publicClient: batch.publicClient,
7419
+ address: batch.walletClient.account.address,
7420
+ gasEstimate
7421
+ });
5687
7422
  const data = {
5688
7423
  appId: batch.appId,
5689
7424
  salt: batch.salt,
@@ -5942,6 +7677,11 @@ async function prepareDeploy(options, logger = defaultLogger) {
5942
7677
  executions: batch.executions,
5943
7678
  authorizationList
5944
7679
  });
7680
+ await assertSufficientGas({
7681
+ publicClient: batch.publicClient,
7682
+ address: batch.walletClient.account.address,
7683
+ gasEstimate
7684
+ });
5945
7685
  const data = {
5946
7686
  appId: batch.appId,
5947
7687
  salt: batch.salt,
@@ -5978,7 +7718,7 @@ async function executeDeploy(options) {
5978
7718
  }
5979
7719
  );
5980
7720
  }
5981
- async function watchDeployment(appId, walletClient, publicClient, environmentConfig, logger = defaultLogger, skipTelemetry) {
7721
+ async function watchDeployment(appId, walletClient, publicClient, environmentConfig, logger = defaultLogger, skipTelemetry, opts) {
5982
7722
  return withSDKTelemetry(
5983
7723
  {
5984
7724
  functionName: "watchDeployment",
@@ -5994,7 +7734,8 @@ async function watchDeployment(appId, walletClient, publicClient, environmentCon
5994
7734
  walletClient,
5995
7735
  publicClient,
5996
7736
  environmentConfig,
5997
- appId
7737
+ appId,
7738
+ timeoutSeconds: opts?.timeoutSeconds
5998
7739
  },
5999
7740
  logger
6000
7741
  );
@@ -6090,6 +7831,11 @@ async function prepareUpgradeFromVerifiableBuild(options, logger = defaultLogger
6090
7831
  executions: batch.executions,
6091
7832
  authorizationList
6092
7833
  });
7834
+ await assertSufficientGas({
7835
+ publicClient: batch.publicClient,
7836
+ address: batch.walletClient.account.address,
7837
+ gasEstimate
7838
+ });
6093
7839
  const data = {
6094
7840
  appId: batch.appId,
6095
7841
  executions: batch.executions,
@@ -6279,6 +8025,11 @@ async function prepareUpgrade(options, logger = defaultLogger) {
6279
8025
  executions: batch.executions,
6280
8026
  authorizationList
6281
8027
  });
8028
+ await assertSufficientGas({
8029
+ publicClient: batch.publicClient,
8030
+ address: batch.walletClient.account.address,
8031
+ gasEstimate
8032
+ });
6282
8033
  const data = {
6283
8034
  appId: batch.appId,
6284
8035
  executions: batch.executions,
@@ -6313,7 +8064,7 @@ async function executeUpgrade(options) {
6313
8064
  }
6314
8065
  );
6315
8066
  }
6316
- async function watchUpgrade(appId, walletClient, publicClient, environmentConfig, logger = defaultLogger, skipTelemetry) {
8067
+ async function watchUpgrade(appId, walletClient, publicClient, environmentConfig, logger = defaultLogger, skipTelemetry, opts) {
6317
8068
  return withSDKTelemetry(
6318
8069
  {
6319
8070
  functionName: "watchUpgrade",
@@ -6329,7 +8080,8 @@ async function watchUpgrade(appId, walletClient, publicClient, environmentConfig
6329
8080
  walletClient,
6330
8081
  publicClient,
6331
8082
  environmentConfig,
6332
- appId
8083
+ appId,
8084
+ timeoutSeconds: opts?.timeoutSeconds
6333
8085
  },
6334
8086
  logger
6335
8087
  );
@@ -7021,7 +8773,7 @@ function createAppModule(ctx) {
7021
8773
  }
7022
8774
  const account = walletClient.account;
7023
8775
  const environment = getEnvironmentConfig(ctx.environment);
7024
- const logger = getLogger(ctx.verbose);
8776
+ const logger = ctx.logger ?? getLogger(ctx.verbose);
7025
8777
  return {
7026
8778
  async create(opts) {
7027
8779
  return createApp(opts, logger);
@@ -7133,14 +8885,15 @@ function createAppModule(ctx) {
7133
8885
  imageRef: result.imageRef
7134
8886
  };
7135
8887
  },
7136
- async watchDeployment(appId) {
8888
+ async watchDeployment(appId, opts) {
7137
8889
  return watchDeployment(
7138
8890
  appId,
7139
8891
  walletClient,
7140
8892
  publicClient,
7141
8893
  environment,
7142
8894
  logger,
7143
- skipTelemetry
8895
+ skipTelemetry,
8896
+ opts
7144
8897
  );
7145
8898
  },
7146
8899
  // Granular upgrade control
@@ -7198,8 +8951,16 @@ function createAppModule(ctx) {
7198
8951
  imageRef: result.imageRef
7199
8952
  };
7200
8953
  },
7201
- async watchUpgrade(appId) {
7202
- return watchUpgrade(appId, walletClient, publicClient, environment, logger, skipTelemetry);
8954
+ async watchUpgrade(appId, opts) {
8955
+ return watchUpgrade(
8956
+ appId,
8957
+ walletClient,
8958
+ publicClient,
8959
+ environment,
8960
+ logger,
8961
+ skipTelemetry,
8962
+ opts
8963
+ );
7203
8964
  },
7204
8965
  // Profile management
7205
8966
  async setProfile(appId, profile) {