@layr-labs/ecloud-sdk 1.0.0-devep7 → 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,27 +186,28 @@ 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",
193
199
  userApiServerURL: "https://userapi-compute-sepolia-dev.eigencloud.xyz",
194
200
  defaultRPCURL: "https://ethereum-sepolia-rpc.publicnode.com",
195
201
  usdcCreditsAddress: "0xbdA3897c3A428763B59015C64AB766c288C97376",
196
- platformEnv: PLATFORM_ENV_TESTNET_SEPOLIA,
197
- appBaseDomain: DEFAULT_APP_BASE_DOMAIN
202
+ baseUsdcCreditsAddress: "0x7673a47463F80c6a3553Db9E54c8cDcd5313d0ac",
203
+ baseRPCURL: "https://base-sepolia-rpc.publicnode.com"
198
204
  },
199
205
  sepolia: {
200
206
  name: "sepolia",
201
207
  build: "prod",
202
208
  appControllerAddress: "0x0dd810a6ffba6a9820a10d97b659f07d8d23d4E2",
209
+ releaseAbiVersion: "v1.4",
210
+ // prod still on AppController v1.4.0 (3-field Release)
203
211
  permissionControllerAddress: ChainAddresses[SEPOLIA_CHAIN_ID].PermissionController,
204
212
  erc7702DelegatorAddress: CommonAddresses.ERC7702Delegator,
205
213
  kmsServerURL: "http://10.128.15.203:8080",
@@ -207,21 +215,21 @@ var ENVIRONMENTS = {
207
215
  defaultRPCURL: "https://ethereum-sepolia-rpc.publicnode.com",
208
216
  billingRPCURL: "https://ethereum-rpc.publicnode.com",
209
217
  usdcCreditsAddress: "0xed9c88640ca9149Bd9f7ee6620074af10F2E145d",
210
- platformEnv: PLATFORM_ENV_TESTNET_SEPOLIA,
211
- appBaseDomain: DEFAULT_APP_BASE_DOMAIN
218
+ baseUsdcCreditsAddress: "0x7673a47463F80c6a3553Db9E54c8cDcd5313d0ac",
219
+ baseRPCURL: "https://base-sepolia-rpc.publicnode.com"
212
220
  },
213
221
  "mainnet-alpha": {
214
222
  name: "mainnet-alpha",
215
223
  build: "prod",
216
224
  appControllerAddress: "0xc38d35Fc995e75342A21CBd6D770305b142Fbe67",
225
+ releaseAbiVersion: "v1.4",
226
+ // prod still on AppController v1.4.0 (3-field Release)
217
227
  permissionControllerAddress: ChainAddresses[MAINNET_CHAIN_ID].PermissionController,
218
228
  erc7702DelegatorAddress: CommonAddresses.ERC7702Delegator,
219
229
  kmsServerURL: "http://10.128.0.2:8080",
220
230
  userApiServerURL: "https://userapi-compute.eigencloud.xyz",
221
231
  defaultRPCURL: "https://ethereum-rpc.publicnode.com",
222
- usdcCreditsAddress: "0xed9c88640ca9149Bd9f7ee6620074af10F2E145d",
223
- platformEnv: PLATFORM_ENV_MAINNET_ETHEREUM,
224
- appBaseDomain: DEFAULT_APP_BASE_DOMAIN
232
+ usdcCreditsAddress: "0xed9c88640ca9149Bd9f7ee6620074af10F2E145d"
225
233
  }
226
234
  };
227
235
  var CHAIN_ID_TO_ENVIRONMENT = {
@@ -281,7 +289,7 @@ function getBillingEnvironmentConfig(build) {
281
289
  };
282
290
  }
