@layr-labs/ecloud-sdk 1.0.0-devep8 → 1.0.0

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/browser.js CHANGED
@@ -146,6 +146,13 @@ var init_session = __esm({
146
146
  });
147
147
 
148
148
  // src/client/common/types/index.ts
149
+ var EMPTY_CONTAINER_POLICY = {
150
+ args: [],
151
+ cmdOverride: [],
152
+ env: [],
153
+ envOverride: [],
154
+ restartPolicy: ""
155
+ };
149
156
  var noopLogger = {
150
157
  debug: () => {
151
158
  },
@@ -179,14 +186,13 @@ var BILLING_ENVIRONMENTS = {
179
186
  billingApiServerURL: "https://billingapi.eigencloud.xyz"
180
187
  }
181
188
  };
182
- var PLATFORM_ENV_TESTNET_SEPOLIA = "testnet-sepolia";
183
- var PLATFORM_ENV_MAINNET_ETHEREUM = "mainnet-ethereum";
184
- var DEFAULT_APP_BASE_DOMAIN = "eigencloud.xyz";
185
189
  var ENVIRONMENTS = {
186
190
  "sepolia-dev": {
187
191
  name: "sepolia",
188
192
  build: "dev",
189
193
  appControllerAddress: "0xa86DC1C47cb2518327fB4f9A1627F51966c83B92",
194
+ releaseAbiVersion: "v1.5",
195
+ // AppController upgraded to v1.5.x (containerPolicy)
190
196
  permissionControllerAddress: ChainAddresses[SEPOLIA_CHAIN_ID].PermissionController,
191
197
  erc7702DelegatorAddress: CommonAddresses.ERC7702Delegator,
192
198
  kmsServerURL: "http://10.128.0.57:8080",
@@ -194,14 +200,14 @@ var ENVIRONMENTS = {
194
200
  defaultRPCURL: "https://ethereum-sepolia-rpc.publicnode.com",
195
201
  usdcCreditsAddress: "0xbdA3897c3A428763B59015C64AB766c288C97376",
196
202
  baseUsdcCreditsAddress: "0x7673a47463F80c6a3553Db9E54c8cDcd5313d0ac",
197
- baseRPCURL: "https://base-sepolia-rpc.publicnode.com",
198
- platformEnv: PLATFORM_ENV_TESTNET_SEPOLIA,
199
- appBaseDomain: DEFAULT_APP_BASE_DOMAIN
203
+ baseRPCURL: "https://base-sepolia-rpc.publicnode.com"
200
204
  },
201
205
  sepolia: {
202
206
  name: "sepolia",
203
207
  build: "prod",
204
208
  appControllerAddress: "0x0dd810a6ffba6a9820a10d97b659f07d8d23d4E2",
209
+ releaseAbiVersion: "v1.4",
210
+ // prod still on AppController v1.4.0 (3-field Release)
205
211
  permissionControllerAddress: ChainAddresses[SEPOLIA_CHAIN_ID].PermissionController,
206
212
  erc7702DelegatorAddress: CommonAddresses.ERC7702Delegator,
207
213
  kmsServerURL: "http://10.128.15.203:8080",
@@ -210,22 +216,20 @@ var ENVIRONMENTS = {
210
216
  billingRPCURL: "https://ethereum-rpc.publicnode.com",
211
217
  usdcCreditsAddress: "0xed9c88640ca9149Bd9f7ee6620074af10F2E145d",
212
218
  baseUsdcCreditsAddress: "0x7673a47463F80c6a3553Db9E54c8cDcd5313d0ac",
213
- baseRPCURL: "https://base-sepolia-rpc.publicnode.com",
214
- platformEnv: PLATFORM_ENV_TESTNET_SEPOLIA,
215
- appBaseDomain: DEFAULT_APP_BASE_DOMAIN
219
+ baseRPCURL: "https://base-sepolia-rpc.publicnode.com"
216
220
  },
217
221
  "mainnet-alpha": {
218
222
  name: "mainnet-alpha",
219
223
  build: "prod",
220
224
  appControllerAddress: "0xc38d35Fc995e75342A21CBd6D770305b142Fbe67",
225
+ releaseAbiVersion: "v1.4",
226
+ // prod still on AppController v1.4.0 (3-field Release)
221
227
  permissionControllerAddress: ChainAddresses[MAINNET_CHAIN_ID].PermissionController,
222
228
  erc7702DelegatorAddress: CommonAddresses.ERC7702Delegator,
223
229
  kmsServerURL: "http://10.128.0.2:8080",
224
230
  userApiServerURL: "https://userapi-compute.eigencloud.xyz",
225
231
  defaultRPCURL: "https://ethereum-rpc.publicnode.com",
226
- usdcCreditsAddress: "0xed9c88640ca9149Bd9f7ee6620074af10F2E145d",
227
- platformEnv: PLATFORM_ENV_MAINNET_ETHEREUM,
228
- appBaseDomain: DEFAULT_APP_BASE_DOMAIN
232
+ usdcCreditsAddress: "0xed9c88640ca9149Bd9f7ee6620074af10F2E145d"
229
233
  }
230
234
  };
231
235
  var CHAIN_ID_TO_ENVIRONMENT = {
@@ -285,7 +289,7 @@ function getBillingEnvironmentConfig(build) {
285
289
  };
286
290
  }
287
291
  function getBuildType() {
288
- const buildTimeType = true ? "dev"?.toLowerCase() : void 0;
292
+ const buildTimeType = true ? "prod"?.toLowerCase() : void 0;
289
293
  const runtimeType = process.env.BUILD_TYPE?.toLowerCase();
290
294
  const buildType = buildTimeType || runtimeType;
291
295
  if (buildType === "dev") {
@@ -594,6 +598,7 @@ import axios from "axios";
594
598
  var MAX_RETRIES = 5;
595
599
  var INITIAL_BACKOFF_MS = 1e3;
596
600
  var MAX_BACKOFF_MS = 3e4;
601
+ var RETRYABLE_STATUSES = /* @__PURE__ */ new Set([429, 502, 503, 504]);
597
602
  function sleep(ms) {
598
603
  return new Promise((resolve) => setTimeout(resolve, ms));
599
604
  }
@@ -613,7 +618,7 @@ async function requestWithRetry(config) {
613
618
  for (let attempt = 0; attempt <= MAX_RETRIES; attempt++) {
614
619
  const res = await axios({ ...config, validateStatus: () => true });
615
620
  lastResponse = res;
616
- if (res.status !== 429) {
621
+ if (!RETRYABLE_STATUSES.has(res.status)) {
617
622
  return res;
618
623
  }
619
624
  if (attempt < MAX_RETRIES) {
@@ -642,7 +647,7 @@ var CanViewAppLogsPermission = "0x2fd3f2fe";
642
647
  var CanViewSensitiveAppInfoPermission = "0x0e67b22f";
643
648
  var CanUpdateAppProfilePermission = "0x036fef61";
644
649
  function getDefaultClientId() {
645
- const version = true ? "1.0.0-devep8" : "0.0.0";
650
+ const version = true ? "1.0.0" : "0.0.0";
646
651
  return `ecloud-sdk/v${version}`;
647
652
  }
648
653
  var UserApiClient = class {
@@ -677,7 +682,6 @@ var UserApiClient = class {
677
682
  status: app.app_status,
678
683
  ip: app.ip,
679
684
  machineType: app.machine_type,
680
- hostname: app.hostname,
681
685
  profile: app.profile,
682
686
  metrics: app.metrics,
683
687
  evmAddresses,
@@ -743,28 +747,6 @@ var UserApiClient = class {
743
747
  status: app.app_status || app.App_Status || ""
744
748
  }));
745
749
  }
746
- /**
747
- * Get deployments for an app from the gRPC-gateway endpoint.
748
- * Returns deployment records including upgrade_phase for tracking upgrade progress.
749
- *
750
- * Endpoint: GET /v1/apps/:appAddress/deployments
751
- */
752
- async getDeployments(appAddress) {
753
- const endpoint = `${this.config.userApiServerURL}/v1/apps/${appAddress}/deployments`;
754
- const response = await this.makeEIP712AuthenticatedRequest(endpoint);
755
- const result = await response.json();
756
- const deployments = result.deployments || [];
757
- return deployments.map((dep) => ({
758
- id: dep.id || "",
759
- externalId: dep.external_id || dep.externalId || "",
760
- endpoint: dep.endpoint || "",
761
- releaseId: dep.release_id || dep.releaseId || "",
762
- upgradePhase: dep.upgrade_phase || dep.upgradePhase || "",
763
- replacesDeploymentId: dep.replaces_deployment_id || dep.replacesDeploymentId || "",
764
- createdAt: dep.created_at || dep.createdAt || "",
765
- updatedAt: dep.updated_at || dep.updatedAt || ""
766
- }));
767
- }
768
750
  /**
769
751
  * Upload app profile information with optional image
770
752
  *
@@ -898,48 +880,6 @@ Please check:
898
880
  "X-eigenx-expiry": expiry.toString()
899
881
  };
900
882
  }
901
- /**
902
- * Make an EIP-712 authenticated request to the gRPC-gateway endpoints.
903
- * Uses the billing/compute auth pattern: Authorization + X-Account + X-Expiry headers.
904
- */
905
- async makeEIP712AuthenticatedRequest(url) {
906
- const expiry = BigInt(Math.floor(Date.now() / 1e3) + 5 * 60);
907
- const { signature } = await calculateBillingAuthSignature({
908
- walletClient: this.walletClient,
909
- product: "compute",
910
- expiry
911
- });
912
- const headers = {
913
- Authorization: `Bearer ${signature}`,
914
- "X-Account": this.address,
915
- "X-Expiry": expiry.toString(),
916
- "x-client-id": this.clientId
917
- };
918
- try {
919
- const response = await requestWithRetry({
920
- method: "GET",
921
- url,
922
- headers,
923
- maxRedirects: 0,
924
- withCredentials: true
925
- });
926
- const status = response.status;
927
- if (status < 200 || status >= 300) {
928
- const body = typeof response.data === "string" ? response.data : JSON.stringify(response.data);
929
- throw new Error(`gRPC-gateway request failed: ${status} - ${body}`);
930
- }
931
- return {
932
- json: async () => response.data,
933
- text: async () => typeof response.data === "string" ? response.data : JSON.stringify(response.data)
934
- };
935
- } catch (error) {
936
- if (error.message?.includes("fetch failed") || error.message?.includes("ECONNREFUSED") || error.message?.includes("ENOTFOUND") || error.cause) {
937
- const cause = error.cause?.message || error.cause || error.message;
938
- throw new Error(`Failed to connect to API at ${url}: ${cause}`);
939
- }
940
- throw error;
941
- }
942
- }
943
883
  // ==========================================================================
944
884
  // SIWE Session Management
945
885
  // ==========================================================================
@@ -1310,6 +1250,63 @@ var BillingApiClient = class {
1310
1250
  return resp.json();
1311
1251
  }
1312
1252
  // ==========================================================================
1253
+ // Admin - Coupon Methods
1254
+ // ==========================================================================
1255
+ async createCoupon(amountCents) {
1256
+ const endpoint = `${this.config.billingApiServerURL}/admin/coupons`;
1257
+ const resp = await this.makeAuthenticatedRequest(endpoint, "POST", "compute", { amountCents });
1258
+ return resp.json();
1259
+ }
1260
+ async listCoupons(opts) {
1261
+ const params = new URLSearchParams();
1262
+ if (opts?.offset !== void 0) params.set("offset", opts.offset.toString());
1263
+ if (opts?.limit !== void 0) params.set("limit", opts.limit.toString());
1264
+ if (opts?.active !== void 0) params.set("active", opts.active.toString());
1265
+ if (opts?.redeemed !== void 0) params.set("redeemed", opts.redeemed.toString());
1266
+ const qs = params.toString();
1267
+ const endpoint = `${this.config.billingApiServerURL}/admin/coupons${qs ? `?${qs}` : ""}`;
1268
+ const resp = await this.makeAuthenticatedRequest(endpoint, "GET", "compute");
1269
+ return resp.json();
1270
+ }
1271
+ async getCoupon(id) {
1272
+ const endpoint = `${this.config.billingApiServerURL}/admin/coupons/${id}`;
1273
+ const resp = await this.makeAuthenticatedRequest(endpoint, "GET", "compute");
1274
+ return resp.json();
1275
+ }
1276
+ async deactivateCoupon(id) {
1277
+ const endpoint = `${this.config.billingApiServerURL}/admin/coupons/${id}/deactivate`;
1278
+ await this.makeAuthenticatedRequest(endpoint, "POST", "compute");
1279
+ }
1280
+ async redeemCouponForUser(id, address) {
1281
+ const endpoint = `${this.config.billingApiServerURL}/admin/coupons/${id}/redeem`;
1282
+ await this.makeAuthenticatedRequest(endpoint, "POST", "compute", { address });
1283
+ }
1284
+ // ==========================================================================
1285
+ // Admin - Admin Management Methods
1286
+ // ==========================================================================
1287
+ async addAdmin(address) {
1288
+ const endpoint = `${this.config.billingApiServerURL}/admin/admins`;
1289
+ const resp = await this.makeAuthenticatedRequest(endpoint, "POST", "compute", { address });
1290
+ return resp.json();
1291
+ }
1292
+ async removeAdmin(address) {
1293
+ const endpoint = `${this.config.billingApiServerURL}/admin/admins/${address}`;
1294
+ await this.makeAuthenticatedRequest(endpoint, "DELETE", "compute");
1295
+ }
1296
+ async listAdmins() {
1297
+ const endpoint = `${this.config.billingApiServerURL}/admin/admins`;
1298
+ const resp = await this.makeAuthenticatedRequest(endpoint, "GET", "compute");
1299
+ return resp.json();
1300
+ }
1301
+ // ==========================================================================
1302
+ // User - Coupon Redemption
1303
+ // ==========================================================================
1304
+ async redeemCoupon(code) {
1305
+ const endpoint = `${this.config.billingApiServerURL}/v1/coupons/redeem`;
1306
+ const resp = await this.makeAuthenticatedRequest(endpoint, "POST", "compute", { code });
1307
+ return resp.json();
1308
+ }
1309
+ // ==========================================================================
1313
1310
  // Internal Methods
1314
1311
  // ==========================================================================
1315
1312
  /**
@@ -2972,6 +2969,19 @@ var AppController_default = [
2972
2969
  ],
2973
2970
  stateMutability: "view"
2974
2971
  },
2972
+ {
2973
+ type: "function",
2974
+ name: "confirmUpgrade",
2975
+ inputs: [
2976
+ {
2977
+ name: "app",
2978
+ type: "address",
2979
+ internalType: "contractIApp"
2980
+ }
2981
+ ],
2982
+ outputs: [],
2983
+ stateMutability: "nonpayable"
2984
+ },
2975
2985
  {
2976
2986
  type: "function",
2977
2987
  name: "createApp",
@@ -3024,6 +3034,62 @@ var AppController_default = [
3024
3034
  name: "encryptedEnv",
3025
3035
  type: "bytes",
3026
3036
  internalType: "bytes"
3037
+ },
3038
+ {
3039
+ name: "containerPolicy",
3040
+ type: "tuple",
3041
+ internalType: "structIAppController.ContainerPolicy",
3042
+ components: [
3043
+ {
3044
+ name: "args",
3045
+ type: "string[]",
3046
+ internalType: "string[]"
3047
+ },
3048
+ {
3049
+ name: "cmdOverride",
3050
+ type: "string[]",
3051
+ internalType: "string[]"
3052
+ },
3053
+ {
3054
+ name: "env",
3055
+ type: "tuple[]",
3056
+ internalType: "structIAppController.EnvVar[]",
3057
+ components: [
3058
+ {
3059
+ name: "key",
3060
+ type: "string",
3061
+ internalType: "string"
3062
+ },
3063
+ {
3064
+ name: "value",
3065
+ type: "string",
3066
+ internalType: "string"
3067
+ }
3068
+ ]
3069
+ },
3070
+ {
3071
+ name: "envOverride",
3072
+ type: "tuple[]",
3073
+ internalType: "structIAppController.EnvVar[]",
3074
+ components: [
3075
+ {
3076
+ name: "key",
3077
+ type: "string",
3078
+ internalType: "string"
3079
+ },
3080
+ {
3081
+ name: "value",
3082
+ type: "string",
3083
+ internalType: "string"
3084
+ }
3085
+ ]
3086
+ },
3087
+ {
3088
+ name: "restartPolicy",
3089
+ type: "string",
3090
+ internalType: "string"
3091
+ }
3092
+ ]
3027
3093
  }
3028
3094
  ]
3029
3095
  }
@@ -3089,6 +3155,62 @@ var AppController_default = [
3089
3155
  name: "encryptedEnv",
3090
3156
  type: "bytes",
3091
3157
  internalType: "bytes"
3158
+ },
3159
+ {
3160
+ name: "containerPolicy",
3161
+ type: "tuple",
3162
+ internalType: "structIAppController.ContainerPolicy",
3163
+ components: [
3164
+ {
3165
+ name: "args",
3166
+ type: "string[]",
3167
+ internalType: "string[]"
3168
+ },
3169
+ {
3170
+ name: "cmdOverride",
3171
+ type: "string[]",
3172
+ internalType: "string[]"
3173
+ },
3174
+ {
3175
+ name: "env",
3176
+ type: "tuple[]",
3177
+ internalType: "structIAppController.EnvVar[]",
3178
+ components: [
3179
+ {
3180
+ name: "key",
3181
+ type: "string",
3182
+ internalType: "string"
3183
+ },
3184
+ {
3185
+ name: "value",
3186
+ type: "string",
3187
+ internalType: "string"
3188
+ }
3189
+ ]
3190
+ },
3191
+ {
3192
+ name: "envOverride",
3193
+ type: "tuple[]",
3194
+ internalType: "structIAppController.EnvVar[]",
3195
+ components: [
3196
+ {
3197
+ name: "key",
3198
+ type: "string",
3199
+ internalType: "string"
3200
+ },
3201
+ {
3202
+ name: "value",
3203
+ type: "string",
3204
+ internalType: "string"
3205
+ }
3206
+ ]
3207
+ },
3208
+ {
3209
+ name: "restartPolicy",
3210
+ type: "string",
3211
+ internalType: "string"
3212
+ }
3213
+ ]
3092
3214
  }
3093
3215
  ]
3094
3216
  }
@@ -3102,6 +3224,44 @@ var AppController_default = [
3102
3224
  ],
3103
3225
  stateMutability: "nonpayable"
3104
3226
  },
3227
+ {
3228
+ type: "function",
3229
+ name: "createEmptyApp",
3230
+ inputs: [
3231
+ {
3232
+ name: "salt",
3233
+ type: "bytes32",
3234
+ internalType: "bytes32"
3235
+ }
3236
+ ],
3237
+ outputs: [
3238
+ {
3239
+ name: "app",
3240
+ type: "address",
3241
+ internalType: "contractIApp"
3242
+ }
3243
+ ],
3244
+ stateMutability: "nonpayable"
3245
+ },
3246
+ {
3247
+ type: "function",
3248
+ name: "createEmptyAppWithIsolatedBilling",
3249
+ inputs: [
3250
+ {
3251
+ name: "salt",
3252
+ type: "bytes32",
3253
+ internalType: "bytes32"
3254
+ }
3255
+ ],
3256
+ outputs: [
3257
+ {
3258
+ name: "app",
3259
+ type: "address",
3260
+ internalType: "contractIApp"
3261
+ }
3262
+ ],
3263
+ stateMutability: "nonpayable"
3264
+ },
3105
3265
  {
3106
3266
  type: "function",
3107
3267
  name: "domainSeparator",
@@ -3136,26 +3296,26 @@ var AppController_default = [
3136
3296
  },
3137
3297
  {
3138
3298
  type: "function",
3139
- name: "getBillingType",
3299
+ name: "getAppCreator",
3140
3300
  inputs: [
3141
3301
  {
3142
3302
  name: "app",
3143
3303
  type: "address",
3144
- internalType: "address"
3304
+ internalType: "contractIApp"
3145
3305
  }
3146
3306
  ],
3147
3307
  outputs: [
3148
3308
  {
3149
3309
  name: "",
3150
- type: "uint8",
3151
- internalType: "uint8"
3310
+ type: "address",
3311
+ internalType: "address"
3152
3312
  }
3153
3313
  ],
3154
3314
  stateMutability: "view"
3155
3315
  },
3156
3316
  {
3157
3317
  type: "function",
3158
- name: "getAppCreator",
3318
+ name: "getAppLatestReleaseBlockNumber",
3159
3319
  inputs: [
3160
3320
  {
3161
3321
  name: "app",
@@ -3166,15 +3326,15 @@ var AppController_default = [
3166
3326
  outputs: [
3167
3327
  {
3168
3328
  name: "",
3169
- type: "address",
3170
- internalType: "address"
3329
+ type: "uint32",
3330
+ internalType: "uint32"
3171
3331
  }
3172
3332
  ],
3173
3333
  stateMutability: "view"
3174
3334
  },
3175
3335
  {
3176
3336
  type: "function",
3177
- name: "getAppLatestReleaseBlockNumber",
3337
+ name: "getAppOperatorSetId",
3178
3338
  inputs: [
3179
3339
  {
3180
3340
  name: "app",
@@ -3193,7 +3353,7 @@ var AppController_default = [
3193
3353
  },
3194
3354
  {
3195
3355
  type: "function",
3196
- name: "getAppOperatorSetId",
3356
+ name: "getAppPendingReleaseBlockNumber",
3197
3357
  inputs: [
3198
3358
  {
3199
3359
  name: "app",
@@ -3270,6 +3430,11 @@ var AppController_default = [
3270
3430
  type: "uint32",
3271
3431
  internalType: "uint32"
3272
3432
  },
3433
+ {
3434
+ name: "pendingReleaseBlockNumber",
3435
+ type: "uint32",
3436
+ internalType: "uint32"
3437
+ },
3273
3438
  {
3274
3439
  name: "status",
3275
3440
  type: "uint8",
@@ -3326,6 +3491,11 @@ var AppController_default = [
3326
3491
  type: "uint32",
3327
3492
  internalType: "uint32"
3328
3493
  },
3494
+ {
3495
+ name: "pendingReleaseBlockNumber",
3496
+ type: "uint32",
3497
+ internalType: "uint32"
3498
+ },
3329
3499
  {
3330
3500
  name: "status",
3331
3501
  type: "uint8",
@@ -3382,6 +3552,11 @@ var AppController_default = [
3382
3552
  type: "uint32",
3383
3553
  internalType: "uint32"
3384
3554
  },
3555
+ {
3556
+ name: "pendingReleaseBlockNumber",
3557
+ type: "uint32",
3558
+ internalType: "uint32"
3559
+ },
3385
3560
  {
3386
3561
  name: "status",
3387
3562
  type: "uint8",
@@ -3438,6 +3613,11 @@ var AppController_default = [
3438
3613
  type: "uint32",
3439
3614
  internalType: "uint32"
3440
3615
  },
3616
+ {
3617
+ name: "pendingReleaseBlockNumber",
3618
+ type: "uint32",
3619
+ internalType: "uint32"
3620
+ },
3441
3621
  {
3442
3622
  name: "status",
3443
3623
  type: "uint8",
@@ -3450,51 +3630,1413 @@ var AppController_default = [
3450
3630
  },
3451
3631
  {
3452
3632
  type: "function",
3453
- name: "getMaxActiveAppsPerUser",
3633
+ name: "getBillingAccount",
3454
3634
  inputs: [
3455
3635
  {
3456
- name: "user",
3636
+ name: "app",
3457
3637
  type: "address",
3458
- internalType: "address"
3638
+ internalType: "contractIApp"
3459
3639
  }
3460
3640
  ],
3461
3641
  outputs: [
3462
3642
  {
3463
3643
  name: "",
3464
- type: "uint32",
3465
- internalType: "uint32"
3644
+ type: "address",
3645
+ internalType: "address"
3466
3646
  }
3467
3647
  ],
3468
3648
  stateMutability: "view"
3469
3649
  },
3470
3650
  {
3471
3651
  type: "function",
3472
- name: "globalActiveAppCount",
3473
- inputs: [],
3652
+ name: "getBillingType",
3653
+ inputs: [
3654
+ {
3655
+ name: "app",
3656
+ type: "address",
3657
+ internalType: "contractIApp"
3658
+ }
3659
+ ],
3474
3660
  outputs: [
3475
3661
  {
3476
3662
  name: "",
3477
- type: "uint32",
3478
- internalType: "uint32"
3663
+ type: "uint8",
3664
+ internalType: "enumIAppController.BillingType"
3479
3665
  }
3480
3666
  ],
3481
3667
  stateMutability: "view"
3482
3668
  },
3483
3669
  {
3484
3670
  type: "function",
3485
- name: "initialize",
3671
+ name: "getMaxActiveAppsPerUser",
3486
3672
  inputs: [
3487
3673
  {
3488
- name: "admin",
3674
+ name: "user",
3489
3675
  type: "address",
3490
3676
  internalType: "address"
3491
3677
  }
3492
3678
  ],
3493
- outputs: [],
3494
- stateMutability: "nonpayable"
3495
- },
3496
- {
3497
- type: "function",
3679
+ outputs: [
3680
+ {
3681
+ name: "",
3682
+ type: "uint32",
3683
+ internalType: "uint32"
3684
+ }
3685
+ ],
3686
+ stateMutability: "view"
3687
+ },
3688
+ {
3689
+ type: "function",
3690
+ name: "globalActiveAppCount",
3691
+ inputs: [],
3692
+ outputs: [
3693
+ {
3694
+ name: "",
3695
+ type: "uint32",
3696
+ internalType: "uint32"
3697
+ }
3698
+ ],
3699
+ stateMutability: "view"
3700
+ },
3701
+ {
3702
+ type: "function",
3703
+ name: "initialize",
3704
+ inputs: [
3705
+ {
3706
+ name: "admin",
3707
+ type: "address",
3708
+ internalType: "address"
3709
+ }
3710
+ ],
3711
+ outputs: [],
3712
+ stateMutability: "nonpayable"
3713
+ },
3714
+ {
3715
+ type: "function",
3716
+ name: "maxGlobalActiveApps",
3717
+ inputs: [],
3718
+ outputs: [
3719
+ {
3720
+ name: "",
3721
+ type: "uint32",
3722
+ internalType: "uint32"
3723
+ }
3724
+ ],
3725
+ stateMutability: "view"
3726
+ },
3727
+ {
3728
+ type: "function",
3729
+ name: "permissionController",
3730
+ inputs: [],
3731
+ outputs: [
3732
+ {
3733
+ name: "",
3734
+ type: "address",
3735
+ internalType: "contractIPermissionController"
3736
+ }
3737
+ ],
3738
+ stateMutability: "view"
3739
+ },
3740
+ {
3741
+ type: "function",
3742
+ name: "releaseManager",
3743
+ inputs: [],
3744
+ outputs: [
3745
+ {
3746
+ name: "",
3747
+ type: "address",
3748
+ internalType: "contractIReleaseManager"
3749
+ }
3750
+ ],
3751
+ stateMutability: "view"
3752
+ },
3753
+ {
3754
+ type: "function",
3755
+ name: "setMaxActiveAppsPerUser",
3756
+ inputs: [
3757
+ {
3758
+ name: "user",
3759
+ type: "address",
3760
+ internalType: "address"
3761
+ },
3762
+ {
3763
+ name: "limit",
3764
+ type: "uint32",
3765
+ internalType: "uint32"
3766
+ }
3767
+ ],
3768
+ outputs: [],
3769
+ stateMutability: "nonpayable"
3770
+ },
3771
+ {
3772
+ type: "function",
3773
+ name: "setMaxGlobalActiveApps",
3774
+ inputs: [
3775
+ {
3776
+ name: "limit",
3777
+ type: "uint32",
3778
+ internalType: "uint32"
3779
+ }
3780
+ ],
3781
+ outputs: [],
3782
+ stateMutability: "nonpayable"
3783
+ },
3784
+ {
3785
+ type: "function",
3786
+ name: "startApp",
3787
+ inputs: [
3788
+ {
3789
+ name: "app",
3790
+ type: "address",
3791
+ internalType: "contractIApp"
3792
+ }
3793
+ ],
3794
+ outputs: [],
3795
+ stateMutability: "nonpayable"
3796
+ },
3797
+ {
3798
+ type: "function",
3799
+ name: "stopApp",
3800
+ inputs: [
3801
+ {
3802
+ name: "app",
3803
+ type: "address",
3804
+ internalType: "contractIApp"
3805
+ }
3806
+ ],
3807
+ outputs: [],
3808
+ stateMutability: "nonpayable"
3809
+ },
3810
+ {
3811
+ type: "function",
3812
+ name: "suspend",
3813
+ inputs: [
3814
+ {
3815
+ name: "account",
3816
+ type: "address",
3817
+ internalType: "address"
3818
+ },
3819
+ {
3820
+ name: "apps",
3821
+ type: "address[]",
3822
+ internalType: "contractIApp[]"
3823
+ }
3824
+ ],
3825
+ outputs: [],
3826
+ stateMutability: "nonpayable"
3827
+ },
3828
+ {
3829
+ type: "function",
3830
+ name: "terminateApp",
3831
+ inputs: [
3832
+ {
3833
+ name: "app",
3834
+ type: "address",
3835
+ internalType: "contractIApp"
3836
+ }
3837
+ ],
3838
+ outputs: [],
3839
+ stateMutability: "nonpayable"
3840
+ },
3841
+ {
3842
+ type: "function",
3843
+ name: "terminateAppByAdmin",
3844
+ inputs: [
3845
+ {
3846
+ name: "app",
3847
+ type: "address",
3848
+ internalType: "contractIApp"
3849
+ }
3850
+ ],
3851
+ outputs: [],
3852
+ stateMutability: "nonpayable"
3853
+ },
3854
+ {
3855
+ type: "function",
3856
+ name: "updateAppMetadataURI",
3857
+ inputs: [
3858
+ {
3859
+ name: "app",
3860
+ type: "address",
3861
+ internalType: "contractIApp"
3862
+ },
3863
+ {
3864
+ name: "metadataURI",
3865
+ type: "string",
3866
+ internalType: "string"
3867
+ }
3868
+ ],
3869
+ outputs: [],
3870
+ stateMutability: "nonpayable"
3871
+ },
3872
+ {
3873
+ type: "function",
3874
+ name: "upgradeApp",
3875
+ inputs: [
3876
+ {
3877
+ name: "app",
3878
+ type: "address",
3879
+ internalType: "contractIApp"
3880
+ },
3881
+ {
3882
+ name: "release",
3883
+ type: "tuple",
3884
+ internalType: "structIAppController.Release",
3885
+ components: [
3886
+ {
3887
+ name: "rmsRelease",
3888
+ type: "tuple",
3889
+ internalType: "structIReleaseManagerTypes.Release",
3890
+ components: [
3891
+ {
3892
+ name: "artifacts",
3893
+ type: "tuple[]",
3894
+ internalType: "structIReleaseManagerTypes.Artifact[]",
3895
+ components: [
3896
+ {
3897
+ name: "digest",
3898
+ type: "bytes32",
3899
+ internalType: "bytes32"
3900
+ },
3901
+ {
3902
+ name: "registry",
3903
+ type: "string",
3904
+ internalType: "string"
3905
+ }
3906
+ ]
3907
+ },
3908
+ {
3909
+ name: "upgradeByTime",
3910
+ type: "uint32",
3911
+ internalType: "uint32"
3912
+ }
3913
+ ]
3914
+ },
3915
+ {
3916
+ name: "publicEnv",
3917
+ type: "bytes",
3918
+ internalType: "bytes"
3919
+ },
3920
+ {
3921
+ name: "encryptedEnv",
3922
+ type: "bytes",
3923
+ internalType: "bytes"
3924
+ },
3925
+ {
3926
+ name: "containerPolicy",
3927
+ type: "tuple",
3928
+ internalType: "structIAppController.ContainerPolicy",
3929
+ components: [
3930
+ {
3931
+ name: "args",
3932
+ type: "string[]",
3933
+ internalType: "string[]"
3934
+ },
3935
+ {
3936
+ name: "cmdOverride",
3937
+ type: "string[]",
3938
+ internalType: "string[]"
3939
+ },
3940
+ {
3941
+ name: "env",
3942
+ type: "tuple[]",
3943
+ internalType: "structIAppController.EnvVar[]",
3944
+ components: [
3945
+ {
3946
+ name: "key",
3947
+ type: "string",
3948
+ internalType: "string"
3949
+ },
3950
+ {
3951
+ name: "value",
3952
+ type: "string",
3953
+ internalType: "string"
3954
+ }
3955
+ ]
3956
+ },
3957
+ {
3958
+ name: "envOverride",
3959
+ type: "tuple[]",
3960
+ internalType: "structIAppController.EnvVar[]",
3961
+ components: [
3962
+ {
3963
+ name: "key",
3964
+ type: "string",
3965
+ internalType: "string"
3966
+ },
3967
+ {
3968
+ name: "value",
3969
+ type: "string",
3970
+ internalType: "string"
3971
+ }
3972
+ ]
3973
+ },
3974
+ {
3975
+ name: "restartPolicy",
3976
+ type: "string",
3977
+ internalType: "string"
3978
+ }
3979
+ ]
3980
+ }
3981
+ ]
3982
+ }
3983
+ ],
3984
+ outputs: [
3985
+ {
3986
+ name: "",
3987
+ type: "uint256",
3988
+ internalType: "uint256"
3989
+ }
3990
+ ],
3991
+ stateMutability: "nonpayable"
3992
+ },
3993
+ {
3994
+ type: "function",
3995
+ name: "version",
3996
+ inputs: [],
3997
+ outputs: [
3998
+ {
3999
+ name: "",
4000
+ type: "string",
4001
+ internalType: "string"
4002
+ }
4003
+ ],
4004
+ stateMutability: "view"
4005
+ },
4006
+ {
4007
+ type: "event",
4008
+ name: "AppCreated",
4009
+ inputs: [
4010
+ {
4011
+ name: "creator",
4012
+ type: "address",
4013
+ indexed: true,
4014
+ internalType: "address"
4015
+ },
4016
+ {
4017
+ name: "app",
4018
+ type: "address",
4019
+ indexed: true,
4020
+ internalType: "contractIApp"
4021
+ },
4022
+ {
4023
+ name: "operatorSetId",
4024
+ type: "uint32",
4025
+ indexed: false,
4026
+ internalType: "uint32"
4027
+ }
4028
+ ],
4029
+ anonymous: false
4030
+ },
4031
+ {
4032
+ type: "event",
4033
+ name: "AppMetadataURIUpdated",
4034
+ inputs: [
4035
+ {
4036
+ name: "app",
4037
+ type: "address",
4038
+ indexed: true,
4039
+ internalType: "contractIApp"
4040
+ },
4041
+ {
4042
+ name: "metadataURI",
4043
+ type: "string",
4044
+ indexed: false,
4045
+ internalType: "string"
4046
+ }
4047
+ ],
4048
+ anonymous: false
4049
+ },
4050
+ {
4051
+ type: "event",
4052
+ name: "AppStarted",
4053
+ inputs: [
4054
+ {
4055
+ name: "app",
4056
+ type: "address",
4057
+ indexed: true,
4058
+ internalType: "contractIApp"
4059
+ }
4060
+ ],
4061
+ anonymous: false
4062
+ },
4063
+ {
4064
+ type: "event",
4065
+ name: "AppStopped",
4066
+ inputs: [
4067
+ {
4068
+ name: "app",
4069
+ type: "address",
4070
+ indexed: true,
4071
+ internalType: "contractIApp"
4072
+ }
4073
+ ],
4074
+ anonymous: false
4075
+ },
4076
+ {
4077
+ type: "event",
4078
+ name: "AppSuspended",
4079
+ inputs: [
4080
+ {
4081
+ name: "app",
4082
+ type: "address",
4083
+ indexed: true,
4084
+ internalType: "contractIApp"
4085
+ }
4086
+ ],
4087
+ anonymous: false
4088
+ },
4089
+ {
4090
+ type: "event",
4091
+ name: "AppTerminated",
4092
+ inputs: [
4093
+ {
4094
+ name: "app",
4095
+ type: "address",
4096
+ indexed: true,
4097
+ internalType: "contractIApp"
4098
+ }
4099
+ ],
4100
+ anonymous: false
4101
+ },
4102
+ {
4103
+ type: "event",
4104
+ name: "AppTerminatedByAdmin",
4105
+ inputs: [
4106
+ {
4107
+ name: "app",
4108
+ type: "address",
4109
+ indexed: true,
4110
+ internalType: "contractIApp"
4111
+ }
4112
+ ],
4113
+ anonymous: false
4114
+ },
4115
+ {
4116
+ type: "event",
4117
+ name: "AppUpgraded",
4118
+ inputs: [
4119
+ {
4120
+ name: "app",
4121
+ type: "address",
4122
+ indexed: true,
4123
+ internalType: "contractIApp"
4124
+ },
4125
+ {
4126
+ name: "rmsReleaseId",
4127
+ type: "uint256",
4128
+ indexed: false,
4129
+ internalType: "uint256"
4130
+ },
4131
+ {
4132
+ name: "release",
4133
+ type: "tuple",
4134
+ indexed: false,
4135
+ internalType: "structIAppController.Release",
4136
+ components: [
4137
+ {
4138
+ name: "rmsRelease",
4139
+ type: "tuple",
4140
+ internalType: "structIReleaseManagerTypes.Release",
4141
+ components: [
4142
+ {
4143
+ name: "artifacts",
4144
+ type: "tuple[]",
4145
+ internalType: "structIReleaseManagerTypes.Artifact[]",
4146
+ components: [
4147
+ {
4148
+ name: "digest",
4149
+ type: "bytes32",
4150
+ internalType: "bytes32"
4151
+ },
4152
+ {
4153
+ name: "registry",
4154
+ type: "string",
4155
+ internalType: "string"
4156
+ }
4157
+ ]
4158
+ },
4159
+ {
4160
+ name: "upgradeByTime",
4161
+ type: "uint32",
4162
+ internalType: "uint32"
4163
+ }
4164
+ ]
4165
+ },
4166
+ {
4167
+ name: "publicEnv",
4168
+ type: "bytes",
4169
+ internalType: "bytes"
4170
+ },
4171
+ {
4172
+ name: "encryptedEnv",
4173
+ type: "bytes",
4174
+ internalType: "bytes"
4175
+ },
4176
+ {
4177
+ name: "containerPolicy",
4178
+ type: "tuple",
4179
+ internalType: "structIAppController.ContainerPolicy",
4180
+ components: [
4181
+ {
4182
+ name: "args",
4183
+ type: "string[]",
4184
+ internalType: "string[]"
4185
+ },
4186
+ {
4187
+ name: "cmdOverride",
4188
+ type: "string[]",
4189
+ internalType: "string[]"
4190
+ },
4191
+ {
4192
+ name: "env",
4193
+ type: "tuple[]",
4194
+ internalType: "structIAppController.EnvVar[]",
4195
+ components: [
4196
+ {
4197
+ name: "key",
4198
+ type: "string",
4199
+ internalType: "string"
4200
+ },
4201
+ {
4202
+ name: "value",
4203
+ type: "string",
4204
+ internalType: "string"
4205
+ }
4206
+ ]
4207
+ },
4208
+ {
4209
+ name: "envOverride",
4210
+ type: "tuple[]",
4211
+ internalType: "structIAppController.EnvVar[]",
4212
+ components: [
4213
+ {
4214
+ name: "key",
4215
+ type: "string",
4216
+ internalType: "string"
4217
+ },
4218
+ {
4219
+ name: "value",
4220
+ type: "string",
4221
+ internalType: "string"
4222
+ }
4223
+ ]
4224
+ },
4225
+ {
4226
+ name: "restartPolicy",
4227
+ type: "string",
4228
+ internalType: "string"
4229
+ }
4230
+ ]
4231
+ }
4232
+ ]
4233
+ }
4234
+ ],
4235
+ anonymous: false
4236
+ },
4237
+ {
4238
+ type: "event",
4239
+ name: "GlobalMaxActiveAppsSet",
4240
+ inputs: [
4241
+ {
4242
+ name: "limit",
4243
+ type: "uint32",
4244
+ indexed: false,
4245
+ internalType: "uint32"
4246
+ }
4247
+ ],
4248
+ anonymous: false
4249
+ },
4250
+ {
4251
+ type: "event",
4252
+ name: "Initialized",
4253
+ inputs: [
4254
+ {
4255
+ name: "version",
4256
+ type: "uint8",
4257
+ indexed: false,
4258
+ internalType: "uint8"
4259
+ }
4260
+ ],
4261
+ anonymous: false
4262
+ },
4263
+ {
4264
+ type: "event",
4265
+ name: "MaxActiveAppsSet",
4266
+ inputs: [
4267
+ {
4268
+ name: "user",
4269
+ type: "address",
4270
+ indexed: true,
4271
+ internalType: "address"
4272
+ },
4273
+ {
4274
+ name: "limit",
4275
+ type: "uint32",
4276
+ indexed: false,
4277
+ internalType: "uint32"
4278
+ }
4279
+ ],
4280
+ anonymous: false
4281
+ },
4282
+ {
4283
+ type: "event",
4284
+ name: "UpgradeConfirmed",
4285
+ inputs: [
4286
+ {
4287
+ name: "app",
4288
+ type: "address",
4289
+ indexed: true,
4290
+ internalType: "contractIApp"
4291
+ },
4292
+ {
4293
+ name: "pendingReleaseBlockNumber",
4294
+ type: "uint32",
4295
+ indexed: false,
4296
+ internalType: "uint32"
4297
+ }
4298
+ ],
4299
+ anonymous: false
4300
+ },
4301
+ {
4302
+ type: "error",
4303
+ name: "AccountHasActiveApps",
4304
+ inputs: []
4305
+ },
4306
+ {
4307
+ type: "error",
4308
+ name: "AppAlreadyExists",
4309
+ inputs: []
4310
+ },
4311
+ {
4312
+ type: "error",
4313
+ name: "AppDoesNotExist",
4314
+ inputs: []
4315
+ },
4316
+ {
4317
+ type: "error",
4318
+ name: "GlobalMaxActiveAppsExceeded",
4319
+ inputs: []
4320
+ },
4321
+ {
4322
+ type: "error",
4323
+ name: "InvalidAppStatus",
4324
+ inputs: []
4325
+ },
4326
+ {
4327
+ type: "error",
4328
+ name: "InvalidPermissions",
4329
+ inputs: []
4330
+ },
4331
+ {
4332
+ type: "error",
4333
+ name: "InvalidReleaseMetadataURI",
4334
+ inputs: []
4335
+ },
4336
+ {
4337
+ type: "error",
4338
+ name: "InvalidShortString",
4339
+ inputs: []
4340
+ },
4341
+ {
4342
+ type: "error",
4343
+ name: "InvalidSignature",
4344
+ inputs: []
4345
+ },
4346
+ {
4347
+ type: "error",
4348
+ name: "MaxActiveAppsExceeded",
4349
+ inputs: []
4350
+ },
4351
+ {
4352
+ type: "error",
4353
+ name: "MoreThanOneArtifact",
4354
+ inputs: []
4355
+ },
4356
+ {
4357
+ type: "error",
4358
+ name: "NoPendingUpgrade",
4359
+ inputs: []
4360
+ },
4361
+ {
4362
+ type: "error",
4363
+ name: "SignatureExpired",
4364
+ inputs: []
4365
+ },
4366
+ {
4367
+ type: "error",
4368
+ name: "StringTooLong",
4369
+ inputs: [
4370
+ {
4371
+ name: "str",
4372
+ type: "string",
4373
+ internalType: "string"
4374
+ }
4375
+ ]
4376
+ }
4377
+ ];
4378
+
4379
+ // src/client/common/abis/AppController.v1_4.json
4380
+ var AppController_v1_4_default = [
4381
+ {
4382
+ type: "constructor",
4383
+ inputs: [
4384
+ {
4385
+ name: "_version",
4386
+ type: "string",
4387
+ internalType: "string"
4388
+ },
4389
+ {
4390
+ name: "_permissionController",
4391
+ type: "address",
4392
+ internalType: "contractIPermissionController"
4393
+ },
4394
+ {
4395
+ name: "_releaseManager",
4396
+ type: "address",
4397
+ internalType: "contractIReleaseManager"
4398
+ },
4399
+ {
4400
+ name: "_computeAVSRegistrar",
4401
+ type: "address",
4402
+ internalType: "contractIComputeAVSRegistrar"
4403
+ },
4404
+ {
4405
+ name: "_computeOperator",
4406
+ type: "address",
4407
+ internalType: "contractIComputeOperator"
4408
+ },
4409
+ {
4410
+ name: "_appBeacon",
4411
+ type: "address",
4412
+ internalType: "contractIBeacon"
4413
+ }
4414
+ ],
4415
+ stateMutability: "nonpayable"
4416
+ },
4417
+ {
4418
+ type: "function",
4419
+ name: "API_PERMISSION_TYPEHASH",
4420
+ inputs: [],
4421
+ outputs: [
4422
+ {
4423
+ name: "",
4424
+ type: "bytes32",
4425
+ internalType: "bytes32"
4426
+ }
4427
+ ],
4428
+ stateMutability: "view"
4429
+ },
4430
+ {
4431
+ type: "function",
4432
+ name: "appBeacon",
4433
+ inputs: [],
4434
+ outputs: [
4435
+ {
4436
+ name: "",
4437
+ type: "address",
4438
+ internalType: "contractIBeacon"
4439
+ }
4440
+ ],
4441
+ stateMutability: "view"
4442
+ },
4443
+ {
4444
+ type: "function",
4445
+ name: "calculateApiPermissionDigestHash",
4446
+ inputs: [
4447
+ {
4448
+ name: "permission",
4449
+ type: "bytes4",
4450
+ internalType: "bytes4"
4451
+ },
4452
+ {
4453
+ name: "expiry",
4454
+ type: "uint256",
4455
+ internalType: "uint256"
4456
+ }
4457
+ ],
4458
+ outputs: [
4459
+ {
4460
+ name: "",
4461
+ type: "bytes32",
4462
+ internalType: "bytes32"
4463
+ }
4464
+ ],
4465
+ stateMutability: "view"
4466
+ },
4467
+ {
4468
+ type: "function",
4469
+ name: "calculateAppId",
4470
+ inputs: [
4471
+ {
4472
+ name: "deployer",
4473
+ type: "address",
4474
+ internalType: "address"
4475
+ },
4476
+ {
4477
+ name: "salt",
4478
+ type: "bytes32",
4479
+ internalType: "bytes32"
4480
+ }
4481
+ ],
4482
+ outputs: [
4483
+ {
4484
+ name: "",
4485
+ type: "address",
4486
+ internalType: "contractIApp"
4487
+ }
4488
+ ],
4489
+ stateMutability: "view"
4490
+ },
4491
+ {
4492
+ type: "function",
4493
+ name: "computeAVSRegistrar",
4494
+ inputs: [],
4495
+ outputs: [
4496
+ {
4497
+ name: "",
4498
+ type: "address",
4499
+ internalType: "contractIComputeAVSRegistrar"
4500
+ }
4501
+ ],
4502
+ stateMutability: "view"
4503
+ },
4504
+ {
4505
+ type: "function",
4506
+ name: "computeOperator",
4507
+ inputs: [],
4508
+ outputs: [
4509
+ {
4510
+ name: "",
4511
+ type: "address",
4512
+ internalType: "contractIComputeOperator"
4513
+ }
4514
+ ],
4515
+ stateMutability: "view"
4516
+ },
4517
+ {
4518
+ type: "function",
4519
+ name: "createApp",
4520
+ inputs: [
4521
+ {
4522
+ name: "salt",
4523
+ type: "bytes32",
4524
+ internalType: "bytes32"
4525
+ },
4526
+ {
4527
+ name: "release",
4528
+ type: "tuple",
4529
+ internalType: "structIAppController.Release",
4530
+ components: [
4531
+ {
4532
+ name: "rmsRelease",
4533
+ type: "tuple",
4534
+ internalType: "structIReleaseManagerTypes.Release",
4535
+ components: [
4536
+ {
4537
+ name: "artifacts",
4538
+ type: "tuple[]",
4539
+ internalType: "structIReleaseManagerTypes.Artifact[]",
4540
+ components: [
4541
+ {
4542
+ name: "digest",
4543
+ type: "bytes32",
4544
+ internalType: "bytes32"
4545
+ },
4546
+ {
4547
+ name: "registry",
4548
+ type: "string",
4549
+ internalType: "string"
4550
+ }
4551
+ ]
4552
+ },
4553
+ {
4554
+ name: "upgradeByTime",
4555
+ type: "uint32",
4556
+ internalType: "uint32"
4557
+ }
4558
+ ]
4559
+ },
4560
+ {
4561
+ name: "publicEnv",
4562
+ type: "bytes",
4563
+ internalType: "bytes"
4564
+ },
4565
+ {
4566
+ name: "encryptedEnv",
4567
+ type: "bytes",
4568
+ internalType: "bytes"
4569
+ }
4570
+ ]
4571
+ }
4572
+ ],
4573
+ outputs: [
4574
+ {
4575
+ name: "app",
4576
+ type: "address",
4577
+ internalType: "contractIApp"
4578
+ }
4579
+ ],
4580
+ stateMutability: "nonpayable"
4581
+ },
4582
+ {
4583
+ type: "function",
4584
+ name: "createAppWithIsolatedBilling",
4585
+ inputs: [
4586
+ {
4587
+ name: "salt",
4588
+ type: "bytes32",
4589
+ internalType: "bytes32"
4590
+ },
4591
+ {
4592
+ name: "release",
4593
+ type: "tuple",
4594
+ internalType: "structIAppController.Release",
4595
+ components: [
4596
+ {
4597
+ name: "rmsRelease",
4598
+ type: "tuple",
4599
+ internalType: "structIReleaseManagerTypes.Release",
4600
+ components: [
4601
+ {
4602
+ name: "artifacts",
4603
+ type: "tuple[]",
4604
+ internalType: "structIReleaseManagerTypes.Artifact[]",
4605
+ components: [
4606
+ {
4607
+ name: "digest",
4608
+ type: "bytes32",
4609
+ internalType: "bytes32"
4610
+ },
4611
+ {
4612
+ name: "registry",
4613
+ type: "string",
4614
+ internalType: "string"
4615
+ }
4616
+ ]
4617
+ },
4618
+ {
4619
+ name: "upgradeByTime",
4620
+ type: "uint32",
4621
+ internalType: "uint32"
4622
+ }
4623
+ ]
4624
+ },
4625
+ {
4626
+ name: "publicEnv",
4627
+ type: "bytes",
4628
+ internalType: "bytes"
4629
+ },
4630
+ {
4631
+ name: "encryptedEnv",
4632
+ type: "bytes",
4633
+ internalType: "bytes"
4634
+ }
4635
+ ]
4636
+ }
4637
+ ],
4638
+ outputs: [
4639
+ {
4640
+ name: "app",
4641
+ type: "address",
4642
+ internalType: "contractIApp"
4643
+ }
4644
+ ],
4645
+ stateMutability: "nonpayable"
4646
+ },
4647
+ {
4648
+ type: "function",
4649
+ name: "domainSeparator",
4650
+ inputs: [],
4651
+ outputs: [
4652
+ {
4653
+ name: "",
4654
+ type: "bytes32",
4655
+ internalType: "bytes32"
4656
+ }
4657
+ ],
4658
+ stateMutability: "view"
4659
+ },
4660
+ {
4661
+ type: "function",
4662
+ name: "getActiveAppCount",
4663
+ inputs: [
4664
+ {
4665
+ name: "user",
4666
+ type: "address",
4667
+ internalType: "address"
4668
+ }
4669
+ ],
4670
+ outputs: [
4671
+ {
4672
+ name: "",
4673
+ type: "uint32",
4674
+ internalType: "uint32"
4675
+ }
4676
+ ],
4677
+ stateMutability: "view"
4678
+ },
4679
+ {
4680
+ type: "function",
4681
+ name: "getBillingType",
4682
+ inputs: [
4683
+ {
4684
+ name: "app",
4685
+ type: "address",
4686
+ internalType: "address"
4687
+ }
4688
+ ],
4689
+ outputs: [
4690
+ {
4691
+ name: "",
4692
+ type: "uint8",
4693
+ internalType: "uint8"
4694
+ }
4695
+ ],
4696
+ stateMutability: "view"
4697
+ },
4698
+ {
4699
+ type: "function",
4700
+ name: "getAppCreator",
4701
+ inputs: [
4702
+ {
4703
+ name: "app",
4704
+ type: "address",
4705
+ internalType: "contractIApp"
4706
+ }
4707
+ ],
4708
+ outputs: [
4709
+ {
4710
+ name: "",
4711
+ type: "address",
4712
+ internalType: "address"
4713
+ }
4714
+ ],
4715
+ stateMutability: "view"
4716
+ },
4717
+ {
4718
+ type: "function",
4719
+ name: "getAppLatestReleaseBlockNumber",
4720
+ inputs: [
4721
+ {
4722
+ name: "app",
4723
+ type: "address",
4724
+ internalType: "contractIApp"
4725
+ }
4726
+ ],
4727
+ outputs: [
4728
+ {
4729
+ name: "",
4730
+ type: "uint32",
4731
+ internalType: "uint32"
4732
+ }
4733
+ ],
4734
+ stateMutability: "view"
4735
+ },
4736
+ {
4737
+ type: "function",
4738
+ name: "getAppOperatorSetId",
4739
+ inputs: [
4740
+ {
4741
+ name: "app",
4742
+ type: "address",
4743
+ internalType: "contractIApp"
4744
+ }
4745
+ ],
4746
+ outputs: [
4747
+ {
4748
+ name: "",
4749
+ type: "uint32",
4750
+ internalType: "uint32"
4751
+ }
4752
+ ],
4753
+ stateMutability: "view"
4754
+ },
4755
+ {
4756
+ type: "function",
4757
+ name: "getAppStatus",
4758
+ inputs: [
4759
+ {
4760
+ name: "app",
4761
+ type: "address",
4762
+ internalType: "contractIApp"
4763
+ }
4764
+ ],
4765
+ outputs: [
4766
+ {
4767
+ name: "",
4768
+ type: "uint8",
4769
+ internalType: "enumIAppController.AppStatus"
4770
+ }
4771
+ ],
4772
+ stateMutability: "view"
4773
+ },
4774
+ {
4775
+ type: "function",
4776
+ name: "getApps",
4777
+ inputs: [
4778
+ {
4779
+ name: "offset",
4780
+ type: "uint256",
4781
+ internalType: "uint256"
4782
+ },
4783
+ {
4784
+ name: "limit",
4785
+ type: "uint256",
4786
+ internalType: "uint256"
4787
+ }
4788
+ ],
4789
+ outputs: [
4790
+ {
4791
+ name: "apps",
4792
+ type: "address[]",
4793
+ internalType: "contractIApp[]"
4794
+ },
4795
+ {
4796
+ name: "appConfigsMem",
4797
+ type: "tuple[]",
4798
+ internalType: "structIAppController.AppConfig[]",
4799
+ components: [
4800
+ {
4801
+ name: "creator",
4802
+ type: "address",
4803
+ internalType: "address"
4804
+ },
4805
+ {
4806
+ name: "operatorSetId",
4807
+ type: "uint32",
4808
+ internalType: "uint32"
4809
+ },
4810
+ {
4811
+ name: "latestReleaseBlockNumber",
4812
+ type: "uint32",
4813
+ internalType: "uint32"
4814
+ },
4815
+ {
4816
+ name: "status",
4817
+ type: "uint8",
4818
+ internalType: "enumIAppController.AppStatus"
4819
+ }
4820
+ ]
4821
+ }
4822
+ ],
4823
+ stateMutability: "view"
4824
+ },
4825
+ {
4826
+ type: "function",
4827
+ name: "getAppsByBillingAccount",
4828
+ inputs: [
4829
+ {
4830
+ name: "account",
4831
+ type: "address",
4832
+ internalType: "address"
4833
+ },
4834
+ {
4835
+ name: "offset",
4836
+ type: "uint256",
4837
+ internalType: "uint256"
4838
+ },
4839
+ {
4840
+ name: "limit",
4841
+ type: "uint256",
4842
+ internalType: "uint256"
4843
+ }
4844
+ ],
4845
+ outputs: [
4846
+ {
4847
+ name: "apps",
4848
+ type: "address[]",
4849
+ internalType: "contractIApp[]"
4850
+ },
4851
+ {
4852
+ name: "appConfigsMem",
4853
+ type: "tuple[]",
4854
+ internalType: "structIAppController.AppConfig[]",
4855
+ components: [
4856
+ {
4857
+ name: "creator",
4858
+ type: "address",
4859
+ internalType: "address"
4860
+ },
4861
+ {
4862
+ name: "operatorSetId",
4863
+ type: "uint32",
4864
+ internalType: "uint32"
4865
+ },
4866
+ {
4867
+ name: "latestReleaseBlockNumber",
4868
+ type: "uint32",
4869
+ internalType: "uint32"
4870
+ },
4871
+ {
4872
+ name: "status",
4873
+ type: "uint8",
4874
+ internalType: "enumIAppController.AppStatus"
4875
+ }
4876
+ ]
4877
+ }
4878
+ ],
4879
+ stateMutability: "view"
4880
+ },
4881
+ {
4882
+ type: "function",
4883
+ name: "getAppsByCreator",
4884
+ inputs: [
4885
+ {
4886
+ name: "creator",
4887
+ type: "address",
4888
+ internalType: "address"
4889
+ },
4890
+ {
4891
+ name: "offset",
4892
+ type: "uint256",
4893
+ internalType: "uint256"
4894
+ },
4895
+ {
4896
+ name: "limit",
4897
+ type: "uint256",
4898
+ internalType: "uint256"
4899
+ }
4900
+ ],
4901
+ outputs: [
4902
+ {
4903
+ name: "apps",
4904
+ type: "address[]",
4905
+ internalType: "contractIApp[]"
4906
+ },
4907
+ {
4908
+ name: "appConfigsMem",
4909
+ type: "tuple[]",
4910
+ internalType: "structIAppController.AppConfig[]",
4911
+ components: [
4912
+ {
4913
+ name: "creator",
4914
+ type: "address",
4915
+ internalType: "address"
4916
+ },
4917
+ {
4918
+ name: "operatorSetId",
4919
+ type: "uint32",
4920
+ internalType: "uint32"
4921
+ },
4922
+ {
4923
+ name: "latestReleaseBlockNumber",
4924
+ type: "uint32",
4925
+ internalType: "uint32"
4926
+ },
4927
+ {
4928
+ name: "status",
4929
+ type: "uint8",
4930
+ internalType: "enumIAppController.AppStatus"
4931
+ }
4932
+ ]
4933
+ }
4934
+ ],
4935
+ stateMutability: "view"
4936
+ },
4937
+ {
4938
+ type: "function",
4939
+ name: "getAppsByDeveloper",
4940
+ inputs: [
4941
+ {
4942
+ name: "developer",
4943
+ type: "address",
4944
+ internalType: "address"
4945
+ },
4946
+ {
4947
+ name: "offset",
4948
+ type: "uint256",
4949
+ internalType: "uint256"
4950
+ },
4951
+ {
4952
+ name: "limit",
4953
+ type: "uint256",
4954
+ internalType: "uint256"
4955
+ }
4956
+ ],
4957
+ outputs: [
4958
+ {
4959
+ name: "apps",
4960
+ type: "address[]",
4961
+ internalType: "contractIApp[]"
4962
+ },
4963
+ {
4964
+ name: "appConfigsMem",
4965
+ type: "tuple[]",
4966
+ internalType: "structIAppController.AppConfig[]",
4967
+ components: [
4968
+ {
4969
+ name: "creator",
4970
+ type: "address",
4971
+ internalType: "address"
4972
+ },
4973
+ {
4974
+ name: "operatorSetId",
4975
+ type: "uint32",
4976
+ internalType: "uint32"
4977
+ },
4978
+ {
4979
+ name: "latestReleaseBlockNumber",
4980
+ type: "uint32",
4981
+ internalType: "uint32"
4982
+ },
4983
+ {
4984
+ name: "status",
4985
+ type: "uint8",
4986
+ internalType: "enumIAppController.AppStatus"
4987
+ }
4988
+ ]
4989
+ }
4990
+ ],
4991
+ stateMutability: "view"
4992
+ },
4993
+ {
4994
+ type: "function",
4995
+ name: "getMaxActiveAppsPerUser",
4996
+ inputs: [
4997
+ {
4998
+ name: "user",
4999
+ type: "address",
5000
+ internalType: "address"
5001
+ }
5002
+ ],
5003
+ outputs: [
5004
+ {
5005
+ name: "",
5006
+ type: "uint32",
5007
+ internalType: "uint32"
5008
+ }
5009
+ ],
5010
+ stateMutability: "view"
5011
+ },
5012
+ {
5013
+ type: "function",
5014
+ name: "globalActiveAppCount",
5015
+ inputs: [],
5016
+ outputs: [
5017
+ {
5018
+ name: "",
5019
+ type: "uint32",
5020
+ internalType: "uint32"
5021
+ }
5022
+ ],
5023
+ stateMutability: "view"
5024
+ },
5025
+ {
5026
+ type: "function",
5027
+ name: "initialize",
5028
+ inputs: [
5029
+ {
5030
+ name: "admin",
5031
+ type: "address",
5032
+ internalType: "address"
5033
+ }
5034
+ ],
5035
+ outputs: [],
5036
+ stateMutability: "nonpayable"
5037
+ },
5038
+ {
5039
+ type: "function",
3498
5040
  name: "maxGlobalActiveApps",
3499
5041
  inputs: [],
3500
5042
  outputs: [
@@ -4519,6 +6061,38 @@ var PermissionController_default = [
4519
6061
  ];
4520
6062
 
4521
6063
  // src/client/common/contract/caller.ts
6064
+ function appControllerAbiFor(environmentConfig) {
6065
+ return environmentConfig.releaseAbiVersion === "v1.4" ? AppController_v1_4_default : AppController_default;
6066
+ }
6067
+ function supportsContainerPolicy(environmentConfig) {
6068
+ return environmentConfig.releaseAbiVersion !== "v1.4";
6069
+ }
6070
+ function containerPolicyForViem(policy = EMPTY_CONTAINER_POLICY) {
6071
+ return {
6072
+ args: policy.args,
6073
+ cmdOverride: policy.cmdOverride,
6074
+ env: policy.env.map((e) => ({ key: e.key, value: e.value })),
6075
+ envOverride: policy.envOverride.map((e) => ({ key: e.key, value: e.value })),
6076
+ restartPolicy: policy.restartPolicy
6077
+ };
6078
+ }
6079
+ function releaseForViem(release, environmentConfig) {
6080
+ const base = {
6081
+ rmsRelease: {
6082
+ artifacts: release.rmsRelease.artifacts.map((artifact) => ({
6083
+ digest: `0x${bytesToHex(artifact.digest).slice(2).padStart(64, "0")}`,
6084
+ registry: artifact.registry
6085
+ })),
6086
+ upgradeByTime: release.rmsRelease.upgradeByTime
6087
+ },
6088
+ publicEnv: bytesToHex(release.publicEnv),
6089
+ encryptedEnv: bytesToHex(release.encryptedEnv)
6090
+ };
6091
+ if (!supportsContainerPolicy(environmentConfig)) {
6092
+ return base;
6093
+ }
6094
+ return { ...base, containerPolicy: containerPolicyForViem(release.containerPolicy) };
6095
+ }
4522
6096
  function formatETH(wei) {
4523
6097
  const eth = Number(wei) / 1e18;
4524
6098
  const costStr = eth.toFixed(6);
@@ -4556,7 +6130,7 @@ async function calculateAppID(options) {
4556
6130
  const saltHex = `0x${paddedSaltHex}`;
4557
6131
  const appID = await publicClient.readContract({
4558
6132
  address: environmentConfig.appControllerAddress,
4559
- abi: AppController_default,
6133
+ abi: appControllerAbiFor(environmentConfig),
4560
6134
  functionName: "calculateAppId",
4561
6135
  args: [ownerAddress, saltHex]
4562
6136
  });
@@ -4580,22 +6154,12 @@ async function prepareDeployBatch(options, logger = noopLogger) {
4580
6154
  const saltHexString = bytesToHex(salt).slice(2);
4581
6155
  const paddedSaltHex = saltHexString.padStart(64, "0");
4582
6156
  const saltHex = `0x${paddedSaltHex}`;
4583
- const releaseForViem = {
4584
- rmsRelease: {
4585
- artifacts: release.rmsRelease.artifacts.map((artifact) => ({
4586
- digest: `0x${bytesToHex(artifact.digest).slice(2).padStart(64, "0")}`,
4587
- registry: artifact.registry
4588
- })),
4589
- upgradeByTime: release.rmsRelease.upgradeByTime
4590
- },
4591
- publicEnv: bytesToHex(release.publicEnv),
4592
- encryptedEnv: bytesToHex(release.encryptedEnv)
4593
- };
6157
+ const release_ = releaseForViem(release, environmentConfig);
4594
6158
  const functionName = options.billTo === "app" ? "createAppWithIsolatedBilling" : "createApp";
4595
6159
  const createData = encodeFunctionData2({
4596
- abi: AppController_default,
6160
+ abi: appControllerAbiFor(environmentConfig),
4597
6161
  functionName,
4598
- args: [saltHex, releaseForViem]
6162
+ args: [saltHex, release_]
4599
6163
  });
4600
6164
  const acceptAdminData = encodeFunctionData2({
4601
6165
  abi: PermissionController_default,
@@ -4851,21 +6415,11 @@ async function prepareUpgradeBatch(options) {
4851
6415
  publicLogs,
4852
6416
  needsPermissionChange
4853
6417
  } = options;
4854
- const releaseForViem = {
4855
- rmsRelease: {
4856
- artifacts: release.rmsRelease.artifacts.map((artifact) => ({
4857
- digest: `0x${bytesToHex(artifact.digest).slice(2).padStart(64, "0")}`,
4858
- registry: artifact.registry
4859
- })),
4860
- upgradeByTime: release.rmsRelease.upgradeByTime
4861
- },
4862
- publicEnv: bytesToHex(release.publicEnv),
4863
- encryptedEnv: bytesToHex(release.encryptedEnv)
4864
- };
6418
+ const release_ = releaseForViem(release, environmentConfig);
4865
6419
  const upgradeData = encodeFunctionData2({
4866
- abi: AppController_default,
6420
+ abi: appControllerAbiFor(environmentConfig),
4867
6421
  functionName: "upgradeApp",
4868
- args: [appID, releaseForViem]
6422
+ args: [appID, release_]
4869
6423
  });
4870
6424
  const executions = [
4871
6425
  {
@@ -4999,7 +6553,7 @@ ${pendingMessage}`);
4999
6553
  if (callError.data) {
5000
6554
  try {
5001
6555
  const decoded = decodeErrorResult2({
5002
- abi: AppController_default,
6556
+ abi: appControllerAbiFor(environmentConfig),
5003
6557
  data: callError.data
5004
6558
  });
5005
6559
  const formattedError = formatAppControllerError(decoded);
@@ -5052,7 +6606,7 @@ function formatAppControllerError(decoded) {
5052
6606
  async function getActiveAppCount(publicClient, environmentConfig, user) {
5053
6607
  const count = await publicClient.readContract({
5054
6608
  address: environmentConfig.appControllerAddress,
5055
- abi: AppController_default,
6609
+ abi: appControllerAbiFor(environmentConfig),
5056
6610
  functionName: "getActiveAppCount",
5057
6611
  args: [user]
5058
6612
  });
@@ -5061,7 +6615,7 @@ async function getActiveAppCount(publicClient, environmentConfig, user) {
5061
6615
  async function getMaxActiveAppsPerUser(publicClient, environmentConfig, user) {
5062
6616
  const quota = await publicClient.readContract({
5063
6617
  address: environmentConfig.appControllerAddress,
5064
- abi: AppController_default,
6618
+ abi: appControllerAbiFor(environmentConfig),
5065
6619
  functionName: "getMaxActiveAppsPerUser",
5066
6620
  args: [user]
5067
6621
  });
@@ -5070,7 +6624,7 @@ async function getMaxActiveAppsPerUser(publicClient, environmentConfig, user) {
5070
6624
  async function getAppsByCreator(publicClient, environmentConfig, creator, offset, limit) {
5071
6625
  const result = await publicClient.readContract({
5072
6626
  address: environmentConfig.appControllerAddress,
5073
- abi: AppController_default,
6627
+ abi: appControllerAbiFor(environmentConfig),
5074
6628
  functionName: "getAppsByCreator",
5075
6629
  args: [creator, offset, limit]
5076
6630
  });
@@ -5082,7 +6636,7 @@ async function getAppsByCreator(publicClient, environmentConfig, creator, offset
5082
6636
  async function getAppsByDeveloper(publicClient, environmentConfig, developer, offset, limit) {
5083
6637
  const result = await publicClient.readContract({
5084
6638
  address: environmentConfig.appControllerAddress,
5085
- abi: AppController_default,
6639
+ abi: appControllerAbiFor(environmentConfig),
5086
6640
  functionName: "getAppsByDeveloper",
5087
6641
  args: [developer, offset, limit]
5088
6642
  });
@@ -5094,7 +6648,7 @@ async function getAppsByDeveloper(publicClient, environmentConfig, developer, of
5094
6648
  async function getBillingType(publicClient, environmentConfig, app) {
5095
6649
  const result = await publicClient.readContract({
5096
6650
  address: environmentConfig.appControllerAddress,
5097
- abi: AppController_default,
6651
+ abi: appControllerAbiFor(environmentConfig),
5098
6652
  functionName: "getBillingType",
5099
6653
  args: [app]
5100
6654
  });
@@ -5103,7 +6657,7 @@ async function getBillingType(publicClient, environmentConfig, app) {
5103
6657
  async function getAppsByBillingAccount(publicClient, environmentConfig, account, offset, limit) {
5104
6658
  const result = await publicClient.readContract({
5105
6659
  address: environmentConfig.appControllerAddress,
5106
- abi: AppController_default,
6660
+ abi: appControllerAbiFor(environmentConfig),
5107
6661
  functionName: "getAppsByBillingAccount",
5108
6662
  args: [account, offset, limit]
5109
6663
  });
@@ -5135,7 +6689,7 @@ async function getAllAppsByDeveloper(publicClient, env, developer, pageSize = 10
5135
6689
  async function suspend(options, logger = noopLogger) {
5136
6690
  const { walletClient, publicClient, environmentConfig, account, apps } = options;
5137
6691
  const suspendData = encodeFunctionData2({
5138
- abi: AppController_default,
6692
+ abi: appControllerAbiFor(environmentConfig),
5139
6693
  functionName: "suspend",
5140
6694
  args: [account, apps]
5141
6695
  });
@@ -5562,6 +7116,7 @@ export {
5562
7116
  BillingApiClient,
5563
7117
  BillingSessionError,
5564
7118
  BuildApiClient,
7119
+ EMPTY_CONTAINER_POLICY,
5565
7120
  SessionError,
5566
7121
  UserApiClient,
5567
7122
  addHexPrefix,