/** * Shelby contract error codes from Move modules. * * These error codes are returned by the Shelby Move contracts when * transactions fail due to validation or authorization errors. * * @see move/shelby_contract/sources/blob_metadata.move */ declare const ShelbyErrorCodes: { readonly E_BLOB_NOT_FOUND: "E_BLOB_NOT_FOUND"; readonly E_TEST_ENCODING_NOT_ALLOWED: "E_TEST_ENCODING_NOT_ALLOWED"; readonly E_INVALID_CHUNKSET_COUNT: "E_INVALID_CHUNKSET_COUNT"; readonly E_NOT_BLOB_OWNER: "E_NOT_BLOB_OWNER"; readonly E_NOT_ADMIN: "E_NOT_ADMIN"; readonly E_BLOB_NAME_TOO_LONG: "E_BLOB_NAME_TOO_LONG"; readonly E_NO_SLICES_AVAILABLE: "E_NO_SLICES_AVAILABLE"; readonly EALREADY_EXISTS: "EALREADY_EXISTS"; }; /** * Check if an error message indicates a blob already exists on chain. * * This occurs when trying to register a blob with a name that's already * registered under the same account. * * @param errorMessage - The error message from a failed transaction * @returns true if the error indicates the blob already exists */ declare function isBlobAlreadyExistsError(errorMessage: string): boolean; /** * Check if an error message indicates an access/permission denied error. * * This covers scenarios where the caller doesn't have permission to * perform the requested operation on a blob or account. * * @param errorMessage - The error message from a failed transaction * @returns true if the error indicates access was denied */ declare function isAccessDeniedError(errorMessage: string): boolean; /** * Check if an error message indicates the blob was not found. * * @param errorMessage - The error message from a failed transaction * @returns true if the error indicates the blob doesn't exist */ declare function isBlobNotFoundError(errorMessage: string): boolean; /** * Error codes raised while resolving the location a write lands in. * * @see move/shelby_contract/sources/location.move * @see move/shelby_contract/sources/location_preference.move */ declare const ShelbyLocationErrorCodes: { readonly E_LOCATION_NOT_FOUND: "E_LOCATION_NOT_FOUND"; readonly E_SELECTED_LOCATION_CONFLICTS_WITH_LOCK: "E_SELECTED_LOCATION_CONFLICTS_WITH_LOCK"; readonly E_NO_LOCATION_SELECTED: "E_NO_LOCATION_SELECTED"; readonly E_LOCATION_WRITES_FROZEN: "E_LOCATION_WRITES_FROZEN"; readonly E_LOCATION_NOT_ACTIVATED: "E_LOCATION_NOT_ACTIVATED"; }; /** * Translate a failed-write error into a human-readable explanation when it stems * from on-chain location resolution, or `undefined` when the failure is unrelated * to locations. */ declare function describeLocationError(errorMessage: string): string | undefined; export { ShelbyErrorCodes, ShelbyLocationErrorCodes, describeLocationError, isAccessDeniedError, isBlobAlreadyExistsError, isBlobNotFoundError };