283
291
  function getBuildType() {
284
- const buildTimeType = true ? "dev"?.toLowerCase() : void 0;
292
+ const buildTimeType = true ? "prod"?.toLowerCase() : void 0;
285
293
  const runtimeType = process.env.BUILD_TYPE?.toLowerCase();
286
294
  const buildType = buildTimeType || runtimeType;
287
295
  if (buildType === "dev") {
@@ -312,8 +320,8 @@ import { sepolia as sepolia2 } from "viem/chains";
312
320
  import { privateKeyToAccount } from "viem/accounts";
313
321
 
314
322
  // src/client/common/constants.ts
315
- import { sepolia, mainnet } from "viem/chains";
316
- var SUPPORTED_CHAINS = [mainnet, sepolia];
323
+ import { sepolia, mainnet, baseSepolia } from "viem/chains";
324
+ var SUPPORTED_CHAINS = [mainnet, sepolia, baseSepolia];
317
325
 
318
326
  // src/client/common/utils/helpers.ts
319
327
  function getChainFromID(chainID, fallback2 = sepolia2) {
@@ -590,6 +598,7 @@ import axios from "axios";
590
598
  var MAX_RETRIES = 5;
591
599
  var INITIAL_BACKOFF_MS = 1e3;
592
600
  var MAX_BACKOFF_MS = 3e4;
601
+ var RETRYABLE_STATUSES = /* @__PURE__ */ new Set([429, 502, 503, 504]);
593
602
  function sleep(ms) {
594
603
  return new Promise((resolve) => setTimeout(resolve, ms));
595
604
  }
@@ -609,7 +618,7 @@ async function requestWithRetry(config) {
609
618
  for (let attempt = 0; attempt <= MAX_RETRIES; attempt++) {
610
619
  const res = await axios({ ...config, validateStatus: () => true });
611
620
  lastResponse = res;
612
- if (res.status !== 429) {
621
+ if (!RETRYABLE_STATUSES.has(res.status)) {
613
622
  return res;
614
623
  }
615
624
  if (attempt < MAX_RETRIES) {
@@ -638,7 +647,7 @@ var CanViewAppLogsPermission = "0x2fd3f2fe";
638
647
  var CanViewSensitiveAppInfoPermission = "0x0e67b22f";
639
648
  var CanUpdateAppProfilePermission = "0x036fef61";
640
649
  function getDefaultClientId() {
641
- const version = true ? "1.0.0-devep7" : "0.0.0";
650
+ const version = true ? "1.0.0" : "0.0.0";
642
651
  return `ecloud-sdk/v${version}`;
643
652
  }
644
653
  var UserApiClient = class {
@@ -673,7 +682,6 @@ var UserApiClient = class {
673
682
  status: app.app_status,
674
683
  ip: app.ip,
675
684
  machineType: app.machine_type,
676
- hostname: app.hostname,
677
685
  profile: app.profile,
678
686
  metrics: app.metrics,
679
687
  evmAddresses,
@@ -739,28 +747,6 @@ var UserApiClient = class {
739
747
  status: app.app_status || app.App_Status || ""
740
748
  }));
741
749
  }
742
- /**
743
- * Get deployments for an app from the gRPC-gateway endpoint.
744
- * Returns deployment records including upgrade_phase for tracking upgrade progress.
745
- *
746
- * Endpoint: GET /v1/apps/:appAddress/deployments
747
- */
748
- async getDeployments(appAddress) {
749
- const endpoint = `${this.config.userApiServerURL}/v1/apps/${appAddress}/deployments`;
750
- const response = await this.makeEIP712AuthenticatedRequest(endpoint);
751
- const result = await response.json();
752
- const deployments = result.deployments || [];
753
- return deployments.map((dep) => ({
754
- id: dep.id || "",
755
- externalId: dep.external_id || dep.externalId || "",
756
- endpoint: dep.endpoint || "",
757
- releaseId: dep.release_id || dep.releaseId || "",
758
- upgradePhase: dep.upgrade_phase || dep.upgradePhase || "",
759
- replacesDeploymentId: dep.replaces_deployment_id || dep.replacesDeploymentId || "",
760
- createdAt: dep.created_at || dep.createdAt || "",
761
- updatedAt: dep.updated_at || dep.updatedAt || ""
762
- }));
763
- }
764
750
  /**
765
751
  * Upload app profile information with optional image
766
752
  *
@@ -894,48 +880,6 @@ Please check:
894
880
  "X-eigenx-expiry": expiry.toString()
895
881
  };
896
882
  }
897
- /**
898
- * Make an EIP-712 authenticated request to the gRPC-gateway endpoints.
899
- * Uses the billing/compute auth pattern: Authorization + X-Account + X-Expiry headers.
900
- */
901
- async makeEIP712AuthenticatedRequest(url) {
902
- const expiry = BigInt(Math.floor(Date.now() / 1e3) + 5 * 60);
903
- const { signature } = await calculateBillingAuthSignature({
904
- walletClient: this.walletClient,
905
- product: "compute",
906
- expiry
907
- });
908
- const headers = {
909
- Authorization: `Bearer ${signature}`,
910
- "X-Account": this.address,
911
- "X-Expiry": expiry.toString(),
912
- "x-client-id": this.clientId
913
- };
914
- try {
915
- const response = await requestWithRetry({
916
- method: "GET",
917
- url,
918
- headers,
919
- maxRedirects: 0,
920
- withCredentials: true
921
- });
922
- const status = response.status;
923
- if (status < 200 || status >= 300) {
924
- const body = typeof response.data === "string" ? response.data : JSON.stringify(response.data);
925
- throw new Error(`gRPC-gateway request failed: ${status} - ${body}`);
926
- }
927
- return {
928
- json: async () => response.data,
929
- text: async () => typeof response.data === "string" ? response.data : JSON.stringify(response.data)
930
- };
931
- } catch (error) {
932
- if (error.message?.includes("fetch failed") || error.message?.includes("ECONNREFUSED") || error.message?.includes("ENOTFOUND") || error.cause) {
933
- const cause = error.cause?.message || error.cause || error.message;
934
- throw new Error(`Failed to connect to API at ${url}: ${cause}`);
935
- }
936
- throw error;
937
- }
938
- }
939
883
  // ==========================================================================
940
884
  // SIWE Session Management
941
885
  // ==========================================================================
@@ -1306,6 +1250,63 @@ var BillingApiClient = class {
1306
1250
  return resp.json();
1307
1251
  }
1308
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
+ // ==========================================================================
1309
1310
  // Internal Methods
1310
1311
  // ==========================================================================
1311
1312
  /**
@@ -2968,6 +2969,19 @@ var AppController_default = [
2968
2969
  ],
2969
2970
  stateMutability: "view"
2970
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
+ },
2971
2985
  {
2972
2986
  type: "function",
2973
2987
  name: "createApp",
@@ -3020,6 +3034,62 @@ var AppController_default = [
3020
3034
  name: "encryptedEnv",
3021
3035
  type: "bytes",
3022
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
+ ]
3023
3093
  }
3024
3094
  ]
3025
3095
  }
@@ -3085,6 +3155,62 @@ var AppController_default = [
3085
3155
  name: "encryptedEnv",
3086
3156
  type: "bytes",
3087
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
+ ]
3088
3214
  }
3089
3215
  ]
3090
3216
  }
@@ -3098,6 +3224,44 @@ var AppController_default = [
3098
3224
  ],
3099
3225
  stateMutability: "nonpayable"
3100
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
+ },
3101
3265
  {
3102
3266
  type: "function",
3103
3267
  name: "domainSeparator",
@@ -3132,26 +3296,26 @@ var AppController_default = [
3132
3296
  },
3133
3297
  {
3134
3298
  type: "function",
3135
- name: "getBillingType",
3299
+ name: "getAppCreator",
3136
3300
  inputs: [
3137
3301
  {
3138
3302
  name: "app",
3139
3303
  type: "address",
3140
- internalType: "address"
3304
+ internalType: "contractIApp"
3141
3305
  }
3142
3306
  ],
3143
3307
  outputs: [
3144
3308
  {
3145
3309
  name: "",
3146
- type: "uint8",
3147
- internalType: "uint8"
3310
+ type: "address",
3311
+ internalType: "address"
3148
3312
  }
3149
3313
  ],
3150
3314
  stateMutability: "view"
3151
3315
  },
3152
3316
  {
3153
3317
  type: "function",
3154
- name: "getAppCreator",
3318
+ name: "getAppLatestReleaseBlockNumber",
3155
3319
  inputs: [
3156
3320
  {
3157
3321
  name: "app",
@@ -3162,15 +3326,15 @@ var AppController_default = [
3162
3326
  outputs: [
3163
3327
  {
3164
3328
  name: "",
3165
- type: "address",
3166
- internalType: "address"
3329
+ type: "uint32",
3330
+ internalType: "uint32"
3167
3331
  }
3168
3332
  ],
3169
3333
  stateMutability: "view"
3170
3334
  },
3171
3335
  {
3172
3336
  type: "function",
3173
- name: "getAppLatestReleaseBlockNumber",
3337
+ name: "getAppOperatorSetId",
3174
3338
  inputs: [
3175
3339
  {
3176
3340
  name: "app",
@@ -3189,7 +3353,7 @@ var AppController_default = [
3189
3353
  },
3190
3354
  {
3191
3355
  type: "function",
3192
- name: "getAppOperatorSetId",
3356
+ name: "getAppPendingReleaseBlockNumber",
3193
3357
  inputs: [
3194
3358
  {
3195
3359
  name: "app",
@@ -3266,6 +3430,11 @@ var AppController_default = [
3266
3430
  type: "uint32",
3267
3431
  internalType: "uint32"
3268
3432
  },
3433
+ {
3434
+ name: "pendingReleaseBlockNumber",
3435
+ type: "uint32",
3436
+ internalType: "uint32"
3437
+ },
3269
3438
  {
3270
3439
  name: "status",
3271
3440
  type: "uint8",
@@ -3322,6 +3491,11 @@ var AppController_default = [
3322
3491
  type: "uint32",
3323
3492
  internalType: "uint32"
3324
3493
  },
3494
+ {
3495
+ name: "pendingReleaseBlockNumber",
3496
+ type: "uint32",
3497
+ internalType: "uint32"
3498
+ },
3325
3499
  {
3326
3500
  name: "status",
3327
3501
  type: "uint8",
@@ -3378,6 +3552,11 @@ var AppController_default = [
3378
3552
  type: "uint32",
3379
3553
  internalType: "uint32"
3380
3554
  },
3555
+ {
3556
+ name: "pendingReleaseBlockNumber",
3557
+ type: "uint32",
3558
+ internalType: "uint32"
3559
+ },
3381
3560
  {
3382
3561
  name: "status",
3383
3562
  type: "uint8",
@@ -3434,6 +3613,11 @@ var AppController_default = [
3434
3613
  type: "uint32",
3435
3614
  internalType: "uint32"
3436
3615
  },
3616
+ {
3617
+ name: "pendingReleaseBlockNumber",
3618
+ type: "uint32",
3619
+ internalType: "uint32"
3620
+ },
3437
3621
  {
3438
3622
  name: "status",
3439
3623
  type: "uint8",
@@ -3446,51 +3630,1413 @@ var AppController_default = [
3446
3630
  },
3447
3631
  {
3448
3632
  type: "function",
3449
- name: "getMaxActiveAppsPerUser",
3633
+ name: "getBillingAccount",
3450
3634
  inputs: [
3451
3635
  {
3452
- name: "user",
3636
+ name: "app",
3453
3637
  type: "address",
3454
- internalType: "address"
3638
+ internalType: "contractIApp"
3455
3639
  }
3456
3640
  ],
3457
3641
  outputs: [
3458
3642
  {
3459
3643
  name: "",
3460
- type: "uint32",
3461
- internalType: "uint32"
3644
+ type: "address",
3645
+ internalType: "address"
3462
3646
  }
3463
3647
  ],
3464
3648
  stateMutability: "view"
3465
3649
  },
3466
3650
  {
3467
3651
  type: "function",
3468
- name: "globalActiveAppCount",
3469
- inputs: [],
3652
+ name: "getBillingType",
3653
+ inputs: [
3654
+ {
3655
+ name: "app",
3656
+ type: "address",
3657
+ internalType: "contractIApp"
3658
+ }
3659
+ ],
3470
3660
  outputs: [
3471
3661
  {
3472
3662
  name: "",
3473
- type: "uint32",
3474
- internalType: "uint32"
3663
+ type: "uint8",
3664
+ internalType: "enumIAppController.BillingType"
3475
3665
  }
3476
3666
  ],
3477
3667
  stateMutability: "view"
3478
3668
  },
3479
3669
  {
3480
3670
  type: "function",
3481
- name: "initialize",
3671
+ name: "getMaxActiveAppsPerUser",
3482
3672
  inputs: [
3483
3673
  {
3484
- name: "admin",
3674
+ name: "user",
3485
3675
  type: "address",
3486
3676
  internalType: "address"
3487
3677
  }
3488
3678
  ],
3489
- outputs: [],
3490
- stateMutability: "nonpayable"
3491
- },
3492
- {
3493
- 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",
3494
5040
  name: "maxGlobalActiveApps",
3495
5041
  inputs: [],
3496
5042
  outputs: [
@@ -4515,6 +6061,38 @@ var PermissionController_default = [
4515
6061
  ];
4516
6062
 
4517
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
+ }
4518
6096
  function formatETH(wei) {
4519
6097
  const eth = Number(wei) / 1e18;
4520
6098
  const costStr = eth.toFixed(6);
@@ -4552,7 +6130,7 @@ async function calculateAppID(options) {
4552
6130
  const saltHex = `0x${paddedSaltHex}`;
4553
6131
  const appID = await publicClient.readContract({
4554
6132
  address: environmentConfig.appControllerAddress,
4555
- abi: AppController_default,
6133
+ abi: appControllerAbiFor(environmentConfig),
4556
6134
  functionName: "calculateAppId",
4557
6135
  args: [ownerAddress, saltHex]
4558
6136
  });
@@ -4576,22 +6154,12 @@ async function prepareDeployBatch(options, logger = noopLogger) {
4576
6154
  const saltHexString = bytesToHex(salt).slice(2);
4577
6155
  const paddedSaltHex = saltHexString.padStart(64, "0");
4578
6156
  const saltHex = `0x${paddedSaltHex}`;
4579
- const releaseForViem = {
4580
- rmsRelease: {
4581
- artifacts: release.rmsRelease.artifacts.map((artifact) => ({
4582
- digest: `0x${bytesToHex(artifact.digest).slice(2).padStart(64, "0")}`,
4583
- registry: artifact.registry
4584
- })),
4585
- upgradeByTime: release.rmsRelease.upgradeByTime
4586
- },
4587
- publicEnv: bytesToHex(release.publicEnv),
4588
- encryptedEnv: bytesToHex(release.encryptedEnv)
4589
- };
6157
+ const release_ = releaseForViem(release, environmentConfig);
4590
6158
  const functionName = options.billTo === "app" ? "createAppWithIsolatedBilling" : "createApp";
4591
6159
  const createData = encodeFunctionData2({
4592
- abi: AppController_default,
6160
+ abi: appControllerAbiFor(environmentConfig),
4593
6161
  functionName,
4594
- args: [saltHex, releaseForViem]
6162
+ args: [saltHex, release_]
4595
6163
  });
4596
6164
  const acceptAdminData = encodeFunctionData2({
4597
6165
  abi: PermissionController_default,
@@ -4847,21 +6415,11 @@ async function prepareUpgradeBatch(options) {
4847
6415
  publicLogs,
4848
6416
  needsPermissionChange
4849
6417
  } = options;
4850
- const releaseForViem = {
4851
- rmsRelease: {
4852
- artifacts: release.rmsRelease.artifacts.map((artifact) => ({
4853
- digest: `0x${bytesToHex(artifact.digest).slice(2).padStart(64, "0")}`,
4854
- registry: artifact.registry
4855
- })),
4856
- upgradeByTime: release.rmsRelease.upgradeByTime
4857
- },
4858
- publicEnv: bytesToHex(release.publicEnv),
4859
- encryptedEnv: bytesToHex(release.encryptedEnv)
4860
- };
6418
+ const release_ = releaseForViem(release, environmentConfig);
4861
6419
  const upgradeData = encodeFunctionData2({
4862
- abi: AppController_default,
6420
+ abi: appControllerAbiFor(environmentConfig),
4863
6421
  functionName: "upgradeApp",
4864
- args: [appID, releaseForViem]
6422
+ args: [appID, release_]
4865
6423
  });
4866
6424
  const executions = [
4867
6425
  {
@@ -4995,7 +6553,7 @@ ${pendingMessage}`);
4995
6553
  if (callError.data) {
4996
6554
  try {
4997
6555
  const decoded = decodeErrorResult2({
4998
- abi: AppController_default,
6556
+ abi: appControllerAbiFor(environmentConfig),
4999
6557
  data: callError.data
5000
6558
  });
5001
6559
  const formattedError = formatAppControllerError(decoded);
@@ -5048,7 +6606,7 @@ function formatAppControllerError(decoded) {
5048
6606
  async function getActiveAppCount(publicClient, environmentConfig, user) {
5049
6607
  const count = await publicClient.readContract({
5050
6608
  address: environmentConfig.appControllerAddress,
5051
- abi: AppController_default,
6609
+ abi: appControllerAbiFor(environmentConfig),
5052
6610
  functionName: "getActiveAppCount",
5053
6611
  args: [user]
5054
6612
  });
@@ -5057,7 +6615,7 @@ async function getActiveAppCount(publicClient, environmentConfig, user) {
5057
6615
  async function getMaxActiveAppsPerUser(publicClient, environmentConfig, user) {
5058
6616
  const quota = await publicClient.readContract({
5059
6617
  address: environmentConfig.appControllerAddress,
5060
- abi: AppController_default,
6618
+ abi: appControllerAbiFor(environmentConfig),
5061
6619
  functionName: "getMaxActiveAppsPerUser",
5062
6620
  args: [user]
5063
6621
  });
@@ -5066,7 +6624,7 @@ async function getMaxActiveAppsPerUser(publicClient, environmentConfig, user) {
5066
6624
  async function getAppsByCreator(publicClient, environmentConfig, creator, offset, limit) {
5067
6625
  const result = await publicClient.readContract({
5068
6626
  address: environmentConfig.appControllerAddress,
5069
- abi: AppController_default,
6627
+ abi: appControllerAbiFor(environmentConfig),
5070
6628
  functionName: "getAppsByCreator",
5071
6629
  args: [creator, offset, limit]
5072
6630
  });
@@ -5078,7 +6636,7 @@ async function getAppsByCreator(publicClient, environmentConfig, creator, offset
5078
6636
  async function getAppsByDeveloper(publicClient, environmentConfig, developer, offset, limit) {
5079
6637
  const result = await publicClient.readContract({
5080
6638
  address: environmentConfig.appControllerAddress,
5081
- abi: AppController_default,
6639
+ abi: appControllerAbiFor(environmentConfig),
5082
6640
  functionName: "getAppsByDeveloper",
5083
6641
  args: [developer, offset, limit]
5084
6642
  });
@@ -5090,7 +6648,7 @@ async function getAppsByDeveloper(publicClient, environmentConfig, developer, of
5090
6648
  async function getBillingType(publicClient, environmentConfig, app) {
5091
6649
  const result = await publicClient.readContract({
5092
6650
  address: environmentConfig.appControllerAddress,
5093
- abi: AppController_default,
6651
+ abi: appControllerAbiFor(environmentConfig),
5094
6652
  functionName: "getBillingType",
5095
6653
  args: [app]
5096
6654
  });
@@ -5099,7 +6657,7 @@ async function getBillingType(publicClient, environmentConfig, app) {
5099
6657
  async function getAppsByBillingAccount(publicClient, environmentConfig, account, offset, limit) {
5100
6658
  const result = await publicClient.readContract({
5101
6659
  address: environmentConfig.appControllerAddress,
5102
- abi: AppController_default,
6660
+ abi: appControllerAbiFor(environmentConfig),
5103
6661
  functionName: "getAppsByBillingAccount",
5104
6662
  args: [account, offset, limit]
5105
6663
  });
@@ -5131,7 +6689,7 @@ async function getAllAppsByDeveloper(publicClient, env, developer, pageSize = 10
5131
6689
  async function suspend(options, logger = noopLogger) {
5132
6690
  const { walletClient, publicClient, environmentConfig, account, apps } = options;
5133
6691
  const suspendData = encodeFunctionData2({
5134
- abi: AppController_default,
6692
+ abi: appControllerAbiFor(environmentConfig),
5135
6693
  functionName: "suspend",
5136
6694
  args: [account, apps]
5137
6695
  });
@@ -5558,6 +7116,7 @@ export {
5558
7116
  BillingApiClient,
5559
7117
  BillingSessionError,
5560
7118
  BuildApiClient,
7119
+ EMPTY_CONTAINER_POLICY,
5561
7120
  SessionError,
5562
7121
  UserApiClient,
5563
7122
  addHexPrefix,