@elisym/sdk 0.17.0 → 0.18.1

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/index.cjs CHANGED
@@ -3046,6 +3046,32 @@ var ElisymClient = class {
3046
3046
  this.pool.close();
3047
3047
  }
3048
3048
  };
3049
+
3050
+ // src/services/jobErrors.ts
3051
+ var AGENT_UNAVAILABLE_MARKERS = [
3052
+ "agent temporarily unavailable",
3053
+ "internal processing error",
3054
+ "invalid x-api-key",
3055
+ "invalid api key",
3056
+ "invalid_api_key",
3057
+ "x-api-key",
3058
+ "credit balance",
3059
+ "billing",
3060
+ "insufficient",
3061
+ "insufficient_quota",
3062
+ "authentication_error",
3063
+ "unauthorized",
3064
+ "unauthenticated"
3065
+ ];
3066
+ function classifyJobError(message) {
3067
+ const lower = message.toLowerCase();
3068
+ for (const marker of AGENT_UNAVAILABLE_MARKERS) {
3069
+ if (lower.includes(marker)) {
3070
+ return "agent-unavailable";
3071
+ }
3072
+ }
3073
+ return "unknown";
3074
+ }
3049
3075
  var DEFAULT_COMPUTE_UNIT_LIMIT2 = 2e5;
3050
3076
  var DEFAULT_PRIORITY_FEE_PERCENTILE2 = 75;
3051
3077
  var BASE_FEE_LAMPORTS_PER_SIGNATURE = 5000n;
@@ -3611,6 +3637,7 @@ exports.assetByKey = assetByKey;
3611
3637
  exports.assetKey = assetKey;
3612
3638
  exports.buildPaymentInstructions = buildPaymentInstructions;
3613
3639
  exports.calculateProtocolFee = calculateProtocolFee;
3640
+ exports.classifyJobError = classifyJobError;
3614
3641
  exports.clearPriorityFeeCache = clearPriorityFeeCache;
3615
3642
  exports.clearProtocolConfigCache = clearProtocolConfigCache;
3616
3643
  exports.clearQuickVerifyCache = clearQuickVerifyCache;